@@ -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+
672679struct 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