Store proper HP and MP for raidbosses.
This commit is contained in:
parent
c00935ee0d
commit
7682ea912f
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -377,8 +377,8 @@ public class RaidBossSpawnManager
|
|||||||
{
|
{
|
||||||
// TODO(Zoey76): Change this to use batch.
|
// TODO(Zoey76): Change this to use batch.
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, boss.isDead() ? boss.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, boss.isDead() ? boss.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, bossId);
|
statement.setInt(4, bossId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -343,8 +343,8 @@ public class RaidBossSpawnManager
|
|||||||
{
|
{
|
||||||
// TODO(Zoey76): Change this to use batch.
|
// TODO(Zoey76): Change this to use batch.
|
||||||
ps.setLong(1, info.getLong("respawnTime"));
|
ps.setLong(1, info.getLong("respawnTime"));
|
||||||
ps.setDouble(2, info.getDouble("currentHP"));
|
ps.setDouble(2, boss.isDead() ? boss.getMaxHp() : info.getDouble("currentHP"));
|
||||||
ps.setDouble(3, info.getDouble("currentMP"));
|
ps.setDouble(3, boss.isDead() ? boss.getMaxMp() : info.getDouble("currentMP"));
|
||||||
ps.setInt(4, bossId);
|
ps.setInt(4, bossId);
|
||||||
ps.executeUpdate();
|
ps.executeUpdate();
|
||||||
ps.clearParameters();
|
ps.clearParameters();
|
||||||
|
@ -343,8 +343,8 @@ public class RaidBossSpawnManager
|
|||||||
{
|
{
|
||||||
// TODO(Zoey76): Change this to use batch.
|
// TODO(Zoey76): Change this to use batch.
|
||||||
ps.setLong(1, info.getLong("respawnTime"));
|
ps.setLong(1, info.getLong("respawnTime"));
|
||||||
ps.setDouble(2, info.getDouble("currentHP"));
|
ps.setDouble(2, boss.isDead() ? boss.getMaxHp() : info.getDouble("currentHP"));
|
||||||
ps.setDouble(3, info.getDouble("currentMP"));
|
ps.setDouble(3, boss.isDead() ? boss.getMaxMp() : info.getDouble("currentMP"));
|
||||||
ps.setInt(4, bossId);
|
ps.setInt(4, bossId);
|
||||||
ps.executeUpdate();
|
ps.executeUpdate();
|
||||||
ps.clearParameters();
|
ps.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
@ -420,8 +420,8 @@ public class DBSpawnManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement.setLong(1, info.getLong("respawnTime"));
|
statement.setLong(1, info.getLong("respawnTime"));
|
||||||
statement.setDouble(2, info.getDouble("currentHP"));
|
statement.setDouble(2, npc.isDead() ? npc.getMaxHp() : info.getDouble("currentHP"));
|
||||||
statement.setDouble(3, info.getDouble("currentMP"));
|
statement.setDouble(3, npc.isDead() ? npc.getMaxMp() : info.getDouble("currentMP"));
|
||||||
statement.setInt(4, npcId);
|
statement.setInt(4, npcId);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
statement.clearParameters();
|
statement.clearParameters();
|
||||||
|
Loading…
Reference in New Issue
Block a user