Jelajahi Sumber

BETA: Location improvements.
* Implemented IPositionable interface, to allow more OOP and proper hierarchy.
* Removed L2CharPosition, replaced with Location.
* Removed many instantiations of Location objects.
* Object creation reduced drastically!
* /!\ In some places may still be required to create a new object.
* Replaced method L2Spawn#getLocation() with L2Spawn#getLocationId(), since interface require to implement getLocation().
* Replaced L2ItemInstance#getLocation() with L2ItemInstance#getItemLocation(), since interface require to implement getLocation().
* L2Spawn is backed with a Location object instead of x,y,z,heading ints.

TODO:
* Use same system to back x,y,z,heading in L2Object/L2Character if possible.
* Use the getLocation() in more places instead of getX(), getY(), getZ().
* Implement methods using IPositionable to reduce duplicated code.

Zoey76 12 tahun lalu
induk
melakukan
a750985e47
76 mengubah file dengan 511 tambahan dan 499 penghapusan
  1. 2 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/ItemsAutoDestroy.java
  2. 8 10
      L2J_Server_BETA/java/com/l2jserver/gameserver/SevenSignsFestival.java
  3. 11 11
      L2J_Server_BETA/java/com/l2jserver/gameserver/ai/AbstractAI.java
  4. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2AirShipAI.java
  5. 11 11
      L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2AttackableAI.java
  6. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2BoatAI.java
  7. 7 7
      L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2CharacterAI.java
  8. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2DoorAI.java
  9. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2FortSiegeGuardAI.java
  10. 5 5
      L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2PlayerAI.java
  11. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2SiegeGuardAI.java
  12. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/ItemTable.java
  13. 11 11
      L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/SpawnTable.java
  14. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/DimensionalRiftManager.java
  15. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FortSiegeGuardManager.java
  16. 0 7
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FortSiegeManager.java
  17. 46 49
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FourSepulchersManager.java
  18. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/HellboundManager.java
  19. 4 7
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/MapRegionManager.java
  20. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/MercTicketManager.java
  21. 6 6
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/RaidBossSpawnManager.java
  22. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/SiegeGuardManager.java
  23. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/TerritoryWarManager.java
  24. 2 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/WalkingManager.java
  25. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/AutoSpawnHandler.java
  26. 6 6
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2GroupSpawn.java
  27. 28 18
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2Object.java
  28. 75 106
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2Spawn.java
  29. 89 18
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/Location.java
  30. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/MobGroup.java
  31. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/WalkInfo.java
  32. 1 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Attackable.java
  33. 12 18
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java
  34. 5 6
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Vehicle.java
  35. 0 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/events/listeners/IEventListener.java
  36. 2 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2AirShipInstance.java
  37. 2 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2BoatInstance.java
  38. 2 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2DefenderInstance.java
  39. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2DoorInstance.java
  40. 2 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2FortCommanderInstance.java
  41. 2 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2GuardInstance.java
  42. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PetInstance.java
  43. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2RaidBossInstance.java
  44. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2StaticObjectInstance.java
  45. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/status/PcStatus.java
  46. 17 16
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/status/SummonStatus.java
  47. 6 6
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/BlockCheckerEngine.java
  48. 12 12
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Fort.java
  49. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/FortSiege.java
  50. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Instance.java
  51. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/L2Event.java
  52. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Siege.java
  53. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/TvTEvent.java
  54. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/clanhall/ClanHallSiegeEngine.java
  55. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/fishing/L2Fishing.java
  56. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/holders/NpcRoutesHolder.java
  57. 11 19
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/interfaces/IPositionable.java
  58. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/itemauction/ItemAuctionInstance.java
  59. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/itemcontainer/Inventory.java
  60. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/itemcontainer/ItemContainer.java
  61. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/itemcontainer/Mail.java
  62. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/itemcontainer/PcInventory.java
  63. 10 10
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/items/instance/L2ItemInstance.java
  64. 3 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/quest/Quest.java
  65. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/zone/type/L2BossZone.java
  66. 4 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/AbstractRefinePacket.java
  67. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/CannotMoveAnymore.java
  68. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/MoveBackwardToLocation.java
  69. 4 4
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/MoveToLocationAirShip.java
  70. 2 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestActionUse.java
  71. 1 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java
  72. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestExEnchantItemAttribute.java
  73. 2 3
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestMagicSkillUse.java
  74. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestPostAttachment.java
  75. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestSaveInventoryOrder.java
  76. 1 1
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestSendPost.java

+ 2 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/ItemsAutoDestroy.java

@@ -26,6 +26,7 @@ import com.l2jserver.Config;
 import com.l2jserver.gameserver.instancemanager.ItemsOnGroundManager;
 import com.l2jserver.gameserver.model.L2World;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
+import com.l2jserver.gameserver.model.items.instance.L2ItemInstance.ItemLocation;
 import com.l2jserver.gameserver.model.items.type.L2EtcItemType;
 
 public class ItemsAutoDestroy
@@ -65,7 +66,7 @@ public class ItemsAutoDestroy
 		long curtime = System.currentTimeMillis();
 		for (L2ItemInstance item : _items)
 		{
-			if ((item == null) || (item.getDropTime() == 0) || (item.getLocation() != L2ItemInstance.ItemLocation.VOID))
+			if ((item == null) || (item.getDropTime() == 0) || (item.getItemLocation() != ItemLocation.VOID))
 			{
 				_items.remove(item);
 			}

+ 8 - 10
L2J_Server_BETA/java/com/l2jserver/gameserver/SevenSignsFestival.java

@@ -42,12 +42,12 @@ import com.l2jserver.gameserver.datatables.ExperienceTable;
 import com.l2jserver.gameserver.datatables.NpcTable;
 import com.l2jserver.gameserver.datatables.SpawnTable;
 import com.l2jserver.gameserver.instancemanager.MapRegionManager;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.L2Party;
 import com.l2jserver.gameserver.model.L2Party.messageType;
 import com.l2jserver.gameserver.model.L2Spawn;
 import com.l2jserver.gameserver.model.L2World;
+import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.SpawnListener;
 import com.l2jserver.gameserver.model.StatsSet;
 import com.l2jserver.gameserver.model.actor.L2Npc;
@@ -2155,9 +2155,9 @@ public class SevenSignsFestival implements SpawnListener
 			{
 				L2Spawn npcSpawn = new L2Spawn(witchTemplate);
 				
-				npcSpawn.setLocx(_witchSpawn._x);
-				npcSpawn.setLocy(_witchSpawn._y);
-				npcSpawn.setLocz(_witchSpawn._z);
+				npcSpawn.setX(_witchSpawn._x);
+				npcSpawn.setY(_witchSpawn._y);
+				npcSpawn.setZ(_witchSpawn._z);
 				npcSpawn.setHeading(_witchSpawn._heading);
 				npcSpawn.setAmount(1);
 				npcSpawn.setRespawnDelay(1);
@@ -2228,10 +2228,8 @@ public class SevenSignsFestival implements SpawnListener
 					y -= Rnd.nextInt(FESTIVAL_MAX_OFFSET_Y);
 				}
 				
-				L2CharPosition moveTo = new L2CharPosition(x, y, _startLocation._z, Rnd.nextInt(65536));
-				
 				festivalMob.setRunning();
-				festivalMob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, moveTo);
+				festivalMob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(x, y, _startLocation._z, Rnd.nextInt(65536)));
 			}
 		}
 		
@@ -2281,9 +2279,9 @@ public class SevenSignsFestival implements SpawnListener
 				{
 					L2Spawn npcSpawn = new L2Spawn(npcTemplate);
 					
-					npcSpawn.setLocx(currSpawn._x);
-					npcSpawn.setLocy(currSpawn._y);
-					npcSpawn.setLocz(currSpawn._z);
+					npcSpawn.setX(currSpawn._x);
+					npcSpawn.setY(currSpawn._y);
+					npcSpawn.setZ(currSpawn._z);
 					npcSpawn.setHeading(Rnd.nextInt(65536));
 					npcSpawn.setAmount(1);
 					npcSpawn.setRespawnDelay(respawnDelay);

+ 11 - 11
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/AbstractAI.java

@@ -27,8 +27,8 @@ import java.util.logging.Logger;
 
 import com.l2jserver.gameserver.GameTimeController;
 import com.l2jserver.gameserver.ThreadPoolManager;
-import com.l2jserver.gameserver.model.L2CharPosition;
 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.L2Summon;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
@@ -289,7 +289,7 @@ public abstract class AbstractAI implements Ctrl
 				onIntentionCast((L2Skill) arg0, (L2Object) arg1);
 				break;
 			case AI_INTENTION_MOVE_TO:
-				onIntentionMoveTo((L2CharPosition) arg0);
+				onIntentionMoveTo((Location) arg0);
 				break;
 			case AI_INTENTION_FOLLOW:
 				onIntentionFollow((L2Character) arg0);
@@ -401,7 +401,7 @@ public abstract class AbstractAI implements Ctrl
 				}
 				break;
 			case EVT_ARRIVED_BLOCKED:
-				onEvtArrivedBlocked((L2CharPosition) arg0);
+				onEvtArrivedBlocked((Location) arg0);
 				break;
 			case EVT_FORGET_OBJECT:
 				onEvtForgetObject((L2Object) arg0);
@@ -437,7 +437,7 @@ public abstract class AbstractAI implements Ctrl
 	
 	protected abstract void onIntentionCast(L2Skill skill, L2Object target);
 	
-	protected abstract void onIntentionMoveTo(L2CharPosition destination);
+	protected abstract void onIntentionMoveTo(Location destination);
 	
 	protected abstract void onIntentionFollow(L2Character target);
 	
@@ -473,7 +473,7 @@ public abstract class AbstractAI implements Ctrl
 	
 	protected abstract void onEvtArrivedRevalidate();
 	
-	protected abstract void onEvtArrivedBlocked(L2CharPosition blocked_at_pos);
+	protected abstract void onEvtArrivedBlocked(Location blocked_at_pos);
 	
 	protected abstract void onEvtForgetObject(L2Object object);
 	
@@ -612,29 +612,29 @@ public abstract class AbstractAI implements Ctrl
 	/**
 	 * Stop the actor movement server side AND client side by sending Server->Client packet StopMove/StopRotation <I>(broadcast)</I>.<br>
 	 * <FONT COLOR=#FF0000><B> <U>Caution</U> : Low level function, used by AI subclasses</B></FONT>
-	 * @param pos
+	 * @param loc
 	 */
-	protected void clientStopMoving(L2CharPosition pos)
+	protected void clientStopMoving(Location loc)
 	{
 		// Stop movement of the L2Character
 		if (_actor.isMoving())
 		{
-			_accessor.stopMove(pos);
+			_accessor.stopMove(loc);
 		}
 		
 		_clientMovingToPawnOffset = 0;
 		
-		if (_clientMoving || (pos != null))
+		if (_clientMoving || (loc != null))
 		{
 			_clientMoving = false;
 			
 			// Send a Server->Client packet StopMove to the actor and all L2PcInstance in its _knownPlayers
 			_actor.broadcastPacket(new StopMove(_actor));
 			
-			if (pos != null)
+			if (loc != null)
 			{
 				// Send a Server->Client packet StopRotation to the actor and all L2PcInstance in its _knownPlayers
-				_actor.broadcastPacket(new StopRotation(_actor.getObjectId(), pos.heading, 0));
+				_actor.broadcastPacket(new StopRotation(_actor.getObjectId(), loc.getHeading(), 0));
 			}
 		}
 	}

+ 4 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2AirShipAI.java

@@ -18,7 +18,7 @@
  */
 package com.l2jserver.gameserver.ai;
 
-import com.l2jserver.gameserver.model.L2CharPosition;
+import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.instance.L2AirShipInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.network.serverpackets.ExMoveToLocationAirShip;
@@ -46,14 +46,14 @@ public class L2AirShipAI extends L2VehicleAI
 	}
 	
 	@Override
-	protected void clientStopMoving(L2CharPosition pos)
+	protected void clientStopMoving(Location loc)
 	{
 		if (_actor.isMoving())
 		{
-			_accessor.stopMove(pos);
+			_accessor.stopMove(loc);
 		}
 		
-		if (_clientMoving || (pos != null))
+		if (_clientMoving || (loc != null))
 		{
 			_clientMoving = false;
 			_actor.broadcastPacket(new ExStopMoveAirShip(getActor()));

+ 11 - 11
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2AttackableAI.java

@@ -34,8 +34,8 @@ import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.datatables.NpcTable;
 import com.l2jserver.gameserver.datatables.TerritoryTable;
 import com.l2jserver.gameserver.instancemanager.DimensionalRiftManager;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2Object;
+import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.L2Attackable;
 import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.L2Npc;
@@ -351,7 +351,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 					if (npc.getSpawn() != null)
 					{
 						final int range = Config.MAX_DRIFT_RANGE;
-						if (!npc.isInsideRadius(npc.getSpawn().getLocx(), npc.getSpawn().getLocy(), npc.getSpawn().getLocz(), range + range, true, false))
+						if (!npc.isInsideRadius(npc.getSpawn().getX(), npc.getSpawn().getY(), npc.getSpawn().getZ(), range + range, true, false))
 						{
 							intention = AI_INTENTION_ACTIVE;
 						}
@@ -643,10 +643,10 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 			}
 			
 			// If NPC with random coord in territory
-			if ((npc.getSpawn().getLocx() == 0) && (npc.getSpawn().getLocy() == 0))
+			if ((npc.getSpawn().getX() == 0) && (npc.getSpawn().getY() == 0))
 			{
 				// Calculate a destination point in the spawn area
-				int p[] = TerritoryTable.getInstance().getRandomPoint(npc.getSpawn().getLocation());
+				int p[] = TerritoryTable.getInstance().getRandomPoint(npc.getSpawn().getLocationId());
 				x1 = p[0];
 				y1 = p[1];
 				z1 = p[2];
@@ -663,7 +663,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 				}
 				
 				// If NPC with random fixed coord, don't move (unless needs to return to spawnpoint)
-				if ((TerritoryTable.getInstance().getProcMax(npc.getSpawn().getLocation()) > 0) && !npc.isReturningToSpawnPoint())
+				if ((TerritoryTable.getInstance().getProcMax(npc.getSpawn().getLocationId()) > 0) && !npc.isReturningToSpawnPoint())
 				{
 					return;
 				}
@@ -671,9 +671,9 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 			else
 			{
 				// If NPC with fixed coord
-				x1 = npc.getSpawn().getLocx();
-				y1 = npc.getSpawn().getLocy();
-				z1 = npc.getSpawn().getLocz();
+				x1 = npc.getSpawn().getX();
+				y1 = npc.getSpawn().getY();
+				z1 = npc.getSpawn().getZ();
 				
 				if (!npc.isInsideRadius(x1, y1, range, false))
 				{
@@ -684,8 +684,8 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 					x1 = Rnd.nextInt(range * 2); // x
 					y1 = Rnd.get(x1, range * 2); // distance
 					y1 = (int) Math.sqrt((y1 * y1) - (x1 * x1)); // y
-					x1 += npc.getSpawn().getLocx() - range;
-					y1 += npc.getSpawn().getLocy() - range;
+					x1 += npc.getSpawn().getX() - range;
+					y1 += npc.getSpawn().getY() - range;
 					z1 = npc.getZ();
 				}
 			}
@@ -930,7 +930,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 					
 					if ((Config.GEODATA == 0) || GeoData.getInstance().canMoveFromToTarget(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, npc.getInstanceId()))
 					{
-						setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(posX, posY, posZ, 0));
+						setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(posX, posY, posZ, 0));
 					}
 					return;
 				}

