[Configuration] Gear quality on random bots

This commit is contained in:
Yunfan Li
2024-07-11 12:32:22 +08:00
parent c362630ce6
commit adc9c96b29
4 changed files with 18 additions and 2 deletions

View File

@@ -891,6 +891,14 @@ AiPlayerbot.AutoPickTalents = 1
#
#
# Equips quality limitation for random bots (1 = normal, 2 = uncommon, 3 = rare, 4 = epic, 5 = legendary)
# default: 3 (rare)
AiPlayerbot.RandomGearQualityLimit = 3
# Equips gear score limitation for random bots (0 = no limit)
# default: 0 (no limit)
AiPlayerbot.RandomGearScoreLimit = 0
# Change random bot has lower gear
AiPlayerbot.RandomGearLoweringChance = 0

View File

@@ -95,7 +95,10 @@ bool PlayerbotAIConfig::Initialize()
autoAvoidAoe = sConfigMgr->GetOption<bool>("AiPlayerbot.AutoAvoidAoe", true);
tellWhenAvoidAoe = sConfigMgr->GetOption<bool>("AiPlayerbot.TellWhenAvoidAoe", true);
randomGearLoweringChance = sConfigMgr->GetOption<float>("AiPlayerbot.RandomGearLoweringChance", 0.15f);
randomGearLoweringChance = sConfigMgr->GetOption<float>("AiPlayerbot.RandomGearLoweringChance", 0.0f);
randomGearQualityLimit = sConfigMgr->GetOption<int32>("AiPlayerbot.AutoGearQualityLimit", 3);
randomGearScoreLimit = sConfigMgr->GetOption<int32>("AiPlayerbot.AutoGearScoreLimit", 0);
randomBotMaxLevelChance = sConfigMgr->GetOption<float>("AiPlayerbot.RandomBotMaxLevelChance", 0.15f);
randomBotRpgChance = sConfigMgr->GetOption<float>("AiPlayerbot.RandomBotRpgChance", 0.20f);

View File

@@ -79,6 +79,8 @@ class PlayerbotAIConfig
std::vector<uint32> randomBotQuestIds;
uint32 randomBotTeleportDistance;
float randomGearLoweringChance;
int32 randomGearQualityLimit;
int32 randomGearScoreLimit;
float randomBotMaxLevelChance;
float randomBotRpgChance;
uint32 minRandomBots, maxRandomBots;

View File

@@ -149,7 +149,10 @@ void PlayerbotFactory::Prepare()
{
if (!itemQuality)
{
itemQuality = ITEM_QUALITY_RARE;
uint32 gs = sPlayerbotAIConfig->randomGearScoreLimit == 0 ? 0 :
PlayerbotFactory::CalcMixedGearScore(sPlayerbotAIConfig->randomGearScoreLimit, sPlayerbotAIConfig->randomGearQualityLimit);
itemQuality = sPlayerbotAIConfig->randomGearScoreLimit;
gearScoreLimit = gs;
}
if (bot->isDead())