Jump to content
  • 0

[Help] Private stores


NumL0ck

Question

3 answers to this question

Recommended Posts

  • 0
### Eclipse Workspace Patch 1.0
#P L2_GameServer_It
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 5502)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -748,6 +748,8 @@
	/** The event y. */
	public int eventY;

+	private boolean locked;
+	
	/** The event z. */
	public int eventZ;

@@ -1221,6 +1223,16 @@
		initPcStatusUpdateValues();
	}

+	public boolean canSellBuy()
+	{
+		if(isLocked())
+		{
+			sendMessage("You can buy/sell only in Giran Castle Town, we are sorry.");
+			return false;
+		}
+		return true;
+	}
+	
	@Override
	public final PcKnownList getKnownList()
	{
@@ -1363,6 +1375,16 @@
		return getStat().getLevel();
	}

+	public void setLocked(boolean locked)
+	{
+		this.locked = locked;
+	}
+	
+	public boolean isLocked()
+	{
+		return locked;
+	}
+	
	/**
	 * Return the _newbie state of the L2PcInstance.
	 * @return true, if is newbie
Index: java/net/sf/l2j/gameserver/clientpackets/SetPrivateStoreListSell.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/SetPrivateStoreListSell.java	(revision 5502)
+++ java/net/sf/l2j/gameserver/clientpackets/SetPrivateStoreListSell.java	(working copy)
@@ -101,6 +101,9 @@
			player.broadcastUserInfo();
             return;
         }
+        
+        if(!player.canSellBuy())
+        	return;

         // Check maximum number of allowed slots for pvt shops
         if (_count > player.GetPrivateSellStoreLimit())
Index: java/net/sf/l2j/gameserver/clientpackets/SetPrivateStoreListBuy.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/SetPrivateStoreListBuy.java	(revision 5502)
+++ java/net/sf/l2j/gameserver/clientpackets/SetPrivateStoreListBuy.java	(working copy)
@@ -99,6 +99,9 @@
			player.broadcastUserInfo();
             return;
         }
+        
+        if(!player.canSellBuy())
+        	return;

         // Check maximum number of allowed slots for pvt shops
         if (_count > player.GetPrivateBuyStoreLimit())
Index: java/net/sf/l2j/gameserver/model/zone/type/L2TownZone.java
===================================================================
--- java/net/sf/l2j/gameserver/model/zone/type/L2TownZone.java	(revision 5502)
+++ java/net/sf/l2j/gameserver/model/zone/type/L2TownZone.java	(working copy)
@@ -36,6 +36,8 @@
	private int _taxById;
	private boolean _noPeace;
	private int[] _spawnLoc;
+	
+	int giranId = 2; // 2 is random, change it.


	public L2TownZone()
@@ -99,6 +101,12 @@
			// Could also check if this town is in siege, or if any siege is going on
			if (((L2PcInstance)character).getSiegeState() != 0 && Config.ZONE_TOWN == 1)
				return;
+			
+			if(getTownId() != giranId)
+			
+				((L2PcInstance) character).setLocked(true);
+			else
+				((L2PcInstance) character).setLocked(false);

			//((L2PcInstance)character).sendMessage("You entered "+_townName);
		}

Link to comment
Share on other sites

  • 0

I unlock as p0nyrider answer is good, but doesn't use existing stuff of L2J.

 

Search for L2NoStoreZone on latest L2J, and adapt on whatever pack you're using. Some packs like mine (aCis) got already core support, you simply need to add zones.

 

Relocked, and be more curious else your server will be a big fail.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...