+ 4 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2BoatAI.java

@@ -18,7 +18,7 @@
  */
 package com.l2jserver.gameserver.ai;
 
-import com.l2jserver.gameserver.model.L2CharPosition;
+import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.instance.L2BoatInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.network.serverpackets.VehicleDeparture;
@@ -52,14 +52,14 @@ public class L2BoatAI extends L2VehicleAI
 	}
 	
 	@Override
-	protected void clientStopMoving(L2CharPosition pos)
+	protected void clientStopMoving(Location loc)
 	{
 		if (_actor.isMoving())
 		{
-			_accessor.stopMove(pos);
+			_accessor.stopMove(loc);
 		}
 		
-		if (_clientMoving || (pos != null))
+		if (_clientMoving || (loc != null))
 		{
 			_clientMoving = false;
 			_actor.broadcastPacket(new VehicleStarted(getActor(), 0));

+ 7 - 7
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2CharacterAI.java

@@ -37,8 +37,8 @@ import com.l2jserver.gameserver.GameTimeController;
 import com.l2jserver.gameserver.GeoData;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.instancemanager.WalkingManager;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2Object;
+import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.L2Attackable;
 import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.L2Npc;
@@ -356,7 +356,7 @@ public class L2CharacterAI extends AbstractAI
 	 * </ul>
 	 */
 	@Override
-	protected void onIntentionMoveTo(L2CharPosition pos)
+	protected void onIntentionMoveTo(Location loc)
 	{
 		if (getIntention() == AI_INTENTION_REST)
 		{
@@ -373,7 +373,7 @@ public class L2CharacterAI extends AbstractAI
 		}
 		
 		// Set the Intention of this AbstractAI to AI_INTENTION_MOVE_TO
-		changeIntention(AI_INTENTION_MOVE_TO, pos, null);
+		changeIntention(AI_INTENTION_MOVE_TO, loc, null);
 		
 		// Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop (broadcast)
 		clientStopAutoAttack();
@@ -382,7 +382,7 @@ public class L2CharacterAI extends AbstractAI
 		_actor.abortAttack();
 		
 		// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
-		moveTo(pos.x, pos.y, pos.z);
+		moveTo(loc.getX(), loc.getY(), loc.getZ());
 	}
 	
 	/**
@@ -471,7 +471,7 @@ public class L2CharacterAI extends AbstractAI
 		// Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop (broadcast)
 		clientStopAutoAttack();
 		
-		if ((object instanceof L2ItemInstance) && (((L2ItemInstance) object).getLocation() != ItemLocation.VOID))
+		if ((object instanceof L2ItemInstance) && (((L2ItemInstance) object).getItemLocation() != ItemLocation.VOID))
 		{
 			return;
 		}
@@ -791,7 +791,7 @@ public class L2CharacterAI extends AbstractAI
 	 * </ul>
 	 */
 	@Override
-	protected void onEvtArrivedBlocked(L2CharPosition blocked_at_pos)
+	protected void onEvtArrivedBlocked(Location blocked_at_loc)
 	{
 		// If the Intention was AI_INTENTION_MOVE_TO, set the Intention to AI_INTENTION_ACTIVE
 		if ((getIntention() == AI_INTENTION_MOVE_TO) || (getIntention() == AI_INTENTION_CAST))
@@ -800,7 +800,7 @@ public class L2CharacterAI extends AbstractAI
 		}
 		
 		// Stop the actor movement server side AND client side by sending Server->Client packet StopMove/StopRotation (broadcast)
-		clientStopMoving(blocked_at_pos);
+		clientStopMoving(blocked_at_loc);
 		
 		// Launch actions corresponding to the Event Think
 		onEvtThink();

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2DoorAI.java

@@ -19,8 +19,8 @@
 package com.l2jserver.gameserver.ai;
 
 import com.l2jserver.gameserver.ThreadPoolManager;
-import com.l2jserver.gameserver.model.L2CharPosition;
 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.L2DefenderInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
@@ -63,7 +63,7 @@ public class L2DoorAI extends L2CharacterAI
 	}
 	
 	@Override
-	protected void onIntentionMoveTo(L2CharPosition destination)
+	protected void onIntentionMoveTo(Location destination)
 	{
 	}
 	
@@ -135,7 +135,7 @@ public class L2DoorAI extends L2CharacterAI
 	}
 	
 	@Override
-	protected void onEvtArrivedBlocked(L2CharPosition blocked_at_pos)
+	protected void onEvtArrivedBlocked(Location blocked_at_loc)
 	{
 	}
 	

+ 4 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2FortSiegeGuardAI.java

@@ -656,8 +656,8 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
 				double dx = _actor.getX() - attackTarget.getX();
 				double dy = _actor.getY() - attackTarget.getY();
 				double dz = _actor.getZ() - attackTarget.getZ();
