aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AuctionHouseBot/AuctionHouseBot.h
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2015-08-01 18:48:55 +0200
committerCarbenium <carbenium@outlook.com>2015-09-24 19:48:31 +0200
commitcf67b7d375845e1745a79a712701413fcf4e75ea (patch)
tree5a75704cec89a5981e1586c0114e0d5104ea32c0 /src/server/game/AuctionHouseBot/AuctionHouseBot.h
parent8a5d92726a0b52b70e881c595a2a8e1000d9de68 (diff)
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 177b6319d1ad49a38fbd06f37671da1e3d1ae4e6) Conflicts: src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
Diffstat (limited to 'src/server/game/AuctionHouseBot/AuctionHouseBot.h')
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBot.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.h b/src/server/game/AuctionHouseBot/AuctionHouseBot.h
index d7570c37d44..225d3b7ee25 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBot.h
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.h
@@ -174,6 +174,12 @@ enum AuctionBotConfigBoolValues
CONFIG_UINT32_AHBOT_BOOL_COUNT
};
+enum AuctionBotConfigFloatValues
+{
+ CONFIG_AHBOT_BUYER_CHANCE_FACTOR,
+ CONFIG_AHBOT_FLOAT_COUNT
+};
+
// All basic config data used by other AHBot classes for self-configure.
class AuctionBotConfig
{
@@ -196,8 +202,10 @@ public:
uint32 GetConfig(AuctionBotConfigUInt32Values index) const { return _configUint32Values[index]; }
bool GetConfig(AuctionBotConfigBoolValues index) const { return _configBoolValues[index]; }
+ float GetConfig(AuctionBotConfigFloatValues index) const { return _configFloatValues[index]; }
void SetConfig(AuctionBotConfigBoolValues index, bool value) { _configBoolValues[index] = value; }
void SetConfig(AuctionBotConfigUInt32Values index, uint32 value) { _configUint32Values[index] = value; }
+ void SetConfig(AuctionBotConfigFloatValues index, float value) { _configFloatValues[index] = value; }
uint32 GetConfigItemAmountRatio(AuctionHouseType houseType) const;
bool GetConfigBuyerEnabled(AuctionHouseType houseType) const;
@@ -217,6 +225,7 @@ private:
uint32 _configUint32Values[CONFIG_UINT32_AHBOT_UINT32_COUNT];
bool _configBoolValues[CONFIG_UINT32_AHBOT_BOOL_COUNT];
+ float _configFloatValues[CONFIG_AHBOT_FLOAT_COUNT];
void SetAHBotIncludes(const std::string& AHBotIncludes) { _AHBotIncludes = AHBotIncludes; }
void SetAHBotExcludes(const std::string& AHBotExcludes) { _AHBotExcludes = AHBotExcludes; }
@@ -225,6 +234,7 @@ private:
void SetConfigMax(AuctionBotConfigUInt32Values index, char const* fieldname, uint32 defvalue, uint32 maxvalue);
void SetConfigMinMax(AuctionBotConfigUInt32Values index, char const* fieldname, uint32 defvalue, uint32 minvalue, uint32 maxvalue);
void SetConfig(AuctionBotConfigBoolValues index, char const* fieldname, bool defvalue);
+ void SetConfig(AuctionBotConfigFloatValues index, char const* fieldname, float defvalue);
void GetConfigFromFile();
};