diff --git a/Source/Framework/Constants/SmartAIConst.cs b/Source/Framework/Constants/SmartAIConst.cs index ac6b8b9ba..c94fe02f2 100644 --- a/Source/Framework/Constants/SmartAIConst.cs +++ b/Source/Framework/Constants/SmartAIConst.cs @@ -322,7 +322,8 @@ namespace Framework.Constants RandomSound = 115, // SoundId1, SoundId2, SoundId3, SoundId4, SoundId5, onlySelf SetCorpseDelay = 116, // timer DisableEvade = 117, // 0/1 (1 = disabled, 0 = enabled) - // 118 - 127 : 3.3.5 reserved + GoSetGoState = 118, + // 119 - 127 : 3.3.5 reserved PlayAnimkit = 128, ScenePlay = 129, // sceneId SceneCancel = 130, // sceneId diff --git a/Source/Game/AI/SmartScripts/SmartAIManager.cs b/Source/Game/AI/SmartScripts/SmartAIManager.cs index 61b6201b9..390c3863c 100644 --- a/Source/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Source/Game/AI/SmartScripts/SmartAIManager.cs @@ -1220,6 +1220,7 @@ namespace Game.AI case SmartActions.JumpToPos: case SmartActions.SendGossipMenu: case SmartActions.GoSetLootState: + case SmartActions.GoSetGoState: case SmartActions.SendTargetToTarget: case SmartActions.SetHomePos: case SmartActions.SetHealthRegen: @@ -2162,6 +2163,9 @@ namespace Game.AI [FieldOffset(4)] public GoFlag goFlag; + [FieldOffset(4)] + public GoState goState; + [FieldOffset(4)] public CreatureGroup creatureGroup; @@ -2593,6 +2597,10 @@ namespace Game.AI { public uint flag; } + public struct GoState + { + public uint state; + } public struct CreatureGroup { public uint group; diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index 4fc760287..207635576 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -2027,6 +2027,18 @@ namespace Game.AI obj.ToGameObject().SetLootState((LootState)e.Action.setGoLootState.state); break; } + case SmartActions.GoSetGoState: + { + List targets = GetTargets(e, unit); + + if (targets.Empty()) + break; + + foreach (var obj in targets) + if (IsGameObject(obj)) + obj.ToGameObject().SetGoState((GameObjectState)e.Action.goState.state); + break; + } case SmartActions.SendTargetToTarget: { List targets = GetTargets(e, unit);