Core/Spells: Implement SPELL_ATTR4_DAMAGE_DOESNT_BREAK_AURAS. Damage from spells with this attribute flag shouldn't break breakable by damage auras

This commit is contained in:
tobmaps
2011-05-11 01:46:13 +07:00
parent 8fc000b216
commit ce7f024945
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -591,7 +591,13 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
if (damagetype != NODAMAGE) if (damagetype != NODAMAGE)
{ {
// interrupting auras with AURA_INTERRUPT_FLAG_DAMAGE before checking !damage (absorbed damage breaks that type of auras) // interrupting auras with AURA_INTERRUPT_FLAG_DAMAGE before checking !damage (absorbed damage breaks that type of auras)
pVictim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TAKE_DAMAGE, spellProto ? spellProto->Id : 0); if (spellProto)
{
if (!(spellProto->AttributesEx4 & SPELL_ATTR4_DAMAGE_DOESNT_BREAK_AURAS))
pVictim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TAKE_DAMAGE, spellProto->Id);
}
else
pVictim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TAKE_DAMAGE, 0);
// We're going to call functions which can modify content of the list during iteration over it's elements // We're going to call functions which can modify content of the list during iteration over it's elements
// Let's copy the list so we can prevent iterator invalidation // Let's copy the list so we can prevent iterator invalidation
@@ -421,7 +421,7 @@ enum SpellAttr4
SPELL_ATTR4_UNK11 = 0x00000800, // 11 SPELL_ATTR4_UNK11 = 0x00000800, // 11
SPELL_ATTR4_UNK12 = 0x00001000, // 12 SPELL_ATTR4_UNK12 = 0x00001000, // 12
SPELL_ATTR4_UNK13 = 0x00002000, // 13 SPELL_ATTR4_UNK13 = 0x00002000, // 13
SPELL_ATTR4_UNK14 = 0x00004000, // 14 SPELL_ATTR4_DAMAGE_DOESNT_BREAK_AURAS = 0x00004000, // 14 doesn't break auras by damage from these spells
SPELL_ATTR4_UNK15 = 0x00008000, // 15 SPELL_ATTR4_UNK15 = 0x00008000, // 15
SPELL_ATTR4_NOT_USABLE_IN_ARENA = 0x00010000, // 16 not usable in arena SPELL_ATTR4_NOT_USABLE_IN_ARENA = 0x00010000, // 16 not usable in arena
SPELL_ATTR4_USABLE_IN_ARENA = 0x00020000, // 17 usable in arena SPELL_ATTR4_USABLE_IN_ARENA = 0x00020000, // 17 usable in arena