Jump to content

Question

Posted

Hello everyone!
I have a FlagZone on my L2JSunrise server. and I would like to block some skils in there. For example: I already blocked not to form party there. but one player goes bishop, enters and heals another individual player. I don't think it's fair to ban the cardinal class from entering, because there are other skil classes to heal. so I wanted to create a rule not to use certain skils inside FlagZone. it's possible? for example, a config that I put the id of skils that can't be used in there.

8 answers to this question

Recommended Posts

  • 0
Posted (edited)

Simply put your check on Creature#checkDoCastConditions(L2Skill) - other name for Creature : L2Character.

 

Something like

 

if (isInsideZone(ZoneId.FLAGZONE) && ArrayUtils.contains(Config.ALLOWED_SKILLS_ON_FLAGZONE, skill.getId()))
{
	sendPacket(ActionFailed.STATIC_PACKET);
	return false;
}

Just after this first block

 

		if (skill == null || isSkillDisabled(skill))
		{
			// Send ActionFailed to the Player
			sendPacket(ActionFailed.STATIC_PACKET);
			return false;
		}

You have to build the Config, it's a simple int[]. The provided exemple is enough if all skills are blocked the same way on all flagzones.

 

-----

 

If you need specific skills being blocked on specific FlagZone (one FlagZone stops all heals, another stop aggro skills,...), you can also hold that Config on the zone itself, and then interrogate which zone you currently are to retrieve the correct int array, but it needs more work.

Edited by Tryskell
  • Like 1
  • 0
Posted

How do I add this restriction? can you help me? I am not yet a java programmer. I am starting the first semester in ADS.  It is and my FlagZone

 

/*
 * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
 */
package l2r.gameserver.model.zone.type;

import l2r.gameserver.ThreadPoolManager;
import l2r.gameserver.data.xml.impl.SkillData;
import l2r.gameserver.enums.MessageType;
import l2r.gameserver.enums.ZoneIdType;
import l2r.gameserver.model.actor.L2Character;
import l2r.gameserver.model.actor.instance.L2PcInstance;
import l2r.gameserver.model.zone.L2ZoneType;
import l2r.gameserver.network.serverpackets.MagicSkillUse;
import l2r.util.Rnd;

import gr.sr.configsEngine.configs.impl.FlagZoneConfigs;

/**
 * @author -=GodFather=-
 */
public class L2FlagZone extends L2ZoneType
{
	public L2FlagZone(int id)
	{
		super(id);
	}
	
	@Override
	protected void onEnter(L2Character character)
	{
		if (FlagZoneConfigs.ENABLE_FLAG_ZONE && character.isPlayer())
		{
			L2PcInstance activeChar = character.getActingPlayer();
			activeChar.setInsideZone(ZoneIdType.FLAG, true);
			activeChar.setInsideZone(ZoneIdType.NO_SUMMON_FRIEND, true);
			activeChar.setInsideZone(ZoneIdType.NO_STORE, true);
			activeChar.setInsideZone(ZoneIdType.NO_BOOKMARK, true);
			activeChar.setInsideZone(ZoneIdType.NO_ITEM_DROP, true);
			
			SkillData.getInstance().getInfo(1323, 1).getEffects(activeChar, activeChar);
			
			if (FlagZoneConfigs.AUTO_FLAG_ON_ENTER)
			{
				activeChar.setPvpFlag(1);
			}
			if (FlagZoneConfigs.ENABLE_ANTIFEED_PROTECTION)
			{
				activeChar.startAntifeedProtection(true);
			}
			
			activeChar.broadcastUserInfo();
			
			if (activeChar.getParty() != null)
			{
				activeChar.getParty().removePartyMember(activeChar, MessageType.None);
			}
		}
	}
	
