Stored npc talk interaction distance to a static variable.

This commit is contained in:
MobiusDev 2016-07-24 13:23:27 +00:00
parent f2a055aedc
commit ee5c640077
2 changed files with 5 additions and 3 deletions

View File

@ -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;
}

View File

@ -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));
}