diff options
author | Subv <s.v.h21@hotmail.com> | 2012-04-19 18:33:25 -0500 |
---|---|---|
committer | Subv <s.v.h21@hotmail.com> | 2012-04-19 18:33:25 -0500 |
commit | a5aba350a087386e7d46f837c88e8c4e90eb7bd6 (patch) | |
tree | 33b21ae721d57335c7cfdbe2c6636c4bc58875a3 | |
parent | 479af777f1b75d1e62ae1bb59c6a2b62a6484009 (diff) |
Core/SmartAI: Allow SMART_ACTION_SUMMON_GO and SMART_ACTION_SUMMON_CREATURE to use x, y, z and o parameters as relative offsets for a summoning position (example, summon creature 20 yards in front of the invoker)
Signed-off-by: Subv <s.v.h21@hotmail.com>
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 209eb38e13a..31038faf369 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1119,12 +1119,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (!IsUnit(*itr)) - continue; - (*itr)->GetPosition(x, y, z, o); + x += e.target.x; + y += e.target.y; + z += e.target.z; + o += e.target.o; if (Creature* summon = GetBaseObject()->SummonCreature(e.action.summonCreature.creature, x, y, z, o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) - if (unit && e.action.summonCreature.attackInvoker) + if (e.action.summonCreature.attackInvoker) summon->AI()->AttackStart((*itr)->ToUnit()); } @@ -1154,6 +1155,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u continue; (*itr)->GetPosition(x, y, z, o); + x += e.target.x + y += e.target.y + z += e.target.z + o += e.target.o GetBaseObject()->SummonGameObject(e.action.summonGO.entry, x, y, z, o, 0, 0, 0, 0, e.action.summonGO.despawnTime); } |