Core/Auras: Implement SPELL_AURA_DETECT_AMORE (#19955)

Based on b58b29c958

(cherry picked from commit a27a3e0457)
This commit is contained in:
Gustavo
2017-07-06 16:32:10 -03:00
committed by Shauren
parent 94e164f9c9
commit d50611c108
2 changed files with 36 additions and 1 deletions

View File

@@ -236,7 +236,7 @@ NonDefaultConstructible<pAuraEffectHandler> AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleAuraModRangedAttackPowerPercent, //167 SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT
&AuraEffect::HandleNoImmediateEffect, //168 SPELL_AURA_MOD_DAMAGE_DONE_VERSUS implemented in Unit::SpellDamageBonus, Unit::MeleeDamageBonus
&AuraEffect::HandleUnused, //169 Unused (4.3.4) old SPELL_AURA_MOD_CRIT_PERCENT_VERSUS
&AuraEffect::HandleNULL, //170 SPELL_AURA_DETECT_AMORE various spells that change visual of units for aura target (clientside?)
&AuraEffect::HandleDetectAmore, //170 SPELL_AURA_DETECT_AMORE used to detect various spells that change visual of units for aura target
&AuraEffect::HandleAuraModIncreaseSpeed, //171 SPELL_AURA_MOD_SPEED_NOT_STACK
&AuraEffect::HandleAuraModIncreaseMountedSpeed, //172 SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK
&AuraEffect::HandleUnused, //173 unused (4.3.4) no spells, old SPELL_AURA_ALLOW_CHAMPION_SPELLS only for Proclaim Champion spell
@@ -1582,6 +1582,40 @@ void AuraEffect::HandleModStealthLevel(AuraApplication const* aurApp, uint8 mode
target->UpdateObjectVisibility();
}
void AuraEffect::HandleDetectAmore(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK))
return;
Unit* target = aurApp->GetTarget();
if (target->GetTypeId() != TYPEID_PLAYER)
return;
if (apply)
{
if (Player* playerTarget = target->ToPlayer())
{
playerTarget->AddAuraVision(PlayerFieldByte2Flags(1 << (GetMiscValue() - 1)));
}
}
else
{
if (target->HasAuraType(SPELL_AURA_DETECT_AMORE))
{
Unit::AuraEffectList const& amoreAuras = target->GetAuraEffectsByType(SPELL_AURA_DETECT_AMORE);
for (Unit::AuraEffectList::const_iterator i = amoreAuras.begin(); i != amoreAuras.end(); ++i)
{
if (GetMiscValue() == (*i)->GetMiscValue())
return;
}
}
if (Player* playerTarget = target->ToPlayer())
playerTarget->RemoveAuraVision(PlayerFieldByte2Flags(1 << (GetMiscValue() - 1)));
}
}
void AuraEffect::HandleSpiritOfRedemption(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_REAL))

View File

@@ -150,6 +150,7 @@ class TC_GAME_API AuraEffect
void HandleModStealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleModStealthLevel(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleModStealthDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleDetectAmore(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleSpiritOfRedemption(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraGhost(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandlePhase(AuraApplication const* aurApp, uint8 mode, bool apply) const;