Jump to content

Recommended Posts

Posted

First of all hello.

My new share includes disablers for Coliseum Area.

With this patch you can disable Skill Resurrection, Scroll of Resurrection and Potions in zone of coliseum.

 

Index: config/functions/l2jfrozen.properties
===================================================================
--- config/functions/l2jfrozen.properties	(revision 948)
+++ config/functions/l2jfrozen.properties	(working copy)
@@ -280,4 +280,15 @@
ProtectorSkillLevel = 13
ProtectorSkillTime = 600
# Npc Protector Message
-ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
\ No newline at end of file
+ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
+
+#-----------------------------------------------
+# Coliseum Settings By Lekino
+#-----------------------------------------------
+#Allow using skill of resurrection and scroll of ressurection in coliseum?
+#Default: True
+AllowResColiseum = True
+
+#Allow using potions use in coliseum?
+#Default: True
+AllowPotionsColiseum = True
\ No newline at end of file
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java	(revision 948)
+++ head-src/com/l2jfrozen/Config.java	(working copy)
@@ -2378,6 +2378,8 @@
	public static String FARM2_CUSTOM_MESSAGE;
	public static String PVP1_CUSTOM_MESSAGE;
	public static String PVP2_CUSTOM_MESSAGE;
+	public static boolean ALLOW_COLISEUM_RES;
+	public static boolean ALLOW_COLISEUM_POT;		

	//============================================================
	public static void loadL2JFrozenConfig()
@@ -2497,6 +2499,8 @@
			FARM2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("Farm2CustomMeesage", "You have been teleported to Farm Zone 2!");
			PVP1_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP1CustomMeesage", "You have been teleported to PvP Zone 1!");
			PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
+			ALLOW_COLISEUM_RES = Boolean.parseBoolean(L2JFrozenSettings.getProperty("AllowResColiseum", "True"));
+			ALLOW_COLISEUM_POT = Boolean.parseBoolean(L2JFrozenSettings.getProperty("AllowPotionsColiseum", "True"));
		}
		catch(Exception e)
		{
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)
@@ -50,6 +50,7 @@
import com.l2jfrozen.gameserver.model.zone.type.L2CastleTeleportZone;
import com.l2jfrozen.gameserver.model.zone.type.L2CastleZone;
import com.l2jfrozen.gameserver.model.zone.type.L2ClanHallZone;
+import com.l2jfrozen.gameserver.model.zone.type.L2ColiseumZone;
import com.l2jfrozen.gameserver.model.zone.type.L2CustomZone;
import com.l2jfrozen.gameserver.model.zone.type.L2DamageZone;
import com.l2jfrozen.gameserver.model.zone.type.L2DerbyTrackZone;
@@ -240,6 +241,10 @@
								{
									temp = new L2NoHqZone(zoneId);
								}
+								else if(zoneType.equals("ColiseumArea"))
+								{
+									temp = new L2ColiseumZone(zoneId);
+								}								
								else if(zoneType.equals("BossZone"))
								{
									int boss_id = -1;
Index: head-src/com/l2jfrozen/gameserver/handler/itemhandlers/Potions.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/itemhandlers/Potions.java	(revision 948)
+++ head-src/com/l2jfrozen/gameserver/handler/itemhandlers/Potions.java	(working copy)
@@ -28,6 +28,7 @@
import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.datatables.SkillTable;
import com.l2jfrozen.gameserver.handler.IItemHandler;
+import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.model.L2Effect;
import com.l2jfrozen.gameserver.model.L2Effect.EffectType;
import com.l2jfrozen.gameserver.model.L2Skill;
@@ -241,6 +242,13 @@
			return;
		}

