From 585d684ec1cef80b6b7eb938f9dd79bcb0b53b45 Mon Sep 17 00:00:00 2001 From: Karrz1 <127596890+Karrz1@users.noreply.github.com> Date: Sat, 14 Nov 2026 21:25:04 +0000 Subject: [PATCH] Bots: nobody attacks a creature inside a keep-out circle Kel'Thuzad's alcove adds wake for whoever hits them, so a shot, a DoT or an area spell into an alcove pulls its pack even with the raid kept out of it: a warlock had both Abominations and four Soldiers of one alcove on him 6 s in. Every creature inside a keep-out circle, in the fight or idle, is now off limits for the whole raid. --- src/modules/PlayerbotV2/Bot/Raid/RaidBrain.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/modules/PlayerbotV2/Bot/Raid/RaidBrain.cpp b/src/modules/PlayerbotV2/Bot/Raid/RaidBrain.cpp index e3928ae99d..69ac4e2711 100644 --- a/src/modules/PlayerbotV2/Bot/Raid/RaidBrain.cpp +++ b/src/modules/PlayerbotV2/Bot/Raid/RaidBrain.cpp @@ -302,6 +302,7 @@ void SetIdleHostiles(Plan const& plan, Player* ref) // (Escape, Clearest, Usable), so a bot leaving a breath corridor takes the next way out instead of the nearest one, which for Onyxia's // north-south breath is the cave mouth and its whelps; ApplyKeepOut is the clamp for the moves that name a point (role spots, flanks). std::vector g_keepOut; +constexpr float kKeepOutScanYards = 120.0f; // the creatures round the main tank checked against the keep-out circles (PublishTargets) void SetKeepOut(Plan const& plan) { @@ -4099,6 +4100,22 @@ void PublishTargets(Plan& plan, std::unordered_map& orders, if (enemy->GetEntry() == rule.enemy && SpareNow(rule, enemy->GetHealthPct(), gateAlive)) forbiddenAll.push_back(enemy->GetGUID()); } + // Nobody attacks a creature inside a keep-out circle (RaidRules::keepOut: Kel'Thuzad's alcoves, Onyxia's cave mouths), in the fight or + // not: a shot, a DoT or an area spell there wakes the idle pack round it (Kel'Thuzad's alcove adds attack whoever hits them, SpellHit in + // classic_kt_p1AddAI). naxx_kelthuzad 1114f: with the raid kept out of the alcoves, a warlock still had both Abominations and four + // Soldiers of one alcove on him 6 s in, and from 24 s on 20-30 adds were loose. An add the script sends walks out of the circle to its + // raider and is fought there. + if (!g_keepOut.empty() && !plan.members.empty()) + { + Player* const scout = plan.mainTank ? plan.mainTank : plan.members.front().p; + std::list near; + FindCreatureOptions alive; + alive.IsAlive = FindCreatureAliveState::Alive; + scout->GetCreatureListWithOptionsInGrid(near, kKeepOutScanYards, alive); + for (Creature* c : near) + if (c->IsHostileTo(scout) && InsideAny(g_keepOut, c->GetPositionX(), c->GetPositionY(), 0.0f)) + forbiddenAll.push_back(c->GetGUID()); + } auto const trailsHolder = [&packHolders](Unit* enemy) { for (auto const& [holder, rule] : packHolders)