}
private void reLoadNpcDropList(int npcId)
{
L2NpcTemplate npcData = NpcTable.getInstance().getTemplate(npcId);
if (npcData == null)
return;
// reset the drop lists
npcData.clearAllDropData();
// get the drops
java.sql.Connection con = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
L2DropData dropData = null;
npcData.getDropData().clear();
PreparedStatement statement = con.prepareStatement("SELECT " + L2DatabaseFactory.getInstance().safetyString(new String[] {"mobId", "itemId", "min", "max", "category", "chance"}) + " FROM droplist WHERE mobId=?");
statement.setInt(1, npcId);
ResultSet dropDataList = statement.executeQuery();
while(dropDataList.next())
{
dropData = new L2DropData();
dropData.setItemId(dropDataList.getInt("itemId"));
dropData.setMinDrop(dropDataList.getInt("min"));
dropData.setMaxDrop(dropDataList.getInt("max"));
dropData.setChance(dropDataList.getInt("chance"));
int category = dropDataList.getInt("category");
npcData.addDropData(dropData, category);
}
dropDataList.close();
statement.close();
}
catch(Exception e){}