From 33a75afb60f8e9ad44c7a87f7f52dae27dab62b6 Mon Sep 17 00:00:00 2001 From: NathanHandley Date: Fri, 25 Dec 2015 18:54:15 -0600 Subject: Updated AuctionHouseSeller to have item class level stack control For each item class (consumable, glyph), you can now edit the worldserver.conf to configure the ratio (percent) of random compared to single stack auction postings. Example 1 AuctionHouseBot.Class.RandomStackRatio.Consumable = 0 - New consumable auctions posted by AuctionHouseSeller will always be single stack. Example 2 AuctionHouseBot.Class.RandomStackRatio.Consumable = 100 - New consumable auctions posted by AuctionHouseSeller will always be of a random stack size. Example 3 AuctionHouseBot.Class.RandomStackRatio.Consumable = 20 - New consumable auctions posted by AuctionHouseSeller have a 20% chance of being a random stack size, and an 80% chance of being single stack size. --- src/server/worldserver/worldserver.conf.dist | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/server/worldserver') diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 840b819fe99..f416e65dd9f 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -3189,6 +3189,46 @@ AuctionHouseBot.forceIncludeItems = "" AuctionHouseBot.forceExcludeItems = "" +# +# AuctionHouseBot.Class.RandomStackRatio.* +# Description: Used to determine how often an item of the class will be single or randomly-size stacked +# 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 +# 0 = stacks will always single size +# Default: Consumable: 20 (20% random stack size, 80% single stack size) +# Container: 0 (100% single stack size) +# Weapon: 0 (100% single stack size) +# Gem: 20 (20% random stack size, 80% single stack size) +# Armor: 0 (100% single stack size) +# Reagent: 100 (100% random stack size) +# Projectile: 100 (100% random stack size) +# TradeGood: 50 (50% random stack size, 50% single stack size) +# Generic: 100 (100% random stack size) +# Recipe: 0 (100% single stack size) +# Quiver: 0 (100% single stack size) +# Quest: 100 (100% random stack size) +# Key: 100 (100% random stack size) +# Misc: 100 (100% random stack size) +# Glyph: 0 (100% single stack size) +# + +AuctionHouseBot.Class.RandomStackRatio.Consumable = 20 +AuctionHouseBot.Class.RandomStackRatio.Container = 0 +AuctionHouseBot.Class.RandomStackRatio.Weapon = 0 +AuctionHouseBot.Class.RandomStackRatio.Gem = 20 +AuctionHouseBot.Class.RandomStackRatio.Armor = 0 +AuctionHouseBot.Class.RandomStackRatio.Reagent = 100 +AuctionHouseBot.Class.RandomStackRatio.Projectile = 100 +AuctionHouseBot.Class.RandomStackRatio.TradeGood = 50 +AuctionHouseBot.Class.RandomStackRatio.Generic = 100 +AuctionHouseBot.Class.RandomStackRatio.Recipe = 0 +AuctionHouseBot.Class.RandomStackRatio.Quiver = 0 +AuctionHouseBot.Class.RandomStackRatio.Quest = 100 +AuctionHouseBot.Class.RandomStackRatio.Key = 100 +AuctionHouseBot.Class.RandomStackRatio.Misc = 100 +AuctionHouseBot.Class.RandomStackRatio.Glyph = 0 + # ################################################################################################### -- cgit v1.2.3 From ec3a98caeb879ec295959b49f733de4f8324b354 Mon Sep 17 00:00:00 2001 From: NathanHandley Date: Fri, 25 Dec 2015 19:47:38 -0600 Subject: Updates in respnose to feedback from DDuarte. Including: - Changed SetStackSizeForItem to GetStackSizeForItem in AuctionHouseBotSeller - Added Initializer to SellerItemClassInfo.RandomStackRatio in AuctionHouseBotSeller - Updated verbiage around AuctionHouseBot.Class.RandomStackRatio.* to be clearer --- src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp | 13 ++++++------- src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h | 4 ++-- src/server/worldserver/worldserver.conf.dist | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'src/server/worldserver') 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> 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 -- cgit v1.2.3