mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Merge pull request #171 from oiuv/player_bots
add config for another player's character as bot
This commit is contained in:
@@ -17,6 +17,10 @@ AiPlayerbot.DeleteRandomBotAccounts = 0
|
||||
# auto-login all player alts as bots on player login
|
||||
AiPlayerbot.BotAutologin = 0
|
||||
|
||||
# Allow login other players' characters as bots
|
||||
# Default: 0 (disabled)
|
||||
AiPlayerbot.AllowPlayerBots = 0
|
||||
|
||||
# Guild Task system
|
||||
AiPlayerbot.EnableGuildTasks = 0
|
||||
|
||||
|
||||
@@ -98,6 +98,7 @@ bool PlayerbotAIConfig::Initialize()
|
||||
iterationsPerTick = sConfigMgr->GetOption<int32>("AiPlayerbot.IterationsPerTick", 100);
|
||||
|
||||
allowGuildBots = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowGuildBots", true);
|
||||
allowPlayerBots = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowPlayerBots", false);
|
||||
|
||||
randomBotMapsAsString = sConfigMgr->GetOption<std::string>("AiPlayerbot.RandomBotMaps", "0,1,530,571");
|
||||
LoadList<std::vector<uint32>>(randomBotMapsAsString, randomBotMaps);
|
||||
|
||||
@@ -53,7 +53,7 @@ class PlayerbotAIConfig
|
||||
bool IsInPvpProhibitedArea(uint32 id);
|
||||
|
||||
bool enabled;
|
||||
bool allowGuildBots;
|
||||
bool allowGuildBots, allowPlayerBots;
|
||||
uint32 globalCoolDown, reactDelay, maxWaitForMove, expireActionTime, dispelAuraDuration, passiveDelay, repeatDelay,
|
||||
errorDelay, rpgDelay, sitDelay, returnDelay, lootDelay;
|
||||
float sightDistance, spellDistance, reactDistance, grindDistance, lootDistance, shootDistance,
|
||||
|
||||
@@ -527,6 +527,9 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje
|
||||
if (ObjectAccessor::FindPlayer(guid))
|
||||
return "player already logged in";
|
||||
|
||||
if (!sPlayerbotAIConfig->allowPlayerBots && !isRandomAccount && !isMasterAccount)
|
||||
return "You cannot login another player's character as bot.";
|
||||
|
||||
AddPlayerBot(guid, masterAccountId);
|
||||
return "ok";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user