Core/SAI: Implemented new event type SMART_EVENT_AREATRIGGER_EXIT (88)

Port From (https://github.com/TrinityCore/TrinityCore/commit/0d5242daae3fab31ffc73faafa21ad65e5cd9670)
This commit is contained in:
Hondacrx
2024-11-11 10:46:00 -05:00
parent 29acfba7d3
commit 21eca77ad8
5 changed files with 31 additions and 47 deletions
+11 -5
View File
@@ -17,13 +17,19 @@ namespace Scripts.Smart
public override bool OnTrigger(Player player, AreaTriggerRecord trigger)
{
if (!player.IsAlive())
return false;
Log.outDebug(LogFilter.ScriptsAi, "AreaTrigger {0} is using SmartTrigger script", trigger.Id);
Log.outDebug(LogFilter.ScriptsAi, $"AreaTrigger {trigger.Id} is using SmartTrigger script");
SmartScript script = new();
script.OnInitialize(player, trigger);
script.ProcessEventsFor(SmartEvents.AreatriggerOntrigger, player, trigger.Id);
script.ProcessEventsFor(SmartEvents.AreatriggerEnter, player);
return true;
}
public override bool OnExit(Player player, AreaTriggerRecord trigger)
{
Log.outDebug(LogFilter.ScriptsAi, $"AreaTrigger {trigger.Id} exit is using SmartTrigger script");
SmartScript script = new();
script.OnInitialize(player, trigger);
script.ProcessEventsFor(SmartEvents.AreatriggerExit, player);
return true;
}
}