remove ^aggressive/^defensive

This commit is contained in:
nytmyr
2024-12-29 20:18:12 -06:00
parent a0c2abfedf
commit 2d7d58b4ef
4 changed files with 0 additions and 165 deletions
-4
View File
@@ -1247,7 +1247,6 @@ int bot_command_init(void)
if (
bot_command_add("actionable", "Lists actionable command arguments and use descriptions", AccountStatus::Player, bot_command_actionable) ||
bot_command_add("aggressive", "Orders a bot to use a aggressive discipline", AccountStatus::Player, bot_command_aggressive) ||
bot_command_add("applypoison", "Applies cursor-held poison to a rogue bot's weapon", AccountStatus::Player, bot_command_apply_poison) ||
bot_command_add("attack", "Orders bots to attack a designated target", AccountStatus::Player, bot_command_attack) ||
bot_command_add("behindmob", "Toggles whether or not your bot tries to stay behind a mob", AccountStatus::Player, bot_command_behind_mob) ||
@@ -1292,7 +1291,6 @@ int bot_command_init(void)
bot_command_add("clickitem", "Orders your targeted bot to click the item in the provided inventory slot.", AccountStatus::Player, bot_command_click_item) ||
bot_command_add("copysettings", "Copies settings from one bot to another", AccountStatus::Player, bot_command_copy_settings) ||
bot_command_add("defaultsettings", "Restores a bot back to default settings", AccountStatus::Player, bot_command_default_settings) ||
bot_command_add("defensive", "Orders a bot to use a defensive discipline", AccountStatus::Player, bot_command_defensive) ||
bot_command_add("depart", "Orders a bot to open a magical doorway to a specified destination", AccountStatus::Player, bot_command_depart) ||
bot_command_add("enforcespellsettings", "Toggles your Bot to cast only spells in their spell settings list.", AccountStatus::Player, bot_command_enforce_spell_list) ||
bot_command_add("findaliases", "Find available aliases for a bot command", AccountStatus::Player, bot_command_find_aliases) ||
@@ -2207,7 +2205,6 @@ void SendSpellTypeWindow(Client* c, const Seperator* sep) {
}
#include "bot_commands/actionable.cpp"
#include "bot_commands/aggressive.cpp"
#include "bot_commands/appearance.cpp"
#include "bot_commands/apply_poison.cpp"
#include "bot_commands/apply_potion.cpp"
@@ -2221,7 +2218,6 @@ void SendSpellTypeWindow(Client* c, const Seperator* sep) {
#include "bot_commands/click_item.cpp"
#include "bot_commands/copy_settings.cpp"
#include "bot_commands/default_settings.cpp"
#include "bot_commands/defensive.cpp"
#include "bot_commands/depart.cpp"
#include "bot_commands/discipline.cpp"
#include "bot_commands/distance_ranged.cpp"
-2
View File
@@ -1663,7 +1663,6 @@ int bot_command_real_dispatch(Client *c, char const *message);
// Bot Commands
void bot_command_actionable(Client *c, const Seperator *sep);
void bot_command_aggressive(Client *c, const Seperator *sep);
void bot_command_apply_poison(Client *c, const Seperator *sep);
void bot_command_apply_potion(Client* c, const Seperator* sep);
void bot_command_attack(Client *c, const Seperator *sep);
@@ -1679,7 +1678,6 @@ void bot_command_class_race_list(Client* c, const Seperator* sep);
void bot_command_click_item(Client* c, const Seperator* sep);
void bot_command_copy_settings(Client* c, const Seperator* sep);
void bot_command_default_settings(Client* c, const Seperator* sep);
void bot_command_defensive(Client *c, const Seperator *sep);
void bot_command_depart(Client *c, const Seperator *sep);
void bot_command_find_aliases(Client *c, const Seperator *sep);
void bot_command_follow(Client *c, const Seperator *sep);
-85
View File
@@ -1,85 +0,0 @@
#include "../bot_command.h"
void bot_command_aggressive(Client* c, const Seperator* sep)
{
bcst_list* local_list = &bot_command_spells[BCEnum::SpT_Stance];
if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Stance) ||
helper_command_alias_fail(c, "bot_command_aggressive", sep->arg[0], "aggressive")) {
return;
}
if (helper_is_help_or_usage(sep->arg[1])) {
c->Message(Chat::White, "usage: %s ([actionable: target | byname | ownergroup | ownerraid | targetgroup | namesgroup | healrotationtargets | mmr | byclass | byrace | spawned] ([actionable_name]))", sep->arg[0]);
c->Message(Chat::White, "note: Orders a bot to use a aggressive discipline");
helper_send_usage_required_bots(c, BCEnum::SpT_Stance);
return;
}
const int ab_mask = ActionableBots::ABM_Type1;
int ab_arg = 1;
std::string class_race_arg = sep->arg[ab_arg];
bool class_race_check = false;
if (!class_race_arg.compare("byclass") || !class_race_arg.compare("byrace")) {
class_race_check = true;
}
std::vector<Bot*> sbl;
if (ActionableBots::PopulateSBL(c, sep->arg[ab_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;
}
sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end());
int success_count = 0;
int candidate_count = sbl.size();
for (auto list_iter: *local_list) {
if (sbl.empty()) {
break;
}
auto local_entry = list_iter->SafeCastToStance();
if (helper_spell_check_fail(local_entry)) {
continue;
}
if (local_entry->stance_type != BCEnum::StT_Aggressive) {
continue;
}
for (auto bot_iter = sbl.begin(); bot_iter != sbl.end();) {
Bot* my_bot = *bot_iter;
if (local_entry->caster_class != my_bot->GetClass()) {
++bot_iter;
continue;
}
if (local_entry->spell_level > my_bot->GetLevel()) {
++bot_iter;
continue;
}
my_bot->InterruptSpell();
if (candidate_count == 1) {
Bot::BotGroupSay(
my_bot,
fmt::format(
"Using {}.",
spells[local_entry->spell_id].name
).c_str()
);
}
my_bot->UseDiscipline(local_entry->spell_id, my_bot->GetID());
++success_count;
bot_iter = sbl.erase(bot_iter);
}
}
c->Message(
Chat::White,
"%i of %i bots have attempted to use aggressive disciplines",
success_count,
candidate_count
);
}
-74
View File
@@ -1,74 +0,0 @@
#include "../bot_command.h"
void bot_command_defensive(Client *c, const Seperator *sep)
{
bcst_list* local_list = &bot_command_spells[BCEnum::SpT_Stance];
if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Stance) || helper_command_alias_fail(c, "bot_command_defensive", sep->arg[0], "defensive"))
return;
if (helper_is_help_or_usage(sep->arg[1])) {
c->Message(Chat::White, "usage: %s ([actionable: target | byname | ownergroup | ownerraid | targetgroup | namesgroup | healrotationtargets | mmr | byclass | byrace | spawned] ([actionable_name]))", sep->arg[0]);
helper_send_usage_required_bots(c, BCEnum::SpT_Stance);
return;
}
const int ab_mask = ActionableBots::ABM_Type1;
std::string arg1 = sep->arg[1];
int ab_arg = 1;
std::string class_race_arg = sep->arg[ab_arg];
bool class_race_check = false;
if (!class_race_arg.compare("byclass") || !class_race_arg.compare("byrace")) {
class_race_check = true;
}
std::vector<Bot*> sbl;
if (ActionableBots::PopulateSBL(c, sep->arg[ab_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;
}
sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end());
int success_count = 0;
int candidate_count = sbl.size();
for (auto list_iter : *local_list) {
if (sbl.empty())
break;
auto local_entry = list_iter->SafeCastToStance();
if (helper_spell_check_fail(local_entry))
continue;
if (local_entry->stance_type != BCEnum::StT_Defensive)
continue;
for (auto bot_iter = sbl.begin(); bot_iter != sbl.end(); ) {
Bot* my_bot = *bot_iter;
if (local_entry->caster_class != my_bot->GetClass()) {
++bot_iter;
continue;
}
if (local_entry->spell_level > my_bot->GetLevel()) {
++bot_iter;
continue;
}
my_bot->InterruptSpell();
if (candidate_count == 1) {
Bot::BotGroupSay(
my_bot,
fmt::format(
"Using {}.",
spells[local_entry->spell_id].name
).c_str()
);
}
my_bot->UseDiscipline(local_entry->spell_id, my_bot->GetID());
++success_count;
bot_iter = sbl.erase(bot_iter);
}
}
c->Message(Chat::White, "%i of %i bots have attempted to use defensive disciplines", success_count, candidate_count);
}