Sfoglia il codice sorgente

BETA: Minor updates for first half of instance managers.
* Small updates to methods.
* Moving runnable tasks to separate classes.
* Moving DTO's to separate classes.
* Reviewed by: UnAfraid

xban1x 11 anni fa
parent
commit
1cdd776444
50 ha cambiato i file con 1123 aggiunte e 665 eliminazioni
  1. 6 19
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/AirShipManager.java
  2. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/AntiFeedManager.java
  3. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/AuctionManager.java
  4. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/BoatManager.java
  5. 2 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/CastleManager.java
  6. 3 107
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/CastleManorManager.java
  7. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/CoupleManager.java
  8. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/CursedWeaponsManager.java
  9. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/DayNightSpawnManager.java
  10. 9 127
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/DimensionalRiftManager.java
  11. 7 7
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/DuelManager.java
  12. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FortManager.java
  13. 5 5
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FortSiegeGuardManager.java
  14. 21 58
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FortSiegeManager.java
  15. 142 234
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FourSepulchersManager.java
  16. 13 26
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/WalkingManager.java
  17. 96 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/tasks/FourSepulchersChangeAttackTimeTask.java
  18. 67 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/tasks/FourSepulchersChangeCoolDownTimeTask.java
  19. 69 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/tasks/FourSepulchersChangeEntryTimeTask.java
  20. 65 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/tasks/FourSepulchersChangeWarmUpTimeTask.java
  21. 60 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/tasks/FourSepulchersManagerSay.java
  22. 47 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/tasks/StartMovingTask.java
  23. 52 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/AirShipTeleportList.java
  24. 80 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/CropProcure.java
  25. 163 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/DimensionalRiftRoom.java
  26. 53 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/FortSiegeSpawn.java
  27. 71 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/SeedProduction.java
  28. 21 18
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/VehiclePathPoint.java
  29. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java
  30. 17 17
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Vehicle.java
  31. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2FortCommanderInstance.java
  32. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Castle.java
  33. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/DimensionalRift.java
  34. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/FortSiege.java
  35. 11 0
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/zone/L2ZoneType.java
  36. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestBuySeed.java
  37. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestProcureCropList.java
  38. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestSetCrop.java
  39. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestSetSeed.java
  40. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/BuyListSeed.java
  41. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExAirShipTeleportList.java
  42. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowCropInfo.java
  43. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowCropSetting.java
  44. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowFortressMapInfo.java
  45. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowFortressSiegeInfo.java
  46. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowProcureCropDetail.java
  47. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowSeedInfo.java
  48. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowSeedSetting.java
  49. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowSellCropList.java
  50. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/SellListProcure.java

+ 6 - 19
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/AirShipManager.java

@@ -30,6 +30,7 @@ import java.util.logging.Logger;
 
 import com.l2jserver.L2DatabaseFactory;
 import com.l2jserver.gameserver.idfactory.IdFactory;
+import com.l2jserver.gameserver.model.AirShipTeleportList;
 import com.l2jserver.gameserver.model.StatsSet;
 import com.l2jserver.gameserver.model.VehiclePathPoint;
 import com.l2jserver.gameserver.model.actor.instance.L2AirShipInstance;
@@ -230,7 +231,7 @@ public class AirShipManager
 		}
 		
 		final AirShipTeleportList all = _teleports.get(dockId);
-		player.sendPacket(new ExAirShipTeleportList(all.location, all.routes, all.fuel));
+		player.sendPacket(new ExAirShipTeleportList(all.getLocation(), all.getRoute(), all.getFuel()));
 	}
 	
 	public VehiclePathPoint[] getTeleportDestination(int dockId, int index)
@@ -241,12 +242,12 @@ public class AirShipManager
 			return null;
 		}
 		
-		if ((index < -1) || (index >= all.routes.length))
+		if ((index < -1) || (index >= all.getRoute().length))
 		{
 			return null;
 		}
 		
-		return all.routes[index + 1];
+		return all.getRoute()[index + 1];
 	}
 	
 	public int getFuelConsumption(int dockId, int index)
@@ -257,12 +258,12 @@ public class AirShipManager
 			return 0;
 		}
 		
-		if ((index < -1) || (index >= all.fuel.length))
+		if ((index < -1) || (index >= all.getFuel().length))
 		{
 			return 0;
 		}
 		
-		return all.fuel[index + 1];
+		return all.getFuel()[index + 1];
 	}
 	
 	private void load()
@@ -315,20 +316,6 @@ public class AirShipManager
 		}
 	}
 	
