Jump to content

Recommended Posts

Posted (edited)
Spoiler

diff --git a/java/L2JDev/World/gameserver/GameServer.java b/java/L2JDev/World/gameserver/GameServer.java
index 4938129..6076801 100644
--- a/java/L2JDev/World/gameserver/GameServer.java
+++ b/java/L2JDev/World/gameserver/GameServer.java
@@ -99,6 +99,7 @@
 import L2JDev.World.gameserver.model.entity.DeathMatch.DMManager;
 import L2JDev.World.gameserver.model.entity.Dungeon.Dungeon;
 import L2JDev.World.gameserver.model.entity.Dungeon.InicialDungeon;
+import L2JDev.World.gameserver.model.entity.NoZerg.ZergManager;
 import L2JDev.World.gameserver.model.entity.PartyFarm.InitialPartyFarm;
 import L2JDev.World.gameserver.model.entity.PartyFarm.PartyFarm;
 import L2JDev.World.gameserver.model.entity.TeamVsTeam.TvTConfig;
@@ -220,6 +221,7 @@
 		
 		StringUtil.printSection("Zones");
 		ZoneManager.getInstance();
+		ZergManager.getInstance();

@@ -301,15 +303,12 @@

diff --git a/java/L2JDev/World/gameserver/data/manager/ZoneManager.java b/java/L2JDev/World/gameserver/data/manager/ZoneManager.java
index 2d2cfac..30c71ef 100644
--- a/java/L2JDev/World/gameserver/data/manager/ZoneManager.java
+++ b/java/L2JDev/World/gameserver/data/manager/ZoneManager.java
@@ -30,6 +30,7 @@
 import L2JDev.World.gameserver.model.zone.type.BattleZone;
 import L2JDev.World.gameserver.model.zone.type.BossZone;
 import L2JDev.World.gameserver.model.zone.type.ChaoticZone;
+import L2JDev.World.gameserver.model.zone.type.NoZergZone;
 import L2JDev.World.gameserver.model.zone.type.subtype.SpawnZoneType;
 import L2JDev.World.gameserver.model.zone.type.subtype.ZoneType;
 import L2JDev.World.gameserver.network.serverpackets.L2GameServerPacket;
@@ -454,6 +455,21 @@
 		return null;
 	}
 	
