mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Bots] Add "silent" option to ^spawn and mute raid spawn (#4494)
When zoning or forming a raid, bots would spam their spawn message. They will now be muted. Adds an optional argument "silent" to the ^spawn command. This will bypass ^oo spawnmessage settings and not send a spawn message. Example: ^spawn Warbot silent
This commit is contained in:
parent
a17f467b98
commit
7eaee2649e
@ -857,7 +857,7 @@ void bot_command_spawn(Client *c, const Seperator *sep)
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Usage: {} [bot_name]",
|
||||
"Usage: {} [bot_name] [optional: silent]",
|
||||
sep->arg[0]
|
||||
).c_str()
|
||||
);
|
||||
@ -1045,9 +1045,17 @@ void bot_command_spawn(Client *c, const Seperator *sep)
|
||||
message_index = VALIDATECLASSID(my_bot->GetClass());
|
||||
}
|
||||
|
||||
if (c->GetBotOption(Client::booSpawnMessageSay)) {
|
||||
std::string silent_confirm = sep->arg[2];
|
||||
bool silentTell = false;
|
||||
|
||||
if (!silent_confirm.compare("silent")) {
|
||||
silentTell = true;
|
||||
}
|
||||
|
||||
if (!silentTell && c->GetBotOption(Client::booSpawnMessageSay)) {
|
||||
Bot::BotGroupSay(my_bot, bot_spawn_message[message_index].c_str());
|
||||
} else if (c->GetBotOption(Client::booSpawnMessageTell)) {
|
||||
}
|
||||
else if (!silentTell && c->GetBotOption(Client::booSpawnMessageTell)) {
|
||||
my_bot->OwnerMessage(bot_spawn_message[message_index]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -312,10 +312,12 @@ void Client::SpawnRaidBotsOnConnect(Raid* raid) {
|
||||
for (const auto& m: r_members) {
|
||||
if (strlen(m.member_name) != 0) {
|
||||
|
||||
for (const auto& b: bots_list) {
|
||||
for (const auto& b : bots_list) {
|
||||
if (strcmp(m.member_name, b.bot_name) == 0) {
|
||||
std::string buffer = "^spawn ";
|
||||
buffer.append(m.member_name);
|
||||
std::string silent = " silent";
|
||||
buffer.append(silent);
|
||||
bot_command_real_dispatch(this, buffer.c_str());
|
||||
auto bot = entity_list.GetBotByBotName(m.member_name);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user