[7195] Implement SPELL_AURA_PHASE (261) and basics of phases system work (for player/creatures/pets only)

This commit is contained in:
VladimirMangos 2009-01-27 17:00:16 +03:00
parent 700fb25407
commit 430c634fd3
7 changed files with 75 additions and 18 deletions

View file

@ -311,9 +311,9 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleNULL, //258 SPELL_AURA_MOD_SPELL_VISUAL
&Aura::HandleNULL, //259 corrupt healing over time spell
&Aura::HandleNoImmediateEffect, //260 SPELL_AURA_SCREEN_EFFECT (miscvalue = id in ScreenEffect.dbc) not required any code
&Aura::HandleNULL, //261 out of phase?
&Aura::HandlePhase, //261 SPELL_AURA_PHASE undetactable invisibility? implemented in Unit::isVisibleForOrDetect
&Aura::HandleNULL, //262
&Aura::HandleNULL, //263 SPELL_AURA_ALLOW_ONLY_ABILITY player can use only abilites set in SpellClassMask
&Aura::HandleNULL, //263 SPELL_AURA_ALLOW_ONLY_ABILITY player can use only abilities set in SpellClassMask
&Aura::HandleNULL, //264 unused
&Aura::HandleNULL, //265 unused
&Aura::HandleNULL, //266 unused
@ -6568,3 +6568,25 @@ void Aura::HandleAuraConvertRune(bool apply, bool Real)
}
}
}
void Aura::HandlePhase(bool apply, bool Real)
{
// no-phase is also phase state so same code for apply and remove
// phase auras normaly not expected at BG but anyway better check
if(Real && m_target->GetTypeId()==TYPEID_PLAYER)
{
// drop flag at invisible in bg
if(((Player*)m_target)->InBattleGround())
if(BattleGround *bg = ((Player*)m_target)->GetBattleGround())
bg->EventPlayerDroppedFlag((Player*)m_target);
}
// apply/remove only if not in GM invisibility
if(m_target->GetVisibility()!=VISIBILITY_OFF)
{
// just need triggering visibility update base at aura presence
m_target->SetVisibility(m_target->GetVisibility());
}
}