Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2PetData


    FillPetDataTable();
  }

  public L2PetData getInfo(int petNpcId, int level)
  {
    L2PetData result = null;
    while(result == null && level < 100)
    {
      result = _pets.get(petNpcId * 100 + level);
      level++;
    }
View Full Code Here


  private void FillPetDataTable()
  {
    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    L2PetData petData;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT id, level, exp, hp, mp, patk, pdef, matk, mdef, acc, evasion, crit, speed, atk_speed, cast_speed, max_meal, battle_meal, normal_meal, loadMax, hpregen, mpregen FROM pet_data");
      rset = statement.executeQuery();
      while(rset.next())
      {
        petData = new L2PetData();
        petData.setID(rset.getInt("id"));
        petData.setLevel(rset.getInt("level"));
        petData.setExp(rset.getLong("exp"));
        petData.setHP(rset.getInt("hp"));
        petData.setMP(rset.getInt("mp"));
        petData.setPAtk(rset.getInt("patk"));
        petData.setPDef(rset.getInt("pdef"));
        petData.setMAtk(rset.getInt("matk"));
        petData.setMDef(rset.getInt("mdef"));
        petData.setAccuracy(rset.getInt("acc"));
        petData.setEvasion(rset.getInt("evasion"));
        petData.setCritical(rset.getInt("crit"));
        petData.setSpeed(rset.getInt("speed"));
        petData.setAtkSpeed(rset.getInt("atk_speed"));
        petData.setCastSpeed(rset.getInt("cast_speed"));
        petData.setFeedMax(rset.getInt("max_meal"));
        petData.setFeedBattle(rset.getInt("battle_meal"));
        petData.setFeedNormal(rset.getInt("normal_meal"));
        petData.setMaxLoad(rset.getInt("loadMax"));
        petData.setHpRegen(rset.getInt("hpregen"));
        petData.setMpRegen(rset.getInt("mpregen"));
        petData.setControlItemId(getControlItemId(petData.getID()));
        petData.setFoodId(getFoodId(petData.getID()));
        petData.setMountable(isMountable(petData.getID()));
        petData.setMinLevel(getMinLevel(petData.getID()));
        petData.setAddFed(getAddFed(petData.getID()));
        _pets.put(petData.getID() * 100 + petData.getLevel(), petData);
      }
    }
    catch(Exception e)
    {
      _log.warning("Cannot fill up PetDataTable: " + e);
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2PetData

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.