Core/Items: Dropped deprecated ItemFlag2 ITEM_FLAG2_DONT_IGNORE_BUY_PRICE
Port From (https://github.com/TrinityCore/TrinityCore/commit/e275c39586dba170c931b972aa7e9cc3c691a533)
This commit is contained in:
@@ -3387,7 +3387,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
ulong price = 0;
|
ulong price = 0;
|
||||||
if (crItem.IsGoldRequired(pProto) && pProto.GetBuyPrice() > 0) //Assume price cannot be negative (do not know why it is int32)
|
if (pProto.GetBuyPrice() > 0) //Assume price cannot be negative (do not know why it is int32)
|
||||||
{
|
{
|
||||||
float buyPricePerItem = (float)pProto.GetBuyPrice() / pProto.GetBuyCount();
|
float buyPricePerItem = (float)pProto.GetBuyPrice() / pProto.GetBuyCount();
|
||||||
ulong maxCount = (ulong)(PlayerConst.MaxMoneyAmount / buyPricePerItem);
|
ulong maxCount = (ulong)(PlayerConst.MaxMoneyAmount / buyPricePerItem);
|
||||||
@@ -3400,6 +3400,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
// reputation discount
|
// reputation discount
|
||||||
price = (ulong)Math.Floor(price * GetReputationPriceDiscount(creature));
|
price = (ulong)Math.Floor(price * GetReputationPriceDiscount(creature));
|
||||||
|
price = pProto.GetBuyPrice() > 0 ? Math.Max(1ul, price) : price;
|
||||||
|
|
||||||
int priceMod = GetTotalAuraModifier(AuraType.ModVendorItemsPrices);
|
int priceMod = GetTotalAuraModifier(AuraType.ModVendorItemsPrices);
|
||||||
if (priceMod != 0)
|
if (priceMod != 0)
|
||||||
|
|||||||
@@ -659,7 +659,8 @@ namespace Game
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int price = (int)(vendorItem.IsGoldRequired(itemTemplate) ? Math.Floor(itemTemplate.GetBuyPrice() * discountMod) : 0);
|
ulong price = (ulong)Math.Floor(itemTemplate.GetBuyPrice() * discountMod);
|
||||||
|
price = itemTemplate.GetBuyPrice() > 0 ? Math.Max(1ul, price) : price;
|
||||||
|
|
||||||
int priceMod = GetPlayer().GetTotalAuraModifier(AuraType.ModVendorItemsPrices);
|
int priceMod = GetPlayer().GetTotalAuraModifier(AuraType.ModVendorItemsPrices);
|
||||||
if (priceMod != 0)
|
if (priceMod != 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user