-				double homeX = attackTarget.getX() - sGuard.getSpawn().getLocx();
-				double homeY = attackTarget.getY() - sGuard.getSpawn().getLocy();
+				double homeX = attackTarget.getX() - sGuard.getSpawn().getX();
+				double homeY = attackTarget.getY() - sGuard.getSpawn().getY();
 				
 				// Check if the L2SiegeGuardInstance isn't too far from it's home location
 				if ((((dx * dx) + (dy * dy)) > 10000) && (((homeX * homeX) + (homeY * homeY)) > 3240000) // 1800 * 1800
@@ -930,8 +930,8 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
 				{
 					sGuard = (L2DefenderInstance) _actor;
 				}
-				double homeX = target.getX() - sGuard.getSpawn().getLocx();
-				double homeY = target.getY() - sGuard.getSpawn().getLocy();
+				double homeX = target.getX() - sGuard.getSpawn().getX();
+				double homeY = target.getY() - sGuard.getSpawn().getY();
 				
 				// Check if the L2SiegeGuardInstance is not too far from its home location
 				if (((homeX * homeX) + (homeY * homeY)) < 3240000)

+ 5 - 5
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2PlayerAI.java

@@ -26,8 +26,8 @@ import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_MOVE_TO;
 import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_PICK_UP;
 import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_REST;
 
-import com.l2jserver.gameserver.model.L2CharPosition;
 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.L2Character.AIAccessor;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
@@ -184,7 +184,7 @@ public class L2PlayerAI extends L2PlayableAI
 	 * </ul>
 	 */
 	@Override
-	protected void onIntentionMoveTo(L2CharPosition pos)
+	protected void onIntentionMoveTo(Location loc)
 	{
 		if (getIntention() == AI_INTENTION_REST)
 		{
@@ -196,12 +196,12 @@ public class L2PlayerAI extends L2PlayableAI
 		if (_actor.isAllSkillsDisabled() || _actor.isCastingNow() || _actor.isAttackingNow())
 		{
 			clientActionFailed();
-			saveNextIntention(AI_INTENTION_MOVE_TO, pos, null);
+			saveNextIntention(AI_INTENTION_MOVE_TO, loc, null);
 			return;
 		}
 		
 		// Set the Intention of this AbstractAI to AI_INTENTION_MOVE_TO
-		changeIntention(AI_INTENTION_MOVE_TO, pos, null);
+		changeIntention(AI_INTENTION_MOVE_TO, loc, null);
 		
 		// Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop (broadcast)
 		clientStopAutoAttack();
@@ -210,7 +210,7 @@ public class L2PlayerAI extends L2PlayableAI
 		_actor.abortAttack();
 		
 		// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
-		moveTo(pos.x, pos.y, pos.z);
+		moveTo(loc.getX(), loc.getY(), loc.getZ());
 	}
 	
 	@Override

+ 4 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2SiegeGuardAI.java

@@ -628,8 +628,8 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
 				double dx = _actor.getX() - attackTarget.getX();
 				double dy = _actor.getY() - attackTarget.getY();
 				double dz = _actor.getZ() - attackTarget.getZ();
-				double homeX = attackTarget.getX() - sGuard.getSpawn().getLocx();
-				double homeY = attackTarget.getY() - sGuard.getSpawn().getLocy();
+				double homeX = attackTarget.getX() - sGuard.getSpawn().getX();
+				double homeY = attackTarget.getY() - sGuard.getSpawn().getY();
 				
 				// Check if the L2SiegeGuardInstance isn't too far from it's home location
 				if ((((dx * dx) + (dy * dy)) > 10000) && (((homeX * homeX) + (homeY * homeY)) > 3240000) // 1800 * 1800
@@ -893,8 +893,8 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
 				}
 				
 				L2DefenderInstance sGuard = (L2DefenderInstance) _actor;
-				double homeX = target.getX() - sGuard.getSpawn().getLocx();
-				double homeY = target.getY() - sGuard.getSpawn().getLocy();
+				double homeX = target.getX() - sGuard.getSpawn().getX();
+				double homeY = target.getY() - sGuard.getSpawn().getY();
 				
 				// Check if the L2SiegeGuardInstance is not too far from its home location
 				if (((homeX * homeX) + (homeY * homeY)) < 3240000)

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/ItemTable.java

@@ -411,7 +411,7 @@ public class ItemTable
 			long old = item.getCount();
 			item.setCount(0);
 			item.setOwnerId(0);
-			item.setLocation(ItemLocation.VOID);
+			item.setItemLocation(ItemLocation.VOID);
 			item.setLastChange(L2ItemInstance.REMOVED);
 			
 			L2World.getInstance().removeObject(item);

+ 11 - 11
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/SpawnTable.java

@@ -107,14 +107,14 @@ public final class SpawnTable
 				
 				spawn = new L2Spawn(npcTemplate);
 				spawn.setAmount(rs.getInt("count"));
-				spawn.setLocx(rs.getInt("locx"));
-				spawn.setLocy(rs.getInt("locy"));
-				spawn.setLocz(rs.getInt("locz"));
+				spawn.setX(rs.getInt("locx"));
+				spawn.setY(rs.getInt("locy"));
+				spawn.setZ(rs.getInt("locz"));
 				spawn.setHeading(rs.getInt("heading"));
 				spawn.setRespawnDelay(rs.getInt("respawn_delay"), rs.getInt("respawn_random"));
 				spawn.setCustom(isCustom);
 				int loc_id = rs.getInt("loc_id");
-				spawn.setLocation(loc_id);
+				spawn.setLocationId(loc_id);
 				
 				switch (rs.getInt("periodOfDay"))
 				{
@@ -193,13 +193,13 @@ public final class SpawnTable
 			{
 				insert.setInt(1, spawn.getAmount());
 				insert.setInt(2, spawn.getNpcid());
-				insert.setInt(3, spawn.getLocx());
-				insert.setInt(4, spawn.getLocy());
-				insert.setInt(5, spawn.getLocz());
+				insert.setInt(3, spawn.getX());
+				insert.setInt(4, spawn.getY());
+				insert.setInt(5, spawn.getZ());
 				insert.setInt(6, spawn.getHeading());
 				insert.setInt(7, spawn.getRespawnDelay() / 1000);
 				insert.setInt(8, spawn.getRespawnMaxDelay() - spawn.getRespawnMinDelay());
-				insert.setInt(9, spawn.getLocation());
+				insert.setInt(9, spawn.getLocationId());
 				insert.execute();
 			}
 			catch (Exception e)
@@ -226,9 +226,9 @@ public final class SpawnTable
 			try (Connection con = L2DatabaseFactory.getInstance().getConnection();
 				PreparedStatement delete = con.prepareStatement("DELETE FROM " + (spawn.isCustom() ? "custom_spawnlist" : "spawnlist") + " WHERE locx=? AND locy=? AND locz=? AND npc_templateid=? AND heading=?"))
 			{
-				delete.setInt(1, spawn.getLocx());
-				delete.setInt(2, spawn.getLocy());
-				delete.setInt(3, spawn.getLocz());
+				delete.setInt(1, spawn.getX());
+				delete.setInt(2, spawn.getY());
+				delete.setInt(3, spawn.getZ());
 				delete.setInt(4, spawn.getNpcid());
 				delete.setInt(5, spawn.getHeading());
 				delete.execute();

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/DimensionalRiftManager.java

@@ -199,9 +199,9 @@ public class DimensionalRiftManager
 												{
 													spawnDat = new L2Spawn(template);
 													spawnDat.setAmount(1);
-													spawnDat.setLocx(x);
-													spawnDat.setLocy(y);
-													spawnDat.setLocz(z);
+													spawnDat.setX(x);
+													spawnDat.setY(y);
+													spawnDat.setZ(z);
 													spawnDat.setHeading(-1);
 													spawnDat.setRespawnDelay(delay);
 													SpawnTable.getInstance().addNewSpawn(spawnDat, false);

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

@@ -127,12 +127,12 @@ public class FortSiegeGuardManager
 					{
 						spawn1 = new L2Spawn(template1);
 						spawn1.setAmount(1);
-						spawn1.setLocx(rs.getInt("x"));
-						spawn1.setLocy(rs.getInt("y"));
-						spawn1.setLocz(rs.getInt("z"));
+						spawn1.setX(rs.getInt("x"));
+						spawn1.setY(rs.getInt("y"));
+						spawn1.setZ(rs.getInt("z"));
 						spawn1.setHeading(rs.getInt("heading"));
 						spawn1.setRespawnDelay(rs.getInt("respawnDelay"));
-						spawn1.setLocation(0);
+						spawn1.setLocationId(0);
 						
 						_siegeGuardsSpawns.add(spawn1);
 					}

+ 0 - 7
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FortSiegeManager.java

@@ -408,7 +408,6 @@ public class FortSiegeManager
 	{
 		Location _location;
 		private final int _npcId;
-		private final int _heading;
 		private final int _fortId;
 		private final int _id;
 		
@@ -416,7 +415,6 @@ public class FortSiegeManager
 		{
 			_fortId = fort_id;
 			_location = new Location(x, y, z, heading);
-			_heading = heading;
 			_npcId = npc_id;
 			_id = id;
 		}
@@ -431,11 +429,6 @@ public class FortSiegeManager
 			return _npcId;
 		}
 		
-		public int getHeading()
-		{
-			return _heading;
-		}
-		
 		public int getId()
 		{
 			return _id;

+ 46 - 49
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FourSepulchersManager.java

@@ -305,27 +305,27 @@ public class FourSepulchersManager
 				switch (i)
 				{
 					case 31921: // conquerors
-						spawnDat.setLocx(181061);
-						spawnDat.setLocy(-85595);
-						spawnDat.setLocz(-7200);
+						spawnDat.setX(181061);
+						spawnDat.setY(-85595);
+						spawnDat.setZ(-7200);
 						spawnDat.setHeading(-32584);
 						break;
 					case 31922: // emperors
-						spawnDat.setLocx(179292);
-						spawnDat.setLocy(-88981);
-						spawnDat.setLocz(-7200);
+						spawnDat.setX(179292);
+						spawnDat.setY(-88981);
+						spawnDat.setZ(-7200);
 						spawnDat.setHeading(-33272);
 						break;
 					case 31923: // sages
-						spawnDat.setLocx(173202);
-						spawnDat.setLocy(-87004);
-						spawnDat.setLocz(-7200);
+						spawnDat.setX(173202);
+						spawnDat.setY(-87004);
+						spawnDat.setZ(-7200);
 						spawnDat.setHeading(-16248);
 						break;
 					case 31924: // judges
-						spawnDat.setLocx(175606);
-						spawnDat.setLocy(-82853);
-						spawnDat.setLocz(-7200);
+						spawnDat.setX(175606);
+						spawnDat.setY(-82853);
+						spawnDat.setZ(-7200);
 						spawnDat.setHeading(-16248);
 						break;
 				}
@@ -445,9 +445,9 @@ public class FourSepulchersManager
 					{
 						spawnDat = new L2Spawn(template1);
 						spawnDat.setAmount(rs.getInt("count"));
-						spawnDat.setLocx(rs.getInt("locx"));
-						spawnDat.setLocy(rs.getInt("locy"));
-						spawnDat.setLocz(rs.getInt("locz"));
+						spawnDat.setX(rs.getInt("locx"));
+						spawnDat.setY(rs.getInt("locy"));
+						spawnDat.setZ(rs.getInt("locz"));
 						spawnDat.setHeading(rs.getInt("heading"));
 						spawnDat.setRespawnDelay(rs.getInt("respawn_delay"));
 						SpawnTable.getInstance().addNewSpawn(spawnDat, false);
@@ -483,9 +483,9 @@ public class FourSepulchersManager
 				{
 					spawnDat = new L2Spawn(template);
 					spawnDat.setAmount(1);
-					spawnDat.setLocx(0);
-					spawnDat.setLocy(0);
-					spawnDat.setLocz(0);
+					spawnDat.setX(0);
+					spawnDat.setY(0);
+					spawnDat.setZ(0);
 					spawnDat.setHeading(0);
 					spawnDat.setRespawnDelay(3600);
 					SpawnTable.getInstance().addNewSpawn(spawnDat, false);
@@ -533,9 +533,9 @@ public class FourSepulchersManager
 							{
 								spawnDat = new L2Spawn(template1);
 								spawnDat.setAmount(rs2.getInt("count"));
-								spawnDat.setLocx(rs2.getInt("locx"));
-								spawnDat.setLocy(rs2.getInt("locy"));
-								spawnDat.setLocz(rs2.getInt("locz"));
+								spawnDat.setX(rs2.getInt("locx"));
+								spawnDat.setY(rs2.getInt("locy"));
+								spawnDat.setZ(rs2.getInt("locz"));
 								spawnDat.setHeading(rs2.getInt("heading"));
 								spawnDat.setRespawnDelay(rs2.getInt("respawn_delay"));
 								SpawnTable.getInstance().addNewSpawn(spawnDat, false);
@@ -591,9 +591,9 @@ public class FourSepulchersManager
 							{
 								spawnDat = new L2Spawn(template1);
 								spawnDat.setAmount(rset2.getInt("count"));
-								spawnDat.setLocx(rset2.getInt("locx"));
-								spawnDat.setLocy(rset2.getInt("locy"));
-								spawnDat.setLocz(rset2.getInt("locz"));
+								spawnDat.setX(rset2.getInt("locx"));
+								spawnDat.setY(rset2.getInt("locy"));
+								spawnDat.setZ(rset2.getInt("locz"));
 								spawnDat.setHeading(rset2.getInt("heading"));
 								spawnDat.setRespawnDelay(rset2.getInt("respawn_delay"));
 								SpawnTable.getInstance().addNewSpawn(spawnDat, false);
@@ -652,9 +652,9 @@ public class FourSepulchersManager
 							{
 								spawnDat = new L2Spawn(template1);
 								spawnDat.setAmount(rset2.getInt("count"));
-								spawnDat.setLocx(rset2.getInt("locx"));
-								spawnDat.setLocy(rset2.getInt("locy"));
-								spawnDat.setLocz(rset2.getInt("locz"));
+								spawnDat.setX(rset2.getInt("locx"));
+								spawnDat.setY(rset2.getInt("locy"));
+								spawnDat.setZ(rset2.getInt("locz"));
 								spawnDat.setHeading(rset2.getInt("heading"));
 								spawnDat.setRespawnDelay(rset2.getInt("respawn_delay"));
 								SpawnTable.getInstance().addNewSpawn(spawnDat, false);
@@ -711,9 +711,9 @@ public class FourSepulchersManager
 							{
 								spawnDat = new L2Spawn(template1);
 								spawnDat.setAmount(rs2.getInt("count"));
-								spawnDat.setLocx(rs2.getInt("locx"));
-								spawnDat.setLocy(rs2.getInt("locy"));
-								spawnDat.setLocz(rs2.getInt("locz"));
+								spawnDat.setX(rs2.getInt("locx"));
+								spawnDat.setY(rs2.getInt("locy"));
+								spawnDat.setZ(rs2.getInt("locz"));
 								spawnDat.setHeading(rs2.getInt("heading"));
 								spawnDat.setRespawnDelay(rs2.getInt("respawn_delay"));
 								SpawnTable.getInstance().addNewSpawn(spawnDat, false);
@@ -763,9 +763,9 @@ public class FourSepulchersManager
 				{
 					spawnDat = new L2Spawn(template);
 					spawnDat.setAmount(1);
-					spawnDat.setLocx(_shadowSpawnLoc[locNo][i][1]);
-					spawnDat.setLocy(_shadowSpawnLoc[locNo][i][2]);
-					spawnDat.setLocz(_shadowSpawnLoc[locNo][i][3]);
+					spawnDat.setX(_shadowSpawnLoc[locNo][i][1]);
+					spawnDat.setY(_shadowSpawnLoc[locNo][i][2]);
+					spawnDat.setZ(_shadowSpawnLoc[locNo][i][3]);
 					spawnDat.setHeading(_shadowSpawnLoc[locNo][i][4]);
 					SpawnTable.getInstance().addNewSpawn(spawnDat, false);
 					int keyNpcId = gateKeeper[i];
@@ -797,9 +797,9 @@ public class FourSepulchersManager
 				{
 					spawnDat = new L2Spawn(template);
 					spawnDat.setAmount(1);
-					spawnDat.setLocx(0);
-					spawnDat.setLocy(0);
-					spawnDat.setLocz(0);
+					spawnDat.setX(0);
+					spawnDat.setY(0);
+					spawnDat.setZ(0);
 					spawnDat.setHeading(0);
 					spawnDat.setRespawnDelay(3600);
 					SpawnTable.getInstance().addNewSpawn(spawnDat, false);
@@ -1136,10 +1136,7 @@ public class FourSepulchersManager
 						{
 							keyBoxMobSpawn = new L2Spawn(template);
 							keyBoxMobSpawn.setAmount(1);
-							keyBoxMobSpawn.setLocx(spawnDat.getLocx());
-							keyBoxMobSpawn.setLocy(spawnDat.getLocy());
-							keyBoxMobSpawn.setLocz(spawnDat.getLocz());
-							keyBoxMobSpawn.setHeading(spawnDat.getHeading());
+							keyBoxMobSpawn.setLocation(spawnDat.getLocation());
 							keyBoxMobSpawn.setRespawnDelay(3600);
 							SpawnTable.getInstance().addNewSpawn(keyBoxMobSpawn, false);
 							mob = (L2SepulcherMonsterInstance) keyBoxMobSpawn.doSpawn();
@@ -1253,9 +1250,9 @@ public class FourSepulchersManager
 		if (spawnDat != null)
 		{
 			spawnDat.setAmount(1);
-			spawnDat.setLocx(activeChar.getX());
-			spawnDat.setLocy(activeChar.getY());
-			spawnDat.setLocz(activeChar.getZ());
+			spawnDat.setX(activeChar.getX());
+			spawnDat.setY(activeChar.getY());
+			spawnDat.setZ(activeChar.getZ());
 			spawnDat.setHeading(activeChar.getHeading());
 			spawnDat.setRespawnDelay(3600);
 			_allMobs.add(spawnDat.doSpawn());
@@ -1276,9 +1273,9 @@ public class FourSepulchersManager
 		if (spawnDat != null)
 		{
 			spawnDat.setAmount(1);
-			spawnDat.setLocx(activeChar.getX());
-			spawnDat.setLocy(activeChar.getY());
-			spawnDat.setLocz(activeChar.getZ());
+			spawnDat.setX(activeChar.getX());
+			spawnDat.setY(activeChar.getY());
+			spawnDat.setZ(activeChar.getZ());
 			spawnDat.setHeading(activeChar.getHeading());
 			spawnDat.setRespawnDelay(3600);
 			_allMobs.add(spawnDat.doSpawn());
@@ -1355,9 +1352,9 @@ public class FourSepulchersManager
 		{
 			int keyNpcId = gateKeeper[i];
 			spawnDat = _shadowSpawns.get(keyNpcId);
-			spawnDat.setLocx(_shadowSpawnLoc[locNo][i][1]);
-			spawnDat.setLocy(_shadowSpawnLoc[locNo][i][2]);
-			spawnDat.setLocz(_shadowSpawnLoc[locNo][i][3]);
+			spawnDat.setX(_shadowSpawnLoc[locNo][i][1]);
+			spawnDat.setY(_shadowSpawnLoc[locNo][i][2]);
+			spawnDat.setZ(_shadowSpawnLoc[locNo][i][3]);
 			spawnDat.setHeading(_shadowSpawnLoc[locNo][i][4]);
 			_shadowSpawns.put(keyNpcId, spawnDat);
 		}

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/HellboundManager.java

@@ -270,9 +270,9 @@ public class HellboundManager
 				{
 					spawnDat = new HellboundSpawn(template);
 					spawnDat.setAmount(1);
-					spawnDat.setLocx(rs.getInt("locx"));
-					spawnDat.setLocy(rs.getInt("locy"));
-					spawnDat.setLocz(rs.getInt("locz"));
+					spawnDat.setX(rs.getInt("locx"));
+					spawnDat.setY(rs.getInt("locy"));
+					spawnDat.setX(rs.getInt("locz"));
 					spawnDat.setHeading(rs.getInt("heading"));
 					spawnDat.setRespawnDelay(rs.getInt("respawn_delay"), rs.getInt("respawn_random"));
 					spawnDat.setMinLvl(rs.getInt("min_hellbound_level"));

+ 4 - 7
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/MapRegionManager.java

@@ -348,7 +348,7 @@ public class MapRegionManager extends DocumentParser
 					L2SiegeFlagInstance tw_flag = TerritoryWarManager.getInstance().getFlagForClan(player.getClan());
 					if (tw_flag != null)
 					{
-						return new Location(tw_flag.getX(), tw_flag.getY(), tw_flag.getZ());
+						return tw_flag.getLocation();
 					}
 					else if (castle != null)
 					{
@@ -359,8 +359,7 @@ public class MapRegionManager extends DocumentParser
 							if ((flags != null) && !flags.isEmpty())
 							{
 								// Spawn to flag - Need more work to get player to the nearest flag
-								L2Npc flag = flags.get(0);
-								return new Location(flag.getX(), flag.getY(), flag.getZ());
+								return flags.get(0).getLocation();
 							}
 						}
 						
@@ -374,8 +373,7 @@ public class MapRegionManager extends DocumentParser
 							if ((flags != null) && !flags.isEmpty())
 							{
 								// Spawn to flag - Need more work to get player to the nearest flag
-								L2Npc flag = flags.get(0);
-								return new Location(flag.getX(), flag.getY(), flag.getZ());
+								return flags.get(0).getLocation();
 							}
 						}
 					}
@@ -385,8 +383,7 @@ public class MapRegionManager extends DocumentParser
 						List<L2Npc> flags = sHall.getSiege().getFlag(player.getClan());
 						if ((flags != null) && !flags.isEmpty())
 						{
-							L2Npc flag = flags.get(0);
-							return new Location(flag.getX(), flag.getY(), flag.getZ());
+							return flags.get(0).getLocation();
 						}
 					}
 				}

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/MercTicketManager.java

@@ -191,7 +191,7 @@ public class MercTicketManager
 							itemId = ITEM_IDS[i];
 							// create the ticket in the gameworld
 							L2ItemInstance dropticket = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
-							dropticket.setLocation(L2ItemInstance.ItemLocation.VOID);
+							dropticket.setItemLocation(L2ItemInstance.ItemLocation.VOID);
 							dropticket.dropMe(null, x, y, z);
 							dropticket.setDropTime(0); // avoids it from being removed by the auto item destroyer
 							L2World.getInstance().storeObject(dropticket);
@@ -335,7 +335,7 @@ public class MercTicketManager
 				
 				// create the ticket in the gameworld
 				L2ItemInstance dropticket = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
-				dropticket.setLocation(L2ItemInstance.ItemLocation.VOID);
+				dropticket.setItemLocation(L2ItemInstance.ItemLocation.VOID);
 				dropticket.dropMe(null, x, y, z);
 				dropticket.setDropTime(0); // avoids it from beeing removed by the auto item destroyer
 				L2World.getInstance().storeObject(dropticket); // add to the world

+ 6 - 6
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/RaidBossSpawnManager.java

@@ -92,9 +92,9 @@ public class RaidBossSpawnManager
 				if (template != null)
 				{
 					spawnDat = new L2Spawn(template);
-					spawnDat.setLocx(rset.getInt("loc_x"));
-					spawnDat.setLocy(rset.getInt("loc_y"));
-					spawnDat.setLocz(rset.getInt("loc_z"));
+					spawnDat.setX(rset.getInt("loc_x"));
+					spawnDat.setY(rset.getInt("loc_y"));
+					spawnDat.setZ(rset.getInt("loc_z"));
 					spawnDat.setAmount(rset.getInt("amount"));
 					spawnDat.setHeading(rset.getInt("heading"));
 					spawnDat.setRespawnDelay(rset.getInt("respawn_delay"), rset.getInt("respawn_random"));
@@ -286,9 +286,9 @@ public class RaidBossSpawnManager
 			{
 				statement.setInt(1, spawnDat.getNpcid());
 				statement.setInt(2, spawnDat.getAmount());
-				statement.setInt(3, spawnDat.getLocx());
-				statement.setInt(4, spawnDat.getLocy());
-				statement.setInt(5, spawnDat.getLocz());
+				statement.setInt(3, spawnDat.getX());
+				statement.setInt(4, spawnDat.getY());
+				statement.setInt(5, spawnDat.getZ());
 				statement.setInt(6, spawnDat.getHeading());
 				statement.setLong(7, respawnTime);
 				statement.setDouble(8, currentHP);

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

@@ -220,12 +220,12 @@ public class SiegeGuardManager
 					{
 						spawn1 = new L2Spawn(template1);
 						spawn1.setAmount(1);
-						spawn1.setLocx(rs.getInt("x"));
-						spawn1.setLocy(rs.getInt("y"));
-						spawn1.setLocz(rs.getInt("z"));
+						spawn1.setX(rs.getInt("x"));
+						spawn1.setY(rs.getInt("y"));
+						spawn1.setZ(rs.getInt("z"));
 						spawn1.setHeading(rs.getInt("heading"));
 						spawn1.setRespawnDelay(rs.getInt("respawnDelay"));
-						spawn1.setLocation(0);
+						spawn1.setLocationId(0);
 						
 						_siegeGuardSpawn.add(spawn1);
 					}

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/TerritoryWarManager.java

@@ -779,9 +779,9 @@ public class TerritoryWarManager implements Siegable
 			{
 				spawnDat = new L2Spawn(template);
 				spawnDat.setAmount(1);
-				spawnDat.setLocx(loc.getX());
-				spawnDat.setLocy(loc.getY());
-				spawnDat.setLocz(loc.getZ());
+				spawnDat.setX(loc.getX());
+				spawnDat.setY(loc.getY());
+				spawnDat.setZ(loc.getZ());
 				spawnDat.setHeading(loc.getHeading());
 				spawnDat.stopRespawn();
 				return spawnDat.spawnOne(false);

+ 2 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/WalkingManager.java

@@ -29,7 +29,6 @@ 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.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2NpcWalkerNode;
 import com.l2jserver.gameserver.model.L2WalkRoute;
 import com.l2jserver.gameserver.model.Location;
@@ -278,7 +277,7 @@ public class WalkingManager extends DocumentParser
 					
 					npc.sendDebugMessage("Starting to move at route " + routeName);
 					npc.setIsRunning(node.getRunning());
-					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(node.getMoveX(), node.getMoveY(), node.getMoveZ(), 0));
+					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(node.getMoveX(), node.getMoveY(), node.getMoveZ(), 0));
 					walk.setWalkCheckTask(ThreadPoolManager.getInstance().scheduleAiAtFixedRate(new Runnable()
 					{
 						@Override
@@ -327,7 +326,7 @@ public class WalkingManager extends DocumentParser
 					L2NpcWalkerNode node = walk.getCurrentNode();
 					npc.sendDebugMessage("Route id: " + routeName + ", continue to node " + walk.getCurrentNodeId());
 					npc.setIsRunning(node.getRunning());
-					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(node.getMoveX(), node.getMoveY(), node.getMoveZ(), 0));
+					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(node.getMoveX(), node.getMoveY(), node.getMoveZ(), 0));
 					walk.setBlocked(false);
 					walk.setStoppedByAttack(false);
 				}

+ 4 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/model/AutoSpawnHandler.java

@@ -472,11 +472,11 @@ public class AutoSpawnHandler
 					_log.warning("Couldnt find NPC id" + spawnInst.getNpcId() + " Try to update your DP");
 					return;
 				}
-				L2Spawn newSpawn = new L2Spawn(npcTemp);
 				
-				newSpawn.setLocx(x);
-				newSpawn.setLocy(y);
-				newSpawn.setLocz(z);
+				L2Spawn newSpawn = new L2Spawn(npcTemp);
+				newSpawn.setX(x);
+				newSpawn.setY(y);
+				newSpawn.setZ(z);
 				if (heading != -1)
 				{
 					newSpawn.setHeading(heading);

+ 6 - 6
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2GroupSpawn.java

@@ -72,23 +72,23 @@ public class L2GroupSpawn extends L2Spawn
 			
 			int newlocx, newlocy, newlocz;
 			
-			if ((getLocx() == 0) && (getLocy() == 0))
+			if ((getX() == 0) && (getY() == 0))
 			{
-				if (getLocation() == 0)
+				if (getLocationId() == 0)
 				{
 					return null;
 				}
 				
-				int p[] = TerritoryTable.getInstance().getRandomPoint(getLocation());
+				int p[] = TerritoryTable.getInstance().getRandomPoint(getLocationId());
 				newlocx = p[0];
 				newlocy = p[1];
 				newlocz = p[2];
 			}
 			else
 			{
-				newlocx = getLocx();
-				newlocy = getLocy();
-				newlocz = getLocz();
+				newlocx = getX();
+				newlocy = getY();
+				newlocz = getZ();
 			}
 			
 			mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp());

+ 28 - 18
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2Object.java

@@ -34,6 +34,7 @@ import com.l2jserver.gameserver.model.actor.knownlist.ObjectKnownList;
 import com.l2jserver.gameserver.model.actor.poly.ObjectPoly;
 import com.l2jserver.gameserver.model.actor.position.ObjectPosition;
 import com.l2jserver.gameserver.model.entity.Instance;
+import com.l2jserver.gameserver.model.interfaces.IPositionable;
 import com.l2jserver.gameserver.model.zone.ZoneId;
 import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
@@ -47,7 +48,7 @@ import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
  * <BR>
  * <li>L2Character</li> <li>L2ItemInstance</li>
  */
-public abstract class L2Object
+public abstract class L2Object implements IPositionable
 {
 	private boolean _isVisible; // Object visibility
 	private ObjectKnownList _knownList;
@@ -308,12 +309,38 @@ public abstract class L2Object
 		getPosition().setXYZInvisible(x, y, z);
 	}
 	
+	@Override
 	public final int getX()
 	{
 		assert (getPosition().getWorldRegion() != null) || _isVisible;
 		return getPosition().getX();
 	}
 	
+	@Override
+	public final int getY()
+	{
+		assert (getPosition().getWorldRegion() != null) || _isVisible;
+		return getPosition().getY();
+	}
+	
+	@Override
+	public final int getZ()
+	{
+		assert (getPosition().getWorldRegion() != null) || _isVisible;
+		return getPosition().getZ();
+	}
+	
+	@Override
+	public Location getLocation()
+	{
+		return new Location(getX(), getY(), getZ(), getHeading(), getInstanceId());
+	}
+	
+	public int getHeading()
+	{
+		return 0;
+	}
+	
 	/**
 	 * @return The id of the instance zone the object is in - id 0 is global since everything like dropped items, mobs, players can be in a instanciated area, it must be in l2object
 	 */
@@ -416,23 +443,6 @@ public abstract class L2Object
 		}
 	}
 	
-	public final int getY()
-	{
-		assert (getPosition().getWorldRegion() != null) || _isVisible;
-		return getPosition().getY();
-	}
-	
-	public final int getZ()
-	{
-		assert (getPosition().getWorldRegion() != null) || _isVisible;
-		return getPosition().getZ();
-	}
-	
-	public int getHeading()
-	{
-		return 0;
-	}
-	
 	/**
 	 * Remove a L2Object from the world.<BR>
 	 * <BR>

+ 75 - 106
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2Spawn.java

@@ -35,6 +35,7 @@ import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.L2Npc;
 import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
 import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
+import com.l2jserver.gameserver.model.interfaces.IPositionable;
 import com.l2jserver.util.Rnd;
 
 /**
@@ -44,59 +45,35 @@ import com.l2jserver.util.Rnd;
  * The heading of the L2NpcInstance can be a random heading if not defined (value= -1) or an exact heading (ex : merchant...).
  * @author Nightmare
  */
-public class L2Spawn
+public class L2Spawn implements IPositionable
 {
 	protected static final Logger _log = Logger.getLogger(L2Spawn.class.getName());
 	
 	/** The link on the L2NpcTemplate object containing generic and static properties of this spawn (ex : RewardExp, RewardSP, AggroRange...) */
 	private L2NpcTemplate _template;
-	
-	// private String _location = DEFAULT_LOCATION;
-	
-	/** The identifier of the location area where L2NpcInstance can be spwaned */
-	private int _location;
-	
 	/** The maximum number of L2NpcInstance that can manage this L2Spawn */
 	private int _maximumCount;
-	
 	/** The current number of L2NpcInstance managed by this L2Spawn */
 	private int _currentCount;
-	
 	/** The current number of SpawnTask in progress or stand by of this L2Spawn */
 	protected int _scheduledCount;
-	
-	/** The X position of the spwan point */
-	private int _locX;
-	
-	/** The Y position of the spwan point */
-	private int _locY;
-	
-	/** The Z position of the spwan point */
-	private int _locZ;
-	
-	/** The heading of L2NpcInstance when they are spawned */
-	private int _heading;
-	
+	/** The identifier of the location area where L2NpcInstance can be spwaned */
+	private int _locationId;
+	/** The Location of this NPC spawn. */
+	private Location _location = new Location(0, 0, 0);
 	/** Minimum respawn delay */
 	private int _respawnMinDelay;
-	
 	/** Maximum respawn delay */
 	private int _respawnMaxDelay;
-	
 	private int _instanceId = 0;
-	
 	/** The generic constructor of L2NpcInstance managed by this L2Spawn */
 	private Constructor<?> _constructor;
-	
 	/** If True a L2NpcInstance is respawned each time that another is killed */
 	private boolean _doRespawn;
-	
 	/** If true then spawn is custom */
 	private boolean _customSpawn;
-	
 	private L2Npc _lastSpawn;
 	private static List<SpawnListener> _spawnListeners = new FastList<>();
-	
 	private boolean _isNoRndWalk = false; // Is no random walk
 	
 	/** The task launching the function doSpawn() */
@@ -175,46 +152,60 @@ public class L2Spawn
 	/**
 	 * @return the Identifier of the location area where L2NpcInstance can be spwaned.
 	 */
-	public int getLocation()
+	public int getLocationId()
+	{
+		return _locationId;
+	}
+	
+	@Override
+	public Location getLocation()
 	{
 		return _location;
 	}
 	
-	public Location getSpawnLocation()
+	@Override
+	public int getX()
 	{
-		return new Location(getLocx(), getLocy(), getLocz(), getHeading());
+		return _location.getX();
 	}
 	
 	/**
-	 * @return the X position of the spwan point.
+	 * Set the X position of the spawn point.
+	 * @param x the x coordinate
 	 */
-	public int getLocx()
+	public void setX(int x)
 	{
-		return _locX;
+		_location.setX(x);
 	}
 	
-	/**
-	 * @return the Y position of the spwan point.
-	 */
-	public int getLocy()
+	@Override
+	public int getY()
 	{
-		return _locY;
+		return _location.getY();
 	}
 	
 	/**
-	 * @return the Z position of the spwan point.
+	 * Set the Y position of the spawn point.
+	 * @param y the y coordinate
 	 */
-	public int getLocz()
+	public void setY(int y)
+	{
+		_location.setY(y);
+	}
+	
+	@Override
+	public int getZ()
 	{
-		return _locZ;
+		return _location.getZ();
 	}
 	
 	/**
-	 * @return the Identifier of the L2NpcInstance manage by this L2Spawn contained in the L2NpcTemplate.
+	 * Set the Z position of the spawn point.
+	 * @param z the z coordinate
 	 */
-	public int getNpcid()
+	public void setZ(int z)
 	{
-		return _template.getNpcId();
+		_location.setZ(z);
 	}
 	
 	/**
@@ -222,7 +213,33 @@ public class L2Spawn
 	 */
 	public int getHeading()
 	{
-		return _heading;
+		return _location.getHeading();
+	}
+	
+	/**
+	 * Set the heading of L2NpcInstance when they are spawned.
+	 * @param heading
+	 */
+	public void setHeading(int heading)
+	{
+		_location.setHeading(heading);
+	}
+	
+	/**
+	 * Set the XYZ position of the spawn point.
+	 * @param loc
+	 */
+	public void setLocation(Location loc)
+	{
+		_location = loc;
+	}
+	
+	/**
+	 * @return the Identifier of the L2NpcInstance manage by this L2Spawn contained in the L2NpcTemplate.
+	 */
+	public int getNpcid()
+	{
+		return _template.getNpcId();
 	}
 	
 	/**
@@ -252,11 +269,11 @@ public class L2Spawn
 	
 	/**
 	 * Set the Identifier of the location area where L2NpcInstance can be spawned.
-	 * @param location
+	 * @param id
 	 */
-	public void setLocation(int location)
+	public void setLocationId(int id)
 	{
-		_location = location;
+		_locationId = id;
 	}
 	
 	/**
@@ -277,54 +294,6 @@ public class L2Spawn
 		_respawnMaxDelay = date;
 	}
 	
-	/**
-	 * Set the X position of the spawn point.
-	 * @param locx
-	 */
-	public void setLocx(int locx)
-	{
-		_locX = locx;
-	}
-	
-	/**
-	 * Set the Y position of the spawn point.
-	 * @param locy
-	 */
-	public void setLocy(int locy)
-	{
-		_locY = locy;
-	}
-	
-	/**
-	 * Set the Z position of the spawn point.
-	 * @param locz
-	 */
-	public void setLocz(int locz)
-	{
-		_locZ = locz;
-	}
-	
-	/**
-	 * Set the XYZ position of the spawn point.
-	 * @param loc
-	 */
-	public void setLocation(Location loc)
-	{
-		_locX = loc.getX();
-		_locY = loc.getY();
-		_locZ = loc.getZ();
-		_heading = loc.getHeading();
-	}
-	
-	/**
-	 * Set the heading of L2NpcInstance when they are spawned.
-	 * @param heading
-	 */
-	public void setHeading(int heading)
-	{
-		_heading = heading;
-	}
-	
 	/**
 	 * Set the spawn as custom.<BR>
 	 * @param custom
@@ -499,15 +468,15 @@ public class L2Spawn
 		int newlocx, newlocy, newlocz;
 		
 		// If Locx=0 and Locy=0, the L2NpcInstance must be spawned in an area defined by location
-		if ((getLocx() == 0) && (getLocy() == 0))
+		if ((getX() == 0) && (getY() == 0))
 		{
-			if (getLocation() == 0)
+			if (getLocationId() == 0)
 			{
 				return mob;
 			}
 			
 			// Calculate the random position in the location area
-			int p[] = TerritoryTable.getInstance().getRandomPoint(getLocation());
+			int p[] = TerritoryTable.getInstance().getRandomPoint(getLocationId());
 			
 			// Set the calculated position of the L2NpcInstance
 			newlocx = p[0];
@@ -517,15 +486,15 @@ public class L2Spawn
 		else
 		{
 			// The L2NpcInstance is spawned at the exact position (Lox, Locy, Locz)
-			newlocx = getLocx();
-			newlocy = getLocy();
+			newlocx = getX();
+			newlocy = getY();
 			if (Config.GEODATA > 0)
 			{
-				newlocz = GeoData.getInstance().getSpawnHeight(newlocx, newlocy, getLocz(), getLocz(), this);
+				newlocz = GeoData.getInstance().getSpawnHeight(newlocx, newlocy, getZ(), getZ(), this);
 			}
 			else
 			{
-				newlocz = getLocz();
+				newlocz = getZ();
 			}
 		}
 		
@@ -694,7 +663,7 @@ public class L2Spawn
 	@Override
 	public String toString()
 	{
-		return "L2Spawn [_template=" + getNpcid() + ", _locX=" + _locX + ", _locY=" + _locY + ", _locZ=" + _locZ + ", _heading=" + _heading + "]";
+		return "L2Spawn [_template=" + getNpcid() + ", _locX=" + getX() + ", _locY=" + getY() + ", _locZ=" + getZ() + ", _heading=" + getHeading() + "]";
 	}
 	
 	public final boolean isNoRndWalk()

+ 89 - 18
L2J_Server_BETA/java/com/l2jserver/gameserver/model/Location.java

@@ -18,13 +18,18 @@
  */
 package com.l2jserver.gameserver.model;
 
-import com.l2jserver.gameserver.model.actor.L2Character;
+import com.l2jserver.gameserver.model.interfaces.IPositionable;
 
-public class Location
+/**
+ * Location data transfer object.<br>
+ * Contains coordinates data, heading and instance Id.
+ * @author Zoey76
+ */
+public class Location implements IPositionable
 {
-	private final int _x;
-	private final int _y;
-	private final int _z;
+	private int _x;
+	private int _y;
+	private int _z;
 	private int _heading;
 	private int _instanceId;
 	
@@ -63,51 +68,117 @@ public class Location
 		_instanceId = obj.getInstanceId();
 	}
 	
-	public Location(L2Character obj)
+	/**
+	 * Get the x coordinate.
+	 * @return the x coordinate
+	 */
+	@Override
+	public int getX()
 	{
-		_x = obj.getX();
-		_y = obj.getY();
-		_z = obj.getZ();
-		_heading = obj.getHeading();
-		_instanceId = obj.getInstanceId();
+		return _x;
 	}
 	
-	public int getX()
+	/**
+	 * Set the x coordinate.
+	 * @param x the x coordinate
+	 */
+	public void setX(int x)
 	{
-		return _x;
+		_x = x;
 	}
 	
+	/**
+	 * Get the y coordinate.
+	 * @return the y coordinate
+	 */
+	@Override
 	public int getY()
 	{
 		return _y;
 	}
 	
+	/**
+	 * Set the y coordinate.
+	 * @param y the x coordinate
+	 */
+	public void setY(int y)
+	{
+		_y = y;
+	}
+	
+	/**
+	 * Get the z coordinate.
+	 * @return the z coordinate
+	 */
+	@Override
 	public int getZ()
 	{
 		return _z;
 	}
 	
+	/**
+	 * Set the z coordinate.
+	 * @param z the z coordinate
+	 */
+	public void setZ(int z)
+	{
+		_z = z;
+	}
+	
+	/**
+	 * Get the heading.
+	 * @return the heading
+	 */
 	public int getHeading()
 	{
 		return _heading;
 	}
 	
-	public int getInstanceId()
+	/**
+	 * Set the heading.
+	 * @param heading the heading
+	 */
+	public void setHeading(int heading)
 	{
-		return _instanceId;
+		_heading = heading;
 	}
 	
-	@Override
-	public String toString()
+	/**
+	 * Get the instance Id.
+	 * @return the instance Id
+	 */
+	public int getInstanceId()
 	{
-		return "[" + getClass().getSimpleName() + "] X: " + _x + " Y: " + _y + " Z: " + _z + " Heading: " + _heading + " InstanceId: " + _instanceId;
+		return _instanceId;
 	}
 	
 	/**
+	 * Set the instance Id.
 	 * @param instanceId the instance Id to set
 	 */
 	public void setInstanceId(int instanceId)
 	{
 		_instanceId = instanceId;
 	}
+	
+	@Override
+	public Location getLocation()
+	{
+		return this;
+	}
+	
+	public void setLocation(Location loc)
+	{
+		_x = loc.getX();
+		_y = loc.getY();
+		_z = loc.getZ();
+		_heading = loc.getHeading();
+		_instanceId = loc.getInstanceId();
+	}
+	
+	@Override
+	public String toString()
+	{
+		return "[" + getClass().getSimpleName() + "] X: " + getX() + " Y: " + getY() + " Z: " + getZ() + " Heading: " + _heading + " InstanceId: " + _instanceId;
+	}
 }

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/MobGroup.java

@@ -143,9 +143,9 @@ public final class MobGroup
 				int randX = Rnd.nextInt(MobGroupTable.RANDOM_RANGE);
 				int randY = Rnd.nextInt(MobGroupTable.RANDOM_RANGE);
 				
-				spawn.setLocx(x + (signX * randX));
-				spawn.setLocy(y + (signY * randY));
-				spawn.setLocz(z);
+				spawn.setX(x + (signX * randX));
+				spawn.setY(y + (signY * randY));
+				spawn.setZ(z);
 				spawn.stopRespawn();
 				
 				SpawnTable.getInstance().addNewSpawn(spawn, false);

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/WalkInfo.java

@@ -125,7 +125,7 @@ public class WalkInfo
 					}
 					case WalkingManager.REPEAT_TELE_FIRST:
 					{
-						npc.teleToLocation(npc.getSpawn().getLocx(), npc.getSpawn().getLocy(), npc.getSpawn().getLocz());
+						npc.teleToLocation(npc.getSpawn().getLocation(), 0);
 						_currentNode = 0;
 						break;
 					}

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

@@ -42,7 +42,6 @@ import com.l2jserver.gameserver.datatables.ItemTable;
 import com.l2jserver.gameserver.datatables.ManorData;
 import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager;
 import com.l2jserver.gameserver.instancemanager.WalkingManager;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2CommandChannel;
 import com.l2jserver.gameserver.model.L2DropCategory;
 import com.l2jserver.gameserver.model.L2DropData;
@@ -2502,7 +2501,7 @@ public class L2Attackable extends L2Npc
 		
 		if (hasAI() && (getSpawn() != null))
 		{
-			getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(getSpawn().getLocx(), getSpawn().getLocy(), getSpawn().getLocz(), 0));
+			getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLocation());
 		}
 	}
 	

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

@@ -59,7 +59,6 @@ import com.l2jserver.gameserver.model.ChanceSkillList;
 import com.l2jserver.gameserver.model.CharEffectList;
 import com.l2jserver.gameserver.model.FusionSkill;
 import com.l2jserver.gameserver.model.L2AccessLevel;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2Object;
 import com.l2jserver.gameserver.model.L2Party;
 import com.l2jserver.gameserver.model.L2World;
@@ -3604,11 +3603,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
 		
 		/**
 		 * Accessor to L2Character stopMove() method.
-		 * @param pos
+		 * @param loc
 		 */
-		public void stopMove(L2CharPosition pos)
+		public void stopMove(Location loc)
 		{
-			L2Character.this.stopMove(pos);
+			L2Character.this.stopMove(loc);
 		}
 		
 		/**
@@ -4075,11 +4074,6 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
 		_heading = heading;
 	}
 	
-	public Location getLocation()
-	{
-		return new Location(getX(), getY(), getZ(), getHeading(), getInstanceId());
-	}
-	
 	public final int getXdestination()
 	{
 		MoveData m = _move;
@@ -4449,14 +4443,14 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
 	 * <li>Remove object from _knownObjects and _knownPlayer of all surrounding L2WorldRegion L2Characters</li>
 	 * </ul>
 	 * <FONT COLOR=#FF0000><B><U>Caution</U>: This method DOESN'T send Server->Client packet StopMove/StopRotation</B></FONT>
-	 * @param pos
+	 * @param loc
 	 */
-	public void stopMove(L2CharPosition pos)
+	public void stopMove(Location loc)
 	{
-		stopMove(pos, false);
+		stopMove(loc, false);
 	}
 	
-	public void stopMove(L2CharPosition pos, boolean updateKnownObjects)
+	public void stopMove(Location loc, boolean updateKnownObjects)
 	{
 		// Delete movement data of the L2Character
 		_move = null;
@@ -4465,11 +4459,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
 		// getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
 		
 		// Set the current position (x,y,z), its current L2WorldRegion if necessary and its heading
-		// All data are contained in a L2CharPosition object
-		if (pos != null)
+		// All data are contained in a Location object
+		if (loc != null)
 		{
-			getPosition().setXYZ(pos.x, pos.y, pos.z);
-			setHeading(pos.heading);
+			getPosition().setXYZ(loc.getX(), loc.getY(), loc.getZ());
+			setHeading(loc.getHeading());
 			revalidateZone(true);
 		}
 		broadcastPacket(new StopMove(this));
@@ -4563,7 +4557,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
 	 * <FONT COLOR=#FF0000><B><U>Caution</U>: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.</B></FONT><br>
 	 * <B><U>Example of use</U>:</B>
 	 * <ul>
-	 * <li>AI : onIntentionMoveTo(L2CharPosition), onIntentionPickUp(L2Object), onIntentionInteract(L2Object)</li>
+	 * <li>AI : onIntentionMoveTo(Location), onIntentionPickUp(L2Object), onIntentionInteract(L2Object)</li>
 	 * <li>FollowTask</li>
 	 * </ul>
 	 * @param x The X position of the destination

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

@@ -31,7 +31,6 @@ import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.ai.L2CharacterAI;
 import com.l2jserver.gameserver.instancemanager.MapRegionManager;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2World;
 import com.l2jserver.gameserver.model.L2WorldRegion;
 import com.l2jserver.gameserver.model.Location;
@@ -112,7 +111,7 @@ public abstract class L2Vehicle extends L2Character
 				getStat().setRotationSpeed(point.rotationSpeed);
 			}
 			
-			getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(point.x, point.y, point.z, 0));
+			getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(point.x, point.y, point.z, 0));
 			return;
 		}
 		getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
@@ -390,13 +389,13 @@ public abstract class L2Vehicle extends L2Character
 	}
 	
 	@Override
-	public void stopMove(L2CharPosition pos, boolean updateKnownObjects)
+	public void stopMove(Location loc, boolean updateKnownObjects)
 	{
 		_move = null;
-		if (pos != null)
+		if (loc != null)
 		{
-			setXYZ(pos.x, pos.y, pos.z);
-			setHeading(pos.heading);
+			setXYZ(loc.getX(), loc.getY(), loc.getZ());
+			setHeading(loc.getHeading());
 			revalidateZone(true);
 		}
 		

+ 0 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/events/listeners/IEventListener.java

@@ -18,7 +18,6 @@
  */
 package com.l2jserver.gameserver.model.actor.events.listeners;
 
-
 /**
  * @author UnAfraid
  */

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

@@ -20,7 +20,6 @@ package com.l2jserver.gameserver.model.actor.instance;
 
 import com.l2jserver.gameserver.ai.L2AirShipAI;
 import com.l2jserver.gameserver.instancemanager.AirShipManager;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.L2Vehicle;
 import com.l2jserver.gameserver.model.actor.templates.L2CharTemplate;
@@ -160,9 +159,9 @@ public class L2AirShipInstance extends L2Vehicle
 	}
 	
 	@Override
-	public void stopMove(L2CharPosition pos, boolean updateKnownObjects)
+	public void stopMove(Location loc, boolean updateKnownObjects)
 	{
-		super.stopMove(pos, updateKnownObjects);
+		super.stopMove(loc, updateKnownObjects);
 		
 		broadcastPacket(new ExStopMoveAirShip(this));
 	}

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

@@ -21,7 +21,6 @@ package com.l2jserver.gameserver.model.actor.instance;
 import java.util.logging.Logger;
 
 import com.l2jserver.gameserver.ai.L2BoatAI;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.L2Vehicle;
 import com.l2jserver.gameserver.model.actor.templates.L2CharTemplate;
@@ -78,9 +77,9 @@ public class L2BoatInstance extends L2Vehicle
 	}
 	
 	@Override
-	public void stopMove(L2CharPosition pos, boolean updateKnownObjects)
+	public void stopMove(Location loc, boolean updateKnownObjects)
 	{
-		super.stopMove(pos, updateKnownObjects);
+		super.stopMove(loc, updateKnownObjects);
 		
 		broadcastPacket(new VehicleStarted(this, 0));
 		broadcastPacket(new VehicleInfo(this));

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

@@ -27,7 +27,6 @@ import com.l2jserver.gameserver.ai.L2SpecialSiegeGuardAI;
 import com.l2jserver.gameserver.instancemanager.CastleManager;
 import com.l2jserver.gameserver.instancemanager.FortManager;
 import com.l2jserver.gameserver.instancemanager.TerritoryWarManager;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.actor.L2Attackable;
 import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.L2Playable;
@@ -140,7 +139,7 @@ public class L2DefenderInstance extends L2Attackable
 		{
 			return;
 		}
-		if (!isInsideRadius(getSpawn().getLocx(), getSpawn().getLocy(), 40, false))
+		if (!isInsideRadius(getSpawn().getX(), getSpawn().getY(), 40, false))
 		{
 			if (Config.DEBUG)
 			{
@@ -151,7 +150,7 @@ public class L2DefenderInstance extends L2Attackable
 			
 			if (hasAI())
 			{
-				getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(getSpawn().getLocx(), getSpawn().getLocy(), getSpawn().getLocz(), 0));
+				getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLocation());
 			}
 		}
 	}

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2DoorInstance.java

@@ -34,9 +34,9 @@ import com.l2jserver.gameserver.instancemanager.ClanHallManager;
 import com.l2jserver.gameserver.instancemanager.FortManager;
 import com.l2jserver.gameserver.instancemanager.InstanceManager;
 import com.l2jserver.gameserver.instancemanager.TerritoryWarManager;
-import com.l2jserver.gameserver.model.L2CharPosition;
 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.L2Playable;
 import com.l2jserver.gameserver.model.actor.knownlist.DoorKnownList;
@@ -134,7 +134,7 @@ public class L2DoorInstance extends L2Character
 		}
 		
 		@Override
-		public void stopMove(L2CharPosition pos)
+		public void stopMove(Location loc)
 		{
 		}
 		

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

@@ -25,7 +25,6 @@ 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.L2CharPosition;
 import com.l2jserver.gameserver.model.L2Spawn;
 import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.L2Summon;
@@ -102,7 +101,7 @@ public class L2FortCommanderInstance extends L2DefenderInstance
 	@Override
 	public void returnHome()
 	{
-		if (!isInsideRadius(getSpawn().getLocx(), getSpawn().getLocy(), 200, false))
+		if (!isInsideRadius(getSpawn().getX(), getSpawn().getY(), 200, false))
 		{
 			if (Config.DEBUG)
 			{
@@ -113,7 +112,7 @@ public class L2FortCommanderInstance extends L2DefenderInstance
 			
 			if (hasAI())
 			{
-				getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(getSpawn().getLocx(), getSpawn().getLocy(), getSpawn().getLocz(), 0));
+				getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLocation());
 			}
 		}
 	}

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

