mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-24 23:49:29 -04:00
Core/SAI: Implemented new action SMART_ACTION_TRIGGER_GAME_EVENT
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "CreatureTextMgr.h"
|
||||
#include "CreatureTextMgrImpl.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "GameEventSender.h"
|
||||
#include "GameObject.h"
|
||||
#include "GossipDef.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
@@ -2467,6 +2468,19 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
Trinity::Containers::EraseIf(mTimedActionList, [e](SmartScriptHolder const& script) { return script.event_id > e.event_id; });
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_TRIGGER_GAME_EVENT:
|
||||
{
|
||||
WorldObject* sourceObject = GetBaseObjectOrUnit(unit);
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
if (e.action.triggerGameEvent.useSaiTargetAsGameEventSource)
|
||||
GameEvents::Trigger(e.action.triggerGameEvent.eventId, sourceObject, target);
|
||||
else
|
||||
GameEvents::Trigger(e.action.triggerGameEvent.eventId, target, sourceObject);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
TC_LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry " SI64FMTD " SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user