mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-24 23:49:29 -04:00
Core/SAI: Added Action SMART_ACTION_DO_ACTION for calling DoAction on target AI (#27964)
This commit is contained in:
committed by
GitHub
parent
be800a983f
commit
a4eafbd3f6
@@ -2481,6 +2481,24 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_DO_ACTION:
|
||||
{
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
if (Unit* unitTarget = Object::ToUnit(target))
|
||||
{
|
||||
if (unitTarget->GetAI())
|
||||
unitTarget->GetAI()->DoAction(e.action.doAction.actionId);
|
||||
}
|
||||
else if (GameObject* goTarget = Object::ToGameObject(target))
|
||||
{
|
||||
if (goTarget->AI())
|
||||
goTarget->AI()->DoAction(e.action.doAction.actionId);
|
||||
}
|
||||
}
|
||||
|
||||
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