code cleanup 3

This commit is contained in:
nytmyr
2025-01-10 12:10:12 -06:00
parent 95c1bb6883
commit 90e95572fd
38 changed files with 718 additions and 729 deletions
+5 -5
View File
@@ -82,12 +82,12 @@ void bot_command_behind_mob(Client* c, const Seperator* sep)
int ab_arg = 1; int ab_arg = 1;
bool current_check = false; bool current_check = false;
uint32 typeValue = 0; uint32 type_value = 0;
if (sep->IsNumber(1)) { if (sep->IsNumber(1)) {
typeValue = atoi(sep->arg[1]); type_value = atoi(sep->arg[1]);
++ab_arg; ++ab_arg;
if (typeValue < 0 || typeValue > 1) { if (type_value < 0 || type_value > 1) {
c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled."); c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled.");
return; return;
@@ -147,7 +147,7 @@ void bot_command_behind_mob(Client* c, const Seperator* sep)
); );
} }
else { else {
my_bot->SetBehindMob(typeValue); my_bot->SetBehindMob(type_value);
++success_count; ++success_count;
} }
} }
@@ -168,7 +168,7 @@ void bot_command_behind_mob(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots {} stay behind mobs.", "{} of your bots {} stay behind mobs.",
success_count, success_count,
typeValue ? "will now" : "will no longer" type_value ? "will now" : "will no longer"
).c_str() ).c_str()
); );
} }
+34 -34
View File
@@ -149,10 +149,10 @@ void bot_command_blocked_buffs(Client* c, const Seperator* sep)
} }
const int ab_mask = ActionableBots::ABM_Type1; const int ab_mask = ActionableBots::ABM_Type1;
std::string actionableArg = sep->arg[ab_arg]; std::string actionable_arg = sep->arg[ab_arg];
if (actionableArg.empty()) { if (actionable_arg.empty()) {
actionableArg = "target"; actionable_arg = "target";
} }
std::string class_race_arg = sep->arg[ab_arg]; std::string class_race_arg = sep->arg[ab_arg];
@@ -164,23 +164,23 @@ void bot_command_blocked_buffs(Client* c, const Seperator* sep)
std::vector<Bot*> sbl; std::vector<Bot*> sbl;
if (ActionableBots::PopulateSBL(c, actionableArg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) { if (ActionableBots::PopulateSBL(c, actionable_arg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) {
return; return;
} }
sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end()); sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end());
bool isSuccess = false; bool is_success = false;
uint16 successCount = 0; uint16 success_count = 0;
Bot* firstFound = nullptr; Bot* first_found = nullptr;
for (auto bot_iter : sbl) { for (auto bot_iter : sbl) {
if (!bot_iter->IsInGroupOrRaid(c)) { if (!bot_iter->IsInGroupOrRaid(c)) {
continue; continue;
} }
if (!firstFound) { if (!first_found) {
firstFound = bot_iter; first_found = bot_iter;
} }
if (add) { if (add) {
@@ -190,11 +190,11 @@ void bot_command_blocked_buffs(Client* c, const Seperator* sep)
bot_iter->SetBotBlockedBuff(spell_id, false); bot_iter->SetBotBlockedBuff(spell_id, false);
} }
else if (list) { else if (list) {
std::vector<BotBlockedBuffs_Struct> blockedBuffs = bot_iter->GetBotBlockedBuffs(); std::vector<BotBlockedBuffs_Struct> blocked_buffs = bot_iter->GetBotBlockedBuffs();
bool found = false; bool found = false;
if (!blockedBuffs.empty()) { if (!blocked_buffs.empty()) {
for (auto& blocked_buff : blockedBuffs) { for (auto& blocked_buff : blocked_buffs) {
if (blocked_buff.blocked == 1 && IsValidSpell(blocked_buff.spell_id)) { if (blocked_buff.blocked == 1 && IsValidSpell(blocked_buff.spell_id)) {
found = true; found = true;
c->Message( c->Message(
@@ -232,11 +232,11 @@ void bot_command_blocked_buffs(Client* c, const Seperator* sep)
); );
} }
isSuccess = true; is_success = true;
++successCount; ++success_count;
} }
if (!isSuccess) { if (!is_success) {
c->Message(Chat::Yellow, "No bots were selected."); c->Message(Chat::Yellow, "No bots were selected.");
} }
else { else {
@@ -245,8 +245,8 @@ void bot_command_blocked_buffs(Client* c, const Seperator* sep)
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
"{} {} {} blocking {} [#{}]", "{} {} {} blocking {} [#{}]",
((successCount == 1 && firstFound) ? firstFound->GetCleanName() : (fmt::format("{}", successCount).c_str())), ((success_count == 1 && first_found) ? first_found->GetCleanName() : (fmt::format("{}", success_count).c_str())),
((successCount == 1 && firstFound) ? "is" : "of your bots"), ((success_count == 1 && first_found) ? "is" : "of your bots"),
(add ? "now" : "no longer"), (add ? "now" : "no longer"),
spells[spell_id].name, spells[spell_id].name,
spell_id spell_id
@@ -408,10 +408,10 @@ void bot_command_blocked_pet_buffs(Client* c, const Seperator* sep)
} }
const int ab_mask = ActionableBots::ABM_Type1; const int ab_mask = ActionableBots::ABM_Type1;
std::string actionableArg = sep->arg[ab_arg]; std::string actionable_arg = sep->arg[ab_arg];
if (actionableArg.empty()) { if (actionable_arg.empty()) {
actionableArg = "target"; actionable_arg = "target";
} }
std::string class_race_arg = sep->arg[ab_arg]; std::string class_race_arg = sep->arg[ab_arg];
@@ -423,23 +423,23 @@ void bot_command_blocked_pet_buffs(Client* c, const Seperator* sep)
std::vector<Bot*> sbl; std::vector<Bot*> sbl;
if (ActionableBots::PopulateSBL(c, actionableArg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) { if (ActionableBots::PopulateSBL(c, actionable_arg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) {
return; return;
} }
sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end()); sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end());
bool isSuccess = false; bool is_success = false;
uint16 successCount = 0; uint16 success_count = 0;
Bot* firstFound = nullptr; Bot* first_found = nullptr;
for (auto bot_iter : sbl) { for (auto bot_iter : sbl) {
if (!bot_iter->IsInGroupOrRaid(c)) { if (!bot_iter->IsInGroupOrRaid(c)) {
continue; continue;
} }
if (!firstFound) { if (!first_found) {
firstFound = bot_iter; first_found = bot_iter;
} }
if (add) { if (add) {
@@ -449,11 +449,11 @@ void bot_command_blocked_pet_buffs(Client* c, const Seperator* sep)
bot_iter->SetBotBlockedPetBuff(spell_id, false); bot_iter->SetBotBlockedPetBuff(spell_id, false);
} }
else if (list) { else if (list) {
std::vector<BotBlockedBuffs_Struct> blockedBuffs = bot_iter->GetBotBlockedBuffs(); std::vector<BotBlockedBuffs_Struct> blocked_buffs = bot_iter->GetBotBlockedBuffs();
bool found = false; bool found = false;
if (!blockedBuffs.empty()) { if (!blocked_buffs.empty()) {
for (auto& blocked_buff : blockedBuffs) { for (auto& blocked_buff : blocked_buffs) {
if (blocked_buff.blocked_pet == 1 && IsValidSpell(blocked_buff.spell_id)) { if (blocked_buff.blocked_pet == 1 && IsValidSpell(blocked_buff.spell_id)) {
found = true; found = true;
c->Message( c->Message(
@@ -491,11 +491,11 @@ void bot_command_blocked_pet_buffs(Client* c, const Seperator* sep)
); );
} }
isSuccess = true; is_success = true;
++successCount; ++success_count;
} }
if (!isSuccess) { if (!is_success) {
c->Message(Chat::Yellow, "No bots were selected."); c->Message(Chat::Yellow, "No bots were selected.");
} }
else { else {
@@ -504,8 +504,8 @@ void bot_command_blocked_pet_buffs(Client* c, const Seperator* sep)
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
"{} {} {} blocking {} [#{}] on their pet.", "{} {} {} blocking {} [#{}] on their pet.",
((successCount == 1 && firstFound) ? firstFound->GetCleanName() : (fmt::format("{}", successCount).c_str())), ((success_count == 1 && first_found) ? first_found->GetCleanName() : (fmt::format("{}", success_count).c_str())),
((successCount == 1 && firstFound) ? "is" : "of your bots"), ((success_count == 1 && first_found) ? "is" : "of your bots"),
(add ? "now" : "no longer"), (add ? "now" : "no longer"),
spells[spell_id].name, spells[spell_id].name,
spell_id spell_id
+98 -98
View File
@@ -175,13 +175,13 @@ void bot_command_cast(Client* c, const Seperator* sep)
} }
int ab_arg = 2; int ab_arg = 2;
uint16 spellType = UINT16_MAX; uint16 spell_type = UINT16_MAX;
uint16 subType = UINT16_MAX; uint16 sub_type = UINT16_MAX;
uint16 subTargetType = UINT16_MAX; uint16 sub_target_type = UINT16_MAX;
bool aaType = false; bool aa_type = false;
int aaID = 0; int aa_id = 0;
bool bySpellID = false; bool by_spell_id = false;
uint16 chosenSpellID = UINT16_MAX; uint16 chosen_spell_id = UINT16_MAX;
if (!arg1.compare("aa") || !arg1.compare("harmtouch") || !arg1.compare("layonhands")) { if (!arg1.compare("aa") || !arg1.compare("harmtouch") || !arg1.compare("layonhands")) {
if (!RuleB(Bots, AllowCastAAs)) { if (!RuleB(Bots, AllowCastAAs)) {
@@ -190,10 +190,10 @@ void bot_command_cast(Client* c, const Seperator* sep)
} }
if (!arg1.compare("harmtouch")) { if (!arg1.compare("harmtouch")) {
aaID = zone->GetAlternateAdvancementAbilityByRank(aaHarmTouch)->id; aa_id = zone->GetAlternateAdvancementAbilityByRank(aaHarmTouch)->id;
} }
else if (!arg1.compare("layonhands")) { else if (!arg1.compare("layonhands")) {
aaID = zone->GetAlternateAdvancementAbilityByRank(aaLayonHands)->id; aa_id = zone->GetAlternateAdvancementAbilityByRank(aaLayonHands)->id;
} }
else if (!sep->IsNumber(2) || !zone->GetAlternateAdvancementAbility(Strings::ToInt(arg2))) { else if (!sep->IsNumber(2) || !zone->GetAlternateAdvancementAbility(Strings::ToInt(arg2))) {
c->Message(Chat::Yellow, "You must enter an AA ID."); c->Message(Chat::Yellow, "You must enter an AA ID.");
@@ -201,10 +201,10 @@ void bot_command_cast(Client* c, const Seperator* sep)
} }
else { else {
++ab_arg; ++ab_arg;
aaID = Strings::ToInt(arg2); aa_id = Strings::ToInt(arg2);
} }
aaType = true; aa_type = true;
} }
if (!arg1.compare("spellid")) { if (!arg1.compare("spellid")) {
@@ -215,8 +215,8 @@ void bot_command_cast(Client* c, const Seperator* sep)
if (sep->IsNumber(2) && IsValidSpell(atoi(sep->arg[2]))) { if (sep->IsNumber(2) && IsValidSpell(atoi(sep->arg[2]))) {
++ab_arg; ++ab_arg;
chosenSpellID = atoi(sep->arg[2]); chosen_spell_id = atoi(sep->arg[2]);
bySpellID = true; by_spell_id = true;
} }
else { else {
c->Message(Chat::Yellow, "You must enter a valid spell ID."); c->Message(Chat::Yellow, "You must enter a valid spell ID.");
@@ -225,11 +225,11 @@ void bot_command_cast(Client* c, const Seperator* sep)
} }
} }
if (!aaType && !bySpellID) { if (!aa_type && !by_spell_id) {
if (sep->IsNumber(1)) { if (sep->IsNumber(1)) {
spellType = atoi(sep->arg[1]); spell_type = atoi(sep->arg[1]);
if (spellType < BotSpellTypes::START || (spellType > BotSpellTypes::END && spellType < BotSpellTypes::COMMANDED_START) || spellType > BotSpellTypes::COMMANDED_END) { if (spell_type < BotSpellTypes::START || (spell_type > BotSpellTypes::END && spell_type < BotSpellTypes::COMMANDED_START) || spell_type > BotSpellTypes::COMMANDED_END) {
c->Message( c->Message(
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
@@ -245,7 +245,7 @@ void bot_command_cast(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -262,7 +262,7 @@ void bot_command_cast(Client* c, const Seperator* sep)
} }
} }
switch (spellType) { //Allowed command checks switch (spell_type) { //Allowed command checks
case BotSpellTypes::Charm: case BotSpellTypes::Charm:
if (!RuleB(Bots, AllowCommandedCharm)) { if (!RuleB(Bots, AllowCommandedCharm)) {
c->Message(Chat::Yellow, "This commanded type is currently disabled."); c->Message(Chat::Yellow, "This commanded type is currently disabled.");
@@ -304,50 +304,50 @@ void bot_command_cast(Client* c, const Seperator* sep)
break; break;
} }
std::string argString = sep->arg[ab_arg]; std::string arg_string = sep->arg[ab_arg];
if (!argString.compare("shrink")) { if (!arg_string.compare("shrink")) {
subType = CommandedSubTypes::Shrink; sub_type = CommandedSubTypes::Shrink;
++ab_arg; ++ab_arg;
} }
else if (!argString.compare("grow")) { else if (!arg_string.compare("grow")) {
subType = CommandedSubTypes::Grow; sub_type = CommandedSubTypes::Grow;
++ab_arg; ++ab_arg;
} }
else if (!argString.compare("see")) { else if (!arg_string.compare("see")) {
subType = CommandedSubTypes::SeeInvis; sub_type = CommandedSubTypes::SeeInvis;
++ab_arg; ++ab_arg;
} }
else if (!argString.compare("invis")) { else if (!arg_string.compare("invis")) {
subType = CommandedSubTypes::Invis; sub_type = CommandedSubTypes::Invis;
++ab_arg; ++ab_arg;
} }
else if (!argString.compare("undead")) { else if (!arg_string.compare("undead")) {
subType = CommandedSubTypes::InvisUndead; sub_type = CommandedSubTypes::InvisUndead;
++ab_arg; ++ab_arg;
} }
else if (!argString.compare("animals")) { else if (!arg_string.compare("animals")) {
subType = CommandedSubTypes::InvisAnimals; sub_type = CommandedSubTypes::InvisAnimals;
++ab_arg; ++ab_arg;
} }
else if (!argString.compare("selo")) { else if (!arg_string.compare("selo")) {
subType = CommandedSubTypes::Selo; sub_type = CommandedSubTypes::Selo;
++ab_arg; ++ab_arg;
} }
argString = sep->arg[ab_arg]; arg_string = sep->arg[ab_arg];
if (!argString.compare("single")) { if (!arg_string.compare("single")) {
subTargetType = CommandedSubTypes::SingleTarget; sub_target_type = CommandedSubTypes::SingleTarget;
++ab_arg; ++ab_arg;
} }
else if (!argString.compare("group")) { else if (!arg_string.compare("group")) {
subTargetType = CommandedSubTypes::GroupTarget; sub_target_type = CommandedSubTypes::GroupTarget;
++ab_arg; ++ab_arg;
} }
else if (!argString.compare("ae")) { else if (!arg_string.compare("ae")) {
subTargetType = CommandedSubTypes::AETarget; sub_target_type = CommandedSubTypes::AETarget;
++ab_arg; ++ab_arg;
} }
} }
@@ -355,27 +355,27 @@ void bot_command_cast(Client* c, const Seperator* sep)
Mob* tar = c->GetTarget(); Mob* tar = c->GetTarget();
if (!tar) { if (!tar) {
if ((!aaType && !bySpellID) && spellType != BotSpellTypes::Escape && spellType != BotSpellTypes::Pet) { if ((!aa_type && !by_spell_id) && spell_type != BotSpellTypes::Escape && spell_type != BotSpellTypes::Pet) {
c->Message(Chat::Yellow, "You need a target for that."); c->Message(Chat::Yellow, "You need a target for that.");
return; return;
} }
} }
if (!aaType && !bySpellID) { if (!aa_type && !by_spell_id) {
if (IsPetBotSpellType(spellType) && !tar->IsPet()) { if (IsPetBotSpellType(spell_type) && !tar->IsPet()) {
c->Message( c->Message(
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
"[{}] is an invalid target. {} requires a pet to be targeted.", "[{}] is an invalid target. {} requires a pet to be targeted.",
tar->GetCleanName(), tar->GetCleanName(),
tar->GetSpellTypeNameByID(spellType) tar->GetSpellTypeNameByID(spell_type)
).c_str() ).c_str()
); );
return; return;
} }
switch (spellType) { //Target Checks switch (spell_type) { //Target Checks
case BotSpellTypes::Resurrect: case BotSpellTypes::Resurrect:
if (!tar->IsCorpse() || !tar->CastToCorpse()->IsPlayerCorpse()) { if (!tar->IsCorpse() || !tar->CastToCorpse()->IsPlayerCorpse()) {
c->Message( c->Message(
@@ -409,9 +409,9 @@ void bot_command_cast(Client* c, const Seperator* sep)
break; break;
default: default:
if ( if (
(IsBotSpellTypeDetrimental(spellType) && !c->IsAttackAllowed(tar)) || (IsBotSpellTypeDetrimental(spell_type) && !c->IsAttackAllowed(tar)) ||
( (
spellType == BotSpellTypes::Charm && spell_type == BotSpellTypes::Charm &&
( (
tar->IsClient() || tar->IsClient() ||
tar->IsCorpse() || tar->IsCorpse() ||
@@ -430,7 +430,7 @@ void bot_command_cast(Client* c, const Seperator* sep)
return; return;
} }
if (IsBotSpellTypeBeneficial(spellType)) { if (IsBotSpellTypeBeneficial(spell_type)) {
if ( if (
(tar->IsNPC() && !tar->GetOwner()) || (tar->IsNPC() && !tar->GetOwner()) ||
(tar->GetOwner() && tar->GetOwner()->IsOfClientBot() && !c->IsInGroupOrRaid(tar->GetOwner())) || (tar->GetOwner() && tar->GetOwner()->IsOfClientBot() && !c->IsInGroupOrRaid(tar->GetOwner())) ||
@@ -453,7 +453,7 @@ void bot_command_cast(Client* c, const Seperator* sep)
} }
if ( if (
(spellType == BotSpellTypes::Cure || spellType == BotSpellTypes::GroupCures || spellType == BotSpellTypes::PetCures) && (spell_type == BotSpellTypes::Cure || spell_type == BotSpellTypes::GroupCures || spell_type == BotSpellTypes::PetCures) &&
!c->CastToBot()->GetNeedsCured(tar) !c->CastToBot()->GetNeedsCured(tar)
) { ) {
c->Message( c->Message(
@@ -468,10 +468,10 @@ void bot_command_cast(Client* c, const Seperator* sep)
} }
const int ab_mask = ActionableBots::ABM_Type1; const int ab_mask = ActionableBots::ABM_Type1;
std::string actionableArg = sep->arg[ab_arg]; std::string actionable_arg = sep->arg[ab_arg];
if (actionableArg.empty()) { if (actionable_arg.empty()) {
actionableArg = "spawned"; actionable_arg = "spawned";
} }
std::string class_race_arg = sep->arg[ab_arg]; std::string class_race_arg = sep->arg[ab_arg];
@@ -483,19 +483,19 @@ void bot_command_cast(Client* c, const Seperator* sep)
std::vector<Bot*> sbl; std::vector<Bot*> sbl;
if (ActionableBots::PopulateSBL(c, actionableArg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) { if (ActionableBots::PopulateSBL(c, actionable_arg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) {
return; return;
} }
sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end()); sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end());
BotSpell botSpell; BotSpell bot_spell;
botSpell.SpellId = 0; bot_spell.SpellId = 0;
botSpell.SpellIndex = 0; bot_spell.SpellIndex = 0;
botSpell.ManaCost = 0; bot_spell.ManaCost = 0;
bool isSuccess = false; bool is_success = false;
uint16 successCount = 0; uint16 success_count = 0;
Bot* firstFound = nullptr; Bot* first_found = nullptr;
for (auto bot_iter : sbl) { for (auto bot_iter : sbl) {
if (!bot_iter->IsInGroupOrRaid(c)) { if (!bot_iter->IsInGroupOrRaid(c)) {
@@ -506,31 +506,31 @@ void bot_command_cast(Client* c, const Seperator* sep)
continue; continue;
} }
Mob* newTar = tar; Mob* new_tar = tar;
if (!aaType && !bySpellID) { if (!aa_type && !by_spell_id) {
if (!SpellTypeRequiresTarget(spellType)) { if (!SpellTypeRequiresTarget(spell_type)) {
newTar = bot_iter; new_tar = bot_iter;
} }
if (!newTar) { if (!new_tar) {
continue; continue;
} }
if ( if (
IsBotSpellTypeBeneficial(spellType) && IsBotSpellTypeBeneficial(spell_type) &&
!RuleB(Bots, CrossRaidBuffingAndHealing) && !RuleB(Bots, CrossRaidBuffingAndHealing) &&
!bot_iter->IsInGroupOrRaid(newTar, true) !bot_iter->IsInGroupOrRaid(new_tar, true)
) { ) {
continue; continue;
} }
if (IsBotSpellTypeDetrimental(spellType) && !bot_iter->IsAttackAllowed(newTar)) { if (IsBotSpellTypeDetrimental(spell_type) && !bot_iter->IsAttackAllowed(new_tar)) {
bot_iter->BotGroupSay( bot_iter->BotGroupSay(
bot_iter, bot_iter,
fmt::format( fmt::format(
"I cannot attack [{}].", "I cannot attack [{}].",
newTar->GetCleanName() new_tar->GetCleanName()
).c_str() ).c_str()
); );
@@ -538,14 +538,14 @@ void bot_command_cast(Client* c, const Seperator* sep)
} }
} }
if (aaType) { if (aa_type) {
if (!bot_iter->GetAA(zone->GetAlternateAdvancementAbility(aaID)->first_rank_id)) { if (!bot_iter->GetAA(zone->GetAlternateAdvancementAbility(aa_id)->first_rank_id)) {
continue; continue;
} }
AA::Rank* tempRank = nullptr; AA::Rank* temp_rank = nullptr;
AA::Rank*& rank = tempRank; AA::Rank*& rank = temp_rank;
uint16 spell_id = bot_iter->GetSpellByAA(aaID, rank); uint16 spell_id = bot_iter->GetSpellByAA(aa_id, rank);
if (!IsValidSpell(spell_id)) { if (!IsValidSpell(spell_id)) {
continue; continue;
@@ -555,27 +555,27 @@ void bot_command_cast(Client* c, const Seperator* sep)
continue; continue;
} }
isSuccess = true; is_success = true;
++successCount; ++success_count;
continue; continue;
} }
else if (bySpellID) { else if (by_spell_id) {
if (!bot_iter->CanUseBotSpell(chosenSpellID)) { if (!bot_iter->CanUseBotSpell(chosen_spell_id)) {
continue; continue;
} }
if (!tar || (spells[chosenSpellID].target_type == ST_Self && tar != bot_iter)) { if (!tar || (spells[chosen_spell_id].target_type == ST_Self && tar != bot_iter)) {
tar = bot_iter; tar = bot_iter;
} }
if (bot_iter->AttemptForcedCastSpell(tar, chosenSpellID)) { if (bot_iter->AttemptForcedCastSpell(tar, chosen_spell_id)) {
if (!firstFound) { if (!first_found) {
firstFound = bot_iter; first_found = bot_iter;
} }
isSuccess = true; is_success = true;
++successCount; ++success_count;
} }
continue; continue;
@@ -583,13 +583,13 @@ void bot_command_cast(Client* c, const Seperator* sep)
else { else {
bot_iter->SetCommandedSpell(true); bot_iter->SetCommandedSpell(true);
if (bot_iter->AICastSpell(newTar, 100, spellType, subTargetType, subType)) { if (bot_iter->AICastSpell(new_tar, 100, spell_type, sub_target_type, sub_type)) {
if (!firstFound) { if (!first_found) {
firstFound = bot_iter; first_found = bot_iter;
} }
isSuccess = true; is_success = true;
++successCount; ++success_count;
} }
bot_iter->SetCommandedSpell(false); bot_iter->SetCommandedSpell(false);
@@ -602,22 +602,22 @@ void bot_command_cast(Client* c, const Seperator* sep)
std::string type = ""; std::string type = "";
if (aaType) { if (aa_type) {
type = zone->GetAAName(zone->GetAlternateAdvancementAbility(aaID)->first_rank_id); type = zone->GetAAName(zone->GetAlternateAdvancementAbility(aa_id)->first_rank_id);
} }
else if (bySpellID) { else if (by_spell_id) {
type = "Forced"; type = "Forced";
} }
else { else {
type = c->GetSpellTypeNameByID(spellType); type = c->GetSpellTypeNameByID(spell_type);
} }
if (!isSuccess) { if (!is_success) {
c->Message( c->Message(
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
"No bots are capable of casting [{}] on {}. This could be due to this to any number of things: range, mana, immune, target type, etc.", "No bots are capable of casting [{}] on {}. This could be due to this to any number of things: range, mana, immune, target type, etc.",
(bySpellID ? spells[chosenSpellID].name : type), (by_spell_id ? spells[chosen_spell_id].name : type),
tar ? tar->GetCleanName() : "your target" tar ? tar->GetCleanName() : "your target"
).c_str() ).c_str()
); );
@@ -627,9 +627,9 @@ void bot_command_cast(Client* c, const Seperator* sep)
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
"{} {} [{}]{}", "{} {} [{}]{}",
((successCount == 1 && firstFound) ? firstFound->GetCleanName() : (fmt::format("{}", successCount).c_str())), ((success_count == 1 && first_found) ? first_found->GetCleanName() : (fmt::format("{}", success_count).c_str())),
((successCount == 1 && firstFound) ? "casted" : "of your bots casted"), ((success_count == 1 && first_found) ? "casted" : "of your bots casted"),
(bySpellID ? spells[chosenSpellID].name : type), (by_spell_id ? spells[chosen_spell_id].name : type),
tar ? (fmt::format(" on {}.", tar->GetCleanName()).c_str()) : "." tar ? (fmt::format(" on {}.", tar->GetCleanName()).c_str()) : "."
).c_str() ).c_str()
); );
+45 -45
View File
@@ -106,9 +106,9 @@ void bot_command_copy_settings(Client* c, const Seperator* sep)
std::string arg1 = sep->arg[1]; std::string arg1 = sep->arg[1];
int ab_arg = 2; int ab_arg = 2;
bool validOption = false; bool valid_option = false;
uint16 spellType = UINT16_MAX; uint16 spell_type = UINT16_MAX;
uint16 settingType = UINT16_MAX; uint16 setting_type = UINT16_MAX;
std::vector<std::string> options = std::vector<std::string> options =
{ {
"all", "all",
@@ -133,25 +133,25 @@ void bot_command_copy_settings(Client* c, const Seperator* sep)
}; };
if (sep->IsNumber(4)) { if (sep->IsNumber(4)) {
spellType = atoi(sep->arg[4]); spell_type = atoi(sep->arg[4]);
} }
else { else {
spellType = c->GetSpellTypeIDByShortName(sep->arg[4]); spell_type = c->GetSpellTypeIDByShortName(sep->arg[4]);
} }
if (spellType < BotSpellTypes::START || spellType > BotSpellTypes::END) { if (spell_type < BotSpellTypes::START || spell_type > BotSpellTypes::END) {
spellType = UINT16_MAX; spell_type = UINT16_MAX;
} }
for (int i = 0; i < options.size(); i++) { for (int i = 0; i < options.size(); i++) {
if (sep->arg[3] == options[i]) { if (sep->arg[3] == options[i]) {
settingType = c->GetBotSpellCategoryIDByShortName(sep->arg[3]); setting_type = c->GetBotSpellCategoryIDByShortName(sep->arg[3]);
validOption = true; valid_option = true;
break; break;
} }
} }
if (!validOption) { if (!valid_option) {
c->Message( c->Message(
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
@@ -219,17 +219,17 @@ void bot_command_copy_settings(Client* c, const Seperator* sep)
std::string output = ""; std::string output = "";
if (settingType != UINT16_MAX) { if (setting_type != UINT16_MAX) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
from->CopySettings(to, settingType, spellType); from->CopySettings(to, setting_type, spell_type);
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
from->CopySettings(to, settingType, i); from->CopySettings(to, setting_type, i);
} }
} }
output = from->GetBotSpellCategoryName(settingType); output = from->GetBotSpellCategoryName(setting_type);
} }
else { else {
if (!strcasecmp(sep->arg[3], "misc")) { if (!strcasecmp(sep->arg[3], "misc")) {
@@ -241,20 +241,20 @@ void bot_command_copy_settings(Client* c, const Seperator* sep)
output = "^spellsettings"; output = "^spellsettings";
} }
else if (!strcasecmp(sep->arg[3], "spelltypesettings")) { else if (!strcasecmp(sep->arg[3], "spelltypesettings")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
from->CopySettings(to, BotSettingCategories::SpellHold, spellType); from->CopySettings(to, BotSettingCategories::SpellHold, spell_type);
from->CopySettings(to, BotSettingCategories::SpellDelay, spellType); from->CopySettings(to, BotSettingCategories::SpellDelay, spell_type);
from->CopySettings(to, BotSettingCategories::SpellMinThreshold, spellType); from->CopySettings(to, BotSettingCategories::SpellMinThreshold, spell_type);
from->CopySettings(to, BotSettingCategories::SpellMaxThreshold, spellType); from->CopySettings(to, BotSettingCategories::SpellMaxThreshold, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeAggroCheck, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeAggroCheck, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeMinManaPct, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeMinManaPct, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeMaxManaPct, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeMaxManaPct, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeMinHPPct, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeMinHPPct, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeMaxHPPct, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeMaxHPPct, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeIdlePriority, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeIdlePriority, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeEngagedPriority, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeEngagedPriority, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypePursuePriority, spellType); from->CopySettings(to, BotSettingCategories::SpellTypePursuePriority, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeAEOrGroupTargetCount, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeAEOrGroupTargetCount, spell_type);
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
@@ -285,20 +285,20 @@ void bot_command_copy_settings(Client* c, const Seperator* sep)
else if (!strcasecmp(sep->arg[3], "all")) { else if (!strcasecmp(sep->arg[3], "all")) {
from->CopySettings(to, BotSettingCategories::BaseSetting); from->CopySettings(to, BotSettingCategories::BaseSetting);
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
from->CopySettings(to, BotSettingCategories::SpellHold, spellType); from->CopySettings(to, BotSettingCategories::SpellHold, spell_type);
from->CopySettings(to, BotSettingCategories::SpellDelay, spellType); from->CopySettings(to, BotSettingCategories::SpellDelay, spell_type);
from->CopySettings(to, BotSettingCategories::SpellMinThreshold, spellType); from->CopySettings(to, BotSettingCategories::SpellMinThreshold, spell_type);
from->CopySettings(to, BotSettingCategories::SpellMaxThreshold, spellType); from->CopySettings(to, BotSettingCategories::SpellMaxThreshold, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeAggroCheck, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeAggroCheck, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeMinManaPct, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeMinManaPct, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeMaxManaPct, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeMaxManaPct, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeMinHPPct, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeMinHPPct, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeMaxHPPct, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeMaxHPPct, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeIdlePriority, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeIdlePriority, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeEngagedPriority, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeEngagedPriority, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypePursuePriority, spellType); from->CopySettings(to, BotSettingCategories::SpellTypePursuePriority, spell_type);
from->CopySettings(to, BotSettingCategories::SpellTypeAEOrGroupTargetCount, spellType); from->CopySettings(to, BotSettingCategories::SpellTypeAEOrGroupTargetCount, spell_type);
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
@@ -346,9 +346,9 @@ void bot_command_copy_settings(Client* c, const Seperator* sep)
"{}'s{}{} settings were copied to {}.", "{}'s{}{} settings were copied to {}.",
from->GetCleanName(), from->GetCleanName(),
( (
spellType != UINT16_MAX ? spell_type != UINT16_MAX ?
fmt::format(" [{}] ", fmt::format(" [{}] ",
c->GetSpellTypeNameByID(spellType) c->GetSpellTypeNameByID(spell_type)
) )
: " " : " "
), ),
+100 -100
View File
@@ -109,8 +109,8 @@ void bot_command_default_settings(Client* c, const Seperator* sep)
std::string arg1 = sep->arg[1]; std::string arg1 = sep->arg[1];
int ab_arg = 2; int ab_arg = 2;
bool validOption = false; bool valid_option = false;
uint16 spellType = UINT16_MAX; uint16 spell_type = UINT16_MAX;
std::vector<std::string> options = std::vector<std::string> options =
{ {
"all", "all",
@@ -138,14 +138,14 @@ void bot_command_default_settings(Client* c, const Seperator* sep)
if (sep->IsNumber(2) || c->GetSpellTypeIDByShortName(sep->arg[2]) != UINT16_MAX) { if (sep->IsNumber(2) || c->GetSpellTypeIDByShortName(sep->arg[2]) != UINT16_MAX) {
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
spellType = atoi(sep->arg[2]); spell_type = atoi(sep->arg[2]);
} }
if (c->GetSpellTypeIDByShortName(sep->arg[2]) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(sep->arg[2]) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(sep->arg[2]); spell_type = c->GetSpellTypeIDByShortName(sep->arg[2]);
} }
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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -161,12 +161,12 @@ void bot_command_default_settings(Client* c, const Seperator* sep)
break; break;
} }
validOption = true; valid_option = true;
break; break;
} }
} }
if (!validOption) { if (!valid_option) {
c->Message( c->Message(
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
@@ -197,212 +197,212 @@ void bot_command_default_settings(Client* c, const Seperator* sep)
Bot* first_found = nullptr; Bot* first_found = nullptr;
int success_count = 0; int success_count = 0;
std::string output = ""; std::string output = "";
uint8 botStance = 2; uint8 bot_stance = 2;
for (auto myBot : sbl) { for (auto my_bot : sbl) {
if (!first_found) { if (!first_found) {
first_found = myBot; first_found = my_bot;
} }
botStance = myBot->GetBotStance(); bot_stance = my_bot->GetBotStance();
if (!strcasecmp(sep->arg[1], "misc")) { if (!strcasecmp(sep->arg[1], "misc")) {
for (uint16 i = BotBaseSettings::START; i <= BotBaseSettings::END; ++i) { for (uint16 i = BotBaseSettings::START; i <= BotBaseSettings::END; ++i) {
myBot->SetBotBaseSetting(i, myBot->GetDefaultBotBaseSetting(i, botStance)); my_bot->SetBotBaseSetting(i, my_bot->GetDefaultBotBaseSetting(i, bot_stance));
output = "miscellanous settings"; output = "miscellanous settings";
} }
} }
else if (!strcasecmp(sep->arg[1], "holds")) { else if (!strcasecmp(sep->arg[1], "holds")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellHold(spellType, myBot->GetDefaultSpellHold(spellType, botStance)); my_bot->SetSpellHold(spell_type, my_bot->GetDefaultSpellHold(spell_type, bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellHold(i, myBot->GetDefaultSpellHold(i, botStance)); my_bot->SetSpellHold(i, my_bot->GetDefaultSpellHold(i, bot_stance));
} }
} }
output = "hold settings"; output = "hold settings";
} }
else if (!strcasecmp(sep->arg[1], "delays")) { else if (!strcasecmp(sep->arg[1], "delays")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellDelay(spellType, myBot->GetDefaultSpellDelay(spellType, botStance)); my_bot->SetSpellDelay(spell_type, my_bot->GetDefaultSpellDelay(spell_type, bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellDelay(i, myBot->GetDefaultSpellDelay(i, botStance)); my_bot->SetSpellDelay(i, my_bot->GetDefaultSpellDelay(i, bot_stance));
} }
} }
output = "delay settings"; output = "delay settings";
} }
else if (!strcasecmp(sep->arg[1], "minthresholds")) { else if (!strcasecmp(sep->arg[1], "minthresholds")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellMinThreshold(spellType, myBot->GetDefaultSpellMinThreshold(spellType, botStance)); my_bot->SetSpellMinThreshold(spell_type, my_bot->GetDefaultSpellMinThreshold(spell_type, bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellMinThreshold(i, myBot->GetDefaultSpellMinThreshold(i, botStance)); my_bot->SetSpellMinThreshold(i, my_bot->GetDefaultSpellMinThreshold(i, bot_stance));
} }
} }
output = "minimum threshold settings"; output = "minimum threshold settings";
} }
else if (!strcasecmp(sep->arg[1], "maxthresholds")) { else if (!strcasecmp(sep->arg[1], "maxthresholds")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellMaxThreshold(spellType, myBot->GetDefaultSpellMaxThreshold(spellType, botStance)); my_bot->SetSpellMaxThreshold(spell_type, my_bot->GetDefaultSpellMaxThreshold(spell_type, bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellMaxThreshold(i, myBot->GetDefaultSpellMaxThreshold(i, botStance)); my_bot->SetSpellMaxThreshold(i, my_bot->GetDefaultSpellMaxThreshold(i, bot_stance));
} }
} }
output = "maximum threshold settings"; output = "maximum threshold settings";
} }
else if (!strcasecmp(sep->arg[1], "aggrochecks")) { else if (!strcasecmp(sep->arg[1], "aggrochecks")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellTypeAggroCheck(spellType, myBot->GetDefaultSpellTypeAggroCheck(spellType, botStance)); my_bot->SetSpellTypeAggroCheck(spell_type, my_bot->GetDefaultSpellTypeAggroCheck(spell_type, bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellTypeAggroCheck(i, myBot->GetDefaultSpellTypeAggroCheck(i, botStance)); my_bot->SetSpellTypeAggroCheck(i, my_bot->GetDefaultSpellTypeAggroCheck(i, bot_stance));
} }
} }
output = "aggro check settings"; output = "aggro check settings";
} }
else if (!strcasecmp(sep->arg[1], "minmanapct")) { else if (!strcasecmp(sep->arg[1], "minmanapct")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellTypeMinManaLimit(spellType, myBot->GetDefaultSpellTypeMinManaLimit(spellType, botStance)); my_bot->SetSpellTypeMinManaLimit(spell_type, my_bot->GetDefaultSpellTypeMinManaLimit(spell_type, bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellTypeMinManaLimit(i, myBot->GetDefaultSpellTypeMinManaLimit(i, botStance)); my_bot->SetSpellTypeMinManaLimit(i, my_bot->GetDefaultSpellTypeMinManaLimit(i, bot_stance));
} }
} }
output = "min mana settings"; output = "min mana settings";
} }
else if (!strcasecmp(sep->arg[1], "maxmanapct")) { else if (!strcasecmp(sep->arg[1], "maxmanapct")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellTypeMaxManaLimit(spellType, myBot->GetDefaultSpellTypeMaxManaLimit(spellType, botStance)); my_bot->SetSpellTypeMaxManaLimit(spell_type, my_bot->GetDefaultSpellTypeMaxManaLimit(spell_type, bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellTypeMaxManaLimit(i, myBot->GetDefaultSpellTypeMaxManaLimit(i, botStance)); my_bot->SetSpellTypeMaxManaLimit(i, my_bot->GetDefaultSpellTypeMaxManaLimit(i, bot_stance));
} }
} }
output = "max mana settings"; output = "max mana settings";
} }
else if (!strcasecmp(sep->arg[1], "minhppct")) { else if (!strcasecmp(sep->arg[1], "minhppct")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellTypeMinHPLimit(spellType, myBot->GetDefaultSpellTypeMinHPLimit(spellType, botStance)); my_bot->SetSpellTypeMinHPLimit(spell_type, my_bot->GetDefaultSpellTypeMinHPLimit(spell_type, bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellTypeMinHPLimit(i, myBot->GetDefaultSpellTypeMinHPLimit(i, botStance)); my_bot->SetSpellTypeMinHPLimit(i, my_bot->GetDefaultSpellTypeMinHPLimit(i, bot_stance));
} }
} }
output = "min hp settings"; output = "min hp settings";
} }
else if (!strcasecmp(sep->arg[1], "maxhppct")) { else if (!strcasecmp(sep->arg[1], "maxhppct")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellTypeMaxHPLimit(spellType, myBot->GetDefaultSpellTypeMaxHPLimit(spellType, botStance)); my_bot->SetSpellTypeMaxHPLimit(spell_type, my_bot->GetDefaultSpellTypeMaxHPLimit(spell_type, bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellTypeMaxHPLimit(i, myBot->GetDefaultSpellTypeMaxHPLimit(i, botStance)); my_bot->SetSpellTypeMaxHPLimit(i, my_bot->GetDefaultSpellTypeMaxHPLimit(i, bot_stance));
} }
} }
output = "max hp settings"; output = "max hp settings";
} }
else if (!strcasecmp(sep->arg[1], "idlepriority")) { else if (!strcasecmp(sep->arg[1], "idlepriority")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellTypePriority(spellType, BotPriorityCategories::Idle, myBot->GetDefaultSpellTypePriority(spellType, BotPriorityCategories::Idle, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Idle, my_bot->GetDefaultSpellTypePriority(spell_type, BotPriorityCategories::Idle, my_bot->GetClass(), bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellTypePriority(i, BotPriorityCategories::Idle, myBot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Idle, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(i, BotPriorityCategories::Idle, my_bot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Idle, my_bot->GetClass(), bot_stance));
} }
} }
output = "idle priority settings"; output = "idle priority settings";
} }
else if (!strcasecmp(sep->arg[1], "engagedpriority")) { else if (!strcasecmp(sep->arg[1], "engagedpriority")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellTypePriority(spellType, BotPriorityCategories::Engaged, myBot->GetDefaultSpellTypePriority(spellType, BotPriorityCategories::Engaged, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Engaged, my_bot->GetDefaultSpellTypePriority(spell_type, BotPriorityCategories::Engaged, my_bot->GetClass(), bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellTypePriority(i, BotPriorityCategories::Engaged, myBot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Engaged, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(i, BotPriorityCategories::Engaged, my_bot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Engaged, my_bot->GetClass(), bot_stance));
} }
} }
output = "engaged priority settings"; output = "engaged priority settings";
} }
else if (!strcasecmp(sep->arg[1], "pursuepriority")) { else if (!strcasecmp(sep->arg[1], "pursuepriority")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellTypePriority(spellType, BotPriorityCategories::Pursue, myBot->GetDefaultSpellTypePriority(spellType, BotPriorityCategories::Pursue, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Pursue, my_bot->GetDefaultSpellTypePriority(spell_type, BotPriorityCategories::Pursue, my_bot->GetClass(), bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellTypePriority(i, BotPriorityCategories::Pursue, myBot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Pursue, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(i, BotPriorityCategories::Pursue, my_bot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Pursue, my_bot->GetClass(), bot_stance));
} }
} }
output = "pursue priority settings"; output = "pursue priority settings";
} }
else if (!strcasecmp(sep->arg[1], "targetcounts")) { else if (!strcasecmp(sep->arg[1], "targetcounts")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellTypeAEOrGroupTargetCount(spellType, myBot->GetDefaultSpellTypeAEOrGroupTargetCount(spellType, botStance)); my_bot->SetSpellTypeAEOrGroupTargetCount(spell_type, my_bot->GetDefaultSpellTypeAEOrGroupTargetCount(spell_type, bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellTypeAEOrGroupTargetCount(i, myBot->GetDefaultSpellTypeAEOrGroupTargetCount(i, botStance)); my_bot->SetSpellTypeAEOrGroupTargetCount(i, my_bot->GetDefaultSpellTypeAEOrGroupTargetCount(i, bot_stance));
} }
} }
output = "target count settings"; output = "target count settings";
} }
else if (!strcasecmp(sep->arg[1], "spellsettings")) { else if (!strcasecmp(sep->arg[1], "spellsettings")) {
myBot->ResetBotSpellSettings(); my_bot->ResetBotSpellSettings();
output = "^spellsettings"; output = "^spellsettings";
} }
else if (!strcasecmp(sep->arg[1], "spelltypesettings")) { else if (!strcasecmp(sep->arg[1], "spelltypesettings")) {
if (spellType != UINT16_MAX) { if (spell_type != UINT16_MAX) {
myBot->SetSpellHold(spellType, myBot->GetDefaultSpellHold(spellType, botStance)); my_bot->SetSpellHold(spell_type, my_bot->GetDefaultSpellHold(SpellType, bot_stance));
myBot->SetSpellDelay(spellType, myBot->GetDefaultSpellDelay(spellType, botStance)); my_bot->SetSpellDelay(spell_type, my_bot->GetDefaultSpellDelay(spell_type, bot_stance));
myBot->SetSpellMinThreshold(spellType, myBot->GetDefaultSpellMinThreshold(spellType, botStance)); my_bot->SetSpellMinThreshold(spell_type, my_bot->GetDefaultSpellMinThreshold(spell_type, bot_stance));
myBot->SetSpellMaxThreshold(spellType, myBot->GetDefaultSpellMaxThreshold(spellType, botStance)); my_bot->SetSpellMaxThreshold(spell_type, my_bot->GetDefaultSpellMaxThreshold(spell_type, bot_stance));
myBot->SetSpellTypeAggroCheck(spellType, myBot->GetDefaultSpellTypeAggroCheck(spellType, botStance)); my_bot->SetSpellTypeAggroCheck(spell_type, my_bot->GetDefaultSpellTypeAggroCheck(spell_type, bot_stance));
myBot->SetSpellTypeMinManaLimit(spellType, myBot->GetDefaultSpellTypeMinManaLimit(spellType, botStance)); my_bot->SetSpellTypeMinManaLimit(spell_type, my_bot->GetDefaultSpellTypeMinManaLimit(spell_type, bot_stance));
myBot->SetSpellTypeMaxManaLimit(spellType, myBot->GetDefaultSpellTypeMaxManaLimit(spellType, botStance)); my_bot->SetSpellTypeMaxManaLimit(spell_type, my_bot->GetDefaultSpellTypeMaxManaLimit(spell_type, bot_stance));
myBot->SetSpellTypeMinHPLimit(spellType, myBot->GetDefaultSpellTypeMinHPLimit(spellType, botStance)); my_bot->SetSpellTypeMinHPLimit(spell_type, my_bot->GetDefaultSpellTypeMinHPLimit(spell_type, bot_stance));
myBot->SetSpellTypeMaxHPLimit(spellType, myBot->GetDefaultSpellTypeMaxHPLimit(spellType, botStance)); my_bot->SetSpellTypeMaxHPLimit(spell_type, my_bot->GetDefaultSpellTypeMaxHPLimit(spell_type, bot_stance));
myBot->SetSpellTypePriority(spellType, BotPriorityCategories::Idle, myBot->GetDefaultSpellTypePriority(spellType, BotPriorityCategories::Idle, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Idle, my_bot->GetDefaultSpellTypePriority(spell_type, BotPriorityCategories::Idle, my_bot->GetClass(), bot_stance));
myBot->SetSpellTypePriority(spellType, BotPriorityCategories::Engaged, myBot->GetDefaultSpellTypePriority(spellType, BotPriorityCategories::Engaged, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Engaged, my_bot->GetDefaultSpellTypePriority(spell_type, BotPriorityCategories::Engaged, my_bot->GetClass(), bot_stance));
myBot->SetSpellTypePriority(spellType, BotPriorityCategories::Pursue, myBot->GetDefaultSpellTypePriority(spellType, BotPriorityCategories::Pursue, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Pursue, my_bot->GetDefaultSpellTypePriority(spell_type, BotPriorityCategories::Pursue, my_bot->GetClass(), bot_stance));
myBot->SetSpellTypeAEOrGroupTargetCount(spellType, myBot->GetDefaultSpellTypeAEOrGroupTargetCount(spellType, botStance)); my_bot->SetSpellTypeAEOrGroupTargetCount(spell_type, my_bot->GetDefaultSpellTypeAEOrGroupTargetCount(spell_type, bot_stance));
} }
else { else {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellHold(i, myBot->GetDefaultSpellHold(i, botStance)); my_bot->SetSpellHold(i, my_bot->GetDefaultSpellHold(i, bot_stance));
myBot->SetSpellDelay(i, myBot->GetDefaultSpellDelay(i, botStance)); my_bot->SetSpellDelay(i, my_bot->GetDefaultSpellDelay(i, bot_stance));
myBot->SetSpellMinThreshold(i, myBot->GetDefaultSpellMinThreshold(i, botStance)); my_bot->SetSpellMinThreshold(i, my_bot->GetDefaultSpellMinThreshold(i, bot_stance));
myBot->SetSpellMaxThreshold(i, myBot->GetDefaultSpellMaxThreshold(i, botStance)); my_bot->SetSpellMaxThreshold(i, my_bot->GetDefaultSpellMaxThreshold(i, bot_stance));
myBot->SetSpellTypeAggroCheck(i, myBot->GetDefaultSpellTypeAggroCheck(i, botStance)); my_bot->SetSpellTypeAggroCheck(i, my_bot->GetDefaultSpellTypeAggroCheck(i, bot_stance));
myBot->SetSpellTypeMinManaLimit(i, myBot->GetDefaultSpellTypeMinManaLimit(i, botStance)); my_bot->SetSpellTypeMinManaLimit(i, my_bot->GetDefaultSpellTypeMinManaLimit(i, bot_stance));
myBot->SetSpellTypeMaxManaLimit(i, myBot->GetDefaultSpellTypeMaxManaLimit(i, botStance)); my_bot->SetSpellTypeMaxManaLimit(i, my_bot->GetDefaultSpellTypeMaxManaLimit(i, bot_stance));
myBot->SetSpellTypeMinHPLimit(i, myBot->GetDefaultSpellTypeMinHPLimit(i, botStance)); my_bot->SetSpellTypeMinHPLimit(i, my_bot->GetDefaultSpellTypeMinHPLimit(i, bot_stance));
myBot->SetSpellTypeMaxHPLimit(i, myBot->GetDefaultSpellTypeMaxHPLimit(i, botStance)); my_bot->SetSpellTypeMaxHPLimit(i, my_bot->GetDefaultSpellTypeMaxHPLimit(i, bot_stance));
myBot->SetSpellTypePriority(i, BotPriorityCategories::Idle, myBot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Idle, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(i, BotPriorityCategories::Idle, my_bot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Idle, my_bot->GetClass(), bot_stance));
myBot->SetSpellTypePriority(i, BotPriorityCategories::Engaged, myBot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Engaged, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(i, BotPriorityCategories::Engaged, my_bot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Engaged, my_bot->GetClass(), bot_stance));
myBot->SetSpellTypePriority(i, BotPriorityCategories::Pursue, myBot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Pursue, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(i, BotPriorityCategories::Pursue, my_bot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Pursue, my_bot->GetClass(), bot_stance));
myBot->SetSpellTypeAEOrGroupTargetCount(i, myBot->GetDefaultSpellTypeAEOrGroupTargetCount(i, botStance)); my_bot->SetSpellTypeAEOrGroupTargetCount(i, my_bot->GetDefaultSpellTypeAEOrGroupTargetCount(i, bot_stance));
} }
} }
@@ -410,29 +410,29 @@ void bot_command_default_settings(Client* c, const Seperator* sep)
} }
else if (!strcasecmp(sep->arg[1], "all")) { else if (!strcasecmp(sep->arg[1], "all")) {
for (uint16 i = BotBaseSettings::START; i <= BotBaseSettings::END; ++i) { for (uint16 i = BotBaseSettings::START; i <= BotBaseSettings::END; ++i) {
myBot->SetBotBaseSetting(i, myBot->GetDefaultBotBaseSetting(i, botStance)); my_bot->SetBotBaseSetting(i, my_bot->GetDefaultBotBaseSetting(i, bot_stance));
} }
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
myBot->SetSpellHold(i, myBot->GetDefaultSpellHold(i, botStance)); my_bot->SetSpellHold(i, my_bot->GetDefaultSpellHold(i, bot_stance));
myBot->SetSpellDelay(i, myBot->GetDefaultSpellDelay(i, botStance)); my_bot->SetSpellDelay(i, my_bot->GetDefaultSpellDelay(i, bot_stance));
myBot->SetSpellMinThreshold(i, myBot->GetDefaultSpellMinThreshold(i, botStance)); my_bot->SetSpellMinThreshold(i, my_bot->GetDefaultSpellMinThreshold(i, bot_stance));
myBot->SetSpellMaxThreshold(i, myBot->GetDefaultSpellMaxThreshold(i, botStance)); my_bot->SetSpellMaxThreshold(i, my_bot->GetDefaultSpellMaxThreshold(i, bot_stance));
myBot->SetSpellTypeAggroCheck(i, myBot->GetDefaultSpellTypeAggroCheck(i, botStance)); my_bot->SetSpellTypeAggroCheck(i, my_bot->GetDefaultSpellTypeAggroCheck(i, bot_stance));
myBot->SetSpellTypeMinManaLimit(i, myBot->GetDefaultSpellTypeMinManaLimit(i, botStance)); my_bot->SetSpellTypeMinManaLimit(i, my_bot->GetDefaultSpellTypeMinManaLimit(i, bot_stance));
myBot->SetSpellTypeMaxManaLimit(i, myBot->GetDefaultSpellTypeMaxManaLimit(i, botStance)); my_bot->SetSpellTypeMaxManaLimit(i, my_bot->GetDefaultSpellTypeMaxManaLimit(i, bot_stance));
myBot->SetSpellTypeMinHPLimit(i, myBot->GetDefaultSpellTypeMinHPLimit(i, botStance)); my_bot->SetSpellTypeMinHPLimit(i, my_bot->GetDefaultSpellTypeMinHPLimit(i, bot_stance));
myBot->SetSpellTypeMaxHPLimit(i, myBot->GetDefaultSpellTypeMaxHPLimit(i, botStance)); my_bot->SetSpellTypeMaxHPLimit(i, my_bot->GetDefaultSpellTypeMaxHPLimit(i, bot_stance));
myBot->SetSpellTypePriority(i, BotPriorityCategories::Idle, myBot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Idle, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(i, BotPriorityCategories::Idle, my_bot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Idle, my_bot->GetClass(), bot_stance));
myBot->SetSpellTypePriority(i, BotPriorityCategories::Engaged, myBot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Engaged, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(i, BotPriorityCategories::Engaged, my_bot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Engaged, my_bot->GetClass(), bot_stance));
myBot->SetSpellTypePriority(i, BotPriorityCategories::Pursue, myBot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Pursue, myBot->GetClass(), botStance)); my_bot->SetSpellTypePriority(i, BotPriorityCategories::Pursue, my_bot->GetDefaultSpellTypePriority(i, BotPriorityCategories::Pursue, my_bot->GetClass(), bot_stance));
myBot->SetSpellTypeAEOrGroupTargetCount(i, myBot->GetDefaultSpellTypeAEOrGroupTargetCount(i, botStance)); my_bot->SetSpellTypeAEOrGroupTargetCount(i, my_bot->GetDefaultSpellTypeAEOrGroupTargetCount(i, bot_stance));
}; };
myBot->ResetBotSpellSettings(); my_bot->ResetBotSpellSettings();
myBot->ClearBotBlockedBuffs(); my_bot->ClearBotBlockedBuffs();
myBot->Save(); my_bot->Save();
output = "settings"; output = "settings";
@@ -448,9 +448,9 @@ void bot_command_default_settings(Client* c, const Seperator* sep)
"{} says, '{}{} were restored.'", "{} says, '{}{} were restored.'",
first_found->GetCleanName(), first_found->GetCleanName(),
( (
spellType != UINT16_MAX ? spell_type != UINT16_MAX ?
fmt::format("My [{}] ", fmt::format("My [{}] ",
c->GetSpellTypeNameByID(spellType) c->GetSpellTypeNameByID(spell_type)
) )
: "My " : "My "
), ),
@@ -465,9 +465,9 @@ void bot_command_default_settings(Client* c, const Seperator* sep)
"{} of your bot's{}{} were restored.", "{} of your bot's{}{} were restored.",
success_count, success_count,
( (
spellType != UINT16_MAX ? spell_type != UINT16_MAX ?
fmt::format(" [{}] ", fmt::format(" [{}] ",
c->GetSpellTypeNameByID(spellType) c->GetSpellTypeNameByID(spell_type)
) )
: " " : " "
), ),
+20 -20
View File
@@ -131,13 +131,13 @@ void bot_command_depart(Client* c, const Seperator* sep)
tar = c; tar = c;
} }
std::string argString = sep->arg[ab_arg]; std::string arg_string = sep->arg[ab_arg];
const int ab_mask = ActionableBots::ABM_Type1; const int ab_mask = ActionableBots::ABM_Type1;
std::string actionableArg = sep->arg[ab_arg]; std::string actionable_arg = sep->arg[ab_arg];
if (actionableArg.empty()) { if (actionable_arg.empty()) {
actionableArg = "spawned"; actionable_arg = "spawned";
} }
std::string class_race_arg = sep->arg[ab_arg]; std::string class_race_arg = sep->arg[ab_arg];
@@ -149,19 +149,19 @@ void bot_command_depart(Client* c, const Seperator* sep)
std::vector<Bot*> sbl; std::vector<Bot*> sbl;
if (ActionableBots::PopulateSBL(c, actionableArg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) { if (ActionableBots::PopulateSBL(c, actionable_arg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) {
return; return;
} }
sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end()); sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end());
BotSpell botSpell; BotSpell bot_spell;
botSpell.SpellId = 0; bot_spell.SpellId = 0;
botSpell.SpellIndex = 0; bot_spell.SpellIndex = 0;
botSpell.ManaCost = 0; bot_spell.ManaCost = 0;
bool isSuccess = false; bool is_success = false;
std::map<std::string, std::pair<uint8_t, uint8_t>> listZones; std::map<std::string, std::pair<uint8_t, uint8_t>> list_zones;
for (auto bot_iter : sbl) { for (auto bot_iter : sbl) {
if (!bot_iter->IsInGroupOrRaid(tar, !single)) { if (!bot_iter->IsInGroupOrRaid(tar, !single)) {
@@ -172,9 +172,9 @@ void bot_command_depart(Client* c, const Seperator* sep)
continue; continue;
} }
std::vector<BotSpell_wPriority> botSpellListItr = bot_iter->GetPrioritizedBotSpellsBySpellType(bot_iter, BotSpellTypes::Teleport, tar); std::vector<BotSpell_wPriority> bot_spell_list_itr = bot_iter->GetPrioritizedBotSpellsBySpellType(bot_iter, BotSpellTypes::Teleport, tar);
for (std::vector<BotSpell_wPriority>::iterator itr = botSpellListItr.begin(); itr != botSpellListItr.end(); ++itr) { for (std::vector<BotSpell_wPriority>::iterator itr = bot_spell_list_itr.begin(); itr != bot_spell_list_itr.end(); ++itr) {
if (!IsValidSpell(itr->SpellId)) { if (!IsValidSpell(itr->SpellId)) {
continue; continue;
} }
@@ -188,9 +188,9 @@ void bot_command_depart(Client* c, const Seperator* sep)
} }
if (list) { if (list) {
auto it = listZones.find(spells[itr->SpellId].teleport_zone); auto it = list_zones.find(spells[itr->SpellId].teleport_zone);
if (it != listZones.end()) { if (it != list_zones.end()) {
const auto& [val1, val2] = it->second; const auto& [val1, val2] = it->second;
if (val1 == spells[itr->SpellId].target_type && val2 == bot_iter->GetClass()) { if (val1 == spells[itr->SpellId].target_type && val2 == bot_iter->GetClass()) {
@@ -214,7 +214,7 @@ void bot_command_depart(Client* c, const Seperator* sep)
).c_str() ).c_str()
); );
listZones.insert({ spells[itr->SpellId].teleport_zone, {spells[itr->SpellId].target_type, bot_iter->GetClass()} }); list_zones.insert({ spells[itr->SpellId].teleport_zone, {spells[itr->SpellId].target_type, bot_iter->GetClass()} });
continue; continue;
} }
@@ -268,12 +268,12 @@ void bot_command_depart(Client* c, const Seperator* sep)
); );
} }
isSuccess = true; is_success = true;
} }
bot_iter->SetCommandedSpell(false); bot_iter->SetCommandedSpell(false);
if (isSuccess) { if (is_success) {
return; return;
} }
else { else {
@@ -283,8 +283,8 @@ void bot_command_depart(Client* c, const Seperator* sep)
} }
if ( if (
(list && listZones.empty()) || (list && list_zones.empty()) ||
(!list && !isSuccess) (!list && !is_success)
) { ) {
c->Message( c->Message(
Chat::Yellow, Chat::Yellow,
+33 -33
View File
@@ -122,10 +122,10 @@ void bot_command_discipline(Client* c, const Seperator* sep)
} }
const int ab_mask = ActionableBots::ABM_Type1; const int ab_mask = ActionableBots::ABM_Type1;
std::string actionableArg = sep->arg[ab_arg]; std::string actionable_arg = sep->arg[ab_arg];
if (actionableArg.empty()) { if (actionable_arg.empty()) {
actionableArg = "spawned"; actionable_arg = "spawned";
} }
std::string class_race_arg = sep->arg[ab_arg]; std::string class_race_arg = sep->arg[ab_arg];
@@ -137,15 +137,15 @@ void bot_command_discipline(Client* c, const Seperator* sep)
std::vector<Bot*> sbl; std::vector<Bot*> sbl;
if (ActionableBots::PopulateSBL(c, actionableArg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) { if (ActionableBots::PopulateSBL(c, actionable_arg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) {
return; return;
} }
sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end()); sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end());
bool isSuccess = false; bool is_success = false;
uint16 successCount = 0; uint16 success_count = 0;
Bot* firstFound = nullptr; Bot* first_found = nullptr;
for (auto bot_iter : sbl) { for (auto bot_iter : sbl) {
if (!bot_iter->IsInGroupOrRaid(c)) { if (!bot_iter->IsInGroupOrRaid(c)) {
@@ -157,22 +157,22 @@ void bot_command_discipline(Client* c, const Seperator* sep)
} }
if (spell_id == UINT16_MAX) { // Aggressive/Defensive type if (spell_id == UINT16_MAX) { // Aggressive/Defensive type
std::vector<BotSpells_Struct_wIndex> botSpellList; std::vector<BotSpells_Struct_wIndex> bot_spell_list;
if (aggressive) { if (aggressive) {
botSpellList = bot_iter->BotGetSpellsByType(BotSpellTypes::DiscAggressive); bot_spell_list = bot_iter->BotGetSpellsByType(BotSpellTypes::DiscAggressive);
} }
else if (defensive) { else if (defensive) {
botSpellList = bot_iter->BotGetSpellsByType(BotSpellTypes::DiscDefensive); bot_spell_list = bot_iter->BotGetSpellsByType(BotSpellTypes::DiscDefensive);
} }
for (int i = botSpellList.size() - 1; i >= 0; i--) { for (int i = bot_spell_list.size() - 1; i >= 0; i--) {
if (!IsValidSpell(botSpellList[i].spellid)) { if (!IsValidSpell(bot_spell_list[i].spellid)) {
continue; continue;
} }
if (!bot_iter->CheckDisciplineReuseTimer(botSpellList[i].spellid)) { if (!bot_iter->CheckDisciplineReuseTimer(bot_spell_list[i].spellid)) {
uint32 remaining_time = (bot_iter->GetDisciplineReuseRemainingTime(botSpellList[i].spellid) / 1000); uint32 remaining_time = (bot_iter->GetDisciplineReuseRemainingTime(bot_spell_list[i].spellid) / 1000);
bot_iter->OwnerMessage( bot_iter->OwnerMessage(
fmt::format( fmt::format(
@@ -184,30 +184,30 @@ void bot_command_discipline(Client* c, const Seperator* sep)
continue; continue;
} }
if (bot_iter->GetEndurance() < spells[botSpellList[i].spellid].endurance_cost) { if (bot_iter->GetEndurance() < spells[bot_spell_list[i].spellid].endurance_cost) {
continue; continue;
} }
if (bot_iter->DivineAura() && !IsCastNotStandingSpell(botSpellList[i].spellid)) { if (bot_iter->DivineAura() && !IsCastNotStandingSpell(bot_spell_list[i].spellid)) {
continue; continue;
} }
if (spells[botSpellList[i].spellid].buff_duration_formula != 0 && spells[botSpellList[i].spellid].target_type == ST_Self && bot_iter->HasDiscBuff()) { if (spells[bot_spell_list[i].spellid].buff_duration_formula != 0 && spells[bot_spell_list[i].spellid].target_type == ST_Self && bot_iter->HasDiscBuff()) {
continue; continue;
} }
if (!tar || (spells[botSpellList[i].spellid].target_type == ST_Self && tar != bot_iter)) { if (!tar || (spells[bot_spell_list[i].spellid].target_type == ST_Self && tar != bot_iter)) {
tar = bot_iter; tar = bot_iter;
} }
if (bot_iter->AttemptForcedCastSpell(tar, botSpellList[i].spellid, true)) { if (bot_iter->AttemptForcedCastSpell(tar, bot_spell_list[i].spellid, true)) {
if (!firstFound) { if (!first_found) {
firstFound = bot_iter; first_found = bot_iter;
} }
isSuccess = true; is_success = true;
++successCount; ++success_count;
spell_id = botSpellList[i].spellid; spell_id = bot_spell_list[i].spellid;
} }
} }
} }
@@ -252,19 +252,19 @@ void bot_command_discipline(Client* c, const Seperator* sep)
} }
if (bot_iter->AttemptForcedCastSpell(tar, spell_id, true)) { if (bot_iter->AttemptForcedCastSpell(tar, spell_id, true)) {
if (!firstFound) { if (!first_found) {
firstFound = bot_iter; first_found = bot_iter;
} }
isSuccess = true; is_success = true;
++successCount; ++success_count;
} }
} }
continue; continue;
} }
if (!isSuccess) { if (!is_success) {
c->Message(Chat::Yellow, "No bots were selected."); c->Message(Chat::Yellow, "No bots were selected.");
} }
else { else {
@@ -273,8 +273,8 @@ void bot_command_discipline(Client* c, const Seperator* sep)
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
"{} {} {} {} discipline.", "{} {} {} {} discipline.",
((successCount == 1 && firstFound) ? firstFound->GetCleanName() : (fmt::format("{}", successCount).c_str())), ((success_count == 1 && first_found) ? first_found->GetCleanName() : (fmt::format("{}", success_count).c_str())),
((successCount == 1 && firstFound) ? "used" : "of your bots used"), ((success_count == 1 && first_found) ? "used" : "of your bots used"),
(aggressive ? "an" : "a"), (aggressive ? "an" : "a"),
(aggressive ? "aggressive" : "defensive") (aggressive ? "aggressive" : "defensive")
).c_str() ).c_str()
@@ -285,8 +285,8 @@ void bot_command_discipline(Client* c, const Seperator* sep)
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
"{} {} their {} [#{}] discipline.", "{} {} their {} [#{}] discipline.",
((successCount == 1 && firstFound) ? firstFound->GetCleanName() : (fmt::format("{}", successCount).c_str())), ((success_count == 1 && first_found) ? first_found->GetCleanName() : (fmt::format("{}", success_count).c_str())),
((successCount == 1 && firstFound) ? "used" : "of your bots used"), ((success_count == 1 && first_found) ? "used" : "of your bots used"),
spells[spell_id].name, spells[spell_id].name,
spell_id spell_id
).c_str() ).c_str()
+19 -19
View File
@@ -82,7 +82,7 @@ void bot_command_follow(Client* c, const Seperator* sep)
bool chain = false; bool chain = false;
bool reset = false; bool reset = false;
bool currentCheck = false; bool current_check = false;
int ab_arg = 1; int ab_arg = 1;
Mob* target_mob = nullptr; Mob* target_mob = nullptr;
@@ -94,7 +94,7 @@ void bot_command_follow(Client* c, const Seperator* sep)
++ab_arg; ++ab_arg;
} }
else if (!optional_arg.compare("current")) { else if (!optional_arg.compare("current")) {
currentCheck = true; current_check = true;
++ab_arg; ++ab_arg;
} }
else { else {
@@ -124,13 +124,13 @@ void bot_command_follow(Client* c, const Seperator* sep)
sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end()); sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end());
auto botCount = sbl.size(); auto bot_count = sbl.size();
Mob* follow_mob = nullptr; Mob* follow_mob = nullptr;
std::list<Bot*> chainList; std::list<Bot*> chain_list;
std::list<Bot*>::const_iterator it = chainList.begin(); std::list<Bot*>::const_iterator it = chain_list.begin();
uint16 count = 0; uint16 count = 0;
for (auto bot_iter : sbl) { for (auto bot_iter : sbl) {
if (currentCheck) { if (current_check) {
follow_mob = entity_list.GetMob(bot_iter->GetFollowID()); follow_mob = entity_list.GetMob(bot_iter->GetFollowID());
c->Message( c->Message(
@@ -150,7 +150,7 @@ void bot_command_follow(Client* c, const Seperator* sep)
} }
if (bot_iter == target_mob) { if (bot_iter == target_mob) {
if (botCount == 1) { if (bot_count == 1) {
c->Message( c->Message(
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
@@ -167,13 +167,13 @@ void bot_command_follow(Client* c, const Seperator* sep)
} }
bot_iter->WipeHateList(); bot_iter->WipeHateList();
--botCount; --bot_count;
continue; continue;
} }
if (!bot_iter->IsInGroupOrRaid(target_mob)) { if (!bot_iter->IsInGroupOrRaid(target_mob)) {
--botCount; --bot_count;
continue; continue;
} }
@@ -191,20 +191,20 @@ void bot_command_follow(Client* c, const Seperator* sep)
} }
else { else {
if (chain) { if (chain) {
Mob* nextTar = target_mob; Mob* next_tar = target_mob;
if (count > 0) { if (count > 0) {
nextTar = *it; next_tar = *it;
if (!nextTar) { if (!next_tar) {
nextTar = target_mob; next_tar = target_mob;
} }
} }
chainList.push_back(bot_iter); chain_list.push_back(bot_iter);
++it; ++it;
++count; ++count;
bot_iter->SetFollowID(nextTar->GetID()); bot_iter->SetFollowID(next_tar->GetID());
} }
else { else {
bot_iter->SetFollowID(target_mob->GetID()); bot_iter->SetFollowID(target_mob->GetID());
@@ -222,13 +222,13 @@ void bot_command_follow(Client* c, const Seperator* sep)
bot_iter->GetPet()->SetFollowID(bot_iter->GetID()); bot_iter->GetPet()->SetFollowID(bot_iter->GetID());
} }
if (currentCheck || !botCount) { if (current_check || !bot_count) {
return; return;
} }
follow_mob = target_mob; follow_mob = target_mob;
if (botCount == 1) { if (bot_count == 1) {
follow_mob = entity_list.GetMob(sbl.front()->GetFollowID()); follow_mob = entity_list.GetMob(sbl.front()->GetFollowID());
c->Message( c->Message(
@@ -246,7 +246,7 @@ void bot_command_follow(Client* c, const Seperator* sep)
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"{} of your bots are following you.", "{} of your bots are following you.",
botCount bot_count
).c_str() ).c_str()
); );
} }
@@ -255,7 +255,7 @@ void bot_command_follow(Client* c, const Seperator* sep)
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"{} of your bots are {} {}.", "{} of your bots are {} {}.",
botCount, bot_count,
chain ? "chain following" : "following", chain ? "chain following" : "following",
follow_mob ? follow_mob->GetCleanName() : "you" follow_mob ? follow_mob->GetCleanName() : "you"
).c_str() ).c_str()
+5 -5
View File
@@ -82,12 +82,12 @@ void bot_command_illusion_block(Client* c, const Seperator* sep)
int ab_arg = 1; int ab_arg = 1;
bool current_check = false; bool current_check = false;
uint32 typeValue = 0; uint32 type_value = 0;
if (sep->IsNumber(1)) { if (sep->IsNumber(1)) {
typeValue = atoi(sep->arg[1]); type_value = atoi(sep->arg[1]);
++ab_arg; ++ab_arg;
if (typeValue < 0 || typeValue > 1) { if (type_value < 0 || type_value > 1) {
c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled."); c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled.");
return; return;
@@ -147,7 +147,7 @@ void bot_command_illusion_block(Client* c, const Seperator* sep)
); );
} }
else { else {
my_bot->SetIllusionBlock(typeValue); my_bot->SetIllusionBlock(type_value);
++success_count; ++success_count;
} }
} }
@@ -168,7 +168,7 @@ void bot_command_illusion_block(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots {} block illusions.", "{} of your bots {} block illusions.",
success_count, success_count,
typeValue ? "will now" : "will no longer" type_value ? "will now" : "will no longer"
).c_str() ).c_str()
); );
} }
+4 -4
View File
@@ -123,10 +123,10 @@ void bot_command_item_use(Client* c, const Seperator* sep)
} }
const int ab_mask = ActionableBots::ABM_Type1; const int ab_mask = ActionableBots::ABM_Type1;
std::string actionableArg = sep->arg[ab_arg]; std::string actionable_arg = sep->arg[ab_arg];
if (actionableArg.empty()) { if (actionable_arg.empty()) {
actionableArg = "spawned"; actionable_arg = "spawned";
} }
std::string class_race_arg = sep->arg[ab_arg]; std::string class_race_arg = sep->arg[ab_arg];
@@ -138,7 +138,7 @@ void bot_command_item_use(Client* c, const Seperator* sep)
std::vector<Bot*> sbl; std::vector<Bot*> sbl;
if (ActionableBots::PopulateSBL(c, actionableArg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) { if (ActionableBots::PopulateSBL(c, actionable_arg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) {
return; return;
} }
+5 -5
View File
@@ -81,12 +81,12 @@ void bot_command_max_melee_range(Client* c, const Seperator* sep)
int ab_arg = 1; int ab_arg = 1;
bool current_check = false; bool current_check = false;
uint32 typeValue = 0; uint32 type_value = 0;
if (sep->IsNumber(1)) { if (sep->IsNumber(1)) {
typeValue = atoi(sep->arg[1]); type_value = atoi(sep->arg[1]);
++ab_arg; ++ab_arg;
if (typeValue < 0 || typeValue > 1) { if (type_value < 0 || type_value > 1) {
c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled."); c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled.");
return; return;
@@ -146,7 +146,7 @@ void bot_command_max_melee_range(Client* c, const Seperator* sep)
); );
} }
else { else {
my_bot->SetMaxMeleeRange(typeValue); my_bot->SetMaxMeleeRange(type_value);
++success_count; ++success_count;
} }
} }
@@ -167,7 +167,7 @@ void bot_command_max_melee_range(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots {} stay at max melee range.", "{} of your bots {} stay at max melee range.",
success_count, success_count,
typeValue ? "will now" : "will no longer" type_value ? "will now" : "will no longer"
).c_str() ).c_str()
); );
} }
+58 -69
View File
@@ -228,10 +228,10 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep)
} }
const int ab_mask = ActionableBots::ABM_Type1; const int ab_mask = ActionableBots::ABM_Type1;
std::string actionableArg = sep->arg[ab_arg]; std::string actionable_arg = sep->arg[ab_arg];
if (actionableArg.empty()) { if (actionable_arg.empty()) {
actionableArg = "target"; actionable_arg = "target";
} }
std::string class_race_arg = sep->arg[ab_arg]; std::string class_race_arg = sep->arg[ab_arg];
@@ -243,17 +243,17 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep)
std::vector<Bot*> sbl; std::vector<Bot*> sbl;
if (ActionableBots::PopulateSBL(c, actionableArg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) { if (ActionableBots::PopulateSBL(c, actionable_arg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) {
return; return;
} }
sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end()); sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end());
std::string currentType; std::string current_type;
uint16 reclaim_energy_id = RuleI(Bots, ReclaimEnergySpellID); uint16 reclaim_energy_id = RuleI(Bots, ReclaimEnergySpellID);
bool isSuccess = false; bool is_success = false;
uint16 successCount = 0; uint16 success_count = 0;
Bot* firstFound = nullptr; Bot* first_found = nullptr;
for (auto bot_iter : sbl) { for (auto bot_iter : sbl) {
if (bot_iter->GetClass() != Class::Magician) { if (bot_iter->GetClass() != Class::Magician) {
@@ -284,28 +284,28 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep)
if (current_check) { if (current_check) {
switch (bot_iter->GetPetChooserID()) { switch (bot_iter->GetPetChooserID()) {
case 0: case 0:
currentType = "auto"; current_type = "auto";
break; break;
case SumWater: case SumWater:
currentType = "water"; current_type = "water";
break; break;
case SumFire: case SumFire:
currentType = "fire"; current_type = "fire";
break; break;
case SumAir: case SumAir:
currentType = "air"; current_type = "air";
break; break;
case SumEarth: case SumEarth:
currentType = "earth"; current_type = "earth";
break; break;
case MonsterSum: case MonsterSum:
currentType = "monster"; current_type = "monster";
break; break;
case SumMageMultiElement: case SumMageMultiElement:
currentType = "epic"; current_type = "epic";
break; break;
default: default:
currentType = "null"; current_type = "null";
break; break;
} }
@@ -314,22 +314,22 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep)
fmt::format( fmt::format(
"{} says, 'I'm currently summoning {} pets.'", "{} says, 'I'm currently summoning {} pets.'",
bot_iter->GetCleanName(), bot_iter->GetCleanName(),
currentType current_type
).c_str() ).c_str()
); );
continue; continue;
} }
uint8 airMinLevel = 255; uint8 air_min_level = 255;
uint8 fireMinLevel = 255; uint8 fire_min_level = 255;
uint8 waterMinLevel = 255; uint8 water_min_level = 255;
uint8 earthMinLevel = 255; uint8 earth_min_level = 255;
uint8 monsterMinLevel = 255; uint8 monster_min_level = 255;
uint8 epicMinLevel = 255; uint8 epic_min_level = 255;
std::list<BotSpell> botSpellList = bot_iter->GetBotSpellsBySpellType(bot_iter, BotSpellTypes::Pet); std::list<BotSpell> bot_spell_list = bot_iter->GetBotSpellsBySpellType(bot_iter, BotSpellTypes::Pet);
for (const auto& s : botSpellList) { for (const auto& s : bot_spell_list) {
if (!IsValidSpell(s.SpellId)) { if (!IsValidSpell(s.SpellId)) {
continue; continue;
} }
@@ -340,65 +340,54 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep)
auto spell = spells[s.SpellId]; auto spell = spells[s.SpellId];
if (!strncmp(spell.teleport_zone, "SumWater", 8) && spell.classes[Class::Magician - 1] < waterMinLevel) { if (!strncmp(spell.teleport_zone, "SumWater", 8) && spell.classes[Class::Magician - 1] < water_min_level) {
waterMinLevel = spell.classes[Class::Magician - 1]; water_min_level = spell.classes[Class::Magician - 1];
} }
else if (!strncmp(spell.teleport_zone, "SumFire", 7) && spell.classes[Class::Magician - 1] < fireMinLevel) { else if (!strncmp(spell.teleport_zone, "SumFire", 7) && spell.classes[Class::Magician - 1] < fire_min_level) {
fireMinLevel = spell.classes[Class::Magician - 1]; fire_min_level = spell.classes[Class::Magician - 1];
} }
else if (!strncmp(spell.teleport_zone, "SumAir", 6) && spell.classes[Class::Magician - 1] < airMinLevel) { else if (!strncmp(spell.teleport_zone, "SumAir", 6) && spell.classes[Class::Magician - 1] < air_min_level) {
airMinLevel = spell.classes[Class::Magician - 1]; air_min_level = spell.classes[Class::Magician - 1];
} }
else if (!strncmp(spell.teleport_zone, "SumEarth", 8) && spell.classes[Class::Magician - 1] < earthMinLevel) { else if (!strncmp(spell.teleport_zone, "SumEarth", 8) && spell.classes[Class::Magician - 1] < earth_min_level) {
earthMinLevel = spell.classes[Class::Magician - 1]; earth_min_level = spell.classes[Class::Magician - 1];
} }
else if (!strncmp(spell.teleport_zone, "MonsterSum", 10) && spell.classes[Class::Magician - 1] < monsterMinLevel) { else if (!strncmp(spell.teleport_zone, "MonsterSum", 10) && spell.classes[Class::Magician - 1] < monster_min_level) {
monsterMinLevel = spell.classes[Class::Magician - 1]; monster_min_level = spell.classes[Class::Magician - 1];
} }
} }
uint8 minLevel = std::min({ uint8 min_level = std::min({
waterMinLevel, water_min_level,
fireMinLevel, fire_min_level,
airMinLevel, air_min_level,
earthMinLevel, earth_min_level,
monsterMinLevel monster_min_level
}); });
epicMinLevel = RuleI(Bots, AllowMagicianEpicPetLevel); epic_min_level = RuleI(Bots, AllowMagicianEpicPetLevel);
LogTestDebug("{} says, 'minLevel = {} | waterMinLevel = {} | fireMinLevel = {} | airMinLevel = {} | earthMinLevel = {} | monsterMinLevel = {} | epicMinLevel = {}'",
bot_iter->GetCleanName(),
minLevel,
waterMinLevel,
fireMinLevel,
airMinLevel,
earthMinLevel,
monsterMinLevel,
epicMinLevel
); //deleteme
switch (pet_type) { switch (pet_type) {
case 0: case 0:
level_req = minLevel; level_req = min_level;
break; break;
case SumWater: case SumWater:
level_req = waterMinLevel; level_req = water_min_level;
break; break;
case SumFire: case SumFire:
level_req = fireMinLevel; level_req = fire_min_level;
break; break;
case SumAir: case SumAir:
level_req = airMinLevel; level_req = air_min_level;
break; break;
case SumEarth: case SumEarth:
level_req = earthMinLevel; level_req = earth_min_level;
break; break;
case MonsterSum: case MonsterSum:
level_req = monsterMinLevel; level_req = monster_min_level;
break; break;
case SumMageMultiElement: case SumMageMultiElement:
level_req = epicMinLevel; level_req = epic_min_level;
break; break;
default: default:
break; break;
@@ -416,31 +405,31 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep)
bot_iter->CastSpell(reclaim_energy_id, pet_id); bot_iter->CastSpell(reclaim_energy_id, pet_id);
} }
if (!firstFound) { if (!first_found) {
firstFound = bot_iter; first_found = bot_iter;
} }
isSuccess = true; is_success = true;
++successCount; ++success_count;
} }
if (current_check) { if (current_check) {
return; return;
} }
if (!isSuccess) { if (!is_success) {
c->Message(Chat::Yellow, "No bots were selected."); c->Message(Chat::Yellow, "No bots were selected.");
return; return;
} }
if (successCount == 1 && firstFound) { if (success_count == 1 && first_found) {
c->Message( c->Message(
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"{} says, 'I will now summon {} pets.'", "{} says, 'I will now summon {} pets.'",
firstFound->GetCleanName(), first_found->GetCleanName(),
currentType current_type
).c_str() ).c_str()
); );
} }
@@ -449,7 +438,7 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep)
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"{} of your bots will now summon {} pets.", "{} of your bots will now summon {} pets.",
successCount, success_count,
arg1 arg1
).c_str() ).c_str()
); );
+4 -4
View File
@@ -15,10 +15,10 @@ void bot_command_pull(Client *c, const Seperator *sep)
std::string arg1 = sep->arg[1]; std::string arg1 = sep->arg[1];
int ab_arg = 1; int ab_arg = 1;
std::string actionableArg = sep->arg[ab_arg]; std::string actionable_arg = sep->arg[ab_arg];
if (actionableArg.empty()) { if (actionable_arg.empty()) {
actionableArg = "spawned"; actionable_arg = "spawned";
} }
std::string class_race_arg = sep->arg[ab_arg]; std::string class_race_arg = sep->arg[ab_arg];
@@ -30,7 +30,7 @@ void bot_command_pull(Client *c, const Seperator *sep)
std::vector<Bot*> sbl; std::vector<Bot*> sbl;
if (ActionableBots::PopulateSBL(c, actionableArg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) { if (ActionableBots::PopulateSBL(c, actionable_arg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) {
return; return;
} }
+5 -5
View File
@@ -81,12 +81,12 @@ void bot_command_sit_hp_percent(Client* c, const Seperator* sep)
int ab_arg = 1; int ab_arg = 1;
bool current_check = false; bool current_check = false;
uint32 typeValue = 0; uint32 type_value = 0;
if (sep->IsNumber(1)) { if (sep->IsNumber(1)) {
typeValue = atoi(sep->arg[1]); type_value = atoi(sep->arg[1]);
++ab_arg; ++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 (0%% to 100%% of health)."); c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of health).");
return; return;
@@ -146,7 +146,7 @@ void bot_command_sit_hp_percent(Client* c, const Seperator* sep)
); );
} }
else { else {
my_bot->SetSitHPPct(typeValue); my_bot->SetSitHPPct(type_value);
++success_count; ++success_count;
} }
} }
@@ -167,7 +167,7 @@ void bot_command_sit_hp_percent(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots will now sit in combat whem at or below [{}%%] HP.'", "{} of your bots will now sit in combat whem at or below [{}%%] HP.'",
success_count, success_count,
typeValue type_value
).c_str() ).c_str()
); );
} }
+5 -5
View File
@@ -81,12 +81,12 @@ void bot_command_sit_in_combat(Client* c, const Seperator* sep)
int ab_arg = 1; int ab_arg = 1;
bool current_check = false; bool current_check = false;
uint32 typeValue = 0; uint32 type_value = 0;
if (sep->IsNumber(1)) { if (sep->IsNumber(1)) {
typeValue = atoi(sep->arg[1]); type_value = atoi(sep->arg[1]);
++ab_arg; ++ab_arg;
if (typeValue < 0 || typeValue > 1) { if (type_value < 0 || type_value > 1) {
c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled."); c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled.");
return; return;
@@ -146,7 +146,7 @@ void bot_command_sit_in_combat(Client* c, const Seperator* sep)
); );
} }
else { else {
my_bot->SetMedInCombat(typeValue); my_bot->SetMedInCombat(type_value);
++success_count; ++success_count;
} }
} }
@@ -167,7 +167,7 @@ void bot_command_sit_in_combat(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots {} sit in combat.", "{} of your bots {} sit in combat.",
success_count, success_count,
typeValue ? "will now" : "will no longer" type_value ? "will now" : "will no longer"
).c_str() ).c_str()
); );
} }
+5 -5
View File
@@ -81,12 +81,12 @@ void bot_command_sit_mana_percent(Client* c, const Seperator* sep)
int ab_arg = 1; int ab_arg = 1;
bool current_check = false; bool current_check = false;
uint32 typeValue = 0; uint32 type_value = 0;
if (sep->IsNumber(1)) { if (sep->IsNumber(1)) {
typeValue = atoi(sep->arg[1]); type_value = atoi(sep->arg[1]);
++ab_arg; ++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 (0%% to 100%% of health)."); c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of health).");
return; return;
@@ -146,7 +146,7 @@ void bot_command_sit_mana_percent(Client* c, const Seperator* sep)
); );
} }
else { else {
my_bot->SetSitManaPct(typeValue); my_bot->SetSitManaPct(type_value);
++success_count; ++success_count;
} }
} }
@@ -167,7 +167,7 @@ void bot_command_sit_mana_percent(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots will now sit in combat whem at or below [{}%%] mana.'", "{} of your bots will now sit in combat whem at or below [{}%%] mana.'",
success_count, success_count,
typeValue TypeValue
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -111,14 +111,14 @@ void bot_command_spell_aggro_checks(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -126,7 +126,7 @@ void bot_command_spell_aggro_checks(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -144,9 +144,9 @@ void bot_command_spell_aggro_checks(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++ab_arg;
if (typeValue < 0 || typeValue > 1) { if (type_value < 0 || type_value > 1) {
c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled."); c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled.");
return; return;
@@ -201,13 +201,13 @@ void bot_command_spell_aggro_checks(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] aggro check is currently [{}].'", "{} says, 'My [{}] aggro check is currently [{}].'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellTypeAggroCheck(spellType) ? "enabled" : "disabled" my_bot->GetSpellTypeAggroCheck(spell_type) ? "enabled" : "disabled"
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellTypeAggroCheck(spellType, typeValue); my_bot->SetSpellTypeAggroCheck(spell_type, type_value);
++success_count; ++success_count;
} }
} }
@@ -218,8 +218,8 @@ void bot_command_spell_aggro_checks(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] aggro check was [{}].'", "{} says, 'My [{}] aggro check was [{}].'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellTypeAggroCheck(spellType) ? "enabled" : "disabled" first_found->GetSpellTypeAggroCheck(spell_type) ? "enabled" : "disabled"
).c_str() ).c_str()
); );
} }
@@ -229,8 +229,8 @@ void bot_command_spell_aggro_checks(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots [{}] their [{}] aggro check.", "{} of your bots [{}] their [{}] aggro check.",
success_count, success_count,
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
typeValue ? "enabled" : "disabled" type_value ? "enabled" : "disabled"
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -117,14 +117,14 @@ void bot_command_spell_delays(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -132,7 +132,7 @@ void bot_command_spell_delays(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -150,9 +150,9 @@ void bot_command_spell_delays(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++ab_arg;
if (typeValue < 1 || typeValue > 60000) { if (type_value < 1 || type_value > 60000) {
c->Message(Chat::Yellow, "You must enter a value between 1-60000 (1ms to 60s)."); c->Message(Chat::Yellow, "You must enter a value between 1-60000 (1ms to 60s).");
return; return;
@@ -207,13 +207,13 @@ void bot_command_spell_delays(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] spell delay is currently [{}] seconds.'", "{} says, 'My [{}] spell delay is currently [{}] seconds.'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellDelay(spellType) / 1000.00 my_bot->GetSpellDelay(spell_type) / 1000.00
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellDelay(spellType, typeValue); my_bot->SetSpellDelay(spell_type, type_value);
++success_count; ++success_count;
} }
} }
@@ -224,8 +224,8 @@ void bot_command_spell_delays(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] spell delay was set to [{}] seconds.'", "{} says, 'My [{}] spell delay was set to [{}] seconds.'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellDelay(spellType) / 1000.00 first_found->GetSpellDelay(spell_type) / 1000.00
).c_str() ).c_str()
); );
} }
@@ -235,8 +235,8 @@ void bot_command_spell_delays(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots set their [{}] spell delay to [{}] seconds.", "{} of your bots set their [{}] spell delay to [{}] seconds.",
success_count, success_count,
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
typeValue / 1000.00 type_value / 1000.00
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -115,14 +115,14 @@ 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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -130,7 +130,7 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -148,9 +148,9 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++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."); c->Message(Chat::Yellow, "You must enter a value between 0-100.");
return; return;
@@ -205,13 +205,13 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] engaged cast priority is currently [{}].'", "{} says, 'My [{}] engaged cast priority is currently [{}].'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellTypePriority(spellType, BotPriorityCategories::Engaged) my_bot->GetSpellTypePriority(spell_type, BotPriorityCategories::Engaged)
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellTypePriority(spellType, BotPriorityCategories::Engaged, typeValue); my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Engaged, type_value);
++success_count; ++success_count;
} }
} }
@@ -222,8 +222,8 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] engaged cast priority was set to [{}].'", "{} says, 'My [{}] engaged cast priority was set to [{}].'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellTypePriority(spellType, BotPriorityCategories::Engaged) first_found->GetSpellTypePriority(spell_type, BotPriorityCategories::Engaged)
).c_str() ).c_str()
); );
} }
@@ -233,8 +233,8 @@ void bot_command_spell_engaged_priority(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots set their [{}] engaged cast priority to [{}].", "{} of your bots set their [{}] engaged cast priority to [{}].",
success_count, success_count,
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
typeValue type_value
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -101,14 +101,14 @@ void bot_command_spell_holds(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -116,7 +116,7 @@ void bot_command_spell_holds(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -134,9 +134,9 @@ void bot_command_spell_holds(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++ab_arg;
if (typeValue < 0 || typeValue > 1) { if (type_value < 0 || type_value > 1) {
c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled."); c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled.");
return; return;
@@ -186,13 +186,13 @@ void bot_command_spell_holds(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] spell hold is currently [{}].'", "{} says, 'My [{}] spell hold is currently [{}].'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellHold(spellType) ? "enabled" : "disabled" my_bot->GetSpellHold(spell_type) ? "enabled" : "disabled"
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellHold(spellType, typeValue); my_bot->SetSpellHold(spell_type, type_value);
++success_count; ++success_count;
} }
} }
@@ -203,8 +203,8 @@ void bot_command_spell_holds(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] spell hold was [{}].'", "{} says, 'My [{}] spell hold was [{}].'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellHold(spellType) ? "enabled" : "disabled" first_found->GetSpellHold(spell_type) ? "enabled" : "disabled"
).c_str() ).c_str()
); );
} }
@@ -214,8 +214,8 @@ void bot_command_spell_holds(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots [{}] their [{}] spell hold.", "{} of your bots [{}] their [{}] spell hold.",
success_count, success_count,
typeValue ? "enabled" : "disabled", type_value ? "enabled" : "disabled",
c->GetSpellTypeNameByID(spellType) c->GetSpellTypeNameByID(spell_type)
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -115,14 +115,14 @@ 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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -130,7 +130,7 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -148,9 +148,9 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++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."); c->Message(Chat::Yellow, "You must enter a value between 0-100.");
return; return;
@@ -205,13 +205,13 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] idle cast priority is currently [{}].'", "{} says, 'My [{}] idle cast priority is currently [{}].'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellTypePriority(spellType, BotPriorityCategories::Idle) my_bot->GetSpellTypePriority(spell_type, BotPriorityCategories::Idle)
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellTypePriority(spellType, BotPriorityCategories::Idle, typeValue); my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Idle, type_value);
++success_count; ++success_count;
} }
} }
@@ -222,8 +222,8 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] idle cast priority was set to [{}].'", "{} says, 'My [{}] idle cast priority was set to [{}].'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellTypePriority(spellType, BotPriorityCategories::Idle) first_found->GetSpellTypePriority(spell_type, BotPriorityCategories::Idle)
).c_str() ).c_str()
); );
} }
@@ -233,8 +233,8 @@ void bot_command_spell_idle_priority(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots set their [{}] idle cast priority to [{}].", "{} of your bots set their [{}] idle cast priority to [{}].",
success_count, success_count,
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
typeValue type_value
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -111,14 +111,14 @@ void bot_command_spell_max_hp_pct(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -126,7 +126,7 @@ void bot_command_spell_max_hp_pct(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -144,9 +144,9 @@ void bot_command_spell_max_hp_pct(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++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 (0%% to 100%% of health)."); c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of health).");
return; return;
@@ -201,13 +201,13 @@ void bot_command_spell_max_hp_pct(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] maximum HP is currently [{}%%].'", "{} says, 'My [{}] maximum HP is currently [{}%%].'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellTypeMaxHPLimit(spellType) my_bot->GetSpellTypeMaxHPLimit(spell_type)
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellTypeMaxHPLimit(spellType, typeValue); my_bot->SetSpellTypeMaxHPLimit(spell_type, type_value);
++success_count; ++success_count;
} }
} }
@@ -218,8 +218,8 @@ void bot_command_spell_max_hp_pct(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] maximum HP was set to [{}%%].'", "{} says, 'My [{}] maximum HP was set to [{}%%].'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellTypeMaxHPLimit(spellType) first_found->GetSpellTypeMaxHPLimit(spell_type)
).c_str() ).c_str()
); );
} }
@@ -229,8 +229,8 @@ void bot_command_spell_max_hp_pct(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots set their [{}] maximum HP to [{}%%].", "{} of your bots set their [{}] maximum HP to [{}%%].",
success_count, success_count,
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
typeValue type_value
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -111,14 +111,14 @@ void bot_command_spell_max_mana_pct(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -126,7 +126,7 @@ void bot_command_spell_max_mana_pct(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -144,9 +144,9 @@ void bot_command_spell_max_mana_pct(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++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 (0%% to 100%% of mana)."); c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of mana).");
return; return;
@@ -201,13 +201,13 @@ void bot_command_spell_max_mana_pct(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] maximum mana is currently [{}%%].'", "{} says, 'My [{}] maximum mana is currently [{}%%].'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellTypeMaxManaLimit(spellType) my_bot->GetSpellTypeMaxManaLimit(spell_type)
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellTypeMaxManaLimit(spellType, typeValue); my_bot->SetSpellTypeMaxManaLimit(spell_type, type_value);
++success_count; ++success_count;
} }
} }
@@ -218,8 +218,8 @@ void bot_command_spell_max_mana_pct(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] maximum mana was set to [{}%%].'", "{} says, 'My [{}] maximum mana was set to [{}%%].'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellTypeMaxManaLimit(spellType) first_found->GetSpellTypeMaxManaLimit(spell_type)
).c_str() ).c_str()
); );
} }
@@ -229,8 +229,8 @@ void bot_command_spell_max_mana_pct(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots set their [{}] maximum mana to [{}%%].", "{} of your bots set their [{}] maximum mana to [{}%%].",
success_count, success_count,
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
typeValue type_value
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -117,14 +117,14 @@ void bot_command_spell_max_thresholds(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -132,7 +132,7 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -150,9 +150,9 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++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 (0%% to 100%% of health)."); c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of health).");
return; return;
@@ -207,13 +207,13 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] maximum threshold is currently [{}%%].'", "{} says, 'My [{}] maximum threshold is currently [{}%%].'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellMaxThreshold(spellType) my_bot->GetSpellMaxThreshold(spell_type)
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellMaxThreshold(spellType, typeValue); my_bot->SetSpellMaxThreshold(spell_type, type_value);
++success_count; ++success_count;
} }
} }
@@ -224,8 +224,8 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] maximum threshold was set to [{}%%].'", "{} says, 'My [{}] maximum threshold was set to [{}%%].'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellMaxThreshold(spellType) first_found->GetSpellMaxThreshold(spell_type)
).c_str() ).c_str()
); );
} }
@@ -235,8 +235,8 @@ void bot_command_spell_max_thresholds(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots set their [{}] maximum threshold to [{}%%].", "{} of your bots set their [{}] maximum threshold to [{}%%].",
success_count, success_count,
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
typeValue type_value
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -111,14 +111,14 @@ void bot_command_spell_min_hp_pct(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -126,7 +126,7 @@ void bot_command_spell_min_hp_pct(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -144,9 +144,9 @@ void bot_command_spell_min_hp_pct(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++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 (0%% to 100%% of mana)."); c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of mana).");
return; return;
@@ -201,13 +201,13 @@ void bot_command_spell_min_hp_pct(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] minimum HP is currently [{}%%].'", "{} says, 'My [{}] minimum HP is currently [{}%%].'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellTypeMinHPLimit(spellType) my_bot->GetSpellTypeMinHPLimit(spell_type)
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellTypeMinHPLimit(spellType, typeValue); my_bot->SetSpellTypeMinHPLimit(spell_type, type_value);
++success_count; ++success_count;
} }
} }
@@ -218,8 +218,8 @@ void bot_command_spell_min_hp_pct(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] minimum HP was set to [{}%%].'", "{} says, 'My [{}] minimum HP was set to [{}%%].'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellTypeMinHPLimit(spellType) first_found->GetSpellTypeMinHPLimit(spell_type)
).c_str() ).c_str()
); );
} }
@@ -229,8 +229,8 @@ void bot_command_spell_min_hp_pct(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots set their [{}] minimum HP to [{}%%].", "{} of your bots set their [{}] minimum HP to [{}%%].",
success_count, success_count,
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
typeValue type_value
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -111,14 +111,14 @@ void bot_command_spell_min_mana_pct(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -126,7 +126,7 @@ void bot_command_spell_min_mana_pct(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -144,9 +144,9 @@ void bot_command_spell_min_mana_pct(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++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 (0%% to 100%% of mana)."); c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of mana).");
return; return;
@@ -201,13 +201,13 @@ void bot_command_spell_min_mana_pct(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] minimum mana is currently [{}%%].'", "{} says, 'My [{}] minimum mana is currently [{}%%].'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellTypeMinManaLimit(spellType) my_bot->GetSpellTypeMinManaLimit(spell_type)
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellTypeMinManaLimit(spellType, typeValue); my_bot->SetSpellTypeMinManaLimit(spell_type, type_value);
++success_count; ++success_count;
} }
} }
@@ -218,8 +218,8 @@ void bot_command_spell_min_mana_pct(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] minimum mana was set to [{}%%].'", "{} says, 'My [{}] minimum mana was set to [{}%%].'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellTypeMinManaLimit(spellType) first_found->GetSpellTypeMinManaLimit(spell_type)
).c_str() ).c_str()
); );
} }
@@ -229,8 +229,8 @@ void bot_command_spell_min_mana_pct(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots set their [{}] minimum mana to [{}%%].", "{} of your bots set their [{}] minimum mana to [{}%%].",
success_count, success_count,
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
typeValue type_value
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -119,14 +119,14 @@ void bot_command_spell_min_thresholds(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -134,7 +134,7 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -152,9 +152,9 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++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 (0%% to 100%% of health)."); c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of health).");
return; return;
@@ -209,13 +209,13 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] minimum threshold is currently [{}%%].'", "{} says, 'My [{}] minimum threshold is currently [{}%%].'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellMinThreshold(spellType) my_bot->GetSpellMinThreshold(spell_type)
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellMinThreshold(spellType, typeValue); my_bot->SetSpellMinThreshold(spell_type, type_value);
++success_count; ++success_count;
} }
} }
@@ -226,8 +226,8 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] minimum threshold was set to [{}%%].'", "{} says, 'My [{}] minimum threshold was set to [{}%%].'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellMinThreshold(spellType) first_found->GetSpellMinThreshold(spell_type)
).c_str() ).c_str()
); );
} }
@@ -237,8 +237,8 @@ void bot_command_spell_min_thresholds(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots set their [{}] minimum threshold to [{}%%].", "{} of your bots set their [{}] minimum threshold to [{}%%].",
success_count, success_count,
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
typeValue type_value
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -115,14 +115,14 @@ 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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -130,7 +130,7 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -148,9 +148,9 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++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."); c->Message(Chat::Yellow, "You must enter a value between 0-100.");
return; return;
@@ -205,13 +205,13 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] pursue cast priority is currently [{}].'", "{} says, 'My [{}] pursue cast priority is currently [{}].'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellTypePriority(spellType, BotPriorityCategories::Pursue) my_bot->GetSpellTypePriority(spell_type, BotPriorityCategories::Pursue)
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellTypePriority(spellType, BotPriorityCategories::Pursue, typeValue); my_bot->SetSpellTypePriority(spell_type, BotPriorityCategories::Pursue, type_value);
++success_count; ++success_count;
} }
} }
@@ -222,8 +222,8 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] pursue cast priority was set to [{}].'", "{} says, 'My [{}] pursue cast priority was set to [{}].'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellTypePriority(spellType, BotPriorityCategories::Pursue) first_found->GetSpellTypePriority(spell_type, BotPriorityCategories::Pursue)
).c_str() ).c_str()
); );
} }
@@ -233,8 +233,8 @@ void bot_command_spell_pursue_priority(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots set their [{}] pursue cast priority to [{}].", "{} of your bots set their [{}] pursue cast priority to [{}].",
success_count, success_count,
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
typeValue type_value
).c_str() ).c_str()
); );
} }
+14 -14
View File
@@ -111,14 +111,14 @@ void bot_command_spell_target_count(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
// String/Int type checks // String/Int type checks
if (sep->IsNumber(1)) { 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); c->Message(Chat::Yellow, "You must choose a valid spell type. Spell types range from %i to %i", BotSpellTypes::START, BotSpellTypes::END);
return; return;
@@ -126,7 +126,7 @@ void bot_command_spell_target_count(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
} }
else { else {
c->Message( c->Message(
@@ -144,9 +144,9 @@ void bot_command_spell_target_count(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++ab_arg;
if (typeValue < 1 || typeValue > 100) { if (type_value < 1 || type_value > 100) {
c->Message(Chat::Yellow, "You must enter a value between 1-100."); c->Message(Chat::Yellow, "You must enter a value between 1-100.");
return; return;
@@ -201,13 +201,13 @@ void bot_command_spell_target_count(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] target count is currently [{}].'", "{} says, 'My [{}] target count is currently [{}].'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
my_bot->GetSpellTypeAEOrGroupTargetCount(spellType) my_bot->GetSpellTypeAEOrGroupTargetCount(spell_type)
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetSpellTypeAEOrGroupTargetCount(spellType, typeValue); my_bot->SetSpellTypeAEOrGroupTargetCount(spell_type, type_value);
++success_count; ++success_count;
} }
} }
@@ -218,8 +218,8 @@ void bot_command_spell_target_count(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'My [{}] target count was set to [{}].'", "{} says, 'My [{}] target count was set to [{}].'",
first_found->GetCleanName(), first_found->GetCleanName(),
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
first_found->GetSpellTypeAEOrGroupTargetCount(spellType) first_found->GetSpellTypeAEOrGroupTargetCount(spell_type)
).c_str() ).c_str()
); );
} }
@@ -229,8 +229,8 @@ void bot_command_spell_target_count(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} of your bots set their [{}] target count to [{}].", "{} of your bots set their [{}] target count to [{}].",
success_count, success_count,
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
typeValue type_value
).c_str() ).c_str()
); );
} }
+26 -26
View File
@@ -88,29 +88,29 @@ void bot_command_taunt(Client* c, const Seperator* sep)
std::string arg1 = sep->arg[1]; std::string arg1 = sep->arg[1];
std::string arg2 = sep->arg[2]; std::string arg2 = sep->arg[2];
bool tauntState = false; bool taunt_state = false;
bool petTaunt = false; bool pet_taunt = false;
bool validOption = false; bool valid_option = false;
int ab_arg = 1; int ab_arg = 1;
if (!arg1.compare("on")) { if (!arg1.compare("on")) {
tauntState = true; taunt_state = true;
validOption = true; valid_option = true;
++ab_arg; ++ab_arg;
} }
else if (!arg1.compare("off")) { else if (!arg1.compare("off")) {
validOption = true; valid_option = true;
++ab_arg; ++ab_arg;
} }
if (!arg2.compare("pet")) { if (!arg2.compare("pet")) {
petTaunt = true; pet_taunt = true;
validOption = true; valid_option = true;
++ab_arg; ++ab_arg;
} }
if (!validOption) { if (!valid_option) {
c->Message( c->Message(
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
@@ -125,10 +125,10 @@ void bot_command_taunt(Client* c, const Seperator* sep)
} }
const int ab_mask = ActionableBots::ABM_Type1; const int ab_mask = ActionableBots::ABM_Type1;
std::string actionableArg = sep->arg[ab_arg]; std::string actionable_arg = sep->arg[ab_arg];
if (actionableArg.empty()) { if (actionable_arg.empty()) {
actionableArg = "target"; actionable_arg = "target";
} }
std::string class_race_arg = sep->arg[ab_arg]; std::string class_race_arg = sep->arg[ab_arg];
@@ -140,22 +140,22 @@ void bot_command_taunt(Client* c, const Seperator* sep)
std::vector<Bot*> sbl; std::vector<Bot*> sbl;
if (ActionableBots::PopulateSBL(c, actionableArg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) { if (ActionableBots::PopulateSBL(c, actionable_arg, sbl, ab_mask, !class_race_check ? sep->arg[ab_arg + 1] : nullptr, class_race_check ? atoi(sep->arg[ab_arg + 1]) : 0) == ActionableBots::ABT_None) {
return; return;
} }
sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end()); sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end());
int botTauntingCount = 0; int bot_taunting_count = 0;
int petTauntingCount = 0; int pet_taunting_count = 0;
if (!petTaunt) { if (!pet_taunt) {
for (auto bot_iter : sbl) { for (auto bot_iter : sbl) {
if (!bot_iter->GetSkill(EQ::skills::SkillTaunt)) { if (!bot_iter->GetSkill(EQ::skills::SkillTaunt)) {
continue; continue;
} }
bot_iter->SetTaunting(tauntState); bot_iter->SetTaunting(taunt_state);
Bot::BotGroupSay( Bot::BotGroupSay(
bot_iter, bot_iter,
@@ -165,11 +165,11 @@ void bot_command_taunt(Client* c, const Seperator* sep)
).c_str() ).c_str()
); );
++botTauntingCount; ++bot_taunting_count;
} }
} }
if (petTaunt) { if (pet_taunt) {
for (auto bot_iter : sbl) { for (auto bot_iter : sbl) {
if (!bot_iter->HasPet()) { if (!bot_iter->HasPet()) {
continue; continue;
@@ -179,7 +179,7 @@ void bot_command_taunt(Client* c, const Seperator* sep)
continue; continue;
} }
bot_iter->GetPet()->CastToNPC()->SetTaunting(tauntState); bot_iter->GetPet()->CastToNPC()->SetTaunting(taunt_state);
Bot::BotGroupSay( Bot::BotGroupSay(
bot_iter, bot_iter,
@@ -189,18 +189,18 @@ void bot_command_taunt(Client* c, const Seperator* sep)
).c_str() ).c_str()
); );
++petTauntingCount; ++pet_taunting_count;
} }
} }
if (botTauntingCount || petTauntingCount) { if (bot_taunting_count || pet_taunting_count) {
c->Message( c->Message(
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"{} of your {} are {} taunting.", "{} of your {} are {} taunting.",
(botTauntingCount ? botTauntingCount : petTauntingCount), (bot_taunting_count ? bot_taunting_count : pet_taunting_count),
(botTauntingCount ? "bots" : "bots' pets"), (bot_taunting_count ? "bots" : "bots' pets"),
tauntState ? "now" : "no longer" taunt_state ? "now" : "no longer"
).c_str() ).c_str()
); );
} }
@@ -209,7 +209,7 @@ void bot_command_taunt(Client* c, const Seperator* sep)
Chat::Yellow, Chat::Yellow,
fmt::format( fmt::format(
"None of your {} are capable of taunting.", "None of your {} are capable of taunting.",
!petTaunt ? "bots" : "bots' pets" !pet_taunt ? "bots" : "bots' pets"
).c_str() ).c_str()
); );
} }
+2 -2
View File
@@ -142,7 +142,7 @@ void Raid::HandleOfflineBots(uint32 owner) {
} }
} }
uint8 Bot::GetNumberNeedingHealedInRaidGroup(uint8& need_healed, uint8 hpr, bool includePets, Raid* raid) { uint8 Bot::GetNumberNeedingHealedInRaidGroup(uint8& need_healed, uint8 hpr, bool include_pets, Raid* raid) {
if (raid) { if (raid) {
uint32 r_group = raid->GetGroup(GetName()); uint32 r_group = raid->GetGroup(GetName());
@@ -153,7 +153,7 @@ uint8 Bot::GetNumberNeedingHealedInRaidGroup(uint8& need_healed, uint8 hpr, bool
need_healed++; need_healed++;
} }
if (includePets && m.member->GetPet() && m.member->GetPet()->GetHPRatio() <= hpr) { if (include_pets && m.member->GetPet() && m.member->GetPet()->GetHPRatio() <= hpr) {
need_healed++; need_healed++;
} }
} }
+4 -4
View File
@@ -12,10 +12,10 @@ void command_illusion_block(Client* c, const Seperator* sep)
} }
if (sep->IsNumber(1)) { if (sep->IsNumber(1)) {
int setStatus = atoi(sep->arg[1]); int set_status = atoi(sep->arg[1]);
if (setStatus == 0 || setStatus == 1) { if (set_status == 0 || set_status == 1) {
c->SetIllusionBlock(setStatus); c->SetIllusionBlock(set_status);
c->Message(Chat::White, "Your Illusion Block has been %s.", (setStatus ? "enabled" : "disabled")); c->Message(Chat::White, "Your Illusion Block has been %s.", (set_status ? "enabled" : "disabled"));
} }
else { else {
c->Message(Chat::White, "You must enter 0 for disabled or 1 for enabled."); c->Message(Chat::White, "You must enter 0 for disabled or 1 for enabled.");
+13 -13
View File
@@ -89,13 +89,13 @@ void command_spell_delays(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
if (sep->IsNumber(1)) { if (sep->IsNumber(1)) {
spellType = atoi(sep->arg[1]); spell_type = atoi(sep->arg[1]);
if (!IsClientBotSpellType(spellType)) { if (!IsClientBotSpellType(spell_type)) {
c->Message(Chat::Yellow, "Invalid spell type."); c->Message(Chat::Yellow, "Invalid spell type.");
c->SendSpellTypePrompts(false, true); c->SendSpellTypePrompts(false, true);
@@ -104,9 +104,9 @@ void command_spell_delays(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
if (!IsClientBotSpellType(spellType)) { if (!IsClientBotSpellType(spell_type)) {
c->Message(Chat::Yellow, "Invalid spell type."); c->Message(Chat::Yellow, "Invalid spell type.");
c->SendSpellTypePrompts(false, true); c->SendSpellTypePrompts(false, true);
} }
@@ -128,9 +128,9 @@ void command_spell_delays(Client* c, const Seperator* sep)
// Enable/Disable/Current checks // Enable/Disable/Current checks
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++ab_arg;
if (typeValue < 0 || typeValue > 60000) { if (type_value < 0 || type_value > 60000) {
c->Message(Chat::Yellow, "You must enter a value between 1-60000 (1ms to 60s)."); c->Message(Chat::Yellow, "You must enter a value between 1-60000 (1ms to 60s).");
return; return;
@@ -159,19 +159,19 @@ void command_spell_delays(Client* c, const Seperator* sep)
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"Your [{}] delay is currently {} seconds.'", "Your [{}] delay is currently {} seconds.'",
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
c->GetSpellDelay(spellType) / 1000.00 c->GetSpellDelay(spell_type) / 1000.00
).c_str() ).c_str()
); );
} }
else { else {
c->SetSpellDelay(spellType, typeValue); c->SetSpellDelay(spell_type, type_value);
c->Message( c->Message(
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"Your [{}] delay was set to {} seconds.'", "Your [{}] delay was set to {} seconds.'",
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
c->GetSpellDelay(spellType) / 1000.00 c->GetSpellDelay(spell_type) / 1000.00
).c_str() ).c_str()
); );
} }
+13 -13
View File
@@ -93,13 +93,13 @@ void command_spell_holds(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
if (sep->IsNumber(1)) { if (sep->IsNumber(1)) {
spellType = atoi(sep->arg[1]); spell_type = atoi(sep->arg[1]);
if (!IsClientBotSpellType(spellType)) { if (!IsClientBotSpellType(spell_type)) {
c->Message(Chat::Yellow, "Invalid spell type."); c->Message(Chat::Yellow, "Invalid spell type.");
c->SendSpellTypePrompts(false, true); c->SendSpellTypePrompts(false, true);
@@ -108,9 +108,9 @@ void command_spell_holds(Client *c, const Seperator *sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
if (!IsClientBotSpellType(spellType)) { if (!IsClientBotSpellType(spell_type)) {
c->Message(Chat::Yellow, "Invalid spell type."); c->Message(Chat::Yellow, "Invalid spell type.");
c->SendSpellTypePrompts(false, true); c->SendSpellTypePrompts(false, true);
} }
@@ -132,9 +132,9 @@ void command_spell_holds(Client *c, const Seperator *sep)
// Enable/Disable/Current checks // Enable/Disable/Current checks
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++ab_arg;
if (typeValue < 0 || typeValue > 1) { if (type_value < 0 || type_value > 1) {
c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled."); c->Message(Chat::Yellow, "You must enter either 0 for disabled or 1 for enabled.");
return; return;
@@ -163,19 +163,19 @@ void command_spell_holds(Client *c, const Seperator *sep)
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"Your [{}] spell hold is currently [{}].'", "Your [{}] spell hold is currently [{}].'",
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
c->GetSpellHold(spellType) ? "enabled" : "disabled" c->GetSpellHold(spell_type) ? "enabled" : "disabled"
).c_str() ).c_str()
); );
} }
else { else {
c->SetSpellHold(spellType, typeValue); c->SetSpellHold(spell_type, type_value);
c->Message( c->Message(
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"Your [{}] spell hold was [{}].'", "Your [{}] spell hold was [{}].'",
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
c->GetSpellHold(spellType) ? "enabled" : "disabled" c->GetSpellHold(spell_type) ? "enabled" : "disabled"
).c_str() ).c_str()
); );
} }
+13 -13
View File
@@ -89,13 +89,13 @@ void command_spell_max_thresholds(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
if (sep->IsNumber(1)) { if (sep->IsNumber(1)) {
spellType = atoi(sep->arg[1]); spell_type = atoi(sep->arg[1]);
if (!IsClientBotSpellType(spellType)) { if (!IsClientBotSpellType(spell_type)) {
c->Message(Chat::Yellow, "Invalid spell type."); c->Message(Chat::Yellow, "Invalid spell type.");
c->SendSpellTypePrompts(false, true); c->SendSpellTypePrompts(false, true);
@@ -104,9 +104,9 @@ void command_spell_max_thresholds(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
if (!IsClientBotSpellType(spellType)) { if (!IsClientBotSpellType(spell_type)) {
c->Message(Chat::Yellow, "Invalid spell type."); c->Message(Chat::Yellow, "Invalid spell type.");
c->SendSpellTypePrompts(false, true); c->SendSpellTypePrompts(false, true);
} }
@@ -128,9 +128,9 @@ void command_spell_max_thresholds(Client* c, const Seperator* sep)
// Enable/Disable/Current checks // Enable/Disable/Current checks
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++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 (0%% to 100%% of your health)."); c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of your health).");
return; return;
@@ -159,19 +159,19 @@ void command_spell_max_thresholds(Client* c, const Seperator* sep)
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"Your [{}] maximum hold is currently [{}%%].'", "Your [{}] maximum hold is currently [{}%%].'",
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
c->GetSpellMaxThreshold(spellType) c->GetSpellMaxThreshold(spell_type)
).c_str() ).c_str()
); );
} }
else { else {
c->SetSpellMaxThreshold(spellType, typeValue); c->SetSpellMaxThreshold(spell_type, type_value);
c->Message( c->Message(
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"Your [{}] maximum hold was set to [{}%%].'", "Your [{}] maximum hold was set to [{}%%].'",
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
c->GetSpellMaxThreshold(spellType) c->GetSpellMaxThreshold(spell_type)
).c_str() ).c_str()
); );
} }
+13 -13
View File
@@ -89,13 +89,13 @@ void command_spell_min_thresholds(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;
uint16 spellType = 0; uint16 spell_type = 0;
uint32 typeValue = 0; uint32 type_value = 0;
if (sep->IsNumber(1)) { if (sep->IsNumber(1)) {
spellType = atoi(sep->arg[1]); spell_type = atoi(sep->arg[1]);
if (!IsClientBotSpellType(spellType)) { if (!IsClientBotSpellType(spell_type)) {
c->Message(Chat::Yellow, "Invalid spell type."); c->Message(Chat::Yellow, "Invalid spell type.");
c->SendSpellTypePrompts(false, true); c->SendSpellTypePrompts(false, true);
@@ -104,9 +104,9 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep)
} }
else { else {
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) { if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
spellType = c->GetSpellTypeIDByShortName(arg1); spell_type = c->GetSpellTypeIDByShortName(arg1);
if (!IsClientBotSpellType(spellType)) { if (!IsClientBotSpellType(spell_type)) {
c->Message(Chat::Yellow, "Invalid spell type."); c->Message(Chat::Yellow, "Invalid spell type.");
c->SendSpellTypePrompts(false, true); c->SendSpellTypePrompts(false, true);
} }
@@ -128,9 +128,9 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep)
// Enable/Disable/Current checks // Enable/Disable/Current checks
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
typeValue = atoi(sep->arg[2]); type_value = atoi(sep->arg[2]);
++ab_arg; ++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 (0%% to 100%% of your health)."); c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of your health).");
return; return;
@@ -159,19 +159,19 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep)
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"Your [{}] minimum hold is currently [{}%%].'", "Your [{}] minimum hold is currently [{}%%].'",
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
c->GetSpellMinThreshold(spellType) c->GetSpellMinThreshold(spell_type)
).c_str() ).c_str()
); );
} }
else { else {
c->SetSpellMinThreshold(spellType, typeValue); c->SetSpellMinThreshold(spell_type, type_value);
c->Message( c->Message(
Chat::Green, Chat::Green,
fmt::format( fmt::format(
"Your [{}] minimum hold was set to [{}%%].'", "Your [{}] minimum hold was set to [{}%%].'",
c->GetSpellTypeNameByID(spellType), c->GetSpellTypeNameByID(spell_type),
c->GetSpellMinThreshold(spellType) c->GetSpellMinThreshold(spell_type)
).c_str() ).c_str()
); );
} }
+6 -6
View File
@@ -2262,24 +2262,24 @@ void Group::ClearAllNPCMarks()
} }
int8 Group::GetNumberNeedingHealedInGroup(int8 hpr, bool includePets) { int8 Group::GetNumberNeedingHealedInGroup(int8 hpr, bool include_pets) {
int8 needHealed = 0; int8 need_healed = 0;
for( int i = 0; i<MAX_GROUP_MEMBERS; i++) { for( int i = 0; i<MAX_GROUP_MEMBERS; i++) {
if(members[i] && !members[i]->qglobal) { if(members[i] && !members[i]->qglobal) {
if(members[i]->GetHPRatio() <= hpr) if(members[i]->GetHPRatio() <= hpr)
needHealed++; need_healed++;
if(includePets) { if(include_pets) {
if(members[i]->GetPet() && members[i]->GetPet()->GetHPRatio() <= hpr) { if(members[i]->GetPet() && members[i]->GetPet()->GetHPRatio() <= hpr) {
needHealed++; need_healed++;
} }
} }
} }
} }
return needHealed; return need_healed;
} }
void Group::UpdateGroupAAs() void Group::UpdateGroupAAs()
+1 -1
View File
@@ -107,7 +107,7 @@ public:
void UpdateGroupAAs(); void UpdateGroupAAs();
void SaveGroupLeaderAA(); void SaveGroupLeaderAA();
void MarkNPC(Mob* Target, int Number); void MarkNPC(Mob* Target, int Number);
int8 GetNumberNeedingHealedInGroup(int8 hpr, bool includePets); int8 GetNumberNeedingHealedInGroup(int8 hpr, bool include_pets);
void DelegateMainTank(const char *NewMainAssistName, uint8 toggle = 0); void DelegateMainTank(const char *NewMainAssistName, uint8 toggle = 0);
void DelegateMainAssist(const char *NewMainAssistName, uint8 toggle = 0); void DelegateMainAssist(const char *NewMainAssistName, uint8 toggle = 0);
void DelegatePuller(const char *NewMainAssistName, uint8 toggle = 0); void DelegatePuller(const char *NewMainAssistName, uint8 toggle = 0);