Added ./setrace command

This commit is contained in:
2024-05-04 21:38:06 -05:00
parent eff8be91d6
commit 60b8843563
4 changed files with 67 additions and 1 deletions
+14
View File
@@ -309,7 +309,21 @@ public class dbNPCHandler extends dbHandlerBase {
return false;
}
}
public boolean UPDATE_RACE(NPC npc, int value) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_npc` SET `npc_raceID`=? WHERE `UID`=?")) {
preparedStatement.setInt(1, value);
preparedStatement.setLong(2, npc.getObjectUUID());
return (preparedStatement.executeUpdate() > 0);
} catch (SQLException e) {
Logger.error(e);
return false;
}
}
public void LOAD_PIRATE_NAMES() {
String pirateName;