mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 11:43:18 -04:00
Core/SAI: Add SAI action to create a conversation (#26169)
This commit is contained in:
@@ -2362,6 +2362,25 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_TALK_CONVERSATION:
|
||||
{
|
||||
if (WorldObject* baseObject = GetBaseObject())
|
||||
{
|
||||
for (WorldObject* const target : targets)
|
||||
{
|
||||
if (Player* playerTarget = target->ToPlayer())
|
||||
{
|
||||
Conversation* conversation = Conversation::CreateConversation(e.action.conversation.id, playerTarget,
|
||||
*playerTarget, { playerTarget->GetGUID() }, nullptr);
|
||||
if (!conversation)
|
||||
TC_LOG_WARN("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_TALK_CONVERSATION: id %u, baseObject %s, target %s - failed to create",
|
||||
e.action.conversation.id, baseObject->GetName().c_str(), playerTarget->GetName().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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