From d42a74a9a5e8a741596e91b40b0616006156056d Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Wed, 20 Jul 2022 14:01:18 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts\TempleOfAhnQiraj):=20C'thun=20shoul?= =?UTF-8?q?d=20aggro=20as=20soon=20as=20you=20eit=E2=80=A6=20(#12429)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index cffb86012..c262aafe2 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -195,6 +195,18 @@ public: instance->SetData(DATA_CTHUN_PHASE, PHASE_EYE_GREEN_BEAM); } + void MoveInLineOfSight(Unit* who) override + { + if (who->GetTypeId() == TYPEID_PLAYER && !me->IsInCombat()) + { + // Z checks are necessary here because AQ maps do funky stuff. + if (me->IsWithinLOSInMap(who) && me->IsWithinDist2d(who, 50.0f) && who->GetPositionZ() > 100.0f) + { + AttackStart(who); + } + } + } + void DoAction(int32 action) override { if (action == ACTION_SPAWN_EYE_TENTACLES)