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 ca4f1e334a)
This commit is contained in:
Killyana
2018-02-16 02:19:19 +01:00
committed by Shauren
parent f0823eb048
commit 4b6e76a5ef
4 changed files with 14 additions and 5 deletions

View File

@@ -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: