mirror of
https://github.com/NathanHandley/mod-ah-bot-plus.git
synced 2026-01-15 18:10:29 +00:00
Add category price minimums in the config
This commit is contained in:
@@ -101,6 +101,30 @@ AuctionHouseBot.ListProportion.Key = 1
|
||||
AuctionHouseBot.ListProportion.Misc = 0
|
||||
AuctionHouseBot.ListProportion.Glyph = 2
|
||||
|
||||
###############################################################################
|
||||
# AuctionHouseBot.PriceMinimumCenterBase.*
|
||||
# Category-level price minimums, in copper, before any multipliers come
|
||||
# into play. Value shouldn't be zero, and the base minimum price will
|
||||
# actually be a +/- 50% range of this value. Used to catch 0 cost or
|
||||
# extremely low cost items
|
||||
###############################################################################
|
||||
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Consumable = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Container = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Weapon = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Gem = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Armor = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Reagent = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Projectile = 5
|
||||
AuctionHouseBot.PriceMinimumCenterBase.TradeGood = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Generic = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Recipe = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Quiver = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Quest = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Key = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Misc = 1000
|
||||
AuctionHouseBot.PriceMinimumCenterBase.Glyph = 1000
|
||||
|
||||
###############################################################################
|
||||
# AuctionHouseBot.PriceMultiplier.*
|
||||
# Category/Quality-level modifier values for the prices of items, which can be
|
||||
|
||||
@@ -90,45 +90,71 @@ void AuctionHouseBot::calculateItemValue(ItemTemplate const* itemProto, uint64&
|
||||
// Start with a buyout price related to the sell price
|
||||
outBuyoutPrice = itemProto->SellPrice;
|
||||
|
||||
// Set a minimum base buyoutPrice to 5-15 silver for non projectiles and non trade goods
|
||||
if (outBuyoutPrice < 500 && itemProto->Class != ITEM_CLASS_PROJECTILE && itemProto->Class != ITEM_CLASS_TRADE_GOODS)
|
||||
// Get the price multipliers
|
||||
float classPriceMultiplier = 1;
|
||||
switch (itemProto->Class)
|
||||
{
|
||||
// TODO: Move to a config
|
||||
outBuyoutPrice = urand(500, 1500);
|
||||
}
|
||||
// Special rules for trade goods
|
||||
else if (itemProto->Class == ITEM_CLASS_TRADE_GOODS)
|
||||
{
|
||||
// trade goods are at least 2x vendor price
|
||||
uint32 twoTimesSellPrice = itemProto->SellPrice * 2;
|
||||
if (twoTimesSellPrice > outBuyoutPrice)
|
||||
{
|
||||
uint32 threeTimeSellPrice = itemProto->SellPrice * 3;
|
||||
outBuyoutPrice = urand(twoTimesSellPrice, threeTimeSellPrice);
|
||||
}
|
||||
|
||||
// Calculate a minimum base price for trade goods factoring in the item level and quality
|
||||
if (itemProto->ItemLevel > 0)
|
||||
{
|
||||
double powValue = 1.8;
|
||||
switch (itemProto->Quality)
|
||||
{
|
||||
uint32 minPossiblePrice = (uint32)(pow((double)itemProto->ItemLevel, qualityPriceMultplier));
|
||||
if (minPossiblePrice > outBuyoutPrice)
|
||||
{
|
||||
outBuyoutPrice = urand(minPossiblePrice, minPossiblePrice * 1.1);
|
||||
}
|
||||
}
|
||||
case ITEM_CLASS_CONSUMABLE: classPriceMultiplier = PriceMultiplierCategoryConsumable; break;
|
||||
case ITEM_CLASS_CONTAINER: classPriceMultiplier = PriceMultiplierCategoryContainer; break;
|
||||
case ITEM_CLASS_WEAPON: classPriceMultiplier = PriceMultiplierCategoryWeapon; break;
|
||||
case ITEM_CLASS_GEM: classPriceMultiplier = PriceMultiplierCategoryGem; break;
|
||||
case ITEM_CLASS_REAGENT: classPriceMultiplier = PriceMultiplierCategoryReagent; break;
|
||||
case ITEM_CLASS_ARMOR: classPriceMultiplier = PriceMultiplierCategoryArmor; break;
|
||||
case ITEM_CLASS_PROJECTILE: classPriceMultiplier = PriceMultiplierCategoryProjectile; break;
|
||||
case ITEM_CLASS_TRADE_GOODS: classPriceMultiplier = PriceMultiplierCategoryTradeGood; break;
|
||||
case ITEM_CLASS_GENERIC: classPriceMultiplier = PriceMultiplierCategoryGeneric; break;
|
||||
case ITEM_CLASS_RECIPE: classPriceMultiplier = PriceMultiplierCategoryRecipe; break;
|
||||
case ITEM_CLASS_QUIVER: classPriceMultiplier = PriceMultiplierCategoryQuiver; break;
|
||||
case ITEM_CLASS_QUEST: classPriceMultiplier = PriceMultiplierCategoryQuest; break;
|
||||
case ITEM_CLASS_KEY: classPriceMultiplier = PriceMultiplierCategoryKey; break;
|
||||
case ITEM_CLASS_MISC: classPriceMultiplier = PriceMultiplierCategoryMisc; break;
|
||||
case ITEM_CLASS_GLYPH: classPriceMultiplier = PriceMultiplierCategoryGlyph; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
// If still no buy price, give it something low
|
||||
if (outBuyoutPrice == 0)
|
||||
float qualityPriceMultplier = 1;
|
||||
switch (itemProto->Quality)
|
||||
{
|
||||
outBuyoutPrice = urand(500, 1500);
|
||||
case ITEM_QUALITY_POOR: qualityPriceMultplier = PriceMultiplierQualityPoor; break;
|
||||
case ITEM_QUALITY_NORMAL: qualityPriceMultplier = PriceMultiplierQualityNormal; break;
|
||||
case ITEM_QUALITY_UNCOMMON: qualityPriceMultplier = PriceMultiplierQualityUncommon; break;
|
||||
case ITEM_QUALITY_RARE: qualityPriceMultplier = PriceMultiplierQualityRare; break;
|
||||
case ITEM_QUALITY_EPIC: qualityPriceMultplier = PriceMultiplierQualityEpic; break;
|
||||
case ITEM_QUALITY_LEGENDARY: qualityPriceMultplier = PriceMultiplierQualityLegendary; break;
|
||||
case ITEM_QUALITY_ARTIFACT: qualityPriceMultplier = PriceMultiplierQualityArtifact; break;
|
||||
case ITEM_QUALITY_HEIRLOOM: qualityPriceMultplier = PriceMultiplierQualityHeirloom; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
// Multiply the price based on quality
|
||||
// Grab the minimum prices
|
||||
int PriceMinimumCenterBase = 1000;
|
||||
switch (itemProto->Class)
|
||||
{
|
||||
case ITEM_CLASS_CONSUMABLE: PriceMinimumCenterBase = PriceMinimumCenterBaseConsumable; break;
|
||||
case ITEM_CLASS_CONTAINER: PriceMinimumCenterBase = PriceMinimumCenterBaseContainer; break;
|
||||
case ITEM_CLASS_WEAPON: PriceMinimumCenterBase = PriceMinimumCenterBaseWeapon; break;
|
||||
case ITEM_CLASS_GEM: PriceMinimumCenterBase = PriceMinimumCenterBaseGem; break;
|
||||
case ITEM_CLASS_REAGENT: PriceMinimumCenterBase = PriceMinimumCenterBaseReagent; break;
|
||||
case ITEM_CLASS_ARMOR: PriceMinimumCenterBase = PriceMinimumCenterBaseArmor; break;
|
||||
case ITEM_CLASS_PROJECTILE: PriceMinimumCenterBase = PriceMinimumCenterBaseProjectile; break;
|
||||
case ITEM_CLASS_TRADE_GOODS: PriceMinimumCenterBase = PriceMinimumCenterBaseTradeGood; break;
|
||||
case ITEM_CLASS_GENERIC: PriceMinimumCenterBase = PriceMinimumCenterBaseGeneric; break;
|
||||
case ITEM_CLASS_RECIPE: PriceMinimumCenterBase = PriceMinimumCenterBaseRecipe; break;
|
||||
case ITEM_CLASS_QUIVER: PriceMinimumCenterBase = PriceMinimumCenterBaseQuiver; break;
|
||||
case ITEM_CLASS_QUEST: PriceMinimumCenterBase = PriceMinimumCenterBaseQuest; break;
|
||||
case ITEM_CLASS_KEY: PriceMinimumCenterBase = PriceMinimumCenterBaseKey; break;
|
||||
case ITEM_CLASS_MISC: PriceMinimumCenterBase = PriceMinimumCenterBaseMisc; break;
|
||||
case ITEM_CLASS_GLYPH: PriceMinimumCenterBase = PriceMinimumCenterBaseGlyph; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
// Set the minimum price
|
||||
if (outBuyoutPrice < PriceMinimumCenterBase)
|
||||
outBuyoutPrice = urand(PriceMinimumCenterBase * 0.5, PriceMinimumCenterBase * 1.5);
|
||||
|
||||
// Multiply the price based on multipliers
|
||||
outBuyoutPrice *= qualityPriceMultplier;
|
||||
outBuyoutPrice *= classPriceMultiplier;
|
||||
|
||||
// If a vendor sells this item, make the price at least that high
|
||||
if (itemProto->SellPrice > outBuyoutPrice)
|
||||
@@ -796,6 +822,48 @@ void AuctionHouseBot::InitializeConfiguration()
|
||||
ListProportionMisc = sConfigMgr->GetOption<uint32>("AuctionHouseBot.ListProportion.Misc", 0);
|
||||
ListProportionGlyph = sConfigMgr->GetOption<uint32>("AuctionHouseBot.ListProportion.Glyph", 2);
|
||||
|
||||
// Price Multipliers
|
||||
PriceMultiplierCategoryConsumable = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Consumable", 1);
|
||||
PriceMultiplierCategoryContainer = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Container", 1);
|
||||
PriceMultiplierCategoryWeapon = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Weapon", 1);
|
||||
PriceMultiplierCategoryGem = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Gem", 1);
|
||||
PriceMultiplierCategoryArmor = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Armor", 1);
|
||||
PriceMultiplierCategoryReagent = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Reagent", 1);
|
||||
PriceMultiplierCategoryProjectile = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Projectile", 1);
|
||||
PriceMultiplierCategoryTradeGood = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.TradeGood", 2);
|
||||
PriceMultiplierCategoryGeneric = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Generic", 1);
|
||||
PriceMultiplierCategoryRecipe = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Recipe", 1);
|
||||
PriceMultiplierCategoryQuiver = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Quiver", 1);
|
||||
PriceMultiplierCategoryQuest = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Quest", 1);
|
||||
PriceMultiplierCategoryKey = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Key", 1);
|
||||
PriceMultiplierCategoryMisc = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Misc", 1);
|
||||
PriceMultiplierCategoryGlyph = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Category.Glyph", 1);
|
||||
PriceMultiplierQualityPoor = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Quality.Poor", 1);
|
||||
PriceMultiplierQualityNormal = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Quality.Normal", 1);
|
||||
PriceMultiplierQualityUncommon = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Quality.Uncommon", 1.8);
|
||||
PriceMultiplierQualityRare = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Quality.Rare", 1.9);
|
||||
PriceMultiplierQualityEpic = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Quality.Epic", 2.1);
|
||||
PriceMultiplierQualityLegendary = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Quality.Legendary", 3);
|
||||
PriceMultiplierQualityArtifact = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Quality.Artifact", 3);
|
||||
PriceMultiplierQualityHeirloom = sConfigMgr->GetOption<float>("AuctionHouseBot.PriceMultiplier.Quality.Heirloom", 3);
|
||||
|
||||
// Price minimums
|
||||
PriceMinimumCenterBaseConsumable = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Consumable",1000);
|
||||
PriceMinimumCenterBaseContainer = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Container", 1000);
|
||||
PriceMinimumCenterBaseWeapon = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Weapon", 1000);
|
||||
PriceMinimumCenterBaseGem = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Gem", 1000);
|
||||
PriceMinimumCenterBaseArmor = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Armor", 1000);
|
||||
PriceMinimumCenterBaseReagent = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Reagent", 1000);
|
||||
PriceMinimumCenterBaseProjectile = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Projectile", 5);
|
||||
PriceMinimumCenterBaseTradeGood = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.TradeGood", 1000);
|
||||
PriceMinimumCenterBaseGeneric = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Generic", 1000);
|
||||
PriceMinimumCenterBaseRecipe = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Recipe", 1000);
|
||||
PriceMinimumCenterBaseQuiver = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Quiver", 1000);
|
||||
PriceMinimumCenterBaseQuest = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Quest", 1000);
|
||||
PriceMinimumCenterBaseKey = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Key", 1000);
|
||||
PriceMinimumCenterBaseMisc = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Misc", 1000);
|
||||
PriceMinimumCenterBaseGlyph = sConfigMgr->GetOption<uint32>("AuctionHouseBot.PriceMinimumCenterBase.Glyph", 1000);
|
||||
|
||||
// Disabled Items
|
||||
DisabledItemTextFilter = sConfigMgr->GetOption<bool>("AuctionHouseBot.DisabledItemTextFilter", true);
|
||||
DisabledItems.clear();
|
||||
|
||||
@@ -168,29 +168,44 @@ private:
|
||||
uint32 ListProportionKey;
|
||||
uint32 ListProportionMisc;
|
||||
uint32 ListProportionGlyph;
|
||||
double PriceMultiplierCategoryConsumable;
|
||||
double PriceMultiplierCategoryContainer;
|
||||
double PriceMultiplierCategoryWeapon;
|
||||
double PriceMultiplierCategoryGem;
|
||||
double PriceMultiplierCategoryArmor;
|
||||
double PriceMultiplierCategoryReagent;
|
||||
double PriceMultiplierCategoryProjectile;
|
||||
double PriceMultiplierCategoryTradeGood;
|
||||
double PriceMultiplierCategoryGeneric;
|
||||
double PriceMultiplierCategoryRecipe;
|
||||
double PriceMultiplierCategoryQuiver;
|
||||
double PriceMultiplierCategoryQuest;
|
||||
double PriceMultiplierCategoryKey;
|
||||
double PriceMultiplierCategoryMisc;
|
||||
double PriceMultiplierCategoryGlyph;
|
||||
double PriceMultiplierQualityPoor;
|
||||
double PriceMultiplierQualityNormal;
|
||||
double PriceMultiplierQualityUncommon;
|
||||
double PriceMultiplierQualityRare;
|
||||
double PriceMultiplierQualityEpic;
|
||||
double PriceMultiplierQualityLegendary;
|
||||
double PriceMultiplierQualityArtifact;
|
||||
double PriceMultiplierQualityHeirloom;
|
||||
float PriceMultiplierCategoryConsumable;
|
||||
float PriceMultiplierCategoryContainer;
|
||||
float PriceMultiplierCategoryWeapon;
|
||||
float PriceMultiplierCategoryGem;
|
||||
float PriceMultiplierCategoryArmor;
|
||||
float PriceMultiplierCategoryReagent;
|
||||
float PriceMultiplierCategoryProjectile;
|
||||
float PriceMultiplierCategoryTradeGood;
|
||||
float PriceMultiplierCategoryGeneric;
|
||||
float PriceMultiplierCategoryRecipe;
|
||||
float PriceMultiplierCategoryQuiver;
|
||||
float PriceMultiplierCategoryQuest;
|
||||
float PriceMultiplierCategoryKey;
|
||||
float PriceMultiplierCategoryMisc;
|
||||
float PriceMultiplierCategoryGlyph;
|
||||
float PriceMultiplierQualityPoor;
|
||||
float PriceMultiplierQualityNormal;
|
||||
float PriceMultiplierQualityUncommon;
|
||||
float PriceMultiplierQualityRare;
|
||||
float PriceMultiplierQualityEpic;
|
||||
float PriceMultiplierQualityLegendary;
|
||||
float PriceMultiplierQualityArtifact;
|
||||
float PriceMultiplierQualityHeirloom;
|
||||
uint32 PriceMinimumCenterBaseConsumable;
|
||||
uint32 PriceMinimumCenterBaseContainer;
|
||||
uint32 PriceMinimumCenterBaseWeapon;
|
||||
uint32 PriceMinimumCenterBaseGem;
|
||||
uint32 PriceMinimumCenterBaseArmor;
|
||||
uint32 PriceMinimumCenterBaseReagent;
|
||||
uint32 PriceMinimumCenterBaseProjectile;
|
||||
uint32 PriceMinimumCenterBaseTradeGood;
|
||||
uint32 PriceMinimumCenterBaseGeneric;
|
||||
uint32 PriceMinimumCenterBaseRecipe;
|
||||
uint32 PriceMinimumCenterBaseQuiver;
|
||||
uint32 PriceMinimumCenterBaseQuest;
|
||||
uint32 PriceMinimumCenterBaseKey;
|
||||
uint32 PriceMinimumCenterBaseMisc;
|
||||
uint32 PriceMinimumCenterBaseGlyph;
|
||||
|
||||
AHBConfig AllianceConfig;
|
||||
AHBConfig HordeConfig;
|
||||
|
||||
Reference in New Issue
Block a user