Core/PacketIO: updated SMSG_DURABILITY_DAMAGE_DEATH
Port From (https://github.com/TrinityCore/TrinityCore/commit/e73735fa61a9ba92653826acbd32d9bd9069fc2b)
This commit is contained in:
@@ -3959,6 +3959,7 @@ namespace Game.Entities
|
|||||||
// check for GM and death state included in isAttackableByAOE
|
// check for GM and death state included in isAttackableByAOE
|
||||||
return (!IsTargetableForAttack(false));
|
return (!IsTargetableForAttack(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint EnvironmentalDamage(EnviromentalDamage type, uint damage)
|
public uint EnvironmentalDamage(EnviromentalDamage type, uint damage)
|
||||||
{
|
{
|
||||||
if (IsImmuneToEnvironmentalDamage())
|
if (IsImmuneToEnvironmentalDamage())
|
||||||
@@ -3997,10 +3998,10 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
if (type == EnviromentalDamage.Fall) // DealDamage not apply item durability loss at self damage
|
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");
|
Log.outDebug(LogFilter.Player, $"Player::EnvironmentalDamage: Player '{GetName()}' ({GetGUID()}) fall to death, losing {WorldConfig.GetFloatValue(WorldCfg.RateDurabilityLossOnDeath)} durability");
|
||||||
DurabilityLossAll(0.10f, false);
|
DurabilityLossAll(WorldConfig.GetFloatValue(WorldCfg.RateDurabilityLossOnDeath), false);
|
||||||
// durability lost message
|
// durability lost message
|
||||||
SendDurabilityLoss(this, 10);
|
SendDurabilityLoss(this, (uint)(WorldConfig.GetFloatValue(WorldCfg.RateDurabilityLossOnDeath) * 100.0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateCriteria(CriteriaType.DieFromEnviromentalDamage, 1, (ulong)type);
|
UpdateCriteria(CriteriaType.DieFromEnviromentalDamage, 1, (ulong)type);
|
||||||
|
|||||||
Reference in New Issue
Block a user