fix(Core/Map): Dynamic respawns: preserve original respawn timer and skip rares (#21440)

This commit is contained in:
Andrew
2025-02-14 07:30:59 -03:00
committed by GitHub
parent db9b4cf0c6
commit 062f9c4341
4 changed files with 17 additions and 15 deletions

View File

@@ -1975,8 +1975,8 @@ void Creature::setDeathState(DeathState state, bool despawn)
if (state == DeathState::JustDied)
{
m_corpseRemoveTime = GameTime::GetGameTime().count() + m_corpseDelay;
GetMap()->ApplyDynamicModeRespawnScaling(this, m_respawnDelay);
m_respawnTime = GameTime::GetGameTime().count() + m_respawnDelay + m_corpseDelay;
uint32 dynamicRespawnDelay = GetMap()->ApplyDynamicModeRespawnScaling(this, m_respawnDelay);
m_respawnTime = GameTime::GetGameTime().count() + dynamicRespawnDelay + m_corpseDelay;
// always save boss respawn time at death to prevent crash cheating
if (GetMap()->IsDungeon() || isWorldBoss() || GetCreatureTemplate()->rank >= CREATURE_ELITE_ELITE)

View File

@@ -897,8 +897,8 @@ void GameObject::Update(uint32 diff)
return;
}
GetMap()->ApplyDynamicModeRespawnScaling(this, m_respawnDelayTime);
m_respawnTime = GameTime::GetGameTime().count() + m_respawnDelayTime;
uint32 dynamicRespawnDelay = GetMap()->ApplyDynamicModeRespawnScaling(this, m_respawnDelayTime);
m_respawnTime = GameTime::GetGameTime().count() + dynamicRespawnDelay;
// if option not set then object will be saved at grid unload
if (GetMap()->IsDungeon())