	@Override
	protected void onExit(final L2Character character)
	{
		if (FlagZoneConfigs.ENABLE_FLAG_ZONE && character.isPlayer())
		{
			L2PcInstance activeChar = character.getActingPlayer();
			activeChar.setInsideZone(ZoneIdType.FLAG, false);
			activeChar.setInsideZone(ZoneIdType.NO_SUMMON_FRIEND, false);
			activeChar.setInsideZone(ZoneIdType.NO_STORE, false);
			activeChar.setInsideZone(ZoneIdType.NO_BOOKMARK, false);
			activeChar.setInsideZone(ZoneIdType.NO_ITEM_DROP, false);
			
			if (FlagZoneConfigs.AUTO_FLAG_ON_ENTER)
			{
				activeChar.setPvpFlag(0);
			}
			if (FlagZoneConfigs.ENABLE_ANTIFEED_PROTECTION)
			{
				activeChar.startAntifeedProtection(false);
			}
			
			activeChar.broadcastUserInfo();
		}
	}
	
	@Override
	public void onDieInside(final L2Character character)
	{
		if (FlagZoneConfigs.ENABLE_FLAG_ZONE && FlagZoneConfigs.ENABLE_FLAG_ZONE_AUTO_REVIVE && character.isPlayer())
		{
			final L2PcInstance activeChar = character.getActingPlayer();
			if (FlagZoneConfigs.SHOW_DIE_ANIMATION)
			{
				final MagicSkillUse msu = new MagicSkillUse(activeChar, activeChar, 23096, 1, 1, 1);
				activeChar.broadcastPacket(msu);
			}
			
			if (FlagZoneConfigs.ENABLE_FLAG_ZONE_AUTO_REVIVE)
			{
				activeChar.sendMessage("Get ready! You will be revived in " + FlagZoneConfigs.FLAG_ZONE_REVIVE_DELAY + " seconds!");
				ThreadPoolManager.getInstance().scheduleGeneral(() ->
				{
					if (activeChar.isDead())
					{
						activeChar.doRevive();
						int r = Rnd.get(FlagZoneConfigs.FLAG_ZONE_AUTO_RES_LOCS_COUNT);
						activeChar.teleToLocation(FlagZoneConfigs.xCoords[r], FlagZoneConfigs.yCoords[r], FlagZoneConfigs.zCoords[r]);
					}
				}, FlagZoneConfigs.FLAG_ZONE_REVIVE_DELAY * 1000);
			}
		}
	}
	
	@Override
	public void onReviveInside(L2Character character)
	{
		if (FlagZoneConfigs.ENABLE_FLAG_ZONE && character.isPlayer())
		{
			L2PcInstance activeChar = character.getActingPlayer();
			SkillData.getInstance().getInfo(1323, 1).getEffects(activeChar, activeChar);
			activeChar.setCurrentHpMp(activeChar.getMaxHp(), activeChar.getMaxMp());
			activeChar.setCurrentCp(activeChar.getMaxCp());
		}
	}
}

 

  • 0
Posted
<stat name='classes' val='97,105,112' />
#P L2jFrozen_GameServer
Index: head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java	(revision 1132)
+++ head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java	(working copy)
@@ -56,6 +56,7 @@
 import com.l2jfrozen.gameserver.model.zone.type.L2DerbyTrackZone;
 import com.l2jfrozen.gameserver.model.zone.type.L2EffectZone;
 import com.l2jfrozen.gameserver.model.zone.type.L2FishingZone;
+import com.l2jfrozen.gameserver.model.zone.type.L2FlagZone;
 import com.l2jfrozen.gameserver.model.zone.type.L2FortZone;
 import com.l2jfrozen.gameserver.model.zone.type.L2JailZone;
 import com.l2jfrozen.gameserver.model.zone.type.L2MotherTreeZone;
@@ -268,6 +269,8 @@
 									case "SwampZone":
 										temp = new L2SwampZone(zoneId);
 										break;
+									case "FlagZone":
+										temp = new L2FlagZone(zoneId);
 								}
 								
 								// Check for unknown type
