Core/Player: moved indoors/outdoors aura interrupting mechanic into heartbeat and movement handling

Port From (https://github.com/TrinityCore/TrinityCore/commit/5a169f6eae45a7578d6e312cdba9825f6fc24fa5)
This commit is contained in:
Hondacrx
2024-08-19 11:50:36 -04:00
parent 31ce0c6719
commit 4fbca2d838
2 changed files with 28 additions and 5 deletions
+11 -5
View File
@@ -567,6 +567,9 @@ namespace Game.Entities
// Group update // Group update
SendUpdateToOutOfRangeGroupMembers(); SendUpdateToOutOfRangeGroupMembers();
// Indoor/Outdoor aura requirements
CheckOutdoorsAuraRequirements();
} }
public override void SetDeathState(DeathState s) public override void SetDeathState(DeathState s)
@@ -6266,7 +6269,7 @@ namespace Game.Entities
if (GetTrader() != null && !IsWithinDistInMap(GetTrader(), SharedConst.InteractionDistance)) if (GetTrader() != null && !IsWithinDistInMap(GetTrader(), SharedConst.InteractionDistance))
GetSession().SendCancelTrade(); GetSession().SendCancelTrade();
CheckAreaExploreAndOutdoor(); CheckAreaExplore();
return true; return true;
} }
@@ -6343,7 +6346,7 @@ namespace Game.Entities
SendPacket(new ResetWeeklyCurrency()); SendPacket(new ResetWeeklyCurrency());
} }
void CheckAreaExploreAndOutdoor() void CheckAreaExplore()
{ {
if (!IsAlive()) if (!IsAlive())
return; return;
@@ -6351,9 +6354,6 @@ namespace Game.Entities
if (IsInFlight()) if (IsInFlight())
return; return;
if (WorldConfig.GetBoolValue(WorldCfg.VmapIndoorCheck))
RemoveAurasWithAttribute(IsOutdoors() ? SpellAttr0.OnlyIndoors : SpellAttr0.OnlyOutdoors);
uint areaId = GetAreaId(); uint areaId = GetAreaId();
if (areaId == 0) if (areaId == 0)
return; return;
@@ -6451,6 +6451,12 @@ namespace Game.Entities
SendPacket(new ExplorationExperience(Experience, Area)); SendPacket(new ExplorationExperience(Experience, Area));
} }
public void CheckOutdoorsAuraRequirements()
{
if (WorldConfig.GetBoolValue(WorldCfg.VmapIndoorCheck))
RemoveAurasWithAttribute(IsOutdoors() ? SpellAttr0.OnlyIndoors : SpellAttr0.OnlyOutdoors);
}
public void SendSysMessage(CypherStrings str, params object[] args) public void SendSysMessage(CypherStrings str, params object[] args)
{ {
string input = ObjectMgr.GetCypherString(str); string input = ObjectMgr.GetCypherString(str);
+17
View File
@@ -208,6 +208,23 @@ namespace Game
plrMover.RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.Jump); // Mind Control plrMover.RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.Jump); // Mind Control
Unit.ProcSkillsAndAuras(plrMover, null, new ProcFlagsInit(ProcFlags.Jump), new ProcFlagsInit(ProcFlags.None), ProcFlagsSpellType.MaskAll, ProcFlagsSpellPhase.None, ProcFlagsHit.None, null, null, null); Unit.ProcSkillsAndAuras(plrMover, null, new ProcFlagsInit(ProcFlags.Jump), new ProcFlagsInit(ProcFlags.None), ProcFlagsSpellType.MaskAll, ProcFlagsSpellPhase.None, ProcFlagsHit.None, null, null, null);
} }
// Whenever a player stops a movement action, an indoor/outdoor check is being performed
switch (opcode)
{
case ClientOpcodes.MoveSetFly:
case ClientOpcodes.MoveFallLand:
case ClientOpcodes.MoveStop:
case ClientOpcodes.MoveStopStrafe:
case ClientOpcodes.MoveStopTurn:
case ClientOpcodes.MoveStopSwim:
case ClientOpcodes.MoveStopPitch:
case ClientOpcodes.MoveStopAscend:
plrMover.CheckOutdoorsAuraRequirements();
break;
default:
break;
}
} }
} }