diff --git a/common/ruletypes.h b/common/ruletypes.h index 9251a197f..8008683d9 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -878,6 +878,7 @@ RULE_INT(Bots, MaxFollowDistance, 300, "Default 300. Max distance a bot can be s RULE_INT(Bots, MaxDistanceRanged, 300, "Default 300. Max distance a bot can be set to ranged.") RULE_BOOL(Bots, AllowAIMez, true, "If enabled bots will automatically mez/AE mez eligible targets.") RULE_INT(Bots, CampTimer, 25, "Number of seconds after /camp has begun before bots camp out.") +RULE_BOOL(Bots, SendClassRaceOnHelp, true, "If enabled a reminder of how to check class/race IDs will be sent when using compatible commands.") RULE_CATEGORY_END() RULE_CATEGORY(Chat) diff --git a/zone/bot.h b/zone/bot.h index b3f2ae171..8e85448e0 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -517,8 +517,6 @@ public: void SetManaWhenToMed(uint8 value) { _ManaWhenToMed = value; } void SetHasLoS(bool hasLoS) { _hasLoS = hasLoS; } bool HasLoS() const { return _hasLoS; } - - void SendSpellTypesWindow(Client* c, std::string arg0, std::string arg1, std::string arg2, bool helpPrompt = false); std::list GetSpellTypesPrioritized(uint8 priorityType); uint16 GetSpellListSpellType(uint16 spellType); diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 81f7b21a1..15ea7eba8 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -1375,6 +1375,8 @@ int bot_command_init(void) bot_command_add("spellsettingstoggle", "Toggle a bot spell use", AccountStatus::Player, bot_command_spell_settings_toggle) || bot_command_add("spellsettingsupdate", "Update a bot spell setting entry", AccountStatus::Player, bot_command_spell_settings_update) || bot_command_add("summoncorpse", "Orders a bot to summon a corpse to its feet", AccountStatus::Player, bot_command_summon_corpse) || + bot_command_add("spelltypeids", "Lists spelltypes by ID", AccountStatus::Player, bot_command_spelltype_ids) || + bot_command_add("spelltypenames", "Lists spelltypes by shortname", AccountStatus::Player, bot_command_spelltype_names) || bot_command_add("suspend", "Suspends a bot's AI processing until released", AccountStatus::Player, bot_command_suspend) || bot_command_add("taunt", "Toggles taunt use by a bot", AccountStatus::Player, bot_command_taunt) || bot_command_add("timer", "Checks or clears timers of the chosen type.", AccountStatus::GMMgmt, bot_command_timer) || @@ -2115,43 +2117,54 @@ bool helper_spell_list_fail(Client *bot_owner, bcst_list* spell_list, BCEnum::Sp return false; } -void Bot::SendSpellTypesWindow(Client* c, std::string arg0, std::string arg1, std::string arg2, bool helpPrompt) { - if (helpPrompt) { +void SendSpellTypePrompts(Client *c, bool commandedTypes) { + c->Message( + Chat::Yellow, + fmt::format( + "You can view spell types by ID or shortname: {}, {}, {} / {}, {}, {}", + Saylink::Silent( + fmt::format("^spelltypeids 0-19"), "ID 0-19" + ), + Saylink::Silent( + fmt::format("^spelltypeids 20-39"), "20-39" + ), + Saylink::Silent( + fmt::format("^spelltypeids 40+"), "40+" + ), + Saylink::Silent( + fmt::format("^spelltypenames 0-19"), "Shortname 0-19" + ), + Saylink::Silent( + fmt::format("^spelltypenames 20-39"), "20-39" + ), + Saylink::Silent( + fmt::format("^spelltypenames 40+"), "40+" + ) + ).c_str() + ); + + if (commandedTypes) { c->Message( Chat::Yellow, fmt::format( - "Use {}, {}, {} for a list of spell types by ID", + "You can view commanded spell types by ID or shortname: {} / {}", Saylink::Silent( - fmt::format("{} listid 0-19", arg0) + fmt::format("^spelltypeids commanded"), "ID" ), Saylink::Silent( - fmt::format("{} listid 20-39", arg0) - ), - Saylink::Silent( - fmt::format("{} listid 40+", arg0) + fmt::format("^spelltypenames commanded"), "Shortname" ) ).c_str() ); - - c->Message( - Chat::Yellow, - fmt::format( - "Use {}, {}, {} for a list of spell types by short name", - Saylink::Silent( - fmt::format("{} listname 0-19", arg0) - ), - Saylink::Silent( - fmt::format("{} listname 20-39", arg0) - ), - Saylink::Silent( - fmt::format("{} listname 40+", arg0) - ) - ).c_str() - ); - - return; } + return; +} + +void SendSpellTypeWindow(Client *c, const Seperator* sep) { + std::string arg0 = sep->arg[0]; + std::string arg1 = sep->arg[1]; + uint8 minCount = 0; uint8 maxCount = 0; @@ -2159,18 +2172,22 @@ void Bot::SendSpellTypesWindow(Client* c, std::string arg0, std::string arg1, st minCount = BotSpellTypes::START; maxCount = BotSpellTypes::END; } - else if (!arg2.compare("0-19")) { + else if (!arg1.compare("0-19")) { minCount = BotSpellTypes::START; maxCount = 19; } - else if (!arg2.compare("20-39")) { + else if (!arg1.compare("20-39")) { minCount = std::min(static_cast(20), static_cast(BotSpellTypes::END)); maxCount = std::min(static_cast(39), static_cast(BotSpellTypes::END)); } - else if (!arg2.compare("40+")) { + else if (!arg1.compare("40+")) { minCount = std::min(static_cast(40), static_cast(BotSpellTypes::END)); maxCount = BotSpellTypes::END; } + else if (!arg1.compare("commanded")) { + minCount = BotSpellTypes::COMMANDED_START; + maxCount = BotSpellTypes::COMMANDED_END; + } else { c->Message(Chat::Yellow, "You must choose a valid range option"); @@ -2199,7 +2216,7 @@ void Bot::SendSpellTypesWindow(Client* c, std::string arg0, std::string arg1, st DialogueWindow::TableCell( fmt::format( "{}", - (!arg1.compare("listid") ? DialogueWindow::ColorMessage(goldenrod, idField) : DialogueWindow::ColorMessage(goldenrod, shortnameField)) + (!arg0.compare("^spelltypeids") ? DialogueWindow::ColorMessage(goldenrod, idField) : DialogueWindow::ColorMessage(goldenrod, shortnameField)) ) ) ); @@ -2231,7 +2248,7 @@ void Bot::SendSpellTypesWindow(Client* c, std::string arg0, std::string arg1, st DialogueWindow::TableCell( fmt::format( "{}", - (!arg1.compare("listid") ? DialogueWindow::ColorMessage(slate_blue, std::to_string(i)) : DialogueWindow::ColorMessage(slate_blue, c->GetSpellTypeShortNameByID(i))) + (!arg0.compare("^spelltypeids") ? DialogueWindow::ColorMessage(slate_blue, std::to_string(i)) : DialogueWindow::ColorMessage(slate_blue, c->GetSpellTypeShortNameByID(i))) ) ) ); @@ -2242,7 +2259,6 @@ void Bot::SendSpellTypesWindow(Client* c, std::string arg0, std::string arg1, st c->SendPopupToClient("Spell Types", popup_text.c_str()); } - #include "bot_commands/actionable.cpp" #include "bot_commands/aggressive.cpp" #include "bot_commands/appearance.cpp" @@ -2310,6 +2326,7 @@ void Bot::SendSpellTypesWindow(Client* c, std::string arg0, std::string arg1, st #include "bot_commands/spell_min_thresholds.cpp" #include "bot_commands/spell_pursue_priority.cpp" #include "bot_commands/spell_target_count.cpp" +#include "bot_commands/spelltypes.cpp" #include "bot_commands/summon.cpp" #include "bot_commands/summon_corpse.cpp" #include "bot_commands/suspend.cpp" diff --git a/zone/bot_command.h b/zone/bot_command.h index 373fbd1e5..8e200bd6b 100644 --- a/zone/bot_command.h +++ b/zone/bot_command.h @@ -1733,6 +1733,8 @@ void bot_command_spell_settings_delete(Client* c, const Seperator *sep); void bot_command_spell_settings_list(Client* c, const Seperator *sep); void bot_command_spell_settings_toggle(Client* c, const Seperator *sep); void bot_command_spell_settings_update(Client* c, const Seperator *sep); +void bot_command_spelltype_ids(Client* c, const Seperator* sep); +void bot_command_spelltype_names(Client* c, const Seperator* sep); void bot_spell_info_dialogue_window(Client* c, const Seperator *sep); void bot_command_enforce_spell_list(Client* c, const Seperator* sep); void bot_command_summon_corpse(Client *c, const Seperator *sep); @@ -1820,4 +1822,6 @@ void helper_send_available_subcommands(Client *bot_owner, const char* command_si void helper_send_usage_required_bots(Client *bot_owner, BCEnum::SpType spell_type, uint8 bot_class = Class::None); bool helper_spell_check_fail(STBaseEntry* local_entry); bool helper_spell_list_fail(Client *bot_owner, bcst_list* spell_list, BCEnum::SpType spell_type); +void SendSpellTypePrompts(Client *c, bool commandedTypes = false); +void SendSpellTypeWindow(Client *c, const Seperator* sep); #endif diff --git a/zone/bot_commands/behind_mob.cpp b/zone/bot_commands/behind_mob.cpp index a7710185f..3abde3c1a 100644 --- a/zone/bot_commands/behind_mob.cpp +++ b/zone/bot_commands/behind_mob.cpp @@ -64,24 +64,22 @@ void bot_command_behind_mob(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - int ab_arg = 1; bool current_check = false; uint32 typeValue = 0; diff --git a/zone/bot_commands/cast.cpp b/zone/bot_commands/cast.cpp index fd7dc5aa8..ab02eb950 100644 --- a/zone/bot_commands/cast.cpp +++ b/zone/bot_commands/cast.cpp @@ -94,7 +94,8 @@ void bot_command_cast(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); + SendSpellTypePrompts(c, true); + c->Message( Chat::Yellow, fmt::format( @@ -103,6 +104,16 @@ void bot_command_cast(Client* c, const Seperator* sep) ).c_str() ); + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } + return; } diff --git a/zone/bot_commands/copy_settings.cpp b/zone/bot_commands/copy_settings.cpp index e2745442f..8e41f971a 100644 --- a/zone/bot_commands/copy_settings.cpp +++ b/zone/bot_commands/copy_settings.cpp @@ -97,25 +97,23 @@ void bot_command_copy_settings(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - int ab_arg = 2; bool validOption = false; uint16 spellType = UINT16_MAX; diff --git a/zone/bot_commands/default_settings.cpp b/zone/bot_commands/default_settings.cpp index ddf809a75..8ed6733a6 100644 --- a/zone/bot_commands/default_settings.cpp +++ b/zone/bot_commands/default_settings.cpp @@ -91,25 +91,23 @@ void bot_command_default_settings(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - int ab_arg = 2; bool validOption = false; uint16 spellType = UINT16_MAX; diff --git a/zone/bot_commands/illusion_block.cpp b/zone/bot_commands/illusion_block.cpp index 94faafc42..47d2d6b26 100644 --- a/zone/bot_commands/illusion_block.cpp +++ b/zone/bot_commands/illusion_block.cpp @@ -63,13 +63,16 @@ void bot_command_illusion_block(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; @@ -77,11 +80,6 @@ void bot_command_illusion_block(Client* c, const Seperator* sep) std::string arg1 = sep->arg[1]; - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - int ab_arg = 1; bool current_check = false; uint32 typeValue = 0; diff --git a/zone/bot_commands/max_melee_range.cpp b/zone/bot_commands/max_melee_range.cpp index c9e32dec1..6c4460ac2 100644 --- a/zone/bot_commands/max_melee_range.cpp +++ b/zone/bot_commands/max_melee_range.cpp @@ -63,24 +63,22 @@ void bot_command_max_melee_range(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - int ab_arg = 1; bool current_check = false; uint32 typeValue = 0; diff --git a/zone/bot_commands/sit_hp_percent.cpp b/zone/bot_commands/sit_hp_percent.cpp index fa4a183bf..38b42ffd9 100644 --- a/zone/bot_commands/sit_hp_percent.cpp +++ b/zone/bot_commands/sit_hp_percent.cpp @@ -63,24 +63,22 @@ void bot_command_sit_hp_percent(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - int ab_arg = 1; bool current_check = false; uint32 typeValue = 0; diff --git a/zone/bot_commands/sit_in_combat.cpp b/zone/bot_commands/sit_in_combat.cpp index 210372f56..eaf08e0ae 100644 --- a/zone/bot_commands/sit_in_combat.cpp +++ b/zone/bot_commands/sit_in_combat.cpp @@ -63,24 +63,22 @@ void bot_command_sit_in_combat(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - int ab_arg = 1; bool current_check = false; uint32 typeValue = 0; diff --git a/zone/bot_commands/sit_mana_percent.cpp b/zone/bot_commands/sit_mana_percent.cpp index a5751f9f4..820be6a75 100644 --- a/zone/bot_commands/sit_mana_percent.cpp +++ b/zone/bot_commands/sit_mana_percent.cpp @@ -63,24 +63,22 @@ void bot_command_sit_mana_percent(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - int ab_arg = 1; bool current_check = false; uint32 typeValue = 0; diff --git a/zone/bot_commands/spell_aggro_checks.cpp b/zone/bot_commands/spell_aggro_checks.cpp index 2dfeef486..cbcc4706b 100644 --- a/zone/bot_commands/spell_aggro_checks.cpp +++ b/zone/bot_commands/spell_aggro_checks.cpp @@ -92,25 +92,22 @@ void bot_command_spell_aggro_checks(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spell_delays.cpp b/zone/bot_commands/spell_delays.cpp index 2a5de1017..9fd37b70a 100644 --- a/zone/bot_commands/spell_delays.cpp +++ b/zone/bot_commands/spell_delays.cpp @@ -98,25 +98,22 @@ void bot_command_spell_delays(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spell_engaged_priority.cpp b/zone/bot_commands/spell_engaged_priority.cpp index 70425ee11..f27387b59 100644 --- a/zone/bot_commands/spell_engaged_priority.cpp +++ b/zone/bot_commands/spell_engaged_priority.cpp @@ -96,25 +96,22 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spell_holds.cpp b/zone/bot_commands/spell_holds.cpp index fd17749d1..e30911bd4 100644 --- a/zone/bot_commands/spell_holds.cpp +++ b/zone/bot_commands/spell_holds.cpp @@ -82,25 +82,22 @@ void bot_command_spell_holds(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spell_idle_priority.cpp b/zone/bot_commands/spell_idle_priority.cpp index d6f0a0c35..cdb741d44 100644 --- a/zone/bot_commands/spell_idle_priority.cpp +++ b/zone/bot_commands/spell_idle_priority.cpp @@ -96,25 +96,22 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spell_max_hp_pct.cpp b/zone/bot_commands/spell_max_hp_pct.cpp index 7f8cd150b..bcd3614a5 100644 --- a/zone/bot_commands/spell_max_hp_pct.cpp +++ b/zone/bot_commands/spell_max_hp_pct.cpp @@ -92,25 +92,22 @@ void bot_command_spell_max_hp_pct(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spell_max_mana_pct.cpp b/zone/bot_commands/spell_max_mana_pct.cpp index 44cc7e8d5..84cb9abd9 100644 --- a/zone/bot_commands/spell_max_mana_pct.cpp +++ b/zone/bot_commands/spell_max_mana_pct.cpp @@ -92,25 +92,22 @@ void bot_command_spell_max_mana_pct(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spell_max_thresholds.cpp b/zone/bot_commands/spell_max_thresholds.cpp index 7ff651514..385258ddd 100644 --- a/zone/bot_commands/spell_max_thresholds.cpp +++ b/zone/bot_commands/spell_max_thresholds.cpp @@ -98,25 +98,22 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spell_min_hp_pct.cpp b/zone/bot_commands/spell_min_hp_pct.cpp index 371b44820..be6fe1b9e 100644 --- a/zone/bot_commands/spell_min_hp_pct.cpp +++ b/zone/bot_commands/spell_min_hp_pct.cpp @@ -92,25 +92,22 @@ void bot_command_spell_min_hp_pct(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spell_min_mana_pct.cpp b/zone/bot_commands/spell_min_mana_pct.cpp index b053c462c..f4ffe1bad 100644 --- a/zone/bot_commands/spell_min_mana_pct.cpp +++ b/zone/bot_commands/spell_min_mana_pct.cpp @@ -92,25 +92,22 @@ void bot_command_spell_min_mana_pct(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spell_min_thresholds.cpp b/zone/bot_commands/spell_min_thresholds.cpp index d690dede2..ffcecf8b7 100644 --- a/zone/bot_commands/spell_min_thresholds.cpp +++ b/zone/bot_commands/spell_min_thresholds.cpp @@ -100,25 +100,22 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spell_pursue_priority.cpp b/zone/bot_commands/spell_pursue_priority.cpp index 872444f32..272135422 100644 --- a/zone/bot_commands/spell_pursue_priority.cpp +++ b/zone/bot_commands/spell_pursue_priority.cpp @@ -96,25 +96,22 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spell_target_count.cpp b/zone/bot_commands/spell_target_count.cpp index 2f78a7468..ad1b897b8 100644 --- a/zone/bot_commands/spell_target_count.cpp +++ b/zone/bot_commands/spell_target_count.cpp @@ -92,25 +92,22 @@ void bot_command_spell_target_count(Client* c, const Seperator* sep) popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], "", "", true); - c->Message( - Chat::Yellow, - fmt::format( - "Use {} for information about race/class IDs.", - Saylink::Silent("^classracelist") - ).c_str() - ); + SendSpellTypePrompts(c); + + if (RuleB(Bots, SendClassRaceOnHelp)) { + c->Message( + Chat::Yellow, + fmt::format( + "Use {} for information about race/class IDs.", + Saylink::Silent("^classracelist") + ).c_str() + ); + } return; } std::string arg1 = sep->arg[1]; - - if (!arg1.compare("listid") || !arg1.compare("listname")) { - c->CastToBot()->SendSpellTypesWindow(c, sep->arg[0], sep->arg[1], sep->arg[2]); - return; - } - std::string arg2 = sep->arg[2]; int ab_arg = 2; bool current_check = false; diff --git a/zone/bot_commands/spelltypes.cpp b/zone/bot_commands/spelltypes.cpp new file mode 100644 index 000000000..f91b3ed7e --- /dev/null +++ b/zone/bot_commands/spelltypes.cpp @@ -0,0 +1,9 @@ +void bot_command_spelltype_ids(Client* c, const Seperator* sep) +{ + SendSpellTypeWindow(c, sep); +} + +void bot_command_spelltype_names(Client* c, const Seperator* sep) +{ + SendSpellTypeWindow(c, sep); +}