mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-21 02:20:00 +01:00
[Configuration] Random bots fixed level
This commit is contained in:
parent
0129788ea3
commit
7395acb660
@ -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;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user