From 7cd9bd940ec3c686588cac75b47b8c56effc1aab Mon Sep 17 00:00:00 2001 From: Grimdhex <176165533+Grimdhex@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:01:04 +0200 Subject: [PATCH] try a new way by keeping a random teleport --- .../Outland/BlackTemple/boss_mother_shahraz.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index a6e7fe5823..14fa6a2c31 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -215,7 +215,18 @@ class spell_mother_shahraz_fatal_attraction : public SpellScript void SetDest(SpellDestination& dest) { - dest.Relocate(CenterOfOutdoorCourt); + // Initialize a first destination + Position teleportDest = GetCaster()->GetRandomNearPosition(50.0f); + + // Ensure that the destination is not too close to the caster. + // @todo: Need maybe a LOS Check? + while (teleportDest.GetExactDist(GetCaster()->GetPosition()) < 50.0f) + { + teleportDest = GetCaster()->GetRandomNearPosition(50.0f); + } + + // When a valid destination is found, relocate it. + dest.Relocate(teleportDest); } void HandleTeleportUnits(SpellEffIndex /*effIndex*/)