Skip to content

Commit e675151

Browse files
fix(Scripts/IcecrownCitadel): fix Lord Marrowgar MaxDistance bonestorm (azerothcore#25906)
1 parent 4f17454 commit e675151

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,21 @@ struct boss_lord_marrowgar : public BossAI
217217
break;
218218
}
219219
events.Repeat(5s);
220-
Unit* unit = SelectTarget(SelectTargetMethod::Random, 0, BoneStormMoveTargetSelector(me));
221-
if (!unit)
220+
std::list<Unit*> targets;
221+
SelectTargetList(targets, Is25ManRaid() ? 2 : 1, SelectTargetMethod::MaxDistance, 0, BoneStormMoveTargetSelector(me));
222+
223+
Unit* unit = nullptr;
224+
if (!targets.empty())
225+
unit = targets.size() == 1 ? targets.front() : Acore::Containers::SelectRandomContainerElement(targets);
226+
else if ((unit = SelectTarget(SelectTargetMethod::MaxThreat, 0, 175.0f, true)))
222227
{
223-
if ((unit = SelectTarget(SelectTargetMethod::MaxThreat, 0, 175.0f, true)))
224-
if (unit->GetPositionX() > -337.0f)
225-
{
226-
EnterEvadeMode();
227-
return;
228-
}
228+
if (unit->GetPositionX() > -337.0f)
229+
{
230+
EnterEvadeMode();
231+
return;
232+
}
229233
}
234+
230235
if (unit)
231236
me->GetMotionMaster()->MoveCharge(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), 25.0f, 1337);
232237
break;

0 commit comments

Comments
 (0)