diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index b59424b2aab..80b47953108 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -5709,8 +5709,9 @@ SpellCastResult Spell::CheckCasterAuras() const else if (m_spellInfo->EffectApplyAuraName[i] == SPELL_AURA_DISPEL_IMMUNITY) dispel_immune |= GetDispellMask(DispelType(m_spellInfo->EffectMiscValue[i])); } - // immune movement impairment and loss of control - if (m_spellInfo->Id == 42292) // PvP Trinket + + // immune movement impairment and loss of control (spell data have special structure for mark this case) + if (IsSpellRemoveAllMovementAndControlLossEffects(m_spellInfo)) mechanic_immune = IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK; } diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index b8eabbc8ca7..2b9020162e4 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -225,6 +225,18 @@ inline bool IsPassiveSpellStackableWithRanks(SpellEntry const* spellProto) return !IsSpellHaveEffect(spellProto,SPELL_EFFECT_APPLY_AURA); } +inline bool IsSpellRemoveAllMovementAndControlLossEffects(SpellEntry const* spellProto) +{ + return spellProto->EffectApplyAuraName[EFFECT_INDEX_0] == SPELL_AURA_MECHANIC_IMMUNITY && + spellProto->EffectMiscValue[EFFECT_INDEX_0] == 1 && + spellProto->EffectApplyAuraName[EFFECT_INDEX_1] == 0 && + spellProto->EffectApplyAuraName[EFFECT_INDEX_2] == 0 && + (spellProto->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)/* && -- all above selected spells have SPELL_ATTR_EX5_* mask + ((spellProto->AttributesEx5 & + (SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED|SPELL_ATTR_EX5_USABLE_WHILE_FEARED|SPELL_ATTR_EX5_USABLE_WHILE_STUNNED)) == + (SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED|SPELL_ATTR_EX5_USABLE_WHILE_FEARED|SPELL_ATTR_EX5_USABLE_WHILE_STUNNED))*/; +} + inline bool IsDeathOnlySpell(SpellEntry const *spellInfo) { return spellInfo->AttributesEx3 & SPELL_ATTR_EX3_CAST_ON_DEAD diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp index 9d464ea544a..6fe03b1c534 100644 --- a/src/game/UnitAuraProcHandler.cpp +++ b/src/game/UnitAuraProcHandler.cpp @@ -713,12 +713,9 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura SpellAuraHolderMap& Auras = pVictim->GetSpellAuraHolderMap(); for(SpellAuraHolderMap::const_iterator iter = Auras.begin(); iter != Auras.end();) { - SpellEntry const *spell = iter->second->GetSpellProto(); - - if( spell->Mechanic == MECHANIC_STUN || - iter->second->HasMechanic(MECHANIC_STUN)) + if (iter->second->HasMechanic(MECHANIC_STUN)) { - pVictim->RemoveAurasDueToSpell(spell->Id); + pVictim->RemoveAurasDueToSpell(iter->second->GetId()); iter = Auras.begin(); } else diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3504aaa7cbc..08f9ded5783 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11539" + #define REVISION_NR "11540" #endif // __REVISION_NR_H__