Send SMSG_SPELLORDAMAGE_IMMUNE when target is immune to periodic aura tick
--HG-- branch : trunk
This commit is contained in:
@@ -1133,11 +1133,27 @@ bool AuraEffect::IsPeriodicTickCrit(Unit * target, Unit const * caster) const
|
|||||||
return false;
|
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
|
void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
|
||||||
{
|
{
|
||||||
if(!target->isAlive() || target->hasUnitState(UNIT_STAT_ISOLATED))
|
if(!target->isAlive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (target->hasUnitState(UNIT_STAT_ISOLATED))
|
||||||
|
{
|
||||||
|
SendTickImmune(target, caster);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch(GetAuraType())
|
switch(GetAuraType())
|
||||||
{
|
{
|
||||||
case SPELL_AURA_PERIODIC_DAMAGE:
|
case SPELL_AURA_PERIODIC_DAMAGE:
|
||||||
@@ -1153,7 +1169,10 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
|
|||||||
|
|
||||||
// Check for immune (not use charges)
|
// Check for immune (not use charges)
|
||||||
if (target->IsImmunedToDamage(GetSpellProto()))
|
if (target->IsImmunedToDamage(GetSpellProto()))
|
||||||
|
{
|
||||||
|
SendTickImmune(target, caster);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// some auras remove at specific health level or more
|
// some auras remove at specific health level or more
|
||||||
if (GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE)
|
if (GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE)
|
||||||
@@ -1276,7 +1295,10 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
|
|||||||
|
|
||||||
// Check for immune
|
// Check for immune
|
||||||
if(target->IsImmunedToDamage(GetSpellProto()))
|
if(target->IsImmunedToDamage(GetSpellProto()))
|
||||||
|
{
|
||||||
|
SendTickImmune(target, caster);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 absorb=0;
|
uint32 absorb=0;
|
||||||
uint32 resist=0;
|
uint32 resist=0;
|
||||||
@@ -1456,7 +1478,10 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
|
|||||||
|
|
||||||
// Check for immune (not use charges)
|
// Check for immune (not use charges)
|
||||||
if(target->IsImmunedToDamage(GetSpellProto()))
|
if(target->IsImmunedToDamage(GetSpellProto()))
|
||||||
|
{
|
||||||
|
SendTickImmune(target, caster);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// ignore non positive values (can be result apply spellmods to aura damage
|
// ignore non positive values (can be result apply spellmods to aura damage
|
||||||
uint32 damage = m_amount > 0 ? m_amount : 0;
|
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)
|
// Check for immune (not use charges)
|
||||||
if(target->IsImmunedToDamage(GetSpellProto()))
|
if(target->IsImmunedToDamage(GetSpellProto()))
|
||||||
|
{
|
||||||
|
SendTickImmune(target, caster);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int32 damage = m_amount > 0 ? m_amount : 0;
|
int32 damage = m_amount > 0 ? m_amount : 0;
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ class TRINITY_DLL_SPEC AuraEffect
|
|||||||
bool IsPeriodic() const { return m_isPeriodic; }
|
bool IsPeriodic() const { return m_isPeriodic; }
|
||||||
bool IsAffectedOnSpell(SpellEntry const *spell) const;
|
bool IsAffectedOnSpell(SpellEntry const *spell) const;
|
||||||
|
|
||||||
|
void SendTickImmune(Unit * target, Unit *caster) const;
|
||||||
|
|
||||||
void PeriodicTick(Unit * target, Unit * caster) const;
|
void PeriodicTick(Unit * target, Unit * caster) const;
|
||||||
void PeriodicDummyTick(Unit * target, Unit * caster) const;
|
void PeriodicDummyTick(Unit * target, Unit * caster) const;
|
||||||
Unit* GetTriggerTarget(Unit * target) const;
|
Unit* GetTriggerTarget(Unit * target) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user