Merge pull request #341 from fuzzdeveloper/limit-gear-expansion

New AiPlayerbot.LimitGearExpansion option
This commit is contained in:
fuzzdeveloper
2024-07-14 20:21:36 +10:00
committed by GitHub
4 changed files with 23 additions and 10 deletions

View File

@@ -511,9 +511,15 @@ AiPlayerbot.RandomGearScoreLimit = 0
# Default: 60 # Default: 60
AiPlayerbot.MinEnchantingBotLevel = 60 AiPlayerbot.MinEnchantingBotLevel = 60
# Enable expansion limitation # Enable expansion limitation for enchants - ie: level <= 60 bot only uses enchants
# Default: 1 # available in vanilla, level <= 70 bot only uses enchants available in TBC)
AiPlayerbot.LimitEnchantExpansion = 1 # 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 # Change random bot has lower gear
AiPlayerbot.RandomGearLoweringChance = 0 AiPlayerbot.RandomGearLoweringChance = 0

View File

@@ -300,7 +300,8 @@ bool PlayerbotAIConfig::Initialize()
randombotsWalkingRPG = sConfigMgr->GetOption<bool>("AiPlayerbot.RandombotsWalkingRPG", false); randombotsWalkingRPG = sConfigMgr->GetOption<bool>("AiPlayerbot.RandombotsWalkingRPG", false);
randombotsWalkingRPGInDoors = sConfigMgr->GetOption<bool>("AiPlayerbot.RandombotsWalkingRPG.InDoors", false); randombotsWalkingRPGInDoors = sConfigMgr->GetOption<bool>("AiPlayerbot.RandombotsWalkingRPG.InDoors", false);
minEnchantingBotLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.MinEnchantingBotLevel", 60); minEnchantingBotLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.MinEnchantingBotLevel", 60);
limitEnchantExpansion = sConfigMgr->GetOption<int32>("AiPlayerbot.LimitEnchantExpansion", 1); limitEnchantExpansion = sConfigMgr->GetOption<int32>("AiPlayerbot.LimitEnchantExpansion", 0);
limitGearExpansion = sConfigMgr->GetOption<int32>("AiPlayerbot.LimitGearExpansion", 0);
randombotStartingLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.RandombotStartingLevel", 5); randombotStartingLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.RandombotStartingLevel", 5);
enableRotation = sConfigMgr->GetOption<bool>("AiPlayerbot.EnableRotation", false); enableRotation = sConfigMgr->GetOption<bool>("AiPlayerbot.EnableRotation", false);
rotationPoolSize = sConfigMgr->GetOption<int32>("AiPlayerbot.RotationPoolSize", 500); rotationPoolSize = sConfigMgr->GetOption<int32>("AiPlayerbot.RotationPoolSize", 500);

View File

@@ -136,6 +136,7 @@ class PlayerbotAIConfig
bool randombotsWalkingRPGInDoors; bool randombotsWalkingRPGInDoors;
uint32 minEnchantingBotLevel; uint32 minEnchantingBotLevel;
uint32 limitEnchantExpansion; uint32 limitEnchantExpansion;
uint32 limitGearExpansion;
uint32 randombotStartingLevel; uint32 randombotStartingLevel;
bool enableRotation; bool enableRotation;
uint32 rotationPoolSize; uint32 rotationPoolSize;

View File

@@ -1456,6 +1456,14 @@ void PlayerbotFactory::InitEquipment(bool incremental)
if (itemId == 46978) { // shaman earth ring totem if (itemId == 46978) { // shaman earth ring totem
continue; 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); ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId);
if (!proto) if (!proto)
continue; continue;
@@ -3454,15 +3462,12 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destoryOld)
continue; continue;
} }
// disable next expansion // disable next expansion enchantments
if (sPlayerbotAIConfig->limitEnchantExpansion && bot->GetLevel() <= 69 && enchantSpell >= 25072) { if (sPlayerbotAIConfig->limitEnchantExpansion && bot->GetLevel() <= 60 && enchantSpell >= 25072)
continue; continue;
}
if (sPlayerbotAIConfig->limitEnchantExpansion && bot->GetLevel() <= 79 && enchantSpell > 48557) { if (sPlayerbotAIConfig->limitEnchantExpansion && bot->GetLevel() <= 70 && enchantSpell > 48557)
continue; continue;
}
for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{ {