@@ -25,7 +25,6 @@ import com.l2jserver.Config;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.ai.L2AttackableAI;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2World;
 import com.l2jserver.gameserver.model.L2WorldRegion;
 import com.l2jserver.gameserver.model.actor.L2Attackable;
@@ -105,11 +104,11 @@ public class L2GuardInstance extends L2Attackable
 	@Override
 	public void returnHome()
 	{
-		if (!isInsideRadius(getSpawn().getLocx(), getSpawn().getLocy(), 150, false))
+		if (!isInsideRadius(getSpawn().getX(), getSpawn().getY(), 150, false))
 		{
 			clearAggroList();
 			
-			getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(getSpawn().getLocx(), getSpawn().getLocy(), getSpawn().getLocz(), 0));
+			getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLocation());
 		}
 	}
 	

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

@@ -371,7 +371,7 @@ public class L2PetInstance extends L2Summon
 	{
 		for (L2ItemInstance item : getInventory().getItems())
 		{
-			if ((item.getLocation() == L2ItemInstance.ItemLocation.PET_EQUIP) && (item.getItem().getBodyPart() == L2Item.SLOT_R_HAND))
+			if ((item.getItemLocation() == L2ItemInstance.ItemLocation.PET_EQUIP) && (item.getItem().getBodyPart() == L2Item.SLOT_R_HAND))
 			{
 				return item;
 			}

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

@@ -154,9 +154,9 @@ public class L2RaidBossInstance extends L2MonsterInstance
 			return;
 		}
 		
-		final int spawnX = spawn.getLocx();
-		final int spawnY = spawn.getLocy();
-		final int spawnZ = spawn.getLocz();
+		final int spawnX = spawn.getX();
+		final int spawnY = spawn.getY();
+		final int spawnZ = spawn.getZ();
 		
 		if (!isInCombat() && !isMovementDisabled())
 		{

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2StaticObjectInstance.java

@@ -19,7 +19,7 @@
 package com.l2jserver.gameserver.model.actor.instance;
 
 import com.l2jserver.gameserver.ai.L2CharacterAI;
-import com.l2jserver.gameserver.model.L2CharPosition;
+import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.knownlist.StaticObjectKnownList;
 import com.l2jserver.gameserver.model.actor.stat.StaticObjStat;
@@ -65,7 +65,7 @@ public final class L2StaticObjectInstance extends L2Character
 		}
 		
 		@Override
-		public void stopMove(L2CharPosition pos)
+		public void stopMove(Location loc)
 		{
 		}
 		

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/status/PcStatus.java

@@ -202,7 +202,7 @@ public class PcStatus extends PlayableStatus
 						}
 					}
 					
