From b430118124effc3239da4c538dc3a37c418b1255 Mon Sep 17 00:00:00 2001 From: kadeshar Date: Sat, 30 May 2026 23:14:54 +0200 Subject: [PATCH] Sunder Armor fixes (#2427) ## Pull Request Description Arms and Fury using Sunder Armor when there is not Protection Warrior in group ## How to Test the Changes Invite warrior/warriors to group and check how they apply Sunder Armor on dummy target ## Impact Assessment - Does this change increase per-bot/per-tick processing or risk scaling poorly with thousands of bots? - - [x] No, not at all - - [ ] Minimal impact (**explain below**) - - [ ] Moderate impact (**explain below**) - Does this change modify default bot behavior? - - [ ] No - - [x] Yes (**explain why**) Yes, expained in Pull Request Description - Does this change add new decision branches or increase maintenance complexity? - - [x] No - - [ ] Yes (**explain below**) ## AI Assistance Was AI assistance used while working on this change? - - [ ] No - - [x] Yes (**explain below**) Analyze orginal behavior ## Final Checklist - - [x] Stability is not compromised. - - [x] Performance impact is understood, tested, and acceptable. - - [x] Added logic complexity is justified and explained. - - [x] Any new bot dialogue lines are translated. - - [x] Documentation updated if needed (Conf comments, WiKi commands). ## Notes for Reviewers --- .../Class/Warrior/Action/WarriorActions.cpp | 22 +++++++++++++++++++ .../Warrior/Strategy/ArmsWarriorStrategy.cpp | 1 + 2 files changed, 23 insertions(+) diff --git a/src/Ai/Class/Warrior/Action/WarriorActions.cpp b/src/Ai/Class/Warrior/Action/WarriorActions.cpp index 20a42c219..b30c1a38b 100644 --- a/src/Ai/Class/Warrior/Action/WarriorActions.cpp +++ b/src/Ai/Class/Warrior/Action/WarriorActions.cpp @@ -5,6 +5,7 @@ #include "WarriorActions.h" +#include "AiFactory.h" #include "Playerbots.h" bool CastBerserkerRageAction::isPossible() @@ -36,6 +37,27 @@ bool CastBerserkerRageAction::isUseful() bool CastSunderArmorAction::isUseful() { + Group* group = bot->GetGroup(); + if (!group) + return false; + + if (!botAI->IsTank(bot, false)) + { + for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) + { + Player* member = ref->GetSource(); + if (!member || member == bot || !member->IsAlive() || !member->IsInWorld() || + member->GetMapId() != bot->GetMapId()) + { + continue; + } + + if (member->getClass() == CLASS_WARRIOR && + botAI->IsTank(member, false)) + return false; + } + } + Aura* aura = botAI->GetAura("sunder armor", GetTarget(), false, true); return !aura || aura->GetStackAmount() < 5 || aura->GetDuration() <= 6000; } diff --git a/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp b/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp index bbae89d20..193aab1d7 100644 --- a/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp +++ b/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp @@ -112,6 +112,7 @@ std::vector ArmsWarriorStrategy::getDefaultActions() return { NextAction("bladestorm", ACTION_DEFAULT + 0.2f), NextAction("mortal strike", ACTION_DEFAULT + 0.1f), + NextAction("sunder armor", ACTION_DEFAULT + 0.05f), NextAction("melee", ACTION_DEFAULT) }; }