fix(Core/Spells): Improvements to Far Sight spell: (#11683)

* fix(Core/Spells): Improvements to Far Sight spell:

Far Sight should not interrupt while casting another spell.
Corrected setting Far Sight object as an active object.
Fixed grid activation range for active dynamic objects.
When Far Sight is over, the camera be reset to player.
Enable swapping camera between Far Sight and Sentry Totem.
Fixes #6368

* Update.

* Update.
This commit is contained in:
UltraNix
2022-05-23 09:26:51 +02:00
committed by GitHub
parent 0c209dae75
commit 99f1cd84e2
12 changed files with 127 additions and 39 deletions

View File

@@ -2719,6 +2719,9 @@ void Spell::EffectAddFarsight(SpellEffIndex effIndex)
if (!m_caster->IsInWorld())
return;
// Remove old farsight if exist
bool updateViewerVisibility = m_caster->RemoveDynObject(m_spellInfo->Id);
DynamicObject* dynObj = new DynamicObject(true);
if (!dynObj->CreateDynamicObject(m_caster->GetMap()->GenerateLowGuid<HighGuid::DynamicObject>(), m_caster, m_spellInfo->Id, *destTarget, radius, DYNAMIC_OBJECT_FARSIGHT_FOCUS))
{
@@ -2727,9 +2730,7 @@ void Spell::EffectAddFarsight(SpellEffIndex effIndex)
}
dynObj->SetDuration(duration);
dynObj->SetCasterViewpoint();
m_caster->ToPlayer()->UpdateVisibilityForPlayer();
dynObj->SetCasterViewpoint(updateViewerVisibility);
}
void Spell::EffectUntrainTalents(SpellEffIndex /*effIndex*/)