Package l2p.gameserver.model.entity.vehicle

Examples of l2p.gameserver.model.entity.vehicle.L2AirShip


      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);
      }
View Full Code Here


    return null;
  }

  private L2AirShip searchDockedAirShip()
  {
    L2AirShip airship = null;
    for(L2Character cha : L2World.getAroundCharacters(this, 1000, 500))
    {
      if(cha != null && !cha.isMoving && cha.isAirShip() && L2VehicleManager.getInstance().getBoat(cha.getObjectId()) != null)
      {
        airship = (L2AirShip) cha;
        if(!airship.isDocked())
        {
          airship = null;
          continue;
        }
      }
View Full Code Here

        }
        L2VehicleManager.getInstance().getBoats().clear();
        L2VehicleManager.getInstance().loadShips();
        break;
      case admin_airship:
        boat = new L2AirShip(activeChar.getClan(), "airship", 0);
        boat.setHeading(activeChar.getHeading());
        boat.setXYZ(activeChar.getX(), activeChar.getY(), activeChar.getZ() + 333);
        L2VehicleManager.getInstance().addStaticItem(boat);
        boat.spawn();
        break;
      case admin_airship_enter:
        for(L2Character cha : L2World.getAroundCharacters(activeChar, 1000, 1000))
        {
          if(cha.isAirShip())
          {
            activeChar._stablePoint = activeChar.getLoc().setH(0);
            L2AirShip airship = (L2AirShip) cha;
            activeChar.setInVehiclePosition(new Location());
            activeChar.setLoc(airship.getLoc());
            activeChar.setVehicle(airship);
            activeChar.broadcastPacket(new ExGetOnAirShip(activeChar, airship, activeChar.getInVehiclePosition()));
            break;
          }
        }
        break;
      case admin_airship_invite:
        if(activeChar.getVehicle() == null)
        {
          break;
        }
        L2Player target = null;
        L2Object obj = activeChar.getTarget();
        if(obj != null && obj.isPlayer())
        {
          target = (L2Player) obj;
          L2AirShip airship = (L2AirShip) activeChar.getVehicle();
          target.setInVehiclePosition(new Location());
          target.setLoc(airship.getLoc());
          target.setVehicle(airship);
          target.broadcastPacket(new ExGetOnAirShip(target, airship, target.getInVehiclePosition()));
        }
        break;
      case admin_airship_remove:
        for(L2Character cha : L2World.getAroundCharacters(activeChar, 1000, 1000))
        {
          if(cha.isAirShip())
          {
            L2AirShip airship = (L2AirShip) cha;
            for(L2Player player : L2ObjectsStorage.getAllPlayersForIterate())
            {
              if(player != null && player.getVehicle() == airship)
              {
                activeChar.setVehicle(null);
                activeChar.broadcastPacket(new ExGetOffAirShip(activeChar, airship, activeChar.getLoc()));
                activeChar.teleToLocation(activeChar.getLoc());
              }
            }
            airship.deleteMe();
            break;
          }
        }
        break;
    }
View Full Code Here

      L2Player player = getOwner().getPlayer();
      if(player.getVehicle() == null || !player.getVehicle().isAirShip())
      {
        return 0;
      }
      L2AirShip airship = (L2AirShip) player.getVehicle();
      if(airship.getDriver() == player)
      {
        return 13556;
      } // Затычка на отображение штурвала - Airship Helm
    }
    return 0;
View Full Code Here

    L2Player activeChar = getClient().getActiveChar();
    if(activeChar == null)
    {
      return;
    }
    L2AirShip boat = (L2AirShip) L2VehicleManager.getInstance().getBoat(_id);
    if(boat == null || boat.isMoving) // Не даем слезть с лодки на ходу
    {
      activeChar.sendActionFailed();
      return;
    }
View Full Code Here

      {
        if(target.isDead() || !target.isPlayer() || !target.isInVehicle() || !target.getPlayer().getVehicle().isAirShip())
        {
          continue;
        }
        L2AirShip airship = (L2AirShip) target.getPlayer().getVehicle();
        airship.setFuel(airship.getFuel() + (int) _power);
      }
    }
    if(isSSPossible())
    {
      activeChar.unChargeShots(isMagic());
View Full Code Here

          }
          // Нельзя одевать/снимать оружие/щит/сигил, управляя кораблем
          L2Vehicle vehicle = activeChar.getVehicle();
          if(vehicle != null && vehicle.isAirShip())
          {
            L2AirShip airship = (L2AirShip) vehicle;
            if(airship.getDriver() == activeChar)
            {
              activeChar.sendPacket(new SystemMessage(SystemMessage.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addItemName(itemId));
              return;
            }
          }
View Full Code Here

    if(activeChar.isMovementDisabled() || activeChar.isSitting())
    {
      activeChar.sendActionFailed();
      return;
    }
    L2AirShip boat = (L2AirShip) L2VehicleManager.getInstance().getBoat(_boatId);
    if(boat == null)
    {
      activeChar.sendActionFailed();
      return;
    }
View Full Code Here

    L2Player activeChar = getClient().getActiveChar();
    if(activeChar == null)
    {
      return;
    }
    L2AirShip boat = (L2AirShip) L2VehicleManager.getInstance().getBoat(_shipId);
    if(boat == null)
    {
      return;
    }
    activeChar.stopMove();
    activeChar.setVehicle(boat);
    activeChar.setInVehiclePosition(loc);
    activeChar.setLoc(boat.getLoc());
    activeChar.broadcastPacket(new ExGetOnAirShip(activeChar, boat, loc));
  }
View Full Code Here

      }
      return result;
    }
    if(object.isAirShip())
    {
      L2AirShip boat = (L2AirShip) object;
      result.add(new ExAirShipInfo(boat));
      if(isInVehicle() && getVehicle() == boat)
      {
        result.add(new ExGetOnAirShip(this, boat, getInVehiclePosition()));
      }
      if(boat.isMoving)
      {
        result.add(new ExMoveToLocationAirShip(boat, boat.getLoc(), boat.getDestination()));
      }
    }
    else if(object.isShip())
    {
      L2Ship boat = (L2Ship) object;
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.entity.vehicle.L2AirShip

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.