Send SMSG_SPELLORDAMAGE_IMMUNE when target is immune to periodic aura tick

--HG--
branch : trunk
This commit is contained in:
thenecromancer
2010-01-24 15:20:32 +01:00
parent 6c24f75524
commit 963731abc8
2 changed files with 31 additions and 1 deletions
+29 -1
View File
@@ -1133,11 +1133,27 @@ bool AuraEffect::IsPeriodicTickCrit(Unit * target, Unit const * caster) const
return false;
}
void AuraEffect::SendTickImmune(Unit * target, Unit *caster) const
{
WorldPacket data(SMSG_SPELLORDAMAGE_IMMUNE, 8+8+4+1);
data << uint64(caster ? caster->GetGUID() : target->GetGUID());
data << uint64(target->GetGUID());
data << uint32(m_spellProto->Id);
data << uint8(1);
target->SendMessageToSet(&data,true);
}
void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
{
if(!target->isAlive() || target->hasUnitState(UNIT_STAT_ISOLATED))
if(!target->isAlive())
return;
if (target->hasUnitState(UNIT_STAT_ISOLATED))
{
SendTickImmune(target, caster);
return;
}
switch(GetAuraType())
{
case SPELL_AURA_PERIODIC_DAMAGE:
@@ -1153,7 +1169,10 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
// Check for immune (not use charges)
if (target->IsImmunedToDamage(GetSpellProto()))
{
SendTickImmune(target, caster);
break;
}
// some auras remove at specific health level or more
if (GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE)
@@ -1276,7 +1295,10 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
// Check for immune
if(target->IsImmunedToDamage(GetSpellProto()))
{
SendTickImmune(target, caster);
return;
}
uint32 absorb=0;
uint32 resist=0;
@@ -1456,7 +1478,10 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
// Check for immune (not use charges)
if(target->IsImmunedToDamage(GetSpellProto()))
{
SendTickImmune(target, caster);
break;
}
// ignore non positive values (can be result apply spellmods to aura damage
uint32 damage = m_amount > 0 ? m_amount : 0;
@@ -1607,7 +1632,10 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
// Check for immune (not use charges)
if(target->IsImmunedToDamage(GetSpellProto()))
{
SendTickImmune(target, caster);
return;
}
int32 damage = m_amount > 0 ? m_amount : 0;
+2
View File
@@ -67,6 +67,8 @@ class TRINITY_DLL_SPEC AuraEffect
bool IsPeriodic() const { return m_isPeriodic; }
bool IsAffectedOnSpell(SpellEntry const *spell) const;
void SendTickImmune(Unit * target, Unit *caster) const;
void PeriodicTick(Unit * target, Unit * caster) const;
void PeriodicDummyTick(Unit * target, Unit * caster) const;
Unit* GetTriggerTarget(Unit * target) const;