Maintenance config for altbots (#1693)

* Maintenance config controls

bools in config

* Update TrainerAction.cpp

removed some note-to-selfs (personal config preferences)

* Set default to true

Also tidied up some comments

* Update playerbots.conf.dist

* Reorganised

Changed the description in conf to be less conversational.

Rearranged the order that options are arranged, grouping by what made sense to me (the type of gameplay made easier/skipped by the option being enabled).

Rearranged the order the variables and method calls are listed in the code to match the order they are presented in the conf to make future maintenance of maintenance (:P) more intuitive.

* Update playerbots.conf.dist

Revert previous commit (change to call order in MaintenanceAction::Execute)

conf settings grouped
This commit is contained in:
IainD92
2025-10-03 10:56:16 +01:00
committed by GitHub
parent ffa8c6d94a
commit f2b5580495
4 changed files with 151 additions and 20 deletions

View File

@@ -488,6 +488,34 @@ AiPlayerbot.RPWarningCooldown = 30
# Default: 1 (enabled)
AiPlayerbot.MaintenanceCommand = 1
# Enable/Disable specific maintenance command functionality for alt bots
# Disable to prevent players from giving free bags, spells, skill levels etc to their alt bots
# Default: 1 (enabled)
AiPlayerbot.AltMaintenanceAmmo = 1
AiPlayerbot.AltMaintenanceFood = 1
AiPlayerbot.AltMaintenanceReagents = 1
AiPlayerbot.AltMaintenanceConsumables = 1
AiPlayerbot.AltMaintenancePotions = 1
AiPlayerbot.AltMaintenanceBags = 1
AiPlayerbot.AltMaintenanceMounts = 1
AiPlayerbot.AltMaintenanceSkills = 1
AiPlayerbot.AltMaintenanceClassSpells = 1 # Spells from quests (tame/summon pets, totems, druid forms, etc)
AiPlayerbot.AltMaintenanceAvailableSpells = 1 # Spells learnable from trainer
AiPlayerbot.AltMaintenanceSpecialSpells = 1 # Leave DK starting area
AiPlayerbot.AltMaintenanceTalentTree = 1
AiPlayerbot.AltMaintenanceGlyphs = 1
AiPlayerbot.AltMaintenanceGemsEnchants = 1
AiPlayerbot.AltMaintenancePet = 1
AiPlayerbot.AltMaintenancePetTalents = 1
AiPlayerbot.AltMaintenanceReputation = 1
AiPlayerbot.AltMaintenanceAttunementQuests = 1
AiPlayerbot.AltMaintenanceKeyring = 1
# Enable/Disable autogear command, which automatically upgrades bots' gear; the quality is limited by AutoGearQualityLimit and AutoGearScoreLimit
# Default: 1 (enabled)
AiPlayerbot.AutoGearCommand = 1

View File

@@ -553,6 +553,27 @@ bool PlayerbotAIConfig::Initialize()
addClassCommand = sConfigMgr->GetOption<int32>("AiPlayerbot.AddClassCommand", 1);
addClassAccountPoolSize = sConfigMgr->GetOption<int32>("AiPlayerbot.AddClassAccountPoolSize", 50);
maintenanceCommand = sConfigMgr->GetOption<int32>("AiPlayerbot.MaintenanceCommand", 1);
altMaintenanceAttunementQs = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceAttunementQuests", true);
altMaintenanceBags = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceBags", true);
altMaintenanceAmmo = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceAmmo", true);
altMaintenanceFood = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceFood", true);
altMaintenanceReagents = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceReagents", true);
altMaintenanceConsumables = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceConsumables", true);
altMaintenancePotions = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenancePotions", true);
altMaintenanceTalentTree = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceTalentTree", true);
altMaintenancePet = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenancePet", true);
altMaintenancePetTalents = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenancePetTalents", true);
altMaintenanceClassSpells = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceClassSpells", true);
altMaintenanceAvailableSpells = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceAvailableSpells", true);
altMaintenanceSkills = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceSkills", true);
altMaintenanceReputation = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceReputation", true);
altMaintenanceSpecialSpells = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceSpecialSpells", true);
altMaintenanceMounts = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceMounts", true);
altMaintenanceGlyphs = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceGlyphs", true);
altMaintenanceKeyring = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceKeyring", true);
altMaintenanceGemsEnchants = sConfigMgr->GetOption<bool>("AiPlayerbot.AltMaintenanceGemsEnchants", true);
autoGearCommand = sConfigMgr->GetOption<int32>("AiPlayerbot.AutoGearCommand", 1);
autoGearCommandAltBots = sConfigMgr->GetOption<int32>("AiPlayerbot.AutoGearCommandAltBots", 1);
autoGearQualityLimit = sConfigMgr->GetOption<int32>("AiPlayerbot.AutoGearQualityLimit", 3);

View File

@@ -393,6 +393,25 @@ public:
int32 addClassCommand;
int32 addClassAccountPoolSize;
int32 maintenanceCommand;
bool altMaintenanceAttunementQs,
altMaintenanceBags,
altMaintenanceAmmo,
altMaintenanceFood,
altMaintenanceReagents,
altMaintenanceConsumables,
altMaintenancePotions,
altMaintenanceTalentTree,
altMaintenancePet,
altMaintenancePetTalents,
altMaintenanceClassSpells,
altMaintenanceAvailableSpells,
altMaintenanceSkills,
altMaintenanceReputation,
altMaintenanceSpecialSpells,
altMaintenanceMounts,
altMaintenanceGlyphs,
altMaintenanceKeyring,
altMaintenanceGemsEnchants;
int32 autoGearCommand, autoGearCommandAltBots, autoGearQualityLimit, autoGearScoreLimit;
uint32 useGroundMountAtMinLevel;

View File

@@ -170,26 +170,89 @@ bool MaintenanceAction::Execute(Event event)
botAI->TellMaster("I'm maintaining");
PlayerbotFactory factory(bot, bot->GetLevel());
factory.InitAttunementQuests();
factory.InitBags(false);
factory.InitAmmo();
factory.InitFood();
factory.InitReagents();
factory.InitConsumables();
factory.InitPotions();
factory.InitTalentsTree(true);
factory.InitPet();
factory.InitPetTalents();
factory.InitClassSpells();
factory.InitAvailableSpells();
factory.InitSkills();
factory.InitReputation();
factory.InitSpecialSpells();
factory.InitMounts();
factory.InitGlyphs(false);
factory.InitKeyring();
if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel)
factory.ApplyEnchantAndGemsNew();
if (!botAI->IsAlt())
{
factory.InitAttunementQuests();
factory.InitBags(false);
factory.InitAmmo();
factory.InitFood();
factory.InitReagents();
factory.InitConsumables();
factory.InitPotions();
factory.InitTalentsTree(true);
factory.InitPet();
factory.InitPetTalents();
factory.InitClassSpells();
factory.InitAvailableSpells();
factory.InitSkills();
factory.InitReputation();
factory.InitSpecialSpells();
factory.InitMounts();
factory.InitGlyphs(false);
factory.InitKeyring();
if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel)
factory.ApplyEnchantAndGemsNew();
}
else
{
if (sPlayerbotAIConfig->altMaintenanceAttunementQs)
factory.InitAttunementQuests();
if (sPlayerbotAIConfig->altMaintenanceBags)
factory.InitBags(false);
if (sPlayerbotAIConfig->altMaintenanceAmmo)
factory.InitAmmo();
if (sPlayerbotAIConfig->altMaintenanceFood)
factory.InitFood();
if (sPlayerbotAIConfig->altMaintenanceReagents)
factory.InitReagents();
if (sPlayerbotAIConfig->altMaintenanceConsumables)
factory.InitConsumables();
if (sPlayerbotAIConfig->altMaintenancePotions)
factory.InitPotions();
if (sPlayerbotAIConfig->altMaintenanceTalentTree)
factory.InitTalentsTree(true);
if (sPlayerbotAIConfig->altMaintenancePet)
factory.InitPet();
if (sPlayerbotAIConfig->altMaintenancePetTalents)
factory.InitPetTalents();
if (sPlayerbotAIConfig->altMaintenanceClassSpells)
factory.InitClassSpells();
if (sPlayerbotAIConfig->altMaintenanceAvailableSpells)
factory.InitAvailableSpells();
if (sPlayerbotAIConfig->altMaintenanceSkills)
factory.InitSkills();
if (sPlayerbotAIConfig->altMaintenanceReputation)
factory.InitReputation();
if (sPlayerbotAIConfig->altMaintenanceSpecialSpells)
factory.InitSpecialSpells();
if (sPlayerbotAIConfig->altMaintenanceMounts)
factory.InitMounts();
if (sPlayerbotAIConfig->altMaintenanceGlyphs)
factory.InitGlyphs(false);
if (sPlayerbotAIConfig->altMaintenanceKeyring)
factory.InitKeyring();
if (sPlayerbotAIConfig->altMaintenanceGemsEnchants && bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel)
factory.ApplyEnchantAndGemsNew();
}
bot->DurabilityRepairAll(false, 1.0f, false);
bot->SendTalentsInfoData(false);