-	private static class AirShipTeleportList
-	{
-		public int location;
-		public int[] fuel;
-		public VehiclePathPoint[][] routes;
-		
-		public AirShipTeleportList(int loc, int[] f, VehiclePathPoint[][] r)
-		{
-			location = loc;
-			fuel = f;
-			routes = r;
-		}
-	}
-	
 	public static final AirShipManager getInstance()
 	{
 		return SingletonHolder._instance;

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/AntiFeedManager.java

@@ -30,7 +30,7 @@ import com.l2jserver.gameserver.network.L2GameClient;
 import com.l2jserver.util.L2FastMap;
 import com.l2jserver.util.L2HashMap;
 
-public class AntiFeedManager
+public final class AntiFeedManager
 {
 	public static final int GAME_ID = 0;
 	public static final int OLYMPIAD_ID = 1;

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/AuctionManager.java

@@ -32,7 +32,7 @@ import com.l2jserver.gameserver.model.entity.Auction;
 /**
  * Zoey76: TODO: Rewrite it and unharcode it.
  */
-public class AuctionManager
+public final class AuctionManager
 {
 	protected static final Logger _log = Logger.getLogger(AuctionManager.class.getName());
 	private final List<Auction> _auctions = new ArrayList<>();

+ 4 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/BoatManager.java

@@ -197,8 +197,8 @@ public class BoatManager
 		{
 			if (player != null)
 			{
-				double dx = (double) player.getX() - _point1.x;
-				double dy = (double) player.getY() - _point1.y;
+				double dx = (double) player.getX() - _point1.getX();
+				double dy = (double) player.getY() - _point1.getY();
 				if (Math.sqrt((dx * dx) + (dy * dy)) < Config.BOAT_BROADCAST_RADIUS)
 				{
 					for (L2GameServerPacket p : _packets)
@@ -208,8 +208,8 @@ public class BoatManager
 				}
 				else
 				{
-					dx = (double) player.getX() - _point2.x;
-					dy = (double) player.getY() - _point2.y;
+					dx = (double) player.getX() - _point2.getX();
+					dy = (double) player.getY() - _point2.getY();
 					if (Math.sqrt((dx * dx) + (dy * dy)) < Config.BOAT_BROADCAST_RADIUS)
 					{
 						for (L2GameServerPacket p : _packets)

+ 2 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/CastleManager.java

@@ -38,7 +38,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.entity.Castle;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 
-public class CastleManager implements InstanceListManager
+public final class CastleManager implements InstanceListManager
 {
 	private static final Logger _log = Logger.getLogger(CastleManager.class.getName());
 	
@@ -207,11 +207,9 @@ public class CastleManager implements InstanceListManager
 		}
 	}
 	
-	int _castleId = 1; // from this castle
-	
 	public int getCirclet()
 	{
-		return getCircletByCastleId(_castleId);
+		return getCircletByCastleId(1);
 	}
 	
 	public int getCircletByCastleId(int castleId)

+ 3 - 107
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/CastleManorManager.java

@@ -35,8 +35,10 @@ import com.l2jserver.L2DatabaseFactory;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.datatables.ClanTable;
 import com.l2jserver.gameserver.datatables.ManorData;
+import com.l2jserver.gameserver.model.CropProcure;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.L2World;
+import com.l2jserver.gameserver.model.SeedProduction;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.entity.Castle;
 import com.l2jserver.gameserver.model.itemcontainer.ClanWarehouse;
@@ -48,7 +50,7 @@ import com.l2jserver.util.Rnd;
  * Class for Castle Manor Manager load manor data from DB update/reload/delete, handles all schedule for manor.
  * @author l3x
  */
-public class CastleManorManager
+public final class CastleManorManager
 {
 	protected static final Logger _log = Logger.getLogger(CastleManorManager.class.getName());
 	
@@ -74,112 +76,6 @@ public class CastleManorManager
 	protected ScheduledFuture<?> _scheduledMaintenanceEnd;
 	protected ScheduledFuture<?> _scheduledNextPeriodapprove;
 	
-	public static class CropProcure
-	{
-		final int _cropId;
-		long _buyResidual;
-		final int _rewardType;
-		final long _buy;
-		final long _price;
-		
-		public CropProcure(int id)
-		{
-			_cropId = id;
-			_buyResidual = 0;
-			_rewardType = 0;
-			_buy = 0;
-			_price = 0;
-		}
-		
-		public CropProcure(int id, long amount, int type, long buy, long price)
-		{
-			_cropId = id;
-			_buyResidual = amount;
-			_rewardType = type;
-			_buy = buy;
-			_price = price;
-		}
-		
-		public int getReward()
-		{
-			return _rewardType;
-		}
-		
-		public int getId()
-		{
-			return _cropId;
-		}
-		
-		public long getAmount()
-		{
-			return _buyResidual;
-		}
-		
-		public long getStartAmount()
-		{
-			return _buy;
-		}
-		
-		public long getPrice()
-		{
-			return _price;
-		}
-		
-		public void setAmount(long amount)
-		{
-			_buyResidual = amount;
-		}
-	}
-	
-	public static class SeedProduction
-	{
-		final int _seedId;
-		long _residual;
-		final long _price;
-		final long _sales;
-		
-		public SeedProduction(int id)
-		{
-			_seedId = id;
-			_residual = 0;
-			_price = 0;
-			_sales = 0;
-		}
-		
-		public SeedProduction(int id, long amount, long price, long sales)
-		{
-			_seedId = id;
-			_residual = amount;
-			_price = price;
-			_sales = sales;
-		}
-		
-		public int getId()
-		{
-			return _seedId;
-		}
-		
-		public long getCanProduce()
-		{
-			return _residual;
-		}
-		
-		public long getPrice()
-		{
-			return _price;
-		}
-		
-		public long getStartProduce()
-		{
-			return _sales;
-		}
-		
-		public void setCanProduce(long amount)
-		{
-			_residual = amount;
-		}
-	}
-	
 	protected CastleManorManager()
 	{
 		load(); // load data from database

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/CoupleManager.java

@@ -34,7 +34,7 @@ import com.l2jserver.gameserver.model.entity.Couple;
 /**
  * @author evill33t
  */
-public class CoupleManager
+public final class CoupleManager
 {
 	private static final Logger _log = Logger.getLogger(CoupleManager.class.getName());
 	

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/CursedWeaponsManager.java

@@ -59,7 +59,7 @@ import com.l2jserver.gameserver.util.Broadcast;
  * UnAfraid: TODO: Rewrite with DocumentParser
  * @author Micht
  */
-public class CursedWeaponsManager
+public final class CursedWeaponsManager
 {
 	private static final Logger _log = Logger.getLogger(CursedWeaponsManager.class.getName());
 	

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/DayNightSpawnManager.java

@@ -34,7 +34,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2RaidBossInstance;
 /**
  * @author godson
  */
-public class DayNightSpawnManager
+public final class DayNightSpawnManager
 {
 	
 	private static Logger _log = Logger.getLogger(DayNightSpawnManager.class.getName());

+ 9 - 127
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/DimensionalRiftManager.java

@@ -18,8 +18,6 @@
  */
 package com.l2jserver.gameserver.instancemanager;
 
-import java.awt.Polygon;
-import java.awt.Shape;
 import java.io.File;
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -39,6 +37,7 @@ import com.l2jserver.Config;
 import com.l2jserver.L2DatabaseFactory;
 import com.l2jserver.gameserver.datatables.NpcTable;
 import com.l2jserver.gameserver.datatables.SpawnTable;
+import com.l2jserver.gameserver.model.DimensionalRiftRoom;
 import com.l2jserver.gameserver.model.L2Spawn;
 import com.l2jserver.gameserver.model.actor.L2Npc;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
@@ -54,7 +53,7 @@ import gnu.trove.map.hash.TByteObjectHashMap;
 /**
  * @author kombat
  */
-public class DimensionalRiftManager
+public final class DimensionalRiftManager
 {
 	private static Logger _log = Logger.getLogger(DimensionalRiftManager.class.getName());
 	private final TByteObjectHashMap<TByteObjectHashMap<DimensionalRiftRoom>> _rooms = new TByteObjectHashMap<>(7);
@@ -190,10 +189,10 @@ public class DimensionalRiftManager
 											
 											for (int i = 0; i < count; i++)
 											{
-												DimensionalRiftRoom riftRoom = _rooms.get(type).get(roomId);
+												final DimensionalRiftRoom riftRoom = _rooms.get(type).get(roomId);
 												x = riftRoom.getRandomX();
 												y = riftRoom.getRandomY();
-												z = riftRoom.getTeleportCoords()[2];
+												z = riftRoom.getTeleportCoorinates()[2];
 												
 												if ((template != null) && _rooms.containsKey(type) && _rooms.get(type).containsKey(roomId))
 												{
@@ -261,7 +260,7 @@ public class DimensionalRiftManager
 	
 	public void teleportToWaitingRoom(L2PcInstance player)
 	{
-		int[] coords = getRoom((byte) 0, (byte) 0).getTeleportCoords();
+		int[] coords = getRoom((byte) 0, (byte) 0).getTeleportCoorinates();
 		player.teleToLocation(coords[0], coords[1], coords[2]);
 	}
 	
@@ -377,7 +376,7 @@ public class DimensionalRiftManager
 			room = emptyRooms.get(Rnd.get(1, emptyRooms.size()) - 1);
 		}
 		// find empty room
-		while (_rooms.get(type).get(room).ispartyInside());
+		while (_rooms.get(type).get(room).isPartyInside());
 		new DimensionalRift(player.getParty(), type, room);
 	}
 	
@@ -408,123 +407,6 @@ public class DimensionalRiftManager
 		d.setSpawnTimer(null);
 	}
 	
-	public static class DimensionalRiftRoom
-	{
-		protected final byte _type;
-		protected final byte _room;
-		private final int _xMin;
-		private final int _xMax;
-		private final int _yMin;
-		private final int _yMax;
-		private final int _zMin;
-		private final int _zMax;
-		private final int[] _teleportCoords;
-		private final Shape _s;
-		private final boolean _isBossRoom;
-		private final FastList<L2Spawn> _roomSpawns;
-		protected final FastList<L2Npc> _roomMobs;
-		private boolean _partyInside = false;
-		
-		public DimensionalRiftRoom(byte type, byte room, int xMin, int xMax, int yMin, int yMax, int zMin, int zMax, int xT, int yT, int zT, boolean isBossRoom)
-		{
-			_type = type;
-			_room = room;
-			_xMin = (xMin + 128);
-			_xMax = (xMax - 128);
-			_yMin = (yMin + 128);
-			_yMax = (yMax - 128);
-			_zMin = zMin;
-			_zMax = zMax;
-			_teleportCoords = new int[]
-			{
-				xT,
-				yT,
-				zT
-			};
-			_isBossRoom = isBossRoom;
-			_roomSpawns = new FastList<>();
-			_roomMobs = new FastList<>();
-			_s = new Polygon(new int[]
-			{
-				xMin,
-				xMax,
-				xMax,
-				xMin
-			}, new int[]
-			{
-				yMin,
-				yMin,
-				yMax,
-				yMax
-			}, 4);
-		}
-		
-		public int getRandomX()
-		{
-			return Rnd.get(_xMin, _xMax);
-		}
-		
-		public int getRandomY()
-		{
-			return Rnd.get(_yMin, _yMax);
-		}
-		
-		public int[] getTeleportCoords()
-		{
-			return _teleportCoords;
-		}
-		
-		public boolean checkIfInZone(int x, int y, int z)
-		{
-			return _s.contains(x, y) && (z >= _zMin) && (z <= _zMax);
-		}
-		
-		public boolean isBossRoom()
-		{
-			return _isBossRoom;
-		}
-		
-		public FastList<L2Spawn> getSpawns()
-		{
-			return _roomSpawns;
-		}
-		
-		public void spawn()
-		{
-			for (L2Spawn spawn : _roomSpawns)
-			{
-				spawn.doSpawn();
-				spawn.startRespawn();
-			}
-		}
-		
-		public DimensionalRiftRoom unspawn()
-		{
-			for (L2Spawn spawn : _roomSpawns)
-			{
-				spawn.stopRespawn();
-				if (spawn.getLastSpawn() != null)
-				{
-					spawn.getLastSpawn().deleteMe();
-				}
-			}
-			return this;
-		}
-		
-		/**
-		 * @return the _partyInside
-		 */
-		public boolean ispartyInside()
-		{
-			return _partyInside;
-		}
-		
-		public void setPartyInside(boolean partyInside)
-		{
-			_partyInside = partyInside;
-		}
-	}
-	
 	private int getNeededItems(byte type)
 	{
 		switch (type)
@@ -569,7 +451,7 @@ public class DimensionalRiftManager
 		int count = 0;
 		for (DimensionalRiftRoom room : _rooms.get(type).valueCollection())
 		{
-			if (room.ispartyInside())
+			if (room.isPartyInside())
 			{
 				count++;
 			}
@@ -582,9 +464,9 @@ public class DimensionalRiftManager
 		FastList<Byte> list = new FastList<>();
 		for (DimensionalRiftRoom room : _rooms.get(type).valueCollection())
 		{
-			if (!room.ispartyInside())
+			if (!room.isPartyInside())
 			{
-				list.add(room._room);
+				list.add(room.getRoom());
 			}
 		}
 		return list;

+ 7 - 7
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/DuelManager.java

@@ -25,7 +25,7 @@ import com.l2jserver.gameserver.model.effects.L2Effect;
 import com.l2jserver.gameserver.model.entity.Duel;
 import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
 
-public class DuelManager
+public final class DuelManager
 {
 	private final FastList<Duel> _duels;
 	private int _currentDuelId = 0x90;
@@ -112,7 +112,7 @@ public class DuelManager
 			}
 		}
 		
-		Duel duel = new Duel(playerA, playerB, partyDuel, getNextDuelId());
+		final Duel duel = new Duel(playerA, playerB, partyDuel, getNextDuelId());
 		_duels.add(duel);
 	}
 	
@@ -127,7 +127,7 @@ public class DuelManager
 		{
 			return;
 		}
-		Duel duel = getDuel(player.getDuelId());
+		final Duel duel = getDuel(player.getDuelId());
 		duel.doSurrender(player);
 	}
 	
@@ -141,7 +141,7 @@ public class DuelManager
 		{
 			return;
 		}
-		Duel duel = getDuel(player.getDuelId());
+		final Duel duel = getDuel(player.getDuelId());
 		if (duel != null)
 		{
 			duel.onPlayerDefeat(player);
@@ -159,7 +159,7 @@ public class DuelManager
 		{
 			return;
 		}
-		Duel duel = getDuel(player.getDuelId());
+		final Duel duel = getDuel(player.getDuelId());
 		if (duel != null)
 		{
 			duel.onBuff(player, buff);
@@ -176,7 +176,7 @@ public class DuelManager
 		{
 			return;
 		}
-		Duel duel = getDuel(player.getDuelId());
+		final Duel duel = getDuel(player.getDuelId());
 		if (duel != null)
 		{
 			duel.onRemoveFromParty(player);
@@ -194,7 +194,7 @@ public class DuelManager
 		{
 			return;
 		}
-		Duel duel = getDuel(player.getDuelId());
+		final Duel duel = getDuel(player.getDuelId());
 		if (duel == null)
 		{
 			return;

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FortManager.java

@@ -33,7 +33,7 @@ import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.L2Object;
 import com.l2jserver.gameserver.model.entity.Fort;
 
-public class FortManager implements InstanceListManager
+public final class FortManager implements InstanceListManager
 {
 	protected static final Logger _log = Logger.getLogger(FortManager.class.getName());
 	

+ 5 - 5
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FortSiegeGuardManager.java

@@ -34,13 +34,13 @@ import com.l2jserver.gameserver.model.actor.instance.L2FortBallistaInstance;
 import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
 import com.l2jserver.gameserver.model.entity.Fort;
 
-public class FortSiegeGuardManager
+public final class FortSiegeGuardManager
 {
 	private static final Logger _log = Logger.getLogger(FortSiegeGuardManager.class.getName());
 	
 	private final Fort _fort;
-	protected FastMap<Integer, FastList<L2Spawn>> _siegeGuards = new FastMap<>();
-	protected FastList<L2Spawn> _siegeGuardsSpawns;
+	private final FastMap<Integer, FastList<L2Spawn>> _siegeGuards = new FastMap<>();
+	private FastList<L2Spawn> _siegeGuardsSpawns;
 	
 	public FortSiegeGuardManager(Fort fort)
 	{
@@ -54,7 +54,7 @@ public class FortSiegeGuardManager
 	{
 		try
 		{
-			FastList<L2Spawn> monsterList = getSiegeGuardSpawn().get(getFort().getFortId());
+			final FastList<L2Spawn> monsterList = getSiegeGuardSpawn().get(getFort().getFortId());
 			if (monsterList != null)
 			{
 				for (L2Spawn spawnDat : monsterList)
@@ -84,7 +84,7 @@ public class FortSiegeGuardManager
 	{
 		try
 		{
-			FastList<L2Spawn> monsterList = getSiegeGuardSpawn().get(getFort().getFortId());
+			final FastList<L2Spawn> monsterList = getSiegeGuardSpawn().get(getFort().getFortId());
 			
 			if (monsterList != null)
 			{

+ 21 - 58
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FortSiegeManager.java

@@ -37,9 +37,9 @@ import com.l2jserver.Config;
 import com.l2jserver.L2DatabaseFactory;
 import com.l2jserver.gameserver.datatables.SkillTable;
 import com.l2jserver.gameserver.model.CombatFlag;
+import com.l2jserver.gameserver.model.FortSiegeSpawn;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.L2Object;
-import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.entity.Fort;
@@ -48,19 +48,14 @@ import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
 
-public class FortSiegeManager
+public final class FortSiegeManager
 {
 	private static final Logger _log = Logger.getLogger(FortSiegeManager.class.getName());
 	
-	public static final FortSiegeManager getInstance()
-	{
-		return SingletonHolder._instance;
-	}
-	
 	private int _attackerMaxClans = 500; // Max number of clans
 	
 	// Fort Siege settings
-	private FastMap<Integer, FastList<SiegeSpawn>> _commanderSpawnList;
+	private FastMap<Integer, FastList<FortSiegeSpawn>> _commanderSpawnList;
 	private FastMap<Integer, FastList<CombatFlag>> _flagList;
 	private int _flagMaxCount = 1; // Changeable in fortsiege.properties
 	private int _siegeClanMinLevel = 4; // Changeable in fortsiege.properties
@@ -93,8 +88,8 @@ public class FortSiegeManager
 		}
 		
 		String text = "";
-		L2PcInstance player = (L2PcInstance) activeChar;
-		Fort fort = FortManager.getInstance().getFort(player);
+		final L2PcInstance player = (L2PcInstance) activeChar;
+		final Fort fort = FortManager.getInstance().getFort(player);
 		
 		if ((fort == null) || (fort.getFortId() <= 0))
 		{
@@ -162,7 +157,7 @@ public class FortSiegeManager
 	
 	private final void load()
 	{
-		Properties siegeSettings = new Properties();
+		final Properties siegeSettings = new Properties();
 		final File file = new File(Config.FORTSIEGE_CONFIGURATION_FILE);
 		try (InputStream is = new FileInputStream(file))
 		{
@@ -187,16 +182,16 @@ public class FortSiegeManager
 		
 		for (Fort fort : FortManager.getInstance().getForts())
 		{
-			FastList<SiegeSpawn> _commanderSpawns = new FastList<>();
+			FastList<FortSiegeSpawn> _commanderSpawns = new FastList<>();
 			FastList<CombatFlag> _flagSpawns = new FastList<>();
 			for (int i = 1; i < 5; i++)
 			{
-				String _spawnParams = siegeSettings.getProperty(fort.getName().replace(" ", "") + "Commander" + i, "");
+				final String _spawnParams = siegeSettings.getProperty(fort.getName().replace(" ", "") + "Commander" + i, "");
 				if (_spawnParams.isEmpty())
 				{
 					break;
 				}
-				StringTokenizer st = new StringTokenizer(_spawnParams.trim(), ",");
+				final StringTokenizer st = new StringTokenizer(_spawnParams.trim(), ",");
 				
 				try
 				{
@@ -206,7 +201,7 @@ public class FortSiegeManager
 					int heading = Integer.parseInt(st.nextToken());
 					int npc_id = Integer.parseInt(st.nextToken());
 					
-					_commanderSpawns.add(new SiegeSpawn(fort.getFortId(), x, y, z, heading, npc_id, i));
+					_commanderSpawns.add(new FortSiegeSpawn(fort.getFortId(), x, y, z, heading, npc_id, i));
 				}
 				catch (Exception e)
 				{
@@ -218,12 +213,12 @@ public class FortSiegeManager
 			
 			for (int i = 1; i < 4; i++)
 			{
-				String _spawnParams = siegeSettings.getProperty(fort.getName().replace(" ", "") + "Flag" + i, "");
+				final String _spawnParams = siegeSettings.getProperty(fort.getName().replace(" ", "") + "Flag" + i, "");
 				if (_spawnParams.isEmpty())
 				{
 					break;
 				}
-				StringTokenizer st = new StringTokenizer(_spawnParams.trim(), ",");
+				final StringTokenizer st = new StringTokenizer(_spawnParams.trim(), ",");
 				
 				try
 				{
@@ -243,7 +238,7 @@ public class FortSiegeManager
 		}
 	}
 	
-	public final FastList<SiegeSpawn> getCommanderSpawnList(int _fortId)
+	public final FastList<FortSiegeSpawn> getCommanderSpawnList(int _fortId)
 	{
 		if (_commanderSpawnList.containsKey(_fortId))
 		{
@@ -338,9 +333,9 @@ public class FortSiegeManager
 			return false;
 		}
 		
-		Fort fort = FortManager.getInstance().getFort(player);
+		final Fort fort = FortManager.getInstance().getFort(player);
 		
-		FastList<CombatFlag> fcf = _flagList.get(fort.getFortId());
+		final FastList<CombatFlag> fcf = _flagList.get(fort.getFortId());
 		for (CombatFlag cf : fcf)
 		{
 			if (cf.getCombatFlagInstance() == item)
@@ -353,8 +348,7 @@ public class FortSiegeManager
 	
 	public boolean checkIfCanPickup(L2PcInstance player)
 	{
-		SystemMessage sm;
-		sm = SystemMessage.getSystemMessage(SystemMessageId.THE_FORTRESS_BATTLE_OF_S1_HAS_FINISHED);
+		final SystemMessage sm = SystemMessageId.THE_FORTRESS_BATTLE_OF_S1_HAS_FINISHED.getStaticSystemMessage();
 		sm.addItemName(9819);
 		// Cannot own 2 combat flag
 		if (player.isCombatFlagEquipped())
@@ -365,7 +359,7 @@ public class FortSiegeManager
 		
 		// here check if is siege is in progress
 		// here check if is siege is attacker
-		Fort fort = FortManager.getInstance().getFort(player);
+		final Fort fort = FortManager.getInstance().getFort(player);
 		
 		if ((fort == null) || (fort.getFortId() <= 0))
 		{
@@ -387,9 +381,9 @@ public class FortSiegeManager
 	
 	public void dropCombatFlag(L2PcInstance player, int fortId)
 	{
-		Fort fort = FortManager.getInstance().getFortById(fortId);
+		final Fort fort = FortManager.getInstance().getFortById(fortId);
 		
-		FastList<CombatFlag> fcf = _flagList.get(fort.getFortId());
+		final FastList<CombatFlag> fcf = _flagList.get(fort.getFortId());
 		
 		for (CombatFlag cf : fcf)
 		{
@@ -404,40 +398,9 @@ public class FortSiegeManager
 		}
 	}
 	
-	public static class SiegeSpawn
+	public static final FortSiegeManager getInstance()
 	{
-		Location _location;
-		private final int _npcId;
-		private final int _fortId;
-		private final int _id;
-		
-		public SiegeSpawn(int fort_id, int x, int y, int z, int heading, int npc_id, int id)
-		{
-			_fortId = fort_id;
-			_location = new Location(x, y, z, heading);
-			_npcId = npc_id;
-			_id = id;
-		}
-		
-		public int getFortId()
-		{
-			return _fortId;
-		}
-		
-		public int getNpcId()
-		{
-			return _npcId;
-		}
-		
-		public int getId()
-		{
-			return _id;
-		}
-		
-		public Location getLocation()
-		{
-			return _location;
-		}
+		return SingletonHolder._instance;
 	}
 	
 	private static class SingletonHolder

+ 142 - 234
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FourSepulchersManager.java

@@ -37,6 +37,10 @@ import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.datatables.DoorTable;
 import com.l2jserver.gameserver.datatables.NpcTable;
 import com.l2jserver.gameserver.datatables.SpawnTable;
+import com.l2jserver.gameserver.instancemanager.tasks.FourSepulchersChangeAttackTimeTask;
+import com.l2jserver.gameserver.instancemanager.tasks.FourSepulchersChangeCoolDownTimeTask;
+import com.l2jserver.gameserver.instancemanager.tasks.FourSepulchersChangeEntryTimeTask;
+import com.l2jserver.gameserver.instancemanager.tasks.FourSepulchersChangeWarmUpTimeTask;
 import com.l2jserver.gameserver.model.L2Spawn;
 import com.l2jserver.gameserver.model.actor.L2Npc;
 import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
@@ -60,9 +64,9 @@ import gnu.trove.map.hash.TIntObjectHashMap;
  * Zoey76: TODO: Use Location DTO instead of array of int.
  * @author sandman
  */
-public class FourSepulchersManager
+public final class FourSepulchersManager
 {
-	protected static final Logger _log = Logger.getLogger(FourSepulchersManager.class.getName());
+	private static final Logger _log = Logger.getLogger(FourSepulchersManager.class.getName());
 	
 	private static final int QUEST_ID = 620;
 	
@@ -71,17 +75,16 @@ public class FourSepulchersManager
 	private static final int CHAPEL_KEY = 7260;
 	private static final int ANTIQUE_BROOCH = 7262;
 	
-	protected boolean _firstTimeRun;
-	protected boolean _inEntryTime = false;
-	protected boolean _inWarmUpTime = false;
-	protected boolean _inAttackTime = false;
-	protected boolean _inCoolDownTime = false;
+	private boolean _firstTimeRun;
+	private boolean _inEntryTime = false;
+	private boolean _inWarmUpTime = false;
+	private boolean _inAttackTime = false;
+	private boolean _inCoolDownTime = false;
 	
-	protected ScheduledFuture<?> _changeCoolDownTimeTask = null;
-	protected ScheduledFuture<?> _changeEntryTimeTask = null;
-	protected ScheduledFuture<?> _changeWarmUpTimeTask = null;
-	protected ScheduledFuture<?> _changeAttackTimeTask = null;
-	protected ScheduledFuture<?> _onPartyAnnihilatedTask = null;
+	private ScheduledFuture<?> _changeCoolDownTimeTask = null;
+	private ScheduledFuture<?> _changeEntryTimeTask = null;
+	private ScheduledFuture<?> _changeWarmUpTimeTask = null;
+	private ScheduledFuture<?> _changeAttackTimeTask = null;
 	
 	// @formatter:off
 	private final int[][] _startHallSpawn =
@@ -146,12 +149,12 @@ public class FourSepulchersManager
 	protected FastList<L2Spawn> _emperorsGraveSpawns;
 	protected FastList<L2Npc> _allMobs = new FastList<>();
 	
-	protected long _attackTimeEnd = 0;
-	protected long _coolDownTimeEnd = 0;
-	protected long _entryTimeEnd = 0;
-	protected long _warmUpTimeEnd = 0;
+	private long _attackTimeEnd = 0;
+	private long _coolDownTimeEnd = 0;
+	private long _entryTimeEnd = 0;
+	private long _warmUpTimeEnd = 0;
 	
-	protected byte _newCycleMin = 55;
+	private final byte _newCycleMin = 55;
 	
 	public void init()
 	{
@@ -208,7 +211,7 @@ public class FourSepulchersManager
 		// check
 		{
 			clean();
-			_changeEntryTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeEntryTime(), 0);
+			_changeEntryTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeEntryTimeTask(), 0);
 			_log.info(getClass().getSimpleName() + ": Beginning in Entry time");
 		}
 		else if ((currentTime >= _entryTimeEnd) && (currentTime < _warmUpTimeEnd)) // warmup
@@ -216,7 +219,7 @@ public class FourSepulchersManager
 		// check
 		{
 			clean();
-			_changeWarmUpTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeWarmUpTime(), 0);
+			_changeWarmUpTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeWarmUpTimeTask(), 0);
 			_log.info(getClass().getSimpleName() + ": Beginning in WarmUp time");
 		}
 		else if ((currentTime >= _warmUpTimeEnd) && (currentTime < _attackTimeEnd)) // attack
@@ -224,14 +227,14 @@ public class FourSepulchersManager
 		// check
 		{
 			clean();
-			_changeAttackTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeAttackTime(), 0);
+			_changeAttackTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeAttackTimeTask(), 0);
 			_log.info(getClass().getSimpleName() + ": Beginning in Attack time");
 		}
 		else
 		// else cooldown time and without cleanup because it's already
 		// implemented
 		{
-			_changeCoolDownTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeCoolDownTime(), 0);
+			_changeCoolDownTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeCoolDownTimeTask(), 0);
 			_log.info(getClass().getSimpleName() + ": Beginning in Cooldown time");
 		}
 	}
@@ -817,9 +820,79 @@ public class FourSepulchersManager
 		}
 	}
 	
-	public boolean isEntryTime()
+	public ScheduledFuture<?> getChangeAttackTimeTask()
 	{
-		return _inEntryTime;
+		return _changeAttackTimeTask;
+	}
+	
+	public void setChangeAttackTimeTask(ScheduledFuture<?> task)
+	{
+		_changeAttackTimeTask = task;
+	}
+	
+	public ScheduledFuture<?> getChangeCoolDownTimeTask()
+	{
+		return _changeCoolDownTimeTask;
+	}
+	
+	public void setChangeCoolDownTimeTask(ScheduledFuture<?> task)
+	{
+		_changeCoolDownTimeTask = task;
+	}
+	
+	public ScheduledFuture<?> getChangeEntryTimeTask()
+	{
+		return _changeEntryTimeTask;
+	}
+	
+	public void setChangeEntryTimeTask(ScheduledFuture<?> task)
+	{
+		_changeEntryTimeTask = task;
+	}
+	
+	public ScheduledFuture<?> getChangeWarmUpTimeTask()
+	{
+		return _changeWarmUpTimeTask;
+	}
+	
+	public void setChangeWarmUpTimeTask(ScheduledFuture<?> task)
+	{
+		_changeWarmUpTimeTask = task;
+	}
+	
+	public long getAttackTimeEnd()
+	{
+		return _attackTimeEnd;
+	}
+	
+	public void setAttackTimeEnd(long attackTimeEnd)
+	{
+		_attackTimeEnd = attackTimeEnd;
+	}
+	
+	public byte getCycleMin()
+	{
+		return _newCycleMin;
+	}
+	
+	public long getEntrytTimeEnd()
+	{
+		return _entryTimeEnd;
+	}
+	
+	public void setEntryTimeEnd(long entryTimeEnd)
+	{
+		_entryTimeEnd = entryTimeEnd;
+	}
+	
+	public long getWarmUpTimeEnd()
+	{
+		return _warmUpTimeEnd;
+	}
+	
+	public void setWarmUpTimeEnd(long warmUpTimeEnd)
+	{
+		_warmUpTimeEnd = warmUpTimeEnd;
 	}
 	
 	public boolean isAttackTime()
@@ -827,6 +900,51 @@ public class FourSepulchersManager
 		return _inAttackTime;
 	}
 	
+	public void setIsAttackTime(boolean attackTime)
+	{
+		_inAttackTime = attackTime;
+	}
+	
+	public boolean isCoolDownTime()
+	{
+		return _inCoolDownTime;
+	}
+	
+	public void setIsCoolDownTime(boolean isCoolDownTime)
+	{
+		_inCoolDownTime = isCoolDownTime;
+	}
+	
+	public boolean isEntryTime()
+	{
+		return _inEntryTime;
+	}
+	
+	public void setIsEntryTime(boolean entryTime)
+	{
+		_inEntryTime = entryTime;
+	}
+	
+	public boolean isFirstTimeRun()
+	{
+		return _firstTimeRun;
+	}
+	
+	public void setIsFirstTimeRun(boolean isFirstTimeRun)
+	{
+		_firstTimeRun = isFirstTimeRun;
+	}
+	
+	public boolean isWarmUpTime()
+	{
+		return _inWarmUpTime;
+	}
+	
+	public void setIsWarmUpTime(boolean isWarmUpTime)
+	{
+		_inWarmUpTime = isWarmUpTime;
+	}
+	
 	public synchronized void tryEntry(L2Npc npc, L2PcInstance player)
 	{
 		Quest hostQuest = QuestManager.getInstance().getQuest(QUEST_ID);
@@ -1333,7 +1451,7 @@ public class FourSepulchersManager
 		}
 	}
 	
-	protected void locationShadowSpawns()
+	public void locationShadowSpawns()
 	{
 		int locNo = Rnd.get(4);
 		// _log.info("FourSepulchersManager.LocationShadowSpawns: Location index
@@ -1571,216 +1689,6 @@ public class FourSepulchersManager
 		}
 	}
 	
-	protected class ManagerSay implements Runnable
-	{
-		@Override
-		public void run()
-		{
-			if (_inAttackTime)
-			{
-				Calendar tmp = Calendar.getInstance();
-				tmp.setTimeInMillis(Calendar.getInstance().getTimeInMillis() - _warmUpTimeEnd);
-				if ((tmp.get(Calendar.MINUTE) + 5) < Config.FS_TIME_ATTACK)
-				{
-					managerSay((byte) tmp.get(Calendar.MINUTE)); // byte
-					// because
-					// minute
-					// cannot be
-					// more than
-					// 59
-					ThreadPoolManager.getInstance().scheduleGeneral(new ManagerSay(), 5 * 60000);
-				}
-				// attack time ending chat
-				else if ((tmp.get(Calendar.MINUTE) + 5) >= Config.FS_TIME_ATTACK)
-				{
-					managerSay((byte) 90); // sending a unique id :D
-				}
-			}
-			else if (_inEntryTime)
-			{
-				managerSay((byte) 0);
-			}
-		}
-	}
-	
-	protected class ChangeEntryTime implements Runnable
-	{
-		@Override
-		public void run()
-		{
-			// _log.info("FourSepulchersManager:In Entry Time");
-			_inEntryTime = true;
-			_inWarmUpTime = false;
-			_inAttackTime = false;
-			_inCoolDownTime = false;
-			
-			long interval = 0;
-			// if this is first launch - search time when entry time will be
-			// ended:
-			// counting difference between time when entry time ends and current
-			// time
-			// and then launching change time task
-			if (_firstTimeRun)
-			{
-				interval = _entryTimeEnd - Calendar.getInstance().getTimeInMillis();
-			}
-			else
-			{
-				interval = Config.FS_TIME_ENTRY * 60000L; // else use stupid
-				// method
-			}
-			
-			// launching saying process...
-			ThreadPoolManager.getInstance().scheduleGeneral(new ManagerSay(), 0);
-			_changeWarmUpTimeTask = ThreadPoolManager.getInstance().scheduleEffect(new ChangeWarmUpTime(), interval);
-			if (_changeEntryTimeTask != null)
-			{
-				_changeEntryTimeTask.cancel(true);
-				_changeEntryTimeTask = null;
-			}
-			
-		}
-	}
-	
-	protected class ChangeWarmUpTime implements Runnable
-	{
-		@Override
-		public void run()
-		{
-			// _log.info("FourSepulchersManager:In Warm-Up Time");
-			_inEntryTime = true;
-			_inWarmUpTime = false;
-			_inAttackTime = false;
-			_inCoolDownTime = false;
-			
-			long interval = 0;
-			// searching time when warmup time will be ended:
-			// counting difference between time when warmup time ends and
-			// current time
-			// and then launching change time task
-			if (_firstTimeRun)
-			{
-				interval = _warmUpTimeEnd - Calendar.getInstance().getTimeInMillis();
-			}
-			else
-			{
-				interval = Config.FS_TIME_WARMUP * 60000L;
-			}
-			_changeAttackTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeAttackTime(), interval);
-			
-			if (_changeWarmUpTimeTask != null)
-			{
-				_changeWarmUpTimeTask.cancel(true);
-				_changeWarmUpTimeTask = null;
-			}
-		}
-	}
-	
-	protected class ChangeAttackTime implements Runnable
-	{
-		@Override
-		public void run()
-		{
-			// _log.info("FourSepulchersManager:In Attack Time");
-			_inEntryTime = false;
-			_inWarmUpTime = false;
-			_inAttackTime = true;
-			_inCoolDownTime = false;
-			
-			locationShadowSpawns();
-			
-			spawnMysteriousBox(31921);
-			spawnMysteriousBox(31922);
-			spawnMysteriousBox(31923);
-			spawnMysteriousBox(31924);
-			
-			if (!_firstTimeRun)
-			{
-				_warmUpTimeEnd = Calendar.getInstance().getTimeInMillis();
-			}
-			
-			long interval = 0;
-			// say task
-			if (_firstTimeRun)
-			{
-				for (double min = Calendar.getInstance().get(Calendar.MINUTE); min < _newCycleMin; min++)
-				{
-					// looking for next shout time....
-					if ((min % 5) == 0)// check if min can be divided by 5
-					{
-						_log.info(getClass().getSimpleName() + ": " + Calendar.getInstance().getTime() + " Atk announce scheduled to " + min + " minute of this hour.");
-						Calendar inter = Calendar.getInstance();
-						inter.set(Calendar.MINUTE, (int) min);
-						ThreadPoolManager.getInstance().scheduleGeneral(new ManagerSay(), inter.getTimeInMillis() - Calendar.getInstance().getTimeInMillis());
-						break;
-					}
-				}
-			}
-			else
-			{
-				ThreadPoolManager.getInstance().scheduleGeneral(new ManagerSay(), 5 * 60400);
-			}
-			// searching time when attack time will be ended:
-			// counting difference between time when attack time ends and
-			// current time
-			// and then launching change time task
-			if (_firstTimeRun)
-			{
-				interval = _attackTimeEnd - Calendar.getInstance().getTimeInMillis();
-			}
-			else
-			{
-				interval = Config.FS_TIME_ATTACK * 60000L;
-			}
-			_changeCoolDownTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeCoolDownTime(), interval);
-			
-			if (_changeAttackTimeTask != null)
-			{
-				_changeAttackTimeTask.cancel(true);
-				_changeAttackTimeTask = null;
-			}
-		}
-	}
-	
-	protected class ChangeCoolDownTime implements Runnable
-	{
-		@Override
-		public void run()
-		{
-			// _log.info("FourSepulchersManager:In Cool-Down Time");
-			_inEntryTime = false;
-			_inWarmUpTime = false;
-			_inAttackTime = false;
-			_inCoolDownTime = true;
-			
-			clean();
-			
-			Calendar time = Calendar.getInstance();
-			// one hour = 55th min to 55 min of next hour, so we check for this,
-			// also check for first launch
-			if ((Calendar.getInstance().get(Calendar.MINUTE) > _newCycleMin) && !_firstTimeRun)
-			{
-				time.set(Calendar.HOUR, Calendar.getInstance().get(Calendar.HOUR) + 1);
-			}
-			time.set(Calendar.MINUTE, _newCycleMin);
-			_log.info(getClass().getSimpleName() + ": Entry time: " + time.getTime());
-			if (_firstTimeRun)
-			{
-				_firstTimeRun = false; // cooldown phase ends event hour, so it
-				// will be not first run
-			}
-			
-			long interval = time.getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
-			_changeEntryTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeEntryTime(), interval);
-			
-			if (_changeCoolDownTimeTask != null)
-			{
-				_changeCoolDownTimeTask.cancel(true);
-				_changeCoolDownTimeTask = null;
-			}
-		}
-	}
-	
 	public TIntIntHashMap getHallGateKeepers()
 	{
 		return _hallGateKeepers;

+ 13 - 26
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/WalkingManager.java

@@ -29,6 +29,7 @@ import org.w3c.dom.Node;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.engines.DocumentParser;
+import com.l2jserver.gameserver.instancemanager.tasks.StartMovingTask;
 import com.l2jserver.gameserver.model.L2NpcWalkerNode;
 import com.l2jserver.gameserver.model.L2WalkRoute;
 import com.l2jserver.gameserver.model.Location;
@@ -47,7 +48,7 @@ import com.l2jserver.gameserver.util.Broadcast;
  * This class manages walking monsters.
  * @author GKR
  */
-public class WalkingManager extends DocumentParser
+public final class WalkingManager extends DocumentParser
 {
 	// Repeat style:
 	// 0 - go back
@@ -206,7 +207,7 @@ public class WalkingManager extends DocumentParser
 			return false;
 		}
 		
-		WalkInfo walk = monster != null ? _activeRoutes.get(monster.getObjectId()) : _activeRoutes.get(npc.getObjectId());
+		final WalkInfo walk = monster != null ? _activeRoutes.get(monster.getObjectId()) : _activeRoutes.get(npc.getObjectId());
 		if (walk.isStoppedByAttack() || walk.isSuspended())
 		{
 			return false;
@@ -251,7 +252,7 @@ public class WalkingManager extends DocumentParser
 				// only if not already moved / not engaged in battle... should not happens if called on spawn
 				if ((npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE) || (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE))
 				{
-					WalkInfo walk = new WalkInfo(routeName);
+					final WalkInfo walk = new WalkInfo(routeName);
 					
 					if (npc.isDebug())
 					{
@@ -270,7 +271,7 @@ public class WalkingManager extends DocumentParser
 					
 					if (!npc.isInsideRadius(node, 3000, true, false))
 					{
-						String message = "Route '" + routeName + "': NPC (id=" + npc.getNpcId() + ", x=" + npc.getX() + ", y=" + npc.getY() + ", z=" + npc.getZ() + ") is too far from starting point (node x=" + node.getX() + ", y=" + node.getY() + ", z=" + node.getZ() + ", range=" + npc.getDistanceSq(node.getX(), node.getY(), node.getZ()) + "), walking will not start";
+						final String message = "Route '" + routeName + "': NPC (id=" + npc.getNpcId() + ", x=" + npc.getX() + ", y=" + npc.getY() + ", z=" + npc.getZ() + ") is too far from starting point (node x=" + node.getX() + ", y=" + node.getY() + ", z=" + node.getZ() + ", range=" + npc.getDistanceSq(node.getX(), node.getY(), node.getZ()) + "), walking will not start";
 						_log.warning(getClass().getSimpleName() + ": " + message);
 						npc.sendDebugMessage(message);
 						return;
@@ -279,14 +280,7 @@ public class WalkingManager extends DocumentParser
 					npc.sendDebugMessage("Starting to move at route '" + routeName + "'");
 					npc.setIsRunning(node.runToLocation());
 					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node);
-					walk.setWalkCheckTask(ThreadPoolManager.getInstance().scheduleAiAtFixedRate(new Runnable()
-					{
-						@Override
-						public void run()
-						{
-							startMoving(npc, routeName);
-						}
-					}, 60000, 60000)); // start walk check task, for resuming walk after fight
+					walk.setWalkCheckTask(ThreadPoolManager.getInstance().scheduleAiAtFixedRate(new StartMovingTask(npc, routeName), 60000, 60000)); // start walk check task, for resuming walk after fight
 					
 					npc.getKnownList().startTrackingTask();
 					
@@ -295,14 +289,7 @@ public class WalkingManager extends DocumentParser
 				else
 				{
 					npc.sendDebugMessage("Failed to start moving along route '" + routeName + "', scheduled");
-					ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
-					{
-						@Override
-						public void run()
-						{
-							startMoving(npc, routeName);
-						}
-					}, 60000);
+					ThreadPoolManager.getInstance().scheduleGeneral(new StartMovingTask(npc, routeName), 60000);
 				}
 			}
 			else
@@ -310,7 +297,7 @@ public class WalkingManager extends DocumentParser
 			{
 				if (_activeRoutes.containsKey(npc.getObjectId()) && ((npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE) || (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)))
 				{
-					WalkInfo walk = _activeRoutes.get(npc.getObjectId());
+					final WalkInfo walk = _activeRoutes.get(npc.getObjectId());
 					if (walk == null)
 					{
 						return;
@@ -324,7 +311,7 @@ public class WalkingManager extends DocumentParser
 					}
 					
 					walk.setBlocked(true);
-					L2NpcWalkerNode node = walk.getCurrentNode();
+					final L2NpcWalkerNode node = walk.getCurrentNode();
 					npc.sendDebugMessage("Route '" + routeName + "', continuing to node " + walk.getCurrentNodeId());
 					npc.setIsRunning(node.runToLocation());
 					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, node);
@@ -364,7 +351,7 @@ public class WalkingManager extends DocumentParser
 			return;
 		}
 		
-		WalkInfo walk = _activeRoutes.get(npc.getObjectId());
+		final WalkInfo walk = _activeRoutes.get(npc.getObjectId());
 		walk.setSuspended(false);
 		walk.setStoppedByAttack(false);
 		startMoving(npc, walk.getRoute().getName());
@@ -397,7 +384,7 @@ public class WalkingManager extends DocumentParser
 			return;
 		}
 		
-		WalkInfo walk = monster != null ? _activeRoutes.get(monster.getObjectId()) : _activeRoutes.get(npc.getObjectId());
+		final WalkInfo walk = monster != null ? _activeRoutes.get(monster.getObjectId()) : _activeRoutes.get(npc.getObjectId());
 		
 		walk.setSuspended(suspend);
 		walk.setStoppedByAttack(stoppedByAttack);
@@ -431,12 +418,12 @@ public class WalkingManager extends DocumentParser
 				}
 			}
 			
-			WalkInfo walk = _activeRoutes.get(npc.getObjectId());
+			final WalkInfo walk = _activeRoutes.get(npc.getObjectId());
 			
 			// Opposite should not happen... but happens sometime
 			if ((walk.getCurrentNodeId() >= 0) && (walk.getCurrentNodeId() < walk.getRoute().getNodesCount()))
 			{
-				L2NpcWalkerNode node = walk.getRoute().getNodeList().get(walk.getCurrentNodeId());
+				final L2NpcWalkerNode node = walk.getRoute().getNodeList().get(walk.getCurrentNodeId());
 				if (npc.isInsideRadius(node, 10, false, false))
 				{
 					npc.sendDebugMessage("Route '" + walk.getRoute().getName() + "', arrived to node " + walk.getCurrentNodeId());

+ 96 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/tasks/FourSepulchersChangeAttackTimeTask.java

@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2004-2013 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server 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.
+ * 
+ * L2J Server 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 com.l2jserver.gameserver.instancemanager.tasks;
+
+import java.util.Calendar;
+import java.util.concurrent.ScheduledFuture;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.instancemanager.FourSepulchersManager;
+
+/**
+ * @author xban1x
+ */
+public final class FourSepulchersChangeAttackTimeTask implements Runnable
+{
+	@Override
+	public void run()
+	{
+		final FourSepulchersManager manager = FourSepulchersManager.getInstance();
+		manager.setIsEntryTime(false);
+		manager.setIsWarmUpTime(false);
+		manager.setIsAttackTime(true);
+		manager.setIsCoolDownTime(false);
+		
+		manager.locationShadowSpawns();
+		
+		manager.spawnMysteriousBox(31921);
+		manager.spawnMysteriousBox(31922);
+		manager.spawnMysteriousBox(31923);
+		manager.spawnMysteriousBox(31924);
+		
+		if (!manager.isFirstTimeRun())
+		{
+			manager.setWarmUpTimeEnd(Calendar.getInstance().getTimeInMillis());
+		}
+		
+		long interval = 0;
+		// say task
+		if (manager.isFirstTimeRun())
+		{
+			for (double min = Calendar.getInstance().get(Calendar.MINUTE); min < manager.getCycleMin(); min++)
+			{
+				// looking for next shout time....
+				if ((min % 5) == 0)// check if min can be divided by 5
+				{
+					final Calendar inter = Calendar.getInstance();
+					inter.set(Calendar.MINUTE, (int) min);
+					ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersManagerSay(), inter.getTimeInMillis() - Calendar.getInstance().getTimeInMillis());
+					break;
+				}
+			}
+		}
+		else
+		{
+			ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersManagerSay(), 5 * 60400);
+		}
+		// searching time when attack time will be ended:
+		// counting difference between time when attack time ends and
+		// current time
+		// and then launching change time task
+		if (manager.isFirstTimeRun())
+		{
+			interval = manager.getAttackTimeEnd() - Calendar.getInstance().getTimeInMillis();
+		}
+		else
+		{
+			interval = Config.FS_TIME_ATTACK * 60000L;
+		}
+		
+		manager.setChangeCoolDownTimeTask(ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeCoolDownTimeTask(), interval));
+		final ScheduledFuture<?> changeAttackTimeTask = manager.getChangeAttackTimeTask();
+		
+		if (changeAttackTimeTask != null)
+		{
+			changeAttackTimeTask.cancel(true);
+			manager.setChangeAttackTimeTask(null);
+		}
+	}
+}

+ 67 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/tasks/FourSepulchersChangeCoolDownTimeTask.java

@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2004-2013 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server 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.
+ * 
+ * L2J Server 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 com.l2jserver.gameserver.instancemanager.tasks;
+
+import java.util.Calendar;
+import java.util.concurrent.ScheduledFuture;
+
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.instancemanager.FourSepulchersManager;
+
+/**
+ * @author xban1x
+ */
+public final class FourSepulchersChangeCoolDownTimeTask implements Runnable
+{
+	@Override
+	public void run()
+	{
+		final FourSepulchersManager manager = FourSepulchersManager.getInstance();
+		manager.setIsEntryTime(false);
+		manager.setIsWarmUpTime(false);
+		manager.setIsAttackTime(false);
+		manager.setIsCoolDownTime(true);
+		
+		manager.clean();
+		
+		final Calendar time = Calendar.getInstance();
+		// one hour = 55th min to 55 min of next hour, so we check for this,
+		// also check for first launch
+		if (!manager.isFirstTimeRun() && (Calendar.getInstance().get(Calendar.MINUTE) > manager.getCycleMin()))
+		{
+			time.set(Calendar.HOUR, Calendar.getInstance().get(Calendar.HOUR) + 1);
+		}
+		time.set(Calendar.MINUTE, manager.getCycleMin());
+		if (manager.isFirstTimeRun())
+		{
+			manager.setIsFirstTimeRun(false);
+		}
+		
+		long interval = time.getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
+		
+		manager.setChangeEntryTimeTask(ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeEntryTimeTask(), interval));
+		final ScheduledFuture<?> changeCoolDownTimeTask = manager.getChangeCoolDownTimeTask();
+		
+		if (changeCoolDownTimeTask != null)
+		{
+			changeCoolDownTimeTask.cancel(true);
+			manager.setChangeCoolDownTimeTask(null);
+		}
+	}
+}

+ 69 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/tasks/FourSepulchersChangeEntryTimeTask.java

@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2004-2013 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server 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.
+ * 
+ * L2J Server 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 com.l2jserver.gameserver.instancemanager.tasks;
+
+import java.util.Calendar;
+import java.util.concurrent.ScheduledFuture;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.instancemanager.FourSepulchersManager;
+
+/**
+ * @author xban1x
+ */
+public final class FourSepulchersChangeEntryTimeTask implements Runnable
+{
+	@Override
+	public void run()
+	{
+		final FourSepulchersManager manager = FourSepulchersManager.getInstance();
+		manager.setIsEntryTime(true);
+		manager.setIsWarmUpTime(false);
+		manager.setIsAttackTime(false);
+		manager.setIsCoolDownTime(false);
+		
+		long interval = 0;
+		// if this is first launch - search time whFourSepulchersManager_inEntryTime = true;naFourSepulchersManager_inEntryTime = true;maen entry time will be
+		// ended:
+		// counting difference between time when entry time ends and current
+		// time
+		// and then launching change time task
+		if (manager.isFirstTimeRun())
+		{
+			interval = manager.getEntrytTimeEnd() - Calendar.getInstance().getTimeInMillis();
+		}
+		else
+		{
+			interval = Config.FS_TIME_ENTRY * 60000L; // else use stupid
+			// method
+		}
+		
+		// launching saying process...
+		ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersManagerSay(), 0);
+		manager.setChangeWarmUpTimeTask(ThreadPoolManager.getInstance().scheduleEffect(new FourSepulchersChangeWarmUpTimeTask(), interval));
+		final ScheduledFuture<?> changeEntryTimeTask = manager.getChangeEntryTimeTask();
+		
+		if (changeEntryTimeTask != null)
+		{
+			changeEntryTimeTask.cancel(true);
+			manager.setChangeEntryTimeTask(null);
+		}
+	}
+}

+ 65 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/tasks/FourSepulchersChangeWarmUpTimeTask.java

@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2004-2013 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server 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.
+ * 
+ * L2J Server 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 com.l2jserver.gameserver.instancemanager.tasks;
+
+import java.util.Calendar;
+import java.util.concurrent.ScheduledFuture;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.instancemanager.FourSepulchersManager;
+
+/**
+ * @author xban1x
+ */
+public final class FourSepulchersChangeWarmUpTimeTask implements Runnable
+{
+	@Override
+	public void run()
+	{
+		final FourSepulchersManager manager = FourSepulchersManager.getInstance();
+		manager.setIsEntryTime(true);
+		manager.setIsWarmUpTime(false);
+		manager.setIsAttackTime(false);
+		manager.setIsCoolDownTime(false);
+		
+		long interval = 0;
+		// searching time when warmup time will be ended:
+		// counting difference between time when warmup time ends and
+		// current time
+		// and then launching change time task
+		if (manager.isFirstTimeRun())
+		{
+			interval = manager.getWarmUpTimeEnd() - Calendar.getInstance().getTimeInMillis();
+		}
+		else
+		{
+			interval = Config.FS_TIME_WARMUP * 60000L;
+		}
+		
+		manager.setChangeAttackTimeTask(ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeAttackTimeTask(), interval));
+		final ScheduledFuture<?> changeWarmUpTimeTask = manager.getChangeWarmUpTimeTask();
+		
+		if (changeWarmUpTimeTask != null)
+		{
+			changeWarmUpTimeTask.cancel(true);
+			manager.setChangeWarmUpTimeTask(null);
+		}
+	}
+}

+ 60 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/tasks/FourSepulchersManagerSay.java

@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2004-2013 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server 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.
+ * 
+ * L2J Server 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 com.l2jserver.gameserver.instancemanager.tasks;
+
+import java.util.Calendar;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.instancemanager.FourSepulchersManager;
+
+/**
+ * @author xban1x
+ */
+public final class FourSepulchersManagerSay implements Runnable
+{
+	@Override
+	public void run()
+	{
+		if (FourSepulchersManager.getInstance().isAttackTime())
+		{
+			final Calendar tmp = Calendar.getInstance();
+			tmp.setTimeInMillis(Calendar.getInstance().getTimeInMillis() - FourSepulchersManager.getInstance().getWarmUpTimeEnd());
+			if ((tmp.get(Calendar.MINUTE) + 5) < Config.FS_TIME_ATTACK)
+			{
+				FourSepulchersManager.getInstance().managerSay((byte) tmp.get(Calendar.MINUTE)); // byte
+				// because
+				// minute
+				// cannot be
+				// more than
+				// 59
+				ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersManagerSay(), 5 * 60000);
+			}
+			// attack time ending chat
+			else if ((tmp.get(Calendar.MINUTE) + 5) >= Config.FS_TIME_ATTACK)
+			{
+				FourSepulchersManager.getInstance().managerSay((byte) 90); // sending a unique id :D
+			}
+		}
+		else if (FourSepulchersManager.getInstance().isEntryTime())
+		{
+			FourSepulchersManager.getInstance().managerSay((byte) 0);
+		}
+	}
+}

+ 47 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/tasks/StartMovingTask.java

@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2004-2013 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server 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.
+ * 
+ * L2J Server 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 com.l2jserver.gameserver.instancemanager.tasks;
+
+import com.l2jserver.gameserver.instancemanager.WalkingManager;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+
+/**
+ * Task which starts npc movement.
+ * @author xban1x
+ */
+public final class StartMovingTask implements Runnable
+{
+	final L2Npc _npc;
+	final String _routeName;
+	
+	public StartMovingTask(L2Npc npc, String routeName)
+	{
+		_npc = npc;
+		_routeName = routeName;
+	}
+	
+	@Override
+	public void run()
+	{
+		if (_npc != null)
+		{
+			WalkingManager.getInstance().startMoving(_npc, _routeName);
+		}
+	}
+}

+ 52 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/AirShipTeleportList.java

@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2004-2013 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server 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.
+ * 
+ * L2J Server 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 com.l2jserver.gameserver.model;
+
+/**
+ * Holds a list of all AirShip teleports.
+ * @author xban1x
+ */
+public final class AirShipTeleportList
+{
+	private final int _location;
+	private final int[] _fuel;
+	private final VehiclePathPoint[][] _routes;
+	
+	public AirShipTeleportList(int loc, int[] f, VehiclePathPoint[][] r)
+	{
+		_location = loc;
+		_fuel = f;
+		_routes = r;
+	}
+	
+	public int getLocation()
+	{
+		return _location;
+	}
+	
+	public int[] getFuel()
+	{
+		return _fuel;
+	}
+	
+	public VehiclePathPoint[][] getRoute()
+	{
+		return _routes;
+	}
+}

+ 80 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/CropProcure.java

@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2004-2013 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server 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.
+ * 
+ * L2J Server 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 com.l2jserver.gameserver.model;
+
+/**
+ * @author xban1x
+ */
+public final class CropProcure
+{
+	final int _cropId;
+	long _buyResidual;
+	final int _rewardType;
+	final long _buy;
+	final long _price;
+	
+	public CropProcure(int id)
+	{
+		_cropId = id;
+		_buyResidual = 0;
+		_rewardType = 0;
+		_buy = 0;
+		_price = 0;
+	}
+	
+	public CropProcure(int id, long amount, int type, long buy, long price)
+	{
+		_cropId = id;
+		_buyResidual = amount;
+		_rewardType = type;
+		_buy = buy;
+		_price = price;
+	}
+	
+	public int getReward()
+	{
+		return _rewardType;
+	}
+	
+	public int getId()
+	{
+		return _cropId;
+	}
+	
+	public long getAmount()
+	{
+		return _buyResidual;
+	}
+	
+	public long getStartAmount()
+	{
+		return _buy;
+	}
+	
+	public long getPrice()
+	{
+		return _price;
+	}
+	
+	public void setAmount(long amount)
+	{
+		_buyResidual = amount;
+	}
+	
+}

+ 163 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/DimensionalRiftRoom.java

@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2004-2013 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server 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.
+ * 
+ * L2J Server 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 com.l2jserver.gameserver.model;
+
+import java.awt.Polygon;
+import java.awt.Shape;
+
+import javolution.util.FastList;
+
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.util.Rnd;
+
+/**
+ * Dimensional Rift Room.
+ * @author xban1x
+ */
+public final class DimensionalRiftRoom
+{
+	private final byte _type;
+	private final byte _room;
+	private final int _xMin;
+	private final int _xMax;
+	private final int _yMin;
+	private final int _yMax;
+	private final int _zMin;
+	private final int _zMax;
+	private final int[] _teleportCoords;
+	private final Shape _s;
+	private final boolean _isBossRoom;
+	private final FastList<L2Spawn> _roomSpawns;
+	protected final FastList<L2Npc> _roomMobs;
+	private boolean _partyInside = false;
+	
+	public DimensionalRiftRoom(byte type, byte room, int xMin, int xMax, int yMin, int yMax, int zMin, int zMax, int xT, int yT, int zT, boolean isBossRoom)
+	{
+		_type = type;
+		_room = room;
+		_xMin = (xMin + 128);
+		_xMax = (xMax - 128);
+		_yMin = (yMin + 128);
+		_yMax = (yMax - 128);
+		_zMin = zMin;
+		_zMax = zMax;
+		_teleportCoords = new int[]
+		{
+			xT,
+			yT,
+			zT
+		};
+		_isBossRoom = isBossRoom;
+		_roomSpawns = new FastList<>();
+		_roomMobs = new FastList<>();
+		_s = new Polygon(new int[]
+		{
+			xMin,
+			xMax,
+			xMax,
+			xMin
+		}, new int[]
+		{
+			yMin,
+			yMin,
+			yMax,
+			yMax
+		}, 4);
+	}
+	
+	public byte getType()
+	{
+		return _type;
+	}
+	
+	public byte getRoom()
+	{
+		return _room;
+	}
+	
+	public int getRandomX()
+	{
+		return Rnd.get(_xMin, _xMax);
+	}
+	
+	public int getRandomY()
+	{
+		return Rnd.get(_yMin, _yMax);
+	}
+	
+	public int[] getTeleportCoorinates()
+	{
+		return _teleportCoords;
+	}
+	
+	public boolean checkIfInZone(int x, int y, int z)
+	{
+		return _s.contains(x, y) && (z >= _zMin) && (z <= _zMax);
+	}
+	
+	public boolean isBossRoom()
+	{
+		return _isBossRoom;
+	}
+	
+	public FastList<L2Spawn> getSpawns()
+	{
+		return _roomSpawns;
+	}
+	
+	public void spawn()
+	{
+		for (L2Spawn spawn : _roomSpawns)
+		{
+			spawn.doSpawn();
+			spawn.startRespawn();
+		}
+	}
+	
+	public DimensionalRiftRoom unspawn()
+	{
+		for (L2Spawn spawn : _roomSpawns)
+		{
+			spawn.stopRespawn();
+			if (spawn.getLastSpawn() != null)
+			{
+				spawn.getLastSpawn().deleteMe();
+			}
+		}
+		return this;
+	}
+	
+	/**
+	 * Returns if party is inside the room.
+	 * @return {@code true} if there is a party inside, {@code false} otherwise
+	 */
+	public boolean isPartyInside()
+	{
+		return _partyInside;
+	}
+	
+	/**
+	 * Sets the party inside.
+	 * @param partyInside
+	 */
+	public void setPartyInside(boolean partyInside)
+	{
+		_partyInside = partyInside;
+	}
+}

+ 53 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/FortSiegeSpawn.java

@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2004-2013 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server 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.
+ * 
+ * L2J Server 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 com.l2jserver.gameserver.model;
+
+/**
+ * Fort Siege Spawn.
+ * @author xban1x
+ */
+public final class FortSiegeSpawn extends Location
+{
+	private final int _npcId;
+	private final int _fortId;
+	private final int _id;
+	
+	public FortSiegeSpawn(int fort_id, int x, int y, int z, int heading, int npc_id, int id)
+	{
+		super(x, y, z, heading);
+		_fortId = fort_id;
+		_npcId = npc_id;
+		_id = id;
+	}
+	
+	public int getFortId()
+	{
+		return _fortId;
+	}
+	
+	public int getNpcId()
+	{
+		return _npcId;
+	}
+	
+	public int getId()
+	{
+		return _id;
+	}
+}

+ 71 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/SeedProduction.java

@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2004-2013 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server 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.
+ * 
+ * L2J Server 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 com.l2jserver.gameserver.model;
+
+/**
+ * @author xban1x
+ */
+public final class SeedProduction
+{
+	final int _seedId;
+	long _residual;
+	final long _price;
+	final long _sales;
+	
+	public SeedProduction(int id)
+	{
+		_seedId = id;
+		_residual = 0;
+		_price = 0;
+		_sales = 0;
+	}
+	
+	public SeedProduction(int id, long amount, long price, long sales)
+	{
+		_seedId = id;
+		_residual = amount;
+		_price = price;
+		_sales = sales;
+	}
+	
+	public int getId()
+	{
+		return _seedId;
+	}
+	
+	public long getCanProduce()
+	{
+		return _residual;
+	}
+	
+	public long getPrice()
+	{
+		return _price;
+	}
+	
+	public long getStartProduce()
+	{
+		return _sales;
+	}
+	
+	public void setCanProduce(long amount)
+	{
+		_residual = amount;
+	}
+}

+ 21 - 18
L2J_Server_BETA/java/com/l2jserver/gameserver/model/VehiclePathPoint.java

@@ -18,29 +18,32 @@
  */
 package com.l2jserver.gameserver.model;
 
-public class VehiclePathPoint
+public final class VehiclePathPoint extends Location
 {
-	public int x;
-	public int y;
-	public int z;
-	public int moveSpeed;
-	public int rotationSpeed;
+	private final int _moveSpeed;
+	private final int _rotationSpeed;
 	
-	public VehiclePathPoint(int _x, int _y, int _z)
+	public VehiclePathPoint(int x, int y, int z)
 	{
-		x = _x;
-		y = _y;
-		z = _z;
-		moveSpeed = 350;
-		rotationSpeed = 4000;
+		super(x, y, z);
+		_moveSpeed = 350;
+		_rotationSpeed = 4000;
 	}
 	
-	public VehiclePathPoint(int _x, int _y, int _z, int _m, int _r)
+	public VehiclePathPoint(int x, int y, int z, int moveSpeed, int rotationSpeed)
 	{
-		x = _x;
-		y = _y;
-		z = _z;
-		moveSpeed = _m;
-		rotationSpeed = _r;
+		super(x, y, z);
+		_moveSpeed = moveSpeed;
+		_rotationSpeed = rotationSpeed;
+	}
+	
+	public int getMoveSpeed()
+	{
+		return _moveSpeed;
+	}
+	
+	public int getRotationSpeed()
+	{
+		return _rotationSpeed;
 	}
 }

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -719,7 +719,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
 			{
 				player.getParty().getDimensionalRift().usedTeleport(player);
 			}
-			int[] newCoords = DimensionalRiftManager.getInstance().getRoom((byte) 0, (byte) 0).getTeleportCoords();
+			int[] newCoords = DimensionalRiftManager.getInstance().getRoom((byte) 0, (byte) 0).getTeleportCoorinates();
 			x = newCoords[0];
 			y = newCoords[1];
 			z = newCoords[2];

+ 17 - 17
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Vehicle.java

@@ -102,16 +102,16 @@ public abstract class L2Vehicle extends L2Character
 		if ((_currentPath != null) && (_currentPath.length > 0))
 		{
 			final VehiclePathPoint point = _currentPath[0];
-			if (point.moveSpeed > 0)
+			if (point.getMoveSpeed() > 0)
 			{
-				getStat().setMoveSpeed(point.moveSpeed);
+				getStat().setMoveSpeed(point.getMoveSpeed());
 			}
-			if (point.rotationSpeed > 0)
+			if (point.getRotationSpeed() > 0)
 			{
-				getStat().setRotationSpeed(point.rotationSpeed);
+				getStat().setRotationSpeed(point.getRotationSpeed());
 			}
 			
-			getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(point.x, point.y, point.z, 0));
+			getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(point.getX(), point.getY(), point.getZ(), 0));
 			return;
 		}
 		getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
@@ -130,36 +130,36 @@ public abstract class L2Vehicle extends L2Character
 				final VehiclePathPoint point = _currentPath[_runState];
 				if (!isMovementDisabled())
 				{
-					if (point.moveSpeed == 0)
+					if (point.getMoveSpeed() == 0)
 					{
-						teleToLocation(point.x, point.y, point.z, point.rotationSpeed, false);
+						teleToLocation(point.getX(), point.getY(), point.getZ(), point.getRotationSpeed(), false);
 						_currentPath = null;
 					}
 					else
 					{
-						if (point.moveSpeed > 0)
+						if (point.getMoveSpeed() > 0)
 						{
-							getStat().setMoveSpeed(point.moveSpeed);
+							getStat().setMoveSpeed(point.getMoveSpeed());
 						}
-						if (point.rotationSpeed > 0)
+						if (point.getRotationSpeed() > 0)
 						{
-							getStat().setRotationSpeed(point.rotationSpeed);
+							getStat().setRotationSpeed(point.getRotationSpeed());
 						}
 						
 						MoveData m = new MoveData();
 						m.disregardingGeodata = false;
 						m.onGeodataPathIndex = -1;
-						m._xDestination = point.x;
-						m._yDestination = point.y;
-						m._zDestination = point.z;
+						m._xDestination = point.getX();
+						m._yDestination = point.getY();
+						m._zDestination = point.getZ();
 						m._heading = 0;
 						
-						final double dx = point.x - getX();
-						final double dy = point.y - getY();
+						final double dx = point.getX() - getX();
+						final double dy = point.getY() - getY();
 						final double distance = Math.sqrt((dx * dx) + (dy * dy));
 						if (distance > 1)
 						{
-							setHeading(Util.calculateHeadingFrom(getX(), getY(), point.x, point.y));
+							setHeading(Util.calculateHeadingFrom(getX(), getY(), point.getX(), point.getY()));
 						}
 						
 						m._moveStartTime = GameTimeController.getInstance().getGameTicks();

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2FortCommanderInstance.java

@@ -24,7 +24,7 @@ import com.l2jserver.Config;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.instancemanager.FortSiegeManager;
-import com.l2jserver.gameserver.instancemanager.FortSiegeManager.SiegeSpawn;
+import com.l2jserver.gameserver.model.FortSiegeSpawn;
 import com.l2jserver.gameserver.model.L2Spawn;
 import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.L2Summon;
@@ -123,8 +123,8 @@ public class L2FortCommanderInstance extends L2DefenderInstance
 		L2Spawn spawn = getSpawn();
 		if ((spawn != null) && canTalk())
 		{
-			FastList<SiegeSpawn> commanders = FortSiegeManager.getInstance().getCommanderSpawnList(getFort().getFortId());
-			for (SiegeSpawn spawn2 : commanders)
+			FastList<FortSiegeSpawn> commanders = FortSiegeManager.getInstance().getCommanderSpawnList(getFort().getFortId());
+			for (FortSiegeSpawn spawn2 : commanders)
 			{
 				if (spawn2.getNpcId() == spawn.getNpcid())
 				{

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Castle.java

@@ -41,16 +41,16 @@ import com.l2jserver.gameserver.datatables.SkillTable;
 import com.l2jserver.gameserver.datatables.SkillTreesData;
 import com.l2jserver.gameserver.instancemanager.CastleManager;
 import com.l2jserver.gameserver.instancemanager.CastleManorManager;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.CropProcure;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.SeedProduction;
 import com.l2jserver.gameserver.instancemanager.FortManager;
 import com.l2jserver.gameserver.instancemanager.SiegeManager;
 import com.l2jserver.gameserver.instancemanager.TerritoryWarManager;
 import com.l2jserver.gameserver.instancemanager.TerritoryWarManager.Territory;
 import com.l2jserver.gameserver.instancemanager.ZoneManager;
+import com.l2jserver.gameserver.model.CropProcure;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.L2Object;
 import com.l2jserver.gameserver.model.L2SkillLearn;
+import com.l2jserver.gameserver.model.SeedProduction;
 import com.l2jserver.gameserver.model.TowerSpawn;
 import com.l2jserver.gameserver.model.actor.instance.L2ArtefactInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/DimensionalRift.java

@@ -316,7 +316,7 @@ public class DimensionalRift
 				}
 				_choosenRoom = emptyRooms.get(Rnd.get(1, emptyRooms.size()) - 1);
 			}
-			while (DimensionalRiftManager.getInstance().getRoom(_type, _choosenRoom).ispartyInside());
+			while (DimensionalRiftManager.getInstance().getRoom(_type, _choosenRoom).isPartyInside());
 		}
 		
 		DimensionalRiftManager.getInstance().getRoom(_type, _choosenRoom).setPartyInside(true);
@@ -475,7 +475,7 @@ public class DimensionalRift
 	
 	public int[] getRoomCoord(byte room)
 	{
-		return DimensionalRiftManager.getInstance().getRoom(_type, room).getTeleportCoords();
+		return DimensionalRiftManager.getInstance().getRoom(_type, room).getTeleportCoorinates();
 	}
 	
 	public byte getMaxJumps()

+ 4 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/FortSiege.java

@@ -37,9 +37,9 @@ import com.l2jserver.gameserver.datatables.NpcTable;
 import com.l2jserver.gameserver.instancemanager.FortManager;
 import com.l2jserver.gameserver.instancemanager.FortSiegeGuardManager;
 import com.l2jserver.gameserver.instancemanager.FortSiegeManager;
-import com.l2jserver.gameserver.instancemanager.FortSiegeManager.SiegeSpawn;
 import com.l2jserver.gameserver.instancemanager.MapRegionManager;
 import com.l2jserver.gameserver.model.CombatFlag;
+import com.l2jserver.gameserver.model.FortSiegeSpawn;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.L2Object;
 import com.l2jserver.gameserver.model.L2SiegeClan;
@@ -638,8 +638,8 @@ public class FortSiege implements Siegable
 			L2Spawn spawn = instance.getSpawn();
 			if (spawn != null)
 			{
-				FastList<SiegeSpawn> commanders = FortSiegeManager.getInstance().getCommanderSpawnList(getFort().getFortId());
-				for (SiegeSpawn spawn2 : commanders)
+				FastList<FortSiegeSpawn> commanders = FortSiegeManager.getInstance().getCommanderSpawnList(getFort().getFortId());
+				for (FortSiegeSpawn spawn2 : commanders)
 				{
 					if (spawn2.getNpcId() == spawn.getNpcid())
 					{
@@ -1160,7 +1160,7 @@ public class FortSiege implements Siegable
 			_commanders.clear();
 			L2Spawn spawnDat;
 			L2NpcTemplate template1;
-			for (SiegeSpawn _sp : FortSiegeManager.getInstance().getCommanderSpawnList(getFort().getFortId()))
+			for (FortSiegeSpawn _sp : FortSiegeManager.getInstance().getCommanderSpawnList(getFort().getFortId()))
 			{
 				template1 = NpcTable.getInstance().getTemplate(_sp.getNpcId());
 				if (template1 != null)

+ 11 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/zone/L2ZoneType.java

@@ -30,6 +30,7 @@ import javolution.util.FastMap;
 import com.l2jserver.gameserver.instancemanager.InstanceManager;
 import com.l2jserver.gameserver.model.L2Object;
 import com.l2jserver.gameserver.model.L2Object.InstanceType;
+import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.quest.Quest;
@@ -357,6 +358,16 @@ public abstract class L2ZoneType
 		return _zone.isInsideZone(x, y, _zone.getHighZ());
 	}
 	
+	/**
+	 * Checks if the given coordinates are within the zone, ignores instanceId check
+	 * @param loc
+	 * @return
+	 */
+	public boolean isInsideZone(Location loc)
+	{
+		return _zone.isInsideZone(loc.getX(), loc.getY(), loc.getZ());
+	}
+	
 	/**
 	 * Checks if the given coordinates are within the zone, ignores instanceId check
 	 * @param x

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestBuySeed.java

@@ -25,8 +25,8 @@ import com.l2jserver.Config;
 import com.l2jserver.gameserver.datatables.ItemTable;
 import com.l2jserver.gameserver.instancemanager.CastleManager;
 import com.l2jserver.gameserver.instancemanager.CastleManorManager;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.SeedProduction;
 import com.l2jserver.gameserver.model.L2Object;
+import com.l2jserver.gameserver.model.SeedProduction;
 import com.l2jserver.gameserver.model.actor.instance.L2ManorManagerInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.entity.Castle;

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestProcureCropList.java

@@ -26,7 +26,7 @@ import com.l2jserver.gameserver.datatables.ItemTable;
 import com.l2jserver.gameserver.datatables.ManorData;
 import com.l2jserver.gameserver.instancemanager.CastleManager;
 import com.l2jserver.gameserver.instancemanager.CastleManorManager;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.CropProcure;
+import com.l2jserver.gameserver.model.CropProcure;
 import com.l2jserver.gameserver.model.L2Object;
 import com.l2jserver.gameserver.model.actor.instance.L2ManorManagerInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestSetCrop.java

@@ -27,7 +27,7 @@ import java.util.List;
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.instancemanager.CastleManager;
 import com.l2jserver.gameserver.instancemanager.CastleManorManager;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.CropProcure;
+import com.l2jserver.gameserver.model.CropProcure;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.entity.Castle;

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestSetSeed.java

@@ -27,8 +27,8 @@ import java.util.List;
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.instancemanager.CastleManager;
 import com.l2jserver.gameserver.instancemanager.CastleManorManager;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.SeedProduction;
 import com.l2jserver.gameserver.model.L2Clan;
+import com.l2jserver.gameserver.model.SeedProduction;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.entity.Castle;
 import com.l2jserver.gameserver.util.Util;

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/BuyListSeed.java

@@ -22,7 +22,7 @@ import java.util.List;
 
 import javolution.util.FastList;
 
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.SeedProduction;
+import com.l2jserver.gameserver.model.SeedProduction;
 
 /**
  * @author l3x

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExAirShipTeleportList.java

@@ -52,9 +52,9 @@ public class ExAirShipTeleportList extends L2GameServerPacket
 				writeD(_fuelConsumption[i]);
 				path = _teleports[i];
 				dst = path[path.length - 1];
-				writeD(dst.x);
-				writeD(dst.y);
-				writeD(dst.z);
+				writeD(dst.getX());
+				writeD(dst.getY());
+				writeD(dst.getZ());
 			}
 		}
 		else

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowCropInfo.java

@@ -21,7 +21,7 @@ package com.l2jserver.gameserver.network.serverpackets;
 import java.util.List;
 
 import com.l2jserver.gameserver.datatables.ManorData;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.CropProcure;
+import com.l2jserver.gameserver.model.CropProcure;
 
 /**
  * @author l3x

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowCropSetting.java

@@ -23,7 +23,7 @@ import java.util.List;
 import com.l2jserver.gameserver.datatables.ManorData;
 import com.l2jserver.gameserver.instancemanager.CastleManager;
 import com.l2jserver.gameserver.instancemanager.CastleManorManager;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.CropProcure;
+import com.l2jserver.gameserver.model.CropProcure;
 import com.l2jserver.gameserver.model.entity.Castle;
 
 /**

+ 4 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowFortressMapInfo.java

@@ -21,7 +21,7 @@ package com.l2jserver.gameserver.network.serverpackets;
 import javolution.util.FastList;
 
 import com.l2jserver.gameserver.instancemanager.FortSiegeManager;
-import com.l2jserver.gameserver.instancemanager.FortSiegeManager.SiegeSpawn;
+import com.l2jserver.gameserver.model.FortSiegeSpawn;
 import com.l2jserver.gameserver.model.L2Spawn;
 import com.l2jserver.gameserver.model.entity.Fort;
 
@@ -47,14 +47,14 @@ public class ExShowFortressMapInfo extends L2GameServerPacket
 		writeD(_fortress.getSiege().getIsInProgress() ? 1 : 0); // fortress siege status
 		writeD(_fortress.getFortSize()); // barracks count
 		
-		FastList<SiegeSpawn> commanders = FortSiegeManager.getInstance().getCommanderSpawnList(_fortress.getFortId());
+		FastList<FortSiegeSpawn> commanders = FortSiegeManager.getInstance().getCommanderSpawnList(_fortress.getFortId());
 		if ((commanders != null) && (commanders.size() != 0) && _fortress.getSiege().getIsInProgress())
 		{
 			switch (commanders.size())
 			{
 				case 3:
 				{
-					for (SiegeSpawn spawn : commanders)
+					for (FortSiegeSpawn spawn : commanders)
 					{
 						if (isSpawned(spawn.getNpcId()))
 						{
@@ -70,7 +70,7 @@ public class ExShowFortressMapInfo extends L2GameServerPacket
 				case 4: // TODO: change 4 to 5 once control room supported
 				{
 					int count = 0;
-					for (SiegeSpawn spawn : commanders)
+					for (FortSiegeSpawn spawn : commanders)
 					{
 						count++;
 						if (count == 4)

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowFortressSiegeInfo.java

@@ -21,7 +21,7 @@ package com.l2jserver.gameserver.network.serverpackets;
 import javolution.util.FastList;
 
 import com.l2jserver.gameserver.instancemanager.FortSiegeManager;
-import com.l2jserver.gameserver.instancemanager.FortSiegeManager.SiegeSpawn;
+import com.l2jserver.gameserver.model.FortSiegeSpawn;
 import com.l2jserver.gameserver.model.entity.Fort;
 
 /**
@@ -43,7 +43,7 @@ public class ExShowFortressSiegeInfo extends L2GameServerPacket
 		_fort = fort;
 		_fortId = fort.getFortId();
 		_size = fort.getFortSize();
-		FastList<SiegeSpawn> commanders = FortSiegeManager.getInstance().getCommanderSpawnList(_fortId);
+		FastList<FortSiegeSpawn> commanders = FortSiegeManager.getInstance().getCommanderSpawnList(_fortId);
 		if (commanders != null)
 		{
 			_csize = commanders.size();

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowProcureCropDetail.java

@@ -23,7 +23,7 @@ import java.util.Map;
 
 import com.l2jserver.gameserver.instancemanager.CastleManager;
 import com.l2jserver.gameserver.instancemanager.CastleManorManager;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.CropProcure;
+import com.l2jserver.gameserver.model.CropProcure;
 import com.l2jserver.gameserver.model.entity.Castle;
 
 /**

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowSeedInfo.java

@@ -21,7 +21,7 @@ package com.l2jserver.gameserver.network.serverpackets;
 import java.util.List;
 
 import com.l2jserver.gameserver.datatables.ManorData;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.SeedProduction;
+import com.l2jserver.gameserver.model.SeedProduction;
 
 /**
  * @author l3x

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowSeedSetting.java

@@ -23,7 +23,7 @@ import java.util.List;
 import com.l2jserver.gameserver.datatables.ManorData;
 import com.l2jserver.gameserver.instancemanager.CastleManager;
 import com.l2jserver.gameserver.instancemanager.CastleManorManager;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.SeedProduction;
+import com.l2jserver.gameserver.model.SeedProduction;
 import com.l2jserver.gameserver.model.entity.Castle;
 
 /**

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowSellCropList.java

@@ -23,7 +23,7 @@ import java.util.List;
 import javolution.util.FastMap;
 
 import com.l2jserver.gameserver.datatables.ManorData;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.CropProcure;
+import com.l2jserver.gameserver.model.CropProcure;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/SellListProcure.java

@@ -25,7 +25,7 @@ import javolution.util.FastList;
 import javolution.util.FastMap;
 
 import com.l2jserver.gameserver.instancemanager.CastleManager;
-import com.l2jserver.gameserver.instancemanager.CastleManorManager.CropProcure;
+import com.l2jserver.gameserver.model.CropProcure;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;