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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user