Skip to content

Commit 08ca9eb

Browse files
authored
fix(Scripts/SunwellPlateau): Make Twin special abilities target one of the highest 6 in threat of the other twin (#21964)
1 parent 40a6d66 commit 08ca9eb

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ struct boss_sacrolash : public BossAI
119119

120120
scheduler.CancelGroup(GROUP_SPECIAL_ABILITY);
121121
ScheduleTimedEvent(20s, [&] {
122-
Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 100.0f);
122+
Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false);
123123
if (!target)
124124
target = me->GetVictim();
125125

@@ -153,7 +153,14 @@ struct boss_sacrolash : public BossAI
153153
}, 8s, 12s);
154154

155155
scheduler.Schedule(36s, GROUP_SPECIAL_ABILITY, [this](TaskContext context) {
156-
Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 100.0f);
156+
Unit* target = nullptr;
157+
if (Creature* alythess = instance->GetCreature(DATA_ALYTHESS))
158+
{
159+
std::list<Unit*> targets;
160+
alythess->AI()->SelectTargetList(targets, 6, SelectTargetMethod::MaxThreat, 0, 100.0f, true, false);
161+
if (!targets.empty())
162+
target = Acore::Containers::SelectRandomContainerElement(targets);
163+
}
157164
if (!target)
158165
target = me->GetVictim();
159166
Talk(EMOTE_SHADOW_NOVA, target);
@@ -244,7 +251,7 @@ struct boss_alythess : public BossAI
244251
}, 8s, 10s);
245252

246253
ScheduleTimedEvent(20s, 26s, [&] {
247-
Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 100.0f);
254+
Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false);
248255
if (!target)
249256
target = me->GetVictim();
250257
DoCast(target, SPELL_SHADOW_NOVA);
@@ -280,7 +287,14 @@ struct boss_alythess : public BossAI
280287
}, 10s, 15s);
281288

282289
scheduler.Schedule(20s, GROUP_SPECIAL_ABILITY, [this](TaskContext context) {
283-
Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 100.0f);
290+
Unit* target = nullptr;
291+
if (Creature* sacrolash = instance->GetCreature(DATA_SACROLASH))
292+
{
293+
std::list<Unit*> targets;
294+
sacrolash->AI()->SelectTargetList(targets, 6, SelectTargetMethod::MaxThreat, 0, 100.0f, true, false);
295+
if (!targets.empty())
296+
target = Acore::Containers::SelectRandomContainerElement(targets);
297+
}
284298
if (!target)
285299
target = me->GetVictim();
286300
Talk(EMOTE_CONFLAGRATION, target);

0 commit comments

Comments
 (0)