|
@@ -39,7 +39,6 @@ import com.l2jserver.gameserver.templates.StatsSet;
|
|
import com.l2jserver.util.L2FastList;
|
|
import com.l2jserver.util.L2FastList;
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @author DaRkRaGe
|
|
* @author DaRkRaGe
|
|
* Revised by Emperorc
|
|
* Revised by Emperorc
|
|
*/
|
|
*/
|
|
@@ -120,7 +119,6 @@ public class GrandBossManager
|
|
|
|
|
|
PreparedStatement statement = con.prepareStatement("SELECT * from grandboss_data ORDER BY boss_id");
|
|
PreparedStatement statement = con.prepareStatement("SELECT * from grandboss_data ORDER BY boss_id");
|
|
ResultSet rset = statement.executeQuery();
|
|
ResultSet rset = statement.executeQuery();
|
|
-
|
|
|
|
while (rset.next())
|
|
while (rset.next())
|
|
{
|
|
{
|
|
//Read all info from DB, and store it for AI to read and decide what to do
|
|
//Read all info from DB, and store it for AI to read and decide what to do
|
|
@@ -147,7 +145,6 @@ public class GrandBossManager
|
|
|
|
|
|
info = null;
|
|
info = null;
|
|
}
|
|
}
|
|
-
|
|
|
|
_log.info("GrandBossManager: Loaded " + _storedInfo.size() + " Instances");
|
|
_log.info("GrandBossManager: Loaded " + _storedInfo.size() + " Instances");
|
|
|
|
|
|
rset.close();
|
|
rset.close();
|
|
@@ -167,10 +164,9 @@ public class GrandBossManager
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /*
|
|
|
|
|
|
+ /**
|
|
* Zone Functions
|
|
* Zone Functions
|
|
*/
|
|
*/
|
|
-
|
|
|
|
public void initZones()
|
|
public void initZones()
|
|
{
|
|
{
|
|
Connection con = null;
|
|
Connection con = null;
|
|
@@ -286,10 +282,6 @@ public class GrandBossManager
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
- /*
|
|
|
|
- * The rest
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
public int getBossStatus(int bossId)
|
|
public int getBossStatus(int bossId)
|
|
{
|
|
{
|
|
return _bossStatus.get(bossId);
|
|
return _bossStatus.get(bossId);
|
|
@@ -302,10 +294,9 @@ public class GrandBossManager
|
|
updateDb(bossId, true);
|
|
updateDb(bossId, true);
|
|
}
|
|
}
|
|
|
|
|
|
- /*
|
|
|
|
|
|
+ /**
|
|
* Adds a L2GrandBossInstance to the list of bosses.
|
|
* Adds a L2GrandBossInstance to the list of bosses.
|
|
*/
|
|
*/
|
|
-
|
|
|
|
public void addBoss(L2GrandBossInstance boss)
|
|
public void addBoss(L2GrandBossInstance boss)
|
|
{
|
|
{
|
|
if (boss != null)
|
|
if (boss != null)
|
|
@@ -362,15 +353,13 @@ public class GrandBossManager
|
|
|
|
|
|
for (Integer bossId : _storedInfo.keys())
|
|
for (Integer bossId : _storedInfo.keys())
|
|
{
|
|
{
|
|
- L2GrandBossInstance boss = _bosses.get(bossId);
|
|
|
|
|
|
+ final L2GrandBossInstance boss = _bosses.get(bossId);
|
|
StatsSet info = _storedInfo.get(bossId);
|
|
StatsSet info = _storedInfo.get(bossId);
|
|
if (boss == null || info == null)
|
|
if (boss == null || info == null)
|
|
{
|
|
{
|
|
statement = con.prepareStatement(UPDATE_GRAND_BOSS_DATA2);
|
|
statement = con.prepareStatement(UPDATE_GRAND_BOSS_DATA2);
|
|
statement.setInt(1, _bossStatus.get(bossId));
|
|
statement.setInt(1, _bossStatus.get(bossId));
|
|
statement.setInt(2, bossId);
|
|
statement.setInt(2, bossId);
|
|
- statement.executeUpdate();
|
|
|
|
- statement.clearParameters();
|
|
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -391,11 +380,11 @@ public class GrandBossManager
|
|
statement.setDouble(7, mp);
|
|
statement.setDouble(7, mp);
|
|
statement.setInt(8, _bossStatus.get(bossId));
|
|
statement.setInt(8, _bossStatus.get(bossId));
|
|
statement.setInt(9, bossId);
|
|
statement.setInt(9, bossId);
|
|
- statement.executeUpdate();
|
|
|
|
- statement.clearParameters();
|
|
|
|
}
|
|
}
|
|
|
|
+ statement.executeUpdate();
|
|
|
|
+ statement.clearParameters();
|
|
|
|
+ statement.close();
|
|
}
|
|
}
|
|
- statement.close();
|
|
|
|
}
|
|
}
|
|
catch (SQLException e)
|
|
catch (SQLException e)
|
|
{
|
|
{
|