From a4c30ad72091456caa9fc7b42dcdddf189aa47d0 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Thu, 12 Dec 2024 02:09:59 -0300 Subject: [PATCH] fix(DB/Creature): Fix ZA bosses not despawning on evade (#20900) --- .../rev_1733968037822883300.sql | 2 ++ .../EasternKingdoms/ZulAman/boss_zuljin.cpp | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1733968037822883300.sql diff --git a/data/sql/updates/pending_db_world/rev_1733968037822883300.sql b/data/sql/updates/pending_db_world/rev_1733968037822883300.sql new file mode 100644 index 000000000..9b7813e2f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1733968037822883300.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `flags_extra` = `flags_extra`|2147483648 WHERE `entry` IN (23574, 23578, 24239); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index 767f1aeff..dc7e686d8 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -15,6 +15,7 @@ * with this program. If not, see . */ +#include "CreatureGroups.h" #include "CreatureScript.h" #include "Player.h" #include "ScriptedCreature.h" @@ -144,6 +145,9 @@ struct boss_zuljin : public BossAI me->SetCombatMovement(true); me->m_Events.KillAllEvents(false); _nextPhase = 0; + + if (CreatureGroup* formation = me->GetFormation()) + formation->RespawnFormation(true); } void JustEngagedWith(Unit* /*who*/) override @@ -239,6 +243,21 @@ struct boss_zuljin : public BossAI }); } + void EnterEvadeMode(EvadeReason /*why*/) override + { + if (CreatureGroup* formation = me->GetFormation()) + { + for (auto const& itr : formation->GetMembers()) + { + if (itr.first && itr.first != me) + itr.first->DespawnOnEvade(2min); + } + } + + me->DespawnOnEvade(2min); + _EnterEvadeMode(); + } + void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override { if (spellInfo->Id == SPELL_CLAW_RAGE_CHARGE && target != me)