Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1.     // if we don't have any player in the instance
  2.     if (!instance->HavePlayers())
  3.     {
  4.         if (EventState == IN_PROGRESS) // if event is in progress, mark as fail
  5.         {
  6.             EventState = FAIL;
  7.             CheckEventState();
  8.         }
  9.     }
  10.                
  11. void CheckEventState()
  12. {
  13.     // if main event is in progress and players have wiped then reset instance
  14.     if ((EventState == IN_PROGRESS && CheckWipe()) || EventState == FAIL)
  15.     {
  16.         ResetBossEncounter(FirstBossId);
  17.         ResetBossEncounter(SecondBossId);
  18.         ResetBossEncounter(DATA_CYANIGOSA);
  19.    
  20.         WaveCount = 0;
  21.         DoorIntegrity = 100;
  22.         Defenseless = true;
  23.         SetData(DATA_MAIN_EVENT_STATE, NOT_STARTED);
  24.    
  25.         Scheduler.CancelAll();
  26.    
  27.         if (Creature* sinclari = GetCreature(DATA_SINCLARI))
  28.             sinclari->AI()->EnterEvadeMode();
  29.     }
  30. }
  31.  
  32.  
  33. taskScheduler.Schedule(3s, [this](TaskContext func)
  34. {
  35.     CheckEventState();
  36.     func.Repeat();
  37. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement