diff --git a/Source/Game/AI/SmartScripts/SmartAIManager.cs b/Source/Game/AI/SmartScripts/SmartAIManager.cs index 24b6e9742..1a443f8a2 100644 --- a/Source/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Source/Game/AI/SmartScripts/SmartAIManager.cs @@ -1425,6 +1425,15 @@ namespace Game.AI break; } + case SmartActions.PauseMovement: + { + if (e.Action.pauseMovement.pauseTimer == 0) + { + Log.outError(LogFilter.Sql, $"SmartAIMgr: {e} does not specify pause duration"); + return false; + } + break; + } case SmartActions.SetMovementSpeed: { if (e.Action.movementSpeed.movementType >= (int)MovementGeneratorType.Max) @@ -1529,7 +1538,6 @@ namespace Game.AI case SmartActions.RemoveAllGameobjects: case SmartActions.SpawnSpawngroup: case SmartActions.DespawnSpawngroup: - case SmartActions.RemoveMovement: break; default: Log.outError(LogFilter.ScriptsAi, "SmartAIMgr: Not handled action_type({0}), event_type({1}), Entry {2} SourceType {3} Event {4}, skipped.", e.GetActionType(), e.GetEventType(), e.EntryOrGuid, e.GetScriptType(), e.EventId); @@ -2534,7 +2542,7 @@ namespace Game.AI public RandomTimedEvent randomTimedEvent; [FieldOffset(4)] - public RemoveMovement removeMovement; + public PauseMovement pauseMovement; [FieldOffset(4)] public RespawnData respawnData; @@ -3047,10 +3055,11 @@ namespace Game.AI public uint minId; public uint maxId; } - public struct RemoveMovement + public struct PauseMovement { - public uint movementType; - public uint forced; + public uint movementSlot; + public uint pauseTimer; + public uint force; } public struct RespawnData { diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index 2de488c03..5147feb71 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -2331,18 +2331,11 @@ namespace Game.AI break; } - case SmartActions.RemoveMovement: + case SmartActions.PauseMovement: { foreach (var target in targets) - { if (IsUnit(target)) - { - if (e.Action.removeMovement.movementType != 0 && e.Action.removeMovement.movementType < (uint)MovementGeneratorType.Max) - target.ToUnit().GetMotionMaster().Remove((MovementGeneratorType)e.Action.removeMovement.movementType); - if (e.Action.removeMovement.forced != 0) - target.ToUnit().StopMoving(); - } - } + target.ToUnit().PauseMovement(e.Action.pauseMovement.pauseTimer, (MovementSlot)e.Action.pauseMovement.movementSlot, e.Action.pauseMovement.force != 0); break; }