Index: head-src/com/l2jfrozen/gameserver/model/zone/type/L2FlagZone.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/zone/type/L2FlagZone.java	(nonexistent)
+++ head-src/com/l2jfrozen/gameserver/model/zone/type/L2FlagZone.java	(working copy)
@@ -0,0 +1,258 @@
+/*
+ * 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 3 of the License, 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, see <[url="http://www.gnu.org/licenses/>."]http://www.gnu.org/licenses/>.[/url]
+ */
+package com.l2jfrozen.gameserver.model.zone.type;
+
+import java.util.List;
+import java.util.concurrent.Future;
+
+import javolution.util.FastList;
+
+import com.l2jfrozen.gameserver.datatables.SkillTable;
+import com.l2jfrozen.gameserver.model.L2Character;
+import com.l2jfrozen.gameserver.model.L2Skill;
+import com.l2jfrozen.gameserver.model.actor.instance.L2MonsterInstance;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
+import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
+import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
+import com.l2jfrozen.util.random.Rnd;
+
+/**
+ * @author Strato
+ * @author Elfocrash (for the correction)
+ */
+public class L2FlagZone extends L2ZoneType
+{
+	int _skillId, _skillLvl;
+	private int _chance;
+	private int _initialDelay;
+	private int _reuse;
+	private boolean _enabled;
+	private String _target;
+	private Future<?> _task;
+	private static List<Integer> _forbiddenClasses = new FastList<>();
+	
+	public L2FlagZone(int id)
+	{
+		super(id);
+		_skillId = 1323;
+		_skillLvl = 1;
+		_chance = 100;
+		_initialDelay = 0;
+		_reuse = 30000;
+		_enabled = true;
+		_target = "pc";
+	}
+	
+	@Override
+	public void setParameter(String name, String value)
+	{
+		if (name.equals("skillId"))
+		{
+			_skillId = Integer.parseInt(value);
+		}
+		else if (name.equals("skillLvl"))
+		{
+			_skillLvl = Integer.parseInt(value);
+		}
+		else if (name.equals("chance"))
+		{
+			_chance = Integer.parseInt(value);
+		}
+		else if (name.equals("initialDelay"))
+		{
+			_initialDelay = Integer.parseInt(value);
+		}
+		else if (name.equals("default_enabled"))
+		{
+			_enabled = Boolean.parseBoolean(value);
+		}
+		else if (name.equals("target"))
+		{
+			_target = String.valueOf(value);
+		}
+		else if (name.equals("reuse"))
+		{
+			_reuse = Integer.parseInt(value);
+		}
+		else if (name.equals("classes"))
+		{
+			String[] propertySplit = value.split(",");
+			for (String classId : propertySplit)
+			{
+				int classes = Integer.parseInt(classId);
+				_forbiddenClasses.add(classes);
+			}
+		}
+		else
+		{
+			super.setParameter(name, value);
+		}
+	}
+	
+	@Override
+	protected void onEnter(L2Character character)
+	{
+		if (character instanceof L2PcInstance)
+		{
+			character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, true);
+			character.setInsideZone(L2Character.ZONE_NO_HEALER, true);
+			if (isForbiddenClass(((L2PcInstance) character)))
+			{
+				for (L2Skill skill : character.getAllSkills())
+				{
+					switch (skill.getSkillType())
+					{
+						case HEAL:
+						case HEAL_PERCENT:
+						case BALANCE_LIFE:
+						case RESURRECT:
+							((L2PcInstance) character).disableSkill(skill);
+							((L2PcInstance) character).sendSkillList();
+							break;
+					}
+				}
+			}
+			
+			// Set pvp flag
+			((L2PcInstance) character).setPvpFlag(1);
+			((L2PcInstance) character).sendMessage("Entrando em Zona Flag!!!");
+			((L2PcInstance) character).broadcastUserInfo();
+			if ((character instanceof L2PlayableInstance && _target.equalsIgnoreCase("pc") || character instanceof L2PcInstance && _target.equalsIgnoreCase("pc_only") || character instanceof L2MonsterInstance && _target.equalsIgnoreCase("npc")) && _task == null)
+			{
+				_task = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new ApplySkill(/* this */), _initialDelay, _reuse);
+			}
+		}
+	}
+	
+	@Override
+	protected void onExit(L2Character character)
+	{
+		if (character instanceof L2PcInstance)
+		{
+			character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);
+			character.setInsideZone(L2Character.ZONE_NO_HEALER, false);
+			if (isForbiddenClass(((L2PcInstance) character)))
+			{
+				for (L2Skill skill : character.getAllSkills())
+				{
+					switch (skill.getSkillType())
+					{
+						case HEAL:
+						case HEAL_PERCENT:
+						case BALANCE_LIFE:
+						case RESURRECT:
+							((L2PcInstance) character).enableSkill(skill);
+							((L2PcInstance) character).sendSkillList();
+							break;
+					}
+				}
+			}
+			
+			((L2PcInstance) character).setPvpFlag(0);
+			((L2PcInstance) character).sendMessage("Saindo da Zona de Flag!!");
+			((L2PcInstance) character).broadcastUserInfo();
+		}
+		if (_characterList.isEmpty() && _task != null)
+		{
+			_task.cancel(true);
+			_task = null;
+		}
+	}
+	
+	public L2Skill getSkill()
+	{
+		return SkillTable.getInstance().getInfo(_skillId, _skillLvl);
+	}
+	
+	public String getTargetType()
+	{
+		return _target;
+	}
+	
+	public boolean isEnabled()
+	{
+		return _enabled;
+	}
+	
+	public int getChance()
+	{
+		return _chance;
+	}
+	
+	public void setZoneEnabled(boolean val)
+	{
+		_enabled = val;
+	}
+	
+	class ApplySkill implements Runnable
+	{
+		@Override
+		public void run()
+		{
+			if (isEnabled())
+			{
+				for (L2Character temp : _characterList.values())
+				{
+					if (temp != null && !temp.isDead())
+					{
+						if ((temp instanceof L2PlayableInstance && getTargetType().equalsIgnoreCase("pc") || temp instanceof L2PcInstance && getTargetType().equalsIgnoreCase("pc_only") || temp instanceof L2MonsterInstance && getTargetType().equalsIgnoreCase("npc")) && Rnd.get(100) < getChance())
+						{
+							L2Skill skill = null;
+							if ((skill = getSkill()) == null)
+							{
+								System.out.println("ATTENTION: error on zone with id " + getId());
+								System.out.println("Skill " + _skillId + "," + _skillLvl + " not present between skills");
+							}
+							else
+								skill.getEffects(temp, temp);
+						}
+					}
+				}
+			}
+		}
+	}
+	
+	public static boolean isForbiddenClass(L2PcInstance player)
+	{
+		if (player.isGM())
+			return false;
+		
+		if (_forbiddenClasses == null)
+			return false;
+		
+		if (_forbiddenClasses.contains(player.getClassId().getId()))
+			return true;
+		
+		return false;
+	}
+	
+	public static List<Integer> getForbiddenClasses()
+	{
+		return _forbiddenClasses;
+	}
+	
+	@Override
+	public void onDieInside(L2Character character)
+	{
+		
+	}
+	
+	@Override
+	public void onReviveInside(L2Character character)
+	{
+		onEnter(character);
+	}
+}
\ No newline at end of file
Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/L2Character.java	(revision 1132)
+++ head-src/com/l2jfrozen/gameserver/model/L2Character.java	(working copy)
@@ -322,8 +322,8 @@
 	/** The Constant ZONE_CLANHALL. */
 	public static final int ZONE_CLANHALL = 16;
 	
