From 28a888b6e0d1be61f9b6d38a83f1a1dca9b3a41e Mon Sep 17 00:00:00 2001 From: kadeshar Date: Fri, 6 Mar 2026 16:56:53 +0100 Subject: [PATCH] Added unobtainable items to config (#2133) # Pull Request Moving hardcoded values to config ## How to Test the Changes - use maintenance command - unequip and destroy item get from this command - turn off server - add item to config - turn on server - use maintenace command - check that different item was provided ## Complexity & Impact Does this change add new decision branches? - - [X] No - - [ ] Yes (**explain below**) Does this change increase per-bot or per-tick processing? - - [X] No - - [ ] Yes (**describe and justify impact**) Could this logic scale poorly under load? - - [X] No - - [ ] Yes (**explain why**) --- ## Defaults & Configuration Does this change modify default bot behavior? - - [X] No - - [ ] Yes (**explain why**) --- ## AI Assistance Was AI assistance (e.g. ChatGPT or similar tools) used while working on this change? - - [X] No - - [ ] Yes (**explain below**) --- ## Final Checklist - - [X] Stability is not compromised - - [X] Performance impact is understood, tested, and acceptable - - [X] Added logic complexity is justified and explained - - [X] Documentation updated if needed --- ## Notes for Reviewers --- conf/playerbots.conf.dist | 6 +++++- src/Mgr/Item/RandomItemMgr.cpp | 5 +---- src/PlayerbotAIConfig.cpp | 5 +++++ src/PlayerbotAIConfig.h | 1 + 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 5acf71ea..ede73583 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -796,6 +796,10 @@ AiPlayerbot.LimitGearExpansion = 1 # Set between 0 (0%) and 1 (100%) AiPlayerbot.RandomGearLoweringChance = 0 +# Unobtainable or unusable items (comma-separated list of item IDs) +# Default: Chilton Wand (12468), Totem of the Earthen Ring (46978) +AiPlayerbot.UnobtainableItems = 12468,46978 + # Randombots check player's gearscore level and deny the group invitation if it's too low # Default: 0 (disabled) AiPlayerbot.GearScoreCheck = 0 @@ -2213,4 +2217,4 @@ AiPlayerbot.SummonAtInnkeepersEnabled = 1 # 30% more damage, 40% damage reduction (tank bots), increased all resistances, reduced threat for non tank bots, increased threat for tank bots. # Buffs will be applied on PP, Sindragosa and Lich King -AiPlayerbot.EnableICCBuffs = 1 \ No newline at end of file +AiPlayerbot.EnableICCBuffs = 1 diff --git a/src/Mgr/Item/RandomItemMgr.cpp b/src/Mgr/Item/RandomItemMgr.cpp index d2e7c866..d2a27972 100644 --- a/src/Mgr/Item/RandomItemMgr.cpp +++ b/src/Mgr/Item/RandomItemMgr.cpp @@ -2255,10 +2255,7 @@ void RandomItemMgr::BuildEquipCacheNew() continue; } - // Unobtainable or unusable items - if (itemId == 12468 || // Chilton Wand - itemId == 22784 || // Sunwell Orb - itemId == 46978) // Totem of the Earthen Ring + if (sPlayerbotAIConfig.unobtainableItems.find(itemId) != sPlayerbotAIConfig.unobtainableItems.end()) continue; equipCacheNew[proto->RequiredLevel][proto->InventoryType].push_back(itemId); diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 211db9a0..356098d3 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -182,6 +182,11 @@ bool PlayerbotAIConfig::Initialize() LoadSet>( sConfigMgr->GetOption("AiPlayerbot.AttunementQuests", "10279,10277,10282,10283,10284,10285,10296,10297,10298,11481,11482,11488,11490,11492,10901"), attunementQuests); + + LoadSet>( + sConfigMgr->GetOption("AiPlayerbot.UnobtainableItems", "12468,46978"), + unobtainableItems); + botAutologin = sConfigMgr->GetOption("AiPlayerbot.BotAutologin", false); randomBotAutologin = sConfigMgr->GetOption("AiPlayerbot.RandomBotAutologin", true); minRandomBots = sConfigMgr->GetOption("AiPlayerbot.MinRandomBots", 500); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index a5c6e461..efde98e1 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -99,6 +99,7 @@ public: bool tellWhenAvoidAoe; std::set disallowedGameObjects; std::set attunementQuests; + std::set unobtainableItems; uint32 openGoSpell; bool randomBotAutologin;