|
|
@ -9,6 +9,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
package engine.db.handlers; |
|
|
|
package engine.db.handlers; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import engine.gameManager.NPCManager; |
|
|
|
import engine.objects.EquipmentSetEntry; |
|
|
|
import engine.objects.EquipmentSetEntry; |
|
|
|
import engine.objects.ItemBase; |
|
|
|
import engine.objects.ItemBase; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
@ -149,4 +150,45 @@ public class dbItemBaseHandler extends dbHandlerBase { |
|
|
|
} |
|
|
|
} |
|
|
|
return equipmentSets; |
|
|
|
return equipmentSets; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public HashMap<Integer, ArrayList<Integer>> LOAD_RUNES_FOR_NPC_AND_MOBS() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<Integer, ArrayList<Integer>> runeSets = new HashMap<>(); |
|
|
|
|
|
|
|
int runeSetID; |
|
|
|
|
|
|
|
int runeBaseID; |
|
|
|
|
|
|
|
int recordsRead = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prepareCallable("SELECT * FROM static_npc_runeSet"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
ResultSet rs = executeQuery(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (rs.next()) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
recordsRead++; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
runeSetID = rs.getInt("runeSet"); |
|
|
|
|
|
|
|
runeBaseID = rs.getInt("runeBase"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (runeSets.get(runeSetID) == null){ |
|
|
|
|
|
|
|
ArrayList<Integer> runeList = new ArrayList<>(); |
|
|
|
|
|
|
|
runeList.add(runeBaseID); |
|
|
|
|
|
|
|
runeSets.put(runeSetID, runeList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
ArrayList<Integer>runeList = runeSets.get(runeSetID); |
|
|
|
|
|
|
|
runeList.add(runeSetID); |
|
|
|
|
|
|
|
runeSets.put(runeSetID, runeList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Logger.info("read: " + recordsRead + " cached: " + runeSets.size()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (SQLException e) { |
|
|
|
|
|
|
|
Logger.error( e.toString()); |
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
|
|
closeCallable(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return runeSets; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|