Core/Battlegrounds: Replace manual criteria timer starts in battlegrounds with new GameEvents api

Port From (https://github.com/TrinityCore/TrinityCore/commit/111fc6ac6fd703bb645046e7a477a986d8519a64)
This commit is contained in:
hondacrx
2022-05-31 19:51:16 -04:00
parent 623c3198c0
commit adfca19d4c
6 changed files with 32 additions and 20 deletions
@@ -216,7 +216,7 @@ namespace Game.BattleGrounds.Zones
DoorOpen(ABObjectTypes.GateH);
// Achievement: Let's Get This Done
StartCriteriaTimer(CriteriaStartEvent.SendEvent, EventStartBattle);
TriggerGameEvent(EventStartBattle);
}
public override void AddPlayer(Player player)
@@ -131,7 +131,7 @@ namespace Game.BattleGrounds.Zones
}
// Achievement: Flurry
StartCriteriaTimer(CriteriaStartEvent.SendEvent, EotSMisc.EventStartBattle);
TriggerGameEvent(EotSMisc.EventStartBattle);
}
void AddPoints(Team Team, uint Points)
@@ -343,7 +343,7 @@ namespace Game.BattleGrounds.Zones
ToggleTimer();
DemolisherStartState(false);
Status = SAStatus.RoundOne;
StartCriteriaTimer(CriteriaStartEvent.SendEvent, (Attackers == TeamId.Alliance) ? 23748 : 21702u);
TriggerGameEvent(Attackers == TeamId.Alliance ? 23748 : 21702u);
}
if (TotalTime >= SATimers.BoatStart)
StartShips();
@@ -366,7 +366,7 @@ namespace Game.BattleGrounds.Zones
ToggleTimer();
DemolisherStartState(false);
Status = SAStatus.RoundTwo;
StartCriteriaTimer(CriteriaStartEvent.SendEvent, (Attackers == TeamId.Alliance) ? 23748 : 21702u);
TriggerGameEvent(Attackers == TeamId.Alliance ? 23748 : 21702u);
// status was set to STATUS_WAIT_JOIN manually for Preparation, set it back now
SetStatus(BattlegroundStatus.InProgress);
foreach (var pair in GetPlayers())
@@ -193,7 +193,7 @@ namespace Game.BattleGrounds.Zones
SpawnBGObject(WSGObjectTypes.DoorH4, BattlegroundConst.RespawnOneDay);
// players joining later are not eligibles
StartCriteriaTimer(CriteriaStartEvent.SendEvent, 8563);
TriggerGameEvent( 8563);
}
public override void AddPlayer(Player player)