From 66b7a3852d5b23a1068a2d51e3efd69f1db85b6f Mon Sep 17 00:00:00 2001 From: Bobblybook Date: Fri, 18 Oct 2024 20:57:48 +1100 Subject: [PATCH] HoL updates --- .../HallsOfLightningActions.cpp | 9 ++++++++- .../HallsOfLightningMultipliers.cpp | 17 ++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningActions.cpp b/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningActions.cpp index 6ca64dd4..ac469e95 100644 --- a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningActions.cpp +++ b/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningActions.cpp @@ -19,8 +19,15 @@ bool BjarngrimTargetAction::Execute(Event event) break; } } + + Unit* currentTarget = AI_VALUE(Unit*, "current target"); // There are two, we don't want to ping-pong between them if we're attacking one already - if (!target || AI_VALUE(Unit*, "current target") == target) + if (target && currentTarget && currentTarget->GetEntry() == NPC_STORMFORGED_LIEUTENANT) + { + return false; + } + + if (AI_VALUE(Unit*, "current target") == target) { return false; } diff --git a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningMultipliers.cpp b/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningMultipliers.cpp index 0250868d..0ecb2e56 100644 --- a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningMultipliers.cpp +++ b/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningMultipliers.cpp @@ -19,7 +19,22 @@ float BjarngrimMultiplier::GetValue(Action* action) } } - Unit* boss_add = AI_VALUE2(Unit*, "find target", "stormforged lieutenant"); + // Detect boss adds this way as sometimes they don't get added to threat table on dps bots, + // and some dps just stand at range and don't engage the boss at all as they can't find the adds + // Unit* boss_add = AI_VALUE2(Unit*, "find target", "stormforged lieutenant"); + Unit* boss_add = nullptr; + GuidVector targets = AI_VALUE(GuidVector, "possible targets no los"); + + for (auto i = targets.begin(); i != targets.end(); ++i) + { + Unit* unit = botAI->GetUnit(*i); + if (unit && unit->GetEntry() == NPC_STORMFORGED_LIEUTENANT) + { + boss_add = unit; + break; + } + } + if (!boss_add || botAI->IsTank(bot)) { return 1.0f; } if (dynamic_cast(action))