Jump to content

Recommended Posts

Posted

Hello, Today i'll share a new zone called "Newbie Zone".

You can restrict players to enter if they wear items enchant more then 3

 

Index: head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java	(revision 948)
+++ head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java	(working copy)
@@ -58,6 +58,7 @@
import com.l2jfrozen.gameserver.model.zone.type.L2FortZone;
import com.l2jfrozen.gameserver.model.zone.type.L2JailZone;
import com.l2jfrozen.gameserver.model.zone.type.L2MotherTreeZone;
+import com.l2jfrozen.gameserver.model.zone.type.L2NewbieZone;
import com.l2jfrozen.gameserver.model.zone.type.L2NoHqZone;
import com.l2jfrozen.gameserver.model.zone.type.L2NoLandingZone;
import com.l2jfrozen.gameserver.model.zone.type.L2OlympiadStadiumZone;
@@ -240,6 +241,10 @@
								{
									temp = new L2NoHqZone(zoneId);
								}
+								else if(zoneType.equals("Newbie"))
+								{
+									temp = new L2NewbieZone(zoneId);
+								}								
								else if(zoneType.equals("BossZone"))
								{
									int boss_id = -1;
Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/L2Character.java	(revision 948)
+++ head-src/com/l2jfrozen/gameserver/model/L2Character.java	(working copy)
@@ -340,6 +340,9 @@
	/** The Constant ZONE_DANGERAREA. */
	public static final int ZONE_DANGERAREA = 16384;

+	/** The Constant ZONE_NEWBIE. */
+	public static final int ZONE_NEWBIE = 16385;	
+
	/** The _current zones. */
	private int _currentZones = 0;

Index: head-src/com/l2jfrozen/gameserver/model/zone/type/L2NewbieZone.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/zone/type/L2NewbieZone.java	(revision 0)
+++ head-src/com/l2jfrozen/gameserver/model/zone/type/L2NewbieZone.java	(revision 0)
@@ -0,0 +1,83 @@
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package com.l2jfrozen.gameserver.model.zone.type;
+
+import com.l2jfrozen.gameserver.datatables.csv.MapRegionTable;
+import com.l2jfrozen.gameserver.model.L2Character;
+import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
+
+/**
+ * 
+ * @author Leki
+ */
+public class L2NewbieZone extends L2ZoneType
+{
+	public L2NewbieZone(int id)
+	{
+		super(id);
+	}
+
+	@Override
+	protected void onEnter(L2Character character)
+	{
+		if(character instanceof L2PcInstance)
+		{
+			L2PcInstance player = (L2PcInstance) character;
+			for (L2ItemInstance i : player.getInventory().getItems())
+			{
+				if (!player.isGM())
+				{	
+					if (i.isEquipable())
+					{	
+						if (i.getEnchantLevel() > 3)
+						{  
+							player.sendMessage("You can enter to this zone if your items aren't enchant more than 3");
+							player.teleToLocation(MapRegionTable.TeleportWhereType.Town);
+							return;
+						}
+					}
+				}
+			}	
+			if(!player.isGM() && player.isFlying())
+			{
+				player.teleToLocation(MapRegionTable.TeleportWhereType.Town);
+				return;
+			}
+			character.setInsideZone(L2Character.ZONE_NEWBIE, true);					
+		}
+	}
+
+	@Override
+	protected void onExit(L2Character character)
+	{
+		if(character instanceof L2PcInstance)
+		{
+			character.setInsideZone(L2Character.ZONE_NEWBIE, false);
+		}
+	}
+
+	@Override
+	public void onDieInside(L2Character character)
+	{}
+
+	@Override
+	public void onReviveInside(L2Character character)
+	{}
+}
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java	(revision 948)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java	(working copy)
@@ -21,6 +21,7 @@

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.model.Inventory;
+import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
@@ -135,7 +136,13 @@
			activeChar.setActiveEnchantItem(null);
			return;
		}
