Fixed raidboss random instant spawn.
This commit is contained in:
@@ -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)
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user