[Configuration] Random bots fixed level

This commit is contained in:
Yunfan Li
2024-06-27 23:39:54 +08:00
parent 0129788ea3
commit 7395acb660
2 changed files with 6 additions and 5 deletions

View File

@@ -448,6 +448,12 @@ void PlayerbotHolder::OnBotLogin(Player* const bot)
uint32 accountId = bot->GetSession()->GetAccountId();
bool isRandomAccount = sPlayerbotAIConfig->IsInRandomAccountList(accountId);
if (isRandomAccount && sPlayerbotAIConfig->randomBotFixedLevel) {
bot->SetPlayerFlag(PLAYER_FLAGS_NO_XP_GAIN);
} else {
bot->RemovePlayerFlag(PLAYER_FLAGS_NO_XP_GAIN);
}
bot->SaveToDB(false, false);
if (master && isRandomAccount && master->GetLevel() < bot->GetLevel()) {
// PlayerbotFactory factory(bot, master->getLevel());

View File

@@ -11,11 +11,6 @@ bool XpGainAction::Execute(Event event)
{
context->GetValue<uint32>("death count")->Set(0);
if (sRandomPlayerbotMgr->IsRandomBot(bot) && sPlayerbotAIConfig->randomBotFixedLevel) {
bot->SetUInt32Value(PLAYER_XP, 0);
return true;
}
if (!sRandomPlayerbotMgr->IsRandomBot(bot) || sPlayerbotAIConfig->playerbotsXPrate == 1)
return true;