mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 12:47:07 +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++)
|
||||
|
||||
@@ -1976,6 +1976,7 @@ public:
|
||||
void BuildPlayerRepop();
|
||||
void RepopAtGraveyard();
|
||||
|
||||
void SendDurabilityLoss();
|
||||
void DurabilityLossAll(double percent, bool inventory);
|
||||
void DurabilityLoss(Item* item, double percent);
|
||||
void DurabilityPointsLossAll(int32 points, bool inventory);
|
||||
|
||||
@@ -17343,8 +17343,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
||||
LOG_DEBUG("entities.unit", "We are dead, losing {} percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH));
|
||||
plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false);
|
||||
// durability lost message
|
||||
WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0);
|
||||
plrVictim->GetSession()->SendPacket(&data);
|
||||
plrVictim->SendDurabilityLoss();
|
||||
}
|
||||
// Call KilledUnit for creatures
|
||||
if (killer && killer->GetTypeId() == TYPEID_UNIT && killer->IsAIEnabled)
|
||||
|
||||
@@ -114,6 +114,14 @@ namespace WorldPackets
|
||||
ObjectGuid Roller;
|
||||
};
|
||||
|
||||
class DurabilityDamageDeath final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
DurabilityDamageDeath() : ServerPacket(SMSG_DURABILITY_DAMAGE_DEATH, 0) { }
|
||||
|
||||
WorldPacket const* Write() override { return &_worldPacket; }
|
||||
};
|
||||
|
||||
class CrossedInebriationThreshold final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
@@ -124,6 +132,7 @@ namespace WorldPackets
|
||||
ObjectGuid Guid;
|
||||
uint32 Threshold = 0;
|
||||
uint32 ItemID = 0;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1051,7 +1051,7 @@ public:
|
||||
if (show == "off")
|
||||
{
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_BY_ID);
|
||||
stmt->SetData(0, 1);
|
||||
stmt->SetArguments(1, 1, 1);
|
||||
|
||||
PreparedQueryResult result = WorldDatabase.Query(stmt);
|
||||
if (!result)
|
||||
|
||||
@@ -2471,6 +2471,7 @@ DurabilityLoss.InPvP = 0
|
||||
#
|
||||
# DurabilityLoss.OnDeath
|
||||
# Description: Durability loss percentage on death.
|
||||
# Note: On 3.3.5 client always shows log message "Your items have lost 10% durability"
|
||||
# Default: 10
|
||||
|
||||
DurabilityLoss.OnDeath = 10
|
||||
|
||||
Reference in New Issue
Block a user