+		if(activeChar.isInsideZone(L2Character.ZONE_NEWBIE))
+		{
+			activeChar.sendMessage("You can't enchant in newbie zone!");
+			return;
+		}	

		/*
		if(!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_ENCHANT))
		{

 

DP

Index: zone.xml
===================================================================
--- zone.xml	(revision 946)
+++ zone.xml	(working copy)
@@ -881,7 +881,6 @@
	<zone id='13004' type='PeaceZone' shape='Cuboid' minZ='-2850' maxZ='-1300' /> <!-- Ivory Tower Top Floors -->
	<zone id='13005' type='PeaceZone' shape='NPoly' minZ='-3700' maxZ='-3500' /> <!-- Gludin Arena Entrance -->
	<zone id='13006' type='PeaceZone' shape='NPoly' minZ='-3800' maxZ='-3600' /> <!-- Giran Arena Entrance -->
-	<zone id='13007' type='PeaceZone' shape='NPoly' minZ='-3200' maxZ='-2200' /> <!-- Cedric's Training Hall -->
	<zone id='13008' type='PeaceZone' shape='NPoly' minZ='-3650' maxZ='-2650' /> <!-- Einhovant's School of Magic -->
	<zone id='13009' type='PeaceZone' shape='NPoly' minZ='-4300' maxZ='-2300' /> <!-- The Shilen Temple -->
	<zone id='13010' type='PeaceZone' shape='Cuboid' minZ='-1000' maxZ='500' /> <!-- The Pa'agrio Temple -->
@@ -4489,4 +4488,8 @@
		<node X="-85870" Y="-46233" />
		<node X="-86090" Y="-46061" />
	</zone>	
-</list>
\ No newline at end of file
+	<zone id='13007' type='Newbie' shape='NPoly' minZ='-3200' maxZ='-2200' /> <!-- Cedric's Training Hall -->
+	  <stat name='name' val='NewbieZone'/>
+	</zone>
+</list>	
\ No newline at end of file

 

 

Thanks for idea to vampir!

Credits to me

Posted

Hello, Today i'll share a new zone called "Newbie Zone".

You can restrict players to enter if they wear items enchant more then 3

 

Can you fix that and can wear only until B Grade Armors/jewels/weapons  Please??

 

anyway nice!!

Index: com/l2jfrozen/gameserver/model/L2Character.java
===================================================================
--- com/l2jfrozen/gameserver/model/L2Character.java	(revision 948)
+++ com/l2jfrozen/gameserver/model/L2Character.java	(working copy)
@@ -340,6 +340,9 @@
	/** The Constant ZONE_DANGERAREA. */
	public static final int ZONE_DANGERAREA = 16384;

+	/** The Constant ZONE_NEWBIE. */
+	public static final int ZONE_NEWBIE = 16385;	
+
	/** The _current zones. */
	private int _currentZones = 0;

Index: com/l2jfrozen/gameserver/model/zone/type/L2NewbieZone.java
===================================================================
--- com/l2jfrozen/gameserver/model/zone/type/L2NewbieZone.java	(revision 0)
+++ com/l2jfrozen/gameserver/model/zone/type/L2NewbieZone.java	(revision 0)
@@ -0,0 +1,83 @@
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package com.l2jfrozen.gameserver.model.zone.type;
+
+import com.l2jfrozen.gameserver.datatables.csv.MapRegionTable;
+import com.l2jfrozen.gameserver.model.L2Character;
+import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
+
+/**
+ * 
+ * @author Leki
+ */
+public class L2NewbieZone extends L2ZoneType
+{
+	public L2NewbieZone(int id)
+	{
+		super(id);
+	}
+
+	@Override
+	protected void onEnter(L2Character character)
+	{
+		if(character instanceof L2PcInstance)
+		{
+			L2PcInstance player = (L2PcInstance) character;
+			for (L2ItemInstance i : player.getInventory().getItems())
+			{
+				if (!player.isGM())
+				{	
+					if (i.isEquipable())
+					{	
+						if (i.getEnchantLevel() > 3)
+						{  
+							player.sendMessage("You can enter to this zone if your items aren't enchant more than 3");
+							player.teleToLocation(MapRegionTable.TeleportWhereType.Town);
+							return;
+						}
+					}
+				}
+			}	
+			if(!player.isGM() && player.isFlying())
+			{
+				player.teleToLocation(MapRegionTable.TeleportWhereType.Town);
+				return;
+			}
+			character.setInsideZone(L2Character.ZONE_NEWBIE, true);					
+		}
+	}
+
+	@Override
+	protected void onExit(L2Character character)
+	{
+		if(character instanceof L2PcInstance)
+		{
+			character.setInsideZone(L2Character.ZONE_NEWBIE, false);
+		}
+	}
+
+	@Override
+	public void onDieInside(L2Character character)
+	{}
+
+	@Override
+	public void onReviveInside(L2Character character)
+	{}
+}
\ No newline at end of file
Index: com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java
===================================================================
--- com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java	(revision 948)
+++ com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java	(working copy)
@@ -21,6 +21,7 @@

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.model.Inventory;
+import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
@@ -135,7 +136,13 @@
			activeChar.setActiveEnchantItem(null);
			return;
		}
+		if(activeChar.isInsideZone(L2Character.ZONE_NEWBIE))
+		{
+			activeChar.sendMessage("You can't enchant in newbie zone!");
+			return;
+		}	

