Core/SmartScripts: Rename SMART_ACTION_RESPAWN_TARGET -> SMART_ACTION_ENABLE_TEMP_GOBJ, since that's the only thing it still does in the dynspawn model. Adjust body accordingly to warn on misuse.

Port From (https://github.com/TrinityCore/TrinityCore/commit/32997a598992c5be7ad838b52b9e9a185d68d9fb)
This commit is contained in:
hondacrx
2021-08-09 09:57:11 -04:00
parent f2ff234456
commit 08db42917e
3 changed files with 17 additions and 10 deletions
+4 -5
View File
@@ -1420,19 +1420,18 @@ namespace Game.AI
}
break;
}
case SmartActions.RespawnTarget:
case SmartActions.EnableTempGobj:
{
foreach (var target in targets)
{
if (IsCreature(target))
target.ToCreature().Respawn();
Log.outWarn(LogFilter.Sql, $"Invalid creature target '{target.GetName()}' (entry {target.GetEntry()}, spawnId {target.ToCreature().GetSpawnId()}) specified for SMART_ACTION_ENABLE_TEMP_GOBJ");
else if (IsGameObject(target))
{
// do not modify respawndelay of already spawned gameobjects
if (target.ToGameObject().IsSpawnedByDefault())
target.ToGameObject().Respawn();
Log.outWarn(LogFilter.Sql, $"Invalid gameobject target '{target.GetName()}' (entry {target.GetEntry()}, spawnId {target.ToGameObject().GetSpawnId()}) for SMART_ACTION_ENABLE_TEMP_GOBJ - the object is spawned by default");
else
target.ToGameObject().SetRespawnTime((int)e.Action.respawnTarget.goRespawnTime);
target.ToGameObject().SetRespawnTime((int)e.Action.enableTempGO.duration);
}
}
break;