mirror of
https://github.com/NathanHandley/mod-ah-bot-plus.git
synced 2026-02-07 12:51:10 +00:00
Add overall price override capabilities
This commit is contained in:
@@ -81,6 +81,35 @@ AuctionHouseBot.ItemsPerCycle = 150
|
||||
AuctionHouseBot.ListingExpireTimeInSecondsMin = 900
|
||||
AuctionHouseBot.ListingExpireTimeInSecondsMax = 86400
|
||||
|
||||
###############################################################################
|
||||
# AuctionHouseBot.CompleteItemValueOverride.Enabled
|
||||
# Enable/Disable the ability to have a list of items that use overrides
|
||||
# which ignore any other calculations been applied to them, except
|
||||
# what is configured. This will override any other calculation, even
|
||||
# advanced pricing! Note that "AuctionHouseBot.Buyer." is still
|
||||
# honered.
|
||||
# Default: false (disabled)
|
||||
#
|
||||
# AuctionHouseBot.CompleteItemValueOverride.ItemsList
|
||||
# Comma separated list of items in the format of "itemID:PriceMinCopper"
|
||||
# which represents exact item prices of items not factoring for any
|
||||
# math at all in the listing's price value being calculated
|
||||
# Example: "2589:1000000,4306:100000" would set the fixed price value
|
||||
# of linen cloth to 100 gold and silk cloth to 10 gold each.
|
||||
# Default:
|
||||
#
|
||||
# AuctionHouseBot.CompleteItemValueOverride.DoApplyBidVariations
|
||||
# AuctionHouseBot.CompleteItemValueOverride.DoApplyBuyoutVariations
|
||||
# If true, the variables such as BuyoutVariation* and BidVariation*
|
||||
# blow will apply to prices set by CompleteItemBuySellPriceOverride
|
||||
# Default: false
|
||||
###############################################################################
|
||||
|
||||
AuctionHouseBot.CompleteItemValueOverride.Enabled = false
|
||||
AuctionHouseBot.CompleteItemValueOverride.ItemsList =
|
||||
AuctionHouseBot.CompleteItemValueOverride.DoApplyBidVariations = false
|
||||
AuctionHouseBot.CompleteItemValueOverride.DoApplyBuyoutVariations = false
|
||||
|
||||
###############################################################################
|
||||
# AuctionHouseBot.AdvancedListingRules.UseDropRates.Enabled
|
||||
# Enable/Disable the Seller using items' in-game drop rates from Enemies
|
||||
|
||||
@@ -49,6 +49,9 @@ AuctionHouseBot::AuctionHouseBot() :
|
||||
CyclesBetweenSellAction(1),
|
||||
CyclesBetweenSellActionMax(1),
|
||||
MaxBuyoutPriceInCopper(1000000000),
|
||||
CompleteItemValueOverrideEnabled(false),
|
||||
CompleteItemValueOverrideDoApplyBidVariations(false),
|
||||
CompleteItemValueOverrideDoApplyBuyoutVariations(false),
|
||||
BuyoutVariationReducePercent(0.15f),
|
||||
BuyoutVariationAddPercent(0.25f),
|
||||
BidVariationHighReducePercent(0),
|
||||
@@ -243,6 +246,29 @@ uint32 AuctionHouseBot::GetStackSizeForItem(ItemTemplate const* itemProto) const
|
||||
|
||||
void AuctionHouseBot::CalculateItemValue(ItemTemplate const* itemProto, uint64& outBidPrice, uint64& outBuyoutPrice)
|
||||
{
|
||||
if (CompleteItemValueOverrideEnabled == true)
|
||||
{
|
||||
auto it = CompleteItemValueOverrideItemListByItemID.find(itemProto->ItemId);
|
||||
if (it != CompleteItemValueOverrideItemListByItemID.end())
|
||||
{
|
||||
outBuyoutPrice = it->second;
|
||||
if (CompleteItemValueOverrideDoApplyBuyoutVariations == true)
|
||||
outBuyoutPrice = urand(outBuyoutPrice * (1.0f - BuyoutVariationReducePercent), outBuyoutPrice * (1.0f + BuyoutVariationAddPercent));
|
||||
|
||||
if (CompleteItemValueOverrideDoApplyBidVariations == true)
|
||||
{
|
||||
float sellVarianceBidPriceTopPercent = 1.0f - BidVariationHighReducePercent;
|
||||
float sellVarianceBidPriceBottomPercent = 1.0f - BidVariationLowReducePercent;
|
||||
outBidPrice = urand(sellVarianceBidPriceBottomPercent * outBuyoutPrice, sellVarianceBidPriceTopPercent * outBuyoutPrice);
|
||||
}
|
||||
else
|
||||
outBidPrice = outBuyoutPrice;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Start with a buyout price related to the sell price, if configured
|
||||
if (UseItemSellPriceIfHigherThanPriceMinimumCenterBase == true)
|
||||
outBuyoutPrice = itemProto->SellPrice;
|
||||
@@ -1844,6 +1870,12 @@ void AuctionHouseBot::InitializeConfiguration()
|
||||
string charString = sConfigMgr->GetOption<std::string>("AuctionHouseBot.GUIDs", "0");
|
||||
AddCharacters(charString);
|
||||
|
||||
// Top level overrides
|
||||
CompleteItemValueOverrideEnabled = sConfigMgr->GetOption<bool>("AuctionHouseBot.CompleteItemValueOverride.Enabled", false);
|
||||
AddItemValuePairsToItemIDMap(CompleteItemValueOverrideItemListByItemID, sConfigMgr->GetOption<std::string>("AuctionHouseBot.CompleteItemValueOverride.ItemsList", ""));
|
||||
CompleteItemValueOverrideDoApplyBidVariations = sConfigMgr->GetOption<bool>("AuctionHouseBot.CompleteItemValueOverride.DoApplyBidVariations", false);
|
||||
CompleteItemValueOverrideDoApplyBuyoutVariations = sConfigMgr->GetOption<bool>("AuctionHouseBot.CompleteItemValueOverride.DoApplyBuyoutVariations", false);
|
||||
|
||||
// Buyer & Seller core properties
|
||||
SetCyclesBetweenBuyOrSell();
|
||||
ReturnExpiredAuctionItemsToBot = sConfigMgr->GetOption<bool>("AuctionHouseBot.ReturnExpiredAuctionItemsToBot", false);
|
||||
|
||||
@@ -136,6 +136,10 @@ private:
|
||||
uint32 CyclesBetweenSellAction;
|
||||
uint32 CyclesBetweenSellActionMax;
|
||||
uint32 MaxBuyoutPriceInCopper;
|
||||
bool CompleteItemValueOverrideEnabled;
|
||||
std::unordered_map<uint32, uint64> CompleteItemValueOverrideItemListByItemID;
|
||||
bool CompleteItemValueOverrideDoApplyBidVariations;
|
||||
bool CompleteItemValueOverrideDoApplyBuyoutVariations;
|
||||
float BuyoutVariationReducePercent;
|
||||
float BuyoutVariationAddPercent;
|
||||
float BidVariationHighReducePercent;
|
||||
|
||||
Reference in New Issue
Block a user