feat(Core/Maps): Implement dynamic respawn rates (#21417)
Co-authored-by: r00ty-tc <r00ty-tc@users.noreply.github.com> Co-authored-by: Jelle Meeus <sogladev@gmail.com> Co-authored-by Treeston This is a partial cherry-pick of: https://github.com/TrinityCore/TrinityCore/pull/19056/commits/59db2eeea0a35028779fd76372ae06cc98c8086f
This commit is contained in:
@@ -1974,6 +1974,7 @@ 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;
|
||||
|
||||
// always save boss respawn time at death to prevent crash cheating
|
||||
|
||||
@@ -897,6 +897,7 @@ void GameObject::Update(uint32 diff)
|
||||
return;
|
||||
}
|
||||
|
||||
GetMap()->ApplyDynamicModeRespawnScaling(this, m_respawnDelayTime);
|
||||
m_respawnTime = GameTime::GetGameTime().count() + m_respawnDelayTime;
|
||||
|
||||
// if option not set then object will be saved at grid unload
|
||||
|
||||
@@ -1245,9 +1245,7 @@ void Player::UpdateArea(uint32 newArea)
|
||||
void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
||||
{
|
||||
if (!newZone)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_zoneUpdateId != newZone)
|
||||
{
|
||||
@@ -1264,6 +1262,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
||||
guild->UpdateMemberData(this, GUILD_MEMBER_DATA_ZONEID, newZone);
|
||||
}
|
||||
|
||||
GetMap()->UpdatePlayerZoneStats(m_zoneUpdateId, newZone);
|
||||
|
||||
// group update
|
||||
if (GetGroup())
|
||||
SetGroupUpdateFlag(GROUP_UPDATE_FULL);
|
||||
|
||||
Reference in New Issue
Block a user