public void updateStatus(L2RaidBossInstance boss, boolean isBossDead)
{
if(!_storedInfo.containsKey(boss.getNpcId()))
return;
StatsSet info = _storedInfo.get(boss.getNpcId());
if(isBossDead)
{
boss.setRaidStatus(StatusEnum.DEAD);
long respawnTime;
int RespawnMinDelay = boss.getSpawn().getRespawnMinDelay();
int RespawnMaxDelay = boss.getSpawn().getRespawnMaxDelay();
long respawn_delay = Rnd.get((int) (RespawnMinDelay * 1000 * Config.RAID_MIN_RESPAWN_MULTIPLIER), (int) (RespawnMaxDelay * 1000 * Config.RAID_MAX_RESPAWN_MULTIPLIER));
respawnTime = Calendar.getInstance().getTimeInMillis() + respawn_delay;
info.set("currentHP", boss.getMaxHp());
info.set("currentMP", boss.getMaxMp());
info.set("respawnTime", respawnTime);
String text = "RaidBossSpawnManager: Updated " + boss.getName() + " respawn time to " + respawnTime;
Log.add(text, "RaidBossSpawnManager");
ScheduledFuture<?> futureSpawn;
futureSpawn = ThreadPoolManager.getInstance().scheduleGeneral(new spawnSchedule(boss.getNpcId()), respawn_delay);
_schedules.put(boss.getNpcId(), futureSpawn);
futureSpawn = null;
if(Config.SAVE_RAIDBOSS_STATUS_INTO_DB)
{
updateDb();
}
}
else
{
boss.setRaidStatus(StatusEnum.ALIVE);
info.set("currentHP", boss.getCurrentHp());
info.set("currentMP", boss.getCurrentMp());
info.set("respawnTime", 0L);
}
_storedInfo.remove(boss.getNpcId());
_storedInfo.put(boss.getNpcId(), info);