|
@@ -129,6 +129,7 @@ import com.l2jserver.gameserver.model.L2WorldRegion;
|
|
|
import com.l2jserver.gameserver.model.Location;
|
|
|
import com.l2jserver.gameserver.model.Macro;
|
|
|
import com.l2jserver.gameserver.model.MacroList;
|
|
|
+import com.l2jserver.gameserver.model.MountType;
|
|
|
import com.l2jserver.gameserver.model.PartyMatchRoom;
|
|
|
import com.l2jserver.gameserver.model.PartyMatchRoomList;
|
|
|
import com.l2jserver.gameserver.model.PartyMatchWaitingList;
|
|
@@ -545,7 +546,7 @@ public final class L2PcInstance extends L2Playable
|
|
|
private Point3D _inVehiclePosition;
|
|
|
|
|
|
public ScheduledFuture<?> _taskforfish;
|
|
|
- private int _mountType;
|
|
|
+ private MountType _mountType = MountType.NONE;
|
|
|
private int _mountNpcId;
|
|
|
private int _mountLevel;
|
|
|
/** Store object used to summon the strider you are mounting **/
|
|
@@ -6744,7 +6745,7 @@ public final class L2PcInstance extends L2Playable
|
|
|
}
|
|
|
|
|
|
stopAllToggles();
|
|
|
- setMount(pet.getNpcId(), pet.getLevel(), pet.getMountType());
|
|
|
+ setMount(pet.getNpcId(), pet.getLevel());
|
|
|
setMountObjectID(pet.getControlObjectId());
|
|
|
clearPetData();
|
|
|
startFeed(pet.getNpcId());
|
|
@@ -6758,7 +6759,7 @@ public final class L2PcInstance extends L2Playable
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- public boolean mount(int npcId, int type, int controlItemObjId, boolean useFood)
|
|
|
+ public boolean mount(int npcId, int controlItemObjId, boolean useFood)
|
|
|
{
|
|
|
if (!disarmWeapons())
|
|
|
{
|
|
@@ -6774,7 +6775,7 @@ public final class L2PcInstance extends L2Playable
|
|
|
}
|
|
|
|
|
|
stopAllToggles();
|
|
|
- setMount(npcId, getLevel(), type);
|
|
|
+ setMount(npcId, getLevel());
|
|
|
clearPetData();
|
|
|
setMountObjectID(controlItemObjId);
|
|
|
broadcastPacket(new Ride(this));
|
|
@@ -6871,7 +6872,7 @@ public final class L2PcInstance extends L2Playable
|
|
|
}
|
|
|
else if (isMounted())
|
|
|
{
|
|
|
- if ((getMountType() == 2) && isInsideZone(ZoneId.NO_LANDING))
|
|
|
+ if ((getMountType() == MountType.WYVERN) && isInsideZone(ZoneId.NO_LANDING))
|
|
|
{
|
|
|
sendPacket(ActionFailed.STATIC_PACKET);
|
|
|
sendPacket(SystemMessageId.NO_DISMOUNT_HERE);
|
|
@@ -6897,7 +6898,7 @@ public final class L2PcInstance extends L2Playable
|
|
|
|
|
|
sendPacket(new SetupGauge(3, 0, 0));
|
|
|
int petId = _mountNpcId;
|
|
|
- setMount(0, 0, 0);
|
|
|
+ setMount(0, 0);
|
|
|
stopFeed();
|
|
|
clearPetData();
|
|
|
if (wasFlying)
|
|
@@ -9441,7 +9442,7 @@ public final class L2PcInstance extends L2Playable
|
|
|
|
|
|
public boolean isMounted()
|
|
|
{
|
|
|
- return _mountType > 0;
|
|
|
+ return _mountType != MountType.NONE;
|
|
|
}
|
|
|
|
|
|
public boolean checkLandingState()
|
|
@@ -9464,16 +9465,17 @@ public final class L2PcInstance extends L2Playable
|
|
|
}
|
|
|
|
|
|
// returns false if the change of mount type fails.
|
|
|
- public void setMount(int npcId, int npcLevel, int mountType)
|
|
|
+ public void setMount(int npcId, int npcLevel)
|
|
|
{
|
|
|
- switch (mountType)
|
|
|
+ final MountType type = MountType.findByNpcId(npcId);
|
|
|
+ switch (type)
|
|
|
{
|
|
|
- case 0: // None
|
|
|
+ case NONE: // None
|
|
|
{
|
|
|
setIsFlying(false);
|
|
|
break;
|
|
|
}
|
|
|
- case 1: // Strider
|
|
|
+ case STRIDER: // Strider
|
|
|
{
|
|
|
if (isNoble())
|
|
|
{
|
|
@@ -9481,14 +9483,14 @@ public final class L2PcInstance extends L2Playable
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
- case 2: // Wyvern
|
|
|
+ case WYVERN: // Wyvern
|
|
|
{
|
|
|
setIsFlying(true);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- _mountType = mountType;
|
|
|
+ _mountType = type;
|
|
|
_mountNpcId = npcId;
|
|
|
_mountLevel = npcLevel;
|
|
|
}
|
|
@@ -9496,7 +9498,7 @@ public final class L2PcInstance extends L2Playable
|
|
|
/**
|
|
|
* @return the type of Pet mounted (0 : none, 1 : Strider, 2 : Wyvern, 3: Wolf).
|
|
|
*/
|
|
|
- public int getMountType()
|
|
|
+ public MountType getMountType()
|
|
|
{
|
|
|
return _mountType;
|
|
|
}
|
|
@@ -10790,7 +10792,7 @@ public final class L2PcInstance extends L2Playable
|
|
|
if (_taskRentPet != null)
|
|
|
{
|
|
|
// if the rent of a wyvern expires while over a flying zone, tp to down before unmounting
|
|
|
- if (checkLandingState() && (getMountType() == 2))
|
|
|
+ if (checkLandingState() && (getMountType() == MountType.WYVERN))
|
|
|
{
|
|
|
teleToLocation(TeleportWhereType.TOWN);
|
|
|
}
|