Package com.l2jfrozen.gameserver.model

Examples of com.l2jfrozen.gameserver.model.Item


        for(Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
        {
          if("item".equalsIgnoreCase(d.getNodeName()))
          {
            setCurrentItem(new Item());
            parseItem(d);
            _itemsInFile.add(_currentItem.item);
            resetTable();
          }
        }
      }
      else if("item".equalsIgnoreCase(n.getNodeName()))
      {
        setCurrentItem(new Item());
        parseItem(n);
        _itemsInFile.add(_currentItem.item);
      }
    }
  }
View Full Code Here


    String itemName = n.getAttributes().getNamedItem("name").getNodeValue();

    _currentItem.id = itemId;
    _currentItem.name = itemName;

    Item item;

    if((item = _itemData.get(_currentItem.id)) == null)
      throw new IllegalStateException("No SQL data for Item ID: " + itemId + " - name: " + itemName);

    _currentItem.set = item.set;
View Full Code Here

   *
   * @return
   */
  public Item newItem()
  {
    return new Item();
  }
View Full Code Here

        // Add item in correct FastMap
        while(rset.next())
        {
          if(selectQuery.endsWith("etcitem"))
          {
            final Item newItem = readItem(rset);
            itemData.put(newItem.id, newItem);
          }
          else if(selectQuery.endsWith("armor"))
          {
            final Item newItem = readArmor(rset);
            armorData.put(newItem.id, newItem);
          }
          else if(selectQuery.endsWith("weapon"))
          {
            final Item newItem = readWeapon(rset);
            weaponData.put(newItem.id, newItem);
          }
        }

        statement.close();
        rset.close();
      }
    }
    catch(Exception e)
    {
      _log.severe("data error on item"+" "+ e);
    }
    finally
    {
      CloseUtil.close(con);
    }

    if(Config.CUSTOM_ITEM_TABLES)
    {
      try
      {
        con = L2DatabaseFactory.getInstance().getConnection(false);
        for(String selectQuery : SQL_CUSTOM_ITEM_SELECTS)
        {
          final PreparedStatement statement = con.prepareStatement(selectQuery);
          final ResultSet rset = statement.executeQuery();

          // Add item in correct FastMap
          while(rset.next())
          {
            if(selectQuery.endsWith("etcitem"))
            {
              final Item newItem = readItem(rset);

              if(itemData.containsKey(newItem.id))
              {
                itemData.remove(newItem.id);
              }

              itemData.put(newItem.id, newItem);
            }
            else if(selectQuery.endsWith("armor"))
            {
              final Item newItem = readArmor(rset);

              if(armorData.containsKey(newItem.id))
              {
                armorData.remove(newItem.id);
              }

              armorData.put(newItem.id, newItem);
            }
            else if(selectQuery.endsWith("weapon"))
            {
              final Item newItem = readWeapon(rset);

              if(weaponData.containsKey(newItem.id))
              {
                weaponData.remove(newItem.id);
              }
View Full Code Here

   * @return Item : object created from the database record
   * @throws SQLException
   */
  private Item readWeapon(ResultSet rset) throws SQLException
  {
    Item item = new Item();
    item.set = new StatsSet();
    item.type = _weaponTypes.get(rset.getString("weaponType"));
    item.id = rset.getInt("item_id");
    item.name = rset.getString("name");

View Full Code Here

   * @return Item : object created from the database record
   * @throws SQLException
   */
  private Item readArmor(ResultSet rset) throws SQLException
  {
    Item item = new Item();
    item.set = new StatsSet();
    item.type = _armorTypes.get(rset.getString("armor_type"));
    item.id = rset.getInt("item_id");
    item.name = rset.getString("name");

View Full Code Here

   * @return Item : object created from the database record
   * @throws SQLException
   */
  private Item readItem(ResultSet rset) throws SQLException
  {
    Item item = new Item();
    item.set = new StatsSet();
    item.id = rset.getInt("item_id");

    item.set.set("item_id", item.id);
    item.set.set("crystallizable", Boolean.valueOf(rset.getString("crystallizable")));
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.Item

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.