mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 04:32:35 -04:00
Core/SAI: Implemented SMART_ACTION_SEND_TARGET_TO_TARGET, it can be used to send targets previously stored with SMART_ACTION_STORE_TARGET, to another npc, the other npc can then access them as if it was its own stored list
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
This commit is contained in:
@@ -1794,6 +1794,38 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
delete targets;
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SEND_TARGET_TO_TARGET:
|
||||
{
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
|
||||
if (!targets)
|
||||
return;
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
bool smart = false;
|
||||
SmartAI* ai = NULL;
|
||||
if (IsGameObject(*itr))
|
||||
{
|
||||
smart = IsSmartGO((*itr)->ToGameObject());
|
||||
ai = CAST_AI(SmartAI, (*itr)->ToGameObject()->AI());
|
||||
}
|
||||
|
||||
if (IsCreature(*itr))
|
||||
{
|
||||
smart = IsSmart((*itr)->ToCreature());
|
||||
ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI());
|
||||
}
|
||||
|
||||
if (smart && ai)
|
||||
ai->GetScript()->StoreTargetList(GetTargetList(e.action.sendTargetToTarget.id), e.action.sendTargetToTarget.id);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SEND_GOSSIP_MENU:
|
||||
{
|
||||
if (!GetBaseObject())
|
||||
|
||||
Reference in New Issue
Block a user