aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp13
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h4
-rw-r--r--src/server/worldserver/worldserver.conf.dist2
3 files changed, 9 insertions, 10 deletions
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
index 6375b9726e6..5d60b907328 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
@@ -737,20 +737,20 @@ void AuctionBotSeller::SetPricesOfItem(ItemTemplate const* itemProto, SellerConf
}
// Determines the stack size to use for the item
-void AuctionBotSeller::SetStackSizeForItem(ItemTemplate const* itemProto, SellerConfiguration& config, uint32& stackcnt)
+uint32 AuctionBotSeller::GetStackSizeForItem(ItemTemplate const* itemProto, SellerConfiguration& config) const
{
uint32 randomStackPercent = config.GetRandomStackRatioPerClass(ItemClass(itemProto->Class));
if (randomStackPercent >= 100)
- stackcnt = urand(1, itemProto->GetMaxStackSize());
+ return urand(1, itemProto->GetMaxStackSize());
else if (randomStackPercent == 0)
- stackcnt = 1;
+ return 1;
else
{
uint32 randomStackRoll = urand(0, 99);
if (randomStackRoll < randomStackPercent)
- stackcnt = urand(1, itemProto->GetMaxStackSize());
+ return urand(1, itemProto->GetMaxStackSize());
else
- stackcnt = 1;
+ return 1;
}
}
@@ -987,8 +987,7 @@ void AuctionBotSeller::AddNewAuctions(SellerConfiguration& config)
continue;
}
- uint32 stackCount = 1;
- SetStackSizeForItem(prototype, config, stackCount);
+ uint32 stackCount = GetStackSizeForItem(prototype, config);
Item* item = Item::CreateItem(itemId, stackCount);
if (!item)
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h
index 211344b532e..a6066e9fb39 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h
@@ -33,7 +33,7 @@ typedef std::vector<std::vector<uint32>> AllItemsArray;
struct SellerItemClassInfo
{
- SellerItemClassInfo(): AmountOfItems(0), MissItems(0), Quantity(0), PriceRatio(0) {}
+ SellerItemClassInfo(): AmountOfItems(0), MissItems(0), Quantity(0), PriceRatio(0), RandomStackRatio(100) {}
uint32 AmountOfItems;
uint32 MissItems;
@@ -142,7 +142,7 @@ private:
uint32 SetStat(SellerConfiguration& config);
bool GetItemsToSell(SellerConfiguration& config, ItemsToSellArray& itemsToSellArray, AllItemsArray const& addedItem);
void SetPricesOfItem(ItemTemplate const* itemProto, SellerConfiguration& config, uint32& buyp, uint32& bidp, uint32 stackcnt);
- void SetStackSizeForItem(ItemTemplate const* itemProto, SellerConfiguration& config, uint32& stackcnt);
+ uint32 GetStackSizeForItem(ItemTemplate const* itemProto, SellerConfiguration& config) const;
void LoadItemsQuantity(SellerConfiguration& config);
static uint32 GetBuyModifier(ItemTemplate const* prototype);
static uint32 GetSellModifier(ItemTemplate const* itemProto);
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index f416e65dd9f..5b07dde22bb 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -3191,7 +3191,7 @@ AuctionHouseBot.forceExcludeItems = ""
#
# AuctionHouseBot.Class.RandomStackRatio.*
-# Description: Used to determine how often an item of the class will be single or randomly-size stacked
+# Description: Used to determine how often a stack of the class will be single or randomly-size stacked when posted
# Value needs to be between 0 and 100, no decimal. Anything higher than 100 will be treated as 100
# Examples: 100 = stacks will always be random in size
# 50 = half the time the stacks are random, the other half being single stack