-	/** The Constant ZONE_UNUSED. */
-	public static final int ZONE_UNUSED = 32;
+	/** The Constant ZONE_NO_HEALER. */
+	public static final int ZONE_NO_HEALER = 32;
 	
 	/** The Constant ZONE_NOLANDING. */
 	public static final int ZONE_NOLANDING = 64;
DATAPACK

### Eclipse Workspace Patch 1.0
#P L2jFrozen_DataPack
Index: data/zones/zone.xml
===================================================================
--- data/zones/zone.xml	(revision 1132)
+++ data/zones/zone.xml	(working copy)
@@ -275,11 +275,13 @@
 		<spawn X='17577' Y='170128' Z='-3534'/>
 		<spawn X='19737' Y='170976' Z='-3583'/>
 	</zone>
-<zone id='11037' type='Town' shape='Cuboid' minZ='-3500' maxZ='-3400'>
+<!--  <zone id='11037' type='Town' shape='Cuboid' minZ='-3500' maxZ='-3400'> -->
+	<zone id='11037' type='FlagZone' shape='Cuboid' minZ='-3800' maxZ='-3100'>
 		<stat name='name' val='Primeval Isle'/>
 		<stat name='townId' val='19'/>
 		<stat name='taxById' val='8'/>
 		<stat name='noPeace' val='true'/>
