@ -127,15 +127,13 @@ public class dbMobHandler extends dbHandlerBase {
@@ -127,15 +127,13 @@ public class dbMobHandler extends dbHandlerBase {
}
}
public boolean ADD_TO_GUARDS ( final long captainUID , final int mobBaseID , final String name , final int slot ) {
public boolean ADD_TO_GUARDS ( final long captainUID , final String name ) {
try ( Connection connection = DbManager . getConnection ( ) ;
PreparedStatement preparedStatement = connection . prepareStatement ( "INSERT INTO `dyn_guards` (`captainUID`, `mobBaseID`,` name`, `slot` ) VALUES (?,?, ?,?)" ) ) {
PreparedStatement preparedStatement = connection . prepareStatement ( "INSERT INTO `dyn_guards` (`captainUID`, `name`) VALUES (?,?)" ) ) {
preparedStatement . setLong ( 1 , captainUID ) ;
preparedStatement . setInt ( 2 , mobBaseID ) ;
preparedStatement . setString ( 3 , name ) ;
preparedStatement . setInt ( 4 , slot ) ;
preparedStatement . setString ( 2 , name ) ;
return ( preparedStatement . executeUpdate ( ) > 0 ) ;
@ -145,14 +143,13 @@ public class dbMobHandler extends dbHandlerBase {
@@ -145,14 +143,13 @@ public class dbMobHandler extends dbHandlerBase {
}
}
public boolean REMOVE_FROM_GUARDS ( final long captainUID , final int mobBaseID , final int slot ) {
public boolean REMOVE_FROM_GUARDS ( final long captainUID , final String minionName ) {
try ( Connection connection = DbManager . getConnection ( ) ;
PreparedStatement preparedStatement = connection . prepareStatement ( "DELETE FROM `dyn_guards` WHERE `captainUID`=? AND `mobBaseID`=? AND `slot` =? " ) ) {
PreparedStatement preparedStatement = connection . prepareStatement ( "DELETE FROM `dyn_guards` WHERE `captainUID`=? AND `minionName`=? LIMIT 1; " ) ) {
preparedStatement . setLong ( 1 , captainUID ) ;
preparedStatement . setInt ( 2 , mobBaseID ) ;
preparedStatement . setInt ( 3 , slot ) ;
preparedStatement . setString ( 2 , minionName ) ;
return ( preparedStatement . executeUpdate ( ) > 0 ) ;