mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-18 11:48:21 +00:00
code cleanup 3
This commit is contained in:
@@ -115,14 +115,14 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
|
||||
std::string arg2 = sep->arg[2];
|
||||
int ab_arg = 2;
|
||||
bool current_check = false;
|
||||
uint16 spellType = 0;
|
||||
uint32 typeValue = 0;
|
||||
uint16 spell_type = 0;
|
||||
uint32 type_value = 0;
|
||||
|
||||
// String/Int type checks
|
||||
if (sep->IsNumber(1)) {
|
||||
spellType = atoi(sep->arg[1]);
|
||||
spell_type = atoi(sep->arg[1]);
|
||||
|
||||
if (spellType < BotSpellTypes::START || spellType > BotSpellTypes::END) {
|
||||
if (spell_type < BotSpellTypes::START || spell_type > BotSpellTypes::END) {
|
||||
c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
|
||||
|
||||
return;
|
||||
@@ -130,7 +130,7 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
|
||||
}
|
||||
else {
|
||||
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
|
||||
spellType = c->GetSpellTypeIDByShortName(arg1);
|
||||
spell_type = c->GetSpellTypeIDByShortName(arg1);
|
||||
}
|
||||
else {
|
||||
c->Message(
|
||||
@@ -148,9 +148,9 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
|
||||
}
|
||||
|
||||
if (sep->IsNumber(2)) {
|
||||
typeValue = atoi(sep->arg[2]);
|
||||
type_value = atoi(sep->arg[2]);
|
||||
++ab_arg;
|
||||
if (typeValue < 0 || typeValue > 100) {
|
||||
if (type_value < 0 || type_value > 100) {
|
||||
c->Message(Chat::Yellow, "You must enter a value between 0-100.");
|
||||
|
||||
return;
|
||||
@@ -205,13 +205,13 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
|
||||
fmt::format(
|
||||
"{} says, 'My [{}] pursue cast priority is currently [{}].'",
|
||||
my_bot->GetCleanName(),
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
my_bot->GetSpellTypePriority(spellType, BotPriorityCategories::Pursue)
|
||||
c->GetSpellTypeNameByID(spell_type),
|
||||
my_bot->GetSpellTypePriority(spell_type, BotPriorityCategories::Pursue)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
my_bot->SetSpellTypePriority(spellType, BotPriorityCategories::Pursue, typeValue);
|
||||
my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Pursue, type_value);
|
||||
++success_count;
|
||||
}
|
||||
}
|
||||
@@ -222,8 +222,8 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
|
||||
fmt::format(
|
||||
"{} says, 'My [{}] pursue cast priority was set to [{}].'",
|
||||
first_found->GetCleanName(),
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
first_found->GetSpellTypePriority(spellType, BotPriorityCategories::Pursue)
|
||||
c->GetSpellTypeNameByID(spell_type),
|
||||
first_found->GetSpellTypePriority(spell_type, BotPriorityCategories::Pursue)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -233,8 +233,8 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
|
||||
fmt::format(
|
||||
"{} of your bots set their [{}] pursue cast priority to [{}].",
|
||||
success_count,
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
typeValue
|
||||
c->GetSpellTypeNameByID(spell_type),
|
||||
type_value
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user