diff --git a/Source/Game/AI/CoreAI/CreatureAI.cs b/Source/Game/AI/CoreAI/CreatureAI.cs index 255fe7e5e..ed2ce3d0a 100644 --- a/Source/Game/AI/CoreAI/CreatureAI.cs +++ b/Source/Game/AI/CoreAI/CreatureAI.cs @@ -437,8 +437,8 @@ namespace Game.AI public virtual bool IsEscorted() { return false; } - // Called when creature is spawned or respawned - public virtual void JustRespawned() { } + // Called when creature appears in the world (spawn, respawn, grid load etc...) + public virtual void JustAppeared() { } public virtual void MovementInform(MovementGeneratorType type, uint id) { } diff --git a/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs b/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs index 7da034a09..c58835574 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs @@ -140,7 +140,7 @@ namespace Game.AI } } - public override void JustRespawned() + public override void JustAppeared() { m_uiEscortState = EscortState.None; diff --git a/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs b/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs index e4918eae7..4d1989f6e 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs @@ -147,7 +147,7 @@ namespace Game.AI } } - public override void JustRespawned() + public override void JustAppeared() { m_uiFollowState = FollowState.None; diff --git a/Source/Game/AI/SmartScripts/SmartAI.cs b/Source/Game/AI/SmartScripts/SmartAI.cs index 99cc58c73..e2836b68a 100644 --- a/Source/Game/AI/SmartScripts/SmartAI.cs +++ b/Source/Game/AI/SmartScripts/SmartAI.cs @@ -551,7 +551,7 @@ namespace Game.AI return false; } - public override void JustRespawned() + public override void JustAppeared() { mDespawnTime = 0; mRespawnTime = 0; diff --git a/Source/Game/Chat/Commands/ListCommands.cs b/Source/Game/Chat/Commands/ListCommands.cs index b9198398f..907877f76 100644 --- a/Source/Game/Chat/Commands/ListCommands.cs +++ b/Source/Game/Chat/Commands/ListCommands.cs @@ -661,7 +661,7 @@ namespace Game.Chat.Commands Map map = player.GetMap(); uint mapId = map.GetId(); bool showAll = map.IsBattlegroundOrArena() || map.IsDungeon(); - handler.SendSysMessage("Listing all spawn points in map %u (%s)%s:", mapId, map.GetMapName(), showAll ? "" : " within 5000yd"); + handler.SendSysMessage($"Listing all spawn points in map {mapId} ({map.GetMapName()}){(showAll ? "" : " within 5000yd")}:"); foreach (var pair in Global.ObjectMgr.GetAllCreatureData()) { diff --git a/Source/Game/Chat/Commands/NPCCommands.cs b/Source/Game/Chat/Commands/NPCCommands.cs index 01731cc38..bed23e37b 100644 --- a/Source/Game/Chat/Commands/NPCCommands.cs +++ b/Source/Game/Chat/Commands/NPCCommands.cs @@ -222,8 +222,8 @@ namespace Game.Chat } - // Attempting creature load from DB data - CreatureData data = Global.ObjectMgr.GetCreatureData(lowguid); + // Attempting creature load from DB data + CreatureData data = Global.ObjectMgr.GetCreatureData(lowguid); if (data == null) { handler.SendSysMessage(CypherStrings.CommandCreatguidnotfound, lowguid); diff --git a/Source/Game/Entities/Creature/Creature.Fields.cs b/Source/Game/Entities/Creature/Creature.Fields.cs index 949ff1a70..4a23ffb7e 100644 --- a/Source/Game/Entities/Creature/Creature.Fields.cs +++ b/Source/Game/Entities/Creature/Creature.Fields.cs @@ -70,7 +70,7 @@ namespace Game.Entities //Formation var CreatureGroup m_formation; - bool TriggerJustRespawned; + bool triggerJustAppeared; bool m_respawnCompatibilityMode; public uint[] m_spells = new uint[SharedConst.MaxCreatureSpells]; diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index d0a314fa8..e34dfbf5a 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -44,6 +44,7 @@ namespace Game.Entities DefaultMovementType = MovementGeneratorType.Idle; m_regenHealth = true; m_meleeDamageSchoolMask = SpellSchoolMask.Normal; + triggerJustAppeared = true; RegenTimer = SharedConst.CreatureRegenInterval; @@ -378,10 +379,10 @@ namespace Game.Entities public override void Update(uint diff) { - if (IsAIEnabled && TriggerJustRespawned) + if (IsAIEnabled && triggerJustAppeared && m_deathState == DeathState.Alive) { - TriggerJustRespawned = false; - GetAI().JustRespawned(); + triggerJustAppeared = false; + GetAI().JustAppeared(); if (VehicleKit != null) VehicleKit.Reset(); } @@ -1736,13 +1737,10 @@ namespace Game.Entities //Re-initialize reactstate that could be altered by movementgenerators InitializeReactState(); - //Call AI respawn virtual function//Call AI respawn virtual function - if (IsAIEnabled) - { - //reset the AI to be sure no dirty or uninitialized values will be used till next tick + if (IsAIEnabled) // reset the AI to be sure no dirty or uninitialized values will be used till next tick GetAI().Reset(); - TriggerJustRespawned = true;//delay event to next tick so all creatures are created on the map before processing - } + + triggerJustAppeared = true; uint poolid = GetSpawnId() != 0 ? Global.PoolMgr.IsPartOfAPool(GetSpawnId()) : 0; if (poolid != 0) diff --git a/Source/Game/Entities/Unit/Unit.Movement.cs b/Source/Game/Entities/Unit/Unit.Movement.cs index 7aa68b48f..a73c46f4f 100644 --- a/Source/Game/Entities/Unit/Unit.Movement.cs +++ b/Source/Game/Entities/Unit/Unit.Movement.cs @@ -16,16 +16,16 @@ */ using Framework.Constants; +using Framework.Dynamic; using Framework.GameMath; using Game.BattleGrounds; using Game.DataStorage; using Game.Maps; using Game.Movement; using Game.Networking.Packets; +using Game.Spells; using System; using System.Collections.Generic; -using Game.Spells; -using Framework.Dynamic; namespace Game.Entities { diff --git a/Source/Game/Server/WorldConfig.cs b/Source/Game/Server/WorldConfig.cs index 7fce846f3..971e9e239 100644 --- a/Source/Game/Server/WorldConfig.cs +++ b/Source/Game/Server/WorldConfig.cs @@ -784,7 +784,7 @@ namespace Game Log.outError(LogFilter.ServerLoading, $"Invalid value for Respawn.DynamicMode ({Values[WorldCfg.RespawnDynamicMode]}). Set to 0."); Values[WorldCfg.RespawnDynamicMode] = 0; } - Values[WorldCfg.RespawnDynamicEscortNpc] = GetDefaultValue("Respawn.DynamicEscortNPC", true); + Values[WorldCfg.RespawnDynamicEscortNpc] = GetDefaultValue("Respawn.DynamicEscortNPC", false); Values[WorldCfg.RespawnGuidWarnLevel] = GetDefaultValue("Respawn.GuidWarnLevel", 12000000); if ((int)Values[WorldCfg.RespawnGuidWarnLevel] > 16777215) { diff --git a/Source/Scripts/Northrend/AzjolNerub/AzjolNerub/BossKrikthirTheGatewatcher.cs b/Source/Scripts/Northrend/AzjolNerub/AzjolNerub/BossKrikthirTheGatewatcher.cs index 45fb1c863..36c42ca6c 100644 --- a/Source/Scripts/Northrend/AzjolNerub/AzjolNerub/BossKrikthirTheGatewatcher.cs +++ b/Source/Scripts/Northrend/AzjolNerub/AzjolNerub/BossKrikthirTheGatewatcher.cs @@ -131,9 +131,9 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.KrikthirTheGatewatcher SummonAdds(); } - public override void JustRespawned() + public override void JustAppeared() { - base.JustRespawned(); + base.JustAppeared(); SummonAdds(); } diff --git a/Source/Scripts/Northrend/AzjolNerub/AzjolNerub/BossNadronox.cs b/Source/Scripts/Northrend/AzjolNerub/AzjolNerub/BossNadronox.cs index a96667960..360f6a383 100644 --- a/Source/Scripts/Northrend/AzjolNerub/AzjolNerub/BossNadronox.cs +++ b/Source/Scripts/Northrend/AzjolNerub/AzjolNerub/BossNadronox.cs @@ -373,9 +373,9 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.Nadronox Initialize(); } - public override void JustRespawned() + public override void JustAppeared() { - base.JustRespawned(); + base.JustAppeared(); Initialize(); } diff --git a/Source/Scripts/Northrend/Ulduar/Mimiron.cs b/Source/Scripts/Northrend/Ulduar/Mimiron.cs index f6584f06d..ea53bd603 100644 --- a/Source/Scripts/Northrend/Ulduar/Mimiron.cs +++ b/Source/Scripts/Northrend/Ulduar/Mimiron.cs @@ -486,7 +486,7 @@ namespace Scripts.Northrend.Ulduar _events.ScheduleEvent(Events.Outtro1, 7000); } - public override void JustRespawned() + public override void JustAppeared() { //SetupEncounter(); } @@ -922,7 +922,7 @@ namespace Scripts.Northrend.Ulduar } } - public override void JustRespawned() + public override void JustAppeared() { SetupEncounter(); } diff --git a/Source/WorldServer/WorldServer.conf.dist b/Source/WorldServer/WorldServer.conf.dist index ca0448086..2dd1ad803 100644 --- a/Source/WorldServer/WorldServer.conf.dist +++ b/Source/WorldServer/WorldServer.conf.dist @@ -1740,7 +1740,7 @@ Respawn.DynamicMode = 0 # 1 - Enabled # Default: 0 - Disabled -Respawn.DynamicEscortNPC = 1 +Respawn.DynamicEscortNPC = 0 # # Respawn.DynamicRateCreature