Core/SAI: Add an action_param3 to "summon gob" to control when the object will despawn
Port From (https://github.com/TrinityCore/TrinityCore/commit/4b6e76a5efe5e48ff20b4ef84e0f3dc0f9bc84a0)
This commit is contained in:
@@ -1456,7 +1456,7 @@ namespace Game.Entities
|
||||
return null;
|
||||
}
|
||||
|
||||
public GameObject SummonGameObject(uint entry, float x, float y, float z, float ang, Quaternion rotation, uint respawnTime)
|
||||
public GameObject SummonGameObject(uint entry, float x, float y, float z, float ang, Quaternion rotation, uint respawnTime, GameObjectSummonType summonType = GameObjectSummonType.TimedOrCorpseDespawn)
|
||||
{
|
||||
if (x == 0 && y == 0 && z == 0)
|
||||
{
|
||||
@@ -1465,10 +1465,10 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
Position pos = new(x, y, z, ang);
|
||||
return SummonGameObject(entry, pos, rotation, respawnTime);
|
||||
return SummonGameObject(entry, pos, rotation, respawnTime, summonType);
|
||||
}
|
||||
|
||||
public GameObject SummonGameObject(uint entry, Position pos, Quaternion rotation, uint respawnTime)
|
||||
public GameObject SummonGameObject(uint entry, Position pos, Quaternion rotation, uint respawnTime, GameObjectSummonType summonType = GameObjectSummonType.TimedOrCorpseDespawn)
|
||||
{
|
||||
if (!IsInWorld)
|
||||
return null;
|
||||
@@ -1488,7 +1488,7 @@ namespace Game.Entities
|
||||
PhasingHandler.InheritPhaseShift(go, this);
|
||||
|
||||
go.SetRespawnTime((int)respawnTime);
|
||||
if (IsTypeId(TypeId.Player) || IsTypeId(TypeId.Unit)) //not sure how to handle this
|
||||
if (IsPlayer() || (IsCreature() && summonType == GameObjectSummonType.TimedOrCorpseDespawn)) //not sure how to handle this
|
||||
ToUnit().AddGameObject(go);
|
||||
else
|
||||
go.SetSpawnedByDefault(false);
|
||||
|
||||
Reference in New Issue
Block a user