|
@@ -205,7 +205,7 @@ import com.l2jserver.gameserver.model.fishing.L2Fishing;
|
|
import com.l2jserver.gameserver.model.holders.ItemHolder;
|
|
import com.l2jserver.gameserver.model.holders.ItemHolder;
|
|
import com.l2jserver.gameserver.model.holders.PlayerEventHolder;
|
|
import com.l2jserver.gameserver.model.holders.PlayerEventHolder;
|
|
import com.l2jserver.gameserver.model.holders.SkillUseHolder;
|
|
import com.l2jserver.gameserver.model.holders.SkillUseHolder;
|
|
-import com.l2jserver.gameserver.model.interfaces.IPositionable;
|
|
|
|
|
|
+import com.l2jserver.gameserver.model.interfaces.ILocational;
|
|
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
|
|
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
|
|
import com.l2jserver.gameserver.model.itemcontainer.ItemContainer;
|
|
import com.l2jserver.gameserver.model.itemcontainer.ItemContainer;
|
|
import com.l2jserver.gameserver.model.itemcontainer.PcFreight;
|
|
import com.l2jserver.gameserver.model.itemcontainer.PcFreight;
|
|
@@ -330,7 +330,6 @@ import com.l2jserver.gameserver.scripting.scriptengine.listeners.player.Transfor
|
|
import com.l2jserver.gameserver.taskmanager.AttackStanceTaskManager;
|
|
import com.l2jserver.gameserver.taskmanager.AttackStanceTaskManager;
|
|
import com.l2jserver.gameserver.util.Broadcast;
|
|
import com.l2jserver.gameserver.util.Broadcast;
|
|
import com.l2jserver.gameserver.util.FloodProtectors;
|
|
import com.l2jserver.gameserver.util.FloodProtectors;
|
|
-import com.l2jserver.gameserver.util.Point3D;
|
|
|
|
import com.l2jserver.gameserver.util.Util;
|
|
import com.l2jserver.gameserver.util.Util;
|
|
import com.l2jserver.util.Rnd;
|
|
import com.l2jserver.util.Rnd;
|
|
|
|
|
|
@@ -543,7 +542,7 @@ public final class L2PcInstance extends L2Playable
|
|
|
|
|
|
/** Boat and AirShip */
|
|
/** Boat and AirShip */
|
|
private L2Vehicle _vehicle = null;
|
|
private L2Vehicle _vehicle = null;
|
|
- private Point3D _inVehiclePosition;
|
|
|
|
|
|
+ private Location _inVehiclePosition;
|
|
|
|
|
|
public ScheduledFuture<?> _taskforfish;
|
|
public ScheduledFuture<?> _taskforfish;
|
|
private MountType _mountType = MountType.NONE;
|
|
private MountType _mountType = MountType.NONE;
|
|
@@ -576,7 +575,7 @@ public final class L2PcInstance extends L2Playable
|
|
private boolean _observerMode = false;
|
|
private boolean _observerMode = false;
|
|
|
|
|
|
/** Stored from last ValidatePosition **/
|
|
/** Stored from last ValidatePosition **/
|
|
- private final Point3D _lastServerPosition = new Point3D(0, 0, 0);
|
|
|
|
|
|
+ private final Location _lastServerPosition = new Location(0, 0, 0);
|
|
|
|
|
|
/** The number of recommendation obtained by the L2PcInstance */
|
|
/** The number of recommendation obtained by the L2PcInstance */
|
|
private int _recomHave; // how much I was recommended by others
|
|
private int _recomHave; // how much I was recommended by others
|
|
@@ -703,7 +702,7 @@ public final class L2PcInstance extends L2Playable
|
|
private ScheduledFuture<?> _soulTask = null;
|
|
private ScheduledFuture<?> _soulTask = null;
|
|
|
|
|
|
// WorldPosition used by TARGET_SIGNET_GROUND
|
|
// WorldPosition used by TARGET_SIGNET_GROUND
|
|
- private Point3D _currentSkillWorldPosition;
|
|
|
|
|
|
+ private Location _currentSkillWorldPosition;
|
|
|
|
|
|
private L2AccessLevel _accessLevel;
|
|
private L2AccessLevel _accessLevel;
|
|
|
|
|
|
@@ -4353,12 +4352,12 @@ public final class L2PcInstance extends L2Playable
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public Point3D getCurrentSkillWorldPosition()
|
|
|
|
|
|
+ public Location getCurrentSkillWorldPosition()
|
|
{
|
|
{
|
|
return _currentSkillWorldPosition;
|
|
return _currentSkillWorldPosition;
|
|
}
|
|
}
|
|
|
|
|
|
- public void setCurrentSkillWorldPosition(Point3D worldPosition)
|
|
|
|
|
|
+ public void setCurrentSkillWorldPosition(Location worldPosition)
|
|
{
|
|
{
|
|
_currentSkillWorldPosition = worldPosition;
|
|
_currentSkillWorldPosition = worldPosition;
|
|
}
|
|
}
|
|
@@ -8895,7 +8894,7 @@ public final class L2PcInstance extends L2Playable
|
|
// Create and set a L2Object containing the target of the skill
|
|
// Create and set a L2Object containing the target of the skill
|
|
L2Object target = null;
|
|
L2Object target = null;
|
|
L2TargetType sklTargetType = skill.getTargetType();
|
|
L2TargetType sklTargetType = skill.getTargetType();
|
|
- Point3D worldPosition = getCurrentSkillWorldPosition();
|
|
|
|
|
|
+ Location worldPosition = getCurrentSkillWorldPosition();
|
|
|
|
|
|
if ((sklTargetType == L2TargetType.GROUND) && (worldPosition == null))
|
|
if ((sklTargetType == L2TargetType.GROUND) && (worldPosition == null))
|
|
{
|
|
{
|
|
@@ -11138,7 +11137,7 @@ public final class L2PcInstance extends L2Playable
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void teleToLocation(IPositionable loc, boolean allowRandomOffset)
|
|
|
|
|
|
+ public void teleToLocation(ILocational loc, boolean allowRandomOffset)
|
|
{
|
|
{
|
|
if ((getVehicle() != null) && !getVehicle().isTeleporting())
|
|
if ((getVehicle() != null) && !getVehicle().isTeleporting())
|
|
{
|
|
{
|
|
@@ -11147,7 +11146,7 @@ public final class L2PcInstance extends L2Playable
|
|
|
|
|
|
if (isFlyingMounted() && (loc.getZ() < -1005))
|
|
if (isFlyingMounted() && (loc.getZ() < -1005))
|
|
{
|
|
{
|
|
- loc.setZ(-1005);
|
|
|
|
|
|
+ super.teleToLocation(loc.getX(), loc.getY(), -1005, loc.getHeading(), loc.getInstanceId());
|
|
}
|
|
}
|
|
|
|
|
|
super.teleToLocation(loc, allowRandomOffset);
|
|
super.teleToLocation(loc, allowRandomOffset);
|
|
@@ -11237,23 +11236,14 @@ public final class L2PcInstance extends L2Playable
|
|
_lastServerPosition.setXYZ(x, y, z);
|
|
_lastServerPosition.setXYZ(x, y, z);
|
|
}
|
|
}
|
|
|
|
|
|
- public Point3D getLastServerPosition()
|
|
|
|
|
|
+ public Location getLastServerPosition()
|
|
{
|
|
{
|
|
return _lastServerPosition;
|
|
return _lastServerPosition;
|
|
}
|
|
}
|
|
|
|
|
|
- public boolean checkLastServerPosition(int x, int y, int z)
|
|
|
|
- {
|
|
|
|
- return _lastServerPosition.equals(x, y, z);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
public int getLastServerDistance(int x, int y, int z)
|
|
public int getLastServerDistance(int x, int y, int z)
|
|
{
|
|
{
|
|
- double dx = (x - _lastServerPosition.getX());
|
|
|
|
- double dy = (y - _lastServerPosition.getY());
|
|
|
|
- double dz = (z - _lastServerPosition.getZ());
|
|
|
|
-
|
|
|
|
- return (int) Math.sqrt((dx * dx) + (dy * dy) + (dz * dz));
|
|
|
|
|
|
+ return (int) Util.calculateDistance(x, y, z, _lastServerPosition.getX(), _lastServerPosition.getY(), _lastServerPosition.getZ(), true, false);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -11526,12 +11516,12 @@ public final class L2PcInstance extends L2Playable
|
|
/**
|
|
/**
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public Point3D getInVehiclePosition()
|
|
|
|
|
|
+ public Location getInVehiclePosition()
|
|
{
|
|
{
|
|
return _inVehiclePosition;
|
|
return _inVehiclePosition;
|
|
}
|
|
}
|
|
|
|
|
|
- public void setInVehiclePosition(Point3D pt)
|
|
|
|
|
|
+ public void setInVehiclePosition(Location pt)
|
|
{
|
|
{
|
|
_inVehiclePosition = pt;
|
|
_inVehiclePosition = pt;
|
|
}
|
|
}
|
|
@@ -13589,7 +13579,7 @@ public final class L2PcInstance extends L2Playable
|
|
{
|
|
{
|
|
if (isInBoat())
|
|
if (isInBoat())
|
|
{
|
|
{
|
|
- setWorldPosition(getBoat().getWorldPosition());
|
|
|
|
|
|
+ setXYZ(getBoat().getLocation());
|
|
|
|
|
|
activeChar.sendPacket(new CharInfo(this));
|
|
activeChar.sendPacket(new CharInfo(this));
|
|
activeChar.sendPacket(new ExBrExtraUserInfo(this));
|
|
activeChar.sendPacket(new ExBrExtraUserInfo(this));
|
|
@@ -13617,8 +13607,7 @@ public final class L2PcInstance extends L2Playable
|
|
}
|
|
}
|
|
else if (isInAirShip())
|
|
else if (isInAirShip())
|
|
{
|
|
{
|
|
- setWorldPosition(getAirShip().getWorldPosition());
|
|
|
|
-
|
|
|
|
|
|
+ setXYZ(getAirShip().getLocation());
|
|
activeChar.sendPacket(new CharInfo(this));
|
|
activeChar.sendPacket(new CharInfo(this));
|
|
activeChar.sendPacket(new ExBrExtraUserInfo(this));
|
|
activeChar.sendPacket(new ExBrExtraUserInfo(this));
|
|
int relation1 = getRelation(activeChar);
|
|
int relation1 = getRelation(activeChar);
|