Removed most profession made items

This commit is contained in:
NathanHandley
2024-01-16 12:06:28 -06:00
parent f54f3ca3d3
commit 845eae15ab
3 changed files with 62 additions and 20 deletions

File diff suppressed because one or more lines are too long

View File

@@ -95,6 +95,27 @@ void AuctionHouseBot::calculateItemValue(ItemTemplate const* itemProto, uint64&
// TODO: Move to a config // TODO: Move to a config
outBuyoutPrice = urand(500, 1500); 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
if (itemProto->ItemLevel > 0)
{
uint32 minPossiblePrice = (uint32)(pow((double)itemProto->ItemLevel, 1.8));
if (minPossiblePrice > outBuyoutPrice)
{
outBuyoutPrice = urand(minPossiblePrice, minPossiblePrice * 1.2);
}
}
}
// If still no buy price, give it something low // If still no buy price, give it something low
if (outBuyoutPrice == 0) if (outBuyoutPrice == 0)
@@ -107,8 +128,8 @@ void AuctionHouseBot::calculateItemValue(ItemTemplate const* itemProto, uint64&
{ {
case ITEM_QUALITY_UNCOMMON: outBuyoutPrice *= 2; break; case ITEM_QUALITY_UNCOMMON: outBuyoutPrice *= 2; break;
case ITEM_QUALITY_RARE: outBuyoutPrice *= 5; break; case ITEM_QUALITY_RARE: outBuyoutPrice *= 5; break;
case ITEM_QUALITY_EPIC: outBuyoutPrice *= 7; break; case ITEM_QUALITY_EPIC: outBuyoutPrice *= 8; break;
case ITEM_QUALITY_LEGENDARY: outBuyoutPrice *= 11; break; case ITEM_QUALITY_LEGENDARY: outBuyoutPrice *= 13; break;
default: break; default: break;
} }
@@ -154,16 +175,16 @@ void AuctionHouseBot::populateItemClassSeedList()
// Determine how many of what kinds of items to use based on a seeded weight list, 0 = none // Determine how many of what kinds of items to use based on a seeded weight list, 0 = none
// TODO: Move these weight items to a config // TODO: Move these weight items to a config
uint32 itemClassSeedWeightConsumable = 4; uint32 itemClassSeedWeightConsumable = 3;
uint32 itemClassSeedWeightContainer = 2; uint32 itemClassSeedWeightContainer = 2;
uint32 itemClassSeedWeightWeapon = 8; uint32 itemClassSeedWeightWeapon = 6;
uint32 itemClassSeedWeightGem = 3; uint32 itemClassSeedWeightGem = 2;
uint32 itemClassSeedWeightArmor = 8; uint32 itemClassSeedWeightArmor = 6;
uint32 itemClassSeedWeightReagent = 1; uint32 itemClassSeedWeightReagent = 1;
uint32 itemClassSeedWeightProjectile = 2; uint32 itemClassSeedWeightProjectile = 2;
uint32 itemClassSeedWeightTradeGoods = 10; uint32 itemClassSeedWeightTradeGoods = 14;
uint32 itemClassSeedWeightGeneric = 1; uint32 itemClassSeedWeightGeneric = 1;
uint32 itemClassSeedWeightRecipe = 4; uint32 itemClassSeedWeightRecipe = 3;
uint32 itemClassSeedWeightQuiver = 1; uint32 itemClassSeedWeightQuiver = 1;
uint32 itemClassSeedWeightQuest = 2; uint32 itemClassSeedWeightQuest = 2;
uint32 itemClassSeedWeightKey = 1; uint32 itemClassSeedWeightKey = 1;
@@ -324,6 +345,14 @@ void AuctionHouseBot::populateItemCandidateList()
continue; continue;
} }
// Disabled crafted gems that start with "Perfect"
if (itr->second.Class == ITEM_CLASS_GEM && itr->second.Name1.find("Perfect ") != std::string::npos)
{
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled as it's a perfect crafted gem", itr->second.ItemId);
continue;
}
// Disable all items that have neither a sell or a buy price, with exception of item enhancements and trade goods // Disable all items that have neither a sell or a buy price, with exception of item enhancements and trade goods
bool isEnchantingTradeGood = (itr->second.Class == ITEM_CLASS_TRADE_GOODS && itr->second.SubClass == ITEM_SUBCLASS_ENCHANTING); bool isEnchantingTradeGood = (itr->second.Class == ITEM_CLASS_TRADE_GOODS && itr->second.SubClass == ITEM_SUBCLASS_ENCHANTING);
bool isItemEnhancement = (itr->second.Class == ITEM_CLASS_CONSUMABLE && itr->second.SubClass == ITEM_SUBCLASS_ITEM_ENHANCEMENT); bool isItemEnhancement = (itr->second.Class == ITEM_CLASS_CONSUMABLE && itr->second.SubClass == ITEM_SUBCLASS_ITEM_ENHANCEMENT);
@@ -663,6 +692,14 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con
} }
} }
} }
}
void AuctionHouseBot::addProducedItemsToDisabledItems()
{
} }
void AuctionHouseBot::Update() void AuctionHouseBot::Update()
@@ -778,7 +815,9 @@ void AuctionHouseBot::InitializeConfiguration()
// Disabled Items // Disabled Items
DisabledItemTextFilter = sConfigMgr->GetOption<bool>("AuctionHouseBot.DisabledItemTextFilter", true); DisabledItemTextFilter = sConfigMgr->GetOption<bool>("AuctionHouseBot.DisabledItemTextFilter", true);
DisabledItems = LoadDisabledItems(sConfigMgr->GetOption<std::string>("AuctionHouseBot.DisabledItemIDs", "")); DisabledItems.clear();
AddDisabledItems(sConfigMgr->GetOption<std::string>("AuctionHouseBot.DisabledItemIDs", ""));
AddDisabledItems(sConfigMgr->GetOption<std::string>("AuctionHouseBot.DisabledCraftedItemIDs", ""));
} }
uint32 AuctionHouseBot::GetRandomStackValue(std::string configKeyString, uint32 defaultValue) uint32 AuctionHouseBot::GetRandomStackValue(std::string configKeyString, uint32 defaultValue)
@@ -796,7 +835,8 @@ void AuctionHouseBot::AddToDisabledItems(std::set<uint32>& workingDisabledItemID
{ {
if (workingDisabledItemIDs.find(disabledItemID) != workingDisabledItemIDs.end()) if (workingDisabledItemIDs.find(disabledItemID) != workingDisabledItemIDs.end())
{ {
LOG_ERROR("module", "AuctionHouseBot: Duplicate disabled item ID of {} found, skipping", disabledItemID); if (debug_Out)
LOG_ERROR("module", "AuctionHouseBot: Duplicate disabled item ID of {} found, skipping", disabledItemID);
} }
else else
{ {
@@ -804,11 +844,10 @@ void AuctionHouseBot::AddToDisabledItems(std::set<uint32>& workingDisabledItemID
} }
} }
std::set<uint32> AuctionHouseBot::LoadDisabledItems(std::string disabledItemIdString) void AuctionHouseBot::AddDisabledItems(std::string disabledItemIdString)
{ {
std::string delimitedValue; std::string delimitedValue;
std::stringstream disabledItemIdStream; std::stringstream disabledItemIdStream;
std::set<uint32> disabledItemIDs;
disabledItemIdStream.str(disabledItemIdString); disabledItemIdStream.str(disabledItemIdString);
while (std::getline(disabledItemIdStream, delimitedValue, ',')) // Process each item ID in the string, delimited by the comma "," while (std::getline(disabledItemIdStream, delimitedValue, ',')) // Process each item ID in the string, delimited by the comma ","
@@ -832,18 +871,16 @@ std::set<uint32> AuctionHouseBot::LoadDisabledItems(std::string disabledItemIdSt
else else
{ {
for (int32 i = leftId; i <= rightId; ++i) for (int32 i = leftId; i <= rightId; ++i)
AddToDisabledItems(disabledItemIDs, i); AddToDisabledItems(DisabledItems, i);
} }
} }
else else
{ {
auto itemId = atoi(valueOne.c_str()); auto itemId = atoi(valueOne.c_str());
AddToDisabledItems(disabledItemIDs, itemId); AddToDisabledItems(DisabledItems, itemId);
} }
} }
return disabledItemIDs;
} }
void AuctionHouseBot::Commands(uint32 command, uint32 ahMapID, char* args) void AuctionHouseBot::Commands(uint32 command, uint32 ahMapID, char* args)