+		<stat name='classes' val='97,105,112' />
 		<spawn X='10468' Y='-24569' Z='-3645'/>
 		<spawn X='10928' Y='-24641' Z='-3643'/>
 		<spawn X='8480' Y='-23706' Z='-3727'/>
 

 

  • 0
Posted
3 hours ago, MairHost said:

<stat name='classes' val='97,105,112' />

#P L2jFrozen_GameServer
Index: head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java	(revision 1132)
+++ head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java	(working copy)
@@ -56,6 +56,7 @@
 import com.l2jfrozen.gameserver.model.zone.type.L2DerbyTrackZone;
 import com.l2jfrozen.gameserver.model.zone.type.L2EffectZone;
 import com.l2jfrozen.gameserver.model.zone.type.L2FishingZone;
+import com.l2jfrozen.gameserver.model.zone.type.L2FlagZone;
 import com.l2jfrozen.gameserver.model.zone.type.L2FortZone;
 import com.l2jfrozen.gameserver.model.zone.type.L2JailZone;
 import com.l2jfrozen.gameserver.model.zone.type.L2MotherTreeZone;
@@ -268,6 +269,8 @@
 									case "SwampZone":
 										temp = new L2SwampZone(zoneId);
 										break;
+									case "FlagZone":
+										temp = new L2FlagZone(zoneId);
 								}
 								
 								// Check for unknown type
