remove circle/teleport, tweak depart

This commit is contained in:
nytmyr
2024-11-10 10:14:23 -06:00
parent cf26a476fd
commit d3d53c5a74
4 changed files with 63 additions and 143 deletions
-3
View File
@@ -1287,7 +1287,6 @@ int bot_command_init(void)
bot_command_add("cast", "Tells the first found specified bot to cast the given spell type", AccountStatus::Player, bot_command_cast) ||
bot_command_add("distanceranged", "Controls the range casters and ranged will try to stay away from a mob", AccountStatus::Player, bot_command_distance_ranged) ||
bot_command_add("charm", "Attempts to have a bot charm your target", AccountStatus::Player, bot_command_charm) ||
bot_command_add("circle", "Orders a Druid bot to open a magical doorway to a specified destination", AccountStatus::Player, bot_command_circle) ||
bot_command_add("classracelist", "Lists the classes and races and their appropriate IDs", AccountStatus::Player, bot_command_class_race_list) ||
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) ||
@@ -1345,7 +1344,6 @@ int bot_command_init(void)
bot_command_add("picklock", "Orders a capable bot to pick the lock of the closest door", AccountStatus::Player, bot_command_pick_lock) ||
bot_command_add("pickpocket", "Orders a capable bot to pickpocket a NPC", AccountStatus::Player, bot_command_pickpocket) ||
bot_command_add("precombat", "Sets flag used to determine pre-combat behavior", AccountStatus::Player, bot_command_precombat) ||
bot_command_add("portal", "Orders a Wizard bot to open a magical doorway to a specified destination", AccountStatus::Player, bot_command_portal) ||
bot_command_add("pull", "Orders a designated bot to 'pull' an enemy", AccountStatus::Player, bot_command_pull) ||
bot_command_add("release", "Releases a suspended bot's AI processing (with hate list wipe)", AccountStatus::Player, bot_command_release) ||
bot_command_add("resistance", "Orders a bot to cast a specified resistance buff", AccountStatus::Player, bot_command_resistance) ||
@@ -2316,7 +2314,6 @@ void Bot::SendSpellTypesWindow(Client* c, std::string arg0, std::string arg1, st
#include "bot_commands/summon_corpse.cpp"
#include "bot_commands/suspend.cpp"
#include "bot_commands/taunt.cpp"
#include "bot_commands/teleport.cpp"
#include "bot_commands/timer.cpp"
#include "bot_commands/track.cpp"
#include "bot_commands/view_combos.cpp"
-2
View File
@@ -1775,7 +1775,6 @@ void bot_command_toggle_ranged(Client* c, const Seperator* sep);
void bot_command_update(Client *c, const Seperator *sep);
void bot_command_woad(Client *c, const Seperator *sep);
void bot_command_circle(Client *c, const Seperator *sep);
void bot_command_heal_rotation_adaptive_targeting(Client *c, const Seperator *sep);
void bot_command_heal_rotation_add_member(Client *c, const Seperator *sep);
void bot_command_heal_rotation_add_target(Client *c, const Seperator *sep);
@@ -1803,7 +1802,6 @@ void bot_command_inventory_window(Client *c, const Seperator *sep);
void bot_command_pet_get_lost(Client *c, const Seperator *sep);
void bot_command_pet_remove(Client *c, const Seperator *sep);
void bot_command_pet_set_type(Client *c, const Seperator *sep);
void bot_command_portal(Client *c, const Seperator *sep);
// bot command helpers
+63 -19
View File
@@ -1,59 +1,103 @@
#include "../bot_command.h"
void bot_command_depart(Client *c, const Seperator *sep)
void bot_command_depart(Client* c, const Seperator* sep)
{
bcst_list* local_list = &bot_command_spells[BCEnum::SpT_Depart];
if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Depart) || helper_command_alias_fail(c, "bot_command_depart", sep->arg[0], "depart"))
return;
if (helper_is_help_or_usage(sep->arg[1])) {
c->Message(Chat::White, "usage: %s [list | destination] ([option: single])", sep->arg[0]);
helper_send_usage_required_bots(c, BCEnum::SpT_Depart);
if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Depart) || helper_command_alias_fail(c, "bot_command_depart", sep->arg[0], "depart")) {
return;
}
bool single = false;
if (helper_is_help_or_usage(sep->arg[1])) {
c->Message(Chat::White, "usage: %s [list | destination] ([option: single])", sep->arg[0]);
helper_send_usage_required_bots(c, BCEnum::SpT_Depart);
return;
}
std::list<Bot*> sbl;
MyBots::PopulateSBL_BySpawnedBots(c, sbl);
ActionableTarget::Types actionable_targets;
Bot* my_bot = nullptr; bool single = false;
std::string single_arg = sep->arg[2];
if (!single_arg.compare("single"))
if (!single_arg.compare("single")) {
single = true;
}
std::string destination = sep->arg[1];
if (!destination.compare("list")) {
Bot* my_druid_bot = ActionableBots::AsGroupMember_ByClass(c, c, Class::Druid);
Bot* my_wizard_bot = ActionableBots::AsGroupMember_ByClass(c, c, Class::Wizard);
Bot* my_druid_bot = ActionableBots::Select_ByMinLevelAndClass(c, BCEnum::TT_None, sbl, 1, Class::Druid);
Bot* my_wizard_bot = ActionableBots::Select_ByMinLevelAndClass(c, BCEnum::TT_None, sbl, 1, Class::Wizard);
if (
(!my_druid_bot && !my_wizard_bot) ||
(my_druid_bot && !my_druid_bot->IsInGroupOrRaid(c)) ||
(my_wizard_bot && !my_wizard_bot->IsInGroupOrRaid(c))
) {
c->Message(Chat::Yellow, "No compatible bots found for %s.", sep->arg[0]);
return;
}
helper_command_depart_list(c, my_druid_bot, my_wizard_bot, local_list, single);
return;
}
else if (destination.empty()) {
c->Message(Chat::White, "A [destination] or [list] argument is required to use this command");
return;
}
ActionableTarget::Types actionable_targets;
Bot* my_bot = nullptr;
std::list<Bot*> sbl;
my_bot = nullptr;
sbl.clear();
MyBots::PopulateSBL_BySpawnedBots(c, sbl);
bool cast_success = false;
for (auto list_iter : *local_list) {
auto local_entry = list_iter->SafeCastToDepart();
if (helper_spell_check_fail(local_entry))
if (helper_spell_check_fail(local_entry)) {
continue;
if (local_entry->single != single)
}
if (local_entry->single != single) {
continue;
if (destination.compare(spells[local_entry->spell_id].teleport_zone))
}
if (destination.compare(spells[local_entry->spell_id].teleport_zone)) {
continue;
}
auto target_mob = actionable_targets.Select(c, local_entry->target_type, FRIENDLY);
if (!target_mob)
continue;
my_bot = ActionableBots::Select_ByMinLevelAndClass(c, local_entry->target_type, sbl, local_entry->spell_level, local_entry->caster_class, target_mob);
if (!my_bot)
if (!my_bot) {
continue;
}
if (my_bot->BotPassiveCheck()) {
continue;
}
if (!my_bot->IsInGroupOrRaid(c)) {
continue;
}
if (local_entry->spell_id != 0 && my_bot->GetMana() < spells[local_entry->spell_id].mana) {
continue;
}
cast_success = helper_cast_standard_spell(my_bot, target_mob, local_entry->spell_id);
break;
}
helper_no_available_bots(c, my_bot);
if (!cast_success) {
helper_no_available_bots(c, my_bot);
}
}
-119
View File
@@ -1,119 +0,0 @@
#include "../bot_command.h"
void bot_command_circle(Client *c, const Seperator *sep)
{
bcst_list* local_list = &bot_command_spells[BCEnum::SpT_Depart];
if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Depart) || helper_command_alias_fail(c, "bot_command_circle", sep->arg[0], "circle"))
return;
if (helper_is_help_or_usage(sep->arg[1])) {
c->Message(Chat::White, "usage: %s [list | destination] ([option: single])", sep->arg[0]);
helper_send_usage_required_bots(c, BCEnum::SpT_Depart, Class::Druid);
return;
}
bool single = false;
std::string single_arg = sep->arg[2];
if (!single_arg.compare("single"))
single = true;
std::string destination = sep->arg[1];
if (!destination.compare("list")) {
auto my_druid_bot = ActionableBots::AsGroupMember_ByClass(c, c, Class::Druid);
helper_command_depart_list(c, my_druid_bot, nullptr, local_list, single);
return;
}
else if (destination.empty()) {
c->Message(Chat::White, "A [destination] or [list] argument is required to use this command");
return;
}
ActionableTarget::Types actionable_targets;
Bot* my_bot = nullptr;
std::list<Bot*> sbl;
MyBots::PopulateSBL_BySpawnedBots(c, sbl);
bool cast_success = false;
for (auto list_iter : *local_list) {
auto local_entry = list_iter->SafeCastToDepart();
if (helper_spell_check_fail(local_entry))
continue;
if (local_entry->caster_class != Class::Druid)
continue;
if (local_entry->single != single)
continue;
if (destination.compare(spells[local_entry->spell_id].teleport_zone))
continue;
auto target_mob = actionable_targets.Select(c, local_entry->target_type, FRIENDLY);
if (!target_mob)
continue;
my_bot = ActionableBots::Select_ByMinLevelAndClass(c, local_entry->target_type, sbl, local_entry->spell_level, local_entry->caster_class, target_mob);
if (!my_bot)
continue;
cast_success = helper_cast_standard_spell(my_bot, target_mob, local_entry->spell_id);
break;
}
helper_no_available_bots(c, my_bot);
}
void bot_command_portal(Client *c, const Seperator *sep)
{
bcst_list* local_list = &bot_command_spells[BCEnum::SpT_Depart];
if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Depart) || helper_command_alias_fail(c, "bot_command_portal", sep->arg[0], "portal"))
return;
if (helper_is_help_or_usage(sep->arg[1])) {
c->Message(Chat::White, "usage: %s [list | destination] ([option: single])", sep->arg[0]);
helper_send_usage_required_bots(c, BCEnum::SpT_Depart, Class::Wizard);
return;
}
bool single = false;
std::string single_arg = sep->arg[2];
if (!single_arg.compare("single"))
single = true;
std::string destination = sep->arg[1];
if (!destination.compare("list")) {
auto my_wizard_bot = ActionableBots::AsGroupMember_ByClass(c, c, Class::Wizard);
helper_command_depart_list(c, nullptr, my_wizard_bot, local_list, single);
return;
}
else if (destination.empty()) {
c->Message(Chat::White, "A [destination] or [list] argument is required to use this command");
return;
}
ActionableTarget::Types actionable_targets;
Bot* my_bot = nullptr;
std::list<Bot*> sbl;
MyBots::PopulateSBL_BySpawnedBots(c, sbl);
bool cast_success = false;
for (auto list_iter : *local_list) {
auto local_entry = list_iter->SafeCastToDepart();
if (helper_spell_check_fail(local_entry))
continue;
if (local_entry->caster_class != Class::Wizard)
continue;
if (local_entry->single != single)
continue;
if (destination.compare(spells[local_entry->spell_id].teleport_zone))
continue;
auto target_mob = actionable_targets.Select(c, local_entry->target_type, FRIENDLY);
if (!target_mob)
continue;
my_bot = ActionableBots::Select_ByMinLevelAndClass(c, local_entry->target_type, sbl, local_entry->spell_level, local_entry->caster_class, target_mob);
if (!my_bot)
continue;
cast_success = helper_cast_standard_spell(my_bot, target_mob, local_entry->spell_id);
break;
}
helper_no_available_bots(c, my_bot);
}