fix(Core/Spells): Far Sight auras are supposed to extend view distance and allows seeing objects from further distance (#7068)

- Closes #5793.
This commit is contained in:
UltraNix
2021-07-26 10:23:08 +02:00
committed by GitHub
parent 1f3a097761
commit e37dba8df6
10 changed files with 106 additions and 19 deletions

View File

@@ -125,7 +125,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS] =
&AuraEffect::HandleModPowerCost, // 73 SPELL_AURA_MOD_POWER_COST_SCHOOL
&AuraEffect::HandleNoImmediateEffect, // 74 SPELL_AURA_REFLECT_SPELLS_SCHOOL implemented in Unit::SpellHitResult
&AuraEffect::HandleNoImmediateEffect, // 75 SPELL_AURA_MOD_LANGUAGE
&AuraEffect::HandleNoImmediateEffect, // 76 SPELL_AURA_FAR_SIGHT
&AuraEffect::HandleFarSight, // 76 SPELL_AURA_FAR_SIGHT
&AuraEffect::HandleModMechanicImmunity, // 77 SPELL_AURA_MECHANIC_IMMUNITY
&AuraEffect::HandleAuraMounted, // 78 SPELL_AURA_MOUNTED
&AuraEffect::HandleModDamagePercentDone, // 79 SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
@@ -5476,6 +5476,32 @@ void AuraEffect::HandleBindSight(AuraApplication const* aurApp, uint8 mode, bool
caster->ToPlayer()->SetViewpoint(target, apply);
}
void AuraEffect::HandleFarSight(AuraApplication const* /*aurApp*/, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_REAL))
{
return;
}
Unit* caster = GetCaster();
if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
{
return;
}
Player* player = caster->ToPlayer();
if (apply)
{
player->SetFarSightDistance(m_spellInfo->GetMaxRange());
}
else
{
player->ResetFarSightDistance();
}
caster->UpdateObjectVisibility(!apply);
}
void AuraEffect::HandleForceReaction(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK))