diff options
author | joschiwald <joschiwald.trinity@gmail.com> | 2016-10-02 23:32:14 +0200 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2016-10-03 19:42:44 +0200 |
commit | 2b4006f80105a01419a40b773b250685ff930099 (patch) | |
tree | 0f77e4080895a5fee39dd3ab3ad0d21730054188 | |
parent | d2da56ababd01fdb459fa53546f36146e25e8523 (diff) |
Core/Spells: fixed SPELL_ATTR5_USABLE_WHILE_STUNNED
(cherry picked from commit 625ca6ec1ca524f7435b34408470c9a04b675566)
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6c84bf3e964..9e733dbfdd2 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5721,20 +5721,27 @@ SpellCastResult Spell::CheckCasterAuras() const uint32 unitflag = m_caster->GetUInt32Value(UNIT_FIELD_FLAGS); // Get unit state if (unitflag & UNIT_FLAG_STUNNED) { - // spell is usable while stunned, check if caster has only mechanic stun auras, another stun types must prevent cast spell + // spell is usable while stunned, check if caster has allowed stun auras, another stun types must prevent cast spell if (usableInStun) { + static uint32 const allowedStunMask = + 1 << MECHANIC_STUN + | 1 << MECHANIC_FREEZE + | 1 << MECHANIC_SAPPED + | 1 << MECHANIC_SLEEP; + bool foundNotStun = false; Unit::AuraEffectList const& stunAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_STUN); for (Unit::AuraEffectList::const_iterator i = stunAuras.begin(); i != stunAuras.end(); ++i) { - if ((*i)->GetSpellInfo()->GetAllEffectsMechanicMask() && !((*i)->GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << MECHANIC_STUN))) + uint32 mechanicMask = (*i)->GetSpellInfo()->GetAllEffectsMechanicMask(); + if (mechanicMask && !(mechanicMask & allowedStunMask)) { foundNotStun = true; break; } } - if (foundNotStun && m_spellInfo->Id != 22812) + if (foundNotStun) prevented_reason = SPELL_FAILED_STUNNED; } else |