mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8956] Implement aura SPELL_AURA_ALLOW_ONLY_ABILITY.
(cherry picked from commit f4d1e05) Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
d3b19f8aa4
commit
0ec0f34be7
5 changed files with 40 additions and 4 deletions
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8955"
|
||||
#define REVISION_NR "8956"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue