Skip to content

Commit

Permalink
[11540] Fixed spell 59752 and some other impossibility cast in stun l…
Browse files Browse the repository at this point in the history
…ike states.

Original patch provided by darkstalker.
  • Loading branch information
VladimirMangos committed May 25, 2011
1 parent db3727c commit c144524
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/game/Spell.cpp
Expand Up @@ -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;
}

Expand Down
12 changes: 12 additions & 0 deletions src/game/SpellMgr.h
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions src/game/UnitAuraProcHandler.cpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion 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__

0 comments on commit c144524

Please sign in to comment.