Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- java/net/sf/l2j/gameserver/instancemanager/RaidBossSpawnManager.java (revision 9)
- +++ java/net/sf/l2j/gameserver/instancemanager/RaidBossSpawnManager.java (working copy)
- @@ -45,6 +45,7 @@
- protected final static Map<Integer, L2RaidBossInstance> _bosses = new HashMap<>();
- protected final static Map<Integer, L2Spawn> _spawns = new HashMap<>();
- + protected final static Map<Integer, Long> _respawns = new HashMap<>();
- protected final static Map<Integer, StatsSet> _storedInfo = new HashMap<>();
- protected final static Map<Integer, ScheduledFuture<?>> _schedules = new HashMap<>();
- @@ -142,6 +143,7 @@
- _log.info("RaidBoss: " + raidboss.getName() + " has spawned.");
- _bosses.put(bossId, raidboss);
- + _respawns.put(bossId,0L);
- }
- _schedules.remove(bossId);
- @@ -148,6 +150,14 @@
- }
- }
- + public long getRespawntime(int id)
- + {
- + if(_respawns.containsKey(id))
- + return _respawns.get(id);
- +
- + return -1;
- + }
- +
- public void updateStatus(L2RaidBossInstance boss, boolean isBossDead)
- {
- if (!_storedInfo.containsKey(boss.getNpcId()))
- @@ -171,6 +181,7 @@
- {
- _log.info("RaidBoss: " + boss.getName() + " - " + StringUtil.DATE_MM.format(respawnTime) + " (" + respawnDelay + "h).");
- + _respawns.put(boss.getNpcId(), Calendar.getInstance().getTimeInMillis() + (respawnDelay * 3600000L));
- _schedules.put(boss.getNpcId(), ThreadPoolManager.getInstance().scheduleGeneral(new spawnSchedule(boss.getNpcId()), respawnDelay * 3600000));
- updateDb();
- }
- @@ -179,6 +190,8 @@
- {
- boss.setRaidStatus(StatusEnum.ALIVE);
- + _respawns.put(boss.getNpcId(), 0L);
- +
- info.set("currentHP", boss.getCurrentHp());
- info.set("currentMP", boss.getCurrentMp());
- info.set("respawnTime", 0L);
- @@ -226,11 +239,13 @@
- info.set("respawnTime", 0L);
- _storedInfo.put(bossId, info);
- + _respawns.put(bossId, 0L);
- }
- }
- else
- {
- long spawnTime = respawnTime - Calendar.getInstance().getTimeInMillis();
- + _respawns.put(bossId,respawnTime);
- _schedules.put(bossId, ThreadPoolManager.getInstance().scheduleGeneral(new spawnSchedule(bossId), spawnTime));
- }
- @@ -272,6 +287,9 @@
- SpawnTable.getInstance().deleteSpawn(spawnDat, false);
- _spawns.remove(bossId);
- + if (_respawns.containsKey(bossId))
- + _respawns.remove(bossId);
- +
- if (_bosses.containsKey(bossId))
- _bosses.remove(bossId);
- @@ -412,6 +430,7 @@
- _schedules.clear();
- }
- + _respawns.clear();
- _storedInfo.clear();
- _spawns.clear();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement