From b47740c125bb86994495373ca284fccb86c277e3 Mon Sep 17 00:00:00 2001 From: devbox Date: Sun, 23 Aug 2026 17:40:55 +1000 Subject: [PATCH] Exiles Reach (ship): replace boundary-evade with a distance leash for the sparring clone The SetBoundary approach made the sparring partner evade back to home with a straight spline, clipping through the boat hull. Use a distance leash in UpdateAI instead: stop chasing past 15y and walk back on the ship geometry. --- .../ExilesReach/exiles_reach_north_sea.cpp | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/server/scripts/ExilesReach/exiles_reach_north_sea.cpp b/src/server/scripts/ExilesReach/exiles_reach_north_sea.cpp index 4996097f8..8bde9a4ac 100644 --- a/src/server/scripts/ExilesReach/exiles_reach_north_sea.cpp +++ b/src/server/scripts/ExilesReach/exiles_reach_north_sea.cpp @@ -214,6 +214,25 @@ struct npc_exiles_reach_ship_166583_160664 : public ScriptedAI { npc_exiles_reach_ship_166583_160664(Creature* creature) : ScriptedAI(creature) {} + void SetLeashPosition(Position const& pos) { _leashPosition = pos; _leashSet = true; } + + void UpdateAI(uint32 diff) override + { + if (Unit* victim = me->GetVictim()) + { + // Stay on the boat: if the sparring partner gets dragged past the + // deck edge, stop chasing and walk back on the ship's geometry + // (avoids the boundary-evade spline that clips through the hull). + if (_leashSet && me->GetDistance(_leashPosition) > 15.0f) + { + me->AttackStop(); + me->GetMotionMaster()->MovePoint(0, _leashPosition); + return; + } + } + ScriptedAI::UpdateAI(diff); + } + void BeFriendly() { me->AttackStop(); @@ -230,6 +249,9 @@ struct npc_exiles_reach_ship_166583_160664 : public ScriptedAI case QUEST_H_STAND_YOUR_GROUND: if (Creature* clone = me->SummonPersonalClone(me->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0U, 0U, player)) { + if (npc_exiles_reach_ship_166583_160664* personalAI = CAST_AI(npc_exiles_reach_ship_166583_160664, clone->AI())) + personalAI->SetLeashPosition(me->GetPosition()); + clone->SetHealth(player->GetHealth()); clone->AI()->Talk(0, player); // I'll take my position. Strike first, and strike hard! @@ -305,6 +327,10 @@ struct npc_exiles_reach_ship_166583_160664 : public ScriptedAI else me->CastSpell(player, SPELL_JUMP_BEHIND, true); } + +private: + Position _leashPosition; + bool _leashSet = false; }; void AddSC_exiles_reach_north_sea()