Package lineage2.gameserver.model.CharSelectionInfo

Examples of lineage2.gameserver.model.CharSelectionInfo.CharSelectInfoPackage


    _log.info("=================================================");
    Config.load();
    checkFreePorts();
    Class.forName(Config.DATABASE_DRIVER).newInstance();
    DatabaseFactory.getInstance().getConnection().close();
    IdFactory _idFactory = IdFactory.getInstance();
    if (!_idFactory.isInitialized())
    {
      _log.error("Could not read object IDs from DB. Please Check Your Data.");
      throw new Exception("Could not initialize the ID factory");
    }
    CacheManager.getInstance();
View Full Code Here


    return classId;
  }

  private static CharSelectInfoPackage restoreChar(ResultSet chardata)
  {
    CharSelectInfoPackage charInfopackage = null;
    try
    {
      int objectId = chardata.getInt("obj_Id");
      int classid = chardata.getInt("class_id");
      int[] baseClassId = new int[]
      {
        classid,
        chardata.getInt("default_class_id")
      };
      boolean useBaseClass = chardata.getInt("type") == SubClassType.BASE_CLASS.ordinal();
      if (!useBaseClass)
      {
        baseClassId = restoreBaseClassId(objectId);
      }
      Race race = ClassId.VALUES[baseClassId[1]].getRace();
      String name = chardata.getString("char_name");
      charInfopackage = new CharSelectInfoPackage(objectId, name);
      charInfopackage.setLevel(chardata.getInt("level"));
      charInfopackage.setMaxHp(chardata.getInt("maxHp"));
      charInfopackage.setCurrentHp(chardata.getDouble("curHp"));
      charInfopackage.setMaxMp(chardata.getInt("maxMp"));
      charInfopackage.setCurrentMp(chardata.getDouble("curMp"));

      charInfopackage.setX(chardata.getInt("x"));
      charInfopackage.setY(chardata.getInt("y"));
      charInfopackage.setZ(chardata.getInt("z"));
      charInfopackage.setPk(chardata.getInt("pkkills"));
      charInfopackage.setPvP(chardata.getInt("pvpkills"));

      charInfopackage.setFace(chardata.getInt("face"));
      charInfopackage.setHairStyle(chardata.getInt("hairstyle"));
      charInfopackage.setHairColor(chardata.getInt("haircolor"));
      charInfopackage.setSex(chardata.getInt("sex"));

      charInfopackage.setExp(chardata.getLong("exp"));
      charInfopackage.setSp(chardata.getInt("sp"));
      charInfopackage.setClanId(chardata.getInt("clanid"));

      charInfopackage.setKarma(chardata.getInt("karma"));
      charInfopackage.setRace(race.ordinal());
      charInfopackage.setClassId(classid);
      charInfopackage.setBaseClassId(baseClassId[0]);
      long deletetime = chardata.getLong("deletetime");
      int deletedays = 0;
      if (Config.DELETE_DAYS > 0)
        if (deletetime > 0)
        {
          deletetime = (int) (System.currentTimeMillis() / 1000 - deletetime);
          deletedays = (int) (deletetime / 3600 / 24);
          if (deletedays >= Config.DELETE_DAYS)
          {
            CharacterDAO.getInstance().deleteCharByObjId(objectId);
            return null;
          }
          deletetime = Config.DELETE_DAYS * 3600 * 24 - deletetime;
        }
        else
          deletetime = 0;
      charInfopackage.setDeleteTimer((int) deletetime);
      charInfopackage.setLastAccess(chardata.getLong("lastAccess") * 1000L);
      charInfopackage.setAccessLevel(chardata.getInt("accesslevel"));

      if (charInfopackage.getAccessLevel() < 0 && !AutoBan.isBanned(objectId))
        charInfopackage.setAccessLevel(0);
    }
    catch (Exception e)
    {
      _log.error("", e);
    }
View Full Code Here

    {
      teleportHome();
      return false;
    }
    clearTasks();
    Creature target = prepareTarget();
    if (target == null)
    {
      return false;
    }
    if (!BaiumManager.getZone().checkIfInZone(target))
View Full Code Here

      kama.addKilledKanabion(type);
      spawnPossible = kama.isSpawnPossible();
    }
    if (spawnPossible && (nextId > 0))
    {
      Creature player = null;
      if (!killer.isPlayer())
      {
        for (Player pl : World.getAroundPlayers(actor))
        {
          player = pl;
View Full Code Here

  {
    if (param.length < 4)
    {
      throw new IllegalArgumentException();
    }
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    final long price = Long.parseLong(param[param.length - 1]);
    if (!NpcInstance.canBypassCheck(player, player.getLastNpc()))
    {
      return;
    }
    if ((price > 0) && (player.getAdena() < price))
    {
      player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
      return;
    }
    if (player.getMountType() == 2)
    {
      player.sendMessage("Телепортаци�? верхом на виверне невозможна.");
      return;
    }
    if (player.getLastNpc() != null)
    {
      final int npcId = player.getLastNpc().getNpcId();
      switch (npcId)
      {
        case 30483:
          if (player.getLevel() >= Config.CRUMA_GATEKEEPER_LVL)
          {
            show("teleporter/30483-no.htm", player);
            return;
          }
          break;
        case 32864:
        case 32865:
        case 32866:
        case 32867:
        case 32868:
        case 32869:
        case 32870:
          if (player.getLevel() < 80)
          {
            show("teleporter/" + npcId + "-no.htm", player);
            return;
          }
          break;
      }
    }
    final int x = Integer.parseInt(param[0]);
    final int y = Integer.parseInt(param[1]);
    final int z = Integer.parseInt(param[2]);
    final int castleId = (param.length > 4) ? Integer.parseInt(param[3]) : 0;
    if (player.getReflection().isDefault())
    {
      final Castle castle = (castleId > 0) ? ResidenceHolder.getInstance().getResidence(Castle.class, castleId) : null;
      if ((castle != null) && castle.getSiegeEvent().isInProgress())
      {
        player.sendPacket(Msg.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
        return;
      }
    }
    final Location pos = Location.findPointToStay(x, y, z, 50, 100, player.getGeoIndex());
    if (price > 0)
    {
      player.reduceAdena(price, true);
    }
    player.teleToLocation(pos);
  }
View Full Code Here

  {
    if (param.length < 5)
    {
      throw new IllegalArgumentException();
    }
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    final long count = Long.parseLong(param[3]);
    final int item = Integer.parseInt(param[4]);
    if (!NpcInstance.canBypassCheck(player, player.getLastNpc()))
    {
      return;
    }
    if (count > 0)
    {
      if (!player.getInventory().destroyItemByItemId(item, count))
      {
        player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_REQUIRED_ITEMS);
        return;
      }
      player.sendPacket(SystemMessage2.removeItems(item, count));
    }
    final int x = Integer.parseInt(param[0]);
    final int y = Integer.parseInt(param[1]);
    final int z = Integer.parseInt(param[2]);
    final Location pos = Location.findPointToStay(x, y, z, 20, 70, player.getGeoIndex());
    player.teleToLocation(pos);
  }
View Full Code Here

  {
    if (param.length < 5)
    {
      throw new IllegalArgumentException();
    }
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    player.setReflection(Integer.parseInt(param[4]));
    Gatekeeper(param);
  }
View Full Code Here

   * Method TokenJump.
   * @param param String[]
   */
  public void TokenJump(String[] param)
  {
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    if (player.getLevel() <= 19)
    {
      QuestGatekeeper(param);
    }
    else
    {
View Full Code Here

  /**
   * Method NoblessTeleport.
   */
  public void NoblessTeleport()
  {
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    if (player.isNoble() || Config.ALLOW_NOBLE_TP_TO_ALL)
    {
      show("scripts/noble.htm", player);
    }
    else
    {
View Full Code Here

  {
    if (param.length < 2)
    {
      throw new IllegalArgumentException();
    }
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    final String page = param[0];
    final int item = Integer.parseInt(param[1]);
    final long price = Long.parseLong(param[2]);
    if (getItemCount(player, item) < price)
    {
      player.sendPacket((item == 57) ? Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA : SystemMsg.INCORRECT_ITEM_COUNT);
      return;
    }
    removeItem(player, item, price);
    show(page, player);
  }
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.CharSelectionInfo.CharSelectInfoPackage

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.