}
private static int loadSpawn(FastMap<Integer, GArray<Location>> table, int type)
{
int count = 0;
ThreadConnection con = null;
FiltredPreparedStatement statement1 = null;
ResultSet rset1 = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
statement1 = con.prepareStatement("SELECT DISTINCT key_npc_id FROM four_sepulchers_spawnlist WHERE spawntype = ? ORDER BY key_npc_id");
statement1.setInt(1, type);
rset1 = statement1.executeQuery();
while(rset1.next())
{
int keyNpcId = rset1.getInt("key_npc_id");
FiltredPreparedStatement statement2 = null;
ResultSet rset2 = null;
try
{
statement2 = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay, key_npc_id FROM four_sepulchers_spawnlist WHERE key_npc_id = ? AND spawntype = ? ORDER BY id");
statement2.setInt(1, keyNpcId);
statement2.setInt(2, type);
rset2 = statement2.executeQuery();
GArray<Location> locations = new GArray<Location>();
while(rset2.next())