Rewrite ^pull logic and handling. **MORE**

Add ^setassistee command to set who your bots will assist. Bots will always assist you first before anyone else.

If the rule Bots, AllowCrossGroupRaidAssist is enabled bots will assist the group or raid main assists.

Rewrites logic in handling of pull and returning to ensure bots make it back to their location.
This commit is contained in:
nytmyr
2024-12-05 07:21:34 -06:00
parent 6c19f3dbda
commit 9207be96d3
6 changed files with 199 additions and 25 deletions
+59
View File
@@ -0,0 +1,59 @@
#include "../bot_command.h"
void bot_command_set_assistee(Client* c, const Seperator* sep)
{
if (helper_is_help_or_usage(sep->arg[1])) {
std::vector<std::string> description =
{
"Sets your bots to assist your target in addition to yourself"
};
std::vector<std::string> notes =
{
"- Your target must be another player in your group or raid.",
"- This needs to be set on every zone/camp you do."
};
std::vector<std::string> example_format = { };
std::vector<std::string> examples_one = { };
std::vector<std::string> examples_two = { };
std::vector<std::string> examples_three = { };
std::vector<std::string> actionables = { };
std::vector<std::string> options = { };
std::vector<std::string> options_one = { };
std::vector<std::string> options_two = { };
std::vector<std::string> options_three = { };
std::string popup_text = c->SendCommandHelpWindow(
c,
description,
notes,
example_format,
examples_one, examples_two, examples_three,
actionables,
options,
options_one, options_two, options_three
);
popup_text = DialogueWindow::Table(popup_text);
c->SendPopupToClient(sep->arg[0], popup_text.c_str());
return;
}
Mob* assistee = c->GetTarget();
if (assistee && assistee->IsClient() && c->IsInGroupOrRaid(assistee)) {
c->SetAssistee(assistee->CastToClient()->CharacterID());
c->Message(Chat::Green, "Your bots will now assist %s.", assistee->GetCleanName());
return;
}
c->Message(Chat::Yellow, "You can only set your bots to assist clients that are in your group or raid.");
return;
}