From 6aa0bc37cc75d2b54179f405cb31a33a1959841d Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 16 Nov 2024 06:25:36 -0300 Subject: [PATCH] =?UTF-8?q?refactor(Scripts/SunwellPlateau):=20Move=20summ?= =?UTF-8?q?ons=20to=20the=20new=20summon=20data=E2=80=A6=20(#20586)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor(Scripts/SunwellPlateau): Move summons to the new summon data implementation --- .../instance_sunwell_plateau.cpp | 41 +++++++------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp index 8f2d41cc1..52acb1032 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp @@ -59,6 +59,20 @@ ObjectData const gameObjectData[] = { 0, 0 } }; +ObjectData const summonData[] = +{ + { NPC_DEMONIC_VAPOR_TRAIL, DATA_FELMYST }, + { NPC_UNYIELDING_DEAD, DATA_FELMYST }, + { NPC_DARKNESS, DATA_MURU }, + { NPC_VOID_SENTINEL, DATA_MURU }, + { NPC_VOID_SPAWN, DATA_MURU }, + { NPC_FELFIRE_PORTAL, DATA_KJ_CONTROLLER }, + { NPC_VOLATILE_FELFIRE_FIEND, DATA_KJ_CONTROLLER }, + { NPC_SHIELD_ORB, DATA_KJ_CONTROLLER }, + { NPC_SINISTER_REFLECTION, DATA_KJ_CONTROLLER }, + { 0, 0 } +}; + class instance_sunwell_plateau : public InstanceMapScript { public: @@ -72,6 +86,7 @@ public: SetBossNumber(MAX_ENCOUNTERS); LoadDoorData(doorData); LoadObjectData(creatureData, gameObjectData); + LoadSummonData(summonData); } void OnPlayerEnter(Player* player) override @@ -87,32 +102,6 @@ public: if (creature->GetSpawnId() > 0 || !creature->GetOwnerGUID().IsPlayer()) creature->CastSpell(creature, SPELL_SUNWELL_RADIANCE, true); - switch (creature->GetEntry()) - { - case NPC_DEMONIC_VAPOR_TRAIL: - case NPC_UNYIELDING_DEAD: - if (Creature* felmyst = GetCreature(DATA_FELMYST)) - felmyst->AI()->JustSummoned(creature); - break; - - case NPC_DARKNESS: - case NPC_VOID_SENTINEL: - case NPC_VOID_SPAWN: - if (Creature* muru = GetCreature(DATA_MURU)) - muru->AI()->JustSummoned(creature); - break; - - case NPC_FELFIRE_PORTAL: - case NPC_VOLATILE_FELFIRE_FIEND: - case NPC_SHIELD_ORB: - case NPC_SINISTER_REFLECTION: - if (Creature* kiljaedenC = GetCreature(DATA_KJ_CONTROLLER)) - kiljaedenC->AI()->JustSummoned(creature); - break; - default: - break; - } - InstanceScript::OnCreatureCreate(creature); } };