From 925cf8b8a9e5b65dc2a9fc914e13349b191f4640 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 18 Feb 2022 12:59:53 -0500 Subject: [PATCH] Core/PacketIO: updated SMSG_DURABILITY_DAMAGE_DEATH Port From (https://github.com/TrinityCore/TrinityCore/commit/e73735fa61a9ba92653826acbd32d9bd9069fc2b) --- Source/Game/Entities/Player/Player.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs index 3235aff42..84f8ccd81 100644 --- a/Source/Game/Entities/Player/Player.cs +++ b/Source/Game/Entities/Player/Player.cs @@ -3959,6 +3959,7 @@ namespace Game.Entities // check for GM and death state included in isAttackableByAOE return (!IsTargetableForAttack(false)); } + public uint EnvironmentalDamage(EnviromentalDamage type, uint damage) { if (IsImmuneToEnvironmentalDamage()) @@ -3997,10 +3998,10 @@ namespace Game.Entities { if (type == EnviromentalDamage.Fall) // DealDamage not apply item durability loss at self damage { - Log.outDebug(LogFilter.Player, "We are fall to death, loosing 10 percents durability"); - DurabilityLossAll(0.10f, false); + Log.outDebug(LogFilter.Player, $"Player::EnvironmentalDamage: Player '{GetName()}' ({GetGUID()}) fall to death, losing {WorldConfig.GetFloatValue(WorldCfg.RateDurabilityLossOnDeath)} durability"); + DurabilityLossAll(WorldConfig.GetFloatValue(WorldCfg.RateDurabilityLossOnDeath), false); // durability lost message - SendDurabilityLoss(this, 10); + SendDurabilityLoss(this, (uint)(WorldConfig.GetFloatValue(WorldCfg.RateDurabilityLossOnDeath) * 100.0f)); } UpdateCriteria(CriteriaType.DieFromEnviromentalDamage, 1, (ulong)type);