aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAyrton Stout <ayrtonstout@u.boisestate.edu>2016-12-31 11:47:58 -0700
committerDoctorKraft <DoctorKraft@users.noreply.github.com>2018-03-18 00:19:48 +0100
commitbec131eac3af0efb83c8140730ad97890d68033a (patch)
tree17f26a98bf806c86da97f60f2b608a3d8e1227ab /src
parentc519992c1aceebdcde35dbc88d9d94caf8f892a4 (diff)
Core/AH: AuctionHouseBot BidPrice determined by config options
(cherry picked from commit bed369e7c8d0ef848f710bac9b8ceacc3cbe38a2)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBot.cpp3
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBot.h4
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp8
-rw-r--r--src/server/worldserver/worldserver.conf.dist9
4 files changed, 20 insertions, 4 deletions
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
index 11ed0ab7e80..f548ec80b85 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
@@ -285,6 +285,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 4fa52306407..768f8f97876 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBot.h
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.h
@@ -196,7 +196,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 d5788201ac9..8b7adb2f2a0 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
@@ -699,9 +699,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
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 9ca5ba95c9b..92b1ec5ffac 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -3355,6 +3355,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
# Default: 100 - (Not modify)