Index: head-src/com/l2jfrozen/gameserver/model/zone/type/L2FlagZone.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/zone/type/L2FlagZone.java	(nonexistent)
+++ head-src/com/l2jfrozen/gameserver/model/zone/type/L2FlagZone.java	(working copy)
@@ -0,0 +1,258 @@
+/*
+ * 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 3 of the License, 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, see <[url="http://www.gnu.org/licenses/>."]http://www.gnu.org/licenses/>.[/url]
+ */
+package com.l2jfrozen.gameserver.model.zone.type;
+
+import java.util.List;
+import java.util.concurrent.Future;
+
+import javolution.util.FastList;
+
+import com.l2jfrozen.gameserver.datatables.SkillTable;
+import com.l2jfrozen.gameserver.model.L2Character;
+import com.l2jfrozen.gameserver.model.L2Skill;
+import com.l2jfrozen.gameserver.model.actor.instance.L2MonsterInstance;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
+import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
+import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
+import com.l2jfrozen.util.random.Rnd;
+
+/**
+ * @author Strato
+ * @author Elfocrash (for the correction)
+ */
+public class L2FlagZone extends L2ZoneType
+{
+	int _skillId, _skillLvl;
+	private int _chance;
+	private int _initialDelay;
+	private int _reuse;
+	private boolean _enabled;
+	private String _target;
+	private Future<?> _task;
+	private static List<Integer> _forbiddenClasses = new FastList<>();
+	
+	public L2FlagZone(int id)
+	{
+		super(id);
+		_skillId = 1323;
+		_skillLvl = 1;
+		_chance = 100;
+		_initialDelay = 0;
+		_reuse = 30000;
+		_enabled = true;
+		_target = "pc";
+	}
+	
+	@Override
+	public void setParameter(String name, String value)
+	{
+		if (name.equals("skillId"))
+		{
+			_skillId = Integer.parseInt(value);
+		}
+		else if (name.equals("skillLvl"))
+		{
+			_skillLvl = Integer.parseInt(value);
+		}
+		else if (name.equals("chance"))
+		{
+			_chance = Integer.parseInt(value);
+		}
+		else if (name.equals("initialDelay"))
+		{
+			_initialDelay = Integer.parseInt(value);
+		}
+		else if (name.equals("default_enabled"))
+		{
+			_enabled = Boolean.parseBoolean(value);
+		}
+		else if (name.equals("target"))
+		{
+			_target = String.valueOf(value);
+		}
+		else if (name.equals("reuse"))
+		{
+			_reuse = Integer.parseInt(value);
+		}
+		else if (name.equals("classes"))
+		{
+			String[] propertySplit = value.split(",");
+			for (String classId : propertySplit)
+			{
+				int classes = Integer.parseInt(classId);
+				_forbiddenClasses.add(classes);
+			}
+		}
+		else
+		{
+			super.setParameter(name, value);
+		}
+	}
+	
+	@Override
+	protected void onEnter(L2Character character)
+	{
+		if (character instanceof L2PcInstance)
+		{
+			character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, true);
+			character.setInsideZone(L2Character.ZONE_NO_HEALER, true);
+			if (isForbiddenClass(((L2PcInstance) character)))
+			{
+				for (L2Skill skill : character.getAllSkills())
+				{
+					switch (skill.getSkillType())
+					{
+						case HEAL:
+						case HEAL_PERCENT:
+						case BALANCE_LIFE:
+						case RESURRECT:
+							((L2PcInstance) character).disableSkill(skill);
+							((L2PcInstance) character).sendSkillList();
+							break;
+					}
+				}
+			}
+			
+			// Set pvp flag
+			((L2PcInstance) character).setPvpFlag(1);
+			((L2PcInstance) character).sendMessage("Entrando em Zona Flag!!!");
+			((L2PcInstance) character).broadcastUserInfo();
+			if ((character instanceof L2PlayableInstance && _target.equalsIgnoreCase("pc") || character instanceof L2PcInstance && _target.equalsIgnoreCase("pc_only") || character instanceof L2MonsterInstance && _target.equalsIgnoreCase("npc")) && _task == null)
+			{
+				_task = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new ApplySkill(/* this */), _initialDelay, _reuse);
+			}
+		}
+	}
+	
+	@Override
+	protected void onExit(L2Character character)
+	{
+		if (character instanceof L2PcInstance)
+		{
+			character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);
+			character.setInsideZone(L2Character.ZONE_NO_HEALER, false);
+			if (isForbiddenClass(((L2PcInstance) character)))
+			{
+				for (L2Skill skill : character.getAllSkills())
+				{
+					switch (skill.getSkillType())
+					{
+						case HEAL:
+						case HEAL_PERCENT:
+						case BALANCE_LIFE:
+						case RESURRECT:
+							((L2PcInstance) character).enableSkill(skill);
+							((L2PcInstance) character).sendSkillList();
+							break;
+					}
+				}
+			}
+			
+			((L2PcInstance) character).setPvpFlag(0);
+			((L2PcInstance) character).sendMessage("Saindo da Zona de Flag!!");
+			((L2PcInstance) character).broadcastUserInfo();
+		}
+		if (_characterList.isEmpty() && _task != null)
+		{
+			_task.cancel(true);
+			_task = null;
+		}
+	}
+	
+	public L2Skill getSkill()
+	{
+		return SkillTable.getInstance().getInfo(_skillId, _skillLvl);
+	}
+	
+	public String getTargetType()
+	{
+		return _target;
+	}
+	
+	public boolean isEnabled()
+	{
+		return _enabled;
+	}
+	
+	public int getChance()
+	{
+		return _chance;
+	}
+	
+	public void setZoneEnabled(boolean val)
+	{
+		_enabled = val;
+	}
+	
+	class ApplySkill implements Runnable
+	{
+		@Override
+		public void run()
+		{
+			if (isEnabled())
+			{
+				for (L2Character temp : _characterList.values())
+				{
+					if (temp != null && !temp.isDead())
+					{
+						if ((temp instanceof L2PlayableInstance && getTargetType().equalsIgnoreCase("pc") || temp instanceof L2PcInstance && getTargetType().equalsIgnoreCase("pc_only") || temp instanceof L2MonsterInstance && getTargetType().equalsIgnoreCase("npc")) && Rnd.get(100) < getChance())
+						{
+							L2Skill skill = null;
+							if ((skill = getSkill()) == null)
+							{
+								System.out.println("ATTENTION: error on zone with id " + getId());
+								System.out.println("Skill " + _skillId + "," + _skillLvl + " not present between skills");
+							}
+							else
+								skill.getEffects(temp, temp);
+						}
+					}
+				}
+			}
+		}
+	}
+	
+	public static boolean isForbiddenClass(L2PcInstance player)
+	{
+		if (player.isGM())
+			return false;
+		
+		if (_forbiddenClasses == null)
+			return false;
+		
+		if (_forbiddenClasses.contains(player.getClassId().getId()))
+			return true;
+		
+		return false;
+	}
+	
+	public static List<Integer> getForbiddenClasses()
+	{
+		return _forbiddenClasses;
+	}
+	
+	@Override
+	public void onDieInside(L2Character character)
+	{
+		
+	}
+	
+	@Override
+	public void onReviveInside(L2Character character)
+	{
+		onEnter(character);
+	}
+}
\ No newline at end of file
Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/L2Character.java	(revision 1132)
+++ head-src/com/l2jfrozen/gameserver/model/L2Character.java	(working copy)
@@ -322,8 +322,8 @@
 	/** The Constant ZONE_CLANHALL. */
 	public static final int ZONE_CLANHALL = 16;
 	
