mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-12-01 21:12:50 +08:00
added additional botActiveAlone confguration options (#780)
This commit is contained in:
@@ -1511,6 +1511,12 @@ AiPlayerbot.RandombotsWalkingRPG.InDoors = 0
|
|||||||
# enforced to 100%
|
# enforced to 100%
|
||||||
AiPlayerbot.BotActiveAlone = 100
|
AiPlayerbot.BotActiveAlone = 100
|
||||||
|
|
||||||
|
# Force botActiveAlone when bot is ... of real player
|
||||||
|
AiPlayerbot.BotActiveAloneForceWhenInRadius = 150;
|
||||||
|
AiPlayerbot.BotActiveAloneForceWhenInZone = 1;
|
||||||
|
AiPlayerbot.BotActiveAloneForceWhenIsFriend = 1;
|
||||||
|
AiPlayerbot.BotActiveAloneForceWhenInGuild = 1;
|
||||||
|
|
||||||
# Specify smart scaling is enabled or not.
|
# Specify smart scaling is enabled or not.
|
||||||
# The default is 1. When enabled (smart) scales the 'BotActiveAlone' value.
|
# The default is 1. When enabled (smart) scales the 'BotActiveAlone' value.
|
||||||
# Only when botLevel is between WhenMinLevel and WhenMaxLevel.
|
# Only when botLevel is between WhenMinLevel and WhenMaxLevel.
|
||||||
|
|||||||
@@ -4173,13 +4173,25 @@ bool PlayerbotAI::AllowActive(ActivityType activityType)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// bot zone has active players.
|
// bot zone has active players.
|
||||||
if (ZoneHasRealPlayers(bot))
|
if (sPlayerbotAIConfig->BotActiveAloneForceWhenInZone)
|
||||||
{
|
{
|
||||||
return true;
|
if (ZoneHasRealPlayers(bot))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// when in real guild
|
// when in real guild
|
||||||
if (IsInRealGuild())
|
if (sPlayerbotAIConfig->BotActiveAloneForceWhenInGuild)
|
||||||
|
{
|
||||||
|
if (IsInRealGuild())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Player is near. Always active.
|
||||||
|
if (HasPlayerNearby(sPlayerbotAIConfig->BotActiveAloneWhenInRadius))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -4253,30 +4265,27 @@ bool PlayerbotAI::AllowActive(ActivityType activityType)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player is near. Always active.
|
|
||||||
if (HasPlayerNearby(300.f))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// HasFriend
|
// HasFriend
|
||||||
for (auto& player : sRandomPlayerbotMgr->GetPlayers())
|
if (sPlayerbotAIConfig->BotActiveAloneForceWhenIsFriend)
|
||||||
{
|
{
|
||||||
if (!player || !player->IsInWorld() || !player->GetSocial() || !bot->GetGUID())
|
for (auto& player : sRandomPlayerbotMgr->GetPlayers())
|
||||||
{
|
{
|
||||||
continue;
|
if (!player || !player->IsInWorld() || !player->GetSocial() || !bot->GetGUID())
|
||||||
}
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (player->GetSocial()->HasFriend(bot->GetGUID()))
|
if (player->GetSocial()->HasFriend(bot->GetGUID()))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force the bots to spread
|
// Force the bots to spread
|
||||||
if (activityType == OUT_OF_PARTY_ACTIVITY || activityType == GRIND_ACTIVITY)
|
if (activityType == OUT_OF_PARTY_ACTIVITY || activityType == GRIND_ACTIVITY)
|
||||||
{
|
{
|
||||||
if (HasManyPlayersNearby(10, sPlayerbotAIConfig->sightDistance))
|
if (HasManyPlayersNearby(10, 40))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -468,6 +468,10 @@ bool PlayerbotAIConfig::Initialize()
|
|||||||
playerbotsXPrate = sConfigMgr->GetOption<int32>("AiPlayerbot.KillXPRate", 1);
|
playerbotsXPrate = sConfigMgr->GetOption<int32>("AiPlayerbot.KillXPRate", 1);
|
||||||
disableDeathKnightLogin = sConfigMgr->GetOption<bool>("AiPlayerbot.DisableDeathKnightLogin", 0);
|
disableDeathKnightLogin = sConfigMgr->GetOption<bool>("AiPlayerbot.DisableDeathKnightLogin", 0);
|
||||||
botActiveAlone = sConfigMgr->GetOption<int32>("AiPlayerbot.BotActiveAlone", 100);
|
botActiveAlone = sConfigMgr->GetOption<int32>("AiPlayerbot.BotActiveAlone", 100);
|
||||||
|
BotActiveAloneWhenInRadius = sConfigMgr->GetOption<int32>("AiPlayerbot.BotActiveAloneWhenInRadius", 150);
|
||||||
|
BotActiveAloneForceWhenInZone = sConfigMgr->GetOption<bool>("AiPlayerbot.BotActiveAloneForceWhenInZone", 1);
|
||||||
|
BotActiveAloneForceWhenIsFriend = sConfigMgr->GetOption<bool>("AiPlayerbot.BotActiveAloneForceWhenIsFriend", 1);
|
||||||
|
BotActiveAloneForceWhenInGuild = sConfigMgr->GetOption<bool>("AiPlayerbot.BotActiveAloneForceWhenInGuild", 1);
|
||||||
botActiveAloneSmartScale = sConfigMgr->GetOption<bool>("AiPlayerbot.botActiveAloneSmartScale", 1);
|
botActiveAloneSmartScale = sConfigMgr->GetOption<bool>("AiPlayerbot.botActiveAloneSmartScale", 1);
|
||||||
botActiveAloneSmartScaleWhenMinLevel =
|
botActiveAloneSmartScaleWhenMinLevel =
|
||||||
sConfigMgr->GetOption<uint32>("AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel", 1);
|
sConfigMgr->GetOption<uint32>("AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel", 1);
|
||||||
|
|||||||
@@ -264,6 +264,10 @@ public:
|
|||||||
uint32 playerbotsXPrate;
|
uint32 playerbotsXPrate;
|
||||||
bool disableDeathKnightLogin;
|
bool disableDeathKnightLogin;
|
||||||
uint32 botActiveAlone;
|
uint32 botActiveAlone;
|
||||||
|
uint32 BotActiveAloneWhenInRadius;
|
||||||
|
bool BotActiveAloneForceWhenInZone;
|
||||||
|
bool BotActiveAloneForceWhenIsFriend;
|
||||||
|
bool BotActiveAloneForceWhenInGuild;
|
||||||
bool botActiveAloneSmartScale;
|
bool botActiveAloneSmartScale;
|
||||||
uint32 botActiveAloneSmartScaleWhenMinLevel;
|
uint32 botActiveAloneSmartScaleWhenMinLevel;
|
||||||
uint32 botActiveAloneSmartScaleWhenMaxLevel;
|
uint32 botActiveAloneSmartScaleWhenMaxLevel;
|
||||||
|
|||||||
Reference in New Issue
Block a user