From 5e2d06d6ebd1b646e9642133fe209b0b276bdb64 Mon Sep 17 00:00:00 2001 From: Fuzz Date: Sun, 14 Jul 2024 18:43:20 +1000 Subject: [PATCH] added AiPlayerbot.LimitGearExpansion option so that bots <= 60 can be limited to expansions gear based on level (bot-level <= 60 gets vanilla gear, bot <= 70 gets TBC gear). also modified level thresholds for LimitEnchantExpansion option (which were <= 69 for vanilla enchants and <= 79 for TBC - those dont seem right because 61-69 are TBC levels, not vanilla, same for 71-79 being WOTLK) --- conf/playerbots.conf.dist | 12 +++++++++--- src/PlayerbotAIConfig.cpp | 3 ++- src/PlayerbotAIConfig.h | 1 + src/PlayerbotFactory.cpp | 17 +++++++++++------ 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 4ae02b69..eab4de36 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -511,9 +511,15 @@ AiPlayerbot.RandomGearScoreLimit = 0 # Default: 60 AiPlayerbot.MinEnchantingBotLevel = 60 -# Enable expansion limitation -# Default: 1 -AiPlayerbot.LimitEnchantExpansion = 1 +# Enable expansion limitation for enchants - ie: level <= 60 bot only uses enchants +# available in vanilla, level <= 70 bot only uses enchants available in TBC) +# Default: 0 +AiPlayerbot.LimitEnchantExpansion = 0 + +# Enable expansion limitation for gear - ie: level <= 60 bot only uses gear +# available in vanilla, level <= 70 bot only uses gear available in TBC) +# Default: 0 +AiPlayerbot.LimitGearExpansion = 0 # Change random bot has lower gear AiPlayerbot.RandomGearLoweringChance = 0 diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 48783180..a6bcf470 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -300,7 +300,8 @@ bool PlayerbotAIConfig::Initialize() randombotsWalkingRPG = sConfigMgr->GetOption("AiPlayerbot.RandombotsWalkingRPG", false); randombotsWalkingRPGInDoors = sConfigMgr->GetOption("AiPlayerbot.RandombotsWalkingRPG.InDoors", false); minEnchantingBotLevel = sConfigMgr->GetOption("AiPlayerbot.MinEnchantingBotLevel", 60); - limitEnchantExpansion = sConfigMgr->GetOption("AiPlayerbot.LimitEnchantExpansion", 1); + limitEnchantExpansion = sConfigMgr->GetOption("AiPlayerbot.LimitEnchantExpansion", 0); + limitGearExpansion = sConfigMgr->GetOption("AiPlayerbot.LimitGearExpansion", 0); randombotStartingLevel = sConfigMgr->GetOption("AiPlayerbot.RandombotStartingLevel", 5); enableRotation = sConfigMgr->GetOption("AiPlayerbot.EnableRotation", false); rotationPoolSize = sConfigMgr->GetOption("AiPlayerbot.RotationPoolSize", 500); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index 7bbc0512..17da007d 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -136,6 +136,7 @@ class PlayerbotAIConfig bool randombotsWalkingRPGInDoors; uint32 minEnchantingBotLevel; uint32 limitEnchantExpansion; + uint32 limitGearExpansion; uint32 randombotStartingLevel; bool enableRotation; uint32 rotationPoolSize; diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index c74b722d..26f9e3a6 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -1456,6 +1456,14 @@ void PlayerbotFactory::InitEquipment(bool incremental) if (itemId == 46978) { // shaman earth ring totem continue; } + + // disable next expansion gear + if (sPlayerbotAIConfig->limitGearExpansion && bot->GetLevel() <= 60 && itemId >= 23728) + continue; + + if (sPlayerbotAIConfig->limitGearExpansion && bot->GetLevel() <= 70 && itemId >= 35570 && itemId != 36737 && itemId != 37739 && itemId != 37740)//transition point from TBC -> WOTLK isn't as clear, and there are other wearable TBC items above 35570 but nothing of significance + continue; + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId); if (!proto) continue; @@ -3454,15 +3462,12 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destoryOld) continue; } - // disable next expansion - if (sPlayerbotAIConfig->limitEnchantExpansion && bot->GetLevel() <= 69 && enchantSpell >= 25072) { + // disable next expansion enchantments + if (sPlayerbotAIConfig->limitEnchantExpansion && bot->GetLevel() <= 60 && enchantSpell >= 25072) continue; - } - if (sPlayerbotAIConfig->limitEnchantExpansion && bot->GetLevel() <= 79 && enchantSpell > 48557) { + if (sPlayerbotAIConfig->limitEnchantExpansion && bot->GetLevel() <= 70 && enchantSpell > 48557) continue; - } - for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) {