From 1d6edf58d689031038325fb483144f63e76b00a4 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 4 Jan 2023 16:55:54 -0500 Subject: [PATCH] Core/SAI: Added param PointId to SMART_ACTION_MOVE_OFFSET Port From (https://github.com/TrinityCore/TrinityCore/commit/e218f276028124682790e93688aeae567ca1eaba) --- Source/Framework/Constants/SmartAIConst.cs | 2 +- Source/Game/AI/SmartScripts/SmartAIManager.cs | 8 ++++++++ Source/Game/AI/SmartScripts/SmartScript.cs | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Source/Framework/Constants/SmartAIConst.cs b/Source/Framework/Constants/SmartAIConst.cs index 664cf46cd..39306cbbd 100644 --- a/Source/Framework/Constants/SmartAIConst.cs +++ b/Source/Framework/Constants/SmartAIConst.cs @@ -361,7 +361,7 @@ namespace Framework.Constants GameEventStop = 111, // GameEventId GameEventStart = 112, // GameEventId StartClosestWaypoint = 113, // wp1, wp2, wp3, wp4, wp5, wp6, wp7 - MoveOffset = 114, + MoveOffset = 114, // PointId RandomSound = 115, // SoundId1, SoundId2, SoundId3, SoundId4, SoundId5, onlySelf SetCorpseDelay = 116, // timer DisableEvade = 117, // 0/1 (1 = disabled, 0 = enabled) diff --git a/Source/Game/AI/SmartScripts/SmartAIManager.cs b/Source/Game/AI/SmartScripts/SmartAIManager.cs index c92146407..2ac5d79be 100644 --- a/Source/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Source/Game/AI/SmartScripts/SmartAIManager.cs @@ -25,6 +25,7 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using static Game.AI.SmartAction; namespace Game.AI { @@ -3062,6 +3063,9 @@ namespace Game.AI [FieldOffset(4)] public ClosestWaypointFromList closestWaypointFromList; + [FieldOffset(4)] + public MoveOffset moveOffset; + [FieldOffset(4)] public RandomSound randomSound; @@ -3553,6 +3557,10 @@ namespace Game.AI public uint wp5; public uint wp6; } + public struct MoveOffset + { + public uint PointId; + } public struct RandomSound { public uint sound1; diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index d8fca495c..8f5d7ca50 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -1111,7 +1111,7 @@ namespace Game.AI float x = (float)(pos.GetPositionX() + (Math.Cos(o - (Math.PI / 2)) * e.Target.x) + (Math.Cos(o) * e.Target.y)); float y = (float)(pos.GetPositionY() + (Math.Sin(o - (Math.PI / 2)) * e.Target.x) + (Math.Sin(o) * e.Target.y)); float z = pos.GetPositionZ() + e.Target.z; - target.ToCreature().GetMotionMaster().MovePoint(EventId.SmartRandomPoint, x, y, z); + target.ToCreature().GetMotionMaster().MovePoint(e.Action.moveOffset.PointId, x, y, z); } break; }