fix(Core/Items): Item sell prices are affected by durability loss. So… (#13801)

...urce: Vmangos.
This commit is contained in:
UltraNix 2022-11-21 22:51:40 +01:00 committed by GitHub
parent cb475290b4
commit 8f697bdaee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 8 deletions

View file

@ -3961,7 +3961,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
AutoUnequipOffhandIfNeed();
}
void Player::AddItemToBuyBackSlot(Item* pItem)
void Player::AddItemToBuyBackSlot(Item* pItem, uint32 money)
{
if (pItem)
{
@ -4003,10 +4003,7 @@ void Player::AddItemToBuyBackSlot(Item* pItem)
uint32 eslot = slot - BUYBACK_SLOT_START;
SetGuidValue(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID());
if (ItemTemplate const* proto = pItem->GetTemplate())
SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, proto->SellPrice * pItem->GetCount());
else
SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0);
SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, money);
SetUInt32Value(PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, (uint32)etime);
// move to next (for non filled list is move most optimized choice)