From 6cc8bebdd6973920e80d98ff19ac8ec50f70e76c Mon Sep 17 00:00:00 2001 From: Jinnaix <37972361+Jinnaix@users.noreply.github.com> Date: Wed, 21 Jul 2021 19:57:01 +0200 Subject: Game/Event: zone_hellfire_peninsula.cpp (#26724) * Game/Event: zone_hellfire_peninsula.cpp Convert script timer into game event * _events.Reset(); - just in case * Rename 9999_99_99_99_world.sql to 2021_07_21_03_world.sql Co-authored-by: Giacomo Pozzoni (cherry picked from commit 39e1d293bf5c26c26d26fe9509189a67ce0c4f37) --- .../master/2022_03_11_25_world_2021_07_21_03_world.sql | 3 +++ src/server/scripts/Outland/zone_hellfire_peninsula.cpp | 15 ++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 sql/updates/world/master/2022_03_11_25_world_2021_07_21_03_world.sql diff --git a/sql/updates/world/master/2022_03_11_25_world_2021_07_21_03_world.sql b/sql/updates/world/master/2022_03_11_25_world_2021_07_21_03_world.sql new file mode 100644 index 00000000000..a95e2c17d61 --- /dev/null +++ b/sql/updates/world/master/2022_03_11_25_world_2021_07_21_03_world.sql @@ -0,0 +1,3 @@ +-- +DELETE FROM `game_event` WHERE `eventEntry`=85; +INSERT INTO `game_event` (`eventEntry`, `start_time`, `end_time`, `occurence`, `length`, `holiday`, `holidayStage`, `description`, `world_event`, `announce`) VALUES (85, '2010-01-01 02:00:00', '2030-12-31 07:00:00', 60, 1, 0, 0, 'Honor Hold Hellfire', 0, 2); diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp index 75511d819c0..3ebfa24c0d4 100644 --- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp @@ -639,6 +639,8 @@ enum WatchCommanderLeonus EVENT_CAST = 2, EVENT_END = 3, + GAME_EVENT_HELLFIRE = 85, + NPC_INFERNAL_RAIN = 18729, NPC_FEAR_CONTROLLER = 19393, SPELL_INFERNAL_RAIN = 33814, @@ -649,12 +651,13 @@ struct npc_watch_commander_leonus : public ScriptedAI { npc_watch_commander_leonus(Creature* creature) : ScriptedAI(creature) { } - void JustAppeared() override + void OnGameEvent(bool start, uint16 eventId) override { - ScriptedAI::JustAppeared(); - - _events.Reset(); - _events.ScheduleEvent(EVENT_START, 2min, 10min); + if (eventId == GAME_EVENT_HELLFIRE && start) + { + _events.Reset(); + _events.ScheduleEvent(EVENT_START, 1s); + } } void UpdateAI(uint32 diff) override @@ -681,8 +684,6 @@ struct npc_watch_commander_leonus : public ScriptedAI for (Creature* dummy : dummies) if (dummy->GetCreatureData()->movementType == 0) dummy->AI()->SetData(EVENT_START, 0); - - _events.Repeat(1h); break; } } -- cgit v1.2.3