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);