Core/Auras: Implement SpellAuraInterruptFlags2::StartOfEncounter

Port From (https://github.com/TrinityCore/TrinityCore/commit/15135ce16f76d1635fa5606c99822b60bced94bf)
This commit is contained in:
hondacrx
2023-05-21 17:17:00 -04:00
parent 40ff308573
commit fd377ebc0d
3 changed files with 16 additions and 5 deletions
@@ -407,6 +407,13 @@ namespace Game.BattleGrounds
SetStatus(BattlegroundStatus.InProgress);
SetStartDelayTime(StartDelayTimes[BattlegroundConst.EventIdFourth]);
foreach (var (guid, _) in GetPlayers())
{
Player player = Global.ObjAccessor.FindPlayer(guid);
if (player != null)
player.AtStartOfEncounter();
}
// Remove preparation
if (IsArena())
{
+8
View File
@@ -583,6 +583,14 @@ namespace Game.Entities
return GetTransport();
}
public void AtStartOfEncounter()
{
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.StartOfEncounter);
if (IsAlive())
Unit.ProcSkillsAndAuras(this, null, new ProcFlagsInit(ProcFlags.EncounterStart), new ProcFlagsInit(), ProcFlagsSpellType.MaskAll, ProcFlagsSpellPhase.None, ProcFlagsHit.None, null, null, null);
}
public void _RegisterDynObject(DynamicObject dynObj)
{
m_dynObj.Add(dynObj);
+1 -5
View File
@@ -366,11 +366,7 @@ namespace Game.Maps
InitializeCombatResurrections(1, resInterval);
SendEncounterStart(1, 9, resInterval, resInterval);
instance.DoOnPlayers(player =>
{
if (player.IsAlive())
Unit.ProcSkillsAndAuras(player, null, new ProcFlagsInit(ProcFlags.EncounterStart), new ProcFlagsInit(), ProcFlagsSpellType.MaskAll, ProcFlagsSpellPhase.None, ProcFlagsHit.None, null, null, null);
});
instance.DoOnPlayers(player => player.AtStartOfEncounter());
break;
}
case EncounterState.Fail: