Skip to content
Snippets Groups Projects
Commit 51edc3fb authored by Zoey76's avatar Zoey76
Browse files

Player should move to the first obstacle on action

Reported by: sahar
Patch by: @petpal
parent e4fd1a08
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ import com.l2jserver.gameserver.enums.InstanceType; ...@@ -24,6 +24,7 @@ import com.l2jserver.gameserver.enums.InstanceType;
import com.l2jserver.gameserver.enums.PrivateStoreType; import com.l2jserver.gameserver.enums.PrivateStoreType;
import com.l2jserver.gameserver.handler.IActionHandler; import com.l2jserver.gameserver.handler.IActionHandler;
import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.TvTEvent; import com.l2jserver.gameserver.model.entity.TvTEvent;
...@@ -105,6 +106,12 @@ public class L2PcInstanceAction implements IActionHandler ...@@ -105,6 +106,12 @@ public class L2PcInstanceAction implements IActionHandler
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target); activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
activeChar.onActionRequest(); activeChar.onActionRequest();
} }
else
{
final Location destination = GeoData.getInstance().moveCheck(activeChar.getX(), activeChar.getY(), activeChar.getZ(), target.getX(), target.getY(), target.getZ(), activeChar.getInstanceId());
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
activeChar.onActionRequest();
}
} }
} }
else else
...@@ -115,6 +122,12 @@ public class L2PcInstanceAction implements IActionHandler ...@@ -115,6 +122,12 @@ public class L2PcInstanceAction implements IActionHandler
{ {
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target); activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
} }
else
{
final Location destination = GeoData.getInstance().moveCheck(activeChar.getX(), activeChar.getY(), activeChar.getZ(), target.getX(), target.getY(), target.getZ(), activeChar.getInstanceId());
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
activeChar.onActionRequest();
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment