Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // if we don't have any player in the instance
- if (!instance->HavePlayers())
- {
- if (EventState == IN_PROGRESS) // if event is in progress, mark as fail
- {
- EventState = FAIL;
- CheckEventState();
- }
- }
- void CheckEventState()
- {
- // if main event is in progress and players have wiped then reset instance
- if ((EventState == IN_PROGRESS && CheckWipe()) || EventState == FAIL)
- {
- ResetBossEncounter(FirstBossId);
- ResetBossEncounter(SecondBossId);
- ResetBossEncounter(DATA_CYANIGOSA);
- WaveCount = 0;
- DoorIntegrity = 100;
- Defenseless = true;
- SetData(DATA_MAIN_EVENT_STATE, NOT_STARTED);
- Scheduler.CancelAll();
- if (Creature* sinclari = GetCreature(DATA_SINCLARI))
- sinclari->AI()->EnterEvadeMode();
- }
- }
- taskScheduler.Schedule(3s, [this](TaskContext func)
- {
- CheckEventState();
- func.Repeat();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement