Exiles Reach (ship): replace boundary-evade with a distance leash for the sparring clone
Build (Windows x64) / build (push) Canceled after 0s
Build (Windows x64) / linux-build (push) Canceled after 0s

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.
This commit is contained in:
devbox
2026-08-23 17:40:55 +10:00
parent 5072ad8f6f
commit b47740c125
@@ -214,6 +214,25 @@ struct npc_exiles_reach_ship_166583_160664 : public ScriptedAI
{ {
npc_exiles_reach_ship_166583_160664(Creature* creature) : ScriptedAI(creature) {} 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() void BeFriendly()
{ {
me->AttackStop(); me->AttackStop();
@@ -230,6 +249,9 @@ struct npc_exiles_reach_ship_166583_160664 : public ScriptedAI
case QUEST_H_STAND_YOUR_GROUND: case QUEST_H_STAND_YOUR_GROUND:
if (Creature* clone = me->SummonPersonalClone(me->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0U, 0U, player)) 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->SetHealth(player->GetHealth());
clone->AI()->Talk(0, player); clone->AI()->Talk(0, player);
// I'll take my position. Strike first, and strike hard! // I'll take my position. Strike first, and strike hard!
@@ -305,6 +327,10 @@ struct npc_exiles_reach_ship_166583_160664 : public ScriptedAI
else else
me->CastSpell(player, SPELL_JUMP_BEHIND, true); me->CastSpell(player, SPELL_JUMP_BEHIND, true);
} }
private:
Position _leashPosition;
bool _leashSet = false;
}; };
void AddSC_exiles_reach_north_sea() void AddSC_exiles_reach_north_sea()