Auto Join BG config

This commit is contained in:
郑佩茹
2023-04-04 13:41:01 -06:00
parent e1f8a849e4
commit 9871cd34c4
4 changed files with 8 additions and 0 deletions

View File

@@ -32,6 +32,9 @@ AiPlayerbot.SuggestDungeonsInLowerCaseRandomly = 0
# Enable BG/Arena for random Bots # Enable BG/Arena for random Bots
AiPlayerbot.RandomBotJoinBG = 1 AiPlayerbot.RandomBotJoinBG = 1
# Enable Auto join BG - bots randomly join WSG and 2v2 Arena if server is not lagging
AiPlayerbot.RandomBotAutoJoinBG = 0
# Mark many quests <= Bot level as complete (slows down bot creation) # Mark many quests <= Bot level as complete (slows down bot creation)
AiPlayerbot.PreQuests = 0 AiPlayerbot.PreQuests = 0

View File

@@ -128,6 +128,7 @@ bool PlayerbotAIConfig::Initialize()
randomBotSuggestDungeons = sConfigMgr->GetOption<bool>("AiPlayerbot.RandomBotSuggestDungeons", true); randomBotSuggestDungeons = sConfigMgr->GetOption<bool>("AiPlayerbot.RandomBotSuggestDungeons", true);
suggestDungeonsInLowerCaseRandomly = sConfigMgr->GetOption<bool>("AiPlayerbot.SuggestDungeonsInLowerCaseRandomly", false); suggestDungeonsInLowerCaseRandomly = sConfigMgr->GetOption<bool>("AiPlayerbot.SuggestDungeonsInLowerCaseRandomly", false);
randomBotJoinBG = sConfigMgr->GetOption<bool>("AiPlayerbot.RandomBotJoinBG", true); randomBotJoinBG = sConfigMgr->GetOption<bool>("AiPlayerbot.RandomBotJoinBG", true);
randomBotAutoJoinBG = sConfigMgr->GetOption<bool>("AiPlayerbot.RandomBotAutoJoinBG", false);
logInGroupOnly = sConfigMgr->GetOption<bool>("AiPlayerbot.LogInGroupOnly", true); logInGroupOnly = sConfigMgr->GetOption<bool>("AiPlayerbot.LogInGroupOnly", true);
logValuesPerTick = sConfigMgr->GetOption<bool>("AiPlayerbot.LogValuesPerTick", false); logValuesPerTick = sConfigMgr->GetOption<bool>("AiPlayerbot.LogValuesPerTick", false);
fleeingEnabled = sConfigMgr->GetOption<bool>("AiPlayerbot.FleeingEnabled", true); fleeingEnabled = sConfigMgr->GetOption<bool>("AiPlayerbot.FleeingEnabled", true);

View File

@@ -73,6 +73,7 @@ class PlayerbotAIConfig
bool randomBotSuggestDungeons; bool randomBotSuggestDungeons;
bool suggestDungeonsInLowerCaseRandomly; bool suggestDungeonsInLowerCaseRandomly;
bool randomBotJoinBG; bool randomBotJoinBG;
bool randomBotAutoJoinBG;
bool randomBotLoginAtStartup; bool randomBotLoginAtStartup;
uint32 randomBotTeleLevel; uint32 randomBotTeleLevel;
bool logInGroupOnly, logValuesPerTick; bool logInGroupOnly, logValuesPerTick;

View File

@@ -245,6 +245,9 @@ bool BGJoinAction::shouldJoinBg(BattlegroundQueueTypeId queueTypeId, Battlegroun
bool hasPlayers = (sRandomPlayerbotMgr->BgPlayers[queueTypeId][bracketId][TEAM_ALLIANCE] + sRandomPlayerbotMgr->BgPlayers[queueTypeId][bracketId][TEAM_HORDE]) > 0; bool hasPlayers = (sRandomPlayerbotMgr->BgPlayers[queueTypeId][bracketId][TEAM_ALLIANCE] + sRandomPlayerbotMgr->BgPlayers[queueTypeId][bracketId][TEAM_HORDE]) > 0;
bool hasBots = (sRandomPlayerbotMgr->BgBots[queueTypeId][bracketId][TEAM_ALLIANCE] + sRandomPlayerbotMgr->BgBots[queueTypeId][bracketId][TEAM_HORDE]) >= bg->GetMinPlayersPerTeam(); bool hasBots = (sRandomPlayerbotMgr->BgBots[queueTypeId][bracketId][TEAM_ALLIANCE] + sRandomPlayerbotMgr->BgBots[queueTypeId][bracketId][TEAM_HORDE]) >= bg->GetMinPlayersPerTeam();
if (!sPlayerbotAIConfig->randomBotAutoJoinBG && !hasPlayers)
return false;
if (!(hasPlayers || hasBots)) if (!(hasPlayers || hasBots))
return false; return false;