View File

@@ -169,6 +169,7 @@ private:
void populateItemCandidateList(); void populateItemCandidateList();
void addNewAuctions(Player *AHBplayer, AHBConfig *config); void addNewAuctions(Player *AHBplayer, AHBConfig *config);
void addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *config, WorldSession *session); void addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *config, WorldSession *session);
void addProducedItemsToDisabledItems();
AuctionHouseBot(); AuctionHouseBot();
@@ -186,7 +187,7 @@ public:
void LoadValues(AHBConfig*); void LoadValues(AHBConfig*);
uint32 GetRandomStackValue(std::string configKeyString, uint32 defaultValue); uint32 GetRandomStackValue(std::string configKeyString, uint32 defaultValue);
void AddToDisabledItems(std::set<uint32>& workingDisabledItemIDs, uint32 disabledItemID); void AddToDisabledItems(std::set<uint32>& workingDisabledItemIDs, uint32 disabledItemID);
std::set<uint32> LoadDisabledItems(std::string disabledItemIdString); void AddDisabledItems(std::string disabledItemIdString);
void Commands(uint32 command, uint32 ahMapID, char* args); void Commands(uint32 command, uint32 ahMapID, char* args);
ObjectGuid::LowType GetAHBplayerGUID() { return AHBplayerGUID; }; ObjectGuid::LowType GetAHBplayerGUID() { return AHBplayerGUID; };
}; };