Skip to content

Commit f7ab757

Browse files
sogladevNyeriah
andauthored
chore(Scripts/Ulduar): boss_kologarn_pit_kill_bunny (azerothcore#24636)
Co-authored-by: Andrew <47818697+Nyeriah@users.noreply.github.com>
1 parent 7137295 commit f7ab757

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -669,25 +669,29 @@ class spell_kologarn_focused_eyebeam : public SpellScript
669669
}
670670
};
671671

672+
namespace pitKillBoundary {
673+
static auto const boundaryIntersect = new BoundaryIntersectBoundary(
674+
new RectangleBoundary(1782.0f, 1832.0f, -56.0f, 8.0f),
675+
new ZRangeBoundary(400.0f, 439.0f)
676+
);
677+
}
678+
672679
struct boss_kologarn_pit_kill_bunny : public NullCreatureAI
673680
{
674-
boss_kologarn_pit_kill_bunny(Creature* creature) : NullCreatureAI(creature) { }
681+
explicit boss_kologarn_pit_kill_bunny(Creature* creature) : NullCreatureAI(creature) { }
675682

676683
void Reset() override
677684
{
678-
RectangleBoundary* _boundaryXY = new RectangleBoundary(1782.0f, 1832.0f, -56.0f, 8.0f);
679-
ZRangeBoundary* _boundaryZ = new ZRangeBoundary(400.0f, 439.0f);
680-
_boundaryIntersect = new BoundaryIntersectBoundary(_boundaryXY, _boundaryZ);
681-
682-
scheduler.Schedule(0s, [this](TaskContext context)
685+
scheduler.CancelAll();
686+
scheduler.Schedule(0s,
687+
[this](TaskContext context)
683688
{
684689
me->GetMap()->DoForAllPlayers([&](Player* player)
685690
{
686-
if (_boundaryIntersect->IsWithinBoundary(player->GetPosition()) && !player->IsGameMaster())
687-
{
691+
if (pitKillBoundary::boundaryIntersect->IsWithinBoundary(player->GetPosition()) && !player->IsGameMaster())
688692
player->KillSelf(false);
689-
}
690693
});
694+
691695
context.Repeat(1s);
692696
});
693697
}
@@ -696,8 +700,6 @@ struct boss_kologarn_pit_kill_bunny : public NullCreatureAI
696700
{
697701
scheduler.Update(diff);
698702
}
699-
private:
700-
BoundaryIntersectBoundary const* _boundaryIntersect;
701703
};
702704

703705
// predicate function to select non main tank target

0 commit comments

Comments
 (0)