diff options
author | Martin Topholm <github@m.hoth.dk> | 2019-07-05 23:46:55 +0200 |
---|---|---|
committer | Wyrserth <wyrserth@protonmail.com> | 2019-07-05 23:46:55 +0200 |
commit | 4529a94e0d093fb01c6ae4a98dade46ce75f82a9 (patch) | |
tree | 2e403bd2b2bf82ed9a7007cc997825d0088e5d51 | |
parent | a8d232a92158bb9782e0895e6788692ee4729eb7 (diff) |
Script/BlackrockDepths: fix Ironhand Guardian's Gout of Flame spell cast. (#21816)
4 files changed, 81 insertions, 12 deletions
diff --git a/sql/updates/world/3.3.5/2019_07_05_03_world.sql b/sql/updates/world/3.3.5/2019_07_05_03_world.sql new file mode 100644 index 00000000000..6eb0f75d0ed --- /dev/null +++ b/sql/updates/world/3.3.5/2019_07_05_03_world.sql @@ -0,0 +1,3 @@ +-- +UPDATE `creature_template` SET `AIName`="", `ScriptName`="npc_ironhand_guardian" WHERE `entry`=8982; +DELETE FROM `smart_scripts` WHERE `entryorguid`=8982 AND `source_type`=0; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 761a07eaa78..4d21ecb00d0 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3904,6 +3904,7 @@ void SpellMgr::LoadSpellInfoCorrections() }); ApplySpellFix({ + 15538, // Gout of Flame 42490, // Energized! 42492, // Cast Energized 43115 // Plague Vial diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp index 976fd9f1198..e6706e3ee0b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp @@ -54,6 +54,8 @@ class boss_magmus : public CreatureScript void JustEngagedWith(Unit* /*who*/) override { + if (InstanceScript* instance = me->GetInstanceScript()) + instance->SetData(TYPE_IRON_HALL, IN_PROGRESS); _events.SetPhase(PHASE_ONE); _events.ScheduleEvent(EVENT_FIERY_BURST, 5s); } @@ -97,7 +99,10 @@ class boss_magmus : public CreatureScript void JustDied(Unit* /*killer*/) override { if (InstanceScript* instance = me->GetInstanceScript()) + { instance->HandleGameObject(instance->GetGuidData(DATA_THRONE_DOOR), true); + instance->SetData(TYPE_IRON_HALL, DONE); + } } private: @@ -110,7 +115,67 @@ class boss_magmus : public CreatureScript } }; +enum IronhandGuardian +{ + EVENT_GOUTOFFLAME = 1, + SPELL_GOUTOFFLAME = 15529 +}; + +class npc_ironhand_guardian : public CreatureScript +{ +public: + npc_ironhand_guardian() : CreatureScript("npc_ironhand_guardian") { } + + struct npc_ironhand_guardianAI : public ScriptedAI + { + npc_ironhand_guardianAI(Creature* creature) : ScriptedAI(creature) + { + _instance = me->GetInstanceScript(); + _active = false; + } + + void Reset() override + { + _events.Reset(); + } + + void UpdateAI(uint32 diff) override + { + if (!_active) + { + if (_instance->GetData(TYPE_IRON_HALL) == NOT_STARTED) + return; + // Once the boss is engaged, the guardians will stay activated until the next instance reset + _events.ScheduleEvent(EVENT_GOUTOFFLAME, 0s); + _active = true; + } + + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + if (eventId == EVENT_GOUTOFFLAME) + { + DoCastAOE(SPELL_GOUTOFFLAME); + _events.Repeat(16s); + } + } + } + + private: + EventMap _events; + InstanceScript* _instance; + bool _active; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return GetBlackrockDepthsAI<npc_ironhand_guardianAI>(creature); + } +}; + void AddSC_boss_magmus() { new boss_magmus(); + new npc_ironhand_guardian(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp index 70f8f69379f..64f8dd07af0 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp @@ -33,19 +33,19 @@ enum Creatures { - NPC_EMPEROR = 9019, - NPC_PHALANX = 9502, - NPC_ANGERREL = 9035, - NPC_DOPEREL = 9040, - NPC_HATEREL = 9034, - NPC_VILEREL = 9036, - NPC_SEETHREL = 9038, - NPC_GLOOMREL = 9037, - NPC_DOOMREL = 9039, - NPC_MAGMUS = 9938, - NPC_MOIRA = 8929, + NPC_EMPEROR = 9019, + NPC_PHALANX = 9502, + NPC_ANGERREL = 9035, + NPC_DOPEREL = 9040, + NPC_HATEREL = 9034, + NPC_VILEREL = 9036, + NPC_SEETHREL = 9038, + NPC_GLOOMREL = 9037, + NPC_DOOMREL = 9039, + NPC_MAGMUS = 9938, + NPC_MOIRA = 8929, NPC_PRIESTESS_THAURISSAN = 10076, - NPC_COREN = 23872 + NPC_COREN = 23872, }; enum GameObjects |