Revise bot logic for initializing and using consumables (#1483)

Bots will now add level- and spec-appropriate oils and stones when maintaining and, with respect to randombots, leveling. All bots (other than those with class-specific temporary weapon enchants) will apply oils and stones to their weapons. General clean-ups to associated code were made.
This commit is contained in:
brighton-chi
2025-08-01 12:28:13 -05:00
committed by GitHub
parent baa1aa9e9d
commit 938872564a
10 changed files with 591 additions and 454 deletions

View File

@@ -157,16 +157,23 @@ void AutoMaintenanceOnLevelupAction::LearnSpell(uint32 spellId, std::ostringstre
void AutoMaintenanceOnLevelupAction::AutoUpgradeEquip()
{
if (!sPlayerbotAIConfig->autoUpgradeEquip || !sRandomPlayerbotMgr->IsRandomBot(bot))
{
return;
}
PlayerbotFactory factory(bot, bot->GetLevel());
// Clean up old consumables before adding new ones
factory.CleanupConsumables();
factory.InitAmmo();
factory.InitReagents();
factory.InitFood();
factory.InitConsumables();
factory.InitPotions();
if (!sPlayerbotAIConfig->equipmentPersistence || bot->GetLevel() < sPlayerbotAIConfig->equipmentPersistenceLevel)
{
if (sPlayerbotAIConfig->incrementalGearInit)
factory.InitEquipment(true);
}
factory.InitAmmo();
return;
}