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 <giacomopoz@gmail.com>
(cherry picked from commit 39e1d293bf)
This commit is contained in:
Jinnaix
2021-07-21 19:57:01 +02:00
committed by Shauren
parent 1b22d75019
commit 6cc8bebdd6
2 changed files with 11 additions and 7 deletions

View File

@@ -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);

View File

@@ -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;
}
}