Core/Criteria: Add all values of CriteriaStartEvent

Port From (https://github.com/TrinityCore/TrinityCore/commit/0b2087ae4185fa53cd3b5d7206f7fd3726fd642f)
This commit is contained in:
hondacrx
2021-06-04 14:08:02 -04:00
parent 93f8c09364
commit 103d78dccc
13 changed files with 54 additions and 48 deletions
+2 -2
View File
@@ -1772,13 +1772,13 @@ namespace Game.BattleGrounds
return Global.ObjectMgr.GetClosestGraveYard(player, player.GetTeam(), player);
}
public void StartCriteriaTimer(CriteriaTimedTypes type, uint entry)
public void StartCriteriaTimer(CriteriaStartEvent startEvent, uint entry)
{
foreach (var guid in GetPlayers().Keys)
{
Player player = Global.ObjAccessor.FindPlayer(guid);
if (player)
player.StartCriteriaTimer(type, entry);
player.StartCriteriaTimer(startEvent, entry);
}
}
@@ -212,7 +212,7 @@ namespace Game.BattleGrounds.Zones
DoorOpen(ABObjectTypes.GateH);
// Achievement: Let's Get This Done
StartCriteriaTimer(CriteriaTimedTypes.Event, EventStartBattle);
StartCriteriaTimer(CriteriaStartEvent.SendEvent, EventStartBattle);
}
public override void AddPlayer(Player player)
@@ -132,7 +132,7 @@ namespace Game.BattleGrounds.Zones
}
// Achievement: Flurry
StartCriteriaTimer(CriteriaTimedTypes.Event, EotSMisc.EventStartBattle);
StartCriteriaTimer(CriteriaStartEvent.SendEvent, EotSMisc.EventStartBattle);
}
void AddPoints(Team Team, uint Points)
@@ -344,7 +344,7 @@ namespace Game.BattleGrounds.Zones
ToggleTimer();
DemolisherStartState(false);
Status = SAStatus.RoundOne;
StartCriteriaTimer(CriteriaTimedTypes.Event, (Attackers == TeamId.Alliance) ? 23748 : 21702u);
StartCriteriaTimer(CriteriaStartEvent.SendEvent, (Attackers == TeamId.Alliance) ? 23748 : 21702u);
}
if (TotalTime >= SATimers.BoatStart)
StartShips();
@@ -367,7 +367,7 @@ namespace Game.BattleGrounds.Zones
ToggleTimer();
DemolisherStartState(false);
Status = SAStatus.RoundTwo;
StartCriteriaTimer(CriteriaTimedTypes.Event, (Attackers == TeamId.Alliance) ? 23748 : 21702u);
StartCriteriaTimer(CriteriaStartEvent.SendEvent, (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())
@@ -195,7 +195,7 @@ namespace Game.BattleGrounds.Zones
SpawnBGObject(WSGObjectTypes.DoorH4, BattlegroundConst.RespawnOneDay);
// players joining later are not eligibles
StartCriteriaTimer(CriteriaTimedTypes.Event, 8563);
StartCriteriaTimer(CriteriaStartEvent.SendEvent, 8563);
}
public override void AddPlayer(Player player)
@@ -446,7 +446,7 @@ namespace Game.BattleGrounds.Zones
UpdateFlagState(Team.Horde, WSGFlagState.OnPlayer);
UpdateWorldState(WSGWorldStates.FlagUnkAlliance, 1);
player.CastSpell(player, WSGSpellId.SilverwingFlag, true);
player.StartCriteriaTimer(CriteriaTimedTypes.SpellTarget, WSGSpellId.SilverwingFlagPicked);
player.StartCriteriaTimer(CriteriaStartEvent.BeSpellTarget, WSGSpellId.SilverwingFlagPicked);
if (_flagState[1] == WSGFlagState.OnPlayer)
_bothFlagsKept = true;
}
@@ -464,7 +464,7 @@ namespace Game.BattleGrounds.Zones
UpdateFlagState(Team.Alliance, WSGFlagState.OnPlayer);
UpdateWorldState(WSGWorldStates.FlagUnkHorde, 1);
player.CastSpell(player, WSGSpellId.WarsongFlag, true);
player.StartCriteriaTimer(CriteriaTimedTypes.SpellTarget, WSGSpellId.WarsongFlagPicked);
player.StartCriteriaTimer(CriteriaStartEvent.BeSpellTarget, WSGSpellId.WarsongFlagPicked);
if (_flagState[0] == WSGFlagState.OnPlayer)
_bothFlagsKept = true;
}