From ee5c64007799814b129d8f424419c7c6c7e50c58 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sun, 24 Jul 2016 13:23:27 +0000 Subject: [PATCH] Stored npc talk interaction distance to a static variable. --- trunk/java/com/l2jmobius/gameserver/model/actor/L2Npc.java | 4 +++- .../network/clientpackets/RequestBypassToServer.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/trunk/java/com/l2jmobius/gameserver/model/actor/L2Npc.java b/trunk/java/com/l2jmobius/gameserver/model/actor/L2Npc.java index 4416625426..6cba860179 100644 --- a/trunk/java/com/l2jmobius/gameserver/model/actor/L2Npc.java +++ b/trunk/java/com/l2jmobius/gameserver/model/actor/L2Npc.java @@ -105,6 +105,8 @@ public class L2Npc extends L2Character { /** The interaction distance of the L2NpcInstance(is used as offset in MovetoLocation method) */ public static final int INTERACTION_DISTANCE = 150; + /** The talking interaction distance of the L2NpcInstance */ + public static final int INTERACTION_DISTANCE_TALK = 200; /** Maximum distance where the drop may appear given this NPC position. */ public static final int RANDOM_ITEM_DROP_LIMIT = 70; /** The L2Spawn object that manage this L2NpcInstance */ @@ -493,7 +495,7 @@ public class L2Npc extends L2Character { return false; } - else if (!isInsideRadius(player, (int) (INTERACTION_DISTANCE * 1.7), true, false)) + else if (!isInsideRadius(player, INTERACTION_DISTANCE_TALK, true, false)) { return false; } diff --git a/trunk/java/com/l2jmobius/gameserver/network/clientpackets/RequestBypassToServer.java b/trunk/java/com/l2jmobius/gameserver/network/clientpackets/RequestBypassToServer.java index 23514258e0..b393d512e5 100644 --- a/trunk/java/com/l2jmobius/gameserver/network/clientpackets/RequestBypassToServer.java +++ b/trunk/java/com/l2jmobius/gameserver/network/clientpackets/RequestBypassToServer.java @@ -110,7 +110,7 @@ public final class RequestBypassToServer implements IClientIncomingPacket return; } - if ((bypassOriginId > 0) && !Util.isInsideRangeOfObjectId(activeChar, bypassOriginId, L2Npc.INTERACTION_DISTANCE)) + if ((bypassOriginId > 0) && !Util.isInsideRangeOfObjectId(activeChar, bypassOriginId, L2Npc.INTERACTION_DISTANCE_TALK)) { // No logging here, this could be a common case where the player has the html still open and run too far away and then clicks a html action return; @@ -159,7 +159,7 @@ public final class RequestBypassToServer implements IClientIncomingPacket { final L2Object object = L2World.getInstance().findObject(Integer.parseInt(id)); - if ((object != null) && object.isNpc() && (endOfId > 0) && activeChar.isInsideRadius(object, L2Npc.INTERACTION_DISTANCE, false, false)) + if ((object != null) && object.isNpc() && (endOfId > 0) && activeChar.isInsideRadius(object, L2Npc.INTERACTION_DISTANCE_TALK, false, false)) { ((L2Npc) object).onBypassFeedback(activeChar, _command.substring(endOfId + 1)); }