Compare commits

...

3 Commits

Author SHA1 Message Date
NathanHandley
55a403133e Re-enable common weapons and armor
This should be managed by listing proportions anyway.  Added some invalid item IDs to purge a few bad items.
2026-01-06 08:52:36 -06:00
NathanHandley
9bd64af3a9 Update comments about the 25% random spread 2026-01-06 08:44:19 -06:00
NathanHandley
dcb615212d Add ability to filter items by use or equip level 2026-01-06 08:41:32 -06:00
4 changed files with 78 additions and 24 deletions

View File

@@ -45,7 +45,7 @@ The AuctionHouseBot module adds the following in-game commands (for GMs only):
## Buying Bot Behavior
1. **Determining Items to Buy:** Every minute the buyer bot will select (BuyCandidatesPerBuyCycle) items currently up for auction which are listed by players as potential purchase items.
2. **Price Willing to Pay:** The buyer bot will use the same item price calculation the seller bot uses, including the random +/- 25%, and that calculated price is then multiplied by (AcceptablePriceModifier) which then becomes the price the buyer will be willing to spend.
2. **Price Willing to Pay:** The buyer bot will use the same item price calculation the seller bot uses, including the random +/- 25% (configurable), and that calculated price is then multiplied by (AcceptablePriceModifier) which then becomes the price the buyer will be willing to spend.
3. **Buying it:** If the price calculated is higher than the buy out price, then the bot will buy it out. If not, it will test to see if it has been bidded on by a bot and if not, if the bid price is below the price it is willing to pay. If so, it will bid (outbid, so just over current bid).
The above behavior is replicated on each enabled auction house. If left to default settings, 1 item in each auction house will attempt to be bought from, if the price calculation seems favorable. Note that any item buy attempt, even items above buying price, consumes a buy candidate. That means that too many overpriced items can drown out potential sales.

File diff suppressed because one or more lines are too long

View File

@@ -68,8 +68,11 @@ AuctionHouseBot::AuctionHouseBot() :
DisabledRecipeProducedItemFilterEnabled(false),
ListedItemLevelRestrictedEnabled(false),
ListedItemLevelRestrictedUseCraftedItemForCalculation(true),
ListedItemLevelMax(999),
ListedItemLevelMin(0),
ListedItemLevelMax(999),
ListedItemUseOrEquipRestrictedEnabled(false),
ListedItemUseOrEquipRestrictMinLevel(0),
ListedItemUseOrEquipRestrictMaxLevel(999),
RandomStackRatioConsumable(1),
RandomStackRatioContainer(1),
RandomStackRatioWeapon(1),
@@ -728,6 +731,29 @@ void AuctionHouseBot::PopulateItemCandidatesAndProportions()
}
}
// If there is a use/equip level exception, honor it
if (ListedItemUseOrEquipRestrictedEnabled == true)
{
// Only test if it's not an exception
if (ListedItemUseOrEquipExceptionItems.find(itr->second.ItemId) == ListedItemUseOrEquipExceptionItems.end())
{
uint32 useOrEquipLevelCompare = itr->second.RequiredLevel;
if (useOrEquipLevelCompare > 0 && useOrEquipLevelCompare < ListedItemUseOrEquipRestrictMinLevel)
{
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled since item use or equip level is lower than EquipItemUseOrEquipLevelRestrict.MinItemLevel", itr->second.ItemId);
continue;
}
if (useOrEquipLevelCompare > 0 && useOrEquipLevelCompare > ListedItemUseOrEquipRestrictMaxLevel)
{
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled since item use or equip level is higher than EquipItemUseOrEquipLevelRestrict.MaxItemLevel", itr->second.ItemId);
continue;
}
}
}
// Disabled items by Id
if (DisabledItems.find(itr->second.ItemId) != DisabledItems.end())
{
@@ -824,7 +850,8 @@ void AuctionHouseBot::PopulateItemCandidatesAndProportions()
itr->second.Name1.find("]") != std::string::npos ||
itr->second.Name1.find("D'Sak") != std::string::npos ||
itr->second.Name1.find("(") != std::string::npos ||
itr->second.Name1.find("OLD") != std::string::npos))
itr->second.Name1.find("OLD") != std::string::npos ||
itr->second.Name1.find("PVP") != std::string::npos))
{
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled item with a temp or unused item name", itr->second.ItemId);
@@ -850,22 +877,6 @@ void AuctionHouseBot::PopulateItemCandidatesAndProportions()
continue;
}
// Disable common weapons
if (itr->second.Quality == ITEM_QUALITY_NORMAL && itr->second.Class == ITEM_CLASS_WEAPON)
{
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled common weapon", itr->second.ItemId);
continue;
}
// Disable common armor
if (itr->second.Quality == ITEM_QUALITY_NORMAL && itr->second.Class == ITEM_CLASS_ARMOR)
{
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled common non-misc armor", itr->second.ItemId);
continue;
}
// Store the item ID
ItemCandidatesByItemClassAndQuality[itr->second.Class][itr->second.Quality].push_back(itr->second.ItemId);
}
@@ -2048,6 +2059,13 @@ void AuctionHouseBot::InitializeConfiguration()
ListedItemIDExceptionItems.clear();
ParseNumberListToSet(ListedItemIDExceptionItems, sConfigMgr->GetOption<std::string>("AuctionHouseBot.ListedItemIDRestrict.ExceptionItemIDs", ""), "ListedItemIDRestrict.ExceptionItemIDs");
// Equip or use restrictions
ListedItemUseOrEquipRestrictedEnabled = sConfigMgr->GetOption<bool>("AuctionHouseBot.EquipItemUseOrEquipLevelRestrict.Enabled", false);
ListedItemUseOrEquipRestrictMinLevel = sConfigMgr->GetOption("AuctionHouseBot.EquipItemUseOrEquipLevelRestrict.MinLevel", 0);
ListedItemUseOrEquipRestrictMaxLevel = sConfigMgr->GetOption("AuctionHouseBot.EquipItemUseOrEquipLevelRestrict.MaxLevel", 999);
ListedItemUseOrEquipExceptionItems.clear();
ParseNumberListToSet(ListedItemUseOrEquipExceptionItems, sConfigMgr->GetOption<std::string>("AuctionHouseBot.EquipItemUseOrEquipLevelRestrict.ExceptionItemIDs", ""), "EquipItemUseOrEquipLevelRestrict.ExceptionItemIDs");
// Disabled Items
DisabledItemTextFilter = sConfigMgr->GetOption<bool>("AuctionHouseBot.DisabledItemTextFilter", true);
DisabledRecipeProducedItemFilterEnabled = sConfigMgr->GetOption<bool>("AuctionHouseBot.DisabledRecipeProducedItemFilterEnabled", false);

View File

@@ -159,9 +159,13 @@ private:
std::set<uint32> DisabledItems;
bool ListedItemLevelRestrictedEnabled;
bool ListedItemLevelRestrictedUseCraftedItemForCalculation;
uint32 ListedItemLevelMax;
uint32 ListedItemLevelMin;
uint32 ListedItemLevelMax;
std::set<uint32> ListedItemLevelExceptionItems;
bool ListedItemUseOrEquipRestrictedEnabled;
uint32 ListedItemUseOrEquipRestrictMinLevel;
uint32 ListedItemUseOrEquipRestrictMaxLevel;
std::set<uint32> ListedItemUseOrEquipExceptionItems;
uint32 RandomStackRatioConsumable;
uint32 RandomStackRatioContainer;
uint32 RandomStackRatioWeapon;