Core/SAI: Implemented new source type SMART_SCRIPT_TYPE_EVENT (3)
Port From (https://github.com/TrinityCore/TrinityCore/commit/d015711fbb7a8bf57f7bb64ba8113c942d5125de)
This commit is contained in:
@@ -115,4 +115,19 @@ namespace Scripts.Smart
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class SmartEventTrigger : EventScript
|
||||
{
|
||||
public SmartEventTrigger() : base("SmartEventTrigger") { }
|
||||
|
||||
void OnTrigger(WorldObject obj, WorldObject invoker, uint eventId)
|
||||
{
|
||||
Log.outDebug(LogFilter.ScriptsAi, $"Event {eventId} is using SmartEventTrigger script");
|
||||
SmartScript script = new();
|
||||
// Set invoker as BaseObject if there isn't target for GameEvents::Trigger
|
||||
script.OnInitialize(obj?? invoker, null, null, null, eventId);
|
||||
script.ProcessEventsFor(SmartEvents.SendEventTrigger, invoker.ToUnit(), 0, 0, false, null, invoker.ToGameObject());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user