diff options
author | Shauren <shauren.trinity@gmail.com> | 2021-02-21 16:10:22 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-02-21 16:10:22 +0100 |
commit | 1b8ef46808c44e68f213768c6a64ccc0048f3d65 (patch) | |
tree | d77f18d278853301f546bcbab0a9ce3c2b6d2001 /src/server/game/Spells/Spell.cpp | |
parent | b811da080c1e2a73a8f7787716b5d51ed6e6b3b6 (diff) |
Core/Auras: Reimplement SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES to properly allow casting listed spells
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a070167b440..67ac36e5f90 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4892,8 +4892,16 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint if (m_caster->GetTypeId() == TYPEID_PLAYER) { //can cast triggered (by aura only?) spells while have this flag - if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CASTER_AURASTATE) && m_caster->ToPlayer()->HasPlayerFlag(PLAYER_ALLOW_ONLY_ABILITY)) - return SPELL_FAILED_SPELL_IN_PROGRESS; + if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CASTER_AURASTATE)) + { + // These two auras check SpellFamilyName defined by db2 class data instead of current spell SpellFamilyName + if (m_caster->HasAuraType(SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES) + && !m_spellInfo->HasAttribute(SPELL_ATTR0_REQ_AMMO) + && !m_spellInfo->HasEffect(SPELL_EFFECT_ATTACK) + && !m_spellInfo->HasAttribute(SPELL_ATTR12_IGNORE_CASTING_DISABLED) + && !m_caster->HasAuraTypeWithFamilyFlags(SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES, sChrClassesStore.AssertEntry(m_caster->getClass())->SpellClassSet, m_spellInfo->SpellFamilyFlags)); + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + } // check if we are using a potion in combat for the 2nd+ time. Cooldown is added only after caster gets out of combat if (!IsIgnoringCooldowns() && m_caster->ToPlayer()->GetLastPotionId() && m_CastItem && (m_CastItem->IsPotion() || m_spellInfo->IsCooldownStartedOnEvent())) |