From 0c90bfcf70c3ff60364c6b0df97aef23f8781efa Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 4 Sep 2023 21:15:18 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/Karazhan):=20Remove=20redundant=20G?= =?UTF-8?q?arrote=20cast=20and=20despawn=20gues=E2=80=A6=20(#17152)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/Karazhan): Remove redundant Garrote cast and despawn guests on evade --- .../scripts/EasternKingdoms/Karazhan/boss_moroes.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 358678794..8456ac1d8 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -114,7 +114,7 @@ struct boss_moroes : public BossAI scheduler.Schedule(10s, GROUP_PRECOMBAT_TALK, [this](TaskContext context) { - if(Creature* guest = GetRandomGuest()) + if (Creature* guest = GetRandomGuest()) { guest->AI()->Talk(SAY_GUEST); } @@ -156,7 +156,6 @@ struct boss_moroes : public BossAI scheduler.Schedule(5s, 7s, [this](TaskContext) { me->SetImmuneToAll(false); - DoCastRandomTarget(SPELL_GARROTE, 0, 100.0f, true, true); DoCastSelf(SPELL_VANISH_TELEPORT); _vanished = false; }); @@ -178,7 +177,7 @@ struct boss_moroes : public BossAI void KilledUnit(Unit* victim) override { - if(!_recentlySpoken && victim->GetTypeId() == TYPEID_PLAYER) + if (!_recentlySpoken && victim->GetTypeId() == TYPEID_PLAYER) { Talk(SAY_KILL); _recentlySpoken = true; @@ -206,6 +205,7 @@ struct boss_moroes : public BossAI guestList.push_back(summon); } } + return Acore::Containers::SelectRandomContainerElement(guestList); } @@ -234,7 +234,7 @@ struct boss_moroes : public BossAI EnterEvadeMode(); summons.DoForAllSummons([](WorldObject* summon) { - summon->ToCreature()->AI()->EnterEvadeMode(); + summon->ToCreature()->DespawnOnEvade(5s); }); return; }