diff options
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 32 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.h | 8 |
2 files changed, 39 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 4328eafc962..1224be0e1ae 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -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()) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 6b99a7dc5be..e08fe331d3d 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -473,8 +473,9 @@ enum SMART_ACTION SMART_ACTION_JUMP_TO_POS = 97, // speedXY, speedZ, targetX, targetY, targetZ SMART_ACTION_SEND_GOSSIP_MENU = 98, // menuId, optionId SMART_ACTION_GO_SET_LOOT_STATE = 99, // state + SMART_ACTION_SEND_TARGET_TO_TARGET = 100, // id - SMART_ACTION_END = 100, + SMART_ACTION_END = 101, }; struct SmartAction @@ -885,6 +886,11 @@ struct SmartAction struct { + uint32 id; + } sendTargetToTarget; + + struct + { uint32 param1; uint32 param2; uint32 param3; |