+	public final static NoZergZone getZerg(Player character)
+	{
+		if (character == null)
+			return null;
+		
+		for (ZoneType temp : ZoneManager.getInstance().getZones(character.getX(), character.getY(), character.getZ()))
+		{
+			if (temp instanceof NoZergZone && temp.isCharacterInZone(character))
+				return ((NoZergZone) temp);
+		}
+		
+		return null;
+	}
+
+	
 	public static final ZoneManager getInstance()
 	{
 		return SingletonHolder.INSTANCE;
diff --git a/java/L2JDev/World/gameserver/data/xml/MapRegionData.java b/java/L2JDev/World/gameserver/data/xml/MapRegionData.java
index e1b43a4..15ea1cd 100644
--- a/java/L2JDev/World/gameserver/data/xml/MapRegionData.java
+++ b/java/L2JDev/World/gameserver/data/xml/MapRegionData.java
@@ -24,6 +24,7 @@
 import L2JDev.World.gameserver.model.entity.Castle;
 import L2JDev.World.gameserver.model.entity.Siege;
 import L2JDev.World.gameserver.model.location.Location;
+import L2JDev.World.gameserver.model.zone.type.NoZergZone;
 import L2JDev.World.gameserver.model.zone.type.TownZone;
 
 /**
@@ -291,7 +292,11 @@
			else if (teleportType == TeleportType.SIEGE_FLAG)
			{
				final Siege siege = CastleManager.getInstance().getActiveSiege(player);
				if (siege != null)
				{
					final Npc flag = siege.getFlag(player.getClan());
					if (flag != null)
						return flag.getPosition();
				}
				
				final SiegableHall sh = ClanHallManager.getInstance().getNearestSiegableHall(player);
				if (sh != null)
				{
					final Npc flag = sh.getSiege().getFlag(player.getClan());
					if (flag != null)
						return flag.getPosition();
				}
			}
			
+			// Checking if in Party Zerg Zone
+			NoZergZone zerg = ZoneManager.getZerg(player);
+			if (zerg != null)
+				return zerg.getPosition();
	
		}
		
		// Returning to Town in a Siege - Seal of Strife.
		// When owned by Dawn: Player restarts in the second nearest village.
		// When owned by Dusk / not owned: A clan that has participated in a siege restarts in the first town at the time of escape or death.

 	}
diff --git a/java/L2JDev/World/gameserver/enums/ZoneId.java b/java/L2JDev/World/gameserver/enums/ZoneId.java
index 6fc44c9..40d62d2 100644
--- a/java/L2JDev/World/gameserver/enums/ZoneId.java
+++ b/java/L2JDev/World/gameserver/enums/ZoneId.java
@@ -25,7 +25,8 @@
 	RAID(20),
 	CHAOTIC(21),
 	ARENA_EVENT(22),
-	TOURNAMENT(23);
+	TOURNAMENT(23),
+	NO_ZERG(24);
 	
diff --git a/java/L2JDev/World/gameserver/model/entity/NoZerg/ZergManager.java b/java/L2JDev/World/gameserver/model/entity/NoZerg/ZergManager.java
new file mode 100644
index 0000000..c924e1d
--- /dev/null
+++ b/java/L2JDev/World/gameserver/model/entity/NoZerg/ZergManager.java
@@ -0,0 +1,166 @@
+package L2JDev.World.gameserver.model.entity.NoZerg;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import L2JDev.World.commons.random.Rnd;
+import L2JDev.World.gameserver.enums.ZoneId;
+import L2JDev.World.gameserver.model.actor.Player;
+import L2JDev.World.gameserver.model.pledge.Clan;
+import L2JDev.World.gameserver.network.serverpackets.ExShowScreenMessage;
+
+/**
+ * @author BAN - L2JDev
+ *
+ */
+public class ZergManager
+{
+    private static final Logger _log = Logger.getLogger(ZergManager.class.getName());
+
+    public ZergManager()
+    {
+        _log.log(Level.INFO, "Anti-ZergManager - Loaded.");
+    }
+
+    private static boolean checkClanAreaKickTask(Player activeChar, Integer numberBox)
+    {
+        Map<String, List<Player>> zergMap = new HashMap<>();
+        
+        Clan clan = activeChar.getClan();
+        
+        if (clan != null)
+        {
+        	for (Player player : clan.getOnlineMembers())
+        	{
+        		if (!player.isInsideZone(ZoneId.NO_ZERG) || player.getClan() == null)
+        			continue;
+				String zerg1 = activeChar.getClan().getName();
+				String zerg2 = player.getClan().getName();
+
+				if (zerg1.equals(zerg2))
+				{
+					if (zergMap.get(zerg1) == null)
+						zergMap.put(zerg1, new ArrayList<Player>());
+
+					zergMap.get(zerg1).add(player);
+
+					if (zergMap.get(zerg1).size() > numberBox)
+						return true;
+				}
+        	}
+        }
+        return false;
+    }
+    
+    private static boolean checkAllyAreaKickTask(Player activeChar, Integer numberBox, Collection<Player> world)
+    {
+    	Map<String, List<Player>> zergMap = new HashMap<>();
+
+    	for (Player player : world)
+    	{
+			if (!player.isInsideZone(ZoneId.NO_ZERG) || player.getAllyId() == 0)
+				continue;
+			String zerg1 = activeChar.getClan().getAllyName();
+			String zerg2 = player.getClan().getAllyName();
+
+			if (zerg1.equals(zerg2))
+			{
+				if (zergMap.get(zerg1) == null)
+					zergMap.put(zerg1, new ArrayList<Player>());
+
+				zergMap.get(zerg1).add(player);
+
+				if (zergMap.get(zerg1).size() > numberBox)
+					return true;
+			}
+    	}
+    	return false;
+    }
+
+    public boolean checkClanArea(Player activeChar, Integer numberBox, Boolean forcedTeleport)
+    {
+        if (checkClanAreaKickTask(activeChar, numberBox))
+        {
+            if (forcedTeleport)
+            {
+            	activeChar.sendPacket(new ExShowScreenMessage("Allowed only " + numberBox + " clans members on this area!", 6 * 1000));
+            	RandomTeleport(activeChar);
+            }
+            return true;
+        }
+        return false;
+    }
+    
+    public boolean checkAllyArea(Player activeChar, Integer numberBox, Collection<Player> world, Boolean forcedTeleport)
+    {
+        if (checkAllyAreaKickTask(activeChar, numberBox, world))
+        {
+            if (forcedTeleport)
+            {
+            	activeChar.sendPacket(new ExShowScreenMessage("Allowed only " + numberBox + " ally members on this area!", 6 * 1000));
+            	RandomTeleport(activeChar);
+            }
+            return true;
+        }
+        return false;
+    }
+
+    //Giran Coord's
+	public void RandomTeleport(Player activeChar)
+	{
+		switch (Rnd.get(5))
+		{
+		    case 0:
+		    {
+		    	int x = 82533 + Rnd.get(100);
+		    	int y = 149122 + Rnd.get(100);
+		    	activeChar.teleportTo(x, y, -3474, 0);
+		    	break;
+		    }
+		    case 1:
+		    {
+		    	int x = 82571 + Rnd.get(100);
+		    	int y = 148060 + Rnd.get(100);
+		    	activeChar.teleportTo(x, y, -3467, 0);
+		    	break;
+		    }
+		    case 2:
+		    {
+		    	int x = 81376 + Rnd.get(100);
+		    	int y = 148042 + Rnd.get(100);
+		    	activeChar.teleportTo(x, y, -3474, 0);
+		    	break;
+		    }
+		    case 3:
+		    {
+		    	int x = 81359 + Rnd.get(100);
+		    	int y = 149218 + Rnd.get(100);
+		    	activeChar.teleportTo(x, y, -3474, 0);
+		    	break;
+		    }
+		    case 4:
+		    {
+		    	int x = 82862 + Rnd.get(100);
+		    	int y = 148606 + Rnd.get(100);
+		    	activeChar.teleportTo(x, y, -3474, 0);
+		    	break;
+		    }
+	    }
+	}
+	
+    private static class SingletonHolder
+    {
+        protected static final ZergManager _instance = new ZergManager();
+    }
+
+    public static final ZergManager getInstance()
+    {
+        return SingletonHolder._instance;
+    }
+
+}

diff --git a/java/L2JDev/World/gameserver/model/zone/type/NoZergZone.java b/java/L2JDev/World/gameserver/model/zone/type/NoZergZone.java
new file mode 100644
index 0000000..630620b
--- /dev/null
+++ b/java/L2JDev/World/gameserver/model/zone/type/NoZergZone.java
@@ -0,0 +1,115 @@
+package L2JDev.World.gameserver.model.zone.type;
+
+import L2JDev.World.gameserver.enums.ZoneId;
+import L2JDev.World.gameserver.model.World;
+import L2JDev.World.gameserver.model.actor.Creature;
+import L2JDev.World.gameserver.model.actor.Player;
+import L2JDev.World.gameserver.model.entity.NoZerg.ZergManager;
+import L2JDev.World.gameserver.model.location.SpawnLocation;
+import L2JDev.World.gameserver.model.zone.type.subtype.ZoneType;
+import L2JDev.World.gameserver.network.serverpackets.ExShowScreenMessage;
+import L2JDev.World.gameserver.taskmanager.PvpFlagTaskManager;
+
+/**
+ * @author BAN - L2JDev
+ *
+ */
+public class NoZergZone extends ZoneType
+{
+	private final SpawnLocation _position = new SpawnLocation(0, 0, 0, 0);
+	
+	private int _maxClanMembers;	
+	private int _maxAllyMembers;	
+	private int _minPartyMembers;	
+	private boolean _isflagZone;	
+	private boolean _checkParty;	
+	private boolean _checkClan;	
+	private boolean _checkAlly;	
+	
+	
+	public NoZergZone(int id)
+	{
+		super(id);
+		_maxClanMembers = 0;
+		_maxAllyMembers = 0;
+		_minPartyMembers = 0;
+		_isflagZone = false;
+		_checkParty = false;
+		_checkClan = false;	
+		_checkAlly = false;	
+	}
+	
+	@Override	
+	public void setParameter(String name, String value)
+	{	
+		if (name.equals("MaxClanMembers"))	
+			_maxClanMembers = Integer.parseInt(value);
+		else if (name.equals("MaxAllyMembers"))
+			_maxAllyMembers = Integer.parseInt(value);
+		else if (name.equals("MinPartyMembers"))
+			_minPartyMembers = Integer.parseInt(value);
+		else if (name.equals("isflagZone"))	
+			_isflagZone = Boolean.parseBoolean(value);
+		else if (name.equals("checkParty"))	
+			_checkParty = Boolean.parseBoolean(value);
+		else if (name.equals("checkClan"))	
+			_checkClan = Boolean.parseBoolean(value);
+		else if (name.equals("checkAlly"))	
+			_checkAlly = Boolean.parseBoolean(value);
+		else	
+			super.setParameter(name, value)	;
+	}	
+	
+	
+	@Override
+	protected void onEnter(Creature character)
+	{
+		character.setInsideZone(ZoneId.NO_ZERG, true);
+		if (character instanceof Player)	
+		{	
+			Player player = (Player) character;
+			if (_isflagZone)	
+			{	
+				player.sendPacket(new ExShowScreenMessage("You have entered a Flag PvP zone!", 4000));
+				if (player.getPvpFlag() > 0	)
+					PvpFlagTaskManager.getInstance().remove(player, false);
+				player.updatePvPFlag(1);	
+			}
+			
+			if (_checkParty)
+			{	
+				if (!player.isInParty() || 	player.getParty().getMembersCount() < _minPartyMembers)
+				{	
+					player.sendPacket(new ExShowScreenMessage("Your party does not have " + _minPartyMembers + " members to enter on this zone!", 6 * 1000));
+					ZergManager.getInstance	().RandomTeleport(player);
+				}	
+			}
+			if (_checkClan)	
+				MaxClanMembersOnArea(player	);
+
+			if (_checkAlly)	
+				MaxAllyMembersOnArea(player	);
+		}	
+		
+	}
+	
+	@Override
+	protected void onExit(Creature character)
+	{
+
+	}
+	
+	public boolean MaxClanMembersOnArea(Player activeChar)
+	{	
+		return ZergManager.getInstance().checkClanArea(activeChar, _maxClanMembers, true);
+	}	
+		
+	public boolean MaxAllyMembersOnArea(Player activeChar)
+	{	
+		return ZergManager.getInstance().checkAllyArea(activeChar, _maxAllyMembers, World.getInstance().getPlayers(), true);
+	}
+
+	/**
+	 * @author BAN - L2JDev
+	 * @return
+	 */
+	public Location getPosition()
+	{
+		return _position;
+	}
+
+}

==================================================================
Index: data/zones/NoZergZone.xml
==================================================================

+	<?xml version="1.0" encoding="UTF-8"?>
+	<list>
+		<zone type="NoZergZone" shape="Cylinder" minz="-6400" maxz="-6000" rad="2000"><!-- Ember -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="185656" y="-106284" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-6300" maxz="-5600" rad="3000"><!-- Queen Shyeed -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="79602" y="-55384" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="6990" maxz="7100" rad="2500"><!-- TOI Boss -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="114654" y="16086" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-2700" maxz="-2000" rad="2600"><!-- Shadith -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="115227" y="-39406" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-5000" maxz="-4000" rad="2600"><!-- Hekaton -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="148114" y="-74213" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-1800" maxz="-400" rad="2700"><!-- Varka Commander -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="109533" y="-36529" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-1900" maxz="-1400" rad="2700"><!-- Chief Horus -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="105713" y="-42555" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="NPoly" minz="-10000" maxz="10000"><!-- Chief Horus -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+		    <node x="147744" y="-84150" />
+		    <node x="145999" y="-87340" />
+		    <node x="143299" y="-86207" />
+		    <node x="140295" y="-83158" />
+		    <node x="146468" y="-79285" />
+		    <node x="148002" y="-81522" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-1100" maxz="-700" rad="2000"><!-- Valakas Heart -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="189880" y="-105796" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-4000" maxz="-3500" rad="3000"><!-- Antharas Heart -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="152353" y="120783" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="NPoly" minz="-4815" maxz="-315"><!-- Zaken -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="50797" y="213515" />
+			<node x="57617" y="213510" />
+			<node x="57669" y="221683" />
+			<node x="50773" y="221632" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type='NoZergZone' shape='NPoly' minZ='-10000' maxZ='-4400'><!-- QA - Full -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+	        <node x="-28789" y="152100" />
+	        <node x="8778" y="178677" />
+	        <node x="-20518" y="210251" />
+	        <node x="-58378" y="181749" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="9200" maxz="12500" rad="5000"><!-- Chaotic Zone TOI 13 -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="113679" y="15094" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+	</list>

 

 

Edited by L2VANPER
Posted (edited)
21 hours ago, L2VANPER said:
  Reveal hidden contents




diff --git a/java/L2JDev/World/gameserver/GameServer.java b/java/L2JDev/World/gameserver/GameServer.java
index 4938129..6076801 100644
--- a/java/L2JDev/World/gameserver/GameServer.java
+++ b/java/L2JDev/World/gameserver/GameServer.java
@@ -99,6 +99,7 @@
 import L2JDev.World.gameserver.model.entity.DeathMatch.DMManager;
 import L2JDev.World.gameserver.model.entity.Dungeon.Dungeon;
 import L2JDev.World.gameserver.model.entity.Dungeon.InicialDungeon;
+import L2JDev.World.gameserver.model.entity.NoZerg.ZergManager;
 import L2JDev.World.gameserver.model.entity.PartyFarm.InitialPartyFarm;
 import L2JDev.World.gameserver.model.entity.PartyFarm.PartyFarm;
 import L2JDev.World.gameserver.model.entity.TeamVsTeam.TvTConfig;
@@ -220,6 +221,7 @@
 		
 		StringUtil.printSection("Zones");
 		ZoneManager.getInstance();
+		ZergManager.getInstance();

@@ -301,15 +303,12 @@

diff --git a/java/L2JDev/World/gameserver/data/manager/ZoneManager.java b/java/L2JDev/World/gameserver/data/manager/ZoneManager.java
index 2d2cfac..30c71ef 100644
--- a/java/L2JDev/World/gameserver/data/manager/ZoneManager.java
+++ b/java/L2JDev/World/gameserver/data/manager/ZoneManager.java
@@ -30,6 +30,7 @@
 import L2JDev.World.gameserver.model.zone.type.BattleZone;
 import L2JDev.World.gameserver.model.zone.type.BossZone;
 import L2JDev.World.gameserver.model.zone.type.ChaoticZone;
+import L2JDev.World.gameserver.model.zone.type.NoZergZone;
 import L2JDev.World.gameserver.model.zone.type.subtype.SpawnZoneType;
 import L2JDev.World.gameserver.model.zone.type.subtype.ZoneType;
 import L2JDev.World.gameserver.network.serverpackets.L2GameServerPacket;
@@ -454,6 +455,21 @@
 		return null;
 	}
 	
