mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-12-01 21:12:50 +08:00
[Configuration] Random bots fixed level
This commit is contained in:
@@ -448,6 +448,12 @@ void PlayerbotHolder::OnBotLogin(Player* const bot)
|
|||||||
uint32 accountId = bot->GetSession()->GetAccountId();
|
uint32 accountId = bot->GetSession()->GetAccountId();
|
||||||
bool isRandomAccount = sPlayerbotAIConfig->IsInRandomAccountList(accountId);
|
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);
|
bot->SaveToDB(false, false);
|
||||||
if (master && isRandomAccount && master->GetLevel() < bot->GetLevel()) {
|
if (master && isRandomAccount && master->GetLevel() < bot->GetLevel()) {
|
||||||
// PlayerbotFactory factory(bot, master->getLevel());
|
// PlayerbotFactory factory(bot, master->getLevel());
|
||||||
|
|||||||
@@ -11,11 +11,6 @@ bool XpGainAction::Execute(Event event)
|
|||||||
{
|
{
|
||||||
context->GetValue<uint32>("death count")->Set(0);
|
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)
|
if (!sRandomPlayerbotMgr->IsRandomBot(bot) || sPlayerbotAIConfig->playerbotsXPrate == 1)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user