Stored npc talk interaction distance to a static variable.
This commit is contained in:
parent
f2a055aedc
commit
ee5c640077
@ -105,6 +105,8 @@ public class L2Npc extends L2Character
|
|||||||
{
|
{
|
||||||
/** The interaction distance of the L2NpcInstance(is used as offset in MovetoLocation method) */
|
/** The interaction distance of the L2NpcInstance(is used as offset in MovetoLocation method) */
|
||||||
public static final int INTERACTION_DISTANCE = 150;
|
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. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
/** The L2Spawn object that manage this L2NpcInstance */
|
/** The L2Spawn object that manage this L2NpcInstance */
|
||||||
@ -493,7 +495,7 @@ public class L2Npc extends L2Character
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (!isInsideRadius(player, (int) (INTERACTION_DISTANCE * 1.7), true, false))
|
else if (!isInsideRadius(player, INTERACTION_DISTANCE_TALK, true, false))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ public final class RequestBypassToServer implements IClientIncomingPacket
|
|||||||
return;
|
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
|
// 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;
|
return;
|
||||||
@ -159,7 +159,7 @@ public final class RequestBypassToServer implements IClientIncomingPacket
|
|||||||
{
|
{
|
||||||
final L2Object object = L2World.getInstance().findObject(Integer.parseInt(id));
|
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));
|
((L2Npc) object).onBypassFeedback(activeChar, _command.substring(endOfId + 1));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user