From a59dc767743384f7d2c25ae6dd1afd4e05eb9cf9 Mon Sep 17 00:00:00 2001 From: Den Date: Sun, 5 Jun 2011 19:41:38 +0400 Subject: [PATCH] [11605] Prevent use talent 33206 in stun without glyph 45760 Signed-off-by: VladimirMangos --- src/game/Spell.cpp | 13 +++++++++++-- src/shared/revision_nr.h | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 8302d5b6a..c1e38ff6f 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -5750,12 +5750,21 @@ SpellCastResult Spell::CheckCasterAuras() const // Check whether the cast should be prevented by any state you might have. SpellCastResult prevented_reason = SPELL_CAST_OK; + bool spellUsableWhileStunned = m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED; + // Have to check if there is a stun aura. Otherwise will have problems with ghost aura apply while logging out uint32 unitflag = m_caster->GetUInt32Value(UNIT_FIELD_FLAGS); // Get unit state if (unitflag & UNIT_FLAG_STUNNED) { + // Pain Suppression (have SPELL_ATTR_EX5_USABLE_WHILE_STUNNED that must be used only with glyph) + if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && m_spellInfo->SpellIconID == 2178) + { + if (!m_caster->HasAura(63248)) // Glyph of Pain Suppression + spellUsableWhileStunned = false; + } + // spell is usable while stunned, check if caster has only mechanic stun auras, another stun types must prevent cast spell - if (m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED) + if (spellUsableWhileStunned) { bool is_stun_mechanic = true; Unit::AuraList const& stunAuras = m_caster->GetAurasByType(SPELL_AURA_MOD_STUN); @@ -5822,7 +5831,7 @@ SpellCastResult Spell::CheckCasterAuras() const switch(aura->GetModifier()->m_auraname) { case SPELL_AURA_MOD_STUN: - if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED) || !aura->HasMechanic(MECHANIC_STUN)) + if (!spellUsableWhileStunned || !aura->HasMechanic(MECHANIC_STUN)) return SPELL_FAILED_STUNNED; break; case SPELL_AURA_MOD_CONFUSE: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 31794afa9..b2ba8d5ce 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 "11604" + #define REVISION_NR "11605" #endif // __REVISION_NR_H__