diff options
| author | Killyana <morphone1@gmail.com> | 2018-02-16 02:19:19 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2021-06-22 12:51:28 +0200 |
| commit | 4b6e76a5efe5e48ff20b4ef84e0f3dc0f9bc84a0 (patch) | |
| tree | 02c562efb775d051a404f5dd85d7f787e32e1f4f /src/server/game/AI/SmartScripts | |
| parent | f0823eb0480b79f48f4cd2739b3e02491735d638 (diff) | |
Core/SAI: Add an action_param3 to "summon gob" to control when the object will despawn
0 - For despawn when creature dies or time runs out
1 - For despawn after time
Closes #11601
(cherry picked from commit ca4f1e334a98cbd810168b24714c46201079fc5a)
Diffstat (limited to 'src/server/game/AI/SmartScripts')
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 39c46ef3b7c..0b87e9b2fdf 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1261,13 +1261,15 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u for (WorldObject* target : targets) { Position pos = target->GetPositionWithOffset(Position(e.target.x, e.target.y, e.target.z, e.target.o)); - summoner->SummonGameObject(e.action.summonGO.entry, pos, QuaternionData::fromEulerAnglesZYX(pos.GetOrientation(), 0.f, 0.f), e.action.summonGO.despawnTime); + QuaternionData rot = QuaternionData::fromEulerAnglesZYX(pos.GetOrientation(), 0.f, 0.f); + summoner->SummonGameObject(e.action.summonGO.entry, pos, rot, e.action.summonGO.despawnTime, GOSummonType(e.action.summonGO.summonType)); } if (e.GetTargetType() != SMART_TARGET_POSITION) break; - summoner->SummonGameObject(e.action.summonGO.entry, Position(e.target.x, e.target.y, e.target.z, e.target.o), QuaternionData::fromEulerAnglesZYX(e.target.o, 0.f, 0.f), e.action.summonGO.despawnTime); + QuaternionData rot = QuaternionData::fromEulerAnglesZYX(e.target.o, 0.f, 0.f); + summoner->SummonGameObject(e.action.summonGO.entry, Position(e.target.x, e.target.y, e.target.z, e.target.o), rot, e.action.summonGO.despawnTime, GOSummonType(e.action.summonGO.summonType)); break; } case SMART_ACTION_KILL_UNIT: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 424e1c92f2f..04bc91c9c0f 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -851,6 +851,7 @@ struct SmartAction { uint32 entry; uint32 despawnTime; + uint32 summonType; } summonGO; struct |
