From b55ebc186ddec46843277c8ccf3059a2bdf18b37 Mon Sep 17 00:00:00 2001 From: Dan <83884799+elthehablo@users.noreply.github.com> Date: Tue, 18 Jul 2023 13:45:58 +0200 Subject: [PATCH] fix(Scripts/TempleOfAhnQiraj): make C'thun Dark Glare face location of last eyebeam before cast, instead of random target (#16785) * initial * fix oopsie * whitespace --- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index df615ef0d..306c6c569 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -242,7 +242,11 @@ struct boss_eye_of_cthun : public BossAI { scheduler.Schedule(5s, [this](TaskContext task) { - DoCastRandomTarget(SPELL_GREEN_BEAM); + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true)) + { + DoCast(target, SPELL_GREEN_BEAM); + DarkGlareAngle = me->GetAngle(target); //keep as the location dark glare will be at + } task.SetGroup(GROUP_BEAM_PHASE); task.Repeat(3s); @@ -284,21 +288,18 @@ struct boss_eye_of_cthun : public BossAI scheduler.Schedule(1s, [this](TaskContext /*task*/) { - //Select random target for dark beam to start on - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true)) - { - //Face our target - DarkGlareAngle = me->GetAngle(target); - DarkGlareTick = 0; - ClockWise = RAND(true, false); + //Select last target that had a beam cast on it + //Face our target - //Add red coloration to C'thun - DoCast(me, SPELL_RED_COLORATION, true); + DarkGlareTick = 0; + ClockWise = RAND(true, false); - me->StopMoving(); - me->SetFacingToObject(target); - me->SetOrientation(DarkGlareAngle); - } + //Add red coloration to C'thun + DoCast(me, SPELL_RED_COLORATION, true); + + me->StopMoving(); + me->SetOrientation(DarkGlareAngle); + me->SetFacingTo(DarkGlareAngle); scheduler.Schedule(3s, [this](TaskContext tasker) {