diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java index 097f994df0..ca2c9d0e9c 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1124,7 +1124,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Npc.java index 8dc9e749dd..ddc98a77d4 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1124,7 +1124,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Npc.java index 8dc9e749dd..ddc98a77d4 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1124,7 +1124,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Npc.java index 8dc9e749dd..ddc98a77d4 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1124,7 +1124,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Npc.java index 8dc9e749dd..ddc98a77d4 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1124,7 +1124,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Npc.java index 8dc9e749dd..ddc98a77d4 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1124,7 +1124,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Npc.java index 8dc9e749dd..ddc98a77d4 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1124,7 +1124,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Npc.java index 8dc9e749dd..ddc98a77d4 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1124,7 +1124,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/RaidBossSpawnManager.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/RaidBossSpawnManager.java index 0078c8b514..95c2414423 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/RaidBossSpawnManager.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/RaidBossSpawnManager.java @@ -185,14 +185,12 @@ public class RaidBossSpawnManager final int RespawnMinDelay = boss.getSpawn().getRespawnMinDelay(); final int RespawnMaxDelay = boss.getSpawn().getRespawnMaxDelay(); - final long respawn_delay = Rnd.get((int) (RespawnMinDelay * 1000 * Config.RAID_MIN_RESPAWN_MULTIPLIER), (int) (RespawnMaxDelay * 1000 * Config.RAID_MAX_RESPAWN_MULTIPLIER)); - final long respawnTime = Calendar.getInstance().getTimeInMillis() + respawn_delay; + final long respawnDelay = Rnd.get((int) (RespawnMinDelay * 1000 * Config.RAID_MIN_RESPAWN_MULTIPLIER), (int) (RespawnMaxDelay * 1000 * Config.RAID_MAX_RESPAWN_MULTIPLIER)); + final long respawnTime = Calendar.getInstance().getTimeInMillis() + respawnDelay; info.set("currentHP", boss.getMaxHp()); info.set("currentMP", boss.getMaxMp()); info.set("respawnTime", respawnTime); - ScheduledFuture futureSpawn; - futureSpawn = ThreadPool.schedule(new SpawnSchedule(boss.getNpcId()), respawn_delay); - _schedules.put(boss.getNpcId(), futureSpawn); + _schedules.put(boss.getNpcId(), ThreadPool.schedule(new SpawnSchedule(boss.getNpcId()), respawnDelay)); // To update immediately the database, used for website to show up RaidBoss status. if (Config.SAVE_RAIDBOSS_STATUS_INTO_DB) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java index 0c4c32c4f7..ebed8aecaa 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java @@ -39,6 +39,7 @@ import org.l2jmobius.gameserver.instancemanager.CustomNpcInstanceManager; import org.l2jmobius.gameserver.instancemanager.DimensionalRiftManager; import org.l2jmobius.gameserver.instancemanager.FortManager; import org.l2jmobius.gameserver.instancemanager.QuestManager; +import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager; import org.l2jmobius.gameserver.model.DropCategory; import org.l2jmobius.gameserver.model.DropData; import org.l2jmobius.gameserver.model.Skill; @@ -2920,7 +2921,7 @@ public class NpcInstance extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !RaidBossSpawnManager.getInstance().isDefined(getNpcId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Npc.java index 8c89b4d45a..33da802cdc 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -47,6 +47,7 @@ import org.l2jmobius.gameserver.handler.IBypassHandler; import org.l2jmobius.gameserver.instancemanager.CHSiegeManager; import org.l2jmobius.gameserver.instancemanager.CastleManager; import org.l2jmobius.gameserver.instancemanager.FortManager; +import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager; import org.l2jmobius.gameserver.instancemanager.TownManager; import org.l2jmobius.gameserver.instancemanager.WalkingManager; import org.l2jmobius.gameserver.instancemanager.ZoneManager; @@ -1311,7 +1312,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !RaidBossSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Npc.java index 8c89b4d45a..33da802cdc 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -47,6 +47,7 @@ import org.l2jmobius.gameserver.handler.IBypassHandler; import org.l2jmobius.gameserver.instancemanager.CHSiegeManager; import org.l2jmobius.gameserver.instancemanager.CastleManager; import org.l2jmobius.gameserver.instancemanager.FortManager; +import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager; import org.l2jmobius.gameserver.instancemanager.TownManager; import org.l2jmobius.gameserver.instancemanager.WalkingManager; import org.l2jmobius.gameserver.instancemanager.ZoneManager; @@ -1311,7 +1312,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !RaidBossSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Npc.java index 5bc3f88cea..79f6b1f42a 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1124,7 +1124,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Npc.java index 5bc3f88cea..79f6b1f42a 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1124,7 +1124,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Npc.java index 5bc3f88cea..79f6b1f42a 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1124,7 +1124,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Npc.java index 6228ea6c0d..64073c04fc 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1136,7 +1136,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Npc.java index 6228ea6c0d..64073c04fc 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1136,7 +1136,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Npc.java index 6228ea6c0d..64073c04fc 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1136,7 +1136,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); } diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Npc.java index 5bc3f88cea..79f6b1f42a 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -1124,7 +1124,7 @@ public class Npc extends Creature super.onDecay(); // Decrease its spawn counter - if (_spawn != null) + if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId())) { _spawn.decreaseCount(this); }