#include "../bot_command.h" void bot_command_owner_option(Client *c, const Seperator *sep) { if (helper_is_help_or_usage(sep->arg[1])) { c->Message(Chat::White, "usage: %s [option] [argument]", sep->arg[0]); std::string window_title = "Bot Owner Options"; std::string window_text = "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "
Option
------
Argument
-------
Notes
-----
deathmarqueeenable | disablemarquee message on death
null(toggles)
statsupdateenable | disablereport stats on update
null(toggles)
spawnmessagesay | tell | silentspawn message into channel
class | defaultspawn with class-based message
null(toggles)
autodefendenable | disablebots defend owner when aggroed
null(toggles)
buffcounterenable | disablemarquee message on buff counter change
null(toggles)
monkwumessageenable | disabledisplays monk wu trigger messages
null(toggles)
currentshow current settings
"; c->SendPopupToClient(window_title.c_str(), window_text.c_str()); return; } std::string owner_option(sep->arg[1]); std::string argument(sep->arg[2]); if (!owner_option.compare("deathmarquee")) { if (!argument.compare("enable")) { c->SetBotOption(Client::booDeathMarquee, true); } else if (!argument.compare("disable")) { c->SetBotOption(Client::booDeathMarquee, false); } else { c->SetBotOption(Client::booDeathMarquee, !c->GetBotOption(Client::booDeathMarquee)); } database.botdb.SaveOwnerOption(c->CharacterID(), Client::booDeathMarquee, c->GetBotOption(Client::booDeathMarquee)); c->Message(Chat::White, "Bot 'death marquee' is now %s.", (c->GetBotOption(Client::booDeathMarquee) ? "enabled" : "disabled")); } else if (!owner_option.compare("statsupdate")) { if (!argument.compare("enable")) { c->SetBotOption(Client::booStatsUpdate, true); } else if (!argument.compare("disable")) { c->SetBotOption(Client::booStatsUpdate, false); } else { c->SetBotOption(Client::booStatsUpdate, !c->GetBotOption(Client::booStatsUpdate)); } database.botdb.SaveOwnerOption(c->CharacterID(), Client::booStatsUpdate, c->GetBotOption(Client::booStatsUpdate)); c->Message(Chat::White, "Bot 'stats update' is now %s.", (c->GetBotOption(Client::booStatsUpdate) ? "enabled" : "disabled")); } else if (!owner_option.compare("spawnmessage")) { Client::BotOwnerOption boo = Client::_booCount; if (!argument.compare("say")) { boo = Client::booSpawnMessageSay; c->SetBotOption(Client::booSpawnMessageSay, true); c->SetBotOption(Client::booSpawnMessageTell, false); } else if (!argument.compare("tell")) { boo = Client::booSpawnMessageSay; c->SetBotOption(Client::booSpawnMessageSay, false); c->SetBotOption(Client::booSpawnMessageTell, true); } else if (!argument.compare("silent")) { boo = Client::booSpawnMessageSay; c->SetBotOption(Client::booSpawnMessageSay, false); c->SetBotOption(Client::booSpawnMessageTell, false); } else if (!argument.compare("class")) { boo = Client::booSpawnMessageClassSpecific; c->SetBotOption(Client::booSpawnMessageClassSpecific, true); } else if (!argument.compare("default")) { boo = Client::booSpawnMessageClassSpecific; c->SetBotOption(Client::booSpawnMessageClassSpecific, false); } else { c->Message(Chat::White, "Owner option '%s' argument '%s' is not recognized.", owner_option.c_str(), argument.c_str()); return; } if (boo == Client::booSpawnMessageSay) { database.botdb.SaveOwnerOption( c->CharacterID(), std::pair( Client::booSpawnMessageSay, Client::booSpawnMessageTell ), std::pair( c->GetBotOption(Client::booSpawnMessageSay), c->GetBotOption(Client::booSpawnMessageTell) ) ); } else if (boo == Client::booSpawnMessageClassSpecific) { database.botdb.SaveOwnerOption( c->CharacterID(), Client::booSpawnMessageClassSpecific, c->GetBotOption(Client::booSpawnMessageClassSpecific) ); } else { c->Message(Chat::White, "Bot 'spawn message' is now ERROR."); return; } c->Message(Chat::White, "Bot 'spawn message' is now %s.", argument.c_str()); } else if (!owner_option.compare("autodefend")) { if (RuleB(Bots, AllowOwnerOptionAutoDefend)) { if (!argument.compare("enable")) { c->SetBotOption(Client::booAutoDefend, true); } else if (!argument.compare("disable")) { c->SetBotOption(Client::booAutoDefend, false); } else { c->SetBotOption(Client::booAutoDefend, !c->GetBotOption(Client::booAutoDefend)); } database.botdb.SaveOwnerOption(c->CharacterID(), Client::booAutoDefend, c->GetBotOption(Client::booAutoDefend)); c->Message(Chat::White, "Bot 'auto defend' is now %s.", (c->GetBotOption(Client::booAutoDefend) ? "enabled" : "disabled")); } else { c->Message(Chat::White, "Bot owner option 'autodefend' is not allowed on this server."); } } else if (!owner_option.compare("buffcounter")) { if (!argument.compare("enable")) { c->SetBotOption(Client::booBuffCounter, true); } else if (!argument.compare("disable")) { c->SetBotOption(Client::booBuffCounter, false); } else { c->SetBotOption(Client::booBuffCounter, !c->GetBotOption(Client::booBuffCounter)); } database.botdb.SaveOwnerOption(c->CharacterID(), Client::booBuffCounter, c->GetBotOption(Client::booBuffCounter)); c->Message(Chat::White, "Bot 'buff counter' is now %s.", (c->GetBotOption(Client::booBuffCounter) ? "enabled" : "disabled")); } else if (!owner_option.compare("monkwumessage")) { if (!argument.compare("enable")) { c->SetBotOption(Client::booMonkWuMessage, true); } else if (!argument.compare("disable")) { c->SetBotOption(Client::booMonkWuMessage, false); } else { c->SetBotOption(Client::booMonkWuMessage, !c->GetBotOption(Client::booMonkWuMessage)); } database.botdb.SaveOwnerOption(c->CharacterID(), Client::booMonkWuMessage, c->GetBotOption(Client::booMonkWuMessage)); c->Message( Chat::White, "Bot 'monk wu message' is now %s.", (c->GetBotOption(Client::booMonkWuMessage) ? "enabled" : "disabled") ); } else if (!owner_option.compare("current")) { std::string window_title = "Current Bot Owner Options Settings"; std::string window_text = fmt::format( "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "
Option
------
Argument
-------
deathmarquee{}
statsupdate{}
spawnmessage{}
spawnmessage{}
autodefend{}
buffcounter{}
monkwumessage{}
", (c->GetBotOption(Client::booDeathMarquee) ? "enabled" : "disabled"), (c->GetBotOption(Client::booStatsUpdate) ? "enabled" : "disabled"), (c->GetBotOption(Client::booSpawnMessageSay) ? "say" : (c->GetBotOption(Client::booSpawnMessageTell) ? "tell" : "silent")), (c->GetBotOption(Client::booSpawnMessageClassSpecific) ? "class" : "default"), (RuleB(Bots, AllowOwnerOptionAutoDefend) ? (c->GetBotOption(Client::booAutoDefend) ? "enabled" : "disabled") : "restricted"), (c->GetBotOption(Client::booBuffCounter) ? "enabled" : "disabled"), (c->GetBotOption(Client::booMonkWuMessage) ? "enabled" : "disabled") ); c->SendPopupToClient(window_title.c_str(), window_text.c_str()); } else { c->Message(Chat::White, "Owner option '%s' is not recognized.", owner_option.c_str()); } }