Skip to content

Commit 7e13d17

Browse files
IjostromIjostrom
andauthored
feat(Core/Config): Resurrection durability loss percentage (azerothcore#25715)
Co-authored-by: Ijostrom <skylarburk@mail.com>
1 parent f4be7b1 commit 7e13d17

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/server/apps/worldserver/worldserver.conf.dist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,6 +2606,14 @@ DurabilityLoss.InPvP = 0
26062606

26072607
DurabilityLoss.OnDeath = 10
26082608

2609+
#
2610+
# DurabilityLoss.OnSpiritResurrect
2611+
# Description: Durability loss percentage on spirit healer resurrection. Does not effect PvP
2612+
# spirit healers.
2613+
# Default: 25
2614+
2615+
DurabilityLoss.OnSpiritResurrect = 25
2616+
26092617
#
26102618
# DurabilityLossChance.Damage
26112619
# Description: Chance to lose durability on one equipped item from damage.

src/server/game/Handlers/NPCHandler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,9 @@ void WorldSession::SendSpiritResurrect()
262262
{
263263
_player->ResurrectPlayer(0.5f, true);
264264

265-
_player->DurabilityLossAll(0.25f, true);
265+
float durabilityLossOnSpiritResurrect = sWorld->getRate(RATE_DURABILITY_LOSS_ON_SPIRIT_RESURRECT) / 100.0f;
266+
if (durabilityLossOnSpiritResurrect)
267+
_player->DurabilityLossAll(durabilityLossOnSpiritResurrect, true);
266268

267269
// get corpse nearest graveyard
268270
GraveyardStruct const* corpseGrave = nullptr;

src/server/game/World/WorldConfig.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ void WorldConfig::BuildConfigCache()
138138

139139
SetConfigValue<float>(RATE_DURABILITY_LOSS_ON_DEATH, "DurabilityLoss.OnDeath", 10.0f, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value >= 0.0f && value <= 100.0f; }, ">= 0 && <= 100");
140140

141+
SetConfigValue<float>(RATE_DURABILITY_LOSS_ON_SPIRIT_RESURRECT, "DurabilityLoss.OnSpiritResurrect", 25.0f, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value >= 0.0f && value <= 100.0f; }, ">= 0 && <= 100");
142+
141143
SetConfigValue<float>(RATE_DURABILITY_LOSS_DAMAGE, "DurabilityLossChance.Damage", 0.5f, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value >= 0.0f; }, ">= 0");
142144
SetConfigValue<float>(RATE_DURABILITY_LOSS_ABSORB, "DurabilityLossChance.Absorb", 0.5f, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value >= 0.0f; }, ">= 0");
143145
SetConfigValue<float>(RATE_DURABILITY_LOSS_PARRY, "DurabilityLossChance.Parry", 0.05f, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value >= 0.0f; }, ">= 0");

src/server/game/World/WorldConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ enum ServerConfigs
480480
RATE_CORPSE_DECAY_LOOTED,
481481
RATE_INSTANCE_RESET_TIME,
482482
RATE_DURABILITY_LOSS_ON_DEATH,
483+
RATE_DURABILITY_LOSS_ON_SPIRIT_RESURRECT,
483484
RATE_DURABILITY_LOSS_DAMAGE,
484485
RATE_DURABILITY_LOSS_PARRY,
485486
RATE_DURABILITY_LOSS_ABSORB,

0 commit comments

Comments
 (0)