Add respawn timer to smartscript despawn

This commit is contained in:
hondacrx
2017-07-24 14:05:36 -04:00
parent cbf11e07ae
commit 4b447a3aa4
3 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -1071,11 +1071,11 @@ namespace Game.AI
Creature target = obj.ToCreature();
if (target.IsAlive() && IsSmart(target))
{
((SmartAI)target.GetAI()).SetDespawnTime(e.Action.forceDespawn.delay + 1); // Next tick
((SmartAI)target.GetAI()).SetDespawnTime(e.Action.forceDespawn.delay + 1, e.Action.forceDespawn.respawn); // Next tick
((SmartAI)target.GetAI()).StartDespawn();
}
else
target.DespawnOrUnsummon(e.Action.forceDespawn.delay);
target.DespawnOrUnsummon(e.Action.forceDespawn.delay, TimeSpan.FromSeconds(e.Action.forceDespawn.respawn));
}
else if (obj.IsTypeId(TypeId.GameObject))
{