Core/Auras: Implement SpellAuraInterruptFlags2::StartOfEncounter
Port From (https://github.com/TrinityCore/TrinityCore/commit/15135ce16f76d1635fa5606c99822b60bced94bf)
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user