+		//Check if Character is in coliseum
+		if(activeChar.isInsideZone(L2Character.ZONE_COLISEUM) && !Config.ALLOW_COLISEUM_POT)
+		{
+			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
+			return;
+		}		
+
		//if(activeChar._inEventCTF && CTF._started && !Config.CTF_ALLOW_POTIONS)
		if(activeChar._inEventCTF && CTF.is_started() && !Config.CTF_ALLOW_POTIONS)
		{
Index: head-src/com/l2jfrozen/gameserver/handler/itemhandlers/ScrollOfResurrection.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/itemhandlers/ScrollOfResurrection.java	(revision 948)
+++ head-src/com/l2jfrozen/gameserver/handler/itemhandlers/ScrollOfResurrection.java	(working copy)
@@ -18,6 +18,7 @@
  */
package com.l2jfrozen.gameserver.handler.itemhandlers;

+import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.datatables.SkillTable;
import com.l2jfrozen.gameserver.handler.IItemHandler;
import com.l2jfrozen.gameserver.managers.CastleManager;
@@ -66,7 +67,12 @@
		{
			activeChar.sendMessage("This Item Cannot Be Used On Olympiad Games.");
		}
-
+		
+		if(activeChar.isInsideZone(L2Character.ZONE_COLISEUM) && !Config.ALLOW_COLISEUM_RES)
+		{
+			activeChar.sendMessage("This item cannot be used on Coliseum");
+		}
+		
		if(activeChar.isMovementDisabled())
			return;

Index: head-src/com/l2jfrozen/gameserver/handler/skillhandlers/Resurrect.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/skillhandlers/Resurrect.java	(revision 948)
+++ head-src/com/l2jfrozen/gameserver/handler/skillhandlers/Resurrect.java	(working copy)
@@ -22,6 +22,7 @@

import javolution.util.FastList;

+import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.handler.ISkillHandler;
import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.model.L2Object;
@@ -56,6 +57,12 @@
		L2Character target = null;
		L2PcInstance targetPlayer;
		List<L2Character> targetToRes = new FastList<L2Character>();
+		
+		if(activeChar.isInsideZone(L2Character.ZONE_COLISEUM) && !Config.ALLOW_COLISEUM_RES)
+		{
+			activeChar.sendPacket(SystemMessage.sendString("You can't use resurrect skill in coliseum!"));
+			return;
+		}	

		for(L2Object target2 : targets)
		{
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)
@@ -339,6 +339,9 @@

	/** The Constant ZONE_DANGERAREA. */
	public static final int ZONE_DANGERAREA = 16384;
+	
+	/** The Constant ZONE_COLISEUM. */
+	public static final int ZONE_COLISEUM = 16385;	

	/** The _current zones. */
	private int _currentZones = 0;
Index: head-src/com/l2jfrozen/gameserver/model/zone/type/L2ColiseumZone.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/zone/type/L2ColiseumZone.java	(revision 0)
+++ head-src/com/l2jfrozen/gameserver/model/zone/type/L2ColiseumZone.java	(revision 0)
@@ -0,0 +1,69 @@
+/* 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;
+import com.l2jfrozen.gameserver.network.SystemMessageId;
+import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
+/**
+ * 
+ * @author Leki
+ */
+public class L2ColiseumZone extends L2ZoneType
+{
+	public L2ColiseumZone(int id)
+	{
+		super(id);
+	}
+
+	@Override
+	protected void onEnter(L2Character character)
+	{
+		character.setInsideZone(L2Character.ZONE_PVP, true);
+		character.setInsideZone(L2Character.ZONE_COLISEUM, true);
+		if(character instanceof L2PcInstance)
+		{
+			((L2PcInstance) character).sendPacket(new SystemMessage(SystemMessageId.ENTERED_COMBAT_ZONE));
+		}
+	}
+
+	@Override
+	protected void onExit(L2Character character)
+	{
+		character.setInsideZone(L2Character.ZONE_PVP, false);
+		character.setInsideZone(L2Character.ZONE_COLISEUM, false);
+		
+		if(character instanceof L2PcInstance)
+		{
+			
+			((L2PcInstance) character).sendPacket(new SystemMessage(SystemMessageId.LEFT_COMBAT_ZONE));
+		}
+	}
+
+	@Override
+	public void onDieInside(L2Character character)
+	{}
+
+	@Override
+	public void onReviveInside(L2Character character)
+	{}
+}

 

DP

Index: zone.xml
===================================================================
--- zone.xml	(revision 948)
+++ zone.xml	(working copy)
@@ -17,7 +17,7 @@
		<stat name='spawnY' val='142402'/>
		<stat name='spawnZ' val='-3643'/>
	</zone>
-	<zone id='11012' type='Arena' shape='NPoly' minZ='-3500' maxZ='-3300'>
+	<zone id='11012' type='ColiseumArea' shape='NPoly' minZ='-3500' maxZ='-3300'>
		<stat name='name' val='Coliseum'/>
		<stat name='spawnX' val='147451'/>
		<stat name='spawnY' val='46728'/>

 

If you want to disable something else in coliseum, just add this

activeChar.isInsideZone(L2Character.ZONE_COLISEUM)

 

Credits to me.

If I did something wrong please feedback.

Posted

If I did something wrong please feedback.

 

Yep, you did ;D

 

If you *WHAT* to disable

 

--------

 

Nice share, may be useful :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...