From dd41692a8e2e388c9bd18f75d8fb511187c0e612 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Thu, 22 Aug 2024 14:27:15 -0300 Subject: [PATCH] fix(Scripts/SethekkHalls): Prevent multiple spawns of Anzu (#19636) * fix(Scripts/SethekkHalls): Prevent multiple spawns of Anzu * Update instance_sethekk_halls.cpp * Update instance_sethekk_halls.cpp * Update rev_1723763212128826500.sql --- .../rev_1723763212128826500.sql | 2 ++ .../SethekkHalls/instance_sethekk_halls.cpp | 18 +++++++++++++----- .../Auchindoun/SethekkHalls/sethekk_halls.h | 3 ++- 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1723763212128826500.sql diff --git a/data/sql/updates/pending_db_world/rev_1723763212128826500.sql b/data/sql/updates/pending_db_world/rev_1723763212128826500.sql new file mode 100644 index 000000000..f556675ca --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1723763212128826500.sql @@ -0,0 +1,2 @@ +-- +DELETE FROM `event_scripts` WHERE `id` = 14797; diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp index 7159dc870..4d6f959ce 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp @@ -31,6 +31,14 @@ ObjectData const gameObjectData[] = { 0, 0 } }; +ObjectData const creatureData[] = +{ + { NPC_VOICE_OF_THE_RAVEN_GOD, DATA_VOICE_OF_THE_RAVEN_GOD }, + { 0, 0 } +}; + +const uint32 anzuSummonEventId = 14797; + class instance_sethekk_halls : public InstanceMapScript { public: @@ -48,14 +56,14 @@ public: SetHeaders(DataHeaders); SetBossNumber(EncounterCount); LoadDoorData(doorData); - LoadObjectData(nullptr, gameObjectData); + LoadObjectData(creatureData, gameObjectData); } - void OnCreatureCreate(Creature* creature) override + void ProcessEvent(WorldObject* /*obj*/, uint32 eventId) override { - if (creature->GetEntry() == NPC_ANZU || creature->GetEntry() == NPC_VOICE_OF_THE_RAVEN_GOD) - if (GetBossState(DATA_ANZU) == DONE) - creature->DespawnOrUnsummon(1); + if (eventId == anzuSummonEventId) + if (!GetCreature(DATA_VOICE_OF_THE_RAVEN_GOD) && GetBossState(DATA_ANZU) != DONE) + instance->SummonCreature(NPC_VOICE_OF_THE_RAVEN_GOD, Position(-88.02f, 288.18f, 75.2f, 6.0f)); } }; }; diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h index 69bf90cb8..2d559bacf 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h @@ -41,7 +41,8 @@ enum eTypes enum InstanceData { - DATA_GO_TALON_KING_COFFER + DATA_GO_TALON_KING_COFFER, + DATA_VOICE_OF_THE_RAVEN_GOD }; enum eIds