Core/SAI: Add actions ENTER_VEHICLE, BOARD_PASSENGER and EXIT_VEHICLE

Port From (https://github.com/TrinityCore/TrinityCore/commit/9477209f10bd33611251f38633f28dc5f16103f5)
This commit is contained in:
Hondacrx
2025-08-20 22:15:13 -04:00
parent 09a90c4daf
commit 4cc76e002a
3 changed files with 69 additions and 0 deletions
@@ -821,6 +821,9 @@ namespace Game.AI
SmartActions.DoAction => Marshal.SizeOf(typeof(SmartAction.DoAction)),
SmartActions.CompleteQuest => Marshal.SizeOf(typeof(SmartAction.Quest)),
SmartActions.CreditQuestObjectiveTalkTo => 0,
SmartActions.EnterVehicle => Marshal.SizeOf(typeof(SmartAction.EnterVehicle)),
SmartActions.BoardPassenger => Marshal.SizeOf(typeof(SmartAction.EnterVehicle)),
SmartActions.ExitVehicle => 0,
_ => Marshal.SizeOf(typeof(SmartAction.Raw)),
};
@@ -2178,6 +2181,7 @@ namespace Game.AI
case SmartActions.SpawnSpawngroup:
case SmartActions.AddToStoredTargetList:
case SmartActions.DoAction:
case SmartActions.ExitVehicle:
break;
case SmartActions.BecomePersonalCloneForPlayer:
{
@@ -2220,6 +2224,16 @@ namespace Game.AI
}
break;
}
case SmartActions.EnterVehicle:
case SmartActions.BoardPassenger:
{
if (e.Action.enterVehicle.seatId >= SharedConst.MaxVehicleSeats)
{
Log.outError(LogFilter.Sql, $"SmartAIMgr: {e} uses incorrect seat id (out of range 0 - {SharedConst.MaxVehicleSeats - 1}), skipped.");
return false;
}
break;
}
// No longer supported
case SmartActions.CallAreaexploredoreventhappens:
case SmartActions.CallGroupeventhappens:
@@ -3262,6 +3276,9 @@ namespace Game.AI
[FieldOffset(4)]
public DoAction doAction;
[FieldOffset(4)]
public EnterVehicle enterVehicle;
[FieldOffset(4)]
public Raw raw;
@@ -3816,6 +3833,10 @@ namespace Game.AI
{
public uint actionId;
}
public struct EnterVehicle
{
public uint seatId;
}
public struct Raw
{
public uint param1;