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
This commit is contained in:
Andrew
2024-08-22 14:27:15 -03:00
committed by GitHub
parent eb410d6ab2
commit dd41692a8e
3 changed files with 17 additions and 6 deletions

View File

@@ -0,0 +1,2 @@
--
DELETE FROM `event_scripts` WHERE `id` = 14797;

View File

@@ -31,6 +31,14 @@ ObjectData const gameObjectData[] =
{ 0, 0 } { 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 class instance_sethekk_halls : public InstanceMapScript
{ {
public: public:
@@ -48,14 +56,14 @@ public:
SetHeaders(DataHeaders); SetHeaders(DataHeaders);
SetBossNumber(EncounterCount); SetBossNumber(EncounterCount);
LoadDoorData(doorData); 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 (eventId == anzuSummonEventId)
if (GetBossState(DATA_ANZU) == DONE) if (!GetCreature(DATA_VOICE_OF_THE_RAVEN_GOD) && GetBossState(DATA_ANZU) != DONE)
creature->DespawnOrUnsummon(1); instance->SummonCreature(NPC_VOICE_OF_THE_RAVEN_GOD, Position(-88.02f, 288.18f, 75.2f, 6.0f));
} }
}; };
}; };

View File

@@ -41,7 +41,8 @@ enum eTypes
enum InstanceData enum InstanceData
{ {
DATA_GO_TALON_KING_COFFER DATA_GO_TALON_KING_COFFER,
DATA_VOICE_OF_THE_RAVEN_GOD
}; };
enum eIds enum eIds