[Random bots] Ensure teleport after randomize

This commit is contained in:
Yunfan Li
2024-07-11 23:01:25 +08:00
parent 2a542b1345
commit db1cfa6abc
6 changed files with 26 additions and 19 deletions

View File

@@ -24,7 +24,6 @@ bool AutoLearnSpellAction::Execute(Event event)
out << ".";
botAI->TellMaster(out);
}
return true;
}
@@ -181,3 +180,15 @@ void AutoLearnSpellAction::LearnSpell(uint32 spellId, std::ostringstream* out)
}
}
}
bool AutoUpgradeEquipAction::Execute(Event event) {
if (!sPlayerbotAIConfig->autoUpgradeEquip || !sRandomPlayerbotMgr->IsRandomBot(bot)) {
return false;
}
PlayerbotFactory factory(bot, bot->GetLevel(), ITEM_QUALITY_RARE);
if (!sPlayerbotAIConfig->equipmentPersistence || bot->GetLevel() < sPlayerbotAIConfig->equipmentPersistenceLevel) {
factory.InitEquipment(true);
}
factory.InitAmmo();
return true;
}