Core/AH: AuctionHouseBot BidPrice determined by config options

This commit is contained in:
Ayrton Stout authored and Aokromes committed 2017-01-01 13:37:53 +01:00
1 parent d2572429b7
commit eed28a5be9
4 files changed
+20 -4

No files matched your search

@@ -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)
@@ -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.
@@ -732,9 +732,11 @@ void AuctionBotSeller::SetPricesOfItem(ItemTemplate const* itemProto, SellerConf
buyp = static_cast<uint32>(frand(basePriceFloat - range, basePriceFloat + range) + 0.5f);
if (buyp == 0)
buyp = 1;
uint32 basePrice = buyp * .5;
range = buyp * .4;
bidp = urand(static_cast<uint32>(basePrice - range + 0.5f), static_cast<uint32>(basePrice + range + 0.5f)) + 1;
float bidPercentage = frand(sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BIDPRICE_MIN), sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BIDPRICE_MAX));
bidp = static_cast<uint32>(bidPercentage * buyp);
if (bidp == 0)
bidp = 1;
}
// Determines the stack size to use for the item
@@ -3250,6 +3250,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