aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortobmaps <spambot42@yandex.ru>2011-05-11 01:46:13 +0700
committertobmaps <spambot42@yandex.ru>2011-05-11 01:46:13 +0700
commitce7f024945b01052415201f86ad9108c1845f291 (patch)
treef9b3036cc794005e16806b45be172c883257abff
parent8fc000b216bd1bb1935bf226b085acd2a6299fe7 (diff)
Core/Spells: Implement SPELL_ATTR4_DAMAGE_DOESNT_BREAK_AURAS. Damage from spells with this attribute flag shouldn't break breakable by damage auras
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp8
-rwxr-xr-xsrc/server/game/Miscellaneous/SharedDefines.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index c3876b6169f..78d23dfe870 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -591,7 +591,13 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
if (damagetype != NODAMAGE)
{
// 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
// Let's copy the list so we can prevent iterator invalidation
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 2041b0e6e6f..66f059c26c4 100755
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -421,7 +421,7 @@ enum SpellAttr4
SPELL_ATTR4_UNK11 = 0x00000800, // 11
SPELL_ATTR4_UNK12 = 0x00001000, // 12
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_NOT_USABLE_IN_ARENA = 0x00010000, // 16 not usable in arena
SPELL_ATTR4_USABLE_IN_ARENA = 0x00020000, // 17 usable in arena