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)
This commit is contained in:
hondacrx
2022-05-30 14:43:56 -04:00
parent d3cf388bd7
commit eedbf145d1
3 changed files with 4 additions and 18 deletions
+1 -1
View File
@@ -336,7 +336,7 @@ namespace Framework.Constants
SetUnitFieldBytes1 = 90, // Bytes, Target SetUnitFieldBytes1 = 90, // Bytes, Target
RemoveUnitFieldBytes1 = 91, // Bytes, Target RemoveUnitFieldBytes1 = 91, // Bytes, Target
InterruptSpell = 92, InterruptSpell = 92,
SendGoCustomAnim = 93, // Anim Id SendGoCustomAnim = 93, // UNUSED, DO NOT REUSE
SetDynamicFlag = 94, // UNUSED, DO NOT REUSE SetDynamicFlag = 94, // UNUSED, DO NOT REUSE
AddDynamicFlag = 95, // UNUSED, DO NOT REUSE AddDynamicFlag = 95, // UNUSED, DO NOT REUSE
RemoveDynamicFlag = 96, // UNUSED, DO NOT REUSE RemoveDynamicFlag = 96, // UNUSED, DO NOT REUSE
+3 -10
View File
@@ -755,7 +755,6 @@ namespace Game.AI
SmartActions.SetUnitFieldBytes1 => Marshal.SizeOf(typeof(SmartAction.SetunitByte)), SmartActions.SetUnitFieldBytes1 => Marshal.SizeOf(typeof(SmartAction.SetunitByte)),
SmartActions.RemoveUnitFieldBytes1 => Marshal.SizeOf(typeof(SmartAction.DelunitByte)), SmartActions.RemoveUnitFieldBytes1 => Marshal.SizeOf(typeof(SmartAction.DelunitByte)),
SmartActions.InterruptSpell => Marshal.SizeOf(typeof(SmartAction.InterruptSpellCasting)), SmartActions.InterruptSpell => Marshal.SizeOf(typeof(SmartAction.InterruptSpellCasting)),
SmartActions.SendGoCustomAnim => Marshal.SizeOf(typeof(SmartAction.SendGoCustomAnim)),
SmartActions.AddDynamicFlag => Marshal.SizeOf(typeof(SmartAction.Flag)), SmartActions.AddDynamicFlag => Marshal.SizeOf(typeof(SmartAction.Flag)),
SmartActions.RemoveDynamicFlag => Marshal.SizeOf(typeof(SmartAction.Flag)), SmartActions.RemoveDynamicFlag => Marshal.SizeOf(typeof(SmartAction.Flag)),
SmartActions.JumpToPos => Marshal.SizeOf(typeof(SmartAction.Jump)), SmartActions.JumpToPos => Marshal.SizeOf(typeof(SmartAction.Jump)),
@@ -2060,7 +2059,6 @@ namespace Game.AI
case SmartActions.RandomMove: case SmartActions.RandomMove:
case SmartActions.SetUnitFieldBytes1: case SmartActions.SetUnitFieldBytes1:
case SmartActions.RemoveUnitFieldBytes1: case SmartActions.RemoveUnitFieldBytes1:
case SmartActions.SendGoCustomAnim:
case SmartActions.JumpToPos: case SmartActions.JumpToPos:
case SmartActions.SendGossipMenu: case SmartActions.SendGossipMenu:
case SmartActions.GoSetLootState: case SmartActions.GoSetLootState:
@@ -2094,6 +2092,7 @@ namespace Game.AI
case SmartActions.SetSwim: case SmartActions.SetSwim:
case SmartActions.OverrideScriptBaseObject: case SmartActions.OverrideScriptBaseObject:
case SmartActions.ResetScriptBaseObject: case SmartActions.ResetScriptBaseObject:
case SmartActions.SendGoCustomAnim:
case SmartActions.SetDynamicFlag: case SmartActions.SetDynamicFlag:
case SmartActions.AddDynamicFlag: case SmartActions.AddDynamicFlag:
case SmartActions.RemoveDynamicFlag: case SmartActions.RemoveDynamicFlag:
@@ -2113,7 +2112,8 @@ namespace Game.AI
switch (e.GetActionType()) switch (e.GetActionType())
{ {
// Deprecated // 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."); Log.outWarn(LogFilter.Sql, $"SmartAIMgr: Deprecated action_type: {e}, it might be removed in the future, loaded for now.");
break; break;
default: default:
@@ -3005,9 +3005,6 @@ namespace Game.AI
[FieldOffset(4)] [FieldOffset(4)]
public InterruptSpellCasting interruptSpellCasting; public InterruptSpellCasting interruptSpellCasting;
[FieldOffset(4)]
public SendGoCustomAnim sendGoCustomAnim;
[FieldOffset(4)] [FieldOffset(4)]
public Jump jump; public Jump jump;
@@ -3468,10 +3465,6 @@ namespace Game.AI
public uint spell_id; public uint spell_id;
public uint withInstant; public uint withInstant;
} }
public struct SendGoCustomAnim
{
public uint anim;
}
public struct Jump public struct Jump
{ {
public uint speedxy; public uint speedxy;
@@ -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); target.ToUnit().InterruptNonMeleeSpells(e.Action.interruptSpellCasting.withDelayed != 0, e.Action.interruptSpellCasting.spell_id, e.Action.interruptSpellCasting.withInstant != 0);
break; break;
} }
case SmartActions.SendGoCustomAnim:
{
foreach (var target in targets)
if (IsGameObject(target))
target.ToGameObject().SendCustomAnim(e.Action.sendGoCustomAnim.anim);
break;
}
case SmartActions.AddDynamicFlag: case SmartActions.AddDynamicFlag:
{ {
foreach (var target in targets) foreach (var target in targets)