New handlers created

This commit is contained in:
2023-10-17 08:45:33 -04:00
parent 9d5e16aa5c
commit 34024c9fb4
4 changed files with 68 additions and 0 deletions
+17
View File
@@ -94,6 +94,23 @@ public class dbNPCHandler extends dbHandlerBase {
return row_count;
}
public ArrayList<NPC> GET_ALL_NPCS() {
ArrayList<NPC> npcList = new ArrayList<>();
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_npc`.*, `object`.`parent` FROM `object` INNER JOIN `obj_npc` ON `obj_npc`.`UID` = `object`.`UID` ORDER BY `object`.`UID` ASC;")) {
ResultSet rs = preparedStatement.executeQuery();
npcList = getObjectsFromRs(rs, 1000);
} catch (SQLException e) {
Logger.error(e);
}
return npcList;
}
public ArrayList<NPC> GET_ALL_NPCS_FOR_ZONE(Zone zone) {
ArrayList<NPC> npcList = new ArrayList<>();