Minimum range for private stores.
This commit is contained in:
@@ -7073,4 +7073,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
return getTemplate().getRace();
|
||||
}
|
||||
|
||||
public int getMinShopDistance()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@@ -1939,4 +1939,10 @@ public class L2Npc extends L2Character
|
||||
_summonedNpcs.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinShopDistance()
|
||||
{
|
||||
return Config.SHOP_MIN_RANGE_FROM_NPC;
|
||||
}
|
||||
}
|
||||
|
@@ -4712,9 +4712,27 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
public boolean canOpenPrivateStore()
|
||||
{
|
||||
if ((Config.SHOP_MIN_RANGE_FROM_NPC > 0) || (Config.SHOP_MIN_RANGE_FROM_PLAYER > 0))
|
||||
{
|
||||
for (L2Character cha : getKnownList().getKnownCharacters())
|
||||
{
|
||||
if (Util.checkIfInRange(cha.getMinShopDistance(), this, cha, true))
|
||||
{
|
||||
sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_OPEN_A_PRIVATE_STORE_HERE));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return !isAlikeDead() && !isInOlympiadMode() && !isMounted() && !isInsideZone(ZoneId.NO_STORE) && !isCastingNow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinShopDistance()
|
||||
{
|
||||
return (isSitting()) ? Config.SHOP_MIN_RANGE_FROM_PLAYER : 0;
|
||||
}
|
||||
|
||||
public void tryOpenPrivateBuyStore()
|
||||
{
|
||||
// Player shouldn't be able to set stores if he/she is alike dead (dead or fake death)
|
||||
|
Reference in New Issue
Block a user