From d76ca96795260de466f55fe6f6cd5b63f0bb7dc8 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Wed, 21 Feb 2024 08:33:05 -0300 Subject: [PATCH] fix(Scripts/TheEye): Fix Capernian chase distance (#18372) * fix(Scripts/TheEye): Fix Capernian chase distance * Update boss_kaelthas.cpp --- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 2a6e759ced98e4..c822eafc9f0c03 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -824,6 +824,18 @@ struct npc_capernian : public ScriptedAI me->SetReactState(REACT_PASSIVE); } + void AttackStart(Unit* who) override + { + if (who && who->isTargetableForAttack() && me->GetReactState() != REACT_PASSIVE) + { + if (me->Attack(who, false)) + { + me->GetMotionMaster()->MoveChase(who, 45.0f, 0); + me->AddThreat(who, 0.0f); + } + } + } + void JustEngagedWith(Unit* /*who*/) override { if (!_hasDied) @@ -831,7 +843,17 @@ struct npc_capernian : public ScriptedAI Talk(SAY_CAPERNIAN_AGGRO); } ScheduleTimedEvent(0ms, [&]{ - DoCastVictim(SPELL_CAPERNIAN_FIREBALL); + + if (!me->CanCastSpell(SPELL_CAPERNIAN_FIREBALL)) + { + me->ResumeChasingVictim(); + } + else + { + me->GetMotionMaster()->MoveChase(me->GetVictim(), 45.0f); + DoCastVictim(SPELL_CAPERNIAN_FIREBALL); + } + }, 2500ms); ScheduleTimedEvent(7000ms, 10000ms, [&]{ DoCastRandomTarget(SPELL_CONFLAGRATION, 0, 30.0f);