mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
more command cleanup
This commit is contained in:
+11
-49
@@ -1325,7 +1325,6 @@ int bot_command_init(void)
|
||||
bot_command_add("inventoryremove", "Removes an item from a bot's inventory", AccountStatus::Player, bot_command_inventory_remove) ||
|
||||
bot_command_add("inventorywindow", "Displays all items in a bot's inventory in a pop-up window", AccountStatus::Player, bot_command_inventory_window) ||
|
||||
bot_command_add("itemuse", "Elicits a report from spawned bots that can use the item on your cursor (option 'empty' yields only empty slots)", AccountStatus::Player, bot_command_item_use) ||
|
||||
bot_command_add("lull", "Orders a bot to cast a pacification spell", AccountStatus::Player, bot_command_lull) || //TODO bot rewrite - IMPLEMENT
|
||||
bot_command_add("maxmeleerange", "Toggles whether your bot is at max melee range or not. This will disable all special abilities, including taunt.", AccountStatus::Player, bot_command_max_melee_range) ||
|
||||
bot_command_add("owneroption", "Sets options available to bot owners", AccountStatus::Player, bot_command_owner_option) ||
|
||||
bot_command_add("pet", "Lists the available bot pet [subcommands]", AccountStatus::Player, bot_command_pet) ||
|
||||
@@ -1362,7 +1361,6 @@ int bot_command_init(void)
|
||||
bot_command_add("spellsettingsupdate", "Update a bot spell setting entry", AccountStatus::Player, bot_command_spell_settings_update) ||
|
||||
bot_command_add("spelltypeids", "Lists spelltypes by ID", AccountStatus::Player, bot_command_spelltype_ids) ||
|
||||
bot_command_add("spelltypenames", "Lists spelltypes by shortname", AccountStatus::Player, bot_command_spelltype_names) ||
|
||||
bot_command_add("summoncorpse", "Orders a bot to summon a corpse to its feet", AccountStatus::Player, bot_command_summon_corpse) || //TODO bot rewrite - IMPLEMENT
|
||||
bot_command_add("suspend", "Suspends a bot's AI processing until released", AccountStatus::Player, bot_command_suspend) ||
|
||||
bot_command_add("taunt", "Toggles taunt use by a bot", AccountStatus::Player, bot_command_taunt) ||
|
||||
bot_command_add("timer", "Checks or clears timers of the chosen type.", AccountStatus::GMMgmt, bot_command_timer) ||
|
||||
@@ -2102,56 +2100,13 @@ bool helper_spell_list_fail(Client *bot_owner, bcst_list* spell_list, BCEnum::Sp
|
||||
return false;
|
||||
}
|
||||
|
||||
void SendSpellTypePrompts(Client *c, bool commandedTypes) {
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"You can view spell types by ID or shortname: {}, {}, {} / {}, {}, {}",
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypeids 0-19"), "ID 0-19"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypeids 20-39"), "20-39"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypeids 40+"), "40+"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypenames 0-19"), "Shortname 0-19"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypenames 20-39"), "20-39"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypenames 40+"), "40+"
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
if (commandedTypes) {
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"You can view commanded spell types by ID or shortname: {} / {}",
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypeids commanded"), "ID"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypenames commanded"), "Shortname"
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void SendSpellTypeWindow(Client *c, const Seperator* sep) {
|
||||
void SendSpellTypeWindow(Client* c, const Seperator* sep) {
|
||||
std::string arg0 = sep->arg[0];
|
||||
std::string arg1 = sep->arg[1];
|
||||
|
||||
uint8 minCount = 0;
|
||||
uint8 maxCount = 0;
|
||||
bool clientOnly = false;
|
||||
|
||||
if (BotSpellTypes::END <= 19) {
|
||||
minCount = BotSpellTypes::START;
|
||||
@@ -2173,6 +2128,11 @@ void SendSpellTypeWindow(Client *c, const Seperator* sep) {
|
||||
minCount = BotSpellTypes::COMMANDED_START;
|
||||
maxCount = BotSpellTypes::COMMANDED_END;
|
||||
}
|
||||
else if (!arg1.compare("client")) {
|
||||
minCount = BotSpellTypes::START;
|
||||
maxCount = BotSpellTypes::END;
|
||||
clientOnly = true;
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::Yellow, "You must choose a valid range option");
|
||||
|
||||
@@ -2222,6 +2182,10 @@ void SendSpellTypeWindow(Client *c, const Seperator* sep) {
|
||||
);
|
||||
|
||||
for (int i = minCount; i <= maxCount; ++i) {
|
||||
if (clientOnly && !IsClientBotSpellType(i)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
popup_text += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
@@ -2270,7 +2234,6 @@ void SendSpellTypeWindow(Client *c, const Seperator* sep) {
|
||||
#include "bot_commands/illusion_block.cpp"
|
||||
#include "bot_commands/inventory.cpp"
|
||||
#include "bot_commands/item_use.cpp"
|
||||
#include "bot_commands/lull.cpp"
|
||||
#include "bot_commands/max_melee_range.cpp"
|
||||
#include "bot_commands/name.cpp"
|
||||
#include "bot_commands/owner_option.cpp"
|
||||
@@ -2299,7 +2262,6 @@ void SendSpellTypeWindow(Client *c, const Seperator* sep) {
|
||||
#include "bot_commands/spell_target_count.cpp"
|
||||
#include "bot_commands/spelltypes.cpp"
|
||||
#include "bot_commands/summon.cpp"
|
||||
#include "bot_commands/summon_corpse.cpp"
|
||||
#include "bot_commands/suspend.cpp"
|
||||
#include "bot_commands/taunt.cpp"
|
||||
#include "bot_commands/timer.cpp"
|
||||
|
||||
+2
-4
@@ -1688,7 +1688,6 @@ void bot_command_hold(Client *c, const Seperator *sep);
|
||||
void bot_command_illusion_block(Client* c, const Seperator* sep);
|
||||
void bot_command_inventory(Client *c, const Seperator *sep);
|
||||
void bot_command_item_use(Client *c, const Seperator *sep);
|
||||
void bot_command_lull(Client *c, const Seperator *sep);
|
||||
void bot_command_max_melee_range(Client* c, const Seperator* sep);
|
||||
void bot_command_owner_option(Client *c, const Seperator *sep);
|
||||
void bot_command_pet(Client *c, const Seperator *sep);
|
||||
@@ -1723,7 +1722,6 @@ void bot_command_spelltype_ids(Client* c, const Seperator* sep);
|
||||
void bot_command_spelltype_names(Client* c, const Seperator* sep);
|
||||
void bot_spell_info_dialogue_window(Client* c, const Seperator *sep);
|
||||
void bot_command_enforce_spell_list(Client* c, const Seperator* sep);
|
||||
void bot_command_summon_corpse(Client *c, const Seperator *sep);
|
||||
void bot_command_suspend(Client *c, const Seperator *sep);
|
||||
void bot_command_taunt(Client *c, const Seperator *sep);
|
||||
void bot_command_timer(Client* c, const Seperator* sep);
|
||||
@@ -1807,6 +1805,6 @@ void helper_send_available_subcommands(Client *bot_owner, const char* command_si
|
||||
void helper_send_usage_required_bots(Client *bot_owner, BCEnum::SpType spell_type, uint8 bot_class = Class::None);
|
||||
bool helper_spell_check_fail(STBaseEntry* local_entry);
|
||||
bool helper_spell_list_fail(Client *bot_owner, bcst_list* spell_list, BCEnum::SpType spell_type);
|
||||
void SendSpellTypePrompts(Client *c, bool commandedTypes = false);
|
||||
void SendSpellTypeWindow(Client *c, const Seperator* sep);
|
||||
void SendSpellTypeWindow(Client* c, const Seperator* sep);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -94,7 +94,7 @@ void bot_command_cast(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c, true);
|
||||
c->SendSpellTypePrompts(true);
|
||||
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
|
||||
@@ -97,7 +97,7 @@ void bot_command_copy_settings(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -91,7 +91,7 @@ void bot_command_default_settings(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#include "../bot_command.h"
|
||||
|
||||
void bot_command_lull(Client *c, const Seperator *sep)
|
||||
{
|
||||
bcst_list* local_list = &bot_command_spells[BCEnum::SpT_Lull];
|
||||
if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Lull) || helper_command_alias_fail(c, "bot_command_lull", sep->arg[0], "lull"))
|
||||
return;
|
||||
if (helper_is_help_or_usage(sep->arg[1])) {
|
||||
c->Message(Chat::White, "usage: <enemy_target> %s", sep->arg[0]);
|
||||
helper_send_usage_required_bots(c, BCEnum::SpT_Lull);
|
||||
return;
|
||||
}
|
||||
|
||||
ActionableTarget::Types actionable_targets;
|
||||
Bot* my_bot = nullptr;
|
||||
std::list<Bot*> sbl;
|
||||
MyBots::PopulateSBL_BySpawnedBots(c, sbl);
|
||||
|
||||
for (auto list_iter : *local_list) {
|
||||
auto local_entry = list_iter;
|
||||
if (helper_spell_check_fail(local_entry))
|
||||
continue;
|
||||
|
||||
auto target_mob = actionable_targets.Select(c, local_entry->target_type, ENEMY);
|
||||
if (!target_mob)
|
||||
continue;
|
||||
|
||||
//if (spells[local_entry->spell_id].max[EFFECTIDTOINDEX(3)] && spells[local_entry->spell_id].max[EFFECTIDTOINDEX(3)] < target_mob->GetLevel())
|
||||
// continue;
|
||||
|
||||
my_bot = ActionableBots::Select_ByMinLevelAndClass(c, local_entry->target_type, sbl, local_entry->spell_level, local_entry->caster_class, target_mob);
|
||||
if (!my_bot)
|
||||
continue;
|
||||
|
||||
uint32 dont_root_before = 0;
|
||||
if (helper_cast_standard_spell(my_bot, target_mob, local_entry->spell_id, true, &dont_root_before))
|
||||
target_mob->SetDontRootMeBefore(dont_root_before);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
helper_no_available_bots(c, my_bot);
|
||||
}
|
||||
@@ -92,7 +92,7 @@ void bot_command_spell_aggro_checks(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -98,7 +98,7 @@ void bot_command_spell_delays(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -96,7 +96,7 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -82,7 +82,7 @@ void bot_command_spell_holds(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -96,7 +96,7 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -92,7 +92,7 @@ void bot_command_spell_max_hp_pct(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -92,7 +92,7 @@ void bot_command_spell_max_mana_pct(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -98,7 +98,7 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -92,7 +92,7 @@ void bot_command_spell_min_hp_pct(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -92,7 +92,7 @@ void bot_command_spell_min_mana_pct(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -100,7 +100,7 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -96,7 +96,7 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -92,7 +92,7 @@ void bot_command_spell_target_count(Client* c, const Seperator* sep)
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
SendSpellTypePrompts(c);
|
||||
c->SendSpellTypePrompts();
|
||||
|
||||
if (RuleB(Bots, SendClassRaceOnHelp)) {
|
||||
c->Message(
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#include "../bot_command.h"
|
||||
|
||||
void bot_command_summon_corpse(Client *c, const Seperator *sep)
|
||||
{
|
||||
// Same methodology as old command..but, does not appear to work... (note: didn't work there, either...)
|
||||
|
||||
// temp
|
||||
c->Message(Chat::White, "This command is currently unavailable...");
|
||||
return;
|
||||
|
||||
bcst_list* local_list = &bot_command_spells[BCEnum::SpT_SummonCorpse];
|
||||
if (helper_spell_list_fail(c, local_list, BCEnum::SpT_SummonCorpse) || helper_command_alias_fail(c, "bot_command_summon_corpse", sep->arg[0], "summoncorpse"))
|
||||
return;
|
||||
if (helper_is_help_or_usage(sep->arg[1])) {
|
||||
c->Message(Chat::White, "usage: <friendly_target> %s", sep->arg[0]);
|
||||
helper_send_usage_required_bots(c, BCEnum::SpT_SummonCorpse);
|
||||
return;
|
||||
}
|
||||
|
||||
Bot* my_bot = nullptr;
|
||||
std::list<Bot*> sbl;
|
||||
MyBots::PopulateSBL_BySpawnedBots(c, sbl);
|
||||
|
||||
bool cast_success = false;
|
||||
for (auto list_iter : *local_list) {
|
||||
auto local_entry = list_iter;
|
||||
if (helper_spell_check_fail(local_entry))
|
||||
continue;
|
||||
|
||||
auto target_mob = ActionableTarget::AsSingle_ByPlayer(c);
|
||||
if (!target_mob)
|
||||
continue;
|
||||
|
||||
if (spells[local_entry->spell_id].base_value[EFFECTIDTOINDEX(1)] < target_mob->GetLevel())
|
||||
continue;
|
||||
|
||||
my_bot = ActionableBots::Select_ByMinLevelAndClass(c, local_entry->target_type, sbl, local_entry->spell_level, local_entry->caster_class, target_mob);
|
||||
if (!my_bot)
|
||||
continue;
|
||||
|
||||
cast_success = helper_cast_standard_spell(my_bot, target_mob, local_entry->spell_id);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
helper_no_available_bots(c, my_bot);
|
||||
}
|
||||
@@ -13338,3 +13338,63 @@ std::string Client::SplitCommandHelpText(std::vector<std::string> msg, std::stri
|
||||
|
||||
return returnText;
|
||||
}
|
||||
|
||||
void Client::SendSpellTypePrompts(bool commandedTypes, bool clientOnlyTypes) {
|
||||
if (clientOnlyTypes) {
|
||||
Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"You can view spell types by {} or {}.",
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypeids client"), "ID"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypenames client"), "Shortname"
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"You can view spell types by {}, {}, {} or by {}, {}, {}.",
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypeids 0-19"), "ID 0-19"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypeids 20-39"), "20-39"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypeids 40+"), "40+"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypenames 0-19"), "Shortname 0-19"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypenames 20-39"), "20-39"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypenames 40+"), "40+"
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
if (commandedTypes) {
|
||||
Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"You can view commanded spell types by {} or {}.",
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypeids commanded"), "ID"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("^spelltypenames commanded"), "Shortname"
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1263,6 +1263,7 @@ public:
|
||||
);
|
||||
std::string GetCommandHelpHeader(std::string color, std::string header);
|
||||
std::string SplitCommandHelpText(std::vector<std::string> msg, std::string color, uint16 maxLength, bool secondColor = false, std::string secondaryColor = "");
|
||||
void SendSpellTypePrompts(bool commandedTypes = false, bool clientOnlyTypes = false);
|
||||
|
||||
// Task System Methods
|
||||
void LoadClientTaskState();
|
||||
|
||||
+1
-1
@@ -219,7 +219,7 @@ int command_init(void)
|
||||
command_add("spawneditmass", "[Search Criteria] [Edit Option] [Edit Value] [Apply] Mass editing spawn command (Apply is optional, 0 = False, 1 = True, default is False)", AccountStatus::GMLeadAdmin, command_spawneditmass) ||
|
||||
command_add("spawnfix", "Find targeted NPC in database based on its X/Y/heading and update the database to make it spawn at your current location/heading.", AccountStatus::GMAreas, command_spawnfix) ||
|
||||
command_add("spelldelays", "Controls the delay between casts for a specific spell type", AccountStatus::Player, command_spell_delays) ||
|
||||
command_add("spellholds", "Controls whether a bot holds the specified spell type or not", AccountStatus::Player, command_spell_holds) ||
|
||||
//command_add("spellholds", "Controls whether a bot holds the specified spell type or not", AccountStatus::Player, command_spell_holds) || //currently unusued
|
||||
command_add("spellmaxthresholds", "Controls the minimum target HP threshold for a spell to be cast for a specific type", AccountStatus::Player, command_spell_max_thresholds) ||
|
||||
command_add("spellminthresholds", "Controls the maximum target HP threshold for a spell to be cast for a specific type", AccountStatus::Player, command_spell_min_thresholds) ||
|
||||
command_add("stun", "[duration] - Stuns you or your target for duration", AccountStatus::GMAdmin, command_stun) ||
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ void command_spawn(Client *c, const Seperator *sep);
|
||||
void command_spawneditmass(Client *c, const Seperator *sep);
|
||||
void command_spawnfix(Client *c, const Seperator *sep);
|
||||
void command_spell_delays(Client* c, const Seperator* sep);
|
||||
void command_spell_holds(Client* c, const Seperator* sep);
|
||||
//void command_spell_holds(Client* c, const Seperator* sep); //currently unusued
|
||||
void command_spell_max_thresholds(Client* c, const Seperator* sep);
|
||||
void command_spell_min_thresholds(Client* c, const Seperator* sep);
|
||||
void command_stun(Client *c, const Seperator *sep);
|
||||
|
||||
@@ -7,101 +7,85 @@ void command_spell_delays(Client* c, const Seperator* sep)
|
||||
const bool is_help = !strcasecmp(sep->arg[1], "help");
|
||||
|
||||
if (is_help) {
|
||||
c->Message(Chat::White, "usage: %s [spelltype ID | spelltype Shortname] [current | value: 0-1].", sep->arg[0]);
|
||||
c->Message(Chat::White, "example: [%s 15 4000] or [%s cures 4000] would allow bots to cast cures on you every 4 seconds.", sep->arg[0], sep->arg[0]);
|
||||
c->Message(Chat::White, "note: Use [current] to check your current setting.");
|
||||
c->Message(
|
||||
Chat::White,
|
||||
std::vector<std::string> description =
|
||||
{
|
||||
"Controls how often bots can cast certain spell types on you"
|
||||
};
|
||||
|
||||
std::vector<std::string> notes =
|
||||
{
|
||||
"- All pet types are control your how your pet will be affected"
|
||||
};
|
||||
|
||||
std::vector<std::string> example_format =
|
||||
{
|
||||
fmt::format(
|
||||
"note: Use {} for a list of spell types by ID or {} for a list of spell types by short name.",
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listid", sep->arg[0])
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listname", sep->arg[0])
|
||||
)
|
||||
).c_str()
|
||||
"{} [Type Shortname] [value]"
|
||||
, sep->arg[0]
|
||||
),
|
||||
fmt::format(
|
||||
"{} [Type ID] [value]"
|
||||
, sep->arg[0]
|
||||
)
|
||||
};
|
||||
std::vector<std::string> examples_one =
|
||||
{
|
||||
"To set Very Fast Heals to be received every 1 second:",
|
||||
fmt::format(
|
||||
"{} {} 1000",
|
||||
sep->arg[0],
|
||||
c->GetSpellTypeShortNameByID(BotSpellTypes::VeryFastHeals)
|
||||
),
|
||||
fmt::format(
|
||||
"{} {} 1000",
|
||||
sep->arg[0],
|
||||
BotSpellTypes::VeryFastHeals
|
||||
)
|
||||
};
|
||||
std::vector<std::string> examples_two =
|
||||
{
|
||||
"To check your current Regular Heal delay:",
|
||||
fmt::format(
|
||||
"{} {} current",
|
||||
sep->arg[0],
|
||||
c->GetSpellTypeShortNameByID(BotSpellTypes::RegularHeal)
|
||||
),
|
||||
fmt::format(
|
||||
"{} {} current",
|
||||
sep->arg[0],
|
||||
BotSpellTypes::RegularHeal
|
||||
)
|
||||
};
|
||||
std::vector<std::string> examples_three = { };
|
||||
|
||||
std::vector<std::string> actionables = { };
|
||||
|
||||
std::vector<std::string> options = { };
|
||||
std::vector<std::string> options_one = { };
|
||||
std::vector<std::string> options_two = { };
|
||||
std::vector<std::string> 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
|
||||
);
|
||||
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
std::string arg1 = sep->arg[1];
|
||||
|
||||
if (!arg1.compare("listid") || !arg1.compare("listname")) {
|
||||
const std::string& color_red = "red_1";
|
||||
const std::string& color_blue = "royal_blue";
|
||||
const std::string& color_green = "forest_green";
|
||||
const std::string& bright_green = "green";
|
||||
const std::string& bright_red = "red";
|
||||
const std::string& heroic_color = "gold";
|
||||
|
||||
std::string fillerLine = "-----------";
|
||||
std::string spellTypeField = "Spell Type";
|
||||
std::string pluralS = "s";
|
||||
std::string idField = "ID";
|
||||
std::string shortnameField = "Short Name";
|
||||
|
||||
std::string popup_text = DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
DialogueWindow::ColorMessage(bright_green, spellTypeField)
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
(!arg1.compare("listid") ? DialogueWindow::ColorMessage(bright_green, idField) : DialogueWindow::ColorMessage(bright_green, shortnameField))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_text += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
DialogueWindow::ColorMessage(heroic_color, fillerLine)
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
DialogueWindow::ColorMessage(heroic_color, fillerLine)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
for (int i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
|
||||
if (!IsClientBotSpellType(i)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
popup_text += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}{}",
|
||||
DialogueWindow::ColorMessage(color_green, c->GetSpellTypeNameByID(i)),
|
||||
DialogueWindow::ColorMessage(color_green, pluralS)
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
(!arg1.compare("listid") ? DialogueWindow::ColorMessage(color_blue, std::to_string(i)) : DialogueWindow::ColorMessage(color_blue, c->GetSpellTypeShortNameByID(i)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient("Spell Types", popup_text.c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
std::string arg2 = sep->arg[2];
|
||||
int ab_arg = 2;
|
||||
bool current_check = false;
|
||||
@@ -112,18 +96,8 @@ void command_spell_delays(Client* c, const Seperator* sep)
|
||||
spellType = atoi(sep->arg[1]);
|
||||
|
||||
if (!IsClientBotSpellType(spellType)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You must choose a valid spell type. Use {} for a list of spell types by ID or {} for a list of spell types by short name.",
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listid", sep->arg[0])
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listname", sep->arg[0])
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
c->Message(Chat::Yellow, "Invalid spell type.");
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -133,20 +107,8 @@ void command_spell_delays(Client* c, const Seperator* sep)
|
||||
spellType = c->GetSpellTypeIDByShortName(arg1);
|
||||
|
||||
if (!IsClientBotSpellType(spellType)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You must choose a valid spell type. Use {} for a list of spell types by ID or {} for a list of spell types by short name.",
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listid", sep->arg[0])
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listname", sep->arg[0])
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
c->Message(Chat::Yellow, "Invalid spell type.");
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -164,10 +126,11 @@ void command_spell_delays(Client* c, const Seperator* sep)
|
||||
}
|
||||
}
|
||||
|
||||
// Enable/Disable/Current checks
|
||||
if (sep->IsNumber(2)) {
|
||||
typeValue = atoi(sep->arg[2]);
|
||||
++ab_arg;
|
||||
if (typeValue < 1 || typeValue > 60000) {
|
||||
if (typeValue < 0 || typeValue > 60000) {
|
||||
c->Message(Chat::Yellow, "You must enter a value between 1-60000 (1ms to 60s).");
|
||||
|
||||
return;
|
||||
@@ -195,18 +158,18 @@ void command_spell_delays(Client* c, const Seperator* sep)
|
||||
c->Message(
|
||||
Chat::Green,
|
||||
fmt::format(
|
||||
"Your current {} delay is {} seconds.",
|
||||
"Your [{}] delay is currently {} seconds.'",
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
c->GetSpellDelay(spellType) / 1000.00
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
c->SetSpellDelay(spellType, typeValue);
|
||||
c->SetSpellHold(spellType, typeValue);
|
||||
c->Message(
|
||||
Chat::Green,
|
||||
fmt::format(
|
||||
"Your {} delay was set to {} seconds.",
|
||||
"Your [{}] delay was set to {} seconds.'",
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
c->GetSpellDelay(spellType) / 1000.00
|
||||
).c_str()
|
||||
|
||||
@@ -2,108 +2,94 @@
|
||||
|
||||
void command_spell_holds(Client *c, const Seperator *sep)
|
||||
{
|
||||
//unused for clients
|
||||
c->Message(Chat::Yellow, "Spell Holds for players is currently unused.");
|
||||
return;
|
||||
|
||||
const int arguments = sep->argnum;
|
||||
if (arguments) {
|
||||
const bool is_help = !strcasecmp(sep->arg[1], "help");
|
||||
|
||||
if (is_help) {
|
||||
c->Message(Chat::White, "usage: %s [spelltype ID | spelltype Shortname] [current | value: 0-1].", sep->arg[0]);
|
||||
c->Message(Chat::White, "example: [%s 15 1] or [%s cures 1] would prevent bots from casting cures on you.", sep->arg[0], sep->arg[0]);
|
||||
c->Message(Chat::White, "note: Use [current] to check your current setting.");
|
||||
c->Message(Chat::White, "note: Set to 0 to unhold the given spell type.");
|
||||
c->Message(Chat::White, "note: Set to 1 to hold the given spell type.");
|
||||
c->Message(
|
||||
Chat::White,
|
||||
std::vector<std::string> description =
|
||||
{
|
||||
"Toggles whether or not bots can cast certain spell types on you"
|
||||
};
|
||||
|
||||
std::vector<std::string> notes =
|
||||
{
|
||||
"- All pet types are control your how your pet will be affected"
|
||||
};
|
||||
|
||||
std::vector<std::string> example_format =
|
||||
{
|
||||
fmt::format(
|
||||
"note: Use {} for a list of spell types by ID or {} for a list of spell types by short name.",
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listid", sep->arg[0])
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listname", sep->arg[0])
|
||||
)
|
||||
).c_str()
|
||||
"{} [Type Shortname] [value]"
|
||||
, sep->arg[0]
|
||||
),
|
||||
fmt::format(
|
||||
"{} [Type ID] [value]"
|
||||
, sep->arg[0]
|
||||
)
|
||||
};
|
||||
std::vector<std::string> examples_one =
|
||||
{
|
||||
"To set DoTs to be held:",
|
||||
fmt::format(
|
||||
"{} {} 1",
|
||||
sep->arg[0],
|
||||
c->GetSpellTypeShortNameByID(BotSpellTypes::DOT)
|
||||
),
|
||||
fmt::format(
|
||||
"{} {} 1",
|
||||
sep->arg[0],
|
||||
BotSpellTypes::DOT
|
||||
)
|
||||
};
|
||||
std::vector<std::string> examples_two =
|
||||
{
|
||||
"To check your current DoT settings:",
|
||||
fmt::format(
|
||||
"{} {} current",
|
||||
sep->arg[0],
|
||||
c->GetSpellTypeShortNameByID(BotSpellTypes::DOT)
|
||||
),
|
||||
fmt::format(
|
||||
"{} {} current",
|
||||
sep->arg[0],
|
||||
BotSpellTypes::DOT
|
||||
)
|
||||
};
|
||||
std::vector<std::string> examples_three = { };
|
||||
|
||||
std::vector<std::string> actionables = { };
|
||||
|
||||
std::vector<std::string> options = { };
|
||||
std::vector<std::string> options_one = { };
|
||||
std::vector<std::string> options_two = { };
|
||||
std::vector<std::string> 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
|
||||
);
|
||||
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
std::string arg1 = sep->arg[1];
|
||||
|
||||
if (!arg1.compare("listid") || !arg1.compare("listname")) {
|
||||
const std::string& color_red = "red_1";
|
||||
const std::string& color_blue = "royal_blue";
|
||||
const std::string& color_green = "forest_green";
|
||||
const std::string& bright_green = "green";
|
||||
const std::string& bright_red = "red";
|
||||
const std::string& heroic_color = "gold";
|
||||
|
||||
std::string fillerLine = "-----------";
|
||||
std::string spellTypeField = "Spell Type";
|
||||
std::string pluralS = "s";
|
||||
std::string idField = "ID";
|
||||
std::string shortnameField = "Short Name";
|
||||
|
||||
std::string popup_text = DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
DialogueWindow::ColorMessage(bright_green, spellTypeField)
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
(!arg1.compare("listid") ? DialogueWindow::ColorMessage(bright_green, idField) : DialogueWindow::ColorMessage(bright_green, shortnameField))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_text += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
DialogueWindow::ColorMessage(heroic_color, fillerLine)
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
DialogueWindow::ColorMessage(heroic_color, fillerLine)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
for (int i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
|
||||
if (!IsClientBotSpellType(i)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
popup_text += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}{}",
|
||||
DialogueWindow::ColorMessage(color_green, c->GetSpellTypeNameByID(i)),
|
||||
DialogueWindow::ColorMessage(color_green, pluralS)
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
(!arg1.compare("listid") ? DialogueWindow::ColorMessage(color_blue, std::to_string(i)) : DialogueWindow::ColorMessage(color_blue, c->GetSpellTypeShortNameByID(i)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient("Spell Types", popup_text.c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
std::string arg2 = sep->arg[2];
|
||||
int ab_arg = 2;
|
||||
bool current_check = false;
|
||||
@@ -114,18 +100,8 @@ void command_spell_holds(Client *c, const Seperator *sep)
|
||||
spellType = atoi(sep->arg[1]);
|
||||
|
||||
if (!IsClientBotSpellType(spellType)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You must choose a valid spell type. Use {} for a list of spell types by ID or {} for a list of spell types by short name.",
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listid", sep->arg[0])
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listname", sep->arg[0])
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
c->Message(Chat::Yellow, "Invalid spell type.");
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -135,20 +111,8 @@ void command_spell_holds(Client *c, const Seperator *sep)
|
||||
spellType = c->GetSpellTypeIDByShortName(arg1);
|
||||
|
||||
if (!IsClientBotSpellType(spellType)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You must choose a valid spell type. Use {} for a list of spell types by ID or {} for a list of spell types by short name.",
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listid", sep->arg[0])
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listname", sep->arg[0])
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
c->Message(Chat::Yellow, "Invalid spell type.");
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -198,7 +162,7 @@ void command_spell_holds(Client *c, const Seperator *sep)
|
||||
c->Message(
|
||||
Chat::Green,
|
||||
fmt::format(
|
||||
"Your current Hold {}s status is {}.",
|
||||
"Your [{}] spell hold is currently [{}].'",
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
c->GetSpellHold(spellType) ? "enabled" : "disabled"
|
||||
).c_str()
|
||||
@@ -209,7 +173,7 @@ void command_spell_holds(Client *c, const Seperator *sep)
|
||||
c->Message(
|
||||
Chat::Green,
|
||||
fmt::format(
|
||||
"Your Hold {}s status was {}.",
|
||||
"Your [{}] spell hold was [{}].'",
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
c->GetSpellHold(spellType) ? "enabled" : "disabled"
|
||||
).c_str()
|
||||
|
||||
@@ -7,101 +7,85 @@ void command_spell_max_thresholds(Client* c, const Seperator* sep)
|
||||
const bool is_help = !strcasecmp(sep->arg[1], "help");
|
||||
|
||||
if (is_help) {
|
||||
c->Message(Chat::White, "usage: %s [spelltype ID | spelltype Shortname] [current | value: 0-1].", sep->arg[0]);
|
||||
c->Message(Chat::White, "example: [%s 15 95] or [%s cures 95] would allow bots to cast cures on you when you are under 95%% health.", sep->arg[0], sep->arg[0]);
|
||||
c->Message(Chat::White, "note: Use [current] to check your current setting.");
|
||||
c->Message(
|
||||
Chat::White,
|
||||
std::vector<std::string> description =
|
||||
{
|
||||
"Threshold of your own health when bots will start casting the chosen spell type"
|
||||
};
|
||||
|
||||
std::vector<std::string> notes =
|
||||
{
|
||||
"- All pet types are control your how your pet will be affected"
|
||||
};
|
||||
|
||||
std::vector<std::string> example_format =
|
||||
{
|
||||
fmt::format(
|
||||
"note: Use {} for a list of spell types by ID or {} for a list of spell types by short name.",
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listid", sep->arg[0])
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listname", sep->arg[0])
|
||||
)
|
||||
).c_str()
|
||||
"{} [Type Shortname] [value]"
|
||||
, sep->arg[0]
|
||||
),
|
||||
fmt::format(
|
||||
"{} [Type ID] [value]"
|
||||
, sep->arg[0]
|
||||
)
|
||||
};
|
||||
std::vector<std::string> examples_one =
|
||||
{
|
||||
"To set Complete Heals to start at 90% health:",
|
||||
fmt::format(
|
||||
"{} {} 90",
|
||||
sep->arg[0],
|
||||
c->GetSpellTypeShortNameByID(BotSpellTypes::CompleteHeal)
|
||||
),
|
||||
fmt::format(
|
||||
"{} {} 90",
|
||||
sep->arg[0],
|
||||
BotSpellTypes::CompleteHeal
|
||||
)
|
||||
};
|
||||
std::vector<std::string> examples_two =
|
||||
{
|
||||
"To check your current HoT Heal settings:",
|
||||
fmt::format(
|
||||
"{} {} current",
|
||||
sep->arg[0],
|
||||
c->GetSpellTypeShortNameByID(BotSpellTypes::HoTHeals)
|
||||
),
|
||||
fmt::format(
|
||||
"{} {} current",
|
||||
sep->arg[0],
|
||||
BotSpellTypes::HoTHeals
|
||||
)
|
||||
};
|
||||
std::vector<std::string> examples_three = { };
|
||||
|
||||
std::vector<std::string> actionables = { };
|
||||
|
||||
std::vector<std::string> options = { };
|
||||
std::vector<std::string> options_one = { };
|
||||
std::vector<std::string> options_two = { };
|
||||
std::vector<std::string> 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
|
||||
);
|
||||
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
std::string arg1 = sep->arg[1];
|
||||
|
||||
if (!arg1.compare("listid") || !arg1.compare("listname")) {
|
||||
const std::string& color_red = "red_1";
|
||||
const std::string& color_blue = "royal_blue";
|
||||
const std::string& color_green = "forest_green";
|
||||
const std::string& bright_green = "green";
|
||||
const std::string& bright_red = "red";
|
||||
const std::string& heroic_color = "gold";
|
||||
|
||||
std::string fillerLine = "-----------";
|
||||
std::string spellTypeField = "Spell Type";
|
||||
std::string pluralS = "s";
|
||||
std::string idField = "ID";
|
||||
std::string shortnameField = "Short Name";
|
||||
|
||||
std::string popup_text = DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
DialogueWindow::ColorMessage(bright_green, spellTypeField)
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
(!arg1.compare("listid") ? DialogueWindow::ColorMessage(bright_green, idField) : DialogueWindow::ColorMessage(bright_green, shortnameField))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_text += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
DialogueWindow::ColorMessage(heroic_color, fillerLine)
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
DialogueWindow::ColorMessage(heroic_color, fillerLine)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
for (int i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
|
||||
if (!IsClientBotSpellType(i)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
popup_text += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}{}",
|
||||
DialogueWindow::ColorMessage(color_green, c->GetSpellTypeNameByID(i)),
|
||||
DialogueWindow::ColorMessage(color_green, pluralS)
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
(!arg1.compare("listid") ? DialogueWindow::ColorMessage(color_blue, std::to_string(i)) : DialogueWindow::ColorMessage(color_blue, c->GetSpellTypeShortNameByID(i)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient("Spell Types", popup_text.c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
std::string arg2 = sep->arg[2];
|
||||
int ab_arg = 2;
|
||||
bool current_check = false;
|
||||
@@ -112,18 +96,8 @@ void command_spell_max_thresholds(Client* c, const Seperator* sep)
|
||||
spellType = atoi(sep->arg[1]);
|
||||
|
||||
if (!IsClientBotSpellType(spellType)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You must choose a valid spell type. Use {} for a list of spell types by ID or {} for a list of spell types by short name.",
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listid", sep->arg[0])
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listname", sep->arg[0])
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
c->Message(Chat::Yellow, "Invalid spell type.");
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -133,20 +107,8 @@ void command_spell_max_thresholds(Client* c, const Seperator* sep)
|
||||
spellType = c->GetSpellTypeIDByShortName(arg1);
|
||||
|
||||
if (!IsClientBotSpellType(spellType)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You must choose a valid spell type. Use {} for a list of spell types by ID or {} for a list of spell types by short name.",
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listid", sep->arg[0])
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listname", sep->arg[0])
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
c->Message(Chat::Yellow, "Invalid spell type.");
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -168,8 +130,8 @@ void command_spell_max_thresholds(Client* c, const Seperator* sep)
|
||||
if (sep->IsNumber(2)) {
|
||||
typeValue = atoi(sep->arg[2]);
|
||||
++ab_arg;
|
||||
if (typeValue < 0 || typeValue > 150) {
|
||||
c->Message(Chat::Yellow, "You must enter a value between 0-150 (0%% to 150%% of health).");
|
||||
if (typeValue < 0 || typeValue > 100) {
|
||||
c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of your health).");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -196,18 +158,18 @@ void command_spell_max_thresholds(Client* c, const Seperator* sep)
|
||||
c->Message(
|
||||
Chat::Green,
|
||||
fmt::format(
|
||||
"Your current max threshold for {}s is {}%%.",
|
||||
"Your [{}] maximum hold is currently [{}]%%.'",
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
c->GetSpellMaxThreshold(spellType)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
c->SetSpellMaxThreshold(spellType, typeValue);
|
||||
c->SetSpellHold(spellType, typeValue);
|
||||
c->Message(
|
||||
Chat::Green,
|
||||
fmt::format(
|
||||
"Your max threshold for {}s was set to {}%%.",
|
||||
"Your [{}] maximum hold was set to [{}]%%.'",
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
c->GetSpellMaxThreshold(spellType)
|
||||
).c_str()
|
||||
|
||||
@@ -7,101 +7,85 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep)
|
||||
const bool is_help = !strcasecmp(sep->arg[1], "help");
|
||||
|
||||
if (is_help) {
|
||||
c->Message(Chat::White, "usage: %s [spelltype ID | spelltype Shortname] [current | value: 0-1].", sep->arg[0]);
|
||||
c->Message(Chat::White, "example: [%s 15 15] or [%s cures 15] would prevent bots from casting cures on you when you are under 15%% health.", sep->arg[0], sep->arg[0]);
|
||||
c->Message(Chat::White, "note: Use [current] to check your current setting.");
|
||||
c->Message(
|
||||
Chat::White,
|
||||
std::vector<std::string> description =
|
||||
{
|
||||
"Threshold of your own health when bots will stop casting the chosen spell type"
|
||||
};
|
||||
|
||||
std::vector<std::string> notes =
|
||||
{
|
||||
"- All pet types are control your how your pet will be affected"
|
||||
};
|
||||
|
||||
std::vector<std::string> example_format =
|
||||
{
|
||||
fmt::format(
|
||||
"note: Use {} for a list of spell types by ID or {} for a list of spell types by short name.",
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listid", sep->arg[0])
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listname", sep->arg[0])
|
||||
)
|
||||
).c_str()
|
||||
"{} [Type Shortname] [value]"
|
||||
, sep->arg[0]
|
||||
),
|
||||
fmt::format(
|
||||
"{} [Type ID] [value]"
|
||||
, sep->arg[0]
|
||||
)
|
||||
};
|
||||
std::vector<std::string> examples_one =
|
||||
{
|
||||
"To set Fast Heals to be stopped at 65% health:",
|
||||
fmt::format(
|
||||
"{} {} 65",
|
||||
sep->arg[0],
|
||||
c->GetSpellTypeShortNameByID(BotSpellTypes::FastHeals)
|
||||
),
|
||||
fmt::format(
|
||||
"{} {} 65",
|
||||
sep->arg[0],
|
||||
BotSpellTypes::FastHeals
|
||||
)
|
||||
};
|
||||
std::vector<std::string> examples_two =
|
||||
{
|
||||
"To check your current Cure settings:",
|
||||
fmt::format(
|
||||
"{} {} current",
|
||||
sep->arg[0],
|
||||
c->GetSpellTypeShortNameByID(BotSpellTypes::Cure)
|
||||
),
|
||||
fmt::format(
|
||||
"{} {} current",
|
||||
sep->arg[0],
|
||||
BotSpellTypes::Cure
|
||||
)
|
||||
};
|
||||
std::vector<std::string> examples_three = { };
|
||||
|
||||
std::vector<std::string> actionables = { };
|
||||
|
||||
std::vector<std::string> options = { };
|
||||
std::vector<std::string> options_one = { };
|
||||
std::vector<std::string> options_two = { };
|
||||
std::vector<std::string> 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
|
||||
);
|
||||
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
std::string arg1 = sep->arg[1];
|
||||
|
||||
if (!arg1.compare("listid") || !arg1.compare("listname")) {
|
||||
const std::string& color_red = "red_1";
|
||||
const std::string& color_blue = "royal_blue";
|
||||
const std::string& color_green = "forest_green";
|
||||
const std::string& bright_green = "green";
|
||||
const std::string& bright_red = "red";
|
||||
const std::string& heroic_color = "gold";
|
||||
|
||||
std::string fillerLine = "-----------";
|
||||
std::string spellTypeField = "Spell Type";
|
||||
std::string pluralS = "s";
|
||||
std::string idField = "ID";
|
||||
std::string shortnameField = "Short Name";
|
||||
|
||||
std::string popup_text = DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
DialogueWindow::ColorMessage(bright_green, spellTypeField)
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
(!arg1.compare("listid") ? DialogueWindow::ColorMessage(bright_green, idField) : DialogueWindow::ColorMessage(bright_green, shortnameField))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_text += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
DialogueWindow::ColorMessage(heroic_color, fillerLine)
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
DialogueWindow::ColorMessage(heroic_color, fillerLine)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
for (int i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
|
||||
if (!IsClientBotSpellType(i)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
popup_text += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}{}",
|
||||
DialogueWindow::ColorMessage(color_green, c->GetSpellTypeNameByID(i)),
|
||||
DialogueWindow::ColorMessage(color_green, pluralS)
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{}",
|
||||
(!arg1.compare("listid") ? DialogueWindow::ColorMessage(color_blue, std::to_string(i)) : DialogueWindow::ColorMessage(color_blue, c->GetSpellTypeShortNameByID(i)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
popup_text = DialogueWindow::Table(popup_text);
|
||||
|
||||
c->SendPopupToClient("Spell Types", popup_text.c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
std::string arg2 = sep->arg[2];
|
||||
int ab_arg = 2;
|
||||
bool current_check = false;
|
||||
@@ -112,18 +96,8 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep)
|
||||
spellType = atoi(sep->arg[1]);
|
||||
|
||||
if (!IsClientBotSpellType(spellType)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You must choose a valid spell type. Use {} for a list of spell types by ID or {} for a list of spell types by short name.",
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listid", sep->arg[0])
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listname", sep->arg[0])
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
c->Message(Chat::Yellow, "Invalid spell type.");
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -133,20 +107,8 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep)
|
||||
spellType = c->GetSpellTypeIDByShortName(arg1);
|
||||
|
||||
if (!IsClientBotSpellType(spellType)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You must choose a valid spell type. Use {} for a list of spell types by ID or {} for a list of spell types by short name.",
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listid", sep->arg[0])
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format("{} listname", sep->arg[0])
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
c->Message(Chat::Yellow, "Invalid spell type.");
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -168,8 +130,8 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep)
|
||||
if (sep->IsNumber(2)) {
|
||||
typeValue = atoi(sep->arg[2]);
|
||||
++ab_arg;
|
||||
if (typeValue < 0 || typeValue > 150) {
|
||||
c->Message(Chat::Yellow, "You must enter a value between 0-150 (0%% to 150%% of health).");
|
||||
if (typeValue < 0 || typeValue > 100) {
|
||||
c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of your health).");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -196,18 +158,18 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep)
|
||||
c->Message(
|
||||
Chat::Green,
|
||||
fmt::format(
|
||||
"Your current min threshold for {}s is {}%%.",
|
||||
"Your [{}] minimum hold is currently [{}]%%.'",
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
c->GetSpellMinThreshold(spellType)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
c->SetSpellMinThreshold(spellType, typeValue);
|
||||
c->SetSpellHold(spellType, typeValue);
|
||||
c->Message(
|
||||
Chat::Green,
|
||||
fmt::format(
|
||||
"Your min threshold for {}s was set to {}%%.",
|
||||
"Your [{}] minimum hold was set to [{}]%%.'",
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
c->GetSpellMinThreshold(spellType)
|
||||
).c_str()
|
||||
|
||||
Reference in New Issue
Block a user