mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/AHBot: Adjust AHBot bid and buyout chances
Apply an exponential formula to define the chance to bid/buyout an auction depending on auction price and item price ratio. The formula can be adjusted changing the new AuctionHouseBot.Buyer.ChanceFactor config parameter
Chance = 100 ^ (1 + (1 - (auction_price / item_price) / k)
k is the config parameter AuctionHouseBot.Buyer.ChanceFactor, the higher the number the higher chance to buy overpriced auctions.
(cherry picked from commit 177b6319d1)
Conflicts:
src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
This commit is contained in:
@@ -97,6 +97,11 @@ void AuctionBotConfig::SetConfig(AuctionBotConfigBoolValues index, char const* f
|
||||
SetConfig(index, sConfigMgr->GetBoolDefault(fieldname, defvalue));
|
||||
}
|
||||
|
||||
void AuctionBotConfig::SetConfig(AuctionBotConfigFloatValues index, char const* fieldname, float defvalue)
|
||||
{
|
||||
SetConfig(index, sConfigMgr->GetFloatDefault(fieldname, defvalue));
|
||||
}
|
||||
|
||||
//Get AuctionHousebot configuration file
|
||||
void AuctionBotConfig::GetConfigFromFile()
|
||||
{
|
||||
@@ -111,6 +116,8 @@ void AuctionBotConfig::GetConfigFromFile()
|
||||
SetConfig(CONFIG_AHBOT_BUYER_HORDE_ENABLED, "AuctionHouseBot.Buyer.Horde.Enabled", false);
|
||||
SetConfig(CONFIG_AHBOT_BUYER_NEUTRAL_ENABLED, "AuctionHouseBot.Buyer.Neutral.Enabled", false);
|
||||
|
||||
SetConfig(CONFIG_AHBOT_BUYER_CHANCE_FACTOR, "AuctionHouseBot.Buyer.ChanceFactor", 2.0f);
|
||||
|
||||
SetConfig(CONFIG_AHBOT_ITEMS_VENDOR, "AuctionHouseBot.Items.Vendor", false);
|
||||
SetConfig(CONFIG_AHBOT_ITEMS_LOOT, "AuctionHouseBot.Items.Loot", true);
|
||||
SetConfig(CONFIG_AHBOT_ITEMS_MISC, "AuctionHouseBot.Items.Misc", false);
|
||||
|
||||
Reference in New Issue
Block a user