From bed369e7c8d0ef848f710bac9b8ceacc3cbe38a2 Mon Sep 17 00:00:00 2001 From: Ayrton Stout Date: Sat, 31 Dec 2016 11:47:58 -0700 Subject: Core/AH: AuctionHouseBot BidPrice determined by config options --- src/server/game/AuctionHouseBot/AuctionHouseBot.cpp | 3 +++ src/server/game/AuctionHouseBot/AuctionHouseBot.h | 4 +++- src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp | 8 +++++--- src/server/worldserver/worldserver.conf.dist | 9 +++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp index 4601495a70b..7bd0c08da0b 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp @@ -293,6 +293,9 @@ void AuctionBotConfig::GetConfigFromFile() SetConfig(CONFIG_AHBOT_CLASS_RANDOMSTACKRATIO_KEY, "AuctionHouseBot.Class.RandomStackRatio.Key", 100); SetConfig(CONFIG_AHBOT_CLASS_RANDOMSTACKRATIO_MISC, "AuctionHouseBot.Class.RandomStackRatio.Misc", 100); SetConfig(CONFIG_AHBOT_CLASS_RANDOMSTACKRATIO_GLYPH, "AuctionHouseBot.Class.RandomStackRatio.Glyph", 0); + + SetConfig(CONFIG_AHBOT_BIDPRICE_MIN, "AuctionHouseBot.BidPrice.Min", 0.6f); + SetConfig(CONFIG_AHBOT_BIDPRICE_MAX, "AuctionHouseBot.BidPrice.Max", 1.4f); } char const* AuctionBotConfig::GetHouseTypeName(AuctionHouseType houseType) diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.h b/src/server/game/AuctionHouseBot/AuctionHouseBot.h index 4f68a172255..a6957048f73 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBot.h +++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.h @@ -193,7 +193,9 @@ enum AuctionBotConfigBoolValues enum AuctionBotConfigFloatValues { CONFIG_AHBOT_BUYER_CHANCE_FACTOR, - CONFIG_AHBOT_FLOAT_COUNT + CONFIG_AHBOT_FLOAT_COUNT, + CONFIG_AHBOT_BIDPRICE_MIN, + CONFIG_AHBOT_BIDPRICE_MAX }; // All basic config data used by other AHBot classes for self-configure. diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp index 34127f0c59f..2e96d2a4847 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp @@ -732,9 +732,11 @@ void AuctionBotSeller::SetPricesOfItem(ItemTemplate const* itemProto, SellerConf buyp = static_cast(frand(basePriceFloat - range, basePriceFloat + range) + 0.5f); if (buyp == 0) buyp = 1; - uint32 basePrice = buyp * .5; - range = buyp * .4; - bidp = urand(static_cast(basePrice - range + 0.5f), static_cast(basePrice + range + 0.5f)) + 1; + + float bidPercentage = frand(sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BIDPRICE_MIN), sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BIDPRICE_MAX)); + bidp = static_cast(bidPercentage * buyp); + if (bidp == 0) + bidp = 1; } // Determines the stack size to use for the item diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 1d173057e6f..74d93409d45 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -3223,6 +3223,15 @@ AuctionHouseBot.ItemsPerCycle.Normal = 20 AuctionHouseBot.BuyPrice.Seller = 1 +# +# AuctionHouseBot.BidPrice.* +# Description: These values determine the range that the Bid Price will fall into, as a percentage of the Buy Price +# Default: 0.6 - (Min) +# 1.4 - (Max) + +AuctionHouseBot.BidPrice.Min = 0.6 +AuctionHouseBot.BidPrice.Max = 1.4 + # # AuctionHouseBot.Alliance.Price.Ratio # Description: Percentage by which the price of items selled on Alliance Auction House is incremented / decreased -- cgit v1.2.3