Files
Server/src/engine/db/handlers/dbResistHandler.java
T

48 lines
1.6 KiB
Java
Raw Normal View History

2022-04-30 09:41:17 -04:00
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.db.handlers;
2023-05-22 12:42:34 -04:00
import engine.gameManager.DbManager;
2022-04-30 09:41:17 -04:00
import engine.objects.Resists;
2023-05-22 12:42:34 -04:00
import org.pmw.tinylog.Logger;
2022-04-30 09:41:17 -04:00
2023-05-22 12:42:34 -04:00
import java.sql.Connection;
import java.sql.PreparedStatement;
2022-04-30 09:41:17 -04:00
import java.sql.ResultSet;
import java.sql.SQLException;
public class dbResistHandler extends dbHandlerBase {
public dbResistHandler() {
}
public Resists GET_RESISTS_FOR_MOB(int resistID) {
2023-05-22 12:42:34 -04:00
Resists resists = null;
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_npc_mob_resists` WHERE `ID` = ?;")) {
preparedStatement.setInt(1, resistID);
ResultSet rs = preparedStatement.executeQuery();
if (rs.next())
resists = new Resists(rs);
2022-04-30 09:41:17 -04:00
} catch (SQLException e) {
2023-05-22 12:42:34 -04:00
Logger.error(e);
2022-04-30 09:41:17 -04:00
}
2023-05-22 12:42:34 -04:00
return resists;
2022-04-30 09:41:17 -04:00
}
}