mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
Merge branch 'master' of https://github.com/ZhengPeiRu21/azerothcore-wotlk into Playerbot
This commit is contained in:
@@ -801,11 +801,11 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
|
||||
{
|
||||
if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage
|
||||
{
|
||||
LOG_DEBUG("entities.player", "We are fall to death, loosing 10 percents durability");
|
||||
DurabilityLossAll(0.10f, false);
|
||||
LOG_DEBUG("entities.player", "Player::EnvironmentalDamage: Player '{}' ({}) fall to death, losing {} durability",
|
||||
GetName(), GetGUID().ToString(), sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH));
|
||||
DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false);
|
||||
// durability lost message
|
||||
WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 0);
|
||||
GetSession()->SendPacket(&data2);
|
||||
SendDurabilityLoss();
|
||||
}
|
||||
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, 1, type);
|
||||
@@ -4592,6 +4592,11 @@ Corpse* Player::GetCorpse() const
|
||||
return GetMap()->GetCorpseByPlayer(GetGUID());
|
||||
}
|
||||
|
||||
void Player::SendDurabilityLoss()
|
||||
{
|
||||
SendDirectMessage(WorldPackets::Misc::DurabilityDamageDeath().Write());
|
||||
}
|
||||
|
||||
void Player::DurabilityLossAll(double percent, bool inventory)
|
||||
{
|
||||
for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++)
|
||||
|
||||
Reference in New Issue
Block a user