From f97c28f2f1deadd75a35631bb7ed878c6a1bec3f Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 3 Apr 2017 05:42:12 -0300 Subject: Core/AHBot: fix price calc - priceRatio is already a factor (cherry picked from commit 4a654be2fbb1857f31180f8d4edca91f7825c34a) --- src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp') diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp index ea400b30989..da14231ec3c 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp @@ -616,7 +616,9 @@ void AuctionBotSeller::SetPricesOfItem(ItemTemplate const* itemProto, SellerConf if (sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BUYPRICE_SELLER)) buyPrice = sellPrice; - float basePriceFloat = (buyPrice * stackCount * priceRatio) / (itemProto->GetClass() == 6 ? 200.0f : static_cast(itemProto->GetBuyCount())) / 100.0f; + float basePriceFloat = buyPrice * stackCount / (itemProto->GetClass() == 6 ? 200.0f : static_cast(itemProto->GetBuyCount())); + basePriceFloat *= priceRatio; + float range = basePriceFloat * 0.04f; buyout = (static_cast(frand(basePriceFloat - range, basePriceFloat + range) + 0.5f) / SILVER) * SILVER; -- cgit v1.2.3