[Bots] Line of Sight and Mez optimizations and cleanup (#4746)

* [Bots] Line of Sight and Mez optimizations and cleanup

- Renames `Map:CheckForLoSCheat` to `Map:CheckForDoorLoSCheat` to better reflect what it does.
- Renames `Map:RangeCheckForLoSCheat` to `Map:RangeCheckForDoorLoSCheat` to better reflect what it does.
- Adds the rule `Pets:PetsRequireLoS` to determine whether or not commanded pet attacks require an addition layer of LoS checks for edge-cases.
- Adds the rule `Bots:BotsRequireLoS` to determine whether or not bots require LoS to `^attack`, `^pull` and `^precombat`.
- Adds the rule `Map:ZonesToCheckDoorCheat` to control what if any zones will be checked..
- Corrects, removes and adds LoS checks where necessary.
- Improves door checking logic for locked or triggered doors that could be blocking LoS.
- Cleans up false positives for door cheat checks.
- Adds `drawbox` option to `#door` command. This will spawn points at the center and each corner of the door's "box". It will also spawn points at your and your target's location.
- Improves Mez and AE Mez logic
- Adds more details to the rule `Bots:EpicPetSpellName`

* Remove leftover debugging

* Change return to continue for GetFirstIncomingMobToMez checks

* Move mez chance fail to beginning of cast process
This commit is contained in:
nytmyr
2025-03-29 16:01:31 -05:00
committed by GitHub
parent d554eb3423
commit 444d688ad2
17 changed files with 265 additions and 153 deletions
+27
View File
@@ -35,6 +35,26 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
);
}
if (arg1 == "drawbox") {
Doors *door = entity_list.GetDoorsByID(c->GetDoorToolEntityId());
if (door) {
uint16 door_size = 15;
float door_depth = 5.0f;
if (sep->IsNumber(2) && atof(sep->arg[2]) > 0) {
door_size = atof(sep->arg[2]);
}
if (sep->IsNumber(3) && atof(sep->arg[3]) > 0) {
door_depth = atof(sep->arg[3]);
}
door->IsDoorBetween(c->GetPosition(), (c->GetTarget() ? c->GetTarget()->GetPosition() : c->GetPosition()), door_size, door_depth, true);
}
}
// edit menu
if (arg1 == "edit") {
Doors *door = entity_list.GetDoorsByID(c->GetDoorToolEntityId());
@@ -544,6 +564,13 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
c->Message(Chat::White, "#door setinvertstate [0|1] | Sets selected door invert state");
c->Message(Chat::White, "#door setincline <incline> | Sets selected door incline");
c->Message(Chat::White, "#door opentype <opentype> | Sets selected door opentype");
c->Message(
Chat::White,
fmt::format(
"{} <door_size> <door_depth> | Draws a box for the door, default size = 15, depth = 5 if none defined",
Saylink::Silent("#door drawbox")
).c_str()
);
c->Message(
Chat::White,
fmt::format(