From 9dd11a598fea242810cf31fd31941b1fd5421612 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Sun, 10 Nov 2024 23:15:08 -0600 Subject: [PATCH] Add AllowAIMez to allow bot auto mez to be toggled --- common/ruletypes.h | 1 + zone/botspellsai.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/common/ruletypes.h b/common/ruletypes.h index 068fd0044..5cbbbd6e9 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -870,6 +870,7 @@ RULE_BOOL(Bots, DoResponseAnimations, true, "If enabled bots will do animations RULE_INT(Bots, DefaultFollowDistance, 20, "Default 20. Distance a bot will follow behind.") RULE_INT(Bots, MaxFollowDistance, 300, "Default 300. Max distance a bot can be set to follow behind.") RULE_INT(Bots, MaxDistanceRanged, 300, "Default 300. Max distance a bot can be set to ranged.") +RULE_BOOL(Bots, AllowAIMez, true, "If enabled bots will automatically mez/AE mez eligible targets.") RULE_CATEGORY_END() RULE_CATEGORY(Chat) diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 37decd779..5adbdb3e9 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -639,6 +639,10 @@ bool Bot::AI_PursueCastCheck() { continue; } + if (RuleB(Bots, AllowAIMez) && (currentCast.spellType == BotSpellTypes::AEMez || currentCast.spellType == BotSpellTypes::Mez)) { + continue; + } + if (currentCast.spellType == BotSpellTypes::Resurrect || currentCast.spellType == BotSpellTypes::Charm) { // Unsupported by AI currently. continue; } @@ -698,6 +702,10 @@ bool Bot::AI_IdleCastCheck() { continue; } + if (RuleB(Bots, AllowAIMez) && (currentCast.spellType == BotSpellTypes::AEMez || currentCast.spellType == BotSpellTypes::Mez)) { + continue; + } + if (currentCast.spellType == BotSpellTypes::Resurrect || currentCast.spellType == BotSpellTypes::Charm) { // Unsupported by AI currently. continue; } @@ -744,6 +752,10 @@ bool Bot::AI_EngagedCastCheck() { continue; } + if (RuleB(Bots, AllowAIMez) && (currentCast.spellType == BotSpellTypes::AEMez || currentCast.spellType == BotSpellTypes::Mez)) { + continue; + } + if (currentCast.spellType == BotSpellTypes::Resurrect || currentCast.spellType == BotSpellTypes::Charm) { // Unsupported by AI currently. continue; }