Core/SAI: Implemented new action SMART_ACTION_TRIGGER_GAME_EVENT

Port From (https://github.com/TrinityCore/TrinityCore/commit/9d0187dd5669d73bcb94ffe76b4fc3975a5455cc)
This commit is contained in:
hondacrx
2022-05-31 20:46:07 -04:00
parent e1b85a66e9
commit deadb86e31
3 changed files with 28 additions and 0 deletions
@@ -804,6 +804,7 @@ namespace Game.AI
SmartActions.ActivateGameobject => Marshal.SizeOf(typeof(SmartAction.ActivateGameObject)),
SmartActions.AddToStoredTargetList => Marshal.SizeOf(typeof(SmartAction.AddToStoredTargets)),
SmartActions.BecomePersonalCloneForPlayer => Marshal.SizeOf(typeof(SmartAction.BecomePersonalClone)),
SmartActions.TriggerGameEvent => Marshal.SizeOf(typeof(SmartAction.TriggerGameEvent)),
_ => Marshal.SizeOf(typeof(SmartAction.Raw)),
};
@@ -2088,6 +2089,11 @@ namespace Game.AI
}
break;
}
case SmartActions.TriggerGameEvent:
{
TC_SAI_IS_BOOLEAN_VALID(e, e.Action.triggerGameEvent.useSaiTargetAsGameEventSource);
break;
}
// No longer supported
case SmartActions.SetUnitFlag:
case SmartActions.RemoveUnitFlag:
@@ -3135,6 +3141,9 @@ namespace Game.AI
[FieldOffset(4)]
public BecomePersonalClone becomePersonalClone;
[FieldOffset(4)]
public TriggerGameEvent triggerGameEvent;
[FieldOffset(4)]
public Raw raw;
@@ -3668,6 +3677,11 @@ namespace Game.AI
public uint type;
public uint duration;
}
public struct TriggerGameEvent
{
public uint eventId;
public uint useSaiTargetAsGameEventSource;
}
public struct Raw
{
public uint param1;