mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
feat(Core/SAI): Implement SMART_ACTION_SET_GUID (#15978)
* feat(Core/SAI): Implement SMART_ACTION_SET_GUID * Update SmartScript.cpp * Update src/server/game/AI/SmartScripts/SmartScriptMgr.h * Update SmartScript.cpp
This commit is contained in:
@@ -2688,6 +2688,31 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_GUID:
|
||||
{
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
ObjectGuid guidToSend = me ? me->GetGUID() : go->GetGUID();
|
||||
|
||||
if (e.action.setGuid.invokerGUID)
|
||||
{
|
||||
if (Unit* invoker = GetLastInvoker())
|
||||
{
|
||||
guidToSend = invoker->GetGUID();
|
||||
}
|
||||
}
|
||||
|
||||
if (Creature* creature = target->ToCreature())
|
||||
{
|
||||
creature->AI()->SetGUID(guidToSend, e.action.setGuid.index);
|
||||
}
|
||||
else if (GameObject* object = target->ToGameObject())
|
||||
{
|
||||
object->AI()->SetGUID(guidToSend, e.action.setGuid.index);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry {} SourceType {}, Event {}, Unhandled Action type {}", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user