+	public final static NoZergZone getZerg(Player character)
+	{
+		if (character == null)
+			return null;
+		
+		for (ZoneType temp : ZoneManager.getInstance().getZones(character.getX(), character.getY(), character.getZ()))
+		{
+			if (temp instanceof NoZergZone && temp.isCharacterInZone(character))
+				return ((NoZergZone) temp);
+		}
+		
+		return null;
+	}
+
+	
 	public static final ZoneManager getInstance()
 	{
 		return SingletonHolder.INSTANCE;
diff --git a/java/L2JDev/World/gameserver/data/xml/MapRegionData.java b/java/L2JDev/World/gameserver/data/xml/MapRegionData.java
index e1b43a4..15ea1cd 100644
--- a/java/L2JDev/World/gameserver/data/xml/MapRegionData.java
+++ b/java/L2JDev/World/gameserver/data/xml/MapRegionData.java
@@ -24,6 +24,7 @@
 import L2JDev.World.gameserver.model.entity.Castle;
 import L2JDev.World.gameserver.model.entity.Siege;
 import L2JDev.World.gameserver.model.location.Location;
+import L2JDev.World.gameserver.model.zone.type.NoZergZone;
 import L2JDev.World.gameserver.model.zone.type.TownZone;
 
 /**
@@ -291,7 +292,11 @@
			else if (teleportType == TeleportType.SIEGE_FLAG)
			{
				final Siege siege = CastleManager.getInstance().getActiveSiege(player);
				if (siege != null)
				{
					final Npc flag = siege.getFlag(player.getClan());
					if (flag != null)
						return flag.getPosition();
				}
				
				final SiegableHall sh = ClanHallManager.getInstance().getNearestSiegableHall(player);
				if (sh != null)
				{
					final Npc flag = sh.getSiege().getFlag(player.getClan());
					if (flag != null)
						return flag.getPosition();
				}
			}
			
+			// Checking if in Party Zerg Zone
+			NoZergZone zerg = ZoneManager.getZerg(player);
+			if (zerg != null)
+				return zerg.getPosition();
	
		}
		
		// Returning to Town in a Siege - Seal of Strife.
		// When owned by Dawn: Player restarts in the second nearest village.
		// When owned by Dusk / not owned: A clan that has participated in a siege restarts in the first town at the time of escape or death.

 	}
diff --git a/java/L2JDev/World/gameserver/enums/ZoneId.java b/java/L2JDev/World/gameserver/enums/ZoneId.java
index 6fc44c9..40d62d2 100644
--- a/java/L2JDev/World/gameserver/enums/ZoneId.java
+++ b/java/L2JDev/World/gameserver/enums/ZoneId.java
@@ -25,7 +25,8 @@
 	RAID(20),
 	CHAOTIC(21),
 	ARENA_EVENT(22),
-	TOURNAMENT(23);
+	TOURNAMENT(23),
+	NO_ZERG(24);
 	
diff --git a/java/L2JDev/World/gameserver/model/entity/NoZerg/ZergManager.java b/java/L2JDev/World/gameserver/model/entity/NoZerg/ZergManager.java
new file mode 100644
index 0000000..c924e1d
--- /dev/null
+++ b/java/L2JDev/World/gameserver/model/entity/NoZerg/ZergManager.java
@@ -0,0 +1,166 @@
+package L2JDev.World.gameserver.model.entity.NoZerg;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import L2JDev.World.commons.random.Rnd;
+import L2JDev.World.gameserver.enums.ZoneId;
+import L2JDev.World.gameserver.model.actor.Player;
+import L2JDev.World.gameserver.model.pledge.Clan;
+import L2JDev.World.gameserver.network.serverpackets.ExShowScreenMessage;
+
+/**
+ * @author BAN - L2JDev
+ *
+ */
+public class ZergManager
+{
+    private static final Logger _log = Logger.getLogger(ZergManager.class.getName());
+
+    public ZergManager()
+    {
+        _log.log(Level.INFO, "Anti-ZergManager - Loaded.");
+    }
+
+    private static boolean checkClanAreaKickTask(Player activeChar, Integer numberBox)
+    {
+        Map<String, List<Player>> zergMap = new HashMap<>();
+        
+        Clan clan = activeChar.getClan();
+        
+        if (clan != null)
+        {
+        	for (Player player : clan.getOnlineMembers())
+        	{
+        		if (!player.isInsideZone(ZoneId.NO_ZERG) || player.getClan() == null)
+        			continue;
+				String zerg1 = activeChar.getClan().getName();
+				String zerg2 = player.getClan().getName();
+
+				if (zerg1.equals(zerg2))
+				{
+					if (zergMap.get(zerg1) == null)
+						zergMap.put(zerg1, new ArrayList<Player>());
+
+					zergMap.get(zerg1).add(player);
+
+					if (zergMap.get(zerg1).size() > numberBox)
+						return true;
+				}
+        	}
+        }
+        return false;
+    }
+    
+    private static boolean checkAllyAreaKickTask(Player activeChar, Integer numberBox, Collection<Player> world)
+    {
+    	Map<String, List<Player>> zergMap = new HashMap<>();
+
+    	for (Player player : world)
+    	{
+			if (!player.isInsideZone(ZoneId.NO_ZERG) || player.getAllyId() == 0)
+				continue;
+			String zerg1 = activeChar.getClan().getAllyName();
+			String zerg2 = player.getClan().getAllyName();
+
+			if (zerg1.equals(zerg2))
+			{
+				if (zergMap.get(zerg1) == null)
+					zergMap.put(zerg1, new ArrayList<Player>());
+
+				zergMap.get(zerg1).add(player);
+
+				if (zergMap.get(zerg1).size() > numberBox)
+					return true;
+			}
+    	}
+    	return false;
+    }
+
+    public boolean checkClanArea(Player activeChar, Integer numberBox, Boolean forcedTeleport)
+    {
+        if (checkClanAreaKickTask(activeChar, numberBox))
+        {
+            if (forcedTeleport)
+            {
+            	activeChar.sendPacket(new ExShowScreenMessage("Allowed only " + numberBox + " clans members on this area!", 6 * 1000));
+            	RandomTeleport(activeChar);
+            }
+            return true;
+        }
+        return false;
+    }
+    
+    public boolean checkAllyArea(Player activeChar, Integer numberBox, Collection<Player> world, Boolean forcedTeleport)
+    {
+        if (checkAllyAreaKickTask(activeChar, numberBox, world))
+        {
+            if (forcedTeleport)
+            {
+            	activeChar.sendPacket(new ExShowScreenMessage("Allowed only " + numberBox + " ally members on this area!", 6 * 1000));
+            	RandomTeleport(activeChar);
+            }
+            return true;
+        }
+        return false;
+    }
+
+    //Giran Coord's
+	public void RandomTeleport(Player activeChar)
+	{
+		switch (Rnd.get(5))
+		{
+		    case 0:
+		    {
+		    	int x = 82533 + Rnd.get(100);
+		    	int y = 149122 + Rnd.get(100);
+		    	activeChar.teleportTo(x, y, -3474, 0);
+		    	break;
+		    }
+		    case 1:
+		    {
+		    	int x = 82571 + Rnd.get(100);
+		    	int y = 148060 + Rnd.get(100);
+		    	activeChar.teleportTo(x, y, -3467, 0);
+		    	break;
+		    }
+		    case 2:
+		    {
+		    	int x = 81376 + Rnd.get(100);
+		    	int y = 148042 + Rnd.get(100);
+		    	activeChar.teleportTo(x, y, -3474, 0);
+		    	break;
+		    }
+		    case 3:
+		    {
+		    	int x = 81359 + Rnd.get(100);
+		    	int y = 149218 + Rnd.get(100);
+		    	activeChar.teleportTo(x, y, -3474, 0);
+		    	break;
+		    }
+		    case 4:
+		    {
+		    	int x = 82862 + Rnd.get(100);
+		    	int y = 148606 + Rnd.get(100);
+		    	activeChar.teleportTo(x, y, -3474, 0);
+		    	break;
+		    }
+	    }
+	}
+	
+    private static class SingletonHolder
+    {
+        protected static final ZergManager _instance = new ZergManager();
+    }
+
+    public static final ZergManager getInstance()
+    {
+        return SingletonHolder._instance;
+    }
+
+}

diff --git a/java/L2JDev/World/gameserver/model/zone/type/NoZergZone.java b/java/L2JDev/World/gameserver/model/zone/type/NoZergZone.java
new file mode 100644
index 0000000..630620b
--- /dev/null
+++ b/java/L2JDev/World/gameserver/model/zone/type/NoZergZone.java
@@ -0,0 +1,115 @@
+package L2JDev.World.gameserver.model.zone.type;
+
+import L2JDev.World.gameserver.enums.ZoneId;
+import L2JDev.World.gameserver.model.World;
+import L2JDev.World.gameserver.model.actor.Creature;
+import L2JDev.World.gameserver.model.actor.Player;
+import L2JDev.World.gameserver.model.entity.NoZerg.ZergManager;
+import L2JDev.World.gameserver.model.location.SpawnLocation;
+import L2JDev.World.gameserver.model.zone.type.subtype.ZoneType;
+import L2JDev.World.gameserver.network.serverpackets.ExShowScreenMessage;
+import L2JDev.World.gameserver.taskmanager.PvpFlagTaskManager;
+
+/**
+ * @author BAN - L2JDev
+ *
+ */
+public class NoZergZone extends ZoneType
+{
+	private final SpawnLocation _position = new SpawnLocation(0, 0, 0, 0);
+	
+	private int _maxClanMembers;	
+	private int _maxAllyMembers;	
+	private int _minPartyMembers;	
+	private boolean _isflagZone;	
+	private boolean _checkParty;	
+	private boolean _checkClan;	
+	private boolean _checkAlly;	
+	
+	
+	public NoZergZone(int id)
+	{
+		super(id);
+		_maxClanMembers = 0;
+		_maxAllyMembers = 0;
+		_minPartyMembers = 0;
+		_isflagZone = false;
+		_checkParty = false;
+		_checkClan = false;	
+		_checkAlly = false;	
+	}
+	
+	@Override	
+	public void setParameter(String name, String value)
+	{	
+		if (name.equals("MaxClanMembers"))	
+			_maxClanMembers = Integer.parseInt(value);
+		else if (name.equals("MaxAllyMembers"))
+			_maxAllyMembers = Integer.parseInt(value);
+		else if (name.equals("MinPartyMembers"))
+			_minPartyMembers = Integer.parseInt(value);
+		else if (name.equals("isflagZone"))	
+			_isflagZone = Boolean.parseBoolean(value);
+		else if (name.equals("checkParty"))	
+			_checkParty = Boolean.parseBoolean(value);
+		else if (name.equals("checkClan"))	
+			_checkClan = Boolean.parseBoolean(value);
+		else if (name.equals("checkAlly"))	
+			_checkAlly = Boolean.parseBoolean(value);
+		else	
+			super.setParameter(name, value)	;
+	}	
+	
+	
+	@Override
+	protected void onEnter(Creature character)
+	{
+		character.setInsideZone(ZoneId.NO_ZERG, true);
+		if (character instanceof Player)	
+		{	
+			Player player = (Player) character;
+			if (_isflagZone)	
+			{	
+				player.sendPacket(new ExShowScreenMessage("You have entered a Flag PvP zone!", 4000));
+				if (player.getPvpFlag() > 0	)
+					PvpFlagTaskManager.getInstance().remove(player, false);
+				player.updatePvPFlag(1);	
+			}
+			
+			if (_checkParty)
+			{	
+				if (!player.isInParty() || 	player.getParty().getMembersCount() < _minPartyMembers)
+				{	
+					player.sendPacket(new ExShowScreenMessage("Your party does not have " + _minPartyMembers + " members to enter on this zone!", 6 * 1000));
+					ZergManager.getInstance	().RandomTeleport(player);
+				}	
+			}
+			if (_checkClan)	
+				MaxClanMembersOnArea(player	);
+
+			if (_checkAlly)	
+				MaxAllyMembersOnArea(player	);
+		}	
+		
+	}
+	
+	@Override
+	protected void onExit(Creature character)
+	{
+
+	}
+	
+	public boolean MaxClanMembersOnArea(Player activeChar)
+	{	
+		return ZergManager.getInstance().checkClanArea(activeChar, _maxClanMembers, true);
+	}	
+		
+	public boolean MaxAllyMembersOnArea(Player activeChar)
+	{	
+		return ZergManager.getInstance().checkAllyArea(activeChar, _maxAllyMembers, World.getInstance().getPlayers(), true);
+	}
+
+	/**
+	 * @author BAN - L2JDev
+	 * @return
+	 */
+	public Location getPosition()
+	{
+		return _position;
+	}
+
+}

==================================================================
Index: data/zones/NoZergZone.xml
==================================================================

+	<?xml version="1.0" encoding="UTF-8"?>
+	<list>
+		<zone type="NoZergZone" shape="Cylinder" minz="-6400" maxz="-6000" rad="2000"><!-- Ember -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="185656" y="-106284" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-6300" maxz="-5600" rad="3000"><!-- Queen Shyeed -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="79602" y="-55384" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="6990" maxz="7100" rad="2500"><!-- TOI Boss -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="114654" y="16086" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-2700" maxz="-2000" rad="2600"><!-- Shadith -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="115227" y="-39406" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-5000" maxz="-4000" rad="2600"><!-- Hekaton -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="148114" y="-74213" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-1800" maxz="-400" rad="2700"><!-- Varka Commander -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="109533" y="-36529" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-1900" maxz="-1400" rad="2700"><!-- Chief Horus -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="105713" y="-42555" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="NPoly" minz="-10000" maxz="10000"><!-- Chief Horus -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+		    <node x="147744" y="-84150" />
+		    <node x="145999" y="-87340" />
+		    <node x="143299" y="-86207" />
+		    <node x="140295" y="-83158" />
+		    <node x="146468" y="-79285" />
+		    <node x="148002" y="-81522" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-1100" maxz="-700" rad="2000"><!-- Valakas Heart -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="189880" y="-105796" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="-4000" maxz="-3500" rad="3000"><!-- Antharas Heart -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="152353" y="120783" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="NPoly" minz="-4815" maxz="-315"><!-- Zaken -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="50797" y="213515" />
+			<node x="57617" y="213510" />
+			<node x="57669" y="221683" />
+			<node x="50773" y="221632" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type='NoZergZone' shape='NPoly' minZ='-10000' maxZ='-4400'><!-- QA - Full -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+	        <node x="-28789" y="152100" />
+	        <node x="8778" y="178677" />
+	        <node x="-20518" y="210251" />
+	        <node x="-58378" y="181749" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+		<zone type="NoZergZone" shape="Cylinder" minz="9200" maxz="12500" rad="5000"><!-- Chaotic Zone TOI 13 -->
+		    <!-- Make Players Inside Area Flag -->
+		    <stat name="isflagZone" val="true" />
+		    <!-- Max Clan Members Inside Area -->
+		    <stat name="MaxClanMembers" val="18" />
+		    <!-- Max Ally Members Inside Area -->
+		    <stat name="MaxAllyMembers" val="27" />
+		    <!-- Min Party Members Inside Area -->
+			<stat name="checkParty" val="false" />
+		    <stat name="MinPartyMembers" val="2" />
+			<node x="113679" y="15094" />
+			<spawn x="82480" y="149087" z="-3350" />
+			<spawn x="81440" y="149119" z="-3350" />
+			<spawn x="81376" y="148095" z="-3350" />
+			<spawn x="82496" y="148095" z="-3350" />
+			<spawn x="83473" y="149223" z="-3300" />
+			<spawn x="83426" y="148835" z="-3300" />
+			<spawn x="83409" y="148578" z="-3300" />
+			<spawn x="83415" y="148235" z="-3300" />
+			<spawn x="82272" y="147801" z="-3350" />
+			<spawn x="81562" y="147782" z="-3350" />
+			<spawn x="81062" y="148144" z="-3350" />
+			<spawn x="81033" y="148883" z="-3350" />
+			<spawn x="81637" y="149427" z="-3350" />
+			<spawn x="82292" y="149450" z="-3350" />
+			<spawn x="17611" y="170054" z="-3509" isChaotic="true" />
+		</zone>
+	</list>

 

 

it doesn't take all that to limit clan and ally in one zone.

 

https://pastebin.com/raw/n8h57sN7

Edited by Williams
  • Like 2
  • Upvote 1

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