diff --git a/data/sql/updates/pending_db_world/rev_1744559106171295151.sql b/data/sql/updates/pending_db_world/rev_1744559106171295151.sql new file mode 100644 index 000000000..61480da43 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1744559106171295151.sql @@ -0,0 +1,2 @@ +-- Singularity speed +UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 0.7142 WHERE (`entry` = 25855); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 1b987e7b3..3df6ad0c5 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -285,27 +285,50 @@ struct npc_singularity : public NullCreatureAI me->m_Events.AddEventAtOffset([&] { DoCastSelf(SPELL_BLACK_HOLE_VISUAL2, true); DoCastSelf(SPELL_BLACK_HOLE_PASSIVE, true); + + // Start following players after visuals are complete + FindAndFollowTarget(); }, 8s); me->m_Events.AddEventAtOffset([&] { me->KillSelf(); }, 17s); + } - scheduler.Schedule(8s, [this](TaskContext context) + void FindAndFollowTarget() + { + scheduler.Schedule(1s, [this](TaskContext context) { + Player* target = nullptr; + auto const& playerList = me->GetMap()->GetPlayers(); for (auto const& playerRef : playerList) { if (Player* player = playerRef.GetSource()) + { if (me->IsWithinLOSInMap(player) && player->IsAlive() && !player->HasAura(SPELL_BLACK_HOLE_EFFECT)) { - me->GetMotionMaster()->MovePoint(0, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), false, true); - context.Repeat(); - return; + target = player; + break; } + } } - context.Repeat(1s); + if (target) + { + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f); + + scheduler.Schedule(6s, [this](TaskContext) + { + FindAndFollowTarget(); + }); + } + else + { + // No valid target found, check again soon + context.Repeat(1s); + } }); } @@ -410,7 +433,9 @@ class spell_entropius_black_hole_effect : public SpellScript if (target->GetDistance(GetCaster()) < 5.0f) { float o = frand(0, 2 * M_PI); - pos.Relocate(GetCaster()->GetPositionX() + 4.0f * cos(o), GetCaster()->GetPositionY() + 4.0f * std::sin(o), GetCaster()->GetPositionZ() + frand(10.0f, 15.0f)); + pos.Relocate(GetCaster()->GetPositionX() + 8.0f * cos(o), + GetCaster()->GetPositionY() + 8.0f * std::sin(o), + GetCaster()->GetPositionZ() + frand(2.0f, 5.0f)); } else pos.Relocate(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ() + 1.0f);