diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index f4f6b22ae..58b97bd1f 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4972,6 +4972,18 @@ SpellCastResult Spell::CheckCasterAuras() const prevented_reason = SPELL_FAILED_SILENCED; else if (unitflag & UNIT_FLAG_PACIFIED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY) prevented_reason = SPELL_FAILED_PACIFIED; + else if(m_caster->HasAuraType(SPELL_AURA_ALLOW_ONLY_ABILITY)) + { + Unit::AuraList const& casingLimit = m_caster->GetAurasByType(SPELL_AURA_ALLOW_ONLY_ABILITY); + for(Unit::AuraList::const_iterator itr = casingLimit.begin(); itr != casingLimit.end(); ++itr) + { + if(!IsAffectedByAura(*itr)) + { + prevented_reason = SPELL_FAILED_CASTER_AURASTATE; + break; + } + } + } // Attr must make flag drop spell totally immune from all effects if (prevented_reason != SPELL_CAST_OK) @@ -5726,7 +5738,7 @@ void Spell::UpdatePointers() m_targets.Update(m_caster); } -bool Spell::IsAffectedByAura(Aura *aura) +bool Spell::IsAffectedByAura(Aura *aura) const { return sSpellMgr.IsAffectedByMod(m_spellInfo, aura->getAuraSpellMod()); } diff --git a/src/game/Spell.h b/src/game/Spell.h index 0dc845f16..096511463 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -441,7 +441,7 @@ class Spell void UpdatePointers(); // must be used at call Spell code after time delay (non triggered spell cast/update spell call/etc) - bool IsAffectedByAura(Aura *aura); + bool IsAffectedByAura(Aura *aura) const; bool CheckTargetCreatureType(Unit* target) const; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 5649346b8..ca1ff0522 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -313,7 +313,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleNoImmediateEffect, //260 SPELL_AURA_SCREEN_EFFECT (miscvalue = id in ScreenEffect.dbc) not required any code &Aura::HandlePhase, //261 SPELL_AURA_PHASE undetectable invisibility? implemented in Unit::isVisibleForOrDetect &Aura::HandleNULL, //262 ignore combat/aura state? - &Aura::HandleNULL, //263 SPELL_AURA_ALLOW_ONLY_ABILITY player can use only abilities set in SpellClassMask + &Aura::HandleAllowOnlyAbility, //263 SPELL_AURA_ALLOW_ONLY_ABILITY player can use only abilities set in SpellClassMask &Aura::HandleUnused, //264 unused (3.0.8a-3.2.2a) &Aura::HandleUnused, //265 unused (3.0.8a-3.2.2a) &Aura::HandleUnused, //266 unused (3.0.8a-3.2.2a) @@ -7627,3 +7627,26 @@ void Aura::HandleAuraModAllCritChance(bool apply, bool Real) // included in Player::UpdateSpellCritChance calculation ((Player*)m_target)->UpdateAllSpellCritChances(); } + +void Aura::HandleAllowOnlyAbility(bool apply, bool Real) +{ + if(!Real) + return; + + if(apply) + { + m_target->setAttackTimer(BASE_ATTACK,m_duration); + m_target->setAttackTimer(RANGED_ATTACK,m_duration); + m_target->setAttackTimer(OFF_ATTACK,m_duration); + } + else + { + m_target->resetAttackTimer(BASE_ATTACK); + m_target->resetAttackTimer(RANGED_ATTACK); + m_target->resetAttackTimer(OFF_ATTACK); + } + + m_target->UpdateDamagePhysical(BASE_ATTACK); + m_target->UpdateDamagePhysical(RANGED_ATTACK); + m_target->UpdateDamagePhysical(OFF_ATTACK); +} diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 8e573d498..e4a72aaab 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -214,6 +214,7 @@ class MANGOS_DLL_SPEC Aura void HandlePhase(bool Apply, bool Real); void HandleModTargetArmorPct(bool Apply, bool Real); void HandleAuraModAllCritChance(bool Apply, bool Real); + void HandleAllowOnlyAbility(bool Apply, bool Real); virtual ~Aura(); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 01d674c21..26fa99044 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 "8955" + #define REVISION_NR "8956" #endif // __REVISION_NR_H__