+		
		/*
		if(!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_ENCHANT))
		{

 

DP

Index: zone.xml
===================================================================
--- zone.xml	(revision 946)
+++ zone.xml	(working copy)
@@ -881,7 +881,6 @@
	<zone id='13004' type='PeaceZone' shape='Cuboid' minZ='-2850' maxZ='-1300' /> <!-- Ivory Tower Top Floors -->
	<zone id='13005' type='PeaceZone' shape='NPoly' minZ='-3700' maxZ='-3500' /> <!-- Gludin Arena Entrance -->
	<zone id='13006' type='PeaceZone' shape='NPoly' minZ='-3800' maxZ='-3600' /> <!-- Giran Arena Entrance -->
-	<zone id='13007' type='PeaceZone' shape='NPoly' minZ='-3200' maxZ='-2200' /> <!-- Cedric's Training Hall -->
	<zone id='13008' type='PeaceZone' shape='NPoly' minZ='-3650' maxZ='-2650' /> <!-- Einhovant's School of Magic -->
	<zone id='13009' type='PeaceZone' shape='NPoly' minZ='-4300' maxZ='-2300' /> <!-- The Shilen Temple -->
	<zone id='13010' type='PeaceZone' shape='Cuboid' minZ='-1000' maxZ='500' /> <!-- The Pa'agrio Temple -->
@@ -4489,4 +4488,8 @@
		<node X="-85870" Y="-46233" />
		<node X="-86090" Y="-46061" />
	</zone>	
-</list>
\ No newline at end of file
+	<zone id='13007' type='Newbie' shape='NPoly' minZ='-3200' maxZ='-2200' /> <!-- Cedric's Training Hall -->
+	  <stat name='name' val='NewbieZone'/>
+	</zone>
+</list>	
\ No newline at end of file

 

 

Thanks for idea to vampir!

Credits to me

 

Posted

if some1  go inside armor/weapon will removed or just dont allowed to teleport inside from Gatekeeper?

if he goes inside with armor/weapon enchanted more than 3, he will be teleported to nearest town

Posted

if he goes inside with armor/weapon enchanted more than 3, he will be teleported to nearest town

 

Omagad really Coollllll i thing this one help me to much!!! thanks thanks thanks!!!

Posted

Hello i fix code at eclipse with a friend without Error  but when we add  ZONE get error  what hapend?? what is  wrong??

 

we dont change something at code*

 

 

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



  • Posts

    • Looking a datapack developer for 'Essence' - needs to be good with Mobius structure,  Project is using old fork (I think base from crusader). Write Discord to PM.
    • We are not back on 2005, life in our days is harder than before, in complection with other things yes, L2 has not the same look.
    • ⚔️ L2 Nexus — Full-Stack Development for Lineage 2 Servers   One team for everything. Website, admin panel, launcher, server development, hosting, protection — built together, working together.   ━━━━━━━━━━━━━━━━━━━━━   SERVICES:   🌐 Server Website Registration, player cabinet, donate shop, statistics, voting, news. Integrated with your server — live data from game DB.   🛡️ Admin Panel (CMS) — 60 Modules Web panel for GM team: bans, kicks, item management, payments, analytics. Battle Pass, marketplace, anti-bot, churn prediction, Discord/Telegram bots.   🚀 Custom Launcher Electron launcher with delta patcher, CDN delivery, news feed, integrity check, multi-server support. Fully branded.   ⚔️ Java Development Custom modules for L2J / aCis / Lucera / L2Off (PTS). Events, NPCs, instances, balance, quests, skills — any complexity.   🛡️ Hosting & DDoS Protection Server setup, OVH Game DDoS, Cloudflare, monitoring 24/7.   ━━━━━━━━━━━━━━━━━━━━━   PRICING (Website + CMS):   Core — €1,000 (one-time) Website + player cabinet + tickets + live status. 30 days support.   Business — €2,500 (one-time) ⭐ + Donate shop, payment systems, admin panel, RBAC, analytics, bots. Custom design. 90 days priority support.   Enterprise — €5,000+ (custom) + Battle Pass, marketplace, anti-bot, churn, economy, backups, Wiki, API. Managed hosting, SLA 99.9%. 12 months support.   ━━━━━━━━━━━━━━━━━━━━━   JAVA DEVELOPMENT:   • PvP Events .............. from €200 • Custom NPCs ............. from €80 • Donate & Economy ........ from €150 • Instance Zones .......... from €300 • Balance & Skills ........ from €100 • Quests .................. from €250 • Olympiad & Sieges ....... from €200 • PTS Extenders ........... from €150 • Bug Fixes ............... from €50/hr • Custom Systems .......... from €500   ━━━━━━━━━━━━━━━━━━━━━   Platforms: L2J · aCis · Lucera · L2Off/PTS Chronicles: Interlude · High Five · Classic · Essence 📍 Live CMS demo available — message us on Telegram   Telegram: @l2nexus Website: https://l2-nexus.com
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..