Core/PacketIO: updated SMSG_DURABILITY_DAMAGE_DEATH

Port From (https://github.com/TrinityCore/TrinityCore/commit/e73735fa61a9ba92653826acbd32d9bd9069fc2b)
This commit is contained in:
hondacrx
2022-02-18 12:59:53 -05:00
parent a604bbd7f9
commit 925cf8b8a9
+4 -3
View File
@@ -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);