Skip to content

Commit a78877c

Browse files
authored
Merge 63ae8d7 into da52a27
2 parents da52a27 + 63ae8d7 commit a78877c

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

src/modules/Bots/playerbot/PlayerbotAIConfig.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ PlayerbotAIConfig::PlayerbotAIConfig()
3131
followDistance(0.0f),
3232
whisperDistance(0.0f),
3333
contactDistance(0.0f),
34+
whisperToZoneOnly(false),
3435
criticalHealth(0),
3536
lowHealth(0),
3637
mediumHealth(0),
@@ -134,6 +135,7 @@ bool PlayerbotAIConfig::Initialize()
134135
meleeDistance = config.GetFloatDefault("AiPlayerbot.MeleeDistance", 1.5f);
135136
followDistance = config.GetFloatDefault("AiPlayerbot.FollowDistance", 1.5f);
136137
whisperDistance = config.GetFloatDefault("AiPlayerbot.WhisperDistance", 6000.0f);
138+
whisperToZoneOnly = config.GetBoolDefault("AiPlayerbot.WhisperToZoneOnly", false);
137139
contactDistance = config.GetFloatDefault("AiPlayerbot.ContactDistance", 0.5f);
138140

139141
criticalHealth = config.GetIntDefault("AiPlayerbot.CriticalHealth", 20);

src/modules/Bots/playerbot/PlayerbotAIConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class PlayerbotAIConfig
4545
uint32 globalCoolDown, reactDelay, maxWaitForMove, passiveDelay;
4646
float sightDistance, spellDistance, reactDistance, grindDistance, lootDistance,
4747
fleeDistance, tooCloseDistance, meleeDistance, followDistance, whisperDistance, contactDistance;
48+
bool whisperToZoneOnly;
4849
uint32 criticalHealth, lowHealth, mediumHealth, almostFullHealth;
4950
uint32 lowMana, mediumMana;
5051

src/modules/Bots/playerbot/aiplayerbot.conf.dist.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ AiPlayerbot.CommandPrefix = ~
8181
#AiPlayerbot.MeleeDistance = 1.0
8282
#AiPlayerbot.FollowDistance = 1.5
8383
#AiPlayerbot.WhisperDistance = 6000.0
84+
# If enabled, bot suggestion whispers will only target players in the same zone
85+
#AiPlayerbot.WhisperToZoneOnly = false
8486
#AiPlayerbot.ContactDistance = 0.5
8587

8688
# Bot can flee for enemy

src/modules/Bots/playerbot/strategy/actions/SuggestWhatToDoAction.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ void SuggestWhatToDoAction::spam(string msg)
278278
return;
279279
}
280280

281+
if (sPlayerbotAIConfig.whisperToZoneOnly && bot->GetZoneId() != player->GetZoneId())
282+
return;
283+
281284
if (sPlayerbotAIConfig.whisperDistance && !bot->GetGroup() && sRandomPlayerbotMgr.IsRandomBot(bot) &&
282285
player->GetSession()->GetSecurity() < SEC_GAMEMASTER &&
283286
(bot->GetMapId() != player->GetMapId() || bot->GetDistance(player) > sPlayerbotAIConfig.whisperDistance))

0 commit comments

Comments
 (0)