Jump to content
  • 0

acis 370 shop zone


Question

11 answers to this question

Recommended Posts

  • 0
Posted

Create a file NoStoreZone.xml and paste there your coords (create a shape) where you do not allow stores. There is core support for NO_STORE zone inside aCis.

If you ask me, easier, fast would be to do opposite rename/create a StoreZone, then add/change some checks.

  • 0
Posted

There exists a file named L2NoStoreZone.java....

You have to create your zone and in type just write "NoStoreZone"

  • 0
Posted
13 minutes ago, melron said:

There exists a file named L2NoStoreZone.java....

You have to create your zone and in type just write "NoStoreZone"

yes but then that zone will be noshop zone, i make all towns no shop now but i need to make giran harbor (Not all just small space) like shop area..

  • 0
Posted

Here you are. Btw you only need one, either nostore zone or store zone.

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/model/zone/type/L2NoStoreZone.java
===================================================================
--- java/net/sf/l2j/gameserver/model/zone/type/L2NoStoreZone.java	(revision 2)
+++ java/net/sf/l2j/gameserver/model/zone/type/L2NoStoreZone.java	(nonexistent)
@@ -1,42 +0,0 @@
-package net.sf.l2j.gameserver.model.zone.type;
-
-import net.sf.l2j.gameserver.model.actor.Character;
-import net.sf.l2j.gameserver.model.actor.instance.Player;
-import net.sf.l2j.gameserver.model.zone.L2ZoneType;
-import net.sf.l2j.gameserver.model.zone.ZoneId;
-
-/**
- * Zone where store is not allowed.
- * @author fordfrog
- */
-public class L2NoStoreZone extends L2ZoneType
-{
-	public L2NoStoreZone(final int id)
-	{
-		super(id);
-	}
-	
-	@Override
-	protected void onEnter(final Character character)
-	{
-		if (character instanceof Player)
-			character.setInsideZone(ZoneId.NO_STORE, true);
-	}
-	
-	@Override
-	protected void onExit(final Character character)
-	{
-		if (character instanceof Player)
-			character.setInsideZone(ZoneId.NO_STORE, false);
-	}
-	
-	@Override
-	public void onDieInside(final Character character)
-	{
-	}
-	
-	@Override
-	public void onReviveInside(final Character character)
-	{
-	}
-}
\ No newline at end of file

Index: java/net/sf/l2j/gameserver/model/zone/type/L2StoreZone.java
===================================================================
--- java/net/sf/l2j/gameserver/model/zone/type/L2StoreZone.java	(nonexistent)
+++ java/net/sf/l2j/gameserver/model/zone/type/L2StoreZone.java	(working copy)
@@ -0,0 +1,42 @@
+package net.sf.l2j.gameserver.model.zone.type;
+
+import net.sf.l2j.gameserver.model.actor.Character;
+import net.sf.l2j.gameserver.model.actor.instance.Player;
+import net.sf.l2j.gameserver.model.zone.L2ZoneType;
+import net.sf.l2j.gameserver.model.zone.ZoneId;
+
+/**
+ * Zone where store is allowed.
+ * @author fordfrog
+ */
+public class L2StoreZone extends L2ZoneType
+{
+	public L2StoreZone(final int id)
+	{
+		super(id);
+	}
+	
+	@Override
+	protected void onEnter(final Character character)
+	{
+		if (character instanceof Player)
+			character.setInsideZone(ZoneId.STORE, true);
+	}
+	
+	@Override
+	protected void onExit(final Character character)
+	{
+		if (character instanceof Player)
+			character.setInsideZone(ZoneId.STORE, false);
+	}
+	
+	@Override
+	public void onDieInside(final Character character)
+	{
+	}
+	
+	@Override
+	public void onReviveInside(final Character character)
+	{
+	}
+}
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/model/zone/type/L2JailZone.java
===================================================================
--- java/net/sf/l2j/gameserver/model/zone/type/L2JailZone.java	(revision 2)
+++ java/net/sf/l2j/gameserver/model/zone/type/L2JailZone.java	(working copy)
@@ -25,7 +25,6 @@
 		{
 			character.setInsideZone(ZoneId.JAIL, true);
 			character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true);
-			character.setInsideZone(ZoneId.NO_STORE, true);
 		}
 	}
 	
@@ -36,7 +35,6 @@
 		{
 			character.setInsideZone(ZoneId.JAIL, false);
 			character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, false);
-			character.setInsideZone(ZoneId.NO_STORE, false);
 			
 			final Player player = ((Player) character);
 			if (player.isInJail() && !player.isInsideZone(ZoneId.JAIL))
Index: java/net/sf/l2j/gameserver/model/zone/ZoneId.java
===================================================================
--- java/net/sf/l2j/gameserver/model/zone/ZoneId.java	(revision 2)
+++ java/net/sf/l2j/gameserver/model/zone/ZoneId.java	(working copy)
@@ -18,7 +18,7 @@
 	CASTLE(9),
 	SWAMP(10),
 	NO_SUMMON_FRIEND(11),
