mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-22 15:48:22 +00:00
Add list option to ^spellpriority commands.
This commit is contained in:
@@ -115,6 +115,7 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep)
|
|||||||
std::string arg2 = sep->arg[2];
|
std::string arg2 = sep->arg[2];
|
||||||
int ab_arg = 2;
|
int ab_arg = 2;
|
||||||
bool current_check = false;
|
bool current_check = false;
|
||||||
|
bool list_check = false;
|
||||||
uint16 spell_type = 0;
|
uint16 spell_type = 0;
|
||||||
uint32 type_value = 0;
|
uint32 type_value = 0;
|
||||||
|
|
||||||
@@ -132,6 +133,10 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep)
|
|||||||
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
|
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
|
||||||
spell_type = c->GetSpellTypeIDByShortName(arg1);
|
spell_type = c->GetSpellTypeIDByShortName(arg1);
|
||||||
}
|
}
|
||||||
|
else if (!arg1.compare("list")) {
|
||||||
|
++ab_arg;
|
||||||
|
list_check = true;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::Yellow,
|
Chat::Yellow,
|
||||||
@@ -150,8 +155,8 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep)
|
|||||||
if (sep->IsNumber(2)) {
|
if (sep->IsNumber(2)) {
|
||||||
type_value = atoi(sep->arg[2]);
|
type_value = atoi(sep->arg[2]);
|
||||||
++ab_arg;
|
++ab_arg;
|
||||||
if (type_value < 0 || type_value > 100) {
|
if (EQ::ValueWithin(type_value, BotSpellTypes::START, BotSpellTypes::END)) {
|
||||||
c->Message(Chat::Yellow, "You must enter a value between 0-100.");
|
c->Message(Chat::Yellow, "You must enter a value between {} and {}.", BotSpellTypes::START, BotSpellTypes::END);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -160,7 +165,7 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep)
|
|||||||
++ab_arg;
|
++ab_arg;
|
||||||
current_check = true;
|
current_check = true;
|
||||||
}
|
}
|
||||||
else {
|
else if (!list_check) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::Yellow,
|
Chat::Yellow,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -210,6 +215,31 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep)
|
|||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else if (list_check) {
|
||||||
|
auto cast_order = my_bot->GetSpellTypesPrioritized(BotPriorityCategories::Engaged);
|
||||||
|
|
||||||
|
for (auto& current_cast : cast_order) {
|
||||||
|
c->Message(
|
||||||
|
Chat::Green,
|
||||||
|
fmt::format(
|
||||||
|
"{} says, 'My [{}] engaged cast priority for is currently [{}].'",
|
||||||
|
my_bot->GetCleanName(),
|
||||||
|
c->GetSpellTypeNameByID(current_cast.spellType),
|
||||||
|
(current_cast.priority == 0 ? "disabled (0)" : std::to_string(current_cast.priority))
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::Green,
|
||||||
|
fmt::format(
|
||||||
|
"{} says, 'Anything not listed is currently disabled (0).'",
|
||||||
|
my_bot->GetCleanName()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Engaged, type_value);
|
my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Engaged, type_value);
|
||||||
++success_count;
|
++success_count;
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep)
|
|||||||
std::string arg2 = sep->arg[2];
|
std::string arg2 = sep->arg[2];
|
||||||
int ab_arg = 2;
|
int ab_arg = 2;
|
||||||
bool current_check = false;
|
bool current_check = false;
|
||||||
|
bool list_check = false;
|
||||||
uint16 spell_type = 0;
|
uint16 spell_type = 0;
|
||||||
uint32 type_value = 0;
|
uint32 type_value = 0;
|
||||||
|
|
||||||
@@ -132,6 +133,10 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep)
|
|||||||
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
|
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
|
||||||
spell_type = c->GetSpellTypeIDByShortName(arg1);
|
spell_type = c->GetSpellTypeIDByShortName(arg1);
|
||||||
}
|
}
|
||||||
|
else if (!arg1.compare("list")) {
|
||||||
|
++ab_arg;
|
||||||
|
list_check = true;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::Yellow,
|
Chat::Yellow,
|
||||||
@@ -150,8 +155,8 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep)
|
|||||||
if (sep->IsNumber(2)) {
|
if (sep->IsNumber(2)) {
|
||||||
type_value = atoi(sep->arg[2]);
|
type_value = atoi(sep->arg[2]);
|
||||||
++ab_arg;
|
++ab_arg;
|
||||||
if (type_value < 0 || type_value > 100) {
|
if (EQ::ValueWithin(type_value, BotSpellTypes::START, BotSpellTypes::END)) {
|
||||||
c->Message(Chat::Yellow, "You must enter a value between 0-100.");
|
c->Message(Chat::Yellow, "You must enter a value between {} and {}.", BotSpellTypes::START, BotSpellTypes::END);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -160,7 +165,7 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep)
|
|||||||
++ab_arg;
|
++ab_arg;
|
||||||
current_check = true;
|
current_check = true;
|
||||||
}
|
}
|
||||||
else {
|
else if (!list_check) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::Yellow,
|
Chat::Yellow,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -210,6 +215,31 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep)
|
|||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else if (list_check) {
|
||||||
|
auto cast_order = my_bot->GetSpellTypesPrioritized(BotPriorityCategories::Idle);
|
||||||
|
|
||||||
|
for (auto& current_cast : cast_order) {
|
||||||
|
c->Message(
|
||||||
|
Chat::Green,
|
||||||
|
fmt::format(
|
||||||
|
"{} says, 'My [{}] idle cast priority for is currently [{}].'",
|
||||||
|
my_bot->GetCleanName(),
|
||||||
|
c->GetSpellTypeNameByID(current_cast.spellType),
|
||||||
|
(current_cast.priority == 0 ? "disabled (0)" : std::to_string(current_cast.priority))
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::Green,
|
||||||
|
fmt::format(
|
||||||
|
"{} says, 'Anything not listed is currently disabled (0).'",
|
||||||
|
my_bot->GetCleanName()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Idle, type_value);
|
my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Idle, type_value);
|
||||||
++success_count;
|
++success_count;
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
|
|||||||
std::string arg2 = sep->arg[2];
|
std::string arg2 = sep->arg[2];
|
||||||
int ab_arg = 2;
|
int ab_arg = 2;
|
||||||
bool current_check = false;
|
bool current_check = false;
|
||||||
|
bool list_check = false;
|
||||||
uint16 spell_type = 0;
|
uint16 spell_type = 0;
|
||||||
uint32 type_value = 0;
|
uint32 type_value = 0;
|
||||||
|
|
||||||
@@ -132,6 +133,10 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
|
|||||||
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
|
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
|
||||||
spell_type = c->GetSpellTypeIDByShortName(arg1);
|
spell_type = c->GetSpellTypeIDByShortName(arg1);
|
||||||
}
|
}
|
||||||
|
else if (!arg1.compare("list")) {
|
||||||
|
++ab_arg;
|
||||||
|
list_check = true;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::Yellow,
|
Chat::Yellow,
|
||||||
@@ -150,8 +155,8 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
|
|||||||
if (sep->IsNumber(2)) {
|
if (sep->IsNumber(2)) {
|
||||||
type_value = atoi(sep->arg[2]);
|
type_value = atoi(sep->arg[2]);
|
||||||
++ab_arg;
|
++ab_arg;
|
||||||
if (type_value < 0 || type_value > 100) {
|
if (EQ::ValueWithin(type_value, BotSpellTypes::START, BotSpellTypes::END)) {
|
||||||
c->Message(Chat::Yellow, "You must enter a value between 0-100.");
|
c->Message(Chat::Yellow, "You must enter a value between {} and {}.", BotSpellTypes::START, BotSpellTypes::END);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -160,7 +165,7 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
|
|||||||
++ab_arg;
|
++ab_arg;
|
||||||
current_check = true;
|
current_check = true;
|
||||||
}
|
}
|
||||||
else {
|
else if (!list_check) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::Yellow,
|
Chat::Yellow,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -210,6 +215,31 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
|
|||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else if (list_check) {
|
||||||
|
auto cast_order = my_bot->GetSpellTypesPrioritized(BotPriorityCategories::Pursue);
|
||||||
|
|
||||||
|
for (auto& current_cast : cast_order) {
|
||||||
|
c->Message(
|
||||||
|
Chat::Green,
|
||||||
|
fmt::format(
|
||||||
|
"{} says, 'My [{}] pursue cast priority for is currently [{}].'",
|
||||||
|
my_bot->GetCleanName(),
|
||||||
|
c->GetSpellTypeNameByID(current_cast.spellType),
|
||||||
|
(current_cast.priority == 0 ? "disabled (0)" : std::to_string(current_cast.priority))
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::Green,
|
||||||
|
fmt::format(
|
||||||
|
"{} says, 'Anything not listed is currently disabled (0).'",
|
||||||
|
my_bot->GetCleanName()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Pursue, type_value);
|
my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Pursue, type_value);
|
||||||
++success_count;
|
++success_count;
|
||||||
|
|||||||
Reference in New Issue
Block a user