From eedbf145d1c26cd1039877e7e5eb165b0d5fed57 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 30 May 2022 14:43:56 -0400 Subject: [PATCH] Core/SAI: Remove SMART_ACTION_SEND_GO_CUSTOM_ANIM, make SMART_ACTION_ADD_AURA & SMART_ACTION_SET_GO_FLAG deprecated Port From (https://github.com/TrinityCore/TrinityCore/commit/9ea8cdb45716c162221c7d8a6f37da19a047c6d7) --- Source/Framework/Constants/SmartAIConst.cs | 2 +- Source/Game/AI/SmartScripts/SmartAIManager.cs | 13 +++---------- Source/Game/AI/SmartScripts/SmartScript.cs | 7 ------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/Source/Framework/Constants/SmartAIConst.cs b/Source/Framework/Constants/SmartAIConst.cs index ff7c7edbd..729121b6e 100644 --- a/Source/Framework/Constants/SmartAIConst.cs +++ b/Source/Framework/Constants/SmartAIConst.cs @@ -336,7 +336,7 @@ namespace Framework.Constants SetUnitFieldBytes1 = 90, // Bytes, Target RemoveUnitFieldBytes1 = 91, // Bytes, Target InterruptSpell = 92, - SendGoCustomAnim = 93, // Anim Id + SendGoCustomAnim = 93, // UNUSED, DO NOT REUSE SetDynamicFlag = 94, // UNUSED, DO NOT REUSE AddDynamicFlag = 95, // UNUSED, DO NOT REUSE RemoveDynamicFlag = 96, // UNUSED, DO NOT REUSE diff --git a/Source/Game/AI/SmartScripts/SmartAIManager.cs b/Source/Game/AI/SmartScripts/SmartAIManager.cs index a65e5a2c0..5675a5319 100644 --- a/Source/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Source/Game/AI/SmartScripts/SmartAIManager.cs @@ -755,7 +755,6 @@ namespace Game.AI SmartActions.SetUnitFieldBytes1 => Marshal.SizeOf(typeof(SmartAction.SetunitByte)), SmartActions.RemoveUnitFieldBytes1 => Marshal.SizeOf(typeof(SmartAction.DelunitByte)), SmartActions.InterruptSpell => Marshal.SizeOf(typeof(SmartAction.InterruptSpellCasting)), - SmartActions.SendGoCustomAnim => Marshal.SizeOf(typeof(SmartAction.SendGoCustomAnim)), SmartActions.AddDynamicFlag => Marshal.SizeOf(typeof(SmartAction.Flag)), SmartActions.RemoveDynamicFlag => Marshal.SizeOf(typeof(SmartAction.Flag)), SmartActions.JumpToPos => Marshal.SizeOf(typeof(SmartAction.Jump)), @@ -2060,7 +2059,6 @@ namespace Game.AI case SmartActions.RandomMove: case SmartActions.SetUnitFieldBytes1: case SmartActions.RemoveUnitFieldBytes1: - case SmartActions.SendGoCustomAnim: case SmartActions.JumpToPos: case SmartActions.SendGossipMenu: case SmartActions.GoSetLootState: @@ -2094,6 +2092,7 @@ namespace Game.AI case SmartActions.SetSwim: case SmartActions.OverrideScriptBaseObject: case SmartActions.ResetScriptBaseObject: + case SmartActions.SendGoCustomAnim: case SmartActions.SetDynamicFlag: case SmartActions.AddDynamicFlag: case SmartActions.RemoveDynamicFlag: @@ -2113,7 +2112,8 @@ namespace Game.AI switch (e.GetActionType()) { // Deprecated - case SmartActions.SendGoCustomAnim: + case SmartActions.AddAura: + case SmartActions.SetGoFlag: Log.outWarn(LogFilter.Sql, $"SmartAIMgr: Deprecated action_type: {e}, it might be removed in the future, loaded for now."); break; default: @@ -3005,9 +3005,6 @@ namespace Game.AI [FieldOffset(4)] public InterruptSpellCasting interruptSpellCasting; - [FieldOffset(4)] - public SendGoCustomAnim sendGoCustomAnim; - [FieldOffset(4)] public Jump jump; @@ -3468,10 +3465,6 @@ namespace Game.AI public uint spell_id; public uint withInstant; } - public struct SendGoCustomAnim - { - public uint anim; - } public struct Jump { public uint speedxy; diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index f33b62160..c257c3ece 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -1806,13 +1806,6 @@ namespace Game.AI target.ToUnit().InterruptNonMeleeSpells(e.Action.interruptSpellCasting.withDelayed != 0, e.Action.interruptSpellCasting.spell_id, e.Action.interruptSpellCasting.withInstant != 0); break; } - case SmartActions.SendGoCustomAnim: - { - foreach (var target in targets) - if (IsGameObject(target)) - target.ToGameObject().SendCustomAnim(e.Action.sendGoCustomAnim.anim); - break; - } case SmartActions.AddDynamicFlag: { foreach (var target in targets)