-	NO_STORE(12),
+	STORE(12),
 	TOWN(13),
 	HQ(14),
 	DANGER_AREA(15),
Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminZone.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminZone.java	(revision 2)
+++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminZone.java	(working copy)
@@ -91,7 +91,7 @@
 		html.replace("%CASTLE%", (activeChar.isInsideZone(ZoneId.CASTLE) ? "<font color=\"LEVEL\">YES</font>" : "NO"));
 		html.replace("%SWAMP%", (activeChar.isInsideZone(ZoneId.SWAMP) ? "<font color=\"LEVEL\">YES</font>" : "NO"));
 		html.replace("%NOSUMMONFRIEND%", (activeChar.isInsideZone(ZoneId.NO_SUMMON_FRIEND) ? "<font color=\"LEVEL\">YES</font>" : "NO"));
-		html.replace("%NOSTORE%", (activeChar.isInsideZone(ZoneId.NO_STORE) ? "<font color=\"LEVEL\">YES</font>" : "NO"));
+		html.replace("%STORE%", (activeChar.isInsideZone(ZoneId.STORE) ? "<font color=\"LEVEL\">YES</font>" : "NO"));
 		html.replace("%TOWN%", (activeChar.isInsideZone(ZoneId.TOWN) ? "<font color=\"LEVEL\">YES</font>" : "NO"));
 		html.replace("%HQ%", (activeChar.isInsideZone(ZoneId.HQ) ? "<font color=\"LEVEL\">YES</font>" : "NO"));
 		html.replace("%DANGERAREA%", (activeChar.isInsideZone(ZoneId.DANGER_AREA) ? "<font color=\"LEVEL\">YES</font>" : "NO"));
Index: java/net/sf/l2j/gameserver/model/actor/instance/Player.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/Player.java	(revision 2)
+++ java/net/sf/l2j/gameserver/model/actor/instance/Player.java	(working copy)
@@ -3623,7 +3623,7 @@
 		if (getActiveTradeList() != null)
 			cancelActiveTrade();
 		
-		return !isAlikeDead() && !isInOlympiadMode() && !isMounted() && !isInsideZone(ZoneId.NO_STORE) && !isCastingNow();
+		return !isAlikeDead() && !isInOlympiadMode() && !isMounted() && isInsideZone(ZoneId.STORE) && !isCastingNow();
 	}
 	
 	public void tryOpenPrivateBuyStore()
@@ -3643,7 +3643,7 @@
 		}
 		else
 		{
-			if (isInsideZone(ZoneId.NO_STORE))
+			if (!isInsideZone(ZoneId.STORE))
 				sendPacket(SystemMessageId.NO_PRIVATE_STORE_HERE);
 			
 			sendPacket(ActionFailed.STATIC_PACKET);
@@ -3667,7 +3667,7 @@
 		}
 		else
 		{
-			if (isInsideZone(ZoneId.NO_STORE))
+			if (!isInsideZone(ZoneId.STORE))
 				sendPacket(SystemMessageId.NO_PRIVATE_STORE_HERE);
 			
 			sendPacket(ActionFailed.STATIC_PACKET);
@@ -3693,7 +3693,7 @@
 		}
 		else
 		{
-			if (isInsideZone(ZoneId.NO_STORE))
+			if (!isInsideZone(ZoneId.STORE))
 				sendPacket(SystemMessageId.NO_PRIVATE_WORKSHOP_HERE);
 			
 			sendPacket(ActionFailed.STATIC_PACKET);
Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopListSet.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopListSet.java	(revision 2)
+++ java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopListSet.java	(working copy)
@@ -45,7 +45,7 @@
 			return;
 		}
 		
-		if (player.isInsideZone(ZoneId.NO_STORE))
+		if (!player.isInsideZone(ZoneId.STORE))
 		{
 			player.sendPacket(SystemMessageId.NO_PRIVATE_WORKSHOP_HERE);
 			player.sendPacket(ActionFailed.STATIC_PACKET);
Index: java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java	(revision 2)
+++ java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java	(working copy)
@@ -69,7 +69,7 @@
 			return;
 		}
 		
-		if (player.isInsideZone(ZoneId.NO_STORE))
+		if (!player.isInsideZone(ZoneId.STORE))
 		{
 			player.sendPacket(SystemMessageId.NO_PRIVATE_STORE_HERE);
 			player.sendPacket(new PrivateStoreManageListBuy(player));
Index: java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java	(revision 2)
+++ java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java	(working copy)
@@ -70,7 +70,7 @@
 			return;
 		}
 		
-		if (player.isInsideZone(ZoneId.NO_STORE))
+		if (!player.isInsideZone(ZoneId.STORE))
 		{
 			player.sendPacket(SystemMessageId.NO_PRIVATE_STORE_HERE);
 			player.sendPacket(new PrivateStoreManageListSell(player, _packageSale));

Make a StoreZone.xml with the zones you want and you are ready.

  • 0
Posted (edited)
	@Override
	protected void onEnter(final Character character)
	{
		if (character instanceof Player)
			character.setInsideZone(ZoneId.STORE, true);
	}
	
	@Override
	protected void onExit(final Character character)
	{
		if (character instanceof Player)
			character.setInsideZone(ZoneId.STORE, false);
	}

wrong

Quote

+	@Override
+	protected void onEnter(final Character character)
+	{
+		if (character instanceof Player)
+			character.setInsideZone(ZoneId.STORE,false);
+	}
+	
+	@Override
+	protected void onExit(final Character character)
+	{
+		if (character instanceof Player)
+			character.setInsideZone(ZoneId.STORE, true);
+	}

right

Edited by zFritS

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock