[11605] Prevent use talent 33206 in stun without glyph 45760

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Den 2011-06-05 19:41:38 +04:00 committed by VladimirMangos
parent d99e9dc611
commit a59dc76774
2 changed files with 12 additions and 3 deletions

View file

@ -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:

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11604"
#define REVISION_NR "11605"
#endif // __REVISION_NR_H__