diff --git a/Game/AI/SmartScripts/SmartAI.cs b/Game/AI/SmartScripts/SmartAI.cs index 7b943b405..44efb3b51 100644 --- a/Game/AI/SmartScripts/SmartAI.cs +++ b/Game/AI/SmartScripts/SmartAI.cs @@ -95,7 +95,7 @@ namespace Game.AI mDespawnState++; } else - me.DespawnOrUnsummon(); + me.DespawnOrUnsummon(0, TimeSpan.FromSeconds(mRespawnTime)); } else mDespawnTime -= diff; @@ -549,6 +549,7 @@ namespace Game.AI public override void JustRespawned() { mDespawnTime = 0; + mRespawnTime = 0; mDespawnState = 0; mEscortState = SmartEscortState.None; me.SetVisible(true); @@ -907,9 +908,10 @@ namespace Game.AI public void SetInvincibilityHpLevel(uint level) { mInvincibilityHpLevel = level; } - public void SetDespawnTime(uint t) + public void SetDespawnTime(uint t, uint r = 0) { mDespawnTime = t; + mRespawnTime = r; mDespawnState = (uint)(t != 0 ? 1 : 0); } @@ -945,6 +947,7 @@ namespace Game.AI uint mInvincibilityHpLevel; uint mDespawnTime; + uint mRespawnTime; uint mDespawnState; public uint mEscortQuestID; diff --git a/Game/AI/SmartScripts/SmartAIManager.cs b/Game/AI/SmartScripts/SmartAIManager.cs index 885efc1d2..4559d0c9d 100644 --- a/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Game/AI/SmartScripts/SmartAIManager.cs @@ -2348,6 +2348,7 @@ namespace Game.AI public struct ForceDespawn { public uint delay; + public uint respawn; } public struct InvincHP { diff --git a/Game/AI/SmartScripts/SmartScript.cs b/Game/AI/SmartScripts/SmartScript.cs index 852edc9ba..dc5e83dfb 100644 --- a/Game/AI/SmartScripts/SmartScript.cs +++ b/Game/AI/SmartScripts/SmartScript.cs @@ -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)) {