Handle deprecated SAI actions and events
Port From (https://github.com/TrinityCore/TrinityCore/commit/318e0e24066fc89a1d07a993fc19a5a9dd3a6fd4)
This commit is contained in:
@@ -301,7 +301,7 @@ namespace Framework.Constants
|
|||||||
WpStop = 55, // Despawntime, Quest, Fail?
|
WpStop = 55, // Despawntime, Quest, Fail?
|
||||||
AddItem = 56, // Itemid, Count
|
AddItem = 56, // Itemid, Count
|
||||||
RemoveItem = 57, // Itemid, Count
|
RemoveItem = 57, // Itemid, Count
|
||||||
//Unused58 = 58, // do not reuse
|
InstallAITemplate = 58, // do not use
|
||||||
SetRun = 59, // 0/1
|
SetRun = 59, // 0/1
|
||||||
SetDisableGravity = 60, // 0/1
|
SetDisableGravity = 60, // 0/1
|
||||||
SetSwim = 61, // 0/1
|
SetSwim = 61, // 0/1
|
||||||
@@ -337,7 +337,7 @@ namespace Framework.Constants
|
|||||||
RemoveUnitFieldBytes1 = 91, // Bytes, Target
|
RemoveUnitFieldBytes1 = 91, // Bytes, Target
|
||||||
InterruptSpell = 92,
|
InterruptSpell = 92,
|
||||||
SendGoCustomAnim = 93, // Anim Id
|
SendGoCustomAnim = 93, // Anim Id
|
||||||
//Unused94 = 94, // do not reuse
|
SetDynamicFlag = 94, // do not use
|
||||||
AddDynamicFlag = 95, // Flags
|
AddDynamicFlag = 95, // Flags
|
||||||
RemoveDynamicFlag = 96, // Flags
|
RemoveDynamicFlag = 96, // Flags
|
||||||
JumpToPos = 97, // Speedxy, Speedz, Targetx, Targety, Targetz
|
JumpToPos = 97, // Speedxy, Speedz, Targetx, Targety, Targetz
|
||||||
|
|||||||
@@ -1362,6 +1362,19 @@ namespace Game.AI
|
|||||||
Log.outError(LogFilter.ScriptsAi, "SmartAIMgr: Not handled event_type({0}), Entry {1} SourceType {2} Event {3} Action {4}, skipped.", e.GetEventType(), e.EntryOrGuid, e.GetScriptType(), e.EventId, e.GetActionType());
|
Log.outError(LogFilter.ScriptsAi, "SmartAIMgr: Not handled event_type({0}), Entry {1} SourceType {2} Event {3} Action {4}, skipped.", e.GetEventType(), e.EntryOrGuid, e.GetScriptType(), e.EventId, e.GetActionType());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Additional check for deprecated
|
||||||
|
switch (e.GetEventType())
|
||||||
|
{
|
||||||
|
// Deprecated
|
||||||
|
case SmartEvents.FriendlyHealth:
|
||||||
|
case SmartEvents.TargetHealthPct:
|
||||||
|
case SmartEvents.IsBehindTarget:
|
||||||
|
Log.outWarn(LogFilter.Sql, $"SmartAIMgr: Deprecated event_type({e.GetEventType()}), {e}, it might be removed in the future, loaded for now.");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CheckUnusedEventParams(e))
|
if (!CheckUnusedEventParams(e))
|
||||||
@@ -2148,6 +2161,11 @@ namespace Game.AI
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// No longer supported
|
||||||
|
case SmartActions.InstallAITemplate:
|
||||||
|
case SmartActions.SetDynamicFlag:
|
||||||
|
Log.outError(LogFilter.Sql, $"SmartAIMgr: No longer supported action_type: {e} Skipped.");
|
||||||
|
return false;
|
||||||
default:
|
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);
|
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);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user