if(msg != null)
{
player.sendPacket(msg);
return;
}
L2AirShip airship = searchDockedAirShip();
if(airship == null)
{
player.sendActionFailed();
return;
}
if(player.getVehicle() != null && player.getVehicle().getId() == airship.getId())
{
player.sendPacket(Msg.YOU_HAVE_ALREADY_BOARDED_ANOTHER_AIRSHIP);
return;
}
player._stablePoint = player.getLoc().setH(0);
player.setVehicle(airship);
player.setInVehiclePosition(new Location());
player.setLoc(airship.getLoc());
player.broadcastPacket(new ExGetOnAirShip(player, airship, player.getInVehiclePosition()));
}
else if(command.equalsIgnoreCase("summon"))
{
if(player.getClan() == null || player.getClan().getLevel() < 5)
{
player.sendPacket(Msg.IN_ORDER_TO_ACQUIRE_AN_AIRSHIP_THE_CLAN_S_LEVEL_MUST_BE_LEVEL_5_OR_HIGHER);
return;
}
if((player.getClanPrivileges() & L2Clan.CP_CL_SUMMON_AIRSHIP) != L2Clan.CP_CL_SUMMON_AIRSHIP)
{
player.sendMessage("You don't have rights to do that.");
return;
}
if(!player.getClan().isHaveAirshipLicense())
{
player.sendPacket(Msg.AN_AIRSHIP_CANNOT_BE_SUMMONED_BECAUSE_EITHER_YOU_HAVE_NOT_REGISTERED_YOUR_AIRSHIP_LICENSE_OR_THE);
return;
}
L2AirShip dockedAirship = searchDockedAirShip();
L2AirShip clanAirship = player.getClan().getAirship();
if(clanAirship != null)
{
if(clanAirship == dockedAirship)
{
player.sendPacket(Msg.THE_CLAN_OWNED_AIRSHIP_ALREADY_EXISTS);
}
else
{
player.sendPacket(Msg.THE_AIRSHIP_OWNED_BY_THE_CLAN_IS_ALREADY_BEING_USED_BY_ANOTHER_CLAN_MEMBER);
}
return;
}
if(dockedAirship != null)
{
player.sendPacket(Msg.ANOTHER_AIRSHIP_HAS_ALREADY_BEEN_SUMMONED_AT_THE_WHARF_PLEASE_TRY_AGAIN_LATER);
return;
}
if(Functions.removeItem(player, ENERGY_STAR_STONE, 5) != 5)
{
player.sendPacket(new SystemMessage(SystemMessage.THE_AIRSHIP_CANNOT_BE_SUMMONED_BECAUSE_YOU_DON_T_HAVE_ENOUGH_S1).addItemName(ENERGY_STAR_STONE));
return;
}
L2AirShip newAirship = new L2AirShip(player.getClan(), "airship", 0);
AirShipDock ad = AirShipDocksTable.getInstance().getAirShipDockByNpcId(getNpcId());
L2VehicleManager.getInstance().addStaticItem(newAirship);
newAirship.SetTrajet1(ad.getArrivalTrajetId(), 0, null, null);
newAirship.spawn();
Functions.npcShoutCustomMessage(this, "l2p.gameserver.model.instances.L2AirShipControllerInstance.AirshipSummoned");
if(_autoDepartureTask != null)
{
_autoDepartureTask.cancel(true);
}