feat. Enable bots to respond to GM messages. (#1909)

I found an existing config option that allows bots to speak without a
master, and extended its use so that protected commands (nc, co) are
taken from a bot by GM players. This is primarily a debugging tool and
shouldnt be on generally.

My testing of this is the following. 
With the option off, no error is seen, but no text output is shown. 

With the option on 
GM accounts (Whether GM is on or off) will respond to nc and co commands
by just saying the output directly. Strategies can be changed by GMs for
bots whom they are not masters for (Note, im pretty sure that a GM could
change the strategies even before this change, you just couldnt see the
output of that.)

For non GM characters you get "Invite me to your group first" with the
option on/off.
This commit is contained in:
Keleborn
2025-12-29 15:53:37 -08:00
committed by GitHub
parent 9917863ca1
commit 33f5e733dc

View File

@@ -930,7 +930,6 @@ void PlayerbotAI::HandleCommand(uint32 type, std::string const text, Player* fro
fromPlayer->SendDirectMessage(&data);
return;
}
if (!IsAllowedCommand(filtered) &&
(!GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_ALLOW_ALL, type != CHAT_MSG_WHISPER, fromPlayer)))
return;
@@ -2803,7 +2802,12 @@ bool PlayerbotAI::TellMaster(std::ostringstream& stream, PlayerbotSecurityLevel
bool PlayerbotAI::TellMaster(std::string const text, PlayerbotSecurityLevel securityLevel)
{
if (!master || !TellMasterNoFacing(text, securityLevel))
if (!master)
{
if (sPlayerbotAIConfig->randomBotSayWithoutMaster)
return TellMasterNoFacing(text, securityLevel);
}
if (!TellMasterNoFacing(text, securityLevel))
return false;
if (!bot->isMoving() && !bot->IsInCombat() && bot->GetMapId() == master->GetMapId() &&