-	/** The Constant ZONE_UNUSED. */
-	public static final int ZONE_UNUSED = 32;
+	/** The Constant ZONE_NO_HEALER. */
+	public static final int ZONE_NO_HEALER = 32;
 	
 	/** The Constant ZONE_NOLANDING. */
 	public static final int ZONE_NOLANDING = 64;
DATAPACK

### Eclipse Workspace Patch 1.0
#P L2jFrozen_DataPack
Index: data/zones/zone.xml
===================================================================
--- data/zones/zone.xml	(revision 1132)
+++ data/zones/zone.xml	(working copy)
@@ -275,11 +275,13 @@
 		<spawn X='17577' Y='170128' Z='-3534'/>
 		<spawn X='19737' Y='170976' Z='-3583'/>
 	</zone>
-<zone id='11037' type='Town' shape='Cuboid' minZ='-3500' maxZ='-3400'>
+<!--  <zone id='11037' type='Town' shape='Cuboid' minZ='-3500' maxZ='-3400'> -->
+	<zone id='11037' type='FlagZone' shape='Cuboid' minZ='-3800' maxZ='-3100'>
 		<stat name='name' val='Primeval Isle'/>
 		<stat name='townId' val='19'/>
 		<stat name='taxById' val='8'/>
 		<stat name='noPeace' val='true'/>
+		<stat name='classes' val='97,105,112' />
 		<spawn X='10468' Y='-24569' Z='-3645'/>
 		<spawn X='10928' Y='-24641' Z='-3643'/>
 		<spawn X='8480' Y='-23706' Z='-3727'/>
 

 

I don't wanna undo my flagzone. I just want to block some skils in there. and this is yours too for l2jfrozen

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
Answer this question...

×   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...