diff --git a/zone/bot_commands/actionable.cpp b/zone/bot_commands/actionable.cpp index f66a5b60a..94ed0b0c3 100644 --- a/zone/bot_commands/actionable.cpp +++ b/zone/bot_commands/actionable.cpp @@ -4,16 +4,14 @@ void bot_command_actionable(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_actionable", sep->arg[0], "actionable")) { c->Message(Chat::White, "note: Lists actionable command arguments and use descriptions"); + return; } - std::vector description = - { - "Lists actionable command arguments and use descriptions." - }; + BotCommandHelpParams p; - std::vector notes = - { + p.description = { "Lists actionable command arguments and use descriptions." }; + p.notes = { "[target] - uses the command on the target. Some commands will default to target if no actionable is selected.", "[byname] [name] - selects a bot by name their name.", "[ownergroup] - selects all bots in the owner's group.", @@ -32,29 +30,7 @@ void bot_command_actionable(Client* c, const Seperator* sep) "You may only select your own bots." }; - std::vector example_format = { }; - std::vector examples_one = { }; - std::vector examples_two = { }; - std::vector examples_three = { }; - - std::vector actionables = { }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/behind_mob.cpp b/zone/bot_commands/behind_mob.cpp index 6bbfdd168..5de7571f1 100644 --- a/zone/bot_commands/behind_mob.cpp +++ b/zone/bot_commands/behind_mob.cpp @@ -3,67 +3,36 @@ void bot_command_behind_mob(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_behind_mob", sep->arg[0], "behindmob")) { + c->Message(Chat::White, "note: Toggles whether or not bots will stay behind the mob during combat."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "-Toggles whether or not bots will stay behind the mob during combat." + BotCommandHelpParams p; + + p.description = { "Toggles whether or not bots will stay behind the mob during combat." }; + p.example_format = { + fmt::format("{} [value] [actionable]", sep->arg[0]) }; - - std::vector notes = { }; - - std::vector example_format = - { - fmt::format( - "{} [value] [actionable]" - , sep->arg[0] - ) + p.examples_one = { + "To set Monks to stay behind the mob:", + fmt::format("{} 1 byclass 7", sep->arg[0]) }; - - std::vector examples_one = - { - "To set Monks to stay behind the mob:", - fmt::format( - "{} 1 byclass 7", - sep->arg[0] - ) + p.examples_two = { + "To force all bots to stay behind mobs:", + fmt::format("{} 1 spawned", sep->arg[0]) }; - std::vector examples_two = { }; - std::vector examples_three = - { - "To check the behind mob status for all bots:", - fmt::format( - "{} current spawned", - sep->arg[0] - ) + p.examples_three = { + "To check the behind mob status of all bots:", + fmt::format("{} current spawned", sep->arg[0]) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); - c->SendPopupToClient(sep->arg[0], popup_text.c_str()); + c->SendPopupToClient(sep->arg[0], popup_text.c_str()); if (RuleB(Bots, SendClassRaceOnHelp)) { c->Message( diff --git a/zone/bot_commands/blocked_buffs.cpp b/zone/bot_commands/blocked_buffs.cpp index ebe50f5ac..8cb539604 100644 --- a/zone/bot_commands/blocked_buffs.cpp +++ b/zone/bot_commands/blocked_buffs.cpp @@ -8,72 +8,35 @@ void bot_command_blocked_buffs(Client* c, const Seperator* sep) return; } + if (helper_command_alias_fail(c, "bot_command_blocked_buffs", sep->arg[0], "blockedbuffs")) { + c->Message(Chat::White, "note: Allows you to set, view and wipe blocked buffs for the selected bots."); + + return; + } + if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Allows you to set, view and wipe blocked buffs for the selected bots" - }; + BotCommandHelpParams p; - std::vector notes = - { - "- You can 'set' spells to be blocked, 'remove' spells from the blocked list, 'list' the current blocked spells or 'wipe' the entire list." + p.description = { "Allows you to set, view and wipe blocked buffs for the selected bots." }; + p.notes = { "- You can 'set' spells to be blocked, 'remove' spells from the blocked list, 'list' the current blocked spells or 'wipe' the entire list." }; + p.example_format = { + fmt::format("{} [add [ID] | remove [ID] | list | wipe] [actionable, default: target]", sep->arg[0]) }; + p.examples_one = { + "To add Courage(Spell ID #202) to the targeted bot's blocked list:", + fmt::format("{} add 202", sep->arg[0]) + }; + p.examples_two = { + "To view the targeted bot's blocked buff list:", + fmt::format("{} list", sep->arg[0]) + }; + p.examples_three = { + "To wipe all Warriors bots' blocked buff list:", + fmt::format( "{} wipe byclass {}", sep->arg[0], Class::Warrior) + }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector example_format = - { - fmt::format( - "{} [add [ID] | remove [ID] | list | wipe] [actionable, default: target]" - , sep->arg[0] - ) - }; - std::vector examples_one = - { - "To add Courage (Spell ID #202) to the targeted bot's blocked list:", - fmt::format( - "{} add 202", - sep->arg[0], - c->GetSpellTypeShortNameByID(BotSpellTypes::Nuke) - ) - }; - std::vector examples_two = - { - "To view the targeted bot's blocked buff list:", - fmt::format( - "{} list", - sep->arg[0] - ) - }; - std::vector examples_three = - { - "To wipe all Warriors bots' blocked buff list:", - fmt::format( - "{} wipe byclass {}", - sep->arg[0], - Class::Warrior - ) - }; - - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); @@ -265,26 +228,29 @@ void bot_command_blocked_pet_buffs(Client* c, const Seperator* sep) return; } - if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Allows you to set, view and wipe blocked pet buffs for the selected bots" - }; + if (helper_command_alias_fail(c, "bot_command_blocked_pet_buffs", sep->arg[0], "blockedpetbuffs")) { + c->Message(Chat::White, "note: Allows you to set, view and wipe blocked pet buffs for the selected bots."); - std::vector notes = + return; + } + + if (helper_is_help_or_usage(sep->arg[1])) { + BotCommandHelpParams p; + + p.description = { "Allows you to set, view and wipe blocked pet buffs for the selected bots." }; + p.notes = { "- You can 'set' spells to be blocked, 'remove' spells from the blocked list, 'list' the current blocked spells or 'wipe' the entire list.", - "- This controls whether or not any pet the selected bot(s) own will prevent certain buffs from being cast." + "- This controls whether or not any pet the selected bot(s) own will prevent certain beneficial buffs from landing on them." }; - - std::vector example_format = + p.example_format = { fmt::format( "{} [add [ID] | remove [ID] | list | wipe] [actionable, default: target]" , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To add Courage (Spell ID #202) to the targeted bot's blocked list:", fmt::format( @@ -293,7 +259,7 @@ void bot_command_blocked_pet_buffs(Client* c, const Seperator* sep) c->GetSpellTypeShortNameByID(BotSpellTypes::Nuke) ) }; - std::vector examples_two = + p.examples_two = { "To view the targeted bot's blocked buff list:", fmt::format( @@ -301,7 +267,7 @@ void bot_command_blocked_pet_buffs(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_three = + p.examples_three = { "To wipe all Warriors bots' blocked buff list:", fmt::format( @@ -310,28 +276,9 @@ void bot_command_blocked_pet_buffs(Client* c, const Seperator* sep) Class::Warrior ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/bot.cpp b/zone/bot_commands/bot.cpp index ab5e036d3..e91c5eb32 100644 --- a/zone/bot_commands/bot.cpp +++ b/zone/bot_commands/bot.cpp @@ -472,82 +472,43 @@ void bot_command_delete(Client *c, const Seperator *sep) void bot_command_follow_distance(Client *c, const Seperator *sep) { if (helper_command_alias_fail(c, "bot_command_follow_distance", sep->arg[0], "botfollowdistance")) { + c->Message(Chat::White, "note: Sets or resets the follow distance of the selected bots."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Sets or resets the follow distance of the selected bots." - }; + BotCommandHelpParams p; - std::vector notes = + p.description = { "Sets or resets the follow distance of the selected bots." }; + p.notes = { - fmt::format( - "[Default]: {}", - RuleI(Bots, MaxFollowDistance) - ), - - fmt::format( - "- You must use a value between 1 and {}.", - RuleI(Bots, MaxFollowDistance) - ) + fmt::format("[Default]: {}", RuleI(Bots, MaxFollowDistance)), + fmt::format("- You must use a value between 1 and {}.", RuleI(Bots, MaxFollowDistance)) }; - - std::vector example_format = - { - fmt::format( - "{} [reset]/[set [value]] [actionable]" - , sep->arg[0] - ) + p.example_format = { + fmt::format("{} [reset]/[set [value]] [actionable]", sep->arg[0]) }; - std::vector examples_one = - { - "To set all bots to follow at a distance of 25:", - fmt::format( - "{} set 25 spawned", - sep->arg[0] - ) + p.examples_one = { + "To set all bots to follow at a distance of 25:", + fmt::format("{} set 25 spawned", sep->arg[0]) }; - std::vector examples_two = - { - "To check the curret following distance of all bots:", - fmt::format( - "{} current spawned", - sep->arg[0] - ) + p.examples_two = { + "To check the curret following distance of all bots:", + fmt::format("{} current spawned", sep->arg[0]) }; - std::vector examples_three = + p.examples_three = { "To reset the following distance of all Wizards:", fmt::format( "{} reset byclass {}", sep->arg[0], Class::Wizard - ) + ) }; - - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; + + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); @@ -1187,17 +1148,16 @@ void bot_command_spawn(Client *c, const Seperator *sep) void bot_command_stance(Client *c, const Seperator *sep) { if (helper_command_alias_fail(c, "bot_command_stance", sep->arg[0], "botstance")) { + c->Message(Chat::White, "note: Change a bot's stance to control the way it behaves."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Change a bot's stance to control the way it behaves." - }; + BotCommandHelpParams p; - std::vector notes = - { + p.description = { "Change a bot's stance to control the way it behaves." }; + p.notes = { "- Changing a stance will reset all settings to match that stance type.", "- Any changes made will only save to that stance for future use.", fmt::format( @@ -1225,102 +1185,74 @@ void bot_command_stance(Client *c, const Seperator *sep) Stance::AEBurn ), "
", - fmt::format( - "- {} (#{}) [Default] - Overall balance and casts most spell types by default.", - Stance::GetName(Stance::Balanced), - Stance::Balanced - ), - fmt::format( - "- {} (#{}) - Idle. Does not cast or engage in combat.", - Stance::GetName(Stance::Passive), - Stance::Passive - ), - fmt::format( - "- {} (#{}) - More mana and aggro efficient (SKs will still cast hate line). Longer delays between detrimental spells, thresholds adjusted to cast less often.", - Stance::GetName(Stance::Efficient), - Stance::Efficient - ), - fmt::format( - "- {} (#{}) - Much more aggressive in their cast times and thresholds. More DPS, debuffs and slow but a higher risk of snagging aggro.", - Stance::GetName(Stance::Aggressive), - Stance::Aggressive + fmt::format( + "- {} (#{}) [Default] - Overall balance and casts most spell types by default.", + Stance::GetName(Stance::Balanced), + Stance::Balanced ), fmt::format( - "- {} (#{}) - Support role. Most offensive spell types are disabled. Focused on heals, cures, CC, debuffs and slows.", - Stance::GetName(Stance::Assist), - Stance::Assist + "- {} (#{}) - Idle. Does not cast or engage in combat.", + Stance::GetName(Stance::Passive), + Stance::Passive ), fmt::format( - "- {} (#{}) - Murder. Doesn't care about aggro, just wants to kill. DPS Machine.", - Stance::GetName(Stance::Burn), - Stance::Burn + "- {} (#{}) - More mana and aggro efficient (SKs will still cast hate line). Longer delays between detrimental spells, thresholds adjusted to cast less often.", + Stance::GetName(Stance::Efficient), + Stance::Efficient ), fmt::format( - "- {} (#{}) - Murder EVERYTHING. Doesn't care about aggro, casts AEs. Everything must die ASAP.", - Stance::GetName(Stance::AEBurn), - Stance::AEBurn + "- {} (#{}) - Much more aggressive in their cast times and thresholds. More DPS, debuffs and slow but a higher risk of snagging aggro.", + Stance::GetName(Stance::Aggressive), + Stance::Aggressive + ), + fmt::format( + "- {} (#{}) - Support role. Most offensive spell types are disabled. Focused on heals, cures, CC, debuffs and slows.", + Stance::GetName(Stance::Assist), + Stance::Assist + ), + fmt::format( + "- {} (#{}) - Murder. Doesn't care about aggro, just wants to kill. DPS Machine.", + Stance::GetName(Stance::Burn), + Stance::Burn + ), + fmt::format( + "- {} (#{}) - Murder EVERYTHING. Doesn't care about aggro, casts AEs. Everything must die ASAP.", + Stance::GetName(Stance::AEBurn), + Stance::AEBurn ) }; - std::vector example_format = - { - fmt::format( - "{} [current | value: {}-{}]", + p.example_format = { + fmt::format( "{} [current | value: {}-{}]", sep->arg[0], Stance::Passive, Stance::AEBurn ) }; - std::vector examples_one = - { - "To set all bots to BurnAE:", - fmt::format( - "{} {} spawned {}", + p.examples_one = { + "To set all bots to BurnAE:", + fmt::format("{} {} spawned {}", sep->arg[0], Stance::Aggressive, Class::ShadowKnight ) }; - std::vector examples_two = - { - "To set all Shadowknights to Aggressive:", - fmt::format( - "{} {} byclass {}", + p.examples_two = { + "To set all Shadowknights to Aggressive:", + fmt::format("{} {} byclass {}", sep->arg[0], Stance::Aggressive, Class::ShadowKnight ) }; - std::vector examples_three = - { - "To check the current stances of all bots:", - fmt::format( - "{} current spawned", - sep->arg[0] - ) + p.examples_three = { + "To check the current stances of all bots:", + fmt::format("{} current spawned", sep->arg[0]) }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/bot_settings.cpp b/zone/bot_commands/bot_settings.cpp index 758916ca0..8552afc36 100644 --- a/zone/bot_commands/bot_settings.cpp +++ b/zone/bot_commands/bot_settings.cpp @@ -19,7 +19,6 @@ void bot_command_bot_settings(Client* c, const Seperator* sep) "sithppercent", "sitincombat", "sitmanapercent", - "sithppercent", "spellaggrocheck", "spelldelays", "spellengagedpriority", diff --git a/zone/bot_commands/cast.cpp b/zone/bot_commands/cast.cpp index f6fd0f0eb..74176788a 100644 --- a/zone/bot_commands/cast.cpp +++ b/zone/bot_commands/cast.cpp @@ -2,13 +2,17 @@ void bot_command_cast(Client* c, const Seperator* sep) { - if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Commands bots to force cast a specific spell type, ignoring all settings (holds, delays, thresholds, etc)" - }; + if (helper_command_alias_fail(c, "bot_command_cast", sep->arg[0], "cast")) { + c->Message(Chat::White, "note: Commands bots to force cast a specific spell type, ignoring all settings (holds, delays, thresholds, etc)."); - std::vector notes = + return; + } + + if (helper_is_help_or_usage(sep->arg[1])) { + BotCommandHelpParams p; + + p.description = { "Commands bots to force cast a specific spell type, ignoring all settings (holds, delays, thresholds, etc)." }; + p.notes = { "- This will interrupt any spell currently being cast by bots told to use the command", "- Bots will still check to see if they have the spell in their spell list, whether the target is immune, spell is allowed and all other sanity checks for spells", @@ -19,19 +23,12 @@ void bot_command_cast(Client* c, const Seperator* sep) , sep->arg[0] ) }; - - std::vector example_format = + p.example_format = { - fmt::format( - "{} [Type Shortname] [actionable, default: spawned]" - , sep->arg[0] - ), - fmt::format( - "{} [Type ID] [actionable, default: spawned]" - , sep->arg[0] - ) + fmt::format("{} [Type Shortname] [actionable, default: spawned]", sep->arg[0]), + fmt::format("{} [Type ID] [actionable, default: spawned]", sep->arg[0]) }; - std::vector examples_one = + p.examples_one = { "To tell everyone to Nuke the target:", fmt::format( @@ -45,7 +42,7 @@ void bot_command_cast(Client* c, const Seperator* sep) BotSpellTypes::Nuke ) }; - std::vector examples_two = + p.examples_two = { "To tell Skbot to Harm Touch the target:", fmt::format( @@ -57,7 +54,7 @@ void bot_command_cast(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_three = + p.examples_three = { "To tell all bots to try to cast spell #93 (Burst of Flame)", fmt::format( @@ -65,28 +62,10 @@ void bot_command_cast(Client* c, const Seperator* sep) sep->arg[0] ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); @@ -609,7 +588,12 @@ void bot_command_cast(Client* c, const Seperator* sep) type = "Forced"; } else { - type = c->GetSpellTypeNameByID(spell_type); + if (sub_type == UINT16_MAX) { + type = c->GetSpellTypeNameByID(spell_type); + } + else { + type = c->GetSubTypeNameByID(sub_type); + } } if (!is_success) { diff --git a/zone/bot_commands/copy_settings.cpp b/zone/bot_commands/copy_settings.cpp index 1b250b80b..058385c3b 100644 --- a/zone/bot_commands/copy_settings.cpp +++ b/zone/bot_commands/copy_settings.cpp @@ -3,28 +3,30 @@ void bot_command_copy_settings(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_copy_settings", sep->arg[0], "copysettings")) { + c->Message(Chat::White, "note: Copies settings from one bot to another."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Copies settings from one bot to another bot" - }; + BotCommandHelpParams p; - std::vector notes = + p.description = + { + "Copies settings from one bot to another." + }; + p.notes = { "- You can put a spell type ID or shortname after any option except [all], [misc] and [spellsettings] to restore that specifc spell type only" }; - - std::vector example_format = + p.example_format = { fmt::format( "{} [from] [to] [option]" , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To copy all settings from BotA to BotB:", fmt::format( @@ -32,7 +34,7 @@ void bot_command_copy_settings(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_two = + p.examples_two = { "To copy only Nuke spelltypesettings from BotA to BotB:", fmt::format( @@ -46,45 +48,22 @@ void bot_command_copy_settings(Client* c, const Seperator* sep) c->GetSpellTypeShortNameByID(BotSpellTypes::Nuke) ), }; - std::vector examples_three = { }; - - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = - { - "[all], [misc], [spellsettings], [spelltypesettings], [spellholds], [spelldelays], [spellminthresholds], [spellmaxthresholds], [spellminmanapct], [spellmaxmanapct], [spellminhppct], [spellmaxhppct], [spellidlepriority], [spellengagedpriority], [spellpursuepriority], [spellaggrochecks], [spelltargetcounts], [sithppercent], [sitmanapercent], [blockedbuffs], [blockedpetbuffs]" - }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; + p.options = { "[all], [misc], [spellsettings], [spelltypesettings], [spellholds], [spelldelays], [spellminthresholds], [spellmaxthresholds], [spellminmanapct], [spellmaxmanapct], [spellminhppct], [spellmaxhppct], [spellidlepriority], [spellengagedpriority], [spellpursuepriority], [spellaggrochecks], [spelltargetcounts], [sithppercent], [sitmanapercent], [blockedbuffs], [blockedpetbuffs]" }; std::vector options_one = { "[spellsettings] will copy ^spellsettings options", "[spelltypesettings] copies all spell type settings", - "[all] copies all settings" + "[all] copies all settings" }; std::vector options_two = { "[misc] copies all miscellaneous options such as:", - "- ^showhelm, ^followd, ^stopmeleelevel, ^enforcespellsettings, ^bottoggleranged, ^petsettype, ^behindmob, ^distanceranged, ^illusionblock, ^sitincombat, ^sithppercent, ^sitmanapercent, ^blockedbuffs, ^blockedpetbuffs", - - }; - std::vector options_three = - { - "The remaining options copy that specific type" + "- ^showhelm, ^followd, ^stopmeleelevel, ^enforcespellsettings, ^bottoggleranged, ^petsettype, ^behindmob, ^distanceranged, ^illusionblock, ^sitincombat, ^sithppercent, ^sitmanapercent, ^blockedbuffs, ^blockedpetbuffs" }; + std::vector options_three = { "The remaining options copy that specific type" }; - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/default_settings.cpp b/zone/bot_commands/default_settings.cpp index e5cd77b00..de09a2ee2 100644 --- a/zone/bot_commands/default_settings.cpp +++ b/zone/bot_commands/default_settings.cpp @@ -3,28 +3,21 @@ void bot_command_default_settings(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_default_settings", sep->arg[0], "defaultsettings")) { + c->Message(Chat::White, "note: Restores a bot's setting(s) to defaults."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Restores a bot's setting(s) to defaults" - }; + BotCommandHelpParams p; - std::vector notes = - { - "- You can put a spell type ID or shortname after any option except [all], [misc] and [spellsettings] to restore that specifc spell type only" - }; - - std::vector example_format = + p.description = { "Restores a bot's setting(s) to defaults" }; + p.notes = { "- You can put a spell type ID or shortname after any option except [all], [misc] and [spellsettings] to restore that specifc spell type only"}; + p.example_format = { - fmt::format( - "{} [option] [actionable]" - , sep->arg[0] - ) + fmt::format("{} [option] [actionable]", sep->arg[0]) }; - std::vector examples_one = + p.examples_one = { "To restore delays for Clerics:", fmt::format( @@ -32,7 +25,7 @@ void bot_command_default_settings(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_two = + p.examples_two = { "To restore only Snare delays for BotA:", fmt::format( @@ -46,48 +39,25 @@ void bot_command_default_settings(Client* c, const Seperator* sep) BotSpellTypes::Snare ) }; - std::vector examples_three = { }; - - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = - { - "all, misc, spellsettings, spelltypesettings, holds, delays, minthresholds, maxthresholds minmanapct, maxmanapct, minhppct, maxhppct, idlepriority, engagedpriority, pursuepriority, aggrocheck, targetcounts" - }; - std::vector options_one = + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; + p.options = { "all, misc, spellsettings, spelltypesettings, holds, delays, minthresholds, maxthresholds minmanapct, maxmanapct, minhppct, maxhppct, idlepriority, engagedpriority, pursuepriority, aggrocheck, targetcounts" }; + p.options_one = { "[spellsettings] will restore ^spellsettings options", "[spelltypesettings] restores all spell type settings", "[all] restores all settings" }; - std::vector options_two = + p.options_two = { "[misc] restores all miscellaneous options such as:", "- ^showhelm, ^followd, ^stopmeleelevel", "- ^enforcespellsettings, ^bottoggleranged, ^petsettype", "- ^behindmob, ^distanceranged, ^illusionblock", "- ^sitincombat, ^sithppercent and ^sitmanapercent", - - }; - std::vector options_three = - { - "The remaining options restore that specific type" }; + p.options_three = { "The remaining options restore that specific type" }; - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/depart.cpp b/zone/bot_commands/depart.cpp index 06dc59894..39cb1bffd 100644 --- a/zone/bot_commands/depart.cpp +++ b/zone/bot_commands/depart.cpp @@ -2,26 +2,23 @@ void bot_command_depart(Client* c, const Seperator* sep) { - if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Tells bots to list their port locations or port to a specific location" - }; + if (helper_command_alias_fail(c, "bot_command_depart", sep->arg[0], "depart")) { + c->Message(Chat::White, "note: Tells bots to list their port locations or port to a specific location."); - std::vector notes = + return; + } + + if (helper_is_help_or_usage(sep->arg[1])) { + BotCommandHelpParams p; + + p.description = { "Tells bots to list their port locations or port to a specific location." }; + p.notes = { "- This will interrupt any spell currently being cast by bots told to use the command.", "- Bots will still check to see if they have the spell in their spell list, whether the target is immune, spell is allowed and all other sanity checks for spells" }; - - std::vector example_format = - { - fmt::format( - "{} [list | zone shortname] [optional: single | group | ae] [actionable, default: spawned]" - , sep->arg[0] - ) - }; - std::vector examples_one = + p.example_format = { fmt::format("{} [list | zone shortname] [optional: single | group | ae] [actionable, default: spawned]", sep->arg[0]) }; + p.examples_one = { "To tell everyone to list their portable locations:", fmt::format( @@ -29,7 +26,7 @@ void bot_command_depart(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_two = + p.examples_two = { "To tell all bots to port to Nexus:", fmt::format( @@ -37,7 +34,7 @@ void bot_command_depart(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_three = + p.examples_three = { "To tell Druidbot to single target port to Butcher:", fmt::format( @@ -45,28 +42,9 @@ void bot_command_depart(Client* c, const Seperator* sep) sep->arg[0] ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/discipline.cpp b/zone/bot_commands/discipline.cpp index 0a7f8ad49..0d372bf06 100644 --- a/zone/bot_commands/discipline.cpp +++ b/zone/bot_commands/discipline.cpp @@ -3,25 +3,24 @@ void bot_command_discipline(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_discipline", sep->arg[0], "discipline")) { + c->Message(Chat::White, "note: Tells applicable bots to use the specified disciplines."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Tells applicable bots to use the specified disciplines" - }; + BotCommandHelpParams p; - std::vector notes = { }; - - std::vector example_format = + p.description = { - fmt::format( - "{} [aggressive | defensive | spell ID] [actionable, default: spawned]" - , sep->arg[0] - ) + "Tells applicable bots to use the specified disciplines." }; - std::vector examples_one = + p.notes = { "Aside from Lay On Hands and Harm Touch, you will need to know the spell ID of the discipline to tell a bot to attempt to use it." }; + p.example_format = + { + fmt::format("{} [aggressive | defensive | spell ID] [actionable, default: spawned]", sep->arg[0]) + }; + p.examples_one = { "To tell all bots to use an aggressive discipline:", fmt::format( @@ -29,7 +28,7 @@ void bot_command_discipline(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_two = + p.examples_two = { "To tell Warrior bots to use a defensive discipline:", fmt::format( @@ -38,7 +37,7 @@ void bot_command_discipline(Client* c, const Seperator* sep) Class::Warrior ) }; - std::vector examples_three = + p.examples_three = { "To tell all bots to use their Fearless discipline:", fmt::format( @@ -46,28 +45,9 @@ void bot_command_discipline(Client* c, const Seperator* sep) sep->arg[0] ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/distance_ranged.cpp b/zone/bot_commands/distance_ranged.cpp index 35db3ac75..7a3d2108b 100644 --- a/zone/bot_commands/distance_ranged.cpp +++ b/zone/bot_commands/distance_ranged.cpp @@ -3,16 +3,70 @@ void bot_command_distance_ranged(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_distance_ranged", sep->arg[0], "distanceranged")) { + c->Message(Chat::White, "note: Sets the distance bots will attempt to stay away from their target to cast or use ranged items."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { + BotCommandHelpParams p; + + p.description = { "Sets the distance bots will attempt to stay away from their target to cast or use ranged items." }; + p.notes = + { + "- Bots will stay between half the value of the setting and the current value. IE, if set to 60, bots will stay between 30 and 60.", + "- Casters will never go closer than their maximum melee range.", + "- Throwing bots will never get closer than the minimum value for ranged to work, or beyond the range of their items." + }; + p.example_format = { + fmt::format("{} [value] [actionable]", sep->arg[0]) + }; + p.examples_one = { + "To set Wizards to a range of 100:", + fmt::format( + "{} 100 byclass {}", + sep->arg[0], + Class::Wizard + ) + }; + p.examples_two = { + "To set Rangers to a range of 175:", + fmt::format( + "{} 175 byclass {}", + sep->arg[0], + Class::Ranger + ) + }; + p.examples_three = { + "To view the current setting of all bots:", + fmt::format( + "{} current spawned", + sep->arg[0] + ) + }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; + + std::string popup_text = c->SendBotCommandHelpWindow(p); + popup_text = DialogueWindow::Table(popup_text); + + c->SendPopupToClient(sep->arg[0], popup_text.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; c->Message(Chat::White, "usage: %s [current | value: 0 - 300] ([actionable: target | byname | ownergroup | ownerraid | targetgroup | namesgroup | healrotationtargets | mmr | byclass | byrace | spawned] ([actionable_name]))", sep->arg[0]); c->Message(Chat::White, "note: Use [current] to check the current setting."); c->Message(Chat::White, "note: Set the value to the minimum distance you want your bot to try to remain from its target."); c->Message(Chat::White, "note: If they are too far for a spell, it will be skipped."); c->Message(Chat::White, "note: This is set to (90) units by default."); - return; } const int ab_mask = ActionableBots::ABM_Type1; diff --git a/zone/bot_commands/follow.cpp b/zone/bot_commands/follow.cpp index 5996706d6..fe780d32e 100644 --- a/zone/bot_commands/follow.cpp +++ b/zone/bot_commands/follow.cpp @@ -3,28 +3,18 @@ void bot_command_follow(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_follow", sep->arg[0], "follow")) { + c->Message(Chat::White, "note: Sets bots of your choosing to follow your target, view their current following state or reset their following state."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Sets bots of your choosing to follow your target, view their current following state or reset their following state." - }; + BotCommandHelpParams p; - std::vector notes = - { - "- You can only follow players, bots or mercenaries belonging to your group or raid." - }; - - std::vector example_format = - { - fmt::format( - "{} [optional] [actionable]" - , sep->arg[0] - ) - }; - std::vector examples_one = + p.description = { "Sets bots of your choosing to follow your target, view their current following state or reset their following state." }; + p.notes = { "- You can only follow players, bots or mercenaries belonging to your group or raid." }; + p.example_format = { fmt::format("{} [optional] [actionable]", sep->arg[0]) }; + p.examples_one = { "To set all Clerics to follow your target:", fmt::format( @@ -33,7 +23,7 @@ void bot_command_follow(Client* c, const Seperator* sep) Class::Cleric ) }; - std::vector examples_two = + p.examples_two = { "To check the current state of all bots:", fmt::format( @@ -41,7 +31,7 @@ void bot_command_follow(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_three = + p.examples_three = { "To reset all bots:", fmt::format( @@ -49,28 +39,9 @@ void bot_command_follow(Client* c, const Seperator* sep) sep->arg[0] ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/illusion_block.cpp b/zone/bot_commands/illusion_block.cpp index cb87313d2..f38b72d92 100644 --- a/zone/bot_commands/illusion_block.cpp +++ b/zone/bot_commands/illusion_block.cpp @@ -3,25 +3,17 @@ void bot_command_illusion_block(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_illusion_block", sep->arg[0], "illusionblock")) { + c->Message(Chat::White, "note: Toggles whether or not bots will block the illusion effects of spells cast by players or bots."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Toggles whether or not bots will block the illusion effects of spells cast by players or bots." - }; + BotCommandHelpParams p; - std::vector notes = { }; - - std::vector example_format = - { - fmt::format( - "{} [value] [actionable]" - , sep->arg[0] - ) - }; - std::vector examples_one = + p.description = { "Toggles whether or not bots will block the illusion effects of spells cast by players or bots." }; + p.example_format = { fmt::format("{} [value] [actionable]", sep->arg[0]) }; + p.examples_one = { "To set BotA to block illusions:", fmt::format( @@ -29,8 +21,15 @@ void bot_command_illusion_block(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_two = { }; - std::vector examples_three = + p.examples_two = + { + "To set all bots to block illusions:", + fmt::format( + "{} 1 spawned", + sep->arg[0] + ) + }; + p.examples_three = { "To check the illusion block status for all bots:", fmt::format( @@ -38,28 +37,9 @@ void bot_command_illusion_block(Client* c, const Seperator* sep) sep->arg[0] ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/max_melee_range.cpp b/zone/bot_commands/max_melee_range.cpp index adb00f37d..54749c47c 100644 --- a/zone/bot_commands/max_melee_range.cpp +++ b/zone/bot_commands/max_melee_range.cpp @@ -3,25 +3,17 @@ void bot_command_max_melee_range(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_max_melee_range", sep->arg[0], "maxmeleerange")) { + c->Message(Chat::White, "note: Toggles whether or not bots will stay at max melee range during combat."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Toggles whether or not bots will stay at max melee range during combat." - }; - - std::vector notes = { }; - - std::vector example_format = - { - fmt::format( - "{} [value] [actionable]" - , sep->arg[0] - ) - }; - std::vector examples_one = + BotCommandHelpParams p; + + p.description = { "Toggles whether or not bots will stay at max melee range during combat."}; + p.example_format ={ fmt::format("{} [value] [actionable]", sep->arg[0]) }; + p.examples_one = { "To set BotA to stay at max melee range:", fmt::format( @@ -29,8 +21,15 @@ void bot_command_max_melee_range(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_two = { }; - std::vector examples_three = + p.examples_two = + { + "To set all bots to stay at max melee range:", + fmt::format( + "{} 1 spawned", + sep->arg[0] + ) + }; + p.examples_three = { "To check the max melee range status for all bots:", fmt::format( @@ -38,28 +37,9 @@ void bot_command_max_melee_range(Client* c, const Seperator* sep) sep->arg[0] ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/pet.cpp b/zone/bot_commands/pet.cpp index 5406d7132..04889f1cf 100644 --- a/zone/bot_commands/pet.cpp +++ b/zone/bot_commands/pet.cpp @@ -97,25 +97,17 @@ void bot_command_pet_remove(Client *c, const Seperator *sep) void bot_command_pet_set_type(Client *c, const Seperator *sep) { if (helper_command_alias_fail(c, "bot_command_pet_set_type", sep->arg[0], "petsettype")) { + c->Message(Chat::White, "note: Allows you to change the type of pet Magician bots will cast."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Allows you to change the type of pet Magician bots will cast" - }; + BotCommandHelpParams p; - std::vector notes = {}; - - std::vector example_format = - { - fmt::format( - "{} [current | water | fire | air | earth | monster | epic] [actionable, default: target]" - , sep->arg[0] - ) - }; - std::vector examples_one = + p.description = { "Allows you to change the type of pet Magician bots will cast." }; + p.example_format = { fmt::format("{} [current | water | fire | air | earth | monster | epic] [actionable, default: target]", sep->arg[0]) }; + p.examples_one = { "To set all spawned bots to use Water pets:", fmt::format( @@ -123,7 +115,7 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep) sep->arg[0] ) }; - std::vector examples_two = + p.examples_two = { "To set Magelulz to use Fire pets:", fmt::format( @@ -131,7 +123,7 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep) sep->arg[0] ) }; - std::vector examples_three = + p.examples_three = { "To check the current pet type for all bots:", fmt::format( @@ -139,28 +131,9 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep) sep->arg[0] ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/set_assistee.cpp b/zone/bot_commands/set_assistee.cpp index d2be953e2..f5a1845fe 100644 --- a/zone/bot_commands/set_assistee.cpp +++ b/zone/bot_commands/set_assistee.cpp @@ -2,41 +2,24 @@ void bot_command_set_assistee(Client* c, const Seperator* sep) { - if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Sets your bots to assist your target in addition to yourself" - }; + if (helper_command_alias_fail(c, "bot_command_set_assistee", sep->arg[0], "setassistee")) { + c->Message(Chat::White, "note: Sets your bots to assist your target in addition to yourself."); - std::vector notes = + return; + } + + if (helper_is_help_or_usage(sep->arg[1])) { + BotCommandHelpParams p; + + p.description = { "Sets your bots to assist your target in addition to yourself." }; + p.notes = { "- Your target must be another player in your group or raid.", - "- This needs to be set on every zone/camp you do." + "- This needs to be set on every zone/camp you do.", + "- If a Raid or Group assist is set and you do not want your bots to auto assist that person, set yourself as the assistee." }; - std::vector example_format = { }; - std::vector examples_one = { }; - std::vector examples_two = { }; - std::vector examples_three = { }; - - std::vector actionables = { }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/sit_hp_percent.cpp b/zone/bot_commands/sit_hp_percent.cpp index a147057f5..0c4208191 100644 --- a/zone/bot_commands/sit_hp_percent.cpp +++ b/zone/bot_commands/sit_hp_percent.cpp @@ -3,25 +3,17 @@ void bot_command_sit_hp_percent(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_sit_hp_percent", sep->arg[0], "sithppercent")) { + c->Message(Chat::White, "note: HP % threshold when bots will sit in combat if allowed."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "HP % threshold when bots will sit in combat if allowed." - }; + BotCommandHelpParams p; - std::vector notes = { }; - - std::vector example_format = - { - fmt::format( - "{} [value] [actionable]" - , sep->arg[0] - ) - }; - std::vector examples_one = + p.description = { "HP % threshold when bots will sit in combat if allowed." }; + p.example_format = { fmt::format("{} [value] [actionable]", sep->arg[0]) }; + p.examples_one = { "To set Clerics to sit at 45% HP:", fmt::format( @@ -29,8 +21,15 @@ void bot_command_sit_hp_percent(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_two = { }; - std::vector examples_three = + p.examples_two = + { + "To set all bots to sit at 50% HP:", + fmt::format( + "{} 50 spawned", + sep->arg[0] + ) + }; + p.examples_three = { "To check the HP threshold for all bots:", fmt::format( @@ -38,28 +37,9 @@ void bot_command_sit_hp_percent(Client* c, const Seperator* sep) sep->arg[0] ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/sit_in_combat.cpp b/zone/bot_commands/sit_in_combat.cpp index 86d8896b0..cfe868662 100644 --- a/zone/bot_commands/sit_in_combat.cpp +++ b/zone/bot_commands/sit_in_combat.cpp @@ -3,25 +3,17 @@ void bot_command_sit_in_combat(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_sit_in_combat", sep->arg[0], "sitincombat")) { + c->Message(Chat::White, "note: Toggles whether or not bots will sit in combat to heal or med."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Toggles whether or not bots will sit in combat to heal or med." - }; + BotCommandHelpParams p; - std::vector notes = { }; - - std::vector example_format = - { - fmt::format( - "{} [value] [actionable]" - , sep->arg[0] - ) - }; - std::vector examples_one = + p.description = { "Toggles whether or not bots will sit in combat to heal or med." }; + p.example_format = { fmt::format("{} [value] [actionable]", sep->arg[0]) }; + p.examples_one = { "To set Clerics to sit in combat:", fmt::format( @@ -29,8 +21,15 @@ void bot_command_sit_in_combat(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_two = { }; - std::vector examples_three = + p.examples_two = + { + "To set all bots to sit/med in combat:", + fmt::format( + "{} 1 spawned", + sep->arg[0] + ) + }; + p.examples_three = { "To check the sit in combat state for all bots:", fmt::format( @@ -38,28 +37,9 @@ void bot_command_sit_in_combat(Client* c, const Seperator* sep) sep->arg[0] ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/sit_mana_percent.cpp b/zone/bot_commands/sit_mana_percent.cpp index 14e37fa36..26e43a3be 100644 --- a/zone/bot_commands/sit_mana_percent.cpp +++ b/zone/bot_commands/sit_mana_percent.cpp @@ -3,63 +3,43 @@ void bot_command_sit_mana_percent(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_sit_mana_percent", sep->arg[0], "sitmanapercent")) { + c->Message(Chat::White, "note: Mana % threshold when bots will sit in combat if allowed."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Mana % threshold when bots will sit in combat if allowed." - }; + BotCommandHelpParams p; - std::vector notes = { }; - - std::vector example_format = + p.description = { "Mana % threshold when bots will sit in combat if allowed." }; + p.example_format = { fmt::format("{} [value] [actionable]", sep->arg[0]) }; + p.examples_one = { - fmt::format( - "{} [value] [actionable]" - , sep->arg[0] - ) - }; - std::vector examples_one = - { - "To set Clerics to sit at 45% mana:", + "To set Clerics to sit at 45% Mana:", fmt::format( "{} 45 byclass 2", sep->arg[0] ) }; - std::vector examples_two = { }; - std::vector examples_three = + p.examples_two = { - "To check the mana threshold for all bots:", + "To set all bots to sit at 50% Mana:", + fmt::format( + "{} 50 spawned", + sep->arg[0] + ) + }; + p.examples_three = + { + "To check the Mana threshold for all bots:", fmt::format( "{} current spawned", sep->arg[0] ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_aggro_checks.cpp b/zone/bot_commands/spell_aggro_checks.cpp index 3cddc2bbd..274718e5a 100644 --- a/zone/bot_commands/spell_aggro_checks.cpp +++ b/zone/bot_commands/spell_aggro_checks.cpp @@ -3,18 +3,16 @@ void bot_command_spell_aggro_checks(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_aggro_checks", sep->arg[0], "spellaggrochecks")) { + c->Message(Chat::White, "note: Toggles whether or not bots will cast a spell type if they think it will get them aggro."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Toggles whether or not bots will cast a spell type if they think it will get them aggro" - }; + BotCommandHelpParams p; - std::vector notes = { }; - - std::vector example_format = + p.description = { "Toggles whether or not bots will cast a spell type if they think it will get them aggro." }; + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -25,7 +23,7 @@ void bot_command_spell_aggro_checks(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set all bots to check aggro on nukes:", fmt::format( @@ -39,7 +37,7 @@ void bot_command_spell_aggro_checks(Client* c, const Seperator* sep) BotSpellTypes::Nuke ) }; - std::vector examples_two = + p.examples_two = { "To set Shadowknights to ignore aggro checks on snares:", fmt::format( @@ -53,7 +51,7 @@ void bot_command_spell_aggro_checks(Client* c, const Seperator* sep) BotSpellTypes::Snare ) }; - std::vector examples_three = + p.examples_three = { "To check the current DoT aggro check on all bots:", fmt::format( @@ -68,27 +66,9 @@ void bot_command_spell_aggro_checks(Client* c, const Seperator* sep) ) }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_delays.cpp b/zone/bot_commands/spell_delays.cpp index 0701ca2f0..ea2ecfee4 100644 --- a/zone/bot_commands/spell_delays.cpp +++ b/zone/bot_commands/spell_delays.cpp @@ -3,24 +3,23 @@ void bot_command_spell_delays(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_delays", sep->arg[0], "spelldelays")) { + c->Message(Chat::White, "note: Controls how long a bot will wait between casts of different spell types."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Controls how long a bot will wait between casts of different spell types" - }; + BotCommandHelpParams p; - std::vector notes = + p.description = { "Controls how long a bot will wait between casts of different spell types." }; + p.notes = { "- All pet types are based off the pet's owner's setting", "- Any remaining types use the owner's setting when a pet is the target", "- All Heals, Cures, Buffs (DS and resists included) are based off the target's setting, not the caster", "- e.g., BotA is healing BotB using BotB's settings", }; - - std::vector example_format = + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -31,7 +30,7 @@ void bot_command_spell_delays(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set all Necromancers to an 8s DoT delay:", fmt::format( @@ -45,7 +44,7 @@ void bot_command_spell_delays(Client* c, const Seperator* sep) BotSpellTypes::DOT ) }; - std::vector examples_two = + p.examples_two = { "To set all Warriors to receive Fast Heals every 2.5s:", fmt::format( @@ -59,7 +58,7 @@ void bot_command_spell_delays(Client* c, const Seperator* sep) BotSpellTypes::FastHeals ) }; - std::vector examples_three = + p.examples_three = { "To check the current Nuke delay on all bots:", fmt::format( @@ -73,28 +72,9 @@ void bot_command_spell_delays(Client* c, const Seperator* sep) BotSpellTypes::Nuke ) }; + p.actionables = { "target, byname, ownergroup, ownerraid targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_engaged_priority.cpp b/zone/bot_commands/spell_engaged_priority.cpp index 5ac398334..c87e18acd 100644 --- a/zone/bot_commands/spell_engaged_priority.cpp +++ b/zone/bot_commands/spell_engaged_priority.cpp @@ -3,22 +3,21 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_engaged_priority", sep->arg[0], "spellengagedpriority")) { + c->Message(Chat::White, "note: Sets the order of spell casts when engaged in combat by spell type."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Sets the order of spell casts when engaged in combat by spell type" - }; + BotCommandHelpParams p; - std::vector notes = + p.description = { "Sets the order of spell casts when engaged in combat by spell type." }; + p.notes = { "- Setting a spell type to 0 will prevent that type from being cast.", "- If 2 or more are set to the same priority they will sort by spell type ID." }; - - std::vector example_format = + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -29,7 +28,7 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set all Shaman to cast slows first:", fmt::format( @@ -43,7 +42,7 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep) BotSpellTypes::Slow ) }; - std::vector examples_two = + p.examples_two = { "To set all bots to not cast snares:", fmt::format( @@ -57,7 +56,7 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep) BotSpellTypes::Snare ) }; - std::vector examples_three = + p.examples_three = { "To check the current engaged priority of dispels on all bots:", fmt::format( @@ -71,28 +70,9 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep) BotSpellTypes::Dispel ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_holds.cpp b/zone/bot_commands/spell_holds.cpp index 703da4df7..ad374163b 100644 --- a/zone/bot_commands/spell_holds.cpp +++ b/zone/bot_commands/spell_holds.cpp @@ -3,21 +3,17 @@ void bot_command_spell_holds(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_holds", sep->arg[0], "spellholds")) { + c->Message(Chat::White, "note: Toggles whether or not bots can cast certain spell types."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Toggles whether or not bots can cast certain spell types" - }; + BotCommandHelpParams p; - std::vector notes = - { - "- All pet types are based off the pet owner's setting when a pet is the target" - }; - - std::vector example_format = + p.description = { "Toggles whether or not bots can cast certain spell types." }; + p.notes = { "- All pet types are based off the pet owner's setting when a pet is the target" }; + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -28,7 +24,7 @@ void bot_command_spell_holds(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set all bots to hold DoTs:", fmt::format( @@ -42,7 +38,7 @@ void bot_command_spell_holds(Client* c, const Seperator* sep) BotSpellTypes::DOT ) }; - std::vector examples_two = + p.examples_two = { "To check the current DoT settings on all bots:", fmt::format( @@ -56,29 +52,9 @@ void bot_command_spell_holds(Client* c, const Seperator* sep) BotSpellTypes::DOT ) }; - std::vector examples_three = { }; - - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_idle_priority.cpp b/zone/bot_commands/spell_idle_priority.cpp index 0d24a148d..5310d189e 100644 --- a/zone/bot_commands/spell_idle_priority.cpp +++ b/zone/bot_commands/spell_idle_priority.cpp @@ -3,22 +3,21 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_idle_priority", sep->arg[0], "spellidlepriority")) { + c->Message(Chat::White, "note: Sets the order of spell casts when not in combat by spell type."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Sets the order of spell casts when not in combat by spell type" - }; + BotCommandHelpParams p; - std::vector notes = + p.description = { "Sets the order of spell casts when not in combat by spell type." }; + p.notes = { "- Setting a spell type to 0 will prevent that type from being cast.", "- If 2 or more are set to the same priority they will sort by spell type ID." }; - - std::vector example_format = + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -29,7 +28,7 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set all Clerics to cast fast heals third:", fmt::format( @@ -43,7 +42,7 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep) BotSpellTypes::FastHeals ) }; - std::vector examples_two = + p.examples_two = { "To set all bots to not cast cures:", fmt::format( @@ -57,7 +56,7 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep) BotSpellTypes::Cure ) }; - std::vector examples_three = + p.examples_three = { "To check the current idle priority of buffs on all bots:", fmt::format( @@ -71,28 +70,9 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep) BotSpellTypes::Buff ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_max_hp_pct.cpp b/zone/bot_commands/spell_max_hp_pct.cpp index a9e7e3f6d..450030dad 100644 --- a/zone/bot_commands/spell_max_hp_pct.cpp +++ b/zone/bot_commands/spell_max_hp_pct.cpp @@ -3,18 +3,16 @@ void bot_command_spell_max_hp_pct(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_max_hp_pct", sep->arg[0], "spellmaxhppct")) { + c->Message(Chat::White, "note: Controls at what health percentage a bot will start casting different spell types."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Controls at what health percentage a bot will start casting different spell types" - }; + BotCommandHelpParams p; - std::vector notes = { }; - - std::vector example_format = + p.description = { "Controls at what health percentage a bot will start casting different spell types." }; + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -25,9 +23,9 @@ void bot_command_spell_max_hp_pct(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { - "To set all bots to start snaring when their health is at or below 100% HP:", + "To set all bots to allow snaring when their health is at or below 100% HP:", fmt::format( "{} {} 100 spawned", sep->arg[0], @@ -39,9 +37,9 @@ void bot_command_spell_max_hp_pct(Client* c, const Seperator* sep) BotSpellTypes::Snare ) }; - std::vector examples_two = + p.examples_two = { - "To set BotA to start casting fast heals at 30% HP:", + "To set BotA to allow casting of fast heals at 30% HP:", fmt::format( "{} {} 30 byname BotA", sep->arg[0], @@ -53,7 +51,7 @@ void bot_command_spell_max_hp_pct(Client* c, const Seperator* sep) BotSpellTypes::FastHeals ) }; - std::vector examples_three = + p.examples_three = { "To check the current Stun max HP percent on all bots:", fmt::format( @@ -67,28 +65,9 @@ void bot_command_spell_max_hp_pct(Client* c, const Seperator* sep) BotSpellTypes::Stun ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_max_mana_pct.cpp b/zone/bot_commands/spell_max_mana_pct.cpp index 68dde0c6d..1d554fc1b 100644 --- a/zone/bot_commands/spell_max_mana_pct.cpp +++ b/zone/bot_commands/spell_max_mana_pct.cpp @@ -3,18 +3,16 @@ void bot_command_spell_max_mana_pct(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_max_mana_pct", sep->arg[0], "spellmaxmanapct")) { + c->Message(Chat::White, "note: Controls at what mana percentage a bot will stop casting different spell types."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Controls at what mana percentage a bot will stop casting different spell types" - }; + BotCommandHelpParams p; - std::vector notes = { }; - - std::vector example_format = + p.description = { "Controls at what mana percentage a bot will stop casting different spell types." }; + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -25,9 +23,9 @@ void bot_command_spell_max_mana_pct(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { - "To set all bots to start snaring when their mana is at or below 100% HP:", + "To set all bots to allow snaring when their mana is at or below 100% HP:", fmt::format( "{} {} 10 spawned", sep->arg[0], @@ -39,21 +37,21 @@ void bot_command_spell_max_mana_pct(Client* c, const Seperator* sep) BotSpellTypes::Snare ) }; - std::vector examples_two = + p.examples_two = { - "To set BotA to start casting fast heals at 30% mana:", + "To set BotA to allow casting of fast heals at 90% mana:", fmt::format( - "{} {} 30 byname BotA", + "{} {} 90 byname BotA", sep->arg[0], c->GetSpellTypeShortNameByID(BotSpellTypes::FastHeals) ), fmt::format( - "{} {} 30 byname BotA", + "{} {} 90 byname BotA", sep->arg[0], BotSpellTypes::FastHeals ) }; - std::vector examples_three = + p.examples_three = { "To check the current Stun max mana percent on all bots:", fmt::format( @@ -67,28 +65,9 @@ void bot_command_spell_max_mana_pct(Client* c, const Seperator* sep) BotSpellTypes::Stun ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_max_thresholds.cpp b/zone/bot_commands/spell_max_thresholds.cpp index 709e8bd8a..13cd6e635 100644 --- a/zone/bot_commands/spell_max_thresholds.cpp +++ b/zone/bot_commands/spell_max_thresholds.cpp @@ -3,24 +3,23 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_max_thresholds", sep->arg[0], "spellmaxthresholds")) { + c->Message(Chat::White, "note: Controls at what target HP % the bot will start casting different spell types."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Controls at what target HP % the bot will start casting different spell types" - }; + BotCommandHelpParams p; - std::vector notes = + p.description = { "Controls at what target HP % the bot will start casting different spell types." }; + p.notes = { "- All pet types are based off the pet's owner's setting", "- Any remaining types use the owner's setting when a pet is the target", "- All Heals, Cures, Buffs (DS and resists included) are based off the target's setting, not the caster", "- e.g., BotA is healing BotB using BotB's settings", }; - - std::vector example_format = + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -31,7 +30,7 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set all bots to start snaring at 99%:", fmt::format( @@ -45,7 +44,7 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep) BotSpellTypes::Snare ) }; - std::vector examples_two = + p.examples_two = { "To set bot Enchbot to start casting Debuffs at 99%:", fmt::format( @@ -59,7 +58,7 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep) BotSpellTypes::Debuff ) }; - std::vector examples_three = + p.examples_three = { "To check the current Nuke max threshold on all bots:", fmt::format( @@ -73,28 +72,9 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep) BotSpellTypes::Nuke ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_min_hp_pct.cpp b/zone/bot_commands/spell_min_hp_pct.cpp index c8124b9a0..5ee69b996 100644 --- a/zone/bot_commands/spell_min_hp_pct.cpp +++ b/zone/bot_commands/spell_min_hp_pct.cpp @@ -3,18 +3,16 @@ void bot_command_spell_min_hp_pct(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_min_hp_pct", sep->arg[0], "spellminhppct")) { + c->Message(Chat::White, "note: Controls at what health percentage a bot will stop casting different spell types."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Controls at what health percentage a bot will stop casting different spell types" - }; - - std::vector notes = { }; - - std::vector example_format = + BotCommandHelpParams p; + + p.description = { "Controls at what health percentage a bot will stop casting different spell types." }; + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -25,7 +23,7 @@ void bot_command_spell_min_hp_pct(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set all bots to stop snaring when their health is below 10% HP:", fmt::format( @@ -39,7 +37,7 @@ void bot_command_spell_min_hp_pct(Client* c, const Seperator* sep) BotSpellTypes::Snare ) }; - std::vector examples_two = + p.examples_two = { "To set BotA to stop casting fast heals at 30% HP:", fmt::format( @@ -53,7 +51,7 @@ void bot_command_spell_min_hp_pct(Client* c, const Seperator* sep) BotSpellTypes::FastHeals ) }; - std::vector examples_three = + p.examples_three = { "To check the current Stun min HP percent on all bots:", fmt::format( @@ -67,28 +65,9 @@ void bot_command_spell_min_hp_pct(Client* c, const Seperator* sep) BotSpellTypes::Stun ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_min_mana_pct.cpp b/zone/bot_commands/spell_min_mana_pct.cpp index 411d6ec18..3c760d82e 100644 --- a/zone/bot_commands/spell_min_mana_pct.cpp +++ b/zone/bot_commands/spell_min_mana_pct.cpp @@ -3,18 +3,16 @@ void bot_command_spell_min_mana_pct(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_min_mana_pct", sep->arg[0], "spellminmanapct")) { + c->Message(Chat::White, "note: Controls at what mana percentage a bot will stop casting different spell types."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Controls at what mana percentage a bot will stop casting different spell types" - }; - - std::vector notes = { }; - - std::vector example_format = + BotCommandHelpParams p; + + p.description = { "Controls at what mana percentage a bot will stop casting different spell types." }; + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -25,7 +23,7 @@ void bot_command_spell_min_mana_pct(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set all bots to stop snaring when their mana is below 10% HP:", fmt::format( @@ -39,7 +37,7 @@ void bot_command_spell_min_mana_pct(Client* c, const Seperator* sep) BotSpellTypes::Snare ) }; - std::vector examples_two = + p.examples_two = { "To set BotA to stop casting fast heals at 30% mana:", fmt::format( @@ -53,7 +51,7 @@ void bot_command_spell_min_mana_pct(Client* c, const Seperator* sep) BotSpellTypes::FastHeals ) }; - std::vector examples_three = + p.examples_three = { "To check the current Stun min mana percent on all bots:", fmt::format( @@ -67,28 +65,9 @@ void bot_command_spell_min_mana_pct(Client* c, const Seperator* sep) BotSpellTypes::Stun ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_min_thresholds.cpp b/zone/bot_commands/spell_min_thresholds.cpp index c1c5a6227..606fe5b1b 100644 --- a/zone/bot_commands/spell_min_thresholds.cpp +++ b/zone/bot_commands/spell_min_thresholds.cpp @@ -3,24 +3,23 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_min_thresholds", sep->arg[0], "spellminthresholds")) { + c->Message(Chat::White, "note: Controls at what target HP % the bot will stop casting different spell types."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Controls at what target HP % the bot will stop casting different spell types" - }; + BotCommandHelpParams p; - std::vector notes = + p.description = { "Controls at what target HP % the bot will stop casting different spell types." }; + p.notes = { "- All pet types are based off the pet's owner's setting", "- Any remaining types use the owner's setting when a pet is the target", "- All Heals, Cures, Buffs (DS and resists included) are based off the target's setting, not the caster", "- e.g., BotA is healing BotB using BotB's settings", }; - - std::vector example_format = + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -31,7 +30,7 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set all bots to stop debuffing at 10%:", fmt::format( @@ -45,7 +44,7 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep) BotSpellTypes::Debuff ) }; - std::vector examples_two = + p.examples_two = { "To set all Druids to stop casting DoTs at 15%:", fmt::format( @@ -59,7 +58,7 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep) BotSpellTypes::DOT ) }; - std::vector examples_three = + p.examples_three = { "To check the current Fast Heal min threshold on all bots:", fmt::format( @@ -73,30 +72,9 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep) BotSpellTypes::FastHeals ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid", - "targetgroup, namesgroup, healrotationtargets", - "mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_pursue_priority.cpp b/zone/bot_commands/spell_pursue_priority.cpp index e9430ea4d..51725ba94 100644 --- a/zone/bot_commands/spell_pursue_priority.cpp +++ b/zone/bot_commands/spell_pursue_priority.cpp @@ -3,22 +3,21 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_pursue_priority", sep->arg[0], "spellpursuepriority")) { + c->Message(Chat::White, "note: Sets the order of spell casts when the mob is fleeing in combat by spell type."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Sets the order of spell casts when the mob is fleeing in combat by spell type" - }; + BotCommandHelpParams p; - std::vector notes = + p.description = { "Sets the order of spell casts when the mob is fleeing in combat by spell type." }; + p.notes = { "- Setting a spell type to 0 will prevent that type from being cast.", "- If 2 or more are set to the same priority they will sort by spell type ID." }; - - std::vector example_format = + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -29,7 +28,7 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set all bots to cast nukes first:", fmt::format( @@ -43,7 +42,7 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep) BotSpellTypes::FastHeals ) }; - std::vector examples_two = + p.examples_two = { "To set all Shaman to not cast cures:", fmt::format( @@ -57,7 +56,7 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep) BotSpellTypes::Cure ) }; - std::vector examples_three = + p.examples_three = { "To check the current pursue priority of buffs on all bots:", fmt::format( @@ -71,28 +70,9 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep) BotSpellTypes::Buff ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/spell_target_count.cpp b/zone/bot_commands/spell_target_count.cpp index aeb1931fe..536719d6e 100644 --- a/zone/bot_commands/spell_target_count.cpp +++ b/zone/bot_commands/spell_target_count.cpp @@ -3,18 +3,16 @@ void bot_command_spell_target_count(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_spell_target_count", sep->arg[0], "spelltargetcount")) { + c->Message(Chat::White, "note: Decides how many eligible targets are required for an AE or group spell to cast by spell type."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Decides how many eligible targets are required for an AE or group spell to cast by spell type" - }; + BotCommandHelpParams p; - std::vector notes = { }; - - std::vector example_format = + p.description = { "Decides how many eligible targets are required for an AE or group spell to cast by spell type." }; + p.example_format = { fmt::format( "{} [Type Shortname] [value] [actionable]" @@ -25,7 +23,7 @@ void bot_command_spell_target_count(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set all bots to AEMez with 5 or more targets:", fmt::format( @@ -39,7 +37,7 @@ void bot_command_spell_target_count(Client* c, const Seperator* sep) BotSpellTypes::AEMez ) }; - std::vector examples_two = + p.examples_two = { "To set Wizards to require 5 targets for AENukes:", fmt::format( @@ -53,7 +51,7 @@ void bot_command_spell_target_count(Client* c, const Seperator* sep) BotSpellTypes::AENukes ) }; - std::vector examples_three = + p.examples_three = { "To check the current AESlow count on all bots:", fmt::format( @@ -67,28 +65,9 @@ void bot_command_spell_target_count(Client* c, const Seperator* sep) BotSpellTypes::AESlow ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/bot_commands/taunt.cpp b/zone/bot_commands/taunt.cpp index 2b1eea20b..69b49b42e 100644 --- a/zone/bot_commands/taunt.cpp +++ b/zone/bot_commands/taunt.cpp @@ -3,25 +3,17 @@ void bot_command_taunt(Client* c, const Seperator* sep) { if (helper_command_alias_fail(c, "bot_command_taunt", sep->arg[0], "taunt")) { + c->Message(Chat::White, "note: TAllows you to turn on/off the taunting state of your bots and/or their pets."); + return; } if (helper_is_help_or_usage(sep->arg[1])) { - std::vector description = - { - "Allows you to turn on/off the taunting state of your bots and/or their pets" - }; + BotCommandHelpParams p; - std::vector notes = { }; - - std::vector example_format = - { - fmt::format( - "{} [on / off / pet] [optional: pet] [actionable, default: target]" - , sep->arg[0] - ) - }; - std::vector examples_one = + p.description = { "Allows you to turn on/off the taunting state of your bots and/or their pets." }; + p.example_format = { fmt::format("{} [on / off / pet] [optional: pet] [actionable, default: target]", sep->arg[0]) }; + p.examples_one = { "To turn off taunt on all bots:", fmt::format( @@ -29,7 +21,7 @@ void bot_command_taunt(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_two = + p.examples_two = { "To turn on taunt on all bots' pets:", fmt::format( @@ -37,7 +29,7 @@ void bot_command_taunt(Client* c, const Seperator* sep) sep->arg[0] ) }; - std::vector examples_three = + p.examples_three = { "To turn on taunt for all ShadowKnights:", fmt::format( @@ -46,28 +38,9 @@ void bot_command_taunt(Client* c, const Seperator* sep) Class::ShadowKnight ) }; + p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" }; - std::vector actionables = - { - "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" - }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); - + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/client.cpp b/zone/client.cpp index c8e76b2e2..c0ec607e2 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -13112,20 +13112,10 @@ void Client::ShowZoneShardMenu() } } -std::string Client::SendCommandHelpWindow( - Client* c, - std::vector description, - std::vector notes, - std::vector example_format, - std::vector examples_one, std::vector examples_two, std::vector examples_three, - std::vector actionables, - std::vector options, - std::vector options_one, std::vector options_two, std::vector options_three -) { - +std::string Client::SendBotCommandHelpWindow(const BotCommandHelpParams& params) { unsigned string_length = 0; unsigned current_place = 0; - uint16 max_length = RuleI(Command, MaxHelpLineLength); //character length of a line before splitting in to multiple lines + uint16 max_length = RuleI(Command, MaxHelpLineLength); // Line length before splitting const std::string& description_color = RuleS(Command, DescriptionColor); const std::string& description_header_color = RuleS(Command, DescriptionHeaderColor); const std::string& alt_description_color = RuleS(Command, AltDescriptionColor); @@ -13145,81 +13135,66 @@ std::string Client::SendCommandHelpWindow( const std::string& actionable_color = RuleS(Command, ActionableColor); const std::string& actionable_header_color = RuleS(Command, ActionableHeaderColor); const std::string& alt_actionable_color = RuleS(Command, AltActionableColor); - const std::string& header_color = RuleS(Command, HeaderColor); - const std::string& secondary_header_color = RuleS(Command, SecondaryHeaderColor); - const std::string& alt_header_color = RuleS(Command, AltHeaderColor); const std::string& filler_line_color = RuleS(Command, FillerLineColor); - - std::string filler_line = "--------------------------------------------------------------------"; std::string filler_dia = DialogueWindow::TableRow(DialogueWindow::TableCell(fmt::format("{}", DialogueWindow::ColorMessage(filler_line_color, filler_line)))); std::string break_line = DialogueWindow::Break(); - std::string indent = "        "; - std::string bullet = "- "; - std::string popup_text = ""; + std::string popup_text; - /* - max_length is how long you want lines to be before splitting them. This will look for the last space before the count and split there so words are not split mid sentence - Any SplitCommandHelpText can have the first string from a vector differ in color from the next strings by setting an alternate color for that type in the rule. - */ - - if (!description.empty()) { + if (!params.description.empty()) { popup_text += GetCommandHelpHeader(description_header_color, "[Description]"); - popup_text += SplitCommandHelpText(description, description_color, max_length, !alt_description_color.empty(), alt_description_color); + popup_text += SplitCommandHelpText(params.description, description_color, max_length, !alt_description_color.empty(), alt_description_color); } - if (!notes.empty()) { - popup_text += break_line; - popup_text += break_line; + if (!params.notes.empty()) { + popup_text += break_line + break_line; popup_text += GetCommandHelpHeader(note_header_color, "[Notes]"); - popup_text += SplitCommandHelpText(notes, note_color, max_length, !alt_note_color.empty(), alt_note_color); + popup_text += SplitCommandHelpText(params.notes, note_color, max_length, !alt_note_color.empty(), alt_note_color); } - if (!example_format.empty()) { + if (!params.example_format.empty()) { popup_text += filler_dia; popup_text += GetCommandHelpHeader(example_header_color, "[Examples]"); - popup_text += SplitCommandHelpText(example_format, example_color, max_length, !alt_example_color.empty(), alt_example_color); + popup_text += SplitCommandHelpText(params.example_format, example_color, max_length, !alt_example_color.empty(), alt_example_color); } - if (!examples_one.empty()) { - popup_text += break_line; - popup_text += break_line; - popup_text += SplitCommandHelpText(examples_one, sub_example_color, max_length, !sub_alt_example_color.empty(), sub_alt_example_color); + if (!params.examples_one.empty()) { + popup_text += break_line + break_line; + popup_text += SplitCommandHelpText(params.examples_one, sub_example_color, max_length, !sub_alt_example_color.empty(), sub_alt_example_color); } - if (!examples_two.empty()) { - popup_text += SplitCommandHelpText(examples_two, sub_example_color, max_length, !sub_alt_example_color.empty(), sub_alt_example_color); + if (!params.examples_two.empty()) { + popup_text += SplitCommandHelpText(params.examples_two, sub_example_color, max_length, !sub_alt_example_color.empty(), sub_alt_example_color); } - if (!examples_three.empty()) { - popup_text += SplitCommandHelpText(examples_three, sub_example_color, max_length, !sub_alt_example_color.empty(), sub_alt_example_color); + if (!params.examples_three.empty()) { + popup_text += SplitCommandHelpText(params.examples_three, sub_example_color, max_length, !sub_alt_example_color.empty(), sub_alt_example_color); } - if (!options.empty()) { + if (!params.options.empty()) { popup_text += filler_dia; popup_text += GetCommandHelpHeader(option_header_color, "[Options]"); - popup_text += SplitCommandHelpText(options, option_color, max_length, !alt_option_color.empty(), alt_option_color); + popup_text += SplitCommandHelpText(params.options, option_color, max_length, !alt_option_color.empty(), alt_option_color); } - if (!options_one.empty()) { - popup_text += break_line; - popup_text += break_line; - popup_text += SplitCommandHelpText(options_one, sub_option_color, max_length, !sub_alt_option_color.empty(), sub_alt_option_color); + if (!params.options_one.empty()) { + popup_text += break_line + break_line; + popup_text += SplitCommandHelpText(params.options_one, sub_option_color, max_length, !sub_alt_option_color.empty(), sub_alt_option_color); } - if (!options_two.empty()) { - popup_text += SplitCommandHelpText(options_two, sub_option_color, max_length, !sub_alt_option_color.empty(), sub_alt_option_color); + if (!params.options_two.empty()) { + popup_text += SplitCommandHelpText(params.options_two, sub_option_color, max_length, !sub_alt_option_color.empty(), sub_alt_option_color); } - if (!options_three.empty()) { - popup_text += SplitCommandHelpText(options_three, secondary_header_color, max_length, !sub_alt_option_color.empty(), sub_alt_option_color); + if (!params.options_three.empty()) { + popup_text += SplitCommandHelpText(params.options_three, sub_option_color, max_length, !sub_alt_option_color.empty(), sub_alt_option_color); } - if (!actionables.empty()) { + if (!params.actionables.empty()) { popup_text += filler_dia; popup_text += GetCommandHelpHeader(actionable_header_color, "[Actionables]"); - popup_text += SplitCommandHelpText(actionables, actionable_color, max_length, !alt_actionable_color.empty(), alt_actionable_color); + popup_text += SplitCommandHelpText(params.actionables, actionable_color, max_length, !alt_actionable_color.empty(), alt_actionable_color); } popup_text = DialogueWindow::Table(popup_text); diff --git a/zone/client.h b/zone/client.h index 20e6ebba6..1ac7f893a 100644 --- a/zone/client.h +++ b/zone/client.h @@ -197,6 +197,19 @@ struct RespawnOption float heading; }; +struct BotCommandHelpParams { + std::vector description = {}; + std::vector notes = {}; + std::vector example_format = {}; + std::vector examples_one = {}; + std::vector examples_two = {}; + std::vector examples_three = {}; + std::vector actionables = {}; + std::vector options = {}; + std::vector options_one = {}; + std::vector options_two = {}; + std::vector options_three = {}; +}; // do not ask what all these mean because I have no idea! // named from the client's CEverQuest::GetInnateDesc, they're missing some @@ -1259,16 +1272,7 @@ public: void SendOPTranslocateConfirm(Mob *Caster, uint16 SpellID); // Help Window - std::string SendCommandHelpWindow( - Client* c, - std::vector description, - std::vector notes, - std::vector example_format, - std::vector examples_one, std::vector examples_two, std::vector examples_three, - std::vector actionables, - std::vector options, - std::vector options_one, std::vector options_two, std::vector options_three - ); + std::string SendBotCommandHelpWindow(const BotCommandHelpParams& params); std::string GetCommandHelpHeader(std::string color, std::string header); std::string SplitCommandHelpText(std::vector msg, std::string color, uint16 maxLength, bool secondColor = false, std::string secondaryColor = ""); void SendSpellTypePrompts(bool commandedTypes = false, bool clientOnlyTypes = false); diff --git a/zone/gm_commands/spell_delays.cpp b/zone/gm_commands/spell_delays.cpp index 0c3c8c392..21b744823 100644 --- a/zone/gm_commands/spell_delays.cpp +++ b/zone/gm_commands/spell_delays.cpp @@ -7,17 +7,14 @@ void command_spell_delays(Client* c, const Seperator* sep) const bool is_help = !strcasecmp(sep->arg[1], "help"); if (is_help) { - std::vector description = - { - "Controls how often bots can cast certain spell types on you" - }; + BotCommandHelpParams p; - std::vector notes = + p.description = { "Controls how often bots can cast certain spell types on you" }; + p.notes = { "- All pet types are control your how your pet will be affected" }; - - std::vector example_format = + p.example_format = { fmt::format( "{} [Type Shortname] [value]" @@ -28,7 +25,7 @@ void command_spell_delays(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set Very Fast Heals to be received every 1 second:", fmt::format( @@ -42,7 +39,7 @@ void command_spell_delays(Client* c, const Seperator* sep) BotSpellTypes::VeryFastHeals ) }; - std::vector examples_two = + p.examples_two = { "To check your current Regular Heal delay:", fmt::format( @@ -56,26 +53,8 @@ void command_spell_delays(Client* c, const Seperator* sep) BotSpellTypes::RegularHeal ) }; - std::vector examples_three = { }; - - std::vector actionables = { }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/gm_commands/spell_holds.cpp b/zone/gm_commands/spell_holds.cpp index dcb0639de..a50bc957e 100644 --- a/zone/gm_commands/spell_holds.cpp +++ b/zone/gm_commands/spell_holds.cpp @@ -11,17 +11,14 @@ void command_spell_holds(Client *c, const Seperator *sep) const bool is_help = !strcasecmp(sep->arg[1], "help"); if (is_help) { - std::vector description = - { - "Toggles whether or not bots can cast certain spell types on you" - }; + BotCommandHelpParams p; - std::vector notes = + p.description = { "Toggles whether or not bots can cast certain spell types on you" }; + p.notes = { "- All pet types are control your how your pet will be affected" }; - - std::vector example_format = + p.example_format = { fmt::format( "{} [Type Shortname] [value]" @@ -32,7 +29,7 @@ void command_spell_holds(Client *c, const Seperator *sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set DoTs to be held:", fmt::format( @@ -46,7 +43,7 @@ void command_spell_holds(Client *c, const Seperator *sep) BotSpellTypes::DOT ) }; - std::vector examples_two = + p.examples_two = { "To check your current DoT settings:", fmt::format( @@ -60,26 +57,8 @@ void command_spell_holds(Client *c, const Seperator *sep) BotSpellTypes::DOT ) }; - std::vector examples_three = { }; - - std::vector actionables = { }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/gm_commands/spell_max_thresholds.cpp b/zone/gm_commands/spell_max_thresholds.cpp index c6452d76f..914163f27 100644 --- a/zone/gm_commands/spell_max_thresholds.cpp +++ b/zone/gm_commands/spell_max_thresholds.cpp @@ -7,17 +7,14 @@ void command_spell_max_thresholds(Client* c, const Seperator* sep) const bool is_help = !strcasecmp(sep->arg[1], "help"); if (is_help) { - std::vector description = - { - "Threshold of your own health when bots will start casting the chosen spell type" - }; + BotCommandHelpParams p; - std::vector notes = + p.description = { "Threshold of your own health when bots will start casting the chosen spell type" }; + p.notes = { "- All pet types are control your how your pet will be affected" }; - - std::vector example_format = + p.example_format = { fmt::format( "{} [Type Shortname] [value]" @@ -28,7 +25,7 @@ void command_spell_max_thresholds(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set Complete Heals to start at 90% health:", fmt::format( @@ -42,7 +39,7 @@ void command_spell_max_thresholds(Client* c, const Seperator* sep) BotSpellTypes::CompleteHeal ) }; - std::vector examples_two = + p.examples_two = { "To check your current HoT Heal settings:", fmt::format( @@ -56,26 +53,8 @@ void command_spell_max_thresholds(Client* c, const Seperator* sep) BotSpellTypes::HoTHeals ) }; - std::vector examples_three = { }; - - std::vector actionables = { }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str()); diff --git a/zone/gm_commands/spell_min_thresholds.cpp b/zone/gm_commands/spell_min_thresholds.cpp index 3bff9dbb2..f8b48dbed 100644 --- a/zone/gm_commands/spell_min_thresholds.cpp +++ b/zone/gm_commands/spell_min_thresholds.cpp @@ -7,17 +7,14 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep) const bool is_help = !strcasecmp(sep->arg[1], "help"); if (is_help) { - std::vector description = - { - "Threshold of your own health when bots will stop casting the chosen spell type" - }; + BotCommandHelpParams p; - std::vector notes = + p.description = { "Threshold of your own health when bots will stop casting the chosen spell type" }; + p.notes = { "- All pet types are control your how your pet will be affected" }; - - std::vector example_format = + p.example_format = { fmt::format( "{} [Type Shortname] [value]" @@ -28,7 +25,7 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep) , sep->arg[0] ) }; - std::vector examples_one = + p.examples_one = { "To set Fast Heals to be stopped at 65% health:", fmt::format( @@ -42,7 +39,7 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep) BotSpellTypes::FastHeals ) }; - std::vector examples_two = + p.examples_two = { "To check your current Cure settings:", fmt::format( @@ -56,26 +53,8 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep) BotSpellTypes::Cure ) }; - std::vector examples_three = { }; - - std::vector actionables = { }; - - std::vector options = { }; - std::vector options_one = { }; - std::vector options_two = { }; - std::vector options_three = { }; - - std::string popup_text = c->SendCommandHelpWindow( - c, - description, - notes, - example_format, - examples_one, examples_two, examples_three, - actionables, - options, - options_one, options_two, options_three - ); + std::string popup_text = c->SendBotCommandHelpWindow(p); popup_text = DialogueWindow::Table(popup_text); c->SendPopupToClient(sep->arg[0], popup_text.c_str());