Revert revisions 67325b1a0af0 and a0cba24b9060.

Made vendors ignore gold cost by default when extended cost is set, except when item has ITEM_FLAGS_EXTRA_EXT_COST_REQUIRES_GOLD flag

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-07-15 10:12:51 +02:00
parent 26582fd48b
commit 894a065203
10 changed files with 49 additions and 43 deletions
+12 -12
View File
@@ -19655,12 +19655,12 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
return false;
}
if (uint32 extendedCostId = crItem->GetExtendedCostId())
if (crItem->ExtendedCost)
{
ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(extendedCostId);
ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost);
if (!iece)
{
sLog.outError("Item %u have wrong ExtendedCost field value %u", pProto->ItemId, extendedCostId);
sLog.outError("Item %u have wrong ExtendedCost field value %u", pProto->ItemId, crItem->ExtendedCost);
return false;
}
@@ -19697,7 +19697,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
}
}
int32 price = crItem->IsExcludeMoneyPrice() ? 0 : pProto->BuyPrice * count;
int32 price = crItem->IsGoldRequired(pProto) ? pProto->BuyPrice * count : 0;
// reputation discount
if (price)
@@ -19721,9 +19721,9 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
ModifyMoney(-(int32)price);
if (uint32 extendedCostId = crItem->GetExtendedCostId()) // case for new honor system
if (crItem->ExtendedCost) // case for new honor system
{
ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(extendedCostId);
ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost);
if (iece->reqhonorpoints)
ModifyHonorPoints(- int32(iece->reqhonorpoints * count));
@@ -19749,11 +19749,11 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
GetSession()->SendPacket(&data);
SendNewItem(it, pProto->BuyCount*count, true, false, false);
if (it->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE) && crItem->GetExtendedCostId())
if (it->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE) && crItem->ExtendedCost)
{
it->SetRefundRecipient(GetGUIDLow());
it->SetPaidMoney(price);
it->SetPaidExtendedCost(crItem->GetExtendedCostId());
it->SetPaidExtendedCost(crItem->ExtendedCost);
it->SaveRefundDataToDB();
AddRefundReference(it->GetGUIDLow());
}
@@ -19776,9 +19776,9 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
}
ModifyMoney(-(int32)price);
if (uint32 extendedCostId = crItem->GetExtendedCostId()) // case for new honor system
if (crItem->ExtendedCost) // case for new honor system
{
ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(extendedCostId);
ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost);
if (iece->reqhonorpoints)
ModifyHonorPoints(- int32(iece->reqhonorpoints * count));
@@ -19807,11 +19807,11 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
AutoUnequipOffhandIfNeed();
if (it->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE) && crItem->GetExtendedCostId())
if (it->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE) && crItem->ExtendedCost)
{
it->SetRefundRecipient(GetGUIDLow());
it->SetPaidMoney(price);
it->SetPaidExtendedCost(crItem->GetExtendedCostId());
it->SetPaidExtendedCost(crItem->ExtendedCost);
it->SaveRefundDataToDB();
AddRefundReference(it->GetGUIDLow());
}