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
This commit is contained in:
NathanHandley
2015-12-25 19:47:38 -06:00
parent 33a75afb60
commit ec3a98caeb
3 changed files with 9 additions and 10 deletions

View File

@@ -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)

View File

@@ -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);

View File

@@ -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