-					if (attacker instanceof L2Playable && caster.getCurrentCp() > 0)
+					if ((attacker instanceof L2Playable) && (caster.getCurrentCp() > 0))
 					{
 						if (caster.getCurrentCp() > transferDmg)
 						{
@@ -214,7 +214,7 @@ public class PcStatus extends PlayableStatus
 							caster.getStatus().reduceCp((int) caster.getCurrentCp());
 						}
 					}
-
+					
 					if (membersInRange > 0)
 					{
 						caster.reduceCurrentHp(transferDmg / membersInRange, attacker, null);

+ 17 - 16
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/status/SummonStatus.java

@@ -52,31 +52,32 @@ public class SummonStatus extends PlayableStatus
 		{
 			attackerPlayer.setDuelState(Duel.DUELSTATE_INTERRUPTED);
 		}
-
+		
 		final L2PcInstance caster = getActiveChar().getTransferingDamageTo();
 		if (getActiveChar().getOwner().getParty() != null)
 		{
-			if (caster != null
-					&& Util.checkIfInRange(1000, getActiveChar(), caster, true)
-					&& !caster.isDead()
-					&& getActiveChar().getParty().getMembers().contains(caster))
+			if ((caster != null) && Util.checkIfInRange(1000, getActiveChar(), caster, true) && !caster.isDead() && getActiveChar().getParty().getMembers().contains(caster))
 			{
 				int transferDmg = 0;
-
-				transferDmg = (int) value * (int) getActiveChar().getStat().calcStat(Stats.TRANSFER_DAMAGE_TO_PLAYER, 0, null, null) / 100;
+				
+				transferDmg = ((int) value * (int) getActiveChar().getStat().calcStat(Stats.TRANSFER_DAMAGE_TO_PLAYER, 0, null, null)) / 100;
 				transferDmg = Math.min((int) caster.getCurrentHp() - 1, transferDmg);
 				if (transferDmg > 0)
 				{
 					int membersInRange = 0;
 					for (L2PcInstance member : caster.getParty().getMembers())
 					{
-						if (Util.checkIfInRange(1000, member, caster, false) && member != caster)
+						if (Util.checkIfInRange(1000, member, caster, false) && (member != caster))
+						{
 							membersInRange++;
+						}
 					}
-					if (attacker instanceof L2Playable && caster.getCurrentCp() > 0)
+					if ((attacker instanceof L2Playable) && (caster.getCurrentCp() > 0))
 					{
 						if (caster.getCurrentCp() > transferDmg)
+						{
 							caster.getStatus().reduceCp(transferDmg);
+						}
 						else
 						{
 							transferDmg = (int) (transferDmg - caster.getCurrentCp());
@@ -91,27 +92,27 @@ public class SummonStatus extends PlayableStatus
 				}
 			}
 		}
-		else if (caster != null && caster == getActiveChar().getOwner()
-				&& Util.checkIfInRange(1000, getActiveChar(), caster, true)
-				&& !caster.isDead()) // when no party, transfer only to owner (caster)
+		else if ((caster != null) && (caster == getActiveChar().getOwner()) && Util.checkIfInRange(1000, getActiveChar(), caster, true) && !caster.isDead()) // when no party, transfer only to owner (caster)
 		{
 			int transferDmg = 0;
-
-			transferDmg = (int) value * (int) getActiveChar().getStat().calcStat(Stats.TRANSFER_DAMAGE_TO_PLAYER, 0, null, null) / 100;
+			
+			transferDmg = ((int) value * (int) getActiveChar().getStat().calcStat(Stats.TRANSFER_DAMAGE_TO_PLAYER, 0, null, null)) / 100;
 			transferDmg = Math.min((int) caster.getCurrentHp() - 1, transferDmg);
 			if (transferDmg > 0)
 			{
-				if (attacker instanceof L2Playable && caster.getCurrentCp() > 0)
+				if ((attacker instanceof L2Playable) && (caster.getCurrentCp() > 0))
 				{
 					if (caster.getCurrentCp() > transferDmg)
+					{
 						caster.getStatus().reduceCp(transferDmg);
+					}
 					else
 					{
 						transferDmg = (int) (transferDmg - caster.getCurrentCp());
 						caster.getStatus().reduceCp((int) caster.getCurrentCp());
 					}
 				}
-
+				
 				caster.reduceCurrentHp(transferDmg, attacker, null);
 				value -= transferDmg;
 			}

+ 6 - 6
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/BlockCheckerEngine.java

@@ -486,9 +486,9 @@ public final class BlockCheckerEngine
 				for (int i = 0; i < _numOfBoxes; i++)
 				{
 					L2Spawn spawn = new L2Spawn(template);
-					spawn.setLocx(_arenaCoordinates[_arena][4] + Rnd.get(-400, 400));
-					spawn.setLocy(_arenaCoordinates[_arena][5] + Rnd.get(-400, 400));
-					spawn.setLocz(_zCoord);
+					spawn.setX(_arenaCoordinates[_arena][4] + Rnd.get(-400, 400));
+					spawn.setY(_arenaCoordinates[_arena][5] + Rnd.get(-400, 400));
+					spawn.setZ(_zCoord);
 					spawn.setAmount(1);
 					spawn.setHeading(1);
 					spawn.setRespawnDelay(1);
@@ -522,9 +522,9 @@ public final class BlockCheckerEngine
 				try
 				{
 					final L2Spawn girlSpawn = new L2Spawn(girl);
-					girlSpawn.setLocx(_arenaCoordinates[_arena][4] + Rnd.get(-400, 400));
-					girlSpawn.setLocy(_arenaCoordinates[_arena][5] + Rnd.get(-400, 400));
-					girlSpawn.setLocz(_zCoord);
+					girlSpawn.setX(_arenaCoordinates[_arena][4] + Rnd.get(-400, 400));
+					girlSpawn.setY(_arenaCoordinates[_arena][5] + Rnd.get(-400, 400));
+					girlSpawn.setZ(_zCoord);
 					girlSpawn.setAmount(1);
 					girlSpawn.setHeading(1);
 					girlSpawn.setRespawnDelay(1);

+ 12 - 12
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Fort.java

@@ -1252,9 +1252,9 @@ public class Fort
 					{
 						spawnDat = new L2Spawn(template);
 						spawnDat.setAmount(1);
-						spawnDat.setLocx(rs.getInt("x"));
-						spawnDat.setLocy(rs.getInt("y"));
-						spawnDat.setLocz(rs.getInt("z"));
+						spawnDat.setX(rs.getInt("x"));
+						spawnDat.setY(rs.getInt("y"));
+						spawnDat.setZ(rs.getInt("z"));
 						spawnDat.setHeading(rs.getInt("heading"));
 						spawnDat.setRespawnDelay(60);
 						SpawnTable.getInstance().addNewSpawn(spawnDat, false);
@@ -1293,9 +1293,9 @@ public class Fort
 					{
 						spawnDat = new L2Spawn(template);
 						spawnDat.setAmount(1);
-						spawnDat.setLocx(rs.getInt("x"));
-						spawnDat.setLocy(rs.getInt("y"));
-						spawnDat.setLocz(rs.getInt("z"));
+						spawnDat.setX(rs.getInt("x"));
+						spawnDat.setY(rs.getInt("y"));
+						spawnDat.setZ(rs.getInt("z"));
 						spawnDat.setHeading(rs.getInt("heading"));
 						spawnDat.setRespawnDelay(60);
 						_siegeNpcs.add(spawnDat);
@@ -1332,9 +1332,9 @@ public class Fort
 					{
 						spawnDat = new L2Spawn(template);
 						spawnDat.setAmount(1);
-						spawnDat.setLocx(rs.getInt("x"));
-						spawnDat.setLocy(rs.getInt("y"));
-						spawnDat.setLocz(rs.getInt("z"));
+						spawnDat.setX(rs.getInt("x"));
+						spawnDat.setY(rs.getInt("y"));
+						spawnDat.setZ(rs.getInt("z"));
 						spawnDat.setHeading(rs.getInt("heading"));
 						spawnDat.setRespawnDelay(60);
 						_npcCommanders.add(spawnDat);
@@ -1376,9 +1376,9 @@ public class Fort
 					{
 						spawnDat = new L2Spawn(template);
 						spawnDat.setAmount(1);
-						spawnDat.setLocx(rs.getInt("x"));
-						spawnDat.setLocy(rs.getInt("y"));
-						spawnDat.setLocz(rs.getInt("z"));
+						spawnDat.setX(rs.getInt("x"));
+						spawnDat.setY(rs.getInt("y"));
+						spawnDat.setZ(rs.getInt("z"));
 						spawnDat.setHeading(rs.getInt("heading"));
 						spawnDat.setRespawnDelay(60);
 						_specialEnvoys.add(spawnDat);

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

@@ -1167,9 +1167,9 @@ public class FortSiege implements Siegable
 				{
 					spawnDat = new L2Spawn(template1);
 					spawnDat.setAmount(1);
-					spawnDat.setLocx(_sp.getLocation().getX());
-					spawnDat.setLocy(_sp.getLocation().getY());
-					spawnDat.setLocz(_sp.getLocation().getZ());
+					spawnDat.setX(_sp.getLocation().getX());
+					spawnDat.setY(_sp.getLocation().getY());
+					spawnDat.setZ(_sp.getLocation().getZ());
 					spawnDat.setHeading(_sp.getLocation().getHeading());
 					spawnDat.setRespawnDelay(60);
 					spawnDat.doSpawn();

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Instance.java

@@ -578,9 +578,9 @@ public final class Instance
 								if (npcTemplate != null)
 								{
 									spawnDat = new L2Spawn(npcTemplate);
-									spawnDat.setLocx(x);
-									spawnDat.setLocy(y);
-									spawnDat.setLocz(z);
+									spawnDat.setX(x);
+									spawnDat.setY(y);
+									spawnDat.setZ(z);
 									spawnDat.setAmount(1);
 									spawnDat.setHeading(heading);
 									spawnDat.setRespawnDelay(respawn, respawnRandom);

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/L2Event.java

@@ -177,9 +177,9 @@ public class L2Event
 		{
 			L2Spawn spawn = new L2Spawn(template);
 			
-			spawn.setLocx(target.getX() + 50);
-			spawn.setLocy(target.getY() + 50);
-			spawn.setLocz(target.getZ());
+			spawn.setX(target.getX() + 50);
+			spawn.setY(target.getY() + 50);
+			spawn.setZ(target.getZ());
 			spawn.setAmount(1);
 			spawn.setHeading(target.getHeading());
 			spawn.stopRespawn();

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Siege.java

@@ -1538,9 +1538,9 @@ public class Siege implements Siegable
 				closestCt = null;
 				distanceClosest = Integer.MAX_VALUE;
 				
-				x = spawn.getLocx();
-				y = spawn.getLocy();
-				z = spawn.getLocz();
+				x = spawn.getX();
+				y = spawn.getY();
+				z = spawn.getZ();
 				
 				for (L2ControlTowerInstance ct : _controlTowers)
 				{

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/TvTEvent.java

@@ -132,9 +132,9 @@ public class TvTEvent
 		{
 			_npcSpawn = new L2Spawn(tmpl);
 			
-			_npcSpawn.setLocx(Config.TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0]);
-			_npcSpawn.setLocy(Config.TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1]);
-			_npcSpawn.setLocz(Config.TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2]);
+			_npcSpawn.setX(Config.TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0]);
+			_npcSpawn.setY(Config.TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1]);
+			_npcSpawn.setZ(Config.TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2]);
 			_npcSpawn.setAmount(1);
 			_npcSpawn.setHeading(Config.TVT_EVENT_PARTICIPATION_NPC_COORDINATES[3]);
 			_npcSpawn.setRespawnDelay(1);

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/clanhall/ClanHallSiegeEngine.java

@@ -162,9 +162,9 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
 						final int npcId = rset.getInt("npcId");
 						final L2NpcTemplate template = NpcTable.getInstance().getTemplate(npcId);
 						L2Spawn spawn = new L2Spawn(template);
-						spawn.setLocx(rset.getInt("x"));
-						spawn.setLocy(rset.getInt("y"));
-						spawn.setLocz(rset.getInt("z"));
+						spawn.setX(rset.getInt("x"));
+						spawn.setY(rset.getInt("y"));
+						spawn.setZ(rset.getInt("z"));
 						spawn.setHeading(rset.getInt("heading"));
 						spawn.setRespawnDelay(rset.getInt("respawnDelay"));
 						spawn.setAmount(1);

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/fishing/L2Fishing.java

@@ -377,9 +377,9 @@ public class L2Fishing implements Runnable
 			try
 			{
 				L2Spawn spawn = new L2Spawn(monster);
-				spawn.setLocx(_fisher.getX());
-				spawn.setLocy(_fisher.getY());
-				spawn.setLocz(_fisher.getZ());
+				spawn.setX(_fisher.getX());
+				spawn.setY(_fisher.getY());
+				spawn.setZ(_fisher.getZ());
 				spawn.setAmount(1);
 				spawn.setHeading(_fisher.getHeading());
 				spawn.stopRespawn();

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/holders/NpcRoutesHolder.java

@@ -55,7 +55,7 @@ public class NpcRoutesHolder
 	{
 		if (npc.getSpawn() != null)
 		{
-			String key = getUniqueKey(npc.getSpawn().getSpawnLocation());
+			String key = getUniqueKey(npc.getSpawn().getLocation());
 			return _correspondences.containsKey(key) ? _correspondences.get(key) : "";
 		}
 		return "";

+ 11 - 19
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2CharPosition.java → L2J_Server_BETA/java/com/l2jserver/gameserver/model/interfaces/IPositionable.java

@@ -16,29 +16,21 @@
  * 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;
+package com.l2jserver.gameserver.model.interfaces;
+
+import com.l2jserver.gameserver.model.Location;
 
 /**
- * This class permit to pass (x, y, z, heading) position data to method.
+ * Positionable objects interface.
+ * @author Zoey76
  */
-public final class L2CharPosition
+public interface IPositionable
 {
+	public int getX();
 	
-	public final int x, y, z, heading;
+	public int getY();
 	
-	/**
-	 * Constructor of L2CharPosition.
-	 * @param pX
-	 * @param pY
-	 * @param pZ
-	 * @param pHeading
-	 */
-	public L2CharPosition(int pX, int pY, int pZ, int pHeading)
-	{
-		x = pX;
-		y = pY;
-		z = pZ;
-		heading = pHeading;
-	}
+	public int getZ();
 	
-}
+	public Location getLocation();
+}

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/itemauction/ItemAuctionInstance.java

@@ -516,7 +516,7 @@ public final class ItemAuctionInstance
 			else
 			{
 				item.setOwnerId(bid.getPlayerObjId());
-				item.setLocation(ItemLocation.WAREHOUSE);
+				item.setItemLocation(ItemLocation.WAREHOUSE);
 				item.updateDatabase();
 				L2World.getInstance().removeObject(item);
 				

+ 4 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/model/itemcontainer/Inventory.java

@@ -819,7 +819,7 @@ public abstract class Inventory extends ItemContainer
 			
 			removeItem(item);
 			item.setOwnerId(process, 0, actor, reference);
-			item.setLocation(ItemLocation.VOID);
+			item.setItemLocation(ItemLocation.VOID);
 			item.setLastChange(L2ItemInstance.REMOVED);
 			
 			item.updateDatabase();
@@ -1066,7 +1066,7 @@ public abstract class Inventory extends ItemContainer
 			{
 				_paperdoll[slot] = null;
 				// Put old item from paperdoll slot to base location
-				old.setLocation(getBaseLocation());
+				old.setItemLocation(getBaseLocation());
 				old.setLastChange(L2ItemInstance.MODIFIED);
 				// Get the mask for paperdoll
 				int mask = 0;
@@ -1095,7 +1095,7 @@ public abstract class Inventory extends ItemContainer
 			if (item != null)
 			{
 				_paperdoll[slot] = item;
-				item.setLocation(getEquipLocation(), slot);
+				item.setItemLocation(getEquipLocation(), slot);
 				item.setLastChange(L2ItemInstance.MODIFIED);
 				_wearedMask |= item.getItem().getItemMask();
 				for (PaperdollListener listener : _paperdollListeners)
@@ -1677,7 +1677,7 @@ public abstract class Inventory extends ItemContainer
 						
 						if (!player.canOverrideCond(PcCondOverride.ITEM_CONDITIONS) && !player.isHero() && item.isHeroItem())
 						{
-							item.setLocation(ItemLocation.INVENTORY);
+							item.setItemLocation(ItemLocation.INVENTORY);
 						}
 					}
 					

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/itemcontainer/ItemContainer.java

@@ -242,7 +242,7 @@ public abstract class ItemContainer
 		else
 		{
 			item.setOwnerId(process, getOwnerId(), actor, reference);
-			item.setLocation(getBaseLocation());
+			item.setItemLocation(getBaseLocation());
 			item.setLastChange((L2ItemInstance.ADDED));
 			
 			// Add item in inventory
@@ -304,7 +304,7 @@ public abstract class ItemContainer
 				
 				item = ItemTable.getInstance().createItem(process, itemId, template.isStackable() ? count : 1, actor, reference);
 				item.setOwnerId(getOwnerId());
-				item.setLocation(getBaseLocation());
+				item.setItemLocation(getBaseLocation());
 				item.setLastChange(L2ItemInstance.ADDED);
 				
 				// Add item in inventory

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/itemcontainer/Mail.java

@@ -76,7 +76,7 @@ public class Mail extends ItemContainer
 				continue;
 			}
 			
-			item.setLocation(getBaseLocation(), messageId);
+			item.setItemLocation(getBaseLocation(), messageId);
 		}
 		
 		updateDatabase();
@@ -92,7 +92,7 @@ public class Mail extends ItemContainer
 			}
 			if (wh == null)
 			{
-				item.setLocation(ItemLocation.WAREHOUSE);
+				item.setItemLocation(ItemLocation.WAREHOUSE);
 			}
 			else
 			{
@@ -105,7 +105,7 @@ public class Mail extends ItemContainer
 	protected void addItem(L2ItemInstance item)
 	{
 		super.addItem(item);
-		item.setLocation(getBaseLocation(), _messageId);
+		item.setItemLocation(getBaseLocation(), _messageId);
 	}
 	
 	/*

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/itemcontainer/PcInventory.java

@@ -315,7 +315,7 @@ public class PcInventory extends Inventory
 			}
 			else if (feightable)
 			{
-				if ((item.getLocation() == ItemLocation.INVENTORY) && item.isFreightable())
+				if ((item.getItemLocation() == ItemLocation.INVENTORY) && item.isFreightable())
 				{
 					list.add(item);
 				}

+ 10 - 10
L2J_Server_BETA/java/com/l2jserver/gameserver/model/items/instance/L2ItemInstance.java

@@ -398,9 +398,9 @@ public final class L2ItemInstance extends L2Object
 	 * Sets the location of the item
 	 * @param loc : ItemLocation (enumeration)
 	 */
-	public void setLocation(ItemLocation loc)
+	public void setItemLocation(ItemLocation loc)
 	{
-		setLocation(loc, 0);
+		setItemLocation(loc, 0);
 	}
 	
 	/**
@@ -410,7 +410,7 @@ public final class L2ItemInstance extends L2Object
 	 * @param loc : ItemLocation (enumeration)
 	 * @param loc_data : int designating the slot where the item is stored or the village for freights
 	 */
-	public void setLocation(ItemLocation loc, int loc_data)
+	public void setItemLocation(ItemLocation loc, int loc_data)
 	{
 		if ((loc == _loc) && (loc_data == _locData))
 		{
@@ -429,7 +429,7 @@ public final class L2ItemInstance extends L2Object
 		giveSkillsToOwner();
 	}
 	
-	public ItemLocation getLocation()
+	public ItemLocation getItemLocation()
 	{
 		return _loc;
 	}
@@ -543,7 +543,7 @@ public final class L2ItemInstance extends L2Object
 	 */
 	public int isEnchantable()
 	{
-		if ((getLocation() == ItemLocation.INVENTORY) || (getLocation() == ItemLocation.PAPERDOLL))
+		if ((getItemLocation() == ItemLocation.INVENTORY) || (getItemLocation() == ItemLocation.PAPERDOLL))
 		{
 			return getItem().isEnchantable();
 		}
@@ -1372,7 +1372,7 @@ public final class L2ItemInstance extends L2Object
 					player.broadcastUserInfo();
 				}
 				
-				if (getLocation() != ItemLocation.WAREHOUSE)
+				if (getItemLocation() != ItemLocation.WAREHOUSE)
 				{
 					// destroy
 					player.getInventory().destroyItem("L2ItemInstance", this, player, null);
@@ -1402,7 +1402,7 @@ public final class L2ItemInstance extends L2Object
 				{
 					scheduleConsumeManaTask();
 				}
-				if (getLocation() != ItemLocation.WAREHOUSE)
+				if (getItemLocation() != ItemLocation.WAREHOUSE)
 				{
 					InventoryUpdate iu = new InventoryUpdate();
 					iu.addModifiedItem(this);
@@ -1870,7 +1870,7 @@ public final class L2ItemInstance extends L2Object
 				player.broadcastUserInfo();
 			}
 			
-			if (getLocation() != ItemLocation.WAREHOUSE)
+			if (getItemLocation() != ItemLocation.WAREHOUSE)
 			{
 				// destroy
 				player.getInventory().destroyItem("L2ItemInstance", this, player, null);
@@ -2016,7 +2016,7 @@ public final class L2ItemInstance extends L2Object
 	
 	public boolean isElementable()
 	{
-		if ((getLocation() == ItemLocation.INVENTORY) || (getLocation() == ItemLocation.PAPERDOLL))
+		if ((getItemLocation() == ItemLocation.INVENTORY) || (getItemLocation() == ItemLocation.PAPERDOLL))
 		{
 			return getItem().isElementable();
 		}
@@ -2058,7 +2058,7 @@ public final class L2ItemInstance extends L2Object
 	
 	public boolean hasPassiveSkills()
 	{
-		return (getItemType() == L2EtcItemType.RUNE) && (getLocation() == ItemLocation.INVENTORY) && (getOwnerId() > 0) && getItem().hasSkills();
+		return (getItemType() == L2EtcItemType.RUNE) && (getItemLocation() == ItemLocation.INVENTORY) && (getOwnerId() > 0) && getItem().hasSkills();
 	}
 	
 	public void giveSkillsToOwner()

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/quest/Quest.java

@@ -2768,9 +2768,9 @@ public class Quest extends ManagedScript
 				L2Spawn spawn = new L2Spawn(template);
 				spawn.setInstanceId(instanceId);
 				spawn.setHeading(heading);
-				spawn.setLocx(x);
-				spawn.setLocy(y);
-				spawn.setLocz(z);
+				spawn.setX(x);
+				spawn.setY(y);
+				spawn.setZ(z);
 				spawn.stopRespawn();
 				result = spawn.spawnOne(isSummonSpawn);
 				

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/zone/type/L2BossZone.java

@@ -285,7 +285,7 @@ public class L2BossZone extends L2ZoneType
 							{
 								continue;
 							}
-							if (!raid.isInsideRadius(raid.getSpawn().getLocx(), raid.getSpawn().getLocy(), 150, false))
+							if (!raid.isInsideRadius(raid.getSpawn().getX(), raid.getSpawn().getY(), 150, false))
 							{
 								raid.returnHome();
 							}

+ 4 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/AbstractRefinePacket.java

@@ -28,6 +28,7 @@ import com.l2jserver.gameserver.model.items.L2Armor;
 import com.l2jserver.gameserver.model.items.L2Item;
 import com.l2jserver.gameserver.model.items.L2Weapon;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
+import com.l2jserver.gameserver.model.items.instance.L2ItemInstance.ItemLocation;
 import com.l2jserver.gameserver.network.SystemMessageId;
 
 public abstract class AbstractRefinePacket extends L2GameClientPacket
@@ -219,7 +220,7 @@ public abstract class AbstractRefinePacket extends L2GameClientPacket
 			return false;
 		}
 		// .. and located in inventory
-		if (gemStones.getLocation() != L2ItemInstance.ItemLocation.INVENTORY)
+		if (gemStones.getItemLocation() != ItemLocation.INVENTORY)
 		{
 			return false;
 		}
@@ -261,7 +262,7 @@ public abstract class AbstractRefinePacket extends L2GameClientPacket
 			return false;
 		}
 		// Lifestone must be located in inventory
-		if (refinerItem.getLocation() != L2ItemInstance.ItemLocation.INVENTORY)
+		if (refinerItem.getItemLocation() != ItemLocation.INVENTORY)
 		{
 			return false;
 		}
@@ -342,7 +343,7 @@ public abstract class AbstractRefinePacket extends L2GameClientPacket
 		}
 		
 		// Source item can be equipped or in inventory
-		switch (item.getLocation())
+		switch (item.getItemLocation())
 		{
 			case INVENTORY:
 			case PAPERDOLL:

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/CannotMoveAnymore.java

@@ -20,7 +20,7 @@ package com.l2jserver.gameserver.network.clientpackets;
 
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.ai.CtrlEvent;
-import com.l2jserver.gameserver.model.L2CharPosition;
+import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 
 /**
@@ -60,7 +60,7 @@ public final class CannotMoveAnymore extends L2GameClientPacket
 		}
 		if (player.getAI() != null)
 		{
-			player.getAI().notifyEvent(CtrlEvent.EVT_ARRIVED_BLOCKED, new L2CharPosition(_x, _y, _z, _heading));
+			player.getAI().notifyEvent(CtrlEvent.EVT_ARRIVED_BLOCKED, new Location(_x, _y, _z, _heading));
 		}
 		/*
 		 * if (player.getParty() != null) { player.getParty().broadcastToPartyMembers(player, new PartyMemberPosition(player)); }

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/MoveBackwardToLocation.java

@@ -23,7 +23,7 @@ import java.nio.BufferUnderflowException;
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.TaskPriority;
 import com.l2jserver.gameserver.ai.CtrlIntention;
-import com.l2jserver.gameserver.model.L2CharPosition;
+import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
@@ -140,7 +140,7 @@ public class MoveBackwardToLocation extends L2GameClientPacket
 				activeChar.sendPacket(ActionFailed.STATIC_PACKET);
 				return;
 			}
-			activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(_targetX, _targetY, _targetZ, 0));
+			activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(_targetX, _targetY, _targetZ));
 			
 			/*
 			 * if (activeChar.getParty() != null) activeChar.getParty().broadcastToPartyMembers(activeChar, new PartyMemberPosition(activeChar));

+ 4 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/MoveToLocationAirShip.java

@@ -21,8 +21,8 @@ package com.l2jserver.gameserver.network.clientpackets;
 import com.l2jserver.gameserver.TaskPriority;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.instancemanager.AirShipManager;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2World;
+import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.VehiclePathPoint;
 import com.l2jserver.gameserver.model.actor.instance.L2AirShipInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
@@ -87,7 +87,7 @@ public class MoveToLocationAirShip extends L2GameClientPacket
 				}
 				if (_param1 < L2World.GRACIA_MAX_X)
 				{
-					ship.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(_param1, _param2, z, 0));
+					ship.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(_param1, _param2, z));
 				}
 				break;
 			case 1:
@@ -105,7 +105,7 @@ public class MoveToLocationAirShip extends L2GameClientPacket
 				if (z < L2World.GRACIA_MAX_Z)
 				{
 					z = Math.min(z + STEP, L2World.GRACIA_MAX_Z);
-					ship.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(ship.getX(), ship.getY(), z, 0));
+					ship.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(ship.getX(), ship.getY(), z));
 				}
 				break;
 			case 3:
@@ -116,7 +116,7 @@ public class MoveToLocationAirShip extends L2GameClientPacket
 				if (z > L2World.GRACIA_MIN_Z)
 				{
 					z = Math.max(z - STEP, L2World.GRACIA_MIN_Z);
-					ship.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(ship.getX(), ship.getY(), z, 0));
+					ship.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(ship.getX(), ship.getY(), z));
 				}
 				break;
 			case 4:

+ 2 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestActionUse.java

@@ -30,7 +30,6 @@ import com.l2jserver.gameserver.datatables.PetDataTable;
 import com.l2jserver.gameserver.datatables.SkillTable;
 import com.l2jserver.gameserver.datatables.SummonSkillsTable;
 import com.l2jserver.gameserver.instancemanager.AirShipManager;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2Object;
 import com.l2jserver.gameserver.model.actor.L2Summon;
 import com.l2jserver.gameserver.model.actor.instance.L2BabyPetInstance;
@@ -330,7 +329,7 @@ public final class RequestActionUse extends L2GameClientPacket
 					if ((target != null) && (summon != target) && !summon.isMovementDisabled())
 					{
 						summon.setFollowStatus(false);
-						summon.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(target.getX(), target.getY(), target.getZ(), 0));
+						summon.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, target.getLocation());
 					}
 				}
 				break;
@@ -340,7 +339,7 @@ public final class RequestActionUse extends L2GameClientPacket
 					if ((target != null) && (summon != target) && !summon.isMovementDisabled())
 					{
 						summon.setFollowStatus(false);
-						summon.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(target.getX(), target.getY(), target.getZ(), 0));
+						summon.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, target.getLocation());
 					}
 				}
 				break;

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

@@ -32,7 +32,6 @@ import com.l2jserver.gameserver.handler.AdminCommandHandler;
 import com.l2jserver.gameserver.handler.BypassHandler;
 import com.l2jserver.gameserver.handler.IAdminCommandHandler;
 import com.l2jserver.gameserver.handler.IBypassHandler;
-import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2Object;
 import com.l2jserver.gameserver.model.L2World;
 import com.l2jserver.gameserver.model.actor.L2Npc;
@@ -383,7 +382,7 @@ public final class RequestBypassToServer extends L2GameClientPacket
 		{
 			L2Npc temp = (L2Npc) obj;
 			temp.setTarget(activeChar);
-			temp.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(activeChar.getX(), activeChar.getY(), activeChar.getZ(), 0));
+			temp.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, activeChar.getLocation());
 		}
 	}
 	

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

@@ -99,7 +99,7 @@ public class RequestExEnchantItemAttribute extends L2GameClientPacket
 			return;
 		}
 		
-		switch (item.getLocation())
+		switch (item.getItemLocation())
 		{
 			case INVENTORY:
 			case PAPERDOLL:

+ 2 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestMagicSkillUse.java

@@ -20,7 +20,7 @@ package com.l2jserver.gameserver.network.clientpackets;
 
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.ai.CtrlIntention;
-import com.l2jserver.gameserver.model.L2CharPosition;
+import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.actor.position.PcPosition;
 import com.l2jserver.gameserver.model.effects.L2EffectType;
@@ -109,8 +109,7 @@ public final class RequestMagicSkillUse extends L2GameClientPacket
 		if (((skill.getSkillType() == L2SkillType.BUFF) && (skill.getTargetType() == L2TargetType.SELF)) && (!activeChar.isInAirShip() || !activeChar.isInBoat()))
 		{
 			final PcPosition charPos = activeChar.getPosition();
-			final L2CharPosition stopPos = new L2CharPosition(charPos.getX(), charPos.getY(), charPos.getZ(), charPos.getHeading());
-			activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, stopPos);
+			activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(charPos.getX(), charPos.getY(), charPos.getZ(), charPos.getHeading()));
 		}
 	}
 	

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

@@ -258,7 +258,7 @@ public final class RequestPostAttachment extends L2GameClientPacket
 			{
 				L2ItemInstance paidAdena = ItemTable.getInstance().createItem("PayMail", ADENA_ID, adena, activeChar, null);
 				paidAdena.setOwnerId(msg.getSenderId());
-				paidAdena.setLocation(ItemLocation.INVENTORY);
+				paidAdena.setItemLocation(ItemLocation.INVENTORY);
 				paidAdena.updateDatabase(true);
 				L2World.getInstance().removeObject(paidAdena);
 			}

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestSaveInventoryOrder.java

@@ -63,9 +63,9 @@ public final class RequestSaveInventoryOrder extends L2GameClientPacket
 			for (InventoryOrder order : _order)
 			{
 				L2ItemInstance item = inventory.getItemByObjectId(order.objectID);
-				if ((item != null) && (item.getLocation() == ItemLocation.INVENTORY))
+				if ((item != null) && (item.getItemLocation() == ItemLocation.INVENTORY))
 				{
-					item.setLocation(ItemLocation.INVENTORY, order.order);
+					item.setItemLocation(ItemLocation.INVENTORY, order.order);
 				}
 			}
 		}

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

@@ -331,7 +331,7 @@ public final class RequestSendPost extends L2GameClientPacket
 				_log.warning("Error adding attachment for char " + player.getName() + " (newitem == null)");
 				continue;
 			}
-			newItem.setLocation(newItem.getLocation(), msg.getId());
+			newItem.setItemLocation(newItem.getItemLocation(), msg.getId());
 			
 			if (playerIU != null)
 			{