diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Antharas.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Antharas.java index 37fd5637c9..8d52a53a8b 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Antharas.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Antharas.java @@ -57,18 +57,24 @@ public class Antharas extends Quest { protected static final Logger LOGGER = Logger.getLogger(Antharas.class.getName()); - // Config + // Antharas status. + private static final int DORMANT = 0; // Antharas is spawned and no one has entered yet. Entry is unlocked + private static final int WAITING = 1; // Antharas is spawend and someone has entered, triggering a 30 minute window for additional people to enter before he unleashes his attack. Entry is unlocked. + private static final int FIGHTING = 2; // Antharas is engaged in battle, annihilating his foes. Entry is locked + private static final int DEAD = 3; // Antharas has been killed. Entry is locked + // Monsters. + private static final int ANTHARAS_OLD = 29019; + private static final int ANTHARAS_WEAK = 29066; + private static final int ANTHARAS_NORMAL = 29067; + private static final int ANTHARAS_STRONG = 29068; + // Configs. private static final int FWA_ACTIVITYTIMEOFANTHARAS = 120; - // private static final int FWA_APPTIMEOFANTHARAS = 1800000; - // private static final int FWA_INACTIVITYTIME = 900000; - // private static final boolean FWA_OLDANTHARAS = true; // use antharas interlude with minions - protected static final boolean FWA_OLDANTHARAS = Config.ANTHARAS_OLD; // use antharas interlude with minions + protected static final boolean FWA_OLDANTHARAS = Config.ANTHARAS_OLD; // Use antharas Interlude with minions. private static final boolean FWA_MOVEATRANDOM = true; private static final boolean FWA_DOSERVEREARTHQUAKE = true; private static final int FWA_LIMITOFWEAK = 45; private static final int FWA_LIMITOFNORMAL = 63; - - private static final int FWA_MAXMOBS = 10; // this includes Antharas itself + private static final int FWA_MAXMOBS = 10; // This includes Antharas. private static final int FWA_INTERVALOFMOBSWEAK = 180000; private static final int FWA_INTERVALOFMOBSNORMAL = 150000; private static final int FWA_INTERVALOFMOBSSTRONG = 120000; @@ -83,23 +89,6 @@ public class Antharas extends Quest -7709, 0 }; - - protected Collection _teleportCubeSpawn = ConcurrentHashMap.newKeySet(); - protected Collection _teleportCube = ConcurrentHashMap.newKeySet(); - - // Spawn data of monsters. - protected Map _monsterSpawn = new ConcurrentHashMap<>(); - - // Instance of monsters. - protected Collection _monsters = ConcurrentHashMap.newKeySet(); - protected GrandBossInstance _antharas = null; - - // monstersId - private static final int ANTHARASOLDID = 29019; - private static final int ANTHARASWEAKID = 29066; - private static final int ANTHARASNORMALID = 29067; - private static final int ANTHARASSTRONGID = 29068; - // Tasks. protected ScheduledFuture _cubeSpawnTask = null; protected ScheduledFuture _monsterSpawnTask = null; @@ -110,38 +99,19 @@ public class Antharas extends Quest protected ScheduledFuture _selfDestructionTask = null; protected ScheduledFuture _moveAtRandomTask = null; protected ScheduledFuture _movieTask = null; - - // Antharas Status Tracking : - private static final int DORMANT = 0; // Antharas is spawned and no one has entered yet. Entry is unlocked - private static final int WAITING = 1; // Antharas is spawend and someone has entered, triggering a 30 minute window for additional people to enter - // before he unleashes his attack. Entry is unlocked - private static final int FIGHTING = 2; // Antharas is engaged in battle, annihilating his foes. Entry is locked - private static final int DEAD = 3; // Antharas has been killed. Entry is locked - - protected static long _LastAction = 0; - + // Misc. + protected Collection _teleportCubeSpawn = ConcurrentHashMap.newKeySet(); + protected Collection _teleportCube = ConcurrentHashMap.newKeySet(); + protected Map _monsterSpawn = new ConcurrentHashMap<>(); + protected Collection _monsters = ConcurrentHashMap.newKeySet(); + protected GrandBossInstance _antharas = null; + protected static long _lastAction = 0; protected static BossZone _zone; - // Boss: Antharas public Antharas() { super(-1, "ai/bosses"); - final int[] mob = - { - ANTHARASOLDID, - ANTHARASWEAKID, - ANTHARASNORMALID, - ANTHARASSTRONGID, - 29069, - 29070, - 29071, - 29072, - 29073, - 29074, - 29075, - 29076 - }; - registerMobs(mob); + registerMobs(ANTHARAS_OLD, ANTHARAS_WEAK, ANTHARAS_NORMAL, ANTHARAS_STRONG, 29069, 29070, 29071, 29072, 29073, 29074, 29075, 29076); init(); } @@ -155,19 +125,18 @@ public class Antharas extends Quest return null; } - // Initialize private void init() { // Setting spawn data of monsters. try { _zone = GrandBossManager.getInstance().getZone(179700, 113800, -7709); - NpcTemplate template1; + NpcTemplate template; Spawn tempSpawn; - // Old Antharas - template1 = NpcTable.getInstance().getTemplate(ANTHARASOLDID); - tempSpawn = new Spawn(template1); + // Old Antharas. + template = NpcTable.getInstance().getTemplate(ANTHARAS_OLD); + tempSpawn = new Spawn(template); tempSpawn.setX(181323); tempSpawn.setY(114850); tempSpawn.setZ(-7623); @@ -175,11 +144,11 @@ public class Antharas extends Quest tempSpawn.setAmount(1); tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2); SpawnTable.getInstance().addNewSpawn(tempSpawn, false); - _monsterSpawn.put(29019, tempSpawn); + _monsterSpawn.put(ANTHARAS_OLD, tempSpawn); - // Weak Antharas - template1 = NpcTable.getInstance().getTemplate(ANTHARASWEAKID); - tempSpawn = new Spawn(template1); + // Weak Antharas. + template = NpcTable.getInstance().getTemplate(ANTHARAS_WEAK); + tempSpawn = new Spawn(template); tempSpawn.setX(181323); tempSpawn.setY(114850); tempSpawn.setZ(-7623); @@ -187,11 +156,11 @@ public class Antharas extends Quest tempSpawn.setAmount(1); tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2); SpawnTable.getInstance().addNewSpawn(tempSpawn, false); - _monsterSpawn.put(29066, tempSpawn); + _monsterSpawn.put(ANTHARAS_WEAK, tempSpawn); - // Normal Antharas - template1 = NpcTable.getInstance().getTemplate(ANTHARASNORMALID); - tempSpawn = new Spawn(template1); + // Normal Antharas. + template = NpcTable.getInstance().getTemplate(ANTHARAS_NORMAL); + tempSpawn = new Spawn(template); tempSpawn.setX(181323); tempSpawn.setY(114850); tempSpawn.setZ(-7623); @@ -199,11 +168,11 @@ public class Antharas extends Quest tempSpawn.setAmount(1); tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2); SpawnTable.getInstance().addNewSpawn(tempSpawn, false); - _monsterSpawn.put(29067, tempSpawn); + _monsterSpawn.put(ANTHARAS_NORMAL, tempSpawn); - // Strong Antharas - template1 = NpcTable.getInstance().getTemplate(ANTHARASSTRONGID); - tempSpawn = new Spawn(template1); + // Strong Antharas. + template = NpcTable.getInstance().getTemplate(ANTHARAS_STRONG); + tempSpawn = new Spawn(template); tempSpawn.setX(181323); tempSpawn.setY(114850); tempSpawn.setZ(-7623); @@ -211,7 +180,7 @@ public class Antharas extends Quest tempSpawn.setAmount(1); tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2); SpawnTable.getInstance().addNewSpawn(tempSpawn, false); - _monsterSpawn.put(29068, tempSpawn); + _monsterSpawn.put(ANTHARAS_STRONG, tempSpawn); } catch (Exception e) { @@ -239,40 +208,40 @@ public class Antharas extends Quest LOGGER.warning(e.getMessage()); } - Integer status = GrandBossManager.getInstance().getBossStatus(ANTHARASOLDID); + Integer status = GrandBossManager.getInstance().getBossStatus(ANTHARAS_OLD); if (FWA_OLDANTHARAS || (status == WAITING)) { - final StatSet info = GrandBossManager.getInstance().getStatSet(ANTHARASOLDID); + final StatSet info = GrandBossManager.getInstance().getStatSet(ANTHARAS_OLD); final Long respawnTime = info.getLong("respawn_time"); if ((status == DEAD) && (respawnTime <= Chronos.currentTimeMillis())) { - // the time has already expired while the server was offline. Immediately spawn antharas in his cave. - // also, the status needs to be changed to DORMANT - GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID, DORMANT); + // The time has already expired while the server was offline. Immediately spawn antharas in his cave. + // Also, the status needs to be changed to DORMANT. + GrandBossManager.getInstance().setBossStatus(ANTHARAS_OLD, DORMANT); status = DORMANT; } else if (status == FIGHTING) { - final int loc_x = info.getInt("loc_x"); - final int loc_y = info.getInt("loc_y"); - final int loc_z = info.getInt("loc_z"); + final int x = info.getInt("loc_x"); + final int y = info.getInt("loc_y"); + final int z = info.getInt("loc_z"); final int heading = info.getInt("heading"); final int hp = info.getInt("currentHP"); final int mp = info.getInt("currentMP"); - _antharas = (GrandBossInstance) addSpawn(ANTHARASOLDID, loc_x, loc_y, loc_z, heading, false, 0); + _antharas = (GrandBossInstance) addSpawn(ANTHARAS_OLD, x, y, z, heading, false, 0); GrandBossManager.getInstance().addBoss(_antharas); _antharas.setCurrentHpMp(hp, mp); - _LastAction = Chronos.currentTimeMillis(); - // Start repeating timer to check for inactivity + _lastAction = Chronos.currentTimeMillis(); + // Start repeating timer to check for inactivity. _activityCheckTask = ThreadPool.scheduleAtFixedRate(new CheckActivity(), 60000, 60000); } else if (status == DEAD) { - ThreadPool.schedule(new UnlockAntharas(ANTHARASOLDID), respawnTime - Chronos.currentTimeMillis()); + ThreadPool.schedule(new UnlockAntharas(ANTHARAS_OLD), respawnTime - Chronos.currentTimeMillis()); } else if (status == DORMANT) { - // Here status is 0 on Database, dont do nothing + // Here status is 0 on Database, don't do anything. } else { @@ -281,23 +250,23 @@ public class Antharas extends Quest } else { - final Integer statusWeak = GrandBossManager.getInstance().getBossStatus(ANTHARASWEAKID); - final Integer statusNormal = GrandBossManager.getInstance().getBossStatus(ANTHARASNORMALID); - final Integer statusStrong = GrandBossManager.getInstance().getBossStatus(ANTHARASSTRONGID); + final Integer statusWeak = GrandBossManager.getInstance().getBossStatus(ANTHARAS_WEAK); + final Integer statusNormal = GrandBossManager.getInstance().getBossStatus(ANTHARAS_NORMAL); + final Integer statusStrong = GrandBossManager.getInstance().getBossStatus(ANTHARAS_STRONG); int antharasId = 0; if ((statusWeak == FIGHTING) || (statusWeak == DEAD)) { - antharasId = ANTHARASWEAKID; + antharasId = ANTHARAS_WEAK; status = statusWeak; } else if ((statusNormal == FIGHTING) || (statusNormal == DEAD)) { - antharasId = ANTHARASNORMALID; + antharasId = ANTHARAS_NORMAL; status = statusNormal; } else if ((statusStrong == FIGHTING) || (statusStrong == DEAD)) { - antharasId = ANTHARASSTRONGID; + antharasId = ANTHARAS_STRONG; status = statusStrong; } if ((antharasId != 0) && (status == FIGHTING)) @@ -312,8 +281,8 @@ public class Antharas extends Quest _antharas = (GrandBossInstance) addSpawn(antharasId, loc_x, loc_y, loc_z, heading, false, 0); GrandBossManager.getInstance().addBoss(_antharas); _antharas.setCurrentHpMp(hp, mp); - _LastAction = Chronos.currentTimeMillis(); - // Start repeating timer to check for inactivity + _lastAction = Chronos.currentTimeMillis(); + // Start repeating timer to check for inactivity. _activityCheckTask = ThreadPool.scheduleAtFixedRate(new CheckActivity(), 60000, 60000); } else if ((antharasId != 0) && (status == DEAD)) @@ -322,8 +291,8 @@ public class Antharas extends Quest final Long respawnTime = info.getLong("respawn_time"); if (respawnTime <= Chronos.currentTimeMillis()) { - // the time has already expired while the server was offline. Immediately spawn antharas in his cave. - // also, the status needs to be changed to DORMANT + // The time has already expired while the server was offline. Immediately spawn antharas in his cave. + // Also, the status needs to be changed to DORMANT. GrandBossManager.getInstance().setBossStatus(antharasId, DORMANT); status = DORMANT; } @@ -335,7 +304,6 @@ public class Antharas extends Quest } } - // Do spawn teleport cube. public void spawnCube() { if (_mobsSpawnTask != null) @@ -360,7 +328,6 @@ public class Antharas extends Quest } } - // Setting Antharas spawn task. public void setAntharasSpawnTask() { if (_monsterSpawnTask == null) @@ -369,7 +336,7 @@ public class Antharas extends Quest { if (_monsterSpawnTask == null) { - GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID, WAITING); + GrandBossManager.getInstance().setBossStatus(ANTHARAS_OLD, WAITING); _monsterSpawnTask = ThreadPool.schedule(new AntharasSpawn(1), 60000 * Config.ANTHARAS_WAIT_TIME); } } @@ -380,16 +347,15 @@ public class Antharas extends Quest { int intervalOfMobs; - // Interval of minions is decided by the type of Antharas - // that invaded the lair. + // Interval of minions is decided by the type of Antharas that invaded the lair. switch (antharasId) { - case ANTHARASWEAKID: + case ANTHARAS_WEAK: { intervalOfMobs = FWA_INTERVALOFMOBSWEAK; break; } - case ANTHARASNORMALID: + case ANTHARAS_NORMAL: { intervalOfMobs = FWA_INTERVALOFMOBSNORMAL; break; @@ -402,10 +368,9 @@ public class Antharas extends Quest } // Spawn mobs. - _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(new MobsSpawn(), intervalOfMobs, intervalOfMobs); + _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(new MinionsSpawn(), intervalOfMobs, intervalOfMobs); } - // Do spawn Antharas. private class AntharasSpawn implements Runnable { private int _taskId = 0; @@ -430,25 +395,24 @@ public class Antharas extends Quest { case 1: // Spawn. { - // Strength of Antharas is decided by the number of players that - // invaded the lair. + // Strength of Antharas is decided by the number of players that invaded the lair. _monsterSpawnTask.cancel(false); _monsterSpawnTask = null; if (FWA_OLDANTHARAS) { - npcId = 29019; // old + npcId = ANTHARAS_OLD; } else if ((_players == null) || (_players.size() <= FWA_LIMITOFWEAK)) { - npcId = 29066; // weak + npcId = ANTHARAS_WEAK; } else if (_players.size() > FWA_LIMITOFNORMAL) { - npcId = 29068; // strong + npcId = ANTHARAS_STRONG; } else { - npcId = 29067; // normal + npcId = ANTHARAS_NORMAL; } // Do spawn. antharasSpawn = _monsterSpawn.get(npcId); @@ -456,10 +420,10 @@ public class Antharas extends Quest GrandBossManager.getInstance().addBoss(_antharas); _monsters.add(_antharas); _antharas.setImmobilized(true); - GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID, DORMANT); + GrandBossManager.getInstance().setBossStatus(ANTHARAS_OLD, DORMANT); GrandBossManager.getInstance().setBossStatus(npcId, FIGHTING); - _LastAction = Chronos.currentTimeMillis(); - // Start repeating timer to check for inactivity + _lastAction = Chronos.currentTimeMillis(); + // Start repeating timer to check for inactivity. _activityCheckTask = ThreadPool.scheduleAtFixedRate(new CheckActivity(), 60000, 60000); // Setting 1st time of minions spawn task. if (!FWA_OLDANTHARAS) @@ -574,10 +538,9 @@ public class Antharas extends Quest } } - // Do spawn Behemoth or Bomber. - private class MobsSpawn implements Runnable + private class MinionsSpawn implements Runnable { - public MobsSpawn() + public MinionsSpawn() { } @@ -608,7 +571,7 @@ public class Antharas extends Quest } template1 = NpcTable.getInstance().getTemplate(npcId); tempSpawn = new Spawn(template1); - // allocates it at random in the lair of Antharas. + // Allocates it at random in the lair of Antharas. int tried = 0; boolean notFound = true; int x = 175000; @@ -672,7 +635,6 @@ public class Antharas extends Quest return super.onAggroRangeEnter(npc, player, isPet); } - // Do self destruction. private class SelfDestructionOfBomber implements Runnable { private final NpcInstance _bomber; @@ -742,23 +704,21 @@ public class Antharas extends Quest return super.onSpellFinished(npc, player, skill); } - // At end of activity time. protected class CheckActivity implements Runnable { @Override public void run() { - final Long temp = (Chronos.currentTimeMillis() - _LastAction); + final Long temp = (Chronos.currentTimeMillis() - _lastAction); if (temp > (Config.ANTHARAS_DESPAWN_TIME * 60000)) { GrandBossManager.getInstance().setBossStatus(_antharas.getNpcId(), DORMANT); - setUnspawn(); + finishRaid(); } } } - // Clean Antharas's lair. - public void setUnspawn() + public void finishRaid() { // Eliminate players. _zone.oustAllPlayers(); @@ -822,7 +782,6 @@ public class Antharas extends Quest _teleportCube.clear(); } - // Do spawn teleport cube. private class CubeSpawn implements Runnable { private final int _type; @@ -842,12 +801,11 @@ public class Antharas extends Quest } else { - setUnspawn(); + finishRaid(); } } } - // UnLock Antharas. private static class UnlockAntharas implements Runnable { private final int _bossId; @@ -871,7 +829,6 @@ public class Antharas extends Quest } } - // Action is enabled the boss. private class SetMobilised implements Runnable { private final GrandBossInstance _boss; @@ -895,7 +852,6 @@ public class Antharas extends Quest } } - // Move at random on after Antharas appears. private static class MoveAtRandom implements Runnable { private final NpcInstance _npc; @@ -917,9 +873,9 @@ public class Antharas extends Quest @Override public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet) { - if ((npc.getNpcId() == 29019) || (npc.getNpcId() == 29066) || (npc.getNpcId() == 29067) || (npc.getNpcId() == 29068)) + if ((npc.getNpcId() == ANTHARAS_OLD) || (npc.getNpcId() == ANTHARAS_WEAK) || (npc.getNpcId() == ANTHARAS_NORMAL) || (npc.getNpcId() == ANTHARAS_STRONG)) { - _LastAction = Chronos.currentTimeMillis(); + _lastAction = Chronos.currentTimeMillis(); if (!FWA_OLDANTHARAS && (_mobsSpawnTask == null)) { startMinionSpawns(npc.getNpcId()); @@ -946,7 +902,6 @@ public class Antharas extends Quest break; } } - npc.doCast(skill); } return super.onAttack(npc, attacker, damage, isPet); @@ -955,27 +910,27 @@ public class Antharas extends Quest @Override public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet) { - if ((npc.getNpcId() == 29019) || (npc.getNpcId() == 29066) || (npc.getNpcId() == 29067) || (npc.getNpcId() == 29068)) + if ((npc.getNpcId() == ANTHARAS_OLD) || (npc.getNpcId() == ANTHARAS_WEAK) || (npc.getNpcId() == ANTHARAS_NORMAL) || (npc.getNpcId() == ANTHARAS_STRONG)) { npc.broadcastPacket(new PlaySound(1, "BS01_D", npc)); _cubeSpawnTask = ThreadPool.schedule(new CubeSpawn(0), 10000); GrandBossManager.getInstance().setBossStatus(npc.getNpcId(), DEAD); final long respawnTime = (Config.ANTHARAS_RESP_FIRST + Rnd.get(Config.ANTHARAS_RESP_SECOND)) * 3600000; ThreadPool.schedule(new UnlockAntharas(npc.getNpcId()), respawnTime); - // also save the respawn time so that the info is maintained past reboots + // Also save the respawn time so that the info is maintained past restarts. final StatSet info = GrandBossManager.getInstance().getStatSet(npc.getNpcId()); info.set("respawn_time", (Chronos.currentTimeMillis() + respawnTime)); GrandBossManager.getInstance().setStatSet(npc.getNpcId(), info); } else if (npc.getNpcId() == 29069) { - final int countHPHerb = Rnd.get(6, 18); - final int countMPHerb = Rnd.get(6, 18); - for (int i = 0; i < countHPHerb; i++) + final int hpHerbCount = Rnd.get(6, 18); + final int mpHerbCount = Rnd.get(6, 18); + for (int i = 0; i < hpHerbCount; i++) { ((MonsterInstance) npc).dropItem(killer, 8602, 1); } - for (int i = 0; i < countMPHerb; i++) + for (int i = 0; i < mpHerbCount; i++) { ((MonsterInstance) npc).dropItem(killer, 8605, 1); } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Baium.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Baium.java index 58dbb49e28..5d39638577 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Baium.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Baium.java @@ -66,19 +66,14 @@ public class Baium extends Quest { protected static final Logger LOGGER = Logger.getLogger(Baium.class.getName()); - private Creature _target; - private Skill _skill; + // Baium status. + private static final byte ASLEEP = 0; // Baium is in the stone version, waiting to be woken up. Entry is unlocked. + private static final byte AWAKE = 1; // Baium is awake and fighting. Entry is locked. + private static final byte DEAD = 2; // Baium has been killed and has not yet spawned. Entry is locked. private static final int STONE_BAIUM = 29025; private static final int ANGELIC_VORTEX = 31862; private static final int LIVE_BAIUM = 29020; private static final int ARCHANGEL = 29021; - - // Baium status tracking, - private static final byte ASLEEP = 0; // baium is in the stone version, waiting to be woken up. Entry is unlocked, - private static final byte AWAKE = 1; // baium is awake and fighting. Entry is locked. - private static final byte DEAD = 2; // baium has been killed and has not yet spawned. Entry is locked, - - // Archangel locations. // @formatter:off private static final int[][] ANGEL_LOCATION = { @@ -89,44 +84,42 @@ public class Baium extends Quest {115792, 16608, 10080, 0}, }; // @formatter:on - + // Misc. private long _lastAttackVsBaiumTime = 0; private final List _minions = new CopyOnWriteArrayList<>(); - protected BossZone _zone; + private BossZone _zone; + private Creature _target; + private Skill _skill; public Baium() { super(-1, "ai/bosses"); - final int[] mob = - { - LIVE_BAIUM - }; - registerMobs(mob); + registerMobs(LIVE_BAIUM); // Quest NPC starter initialization addStartNpc(STONE_BAIUM); addStartNpc(ANGELIC_VORTEX); addTalkId(STONE_BAIUM); addTalkId(ANGELIC_VORTEX); + _zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077); + final StatSet info = GrandBossManager.getInstance().getStatSet(LIVE_BAIUM); final Integer status = GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM); if (status == DEAD) { - // load the unlock date and time for baium from DB + // Load the unlock date and time for baium from DB. final long temp = (info.getLong("respawn_time") - Chronos.currentTimeMillis()); if (temp > 0) { - // the unlock time has not yet expired. Mark Baium as currently locked (dead). Setup a timer - // to fire at the correct time (calculate the time between now and the unlock time, - // setup a timer to fire after that many msec) + // The unlock time has not yet expired. Mark Baium as currently locked (dead). + // Setup a timer to fire at the correct time (calculate the time between now and the unlock time, setup a timer to fire after that many msec). startQuestTimer("baium_unlock", temp, null, null); } else { - // the time has already expired while the server was offline. Delete the saved time and - // immediately spawn the stone-baium. Also the state need not be changed from ASLEEP + // The time has already expired while the server was offline. Delete the saved time and immediately spawn the stone-baium. Also the state need not be changed from ASLEEP. addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); if (Config.ANNOUNCE_TO_ALL_SPAWN_RB) { @@ -137,13 +130,13 @@ public class Baium extends Quest } else if (status == AWAKE) { - final int loc_x = info.getInt("loc_x"); - final int loc_y = info.getInt("loc_y"); - final int loc_z = info.getInt("loc_z"); + final int x = info.getInt("loc_x"); + final int y = info.getInt("loc_y"); + final int z = info.getInt("loc_z"); final int heading = info.getInt("heading"); final int hp = info.getInt("currentHP"); final int mp = info.getInt("currentMP"); - final GrandBossInstance baium = (GrandBossInstance) addSpawn(LIVE_BAIUM, loc_x, loc_y, loc_z, heading, false, 0); + final GrandBossInstance baium = (GrandBossInstance) addSpawn(LIVE_BAIUM, x, y, z, heading, false, 0); if (Config.ANNOUNCE_TO_ALL_SPAWN_RB) { AnnouncementsTable.getInstance().announceToAll("Raid boss " + baium.getName() + " spawned in world."); @@ -163,7 +156,7 @@ public class Baium extends Quest { LOGGER.warning(e.getMessage()); } - }, 100L); + }, 100); } else { @@ -201,7 +194,8 @@ public class Baium extends Quest { npc.broadcastPacket(new SocialAction(npc.getObjectId(), 1)); npc.broadcastPacket(new Earthquake(npc.getX(), npc.getY(), npc.getZ(), 40, 5)); - // start monitoring baium's inactivity + + // Start monitoring baium's inactivity. _lastAttackVsBaiumTime = Chronos.currentTimeMillis(); startQuestTimer("baium_despawn", 60000, npc, null, true); if (player != null) @@ -227,9 +221,8 @@ public class Baium extends Quest { LOGGER.warning(e.getMessage()); } - }, 11100L); - // TODO: the person who woke baium up should be knocked across the room, onto a wall, and - // lose massive amounts of HP. + }, 11100); + // TODO: the person who woke baium up should be knocked across the room, onto a wall, and lose massive amounts of HP. for (int[] element : ANGEL_LOCATION) { final MonsterInstance angel = (MonsterInstance) addSpawn(ARCHANGEL, element[0], element[1], element[2], element[3], false, 0); @@ -239,21 +232,20 @@ public class Baium extends Quest angel.isAggressive(); } } - // despawn the live baium after 30 minutes of inactivity - // also check if the players are cheating, having pulled Baium outside his zone... } else if (event.equals("baium_despawn") && (npc != null)) { + // Despawn the live baium after 30 minutes of inactivity also check if the players are cheating, having pulled Baium outside his zone... if (npc.getNpcId() == LIVE_BAIUM) { - // just in case the zone reference has been lost (somehow...), restore the reference + // Just in case the zone reference has been lost (somehow...), restore the reference. if (_zone == null) { _zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077); } if ((_lastAttackVsBaiumTime + (Config.BAIUM_SLEEP * 1000)) < Chronos.currentTimeMillis()) { - npc.deleteMe(); // despawn the live-baium + npc.deleteMe(); // Despawn the live-baium. for (NpcInstance minion : _minions) { if (minion != null) @@ -263,8 +255,8 @@ public class Baium extends Quest } } _minions.clear(); - addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); // spawn stone-baium - GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); // mark that Baium is not awake any more + addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); // Spawn stone-baium. + GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); // Mark that Baium is not awake any more. _zone.oustAllPlayers(); cancelQuestTimer("baium_despawn", npc, null); } @@ -301,8 +293,7 @@ public class Baium extends Quest { if (Config.ALLOW_DIRECT_TP_TO_BOSS_ROOM || _zone.isPlayerAllowed(player)) { - // once Baium is awaken, no more people may enter until he dies, the server reboots, or - // 30 minutes pass with no attacks made against Baium. + // Once Baium is awaken, no more people may enter until he dies, the server reboots, or 30 minutes pass with no attacks made against Baium. GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, AWAKE); npc.deleteMe(); final GrandBossInstance baium = (GrandBossInstance) addSpawn(LIVE_BAIUM, npc); @@ -325,21 +316,20 @@ public class Baium extends Quest } else { - htmltext = "Conditions are not right to wake up Baium"; + htmltext = "Conditions are not right to wake up Baium."; } } else if (npcId == ANGELIC_VORTEX) { if (player.isFlying()) { - // print "Player "+player.getName()+" attempted to enter Baium's lair while flying!"; - return "Angelic Vortex:
You may not enter while flying a wyvern"; + return "Angelic Vortex:
You may not enter while flying a wyvern."; } - if ((status == ASLEEP) && (player.getQuestState(getName()).getQuestItemsCount(4295) > 0)) // bloody fabric + if ((status == ASLEEP) && (player.getQuestState(getName()).getQuestItemsCount(4295) > 0)) // Bloody fabric. { player.getQuestState(getName()).takeItems(4295, 1); - // allow entry for the player for the next 30 secs (more than enough time for the TP to happen) + // Allow entry for the player for the next 30 secs (more than enough time for the TP to happen). // Note: this just means 30secs to get in, no limits on how long it takes before we get out. _zone.allowPlayerEntry(player, 30); player.teleToLocation(113100, 14500, 10077); @@ -398,7 +388,7 @@ public class Baium extends Quest npc.doCast(SkillTable.getInstance().getSkill(4258, 1)); } } - // update a variable with the last action against baium + // Update a variable with the last action against Baium. _lastAttackVsBaiumTime = Chronos.currentTimeMillis(); callSkillAI(npc); } @@ -410,13 +400,13 @@ public class Baium extends Quest { npc.broadcastPacket(new PlaySound(1, "BS01_D", npc)); cancelQuestTimer("baium_despawn", npc, null); - // spawn the "Teleportation Cubic" for 15 minutes (to allow players to exit the lair) - addSpawn(29055, 115203, 16620, 10078, 0, false, 900000); // //should we teleport everyone out if the cubic despawns?? - // "lock" baium for 5 days and 1 to 8 hours [i.e. 432,000,000 + 1*3,600,000 + random-less-than(8*3,600,000) millisecs] + // Spawn the "Teleportation Cubic" for 15 minutes (to allow players to exit the lair). + addSpawn(29055, 115203, 16620, 10078, 0, false, 900000); // Should we teleport everyone out if the cubic despawns?? + // Lock baium for 5 days and 1 to 8 hours [i.e. 432,000,000 + 1*3,600,000 + random-less-than(8*3,600,000) millisecs] final long respawnTime = (Config.BAIUM_RESP_FIRST + Rnd.get(Config.BAIUM_RESP_SECOND)) * 3600000; GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, DEAD); startQuestTimer("baium_unlock", respawnTime, null, null); - // also save the respawn time so that the info is maintained past reboots + // Also save the respawn time so that the info is maintained past reboots. final StatSet info = GrandBossManager.getInstance().getStatSet(LIVE_BAIUM); info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime); GrandBossManager.getInstance().setStatSet(LIVE_BAIUM, info); @@ -482,7 +472,7 @@ public class Baium extends Quest } startQuestTimer("clean_player", 20000, npc, null); - return result.get(Rnd.get(result.size())); + return getRandomEntry(result); } public synchronized void callSkillAI(NpcInstance npc) diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Core.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Core.java index 7a40930c1f..d485442775 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Core.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Core.java @@ -75,12 +75,11 @@ public class Core extends Quest MINNION_SPAWNS.put(SUSCEPTOR, new Location(17706, 109423, -6488)); MINNION_SPAWNS.put(SUSCEPTOR, new Location(17849, 109388, -6480)); } - // Misc + // Status. private static final byte ALIVE = 0; private static final byte DEAD = 1; - + // Misc. private static boolean _firstAttacked; - private static final Collection _minions = ConcurrentHashMap.newKeySet(); public Core() @@ -149,7 +148,7 @@ public class Core extends Quest { GrandBossManager.getInstance().addBoss(npc); npc.broadcastPacket(new PlaySound(1, "BS01_A", npc)); - // Spawn minions + // Spawn minions. Attackable mob; Location spawnLocation; for (Entry spawn : MINNION_SPAWNS.entrySet()) diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Orfen.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Orfen.java index 6192e06573..7515f9acae 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Orfen.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Orfen.java @@ -85,16 +85,9 @@ public class Orfen extends Quest } case LIVE: { - /* - * int loc_x = info.getInteger("loc_x"); int loc_y = info.getInteger("loc_y"); int loc_z = info.getInteger("loc_z"); int heading = info.getInteger("heading"); - */ - final int loc_x = 55024; - final int loc_y = 17368; - final int loc_z = -5412; - final int heading = 0; final int hp = info.getInt("currentHP"); final int mp = info.getInt("currentMP"); - _orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0); + _orfen = (GrandBossInstance) addSpawn(ORFEN, 55024, 17368, -5412, 0, false, 0); if (Config.ANNOUNCE_TO_ALL_SPAWN_RB) { AnnouncementsTable.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world."); @@ -166,7 +159,8 @@ public class Orfen extends Quest startQuestTimer("ORFEN_RETURN", 10000, npc, null); } else - { // restart the refresh scheduling + { + // Restart the refresh scheduling. startQuestTimer("ORFEN_REFRESH", 10000, npc, null); } break; @@ -236,11 +230,11 @@ public class Orfen extends Quest { npc.broadcastPacket(new PlaySound(1, "BS02_D", npc)); GrandBossManager.getInstance().setBossStatus(ORFEN, DEAD); - // time is 48hour +/- 20hour + // Time is 48hour +/- 20hour. final long respawnTime = (Config.ORFEN_RESP_FIRST + Rnd.get(Config.ORFEN_RESP_SECOND)) * 3600000; cancelQuestTimer("ORFEN_REFRESH", npc, null); startQuestTimer("ORFEN_SPAWN", respawnTime, null, null); - // also save the respawn time so that the info is maintained past reboots + // Also save the respawn time so that the info is maintained past restarts. final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN); info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime); GrandBossManager.getInstance().setStatSet(ORFEN, info); diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/QueenAnt.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/QueenAnt.java index 8a8aa3d7ee..6c2ffc6f90 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/QueenAnt.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/QueenAnt.java @@ -34,24 +34,21 @@ import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.EventType; import org.l2jmobius.gameserver.model.quest.Quest; -import org.l2jmobius.gameserver.model.zone.type.BossZone; import org.l2jmobius.gameserver.network.serverpackets.PlaySound; import org.l2jmobius.gameserver.network.serverpackets.SocialAction; public class QueenAnt extends Quest { + // Queen Ant status + private static final int LIVE = 0; // Queen Ant is spawned. + private static final int DEAD = 1; // Queen Ant has been killed. + // NPCs private static final int QUEEN = 29001; private static final int LARVA = 29002; private static final int NURSE = 29003; private static final int GUARD = 29004; private static final int ROYAL = 29005; - - // QUEEN Status Tracking : - private static final int LIVE = 0; // Queen Ant is spawned. - private static final int DEAD = 1; // Queen Ant has been killed. - - @SuppressWarnings("unused") - private static BossZone _zone; + // Misc private MonsterInstance _larva = null; private MonsterInstance _queen = null; private final List _minions = new CopyOnWriteArrayList<>(); @@ -59,7 +56,7 @@ public class QueenAnt extends Quest enum Event { - QUEEN_SPAWN, /* CHECK_QA_ZONE, */ + QUEEN_SPAWN, CHECK_MINIONS_ZONE, CHECK_NURSE_ALIVE, ACTION, @@ -90,8 +87,6 @@ public class QueenAnt extends Quest addEventId(mob, EventType.ON_ATTACK); } - _zone = GrandBossManager.getInstance().getZone(-21610, 181594, -5734); - final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN); final Integer status = GrandBossManager.getInstance().getBossStatus(QUEEN); @@ -115,13 +110,10 @@ public class QueenAnt extends Quest GrandBossManager.getInstance().addBoss(queen); spawnBoss(queen); } - } break; + } case LIVE: { - /* - * int loc_x = info.getInteger("loc_x"); int loc_y = info.getInteger("loc_y"); int loc_z = info.getInteger("loc_z"); int heading = info.getInteger("heading"); - */ final int hp = info.getInt("currentHP"); final int mp = info.getInt("currentMP"); final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0); @@ -132,8 +124,8 @@ public class QueenAnt extends Quest GrandBossManager.getInstance().addBoss(queen); queen.setCurrentHpMp(hp, mp); spawnBoss(queen); - } break; + } default: { final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0); @@ -144,6 +136,7 @@ public class QueenAnt extends Quest GrandBossManager.getInstance().setBossStatus(QUEEN, LIVE); GrandBossManager.getInstance().addBoss(queen); spawnBoss(queen); + break; } } } @@ -365,7 +358,7 @@ public class QueenAnt extends Quest { npc.broadcastPacket(new PlaySound(1, "BS02_D", npc)); GrandBossManager.getInstance().setBossStatus(QUEEN, DEAD); - // time is 36hour +/- 17hour + // Time is 36hour +/- 17hour. final long respawnTime = (Config.QA_RESP_FIRST + Rnd.get(Config.QA_RESP_SECOND)) * 3600000; startQuestTimer("QUEEN_SPAWN", respawnTime, null, null); startQuestTimer("LARVA_DESPAWN", 4 * 60 * 60 * 1000, null, null); @@ -375,7 +368,7 @@ public class QueenAnt extends Quest cancelQuestTimer("CHECK_NURSE_ALIVE", npc, null); cancelQuestTimer("HEAL", null, null); // cancelQuestTimer("CHECK_QA_ZONE", npc, null); - // also save the respawn time so that the info is maintained past reboots + // Also save the respawn time so that the info is maintained past restarts. final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN); info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime); GrandBossManager.getInstance().setStatSet(QUEEN, info); diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Valakas.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Valakas.java index a6aec93720..09d52c194c 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Valakas.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Valakas.java @@ -50,40 +50,35 @@ import org.l2jmobius.gameserver.util.Util; */ public class Valakas extends Quest { + // Valakas status + private static final byte DORMANT = 0; // Valakas is spawned and no one has entered yet. Entry is unlocked. + private static final byte WAITING = 1; // Valakas is spawend and someone has entered, triggering a 30 minute window for additional people to enter before he unleashes his attack. Entry is unlocked. + private static final byte FIGHTING = 2; // Valakas is engaged in battle, annihilating his foes. Entry is locked. + private static final byte DEAD = 3; // Valakas has been killed. Entry is locked. + // NPC + private static final int VALAKAS = 29028; + // Misc private int i_ai0 = 0; private int i_ai1 = 0; private int i_ai2 = 0; private int i_ai3 = 0; private int i_ai4 = 0; private int i_quest0 = 0; - private long lastAttackTime = 0; // time to tracking valakas when was last time attacked - private int i_quest2 = 0; // hate value for 1st player - private int i_quest3 = 0; // hate value for 2nd player - private int i_quest4 = 0; // hate value for 3rd player - private Creature c_quest2 = null; // 1st most hated target - private Creature c_quest3 = null; // 2nd most hated target - private Creature c_quest4 = null; // 3rd most hated target + private long lastAttackTime = 0; // Time to tracking valakas when was last time attacked. + private int i_quest2 = 0; // Hate value for 1st player. + private int i_quest3 = 0; // Hate value for 2nd player. + private int i_quest4 = 0; // Hate value for 3rd player. + private Creature c_quest2 = null; // 1st most hated target. + private Creature c_quest3 = null; // 2nd most hated target. + private Creature c_quest4 = null; // 3rd most hated target. + private static BossZone _zone; - private static final int VALAKAS = 29028; - - // Valakas Status Tracking : - private static final byte DORMANT = 0; // Valakas is spawned and no one has entered yet. Entry is unlocked - private static final byte WAITING = 1; // Valakas is spawend and someone has entered, triggering a 30 minute window for additional people to enter - // before he unleashes his attack. Entry is unlocked - private static final byte FIGHTING = 2; // Valakas is engaged in battle, annihilating his foes. Entry is locked - private static final byte DEAD = 3; // Valakas has been killed. Entry is locked - - private static BossZone _Zone; - - // Boss: Valakas public Valakas() { super(-1, "ai/bosses"); - final int[] mob = - { - VALAKAS - }; - registerMobs(mob); + + registerMobs(VALAKAS); + i_ai0 = 0; i_ai1 = 0; i_ai2 = 0; @@ -91,38 +86,33 @@ public class Valakas extends Quest i_ai4 = 0; i_quest0 = 0; lastAttackTime = Chronos.currentTimeMillis(); - _Zone = GrandBossManager.getInstance().getZone(212852, -114842, -1632); + _zone = GrandBossManager.getInstance().getZone(212852, -114842, -1632); + final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS); final Integer status = GrandBossManager.getInstance().getBossStatus(VALAKAS); if (status == DEAD) { - // load the unlock date and time for valakas from DB + // Load the unlock date and time for valakas from DB. final long temp = (info.getLong("respawn_time") - Chronos.currentTimeMillis()); - // if valakas is locked until a certain time, mark it so and start the unlock timer - // the unlock time has not yet expired. Mark valakas as currently locked. Setup a timer - // to fire at the correct time (calculate the time between now and the unlock time, - // setup a timer to fire after that many msec) + // If valakas is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired. + // Mark valakas as currently locked. Setup a timer to fire at the correct time (calculate the time between now and the unlock time, setup a timer to fire after that many msec). if (temp > 0) { startQuestTimer("valakas_unlock", temp, null, null); } else { - // the time has already expired while the server was offline. - // the status needs to be changed to DORMANT + // The time has already expired while the server was offline. + // The status needs to be changed to DORMANT. GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT); } } else if (status == FIGHTING) { - // respawn to original location - final int loc_x = 213004; - final int loc_y = -114890; - final int loc_z = -1595; - final int heading = 0; + // Respawn to original location. final int hp = info.getInt("currentHP"); final int mp = info.getInt("currentMP"); - final GrandBossInstance valakas = (GrandBossInstance) addSpawn(VALAKAS, loc_x, loc_y, loc_z, heading, false, 0); + final GrandBossInstance valakas = (GrandBossInstance) addSpawn(VALAKAS, 213004, -114890, -1595, 0, false, 0); GrandBossManager.getInstance().addBoss(valakas); ThreadPool.schedule(() -> { @@ -134,18 +124,18 @@ public class Valakas extends Quest catch (Throwable e) { } - }, 100L); + }, 100); startQuestTimer("launch_random_skill", 60000, valakas, null, true); - // Start repeating timer to check for inactivity + // Start repeating timer to check for inactivity. startQuestTimer("check_activity_and_do_actions", 60000, valakas, null, true); } else if (status == WAITING) { - // Start timer to lock entry after 30 minutes and spawn valakas + // Start timer to lock entry after 30 minutes and spawn Valakas. startQuestTimer("lock_entry_and_spawn_valakas", (Config.VALAKAS_WAIT_TIME * 60000), null, null); - } // if it was dormant, just leave it as it was: - // the valakas NPC is not spawned yet and his instance is not loaded + } + // If it was dormant, just leave it as it was. The valakas NPC is not spawned yet and his instance is not loaded. } @Override @@ -153,174 +143,193 @@ public class Valakas extends Quest { if (npc != null) { - long temp = 0; - if (event.equals("check_activity_and_do_actions")) + switch (event) { - int level = 0; - int sk4691 = 0; - for (Effect e : npc.getAllEffects()) + case "check_activity_and_do_actions": { - if (e.getSkill().getId() == 4629) + int level = 0; + int sk4691 = 0; + for (Effect e : npc.getAllEffects()) { - sk4691 = 1; - level = e.getSkill().getLevel(); - break; + if (e.getSkill().getId() == 4629) + { + sk4691 = 1; + level = e.getSkill().getLevel(); + break; + } } - } - - final Integer status = GrandBossManager.getInstance().getBossStatus(VALAKAS); - temp = (Chronos.currentTimeMillis() - lastAttackTime); - if ((status == FIGHTING) && (temp > (Config.VALAKAS_DESPAWN_TIME * 60000))) // 15 mins by default - { - npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); - - // delete the actual boss - final GrandBossInstance boss = GrandBossManager.getInstance().deleteBoss(VALAKAS); - boss.decayMe(); - GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT); - // npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp()); - _Zone.oustAllPlayers(); - cancelQuestTimer("check_activity_and_do_actions", npc, null); - i_quest2 = 0; - i_quest3 = 0; - i_quest4 = 0; - } - else if (npc.getCurrentHp() > ((npc.getMaxHp() * 1) / 4)) - { - if ((sk4691 == 0) || ((sk4691 == 1) && (level != 4))) + final Integer status = GrandBossManager.getInstance().getBossStatus(VALAKAS); + if ((status == FIGHTING) && ((Chronos.currentTimeMillis() - lastAttackTime) > (Config.VALAKAS_DESPAWN_TIME * 60000))) // 15 mins by default. + { + npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + + // delete the actual boss + final GrandBossInstance boss = GrandBossManager.getInstance().deleteBoss(VALAKAS); + boss.decayMe(); + GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT); + // npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp()); + _zone.oustAllPlayers(); + cancelQuestTimer("check_activity_and_do_actions", npc, null); + i_quest2 = 0; + i_quest3 = 0; + i_quest4 = 0; + } + else if (npc.getCurrentHp() > ((npc.getMaxHp() * 1) / 4)) + { + if ((sk4691 == 0) || ((sk4691 == 1) && (level != 4))) + { + npc.setTarget(npc); + npc.doCast(SkillTable.getInstance().getSkill(4691, 4)); + } + } + else if (npc.getCurrentHp() > ((npc.getMaxHp() * 2) / 4.0)) + { + if ((sk4691 == 0) || ((sk4691 == 1) && (level != 3))) + { + npc.setTarget(npc); + npc.doCast(SkillTable.getInstance().getSkill(4691, 3)); + } + } + else if (npc.getCurrentHp() > ((npc.getMaxHp() * 3) / 4.0)) + { + if ((sk4691 == 0) || ((sk4691 == 1) && (level != 2))) + { + npc.setTarget(npc); + npc.doCast(SkillTable.getInstance().getSkill(4691, 2)); + } + } + else if ((sk4691 == 0) || ((sk4691 == 1) && (level != 1))) { npc.setTarget(npc); - npc.doCast(SkillTable.getInstance().getSkill(4691, 4)); + npc.doCast(SkillTable.getInstance().getSkill(4691, 1)); } + break; } - else if (npc.getCurrentHp() > ((npc.getMaxHp() * 2) / 4.0)) + case "launch_random_skill": { - if ((sk4691 == 0) || ((sk4691 == 1) && (level != 3))) + if (!npc.isInvul()) { - npc.setTarget(npc); - npc.doCast(SkillTable.getInstance().getSkill(4691, 3)); + getRandomSkill(npc); } - } - else if (npc.getCurrentHp() > ((npc.getMaxHp() * 3) / 4.0)) - { - if ((sk4691 == 0) || ((sk4691 == 1) && (level != 2))) + else { - npc.setTarget(npc); - npc.doCast(SkillTable.getInstance().getSkill(4691, 2)); + npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); } + break; } - else if ((sk4691 == 0) || ((sk4691 == 1) && (level != 1))) + case "1004": { - npc.setTarget(npc); - npc.doCast(SkillTable.getInstance().getSkill(4691, 1)); + startQuestTimer("1102", 1500, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1300, 180, -5, 3000, 15000)); + break; } - } - else if (event.equals("launch_random_skill")) - { - if (!npc.isInvul()) + case "1102": { + startQuestTimer("1103", 3300, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 500, 180, -8, 600, 15000)); + break; + } + case "1103": + { + startQuestTimer("1104", 2900, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 800, 180, -8, 2700, 15000)); + break; + } + case "1104": + { + startQuestTimer("1105", 2700, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 200, 250, 70, 0, 15000)); + break; + } + case "1105": + { + startQuestTimer("1106", 1, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1100, 250, 70, 2500, 15000)); + break; + } + case "1106": + { + startQuestTimer("1107", 3200, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 700, 150, 30, 0, 15000)); + break; + } + case "1107": + { + startQuestTimer("1108", 1400, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1200, 150, 20, 2900, 15000)); + break; + } + case "1108": + { + startQuestTimer("1109", 6700, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 750, 170, 15, 3400, 15000)); + break; + } + case "1109": + { + startQuestTimer("1110", 5700, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 750, 170, -10, 3400, 15000)); + break; + } + case "1110": + { + GrandBossManager.getInstance().setBossStatus(VALAKAS, FIGHTING); + startQuestTimer("check_activity_and_do_actions", 60000, npc, null, true); + npc.setInvul(false); getRandomSkill(npc); + break; } - else + case "1111": { - npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + startQuestTimer("1112", 3500, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1100, 210, -5, 3000, 10000)); + break; } - } - else if (event.equals("1004")) - { - startQuestTimer("1102", 1500, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1300, 180, -5, 3000, 15000)); - } - else if (event.equals("1102")) - { - startQuestTimer("1103", 3300, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 500, 180, -8, 600, 15000)); - } - else if (event.equals("1103")) - { - startQuestTimer("1104", 2900, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 800, 180, -8, 2700, 15000)); - } - else if (event.equals("1104")) - { - startQuestTimer("1105", 2700, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 200, 250, 70, 0, 15000)); - } - else if (event.equals("1105")) - { - startQuestTimer("1106", 1, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1100, 250, 70, 2500, 15000)); - } - else if (event.equals("1106")) - { - startQuestTimer("1107", 3200, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 700, 150, 30, 0, 15000)); - } - else if (event.equals("1107")) - { - startQuestTimer("1108", 1400, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1200, 150, 20, 2900, 15000)); - } - else if (event.equals("1108")) - { - startQuestTimer("1109", 6700, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 750, 170, 15, 3400, 15000)); - } - else if (event.equals("1109")) - { - startQuestTimer("1110", 5700, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 750, 170, -10, 3400, 15000)); - } - else if (event.equals("1110")) - { - GrandBossManager.getInstance().setBossStatus(VALAKAS, FIGHTING); - startQuestTimer("check_activity_and_do_actions", 60000, npc, null, true); - npc.setInvul(false); - getRandomSkill(npc); - } - else if (event.equals("1111")) - { - startQuestTimer("1112", 3500, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1100, 210, -5, 3000, 10000)); - } - else if (event.equals("1112")) - { - startQuestTimer("1113", 4500, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1300, 200, -8, 3000, 10000)); - } - else if (event.equals("1113")) - { - startQuestTimer("1114", 500, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1000, 190, 0, 3000, 10000)); - } - else if (event.equals("1114")) - { - startQuestTimer("1115", 4600, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 120, 0, 2500, 10000)); - } - else if (event.equals("1115")) - { - startQuestTimer("1116", 750, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 20, 0, 3000, 10000)); - } - else if (event.equals("1116")) - { - startQuestTimer("1117", 2500, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 10, 0, 3000, 10000)); - } - else if (event.equals("1117")) - { - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 10, 0, 3000, 250)); - addSpawn(31759, 212852, -114842, -1632, 0, false, 900000); - final int radius = 1500; - for (int i = 0; i < 20; i++) + case "1112": { - final int x = (int) (radius * Math.cos(i * .331)); // .331~2pi/19 - final int y = (int) (radius * Math.sin(i * .331)); - addSpawn(31759, 212852 + x, -114842 + y, -1632, 0, false, 900000); + startQuestTimer("1113", 4500, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1300, 200, -8, 3000, 10000)); + break; + } + case "1113": + { + startQuestTimer("1114", 500, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1000, 190, 0, 3000, 10000)); + break; + } + case "1114": + { + startQuestTimer("1115", 4600, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 120, 0, 2500, 10000)); + break; + } + case "1115": + { + startQuestTimer("1116", 750, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 20, 0, 3000, 10000)); + break; + } + case "1116": + { + startQuestTimer("1117", 2500, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 10, 0, 3000, 10000)); + break; + } + case "1117": + { + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 10, 0, 3000, 250)); + addSpawn(31759, 212852, -114842, -1632, 0, false, 900000); + final int radius = 1500; + for (int i = 0; i < 20; i++) + { + final int x = (int) (radius * Math.cos(i * .331)); // .331~2pi/19 + final int y = (int) (radius * Math.sin(i * .331)); + addSpawn(31759, 212852 + x, -114842 + y, -1632, 0, false, 900000); + } + startQuestTimer("remove_players", 900000, null, null); + cancelQuestTimer("check_activity_and_do_actions", npc, null); + break; } - startQuestTimer("remove_players", 900000, null, null); - cancelQuestTimer("check_activity_and_do_actions", npc, null); } } else if (event.equals("lock_entry_and_spawn_valakas")) @@ -353,8 +362,9 @@ public class Valakas extends Quest } else if (event.equals("remove_players")) { - _Zone.oustAllPlayers(); + _zone.oustAllPlayers(); } + return super.onAdvEvent(event, npc, player); } @@ -365,10 +375,9 @@ public class Valakas extends Quest { return null; } + lastAttackTime = Chronos.currentTimeMillis(); - /* - * if (!Config.ALLOW_DIRECT_TP_TO_BOSS_ROOM && GrandBossManager.getInstance().getBossStatus(VALAKAS) != FIGHTING && !npc.getSpawn().isCustomBossInstance()) { attacker.teleToLocation(150037, -57255, -2976); } - */ + // if (!Config.ALLOW_DIRECT_TP_TO_BOSS_ROOM && GrandBossManager.getInstance().getBossStatus(VALAKAS) != FIGHTING && !npc.getSpawn().isCustomBossInstance()) { attacker.teleToLocation(150037, -57255, -2976); } if (attacker.getMountType() == 1) { int sk4258 = 0; @@ -583,10 +592,9 @@ public class Valakas extends Quest npc.broadcastPacket(new PlaySound(1, "B03_D", npc)); startQuestTimer("1111", 500, npc, null); GrandBossManager.getInstance().setBossStatus(VALAKAS, DEAD); - final long respawnTime = (Config.VALAKAS_RESP_FIRST + Rnd.get(Config.VALAKAS_RESP_SECOND)) * 3600000; startQuestTimer("valakas_unlock", respawnTime, null, null); - // also save the respawn time so that the info is maintained past reboots + // Also save the respawn time so that the info is maintained past restarts. final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS); info.set("respawn_time", (Chronos.currentTimeMillis() + respawnTime)); GrandBossManager.getInstance().setStatSet(VALAKAS, info); diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Zaken.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Zaken.java index 4f15f1a0f7..5dc6cce784 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Zaken.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Zaken.java @@ -47,6 +47,10 @@ public class Zaken extends Quest { protected static final Logger LOGGER = Logger.getLogger(Zaken.class.getName()); + // Zaken status + private static final byte ALIVE = 0; // Zaken is spawned. + private static final byte DEAD = 1; // Zaken has been killed. + // NPCs private static final int ZAKEN = 29022; private static final int DOLL_BLADER_B = 29023; private static final int VALE_MASTER_B = 29024; @@ -106,31 +110,28 @@ public class Zaken extends Quest -2944, -2944 }; - // Zaken status tracking - private static final byte ALIVE = 0; // Zaken is spawned. - private static final byte DEAD = 1; // Zaken has been killed. // Misc private static BossZone _zone; - private int _1001 = 0; // used for first cancel of QuestTimer "1001" - private int _ai0 = 0; // used for zaken coords updater - private int _ai1 = 0; // used for X coord tracking for non-random teleporting in zaken's self teleport skill - private int _ai2 = 0; // used for Y coord tracking for non-random teleporting in zaken's self teleport skill - private int _ai3 = 0; // used for Z coord tracking for non-random teleporting in zaken's self teleport skill - private int _ai4 = 0; // used for spawning minions cycles - private int _quest0 = 0; // used for teleporting progress - private int _quest1 = 0; // used for most hated players progress - private int _quest2 = 0; // used for zaken HP check for teleport - private PlayerInstance c_quest0 = null; // 1st player used for area teleport - private PlayerInstance c_quest1 = null; // 2nd player used for area teleport - private PlayerInstance c_quest2 = null; // 3rd player used for area teleport - private PlayerInstance c_quest3 = null; // 4th player used for area teleport - private PlayerInstance c_quest4 = null; // 5th player used for area teleport + private int _1001 = 0; // Used for first cancel of QuestTimer "1001". + private int _ai0 = 0; // Used for zaken coords updater. + private int _ai1 = 0; // Used for X coord tracking for non-random teleporting in zaken's self teleport skill. + private int _ai2 = 0; // Used for Y coord tracking for non-random teleporting in zaken's self teleport skill. + private int _ai3 = 0; // Used for Z coord tracking for non-random teleporting in zaken's self teleport skill. + private int _ai4 = 0; // Used for spawning minions cycles. + private int _quest0 = 0; // Used for teleporting progress. + private int _quest1 = 0; // Used for most hated players progress. + private int _quest2 = 0; // Used for zaken HP check for teleport. + private PlayerInstance c_quest0 = null; // 1st player used for area teleport. + private PlayerInstance c_quest1 = null; // 2nd player used for area teleport. + private PlayerInstance c_quest2 = null; // 3rd player used for area teleport. + private PlayerInstance c_quest3 = null; // 4th player used for area teleport. + private PlayerInstance c_quest4 = null; // 5th player used for area teleport. public Zaken() { super(-1, "ai/bosses"); - // Zaken doors handling + // Zaken doors handling. ThreadPool.scheduleAtFixedRate(() -> { try @@ -168,17 +169,17 @@ public class Zaken extends Quest final Integer status = GrandBossManager.getInstance().getBossStatus(ZAKEN); if (status == DEAD) { - // load the unlock date and time for zaken from DB + // Load the unlock date and time for zaken from DB. final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis(); - // if zaken is locked until a certain time, mark it so and start the unlock timer - // the unlock time has not yet expired. + // If Zaken is locked until a certain time, mark it so and start the unlock timer. + // The unlock time has not yet expired. if (temp > 0) { startQuestTimer("zaken_unlock", temp, null, null); } else { - // the time has already expired while the server was offline. Immediately spawn zaken. + // The time has already expired while the server was offline. Immediately spawn Zaken. final GrandBossInstance zaken = (GrandBossInstance) addSpawn(ZAKEN, 55312, 219168, -3223, 0, false, 0); GrandBossManager.getInstance().setBossStatus(ZAKEN, ALIVE); spawnBoss(zaken); @@ -186,13 +187,13 @@ public class Zaken extends Quest } else { - final int loc_x = info.getInt("loc_x"); - final int loc_y = info.getInt("loc_y"); - final int loc_z = info.getInt("loc_z"); + final int x = info.getInt("loc_x"); + final int y = info.getInt("loc_y"); + final int z = info.getInt("loc_z"); final int heading = info.getInt("heading"); final int hp = info.getInt("currentHP"); final int mp = info.getInt("currentMP"); - final GrandBossInstance zaken = (GrandBossInstance) addSpawn(ZAKEN, loc_x, loc_y, loc_z, heading, false, 0); + final GrandBossInstance zaken = (GrandBossInstance) addSpawn(ZAKEN, x, y, z, heading, false, 0); zaken.setCurrentHpMp(hp, mp); spawnBoss(zaken); } @@ -225,7 +226,7 @@ public class Zaken extends Quest } if (getTimeHour() < 5) { - if (sk4223 == 1) // use night face if zaken have day face + if (sk4223 == 1) // Use night face if Zaken have day face. { npc.setTarget(npc); npc.doCast(SkillTable.getInstance().getSkill(4224, 1)); @@ -233,7 +234,7 @@ public class Zaken extends Quest _ai2 = npc.getY(); _ai3 = npc.getZ(); } - if (sk4227 == 0) // use zaken regeneration + if (sk4227 == 0) // Use Zaken regeneration. { npc.setTarget(npc); npc.doCast(SkillTable.getInstance().getSkill(4227, 1)); @@ -405,13 +406,13 @@ public class Zaken extends Quest _quest1 = 0; } } - else if (sk4223 == 0) // use day face if not night time + else if (sk4223 == 0) // Use day face if not night time. { npc.setTarget(npc); npc.doCast(SkillTable.getInstance().getSkill(4223, 1)); _quest2 = 3; } - if (sk4227 == 1) // when switching to day time, cancel zaken night regen + if (sk4227 == 1) // When switching to day time, cancel zaken night regen. { npc.setTarget(npc); npc.doCast(SkillTable.getInstance().getSkill(4242, 1)); @@ -442,131 +443,131 @@ public class Zaken extends Quest case 1: { final int rr = Rnd.get(15); - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, X_COORDS[rr] + Rnd.get(650), Y_COORDS[rr] + Rnd.get(650), Z_COORDS[rr], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, X_COORDS[rr] + Rnd.get(650), Y_COORDS[rr] + Rnd.get(650), Z_COORDS[rr], Rnd.get(65536), false, 0); _ai4 = 2; break; } case 2: { final int rr = Rnd.get(15); - addSpawn(DOLL_BLADER_B, X_COORDS[rr] + Rnd.get(650), Y_COORDS[rr] + Rnd.get(650), Z_COORDS[rr], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(DOLL_BLADER_B, X_COORDS[rr] + Rnd.get(650), Y_COORDS[rr] + Rnd.get(650), Z_COORDS[rr], Rnd.get(65536), false, 0); _ai4 = 3; break; } case 3: { - addSpawn(VALE_MASTER_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(VALE_MASTER_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); _ai4 = 4; break; } case 4: { - addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); _ai4 = 5; break; } case 5: { - addSpawn(DOLL_BLADER_B, 52675, 219371, -3290, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 52687, 219596, -3368, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 52672, 219740, -3418, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 52857, 219992, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 52959, 219997, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 53381, 220151, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54236, 220948, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54885, 220144, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55264, 219860, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55399, 220263, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55679, 220129, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 56276, 220783, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 57173, 220234, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 56267, 218826, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56294, 219482, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56094, 219113, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56364, 218967, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 57113, 218079, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56186, 217153, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55440, 218081, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55202, 217940, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55225, 218236, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54973, 218075, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 53412, 218077, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54226, 218797, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54394, 219067, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54139, 219253, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 54262, 219480, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(DOLL_BLADER_B, 52675, 219371, -3290, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 52687, 219596, -3368, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 52672, 219740, -3418, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 52857, 219992, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 52959, 219997, -3488, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 53381, 220151, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54236, 220948, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54885, 220144, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55264, 219860, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55399, 220263, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55679, 220129, -3488, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 56276, 220783, -3488, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 57173, 220234, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 56267, 218826, -3488, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56294, 219482, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56094, 219113, -3488, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56364, 218967, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 57113, 218079, -3488, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56186, 217153, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55440, 218081, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55202, 217940, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55225, 218236, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54973, 218075, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 53412, 218077, -3488, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54226, 218797, -3488, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54394, 219067, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54139, 219253, -3488, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 54262, 219480, -3488, Rnd.get(65536), false, 0); _ai4 = 6; break; } case 6: { - addSpawn(PIRATES_ZOMBIE_B, 53412, 218077, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54413, 217132, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 54841, 217132, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 55372, 217128, -3343, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 55893, 217122, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56282, 217237, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 56963, 218080, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 56267, 218826, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56294, 219482, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56094, 219113, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56364, 218967, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 56276, 220783, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 57173, 220234, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54885, 220144, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55264, 219860, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55399, 220263, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55679, 220129, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54236, 220948, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54464, 219095, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54226, 218797, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54394, 219067, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54139, 219253, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 54262, 219480, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 53412, 218077, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55440, 218081, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55202, 217940, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55225, 218236, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54973, 218075, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(PIRATES_ZOMBIE_B, 53412, 218077, -3488, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54413, 217132, -3488, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 54841, 217132, -3488, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 55372, 217128, -3343, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 55893, 217122, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56282, 217237, -3216, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 56963, 218080, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 56267, 218826, -3216, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56294, 219482, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56094, 219113, -3216, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56364, 218967, -3216, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 56276, 220783, -3216, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 57173, 220234, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54885, 220144, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55264, 219860, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55399, 220263, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55679, 220129, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54236, 220948, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54464, 219095, -3216, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54226, 218797, -3216, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54394, 219067, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54139, 219253, -3216, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 54262, 219480, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 53412, 218077, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55440, 218081, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55202, 217940, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55225, 218236, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54973, 218075, -3216, Rnd.get(65536), false, 0); _ai4 = 7; break; } case 7: { - addSpawn(PIRATES_ZOMBIE_B, 54228, 217504, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54181, 217168, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 54714, 217123, -3168, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 55298, 217127, -3073, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 55787, 217130, -2993, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56284, 217216, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 56963, 218080, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 56267, 218826, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56294, 219482, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56094, 219113, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56364, 218967, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 56276, 220783, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 57173, 220234, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54885, 220144, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55264, 219860, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55399, 220263, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55679, 220129, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54236, 220948, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54464, 219095, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54226, 218797, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54394, 219067, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54139, 219253, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 54262, 219480, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 53412, 218077, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54280, 217200, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55440, 218081, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55202, 217940, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55225, 218236, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54973, 218075, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(PIRATES_ZOMBIE_B, 54228, 217504, -3216, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54181, 217168, -3216, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 54714, 217123, -3168, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 55298, 217127, -3073, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 55787, 217130, -2993, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56284, 217216, -2944, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 56963, 218080, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 56267, 218826, -2944, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56294, 219482, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56094, 219113, -2944, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56364, 218967, -2944, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 56276, 220783, -2944, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 57173, 220234, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54885, 220144, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55264, 219860, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55399, 220263, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55679, 220129, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54236, 220948, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54464, 219095, -2944, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54226, 218797, -2944, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54394, 219067, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54139, 219253, -2944, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 54262, 219480, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 53412, 218077, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54280, 217200, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55440, 218081, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55202, 217940, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55225, 218236, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54973, 218075, -2944, Rnd.get(65536), false, 0); _ai4 = 8; cancelQuestTimer("1003", null, null); break; @@ -586,7 +587,7 @@ public class Zaken extends Quest } case "CreateOnePrivateEx": { - addSpawn(npc.getNpcId(), npc.getX(), npc.getY(), npc.getZ(), 0, false, 0)/* .setIsRaidMinion(true) */; + addSpawn(npc.getNpcId(), npc.getX(), npc.getY(), npc.getZ(), 0, false, 0); break; } } @@ -605,7 +606,7 @@ public class Zaken extends Quest final int callerId = caller.getNpcId(); if ((getTimeHour() < 5) && (callerId != ZAKEN) && (npcId == ZAKEN)) { - final int damage = 0; // well damage required :x + final int damage = 0; if ((npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE) && (_ai0 == 0) && (damage < 10) && (Rnd.get((30 * 15)) < 1))// todo - damage missing { _ai0 = 1; @@ -833,12 +834,12 @@ public class Zaken extends Quest { npc.broadcastPacket(new PlaySound(1, "BS02_D", npc)); GrandBossManager.getInstance().setBossStatus(ZAKEN, DEAD); - // time is 36hour +/- 17hour + // Time is 36hour +/- 17hour. final long respawnTime = (Config.ZAKEN_RESP_FIRST + Rnd.get(Config.ZAKEN_RESP_SECOND)) * 3600000; startQuestTimer("zaken_unlock", respawnTime, null, null); cancelQuestTimer("1001", npc, null); cancelQuestTimer("1003", npc, null); - // also save the respawn time so that the info is maintained past reboots + // Also save the respawn time so that the info is maintained past reboots. final StatSet info = GrandBossManager.getInstance().getStatSet(ZAKEN); info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime); GrandBossManager.getInstance().setStatSet(ZAKEN, info); @@ -964,7 +965,7 @@ public class Zaken extends Quest startQuestTimer("1003", 1700, null, null); } _1001 = 1; - startQuestTimer("1001", 1000, npc, null); // buffs,random teleports + startQuestTimer("1001", 1000, npc, null); // Buffs, random teleports. } public int getTimeHour() diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/quest/Quest.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/quest/Quest.java index c015ebb6f3..aae93fcea3 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/quest/Quest.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/quest/Quest.java @@ -1733,7 +1733,7 @@ public class Quest extends ManagedScript * @param mobs * @see #registerMobs(int[], EventType...) */ - public void registerMobs(int[] mobs) + public void registerMobs(int... mobs) { for (int id : mobs) { diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Antharas.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Antharas.java index 37fd5637c9..8d52a53a8b 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Antharas.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Antharas.java @@ -57,18 +57,24 @@ public class Antharas extends Quest { protected static final Logger LOGGER = Logger.getLogger(Antharas.class.getName()); - // Config + // Antharas status. + private static final int DORMANT = 0; // Antharas is spawned and no one has entered yet. Entry is unlocked + private static final int WAITING = 1; // Antharas is spawend and someone has entered, triggering a 30 minute window for additional people to enter before he unleashes his attack. Entry is unlocked. + private static final int FIGHTING = 2; // Antharas is engaged in battle, annihilating his foes. Entry is locked + private static final int DEAD = 3; // Antharas has been killed. Entry is locked + // Monsters. + private static final int ANTHARAS_OLD = 29019; + private static final int ANTHARAS_WEAK = 29066; + private static final int ANTHARAS_NORMAL = 29067; + private static final int ANTHARAS_STRONG = 29068; + // Configs. private static final int FWA_ACTIVITYTIMEOFANTHARAS = 120; - // private static final int FWA_APPTIMEOFANTHARAS = 1800000; - // private static final int FWA_INACTIVITYTIME = 900000; - // private static final boolean FWA_OLDANTHARAS = true; // use antharas interlude with minions - protected static final boolean FWA_OLDANTHARAS = Config.ANTHARAS_OLD; // use antharas interlude with minions + protected static final boolean FWA_OLDANTHARAS = Config.ANTHARAS_OLD; // Use antharas Interlude with minions. private static final boolean FWA_MOVEATRANDOM = true; private static final boolean FWA_DOSERVEREARTHQUAKE = true; private static final int FWA_LIMITOFWEAK = 45; private static final int FWA_LIMITOFNORMAL = 63; - - private static final int FWA_MAXMOBS = 10; // this includes Antharas itself + private static final int FWA_MAXMOBS = 10; // This includes Antharas. private static final int FWA_INTERVALOFMOBSWEAK = 180000; private static final int FWA_INTERVALOFMOBSNORMAL = 150000; private static final int FWA_INTERVALOFMOBSSTRONG = 120000; @@ -83,23 +89,6 @@ public class Antharas extends Quest -7709, 0 }; - - protected Collection _teleportCubeSpawn = ConcurrentHashMap.newKeySet(); - protected Collection _teleportCube = ConcurrentHashMap.newKeySet(); - - // Spawn data of monsters. - protected Map _monsterSpawn = new ConcurrentHashMap<>(); - - // Instance of monsters. - protected Collection _monsters = ConcurrentHashMap.newKeySet(); - protected GrandBossInstance _antharas = null; - - // monstersId - private static final int ANTHARASOLDID = 29019; - private static final int ANTHARASWEAKID = 29066; - private static final int ANTHARASNORMALID = 29067; - private static final int ANTHARASSTRONGID = 29068; - // Tasks. protected ScheduledFuture _cubeSpawnTask = null; protected ScheduledFuture _monsterSpawnTask = null; @@ -110,38 +99,19 @@ public class Antharas extends Quest protected ScheduledFuture _selfDestructionTask = null; protected ScheduledFuture _moveAtRandomTask = null; protected ScheduledFuture _movieTask = null; - - // Antharas Status Tracking : - private static final int DORMANT = 0; // Antharas is spawned and no one has entered yet. Entry is unlocked - private static final int WAITING = 1; // Antharas is spawend and someone has entered, triggering a 30 minute window for additional people to enter - // before he unleashes his attack. Entry is unlocked - private static final int FIGHTING = 2; // Antharas is engaged in battle, annihilating his foes. Entry is locked - private static final int DEAD = 3; // Antharas has been killed. Entry is locked - - protected static long _LastAction = 0; - + // Misc. + protected Collection _teleportCubeSpawn = ConcurrentHashMap.newKeySet(); + protected Collection _teleportCube = ConcurrentHashMap.newKeySet(); + protected Map _monsterSpawn = new ConcurrentHashMap<>(); + protected Collection _monsters = ConcurrentHashMap.newKeySet(); + protected GrandBossInstance _antharas = null; + protected static long _lastAction = 0; protected static BossZone _zone; - // Boss: Antharas public Antharas() { super(-1, "ai/bosses"); - final int[] mob = - { - ANTHARASOLDID, - ANTHARASWEAKID, - ANTHARASNORMALID, - ANTHARASSTRONGID, - 29069, - 29070, - 29071, - 29072, - 29073, - 29074, - 29075, - 29076 - }; - registerMobs(mob); + registerMobs(ANTHARAS_OLD, ANTHARAS_WEAK, ANTHARAS_NORMAL, ANTHARAS_STRONG, 29069, 29070, 29071, 29072, 29073, 29074, 29075, 29076); init(); } @@ -155,19 +125,18 @@ public class Antharas extends Quest return null; } - // Initialize private void init() { // Setting spawn data of monsters. try { _zone = GrandBossManager.getInstance().getZone(179700, 113800, -7709); - NpcTemplate template1; + NpcTemplate template; Spawn tempSpawn; - // Old Antharas - template1 = NpcTable.getInstance().getTemplate(ANTHARASOLDID); - tempSpawn = new Spawn(template1); + // Old Antharas. + template = NpcTable.getInstance().getTemplate(ANTHARAS_OLD); + tempSpawn = new Spawn(template); tempSpawn.setX(181323); tempSpawn.setY(114850); tempSpawn.setZ(-7623); @@ -175,11 +144,11 @@ public class Antharas extends Quest tempSpawn.setAmount(1); tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2); SpawnTable.getInstance().addNewSpawn(tempSpawn, false); - _monsterSpawn.put(29019, tempSpawn); + _monsterSpawn.put(ANTHARAS_OLD, tempSpawn); - // Weak Antharas - template1 = NpcTable.getInstance().getTemplate(ANTHARASWEAKID); - tempSpawn = new Spawn(template1); + // Weak Antharas. + template = NpcTable.getInstance().getTemplate(ANTHARAS_WEAK); + tempSpawn = new Spawn(template); tempSpawn.setX(181323); tempSpawn.setY(114850); tempSpawn.setZ(-7623); @@ -187,11 +156,11 @@ public class Antharas extends Quest tempSpawn.setAmount(1); tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2); SpawnTable.getInstance().addNewSpawn(tempSpawn, false); - _monsterSpawn.put(29066, tempSpawn); + _monsterSpawn.put(ANTHARAS_WEAK, tempSpawn); - // Normal Antharas - template1 = NpcTable.getInstance().getTemplate(ANTHARASNORMALID); - tempSpawn = new Spawn(template1); + // Normal Antharas. + template = NpcTable.getInstance().getTemplate(ANTHARAS_NORMAL); + tempSpawn = new Spawn(template); tempSpawn.setX(181323); tempSpawn.setY(114850); tempSpawn.setZ(-7623); @@ -199,11 +168,11 @@ public class Antharas extends Quest tempSpawn.setAmount(1); tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2); SpawnTable.getInstance().addNewSpawn(tempSpawn, false); - _monsterSpawn.put(29067, tempSpawn); + _monsterSpawn.put(ANTHARAS_NORMAL, tempSpawn); - // Strong Antharas - template1 = NpcTable.getInstance().getTemplate(ANTHARASSTRONGID); - tempSpawn = new Spawn(template1); + // Strong Antharas. + template = NpcTable.getInstance().getTemplate(ANTHARAS_STRONG); + tempSpawn = new Spawn(template); tempSpawn.setX(181323); tempSpawn.setY(114850); tempSpawn.setZ(-7623); @@ -211,7 +180,7 @@ public class Antharas extends Quest tempSpawn.setAmount(1); tempSpawn.setRespawnDelay(FWA_ACTIVITYTIMEOFANTHARAS * 2); SpawnTable.getInstance().addNewSpawn(tempSpawn, false); - _monsterSpawn.put(29068, tempSpawn); + _monsterSpawn.put(ANTHARAS_STRONG, tempSpawn); } catch (Exception e) { @@ -239,40 +208,40 @@ public class Antharas extends Quest LOGGER.warning(e.getMessage()); } - Integer status = GrandBossManager.getInstance().getBossStatus(ANTHARASOLDID); + Integer status = GrandBossManager.getInstance().getBossStatus(ANTHARAS_OLD); if (FWA_OLDANTHARAS || (status == WAITING)) { - final StatSet info = GrandBossManager.getInstance().getStatSet(ANTHARASOLDID); + final StatSet info = GrandBossManager.getInstance().getStatSet(ANTHARAS_OLD); final Long respawnTime = info.getLong("respawn_time"); if ((status == DEAD) && (respawnTime <= Chronos.currentTimeMillis())) { - // the time has already expired while the server was offline. Immediately spawn antharas in his cave. - // also, the status needs to be changed to DORMANT - GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID, DORMANT); + // The time has already expired while the server was offline. Immediately spawn antharas in his cave. + // Also, the status needs to be changed to DORMANT. + GrandBossManager.getInstance().setBossStatus(ANTHARAS_OLD, DORMANT); status = DORMANT; } else if (status == FIGHTING) { - final int loc_x = info.getInt("loc_x"); - final int loc_y = info.getInt("loc_y"); - final int loc_z = info.getInt("loc_z"); + final int x = info.getInt("loc_x"); + final int y = info.getInt("loc_y"); + final int z = info.getInt("loc_z"); final int heading = info.getInt("heading"); final int hp = info.getInt("currentHP"); final int mp = info.getInt("currentMP"); - _antharas = (GrandBossInstance) addSpawn(ANTHARASOLDID, loc_x, loc_y, loc_z, heading, false, 0); + _antharas = (GrandBossInstance) addSpawn(ANTHARAS_OLD, x, y, z, heading, false, 0); GrandBossManager.getInstance().addBoss(_antharas); _antharas.setCurrentHpMp(hp, mp); - _LastAction = Chronos.currentTimeMillis(); - // Start repeating timer to check for inactivity + _lastAction = Chronos.currentTimeMillis(); + // Start repeating timer to check for inactivity. _activityCheckTask = ThreadPool.scheduleAtFixedRate(new CheckActivity(), 60000, 60000); } else if (status == DEAD) { - ThreadPool.schedule(new UnlockAntharas(ANTHARASOLDID), respawnTime - Chronos.currentTimeMillis()); + ThreadPool.schedule(new UnlockAntharas(ANTHARAS_OLD), respawnTime - Chronos.currentTimeMillis()); } else if (status == DORMANT) { - // Here status is 0 on Database, dont do nothing + // Here status is 0 on Database, don't do anything. } else { @@ -281,23 +250,23 @@ public class Antharas extends Quest } else { - final Integer statusWeak = GrandBossManager.getInstance().getBossStatus(ANTHARASWEAKID); - final Integer statusNormal = GrandBossManager.getInstance().getBossStatus(ANTHARASNORMALID); - final Integer statusStrong = GrandBossManager.getInstance().getBossStatus(ANTHARASSTRONGID); + final Integer statusWeak = GrandBossManager.getInstance().getBossStatus(ANTHARAS_WEAK); + final Integer statusNormal = GrandBossManager.getInstance().getBossStatus(ANTHARAS_NORMAL); + final Integer statusStrong = GrandBossManager.getInstance().getBossStatus(ANTHARAS_STRONG); int antharasId = 0; if ((statusWeak == FIGHTING) || (statusWeak == DEAD)) { - antharasId = ANTHARASWEAKID; + antharasId = ANTHARAS_WEAK; status = statusWeak; } else if ((statusNormal == FIGHTING) || (statusNormal == DEAD)) { - antharasId = ANTHARASNORMALID; + antharasId = ANTHARAS_NORMAL; status = statusNormal; } else if ((statusStrong == FIGHTING) || (statusStrong == DEAD)) { - antharasId = ANTHARASSTRONGID; + antharasId = ANTHARAS_STRONG; status = statusStrong; } if ((antharasId != 0) && (status == FIGHTING)) @@ -312,8 +281,8 @@ public class Antharas extends Quest _antharas = (GrandBossInstance) addSpawn(antharasId, loc_x, loc_y, loc_z, heading, false, 0); GrandBossManager.getInstance().addBoss(_antharas); _antharas.setCurrentHpMp(hp, mp); - _LastAction = Chronos.currentTimeMillis(); - // Start repeating timer to check for inactivity + _lastAction = Chronos.currentTimeMillis(); + // Start repeating timer to check for inactivity. _activityCheckTask = ThreadPool.scheduleAtFixedRate(new CheckActivity(), 60000, 60000); } else if ((antharasId != 0) && (status == DEAD)) @@ -322,8 +291,8 @@ public class Antharas extends Quest final Long respawnTime = info.getLong("respawn_time"); if (respawnTime <= Chronos.currentTimeMillis()) { - // the time has already expired while the server was offline. Immediately spawn antharas in his cave. - // also, the status needs to be changed to DORMANT + // The time has already expired while the server was offline. Immediately spawn antharas in his cave. + // Also, the status needs to be changed to DORMANT. GrandBossManager.getInstance().setBossStatus(antharasId, DORMANT); status = DORMANT; } @@ -335,7 +304,6 @@ public class Antharas extends Quest } } - // Do spawn teleport cube. public void spawnCube() { if (_mobsSpawnTask != null) @@ -360,7 +328,6 @@ public class Antharas extends Quest } } - // Setting Antharas spawn task. public void setAntharasSpawnTask() { if (_monsterSpawnTask == null) @@ -369,7 +336,7 @@ public class Antharas extends Quest { if (_monsterSpawnTask == null) { - GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID, WAITING); + GrandBossManager.getInstance().setBossStatus(ANTHARAS_OLD, WAITING); _monsterSpawnTask = ThreadPool.schedule(new AntharasSpawn(1), 60000 * Config.ANTHARAS_WAIT_TIME); } } @@ -380,16 +347,15 @@ public class Antharas extends Quest { int intervalOfMobs; - // Interval of minions is decided by the type of Antharas - // that invaded the lair. + // Interval of minions is decided by the type of Antharas that invaded the lair. switch (antharasId) { - case ANTHARASWEAKID: + case ANTHARAS_WEAK: { intervalOfMobs = FWA_INTERVALOFMOBSWEAK; break; } - case ANTHARASNORMALID: + case ANTHARAS_NORMAL: { intervalOfMobs = FWA_INTERVALOFMOBSNORMAL; break; @@ -402,10 +368,9 @@ public class Antharas extends Quest } // Spawn mobs. - _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(new MobsSpawn(), intervalOfMobs, intervalOfMobs); + _mobsSpawnTask = ThreadPool.scheduleAtFixedRate(new MinionsSpawn(), intervalOfMobs, intervalOfMobs); } - // Do spawn Antharas. private class AntharasSpawn implements Runnable { private int _taskId = 0; @@ -430,25 +395,24 @@ public class Antharas extends Quest { case 1: // Spawn. { - // Strength of Antharas is decided by the number of players that - // invaded the lair. + // Strength of Antharas is decided by the number of players that invaded the lair. _monsterSpawnTask.cancel(false); _monsterSpawnTask = null; if (FWA_OLDANTHARAS) { - npcId = 29019; // old + npcId = ANTHARAS_OLD; } else if ((_players == null) || (_players.size() <= FWA_LIMITOFWEAK)) { - npcId = 29066; // weak + npcId = ANTHARAS_WEAK; } else if (_players.size() > FWA_LIMITOFNORMAL) { - npcId = 29068; // strong + npcId = ANTHARAS_STRONG; } else { - npcId = 29067; // normal + npcId = ANTHARAS_NORMAL; } // Do spawn. antharasSpawn = _monsterSpawn.get(npcId); @@ -456,10 +420,10 @@ public class Antharas extends Quest GrandBossManager.getInstance().addBoss(_antharas); _monsters.add(_antharas); _antharas.setImmobilized(true); - GrandBossManager.getInstance().setBossStatus(ANTHARASOLDID, DORMANT); + GrandBossManager.getInstance().setBossStatus(ANTHARAS_OLD, DORMANT); GrandBossManager.getInstance().setBossStatus(npcId, FIGHTING); - _LastAction = Chronos.currentTimeMillis(); - // Start repeating timer to check for inactivity + _lastAction = Chronos.currentTimeMillis(); + // Start repeating timer to check for inactivity. _activityCheckTask = ThreadPool.scheduleAtFixedRate(new CheckActivity(), 60000, 60000); // Setting 1st time of minions spawn task. if (!FWA_OLDANTHARAS) @@ -574,10 +538,9 @@ public class Antharas extends Quest } } - // Do spawn Behemoth or Bomber. - private class MobsSpawn implements Runnable + private class MinionsSpawn implements Runnable { - public MobsSpawn() + public MinionsSpawn() { } @@ -608,7 +571,7 @@ public class Antharas extends Quest } template1 = NpcTable.getInstance().getTemplate(npcId); tempSpawn = new Spawn(template1); - // allocates it at random in the lair of Antharas. + // Allocates it at random in the lair of Antharas. int tried = 0; boolean notFound = true; int x = 175000; @@ -672,7 +635,6 @@ public class Antharas extends Quest return super.onAggroRangeEnter(npc, player, isPet); } - // Do self destruction. private class SelfDestructionOfBomber implements Runnable { private final NpcInstance _bomber; @@ -742,23 +704,21 @@ public class Antharas extends Quest return super.onSpellFinished(npc, player, skill); } - // At end of activity time. protected class CheckActivity implements Runnable { @Override public void run() { - final Long temp = (Chronos.currentTimeMillis() - _LastAction); + final Long temp = (Chronos.currentTimeMillis() - _lastAction); if (temp > (Config.ANTHARAS_DESPAWN_TIME * 60000)) { GrandBossManager.getInstance().setBossStatus(_antharas.getNpcId(), DORMANT); - setUnspawn(); + finishRaid(); } } } - // Clean Antharas's lair. - public void setUnspawn() + public void finishRaid() { // Eliminate players. _zone.oustAllPlayers(); @@ -822,7 +782,6 @@ public class Antharas extends Quest _teleportCube.clear(); } - // Do spawn teleport cube. private class CubeSpawn implements Runnable { private final int _type; @@ -842,12 +801,11 @@ public class Antharas extends Quest } else { - setUnspawn(); + finishRaid(); } } } - // UnLock Antharas. private static class UnlockAntharas implements Runnable { private final int _bossId; @@ -871,7 +829,6 @@ public class Antharas extends Quest } } - // Action is enabled the boss. private class SetMobilised implements Runnable { private final GrandBossInstance _boss; @@ -895,7 +852,6 @@ public class Antharas extends Quest } } - // Move at random on after Antharas appears. private static class MoveAtRandom implements Runnable { private final NpcInstance _npc; @@ -917,9 +873,9 @@ public class Antharas extends Quest @Override public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet) { - if ((npc.getNpcId() == 29019) || (npc.getNpcId() == 29066) || (npc.getNpcId() == 29067) || (npc.getNpcId() == 29068)) + if ((npc.getNpcId() == ANTHARAS_OLD) || (npc.getNpcId() == ANTHARAS_WEAK) || (npc.getNpcId() == ANTHARAS_NORMAL) || (npc.getNpcId() == ANTHARAS_STRONG)) { - _LastAction = Chronos.currentTimeMillis(); + _lastAction = Chronos.currentTimeMillis(); if (!FWA_OLDANTHARAS && (_mobsSpawnTask == null)) { startMinionSpawns(npc.getNpcId()); @@ -946,7 +902,6 @@ public class Antharas extends Quest break; } } - npc.doCast(skill); } return super.onAttack(npc, attacker, damage, isPet); @@ -955,27 +910,27 @@ public class Antharas extends Quest @Override public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet) { - if ((npc.getNpcId() == 29019) || (npc.getNpcId() == 29066) || (npc.getNpcId() == 29067) || (npc.getNpcId() == 29068)) + if ((npc.getNpcId() == ANTHARAS_OLD) || (npc.getNpcId() == ANTHARAS_WEAK) || (npc.getNpcId() == ANTHARAS_NORMAL) || (npc.getNpcId() == ANTHARAS_STRONG)) { npc.broadcastPacket(new PlaySound(1, "BS01_D", npc)); _cubeSpawnTask = ThreadPool.schedule(new CubeSpawn(0), 10000); GrandBossManager.getInstance().setBossStatus(npc.getNpcId(), DEAD); final long respawnTime = (Config.ANTHARAS_RESP_FIRST + Rnd.get(Config.ANTHARAS_RESP_SECOND)) * 3600000; ThreadPool.schedule(new UnlockAntharas(npc.getNpcId()), respawnTime); - // also save the respawn time so that the info is maintained past reboots + // Also save the respawn time so that the info is maintained past restarts. final StatSet info = GrandBossManager.getInstance().getStatSet(npc.getNpcId()); info.set("respawn_time", (Chronos.currentTimeMillis() + respawnTime)); GrandBossManager.getInstance().setStatSet(npc.getNpcId(), info); } else if (npc.getNpcId() == 29069) { - final int countHPHerb = Rnd.get(6, 18); - final int countMPHerb = Rnd.get(6, 18); - for (int i = 0; i < countHPHerb; i++) + final int hpHerbCount = Rnd.get(6, 18); + final int mpHerbCount = Rnd.get(6, 18); + for (int i = 0; i < hpHerbCount; i++) { ((MonsterInstance) npc).dropItem(killer, 8602, 1); } - for (int i = 0; i < countMPHerb; i++) + for (int i = 0; i < mpHerbCount; i++) { ((MonsterInstance) npc).dropItem(killer, 8605, 1); } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Baium.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Baium.java index 58dbb49e28..5d39638577 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Baium.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Baium.java @@ -66,19 +66,14 @@ public class Baium extends Quest { protected static final Logger LOGGER = Logger.getLogger(Baium.class.getName()); - private Creature _target; - private Skill _skill; + // Baium status. + private static final byte ASLEEP = 0; // Baium is in the stone version, waiting to be woken up. Entry is unlocked. + private static final byte AWAKE = 1; // Baium is awake and fighting. Entry is locked. + private static final byte DEAD = 2; // Baium has been killed and has not yet spawned. Entry is locked. private static final int STONE_BAIUM = 29025; private static final int ANGELIC_VORTEX = 31862; private static final int LIVE_BAIUM = 29020; private static final int ARCHANGEL = 29021; - - // Baium status tracking, - private static final byte ASLEEP = 0; // baium is in the stone version, waiting to be woken up. Entry is unlocked, - private static final byte AWAKE = 1; // baium is awake and fighting. Entry is locked. - private static final byte DEAD = 2; // baium has been killed and has not yet spawned. Entry is locked, - - // Archangel locations. // @formatter:off private static final int[][] ANGEL_LOCATION = { @@ -89,44 +84,42 @@ public class Baium extends Quest {115792, 16608, 10080, 0}, }; // @formatter:on - + // Misc. private long _lastAttackVsBaiumTime = 0; private final List _minions = new CopyOnWriteArrayList<>(); - protected BossZone _zone; + private BossZone _zone; + private Creature _target; + private Skill _skill; public Baium() { super(-1, "ai/bosses"); - final int[] mob = - { - LIVE_BAIUM - }; - registerMobs(mob); + registerMobs(LIVE_BAIUM); // Quest NPC starter initialization addStartNpc(STONE_BAIUM); addStartNpc(ANGELIC_VORTEX); addTalkId(STONE_BAIUM); addTalkId(ANGELIC_VORTEX); + _zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077); + final StatSet info = GrandBossManager.getInstance().getStatSet(LIVE_BAIUM); final Integer status = GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM); if (status == DEAD) { - // load the unlock date and time for baium from DB + // Load the unlock date and time for baium from DB. final long temp = (info.getLong("respawn_time") - Chronos.currentTimeMillis()); if (temp > 0) { - // the unlock time has not yet expired. Mark Baium as currently locked (dead). Setup a timer - // to fire at the correct time (calculate the time between now and the unlock time, - // setup a timer to fire after that many msec) + // The unlock time has not yet expired. Mark Baium as currently locked (dead). + // Setup a timer to fire at the correct time (calculate the time between now and the unlock time, setup a timer to fire after that many msec). startQuestTimer("baium_unlock", temp, null, null); } else { - // the time has already expired while the server was offline. Delete the saved time and - // immediately spawn the stone-baium. Also the state need not be changed from ASLEEP + // The time has already expired while the server was offline. Delete the saved time and immediately spawn the stone-baium. Also the state need not be changed from ASLEEP. addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); if (Config.ANNOUNCE_TO_ALL_SPAWN_RB) { @@ -137,13 +130,13 @@ public class Baium extends Quest } else if (status == AWAKE) { - final int loc_x = info.getInt("loc_x"); - final int loc_y = info.getInt("loc_y"); - final int loc_z = info.getInt("loc_z"); + final int x = info.getInt("loc_x"); + final int y = info.getInt("loc_y"); + final int z = info.getInt("loc_z"); final int heading = info.getInt("heading"); final int hp = info.getInt("currentHP"); final int mp = info.getInt("currentMP"); - final GrandBossInstance baium = (GrandBossInstance) addSpawn(LIVE_BAIUM, loc_x, loc_y, loc_z, heading, false, 0); + final GrandBossInstance baium = (GrandBossInstance) addSpawn(LIVE_BAIUM, x, y, z, heading, false, 0); if (Config.ANNOUNCE_TO_ALL_SPAWN_RB) { AnnouncementsTable.getInstance().announceToAll("Raid boss " + baium.getName() + " spawned in world."); @@ -163,7 +156,7 @@ public class Baium extends Quest { LOGGER.warning(e.getMessage()); } - }, 100L); + }, 100); } else { @@ -201,7 +194,8 @@ public class Baium extends Quest { npc.broadcastPacket(new SocialAction(npc.getObjectId(), 1)); npc.broadcastPacket(new Earthquake(npc.getX(), npc.getY(), npc.getZ(), 40, 5)); - // start monitoring baium's inactivity + + // Start monitoring baium's inactivity. _lastAttackVsBaiumTime = Chronos.currentTimeMillis(); startQuestTimer("baium_despawn", 60000, npc, null, true); if (player != null) @@ -227,9 +221,8 @@ public class Baium extends Quest { LOGGER.warning(e.getMessage()); } - }, 11100L); - // TODO: the person who woke baium up should be knocked across the room, onto a wall, and - // lose massive amounts of HP. + }, 11100); + // TODO: the person who woke baium up should be knocked across the room, onto a wall, and lose massive amounts of HP. for (int[] element : ANGEL_LOCATION) { final MonsterInstance angel = (MonsterInstance) addSpawn(ARCHANGEL, element[0], element[1], element[2], element[3], false, 0); @@ -239,21 +232,20 @@ public class Baium extends Quest angel.isAggressive(); } } - // despawn the live baium after 30 minutes of inactivity - // also check if the players are cheating, having pulled Baium outside his zone... } else if (event.equals("baium_despawn") && (npc != null)) { + // Despawn the live baium after 30 minutes of inactivity also check if the players are cheating, having pulled Baium outside his zone... if (npc.getNpcId() == LIVE_BAIUM) { - // just in case the zone reference has been lost (somehow...), restore the reference + // Just in case the zone reference has been lost (somehow...), restore the reference. if (_zone == null) { _zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077); } if ((_lastAttackVsBaiumTime + (Config.BAIUM_SLEEP * 1000)) < Chronos.currentTimeMillis()) { - npc.deleteMe(); // despawn the live-baium + npc.deleteMe(); // Despawn the live-baium. for (NpcInstance minion : _minions) { if (minion != null) @@ -263,8 +255,8 @@ public class Baium extends Quest } } _minions.clear(); - addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); // spawn stone-baium - GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); // mark that Baium is not awake any more + addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); // Spawn stone-baium. + GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); // Mark that Baium is not awake any more. _zone.oustAllPlayers(); cancelQuestTimer("baium_despawn", npc, null); } @@ -301,8 +293,7 @@ public class Baium extends Quest { if (Config.ALLOW_DIRECT_TP_TO_BOSS_ROOM || _zone.isPlayerAllowed(player)) { - // once Baium is awaken, no more people may enter until he dies, the server reboots, or - // 30 minutes pass with no attacks made against Baium. + // Once Baium is awaken, no more people may enter until he dies, the server reboots, or 30 minutes pass with no attacks made against Baium. GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, AWAKE); npc.deleteMe(); final GrandBossInstance baium = (GrandBossInstance) addSpawn(LIVE_BAIUM, npc); @@ -325,21 +316,20 @@ public class Baium extends Quest } else { - htmltext = "Conditions are not right to wake up Baium"; + htmltext = "Conditions are not right to wake up Baium."; } } else if (npcId == ANGELIC_VORTEX) { if (player.isFlying()) { - // print "Player "+player.getName()+" attempted to enter Baium's lair while flying!"; - return "Angelic Vortex:
You may not enter while flying a wyvern"; + return "Angelic Vortex:
You may not enter while flying a wyvern."; } - if ((status == ASLEEP) && (player.getQuestState(getName()).getQuestItemsCount(4295) > 0)) // bloody fabric + if ((status == ASLEEP) && (player.getQuestState(getName()).getQuestItemsCount(4295) > 0)) // Bloody fabric. { player.getQuestState(getName()).takeItems(4295, 1); - // allow entry for the player for the next 30 secs (more than enough time for the TP to happen) + // Allow entry for the player for the next 30 secs (more than enough time for the TP to happen). // Note: this just means 30secs to get in, no limits on how long it takes before we get out. _zone.allowPlayerEntry(player, 30); player.teleToLocation(113100, 14500, 10077); @@ -398,7 +388,7 @@ public class Baium extends Quest npc.doCast(SkillTable.getInstance().getSkill(4258, 1)); } } - // update a variable with the last action against baium + // Update a variable with the last action against Baium. _lastAttackVsBaiumTime = Chronos.currentTimeMillis(); callSkillAI(npc); } @@ -410,13 +400,13 @@ public class Baium extends Quest { npc.broadcastPacket(new PlaySound(1, "BS01_D", npc)); cancelQuestTimer("baium_despawn", npc, null); - // spawn the "Teleportation Cubic" for 15 minutes (to allow players to exit the lair) - addSpawn(29055, 115203, 16620, 10078, 0, false, 900000); // //should we teleport everyone out if the cubic despawns?? - // "lock" baium for 5 days and 1 to 8 hours [i.e. 432,000,000 + 1*3,600,000 + random-less-than(8*3,600,000) millisecs] + // Spawn the "Teleportation Cubic" for 15 minutes (to allow players to exit the lair). + addSpawn(29055, 115203, 16620, 10078, 0, false, 900000); // Should we teleport everyone out if the cubic despawns?? + // Lock baium for 5 days and 1 to 8 hours [i.e. 432,000,000 + 1*3,600,000 + random-less-than(8*3,600,000) millisecs] final long respawnTime = (Config.BAIUM_RESP_FIRST + Rnd.get(Config.BAIUM_RESP_SECOND)) * 3600000; GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, DEAD); startQuestTimer("baium_unlock", respawnTime, null, null); - // also save the respawn time so that the info is maintained past reboots + // Also save the respawn time so that the info is maintained past reboots. final StatSet info = GrandBossManager.getInstance().getStatSet(LIVE_BAIUM); info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime); GrandBossManager.getInstance().setStatSet(LIVE_BAIUM, info); @@ -482,7 +472,7 @@ public class Baium extends Quest } startQuestTimer("clean_player", 20000, npc, null); - return result.get(Rnd.get(result.size())); + return getRandomEntry(result); } public synchronized void callSkillAI(NpcInstance npc) diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Core.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Core.java index 7a40930c1f..d485442775 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Core.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Core.java @@ -75,12 +75,11 @@ public class Core extends Quest MINNION_SPAWNS.put(SUSCEPTOR, new Location(17706, 109423, -6488)); MINNION_SPAWNS.put(SUSCEPTOR, new Location(17849, 109388, -6480)); } - // Misc + // Status. private static final byte ALIVE = 0; private static final byte DEAD = 1; - + // Misc. private static boolean _firstAttacked; - private static final Collection _minions = ConcurrentHashMap.newKeySet(); public Core() @@ -149,7 +148,7 @@ public class Core extends Quest { GrandBossManager.getInstance().addBoss(npc); npc.broadcastPacket(new PlaySound(1, "BS01_A", npc)); - // Spawn minions + // Spawn minions. Attackable mob; Location spawnLocation; for (Entry spawn : MINNION_SPAWNS.entrySet()) diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Frintezza.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Frintezza.java index 5d7096dd95..22976f6ed7 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Frintezza.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Frintezza.java @@ -55,13 +55,24 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; * Frintezza AI * @author Darki699 * @author SANDMAN L2J_JP(modified) - * @author JOJO Update by rocknow Updated by L2jOff team Updated by L2jFrozen team
- * Warn: be careful with adding new spawns {@link #getXFix(int)} + * @author JOJO Updated by rocknow, L2jOff team, L2jFrozen team. */ public class Frintezza extends Quest { + // Frintezza status. + private static final byte DORMANT = 0; // Frintezza is spawned and no one has entered yet. Entry is unlocked. + private static final byte WAITING = 1; // Frintezza is spawend and someone has entered, triggering a 30 minute window for additional people to enter before he unleashes his attack. Entry is unlocked. + private static final byte FIGHTING = 2; // Frintezza is engaged in battle, annihilating his foes. Entry is locked. + private static final byte DEAD = 3; // Frintezza has been killed. Entry is locked. + // NPCs. + private static final int SCARLET1 = 29046; + private static final int SCARLET2 = 29047; + private static final int FRINTEZZA = 29045; + private static final int GUIDE = 32011; + private static final int CUBE = 29061; + // @formatter:off - private static final int[][] _invadeLoc = + private static final int[][] INVADE_LOC = { {174102, -76039, -5105}, {173235, -76884, -5105}, @@ -70,8 +81,7 @@ public class Frintezza extends Quest {174013, -76120, -5105}, {173263, -75161, -5105} }; - - private static final int[][] _skill = + private static final int[][] SKILLS = { {5015, 1, 5000}, {5015, 4, 5000}, @@ -85,8 +95,7 @@ public class Frintezza extends Quest {5019, 1, 10000}, {5016, 1, 5000} }; - - private static final int[][] _mobLoc = + private static final int[][] MONSTER_LOC = { {18328, 172894, -76019, -5107, 243}, {18328, 174095, -77279, -5107, 16216}, @@ -223,19 +232,7 @@ public class Frintezza extends Quest }; // @formatter:on - private static final int SCARLET1 = 29046; - private static final int SCARLET2 = 29047; - private static final int FRINTEZZA = 29045; - private static final int GUIDE = 32011; - private static final int CUBE = 29061; - - // Frintezza Status Tracking : - private static final byte DORMANT = 0; // Frintezza is spawned and no one has entered yet. Entry is unlocked - private static final byte WAITING = 1; // Frintezza is spawend and someone has entered, triggering a 30 minute window for additional people to enter - // before he unleashes his attack. Entry is unlocked - private static final byte FIGHTING = 2; // Frintezza is engaged in battle, annihilating his foes. Entry is locked - private static final byte DEAD = 3; // Frintezza has been killed. Entry is locked - + // Misc. private static long _lastAction = 0; private static int _angle = 0; private static int _locCycle = 0; @@ -254,13 +251,10 @@ public class Frintezza extends Quest private static int _killHallAlarmDevice = 0; private static int _killDarkChoirPlayer = 0; private static int _killDarkChoirCaptain = 0; - private static BossZone _zone; private GrandBossInstance _frintezza; private GrandBossInstance _weakScarlet; private GrandBossInstance _strongScarlet; - @SuppressWarnings("unused") - private GrandBossInstance _activeScarlet; private MonsterInstance _demon1; private MonsterInstance _demon2; private MonsterInstance _demon3; @@ -283,30 +277,10 @@ public class Frintezza extends Quest public Frintezza() { super(-1, "ai/bosses"); - final int[] mob = - { - SCARLET1, - SCARLET2, - FRINTEZZA, - 18328, - 18329, - 18330, - 18331, - 18332, - 18333, - 18334, - 18335, - 18336, - 18337, - 18338, - 18339, - 29048, - 29049, - 29050, - 29051 - }; - _zone = GrandBossManager.getInstance().getZone(getXFix(174232), getYFix(-88020), getZFix(-5116)); - registerMobs(mob); + + _zone = GrandBossManager.getInstance().getZone(174232, -88020, -5116); + + registerMobs(SCARLET1, SCARLET2, FRINTEZZA, 18328, 18329, 18330, 18331, 18332, 18333, 18334, 18335, 18336, 18337, 18338, 18339, 29048, 29049, 29050, 29051); addStartNpc(GUIDE); addTalkId(GUIDE); addStartNpc(CUBE); @@ -331,7 +305,7 @@ public class Frintezza extends Quest GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT); } - // tempfix for messed door cords + // Tempfix for messed door cords. for (int i = 0; i < 8; i++) { DoorData.getInstance().getDoor(25150051 + i).setRange(0, 0, 0, 0, 0, 0); @@ -341,719 +315,838 @@ public class Frintezza extends Quest @Override public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player) { - long temp = 0; - if (event.equals("waiting")) + switch (event) { - startQuestTimer("close", 27000, npc, null); - startQuestTimer("camera_1", 30000, npc, null); - _zone.broadcastPacket(new Earthquake(getXFix(174232), getYFix(-88020), getZFix(-5116), 45, 27)); - } - else if (event.equals("room1_spawn")) - { - for (int i = 0; i <= 17; i++) + case "waiting": { - final NpcInstance mob = addSpawn(_mobLoc[i][0], _mobLoc[i][1], _mobLoc[i][2], _mobLoc[i][3], _mobLoc[i][4], false, 0); - synchronized (_room1Monsters) - { - _room1Monsters.add(mob); - } + startQuestTimer("close", 27000, npc, null); + startQuestTimer("camera_1", 30000, npc, null); + _zone.broadcastPacket(new Earthquake(174232, -88020, -5116, 45, 27)); + break; } - } - else if (event.equals("room1_spawn2")) - { - for (int i = 18; i <= 26; i++) + case "room1_spawn": { - final NpcInstance mob = addSpawn(_mobLoc[i][0], _mobLoc[i][1], _mobLoc[i][2], _mobLoc[i][3], _mobLoc[i][4], false, 0); - synchronized (_room1Monsters) + for (int i = 0; i <= 17; i++) { - _room1Monsters.add(mob); - } - } - } - else if (event.equals("room1_spawn3")) - { - for (int i = 27; i <= 32; i++) - { - final NpcInstance mob = addSpawn(_mobLoc[i][0], _mobLoc[i][1], _mobLoc[i][2], _mobLoc[i][3], _mobLoc[i][4], false, 0); - synchronized (_room1Monsters) - { - _room1Monsters.add(mob); - } - } - } - else if (event.equals("room1_spawn4")) - { - for (int i = 33; i <= 40; i++) - { - final NpcInstance mob = addSpawn(_mobLoc[i][0], _mobLoc[i][1], _mobLoc[i][2], _mobLoc[i][3], _mobLoc[i][4], false, 0); - synchronized (_room1Monsters) - { - _room1Monsters.add(mob); - } - } - } - else if (event.equals("room2_spawn")) - { - for (int i = 41; i <= 44; i++) - { - final NpcInstance mob = addSpawn(_mobLoc[i][0], _mobLoc[i][1], _mobLoc[i][2], _mobLoc[i][3], _mobLoc[i][4], false, 0); - synchronized (_room2Monsters) - { - _room2Monsters.add(mob); - } - } - } - else if (event.equals("room2_spawn2")) - { - for (int i = 45; i <= 131; i++) - { - final NpcInstance mob = addSpawn(_mobLoc[i][0], _mobLoc[i][1], _mobLoc[i][2], _mobLoc[i][3], _mobLoc[i][4], false, 0); - synchronized (_room2Monsters) - { - _room2Monsters.add(mob); - } - } - } - else if (event.equals("room1_del")) - { - synchronized (_room1Monsters) - { - for (NpcInstance mob : _room1Monsters) - { - if (mob != null) + final NpcInstance mob = addSpawn(MONSTER_LOC[i][0], MONSTER_LOC[i][1], MONSTER_LOC[i][2], MONSTER_LOC[i][3], MONSTER_LOC[i][4], false, 0); + synchronized (_room1Monsters) { - mob.deleteMe(); + _room1Monsters.add(mob); } } - _room1Monsters.clear(); + break; } - } - else if (event.equals("room2_del")) - { - synchronized (_room2Monsters) + case "room1_spawn2": { - for (NpcInstance mob : _room2Monsters) + for (int i = 18; i <= 26; i++) { - if (mob != null) + final NpcInstance mob = addSpawn(MONSTER_LOC[i][0], MONSTER_LOC[i][1], MONSTER_LOC[i][2], MONSTER_LOC[i][3], MONSTER_LOC[i][4], false, 0); + synchronized (_room1Monsters) { - mob.deleteMe(); + _room1Monsters.add(mob); } } - _room2Monsters.clear(); + break; } - } - else if (event.equals("room3_del")) - { - if (_demon1 != null) + case "room1_spawn3": { - _demon1.deleteMe(); + for (int i = 27; i <= 32; i++) + { + final NpcInstance mob = addSpawn(MONSTER_LOC[i][0], MONSTER_LOC[i][1], MONSTER_LOC[i][2], MONSTER_LOC[i][3], MONSTER_LOC[i][4], false, 0); + synchronized (_room1Monsters) + { + _room1Monsters.add(mob); + } + } + break; } - if (_demon2 != null) + case "room1_spawn4": { - _demon2.deleteMe(); + for (int i = 33; i <= 40; i++) + { + final NpcInstance mob = addSpawn(MONSTER_LOC[i][0], MONSTER_LOC[i][1], MONSTER_LOC[i][2], MONSTER_LOC[i][3], MONSTER_LOC[i][4], false, 0); + synchronized (_room1Monsters) + { + _room1Monsters.add(mob); + } + } + break; } - if (_demon3 != null) + case "room2_spawn": { - _demon3.deleteMe(); + for (int i = 41; i <= 44; i++) + { + final NpcInstance mob = addSpawn(MONSTER_LOC[i][0], MONSTER_LOC[i][1], MONSTER_LOC[i][2], MONSTER_LOC[i][3], MONSTER_LOC[i][4], false, 0); + synchronized (_room2Monsters) + { + _room2Monsters.add(mob); + } + } + break; } - if (_demon4 != null) + case "room2_spawn2": { - _demon4.deleteMe(); + for (int i = 45; i <= 131; i++) + { + final NpcInstance mob = addSpawn(MONSTER_LOC[i][0], MONSTER_LOC[i][1], MONSTER_LOC[i][2], MONSTER_LOC[i][3], MONSTER_LOC[i][4], false, 0); + synchronized (_room2Monsters) + { + _room2Monsters.add(mob); + } + } + break; } - if (_portrait1 != null) + case "room1_del": { - _portrait1.deleteMe(); + synchronized (_room1Monsters) + { + for (NpcInstance mob : _room1Monsters) + { + if (mob != null) + { + mob.deleteMe(); + } + } + _room1Monsters.clear(); + } + break; } - if (_portrait2 != null) + case "room2_del": { - _portrait2.deleteMe(); + synchronized (_room2Monsters) + { + for (NpcInstance mob : _room2Monsters) + { + if (mob != null) + { + mob.deleteMe(); + } + } + _room2Monsters.clear(); + } + break; } - if (_portrait3 != null) + case "room3_del": { - _portrait3.deleteMe(); + if (_demon1 != null) + { + _demon1.deleteMe(); + } + if (_demon2 != null) + { + _demon2.deleteMe(); + } + if (_demon3 != null) + { + _demon3.deleteMe(); + } + if (_demon4 != null) + { + _demon4.deleteMe(); + } + if (_portrait1 != null) + { + _portrait1.deleteMe(); + } + if (_portrait2 != null) + { + _portrait2.deleteMe(); + } + if (_portrait3 != null) + { + _portrait3.deleteMe(); + } + if (_portrait4 != null) + { + _portrait4.deleteMe(); + } + if (_frintezza != null) + { + _frintezza.deleteMe(); + } + if (_weakScarlet != null) + { + _weakScarlet.deleteMe(); + } + if (_strongScarlet != null) + { + _strongScarlet.deleteMe(); + } + _demon1 = null; + _demon2 = null; + _demon3 = null; + _demon4 = null; + _portrait1 = null; + _portrait2 = null; + _portrait3 = null; + _portrait4 = null; + _frintezza = null; + _weakScarlet = null; + _strongScarlet = null; + break; } - if (_portrait4 != null) + case "clean": { - _portrait4.deleteMe(); + _lastAction = 0; + _locCycle = 0; + _checkDie = 0; + _onCheck = 0; + _abnormal = 0; + _onMorph = 0; + _secondMorph = 0; + _thirdMorph = 0; + _killHallAlarmDevice = 0; + _killDarkChoirPlayer = 0; + _killDarkChoirCaptain = 0; + _playersInside.clear(); + break; } - if (_frintezza != null) + case "close": { - _frintezza.deleteMe(); + for (int i = 25150051; i <= 25150058; i++) + { + DoorData.getInstance().getDoor(i).closeMe(); + } + for (int i = 25150061; i <= 25150070; i++) + { + DoorData.getInstance().getDoor(i).closeMe(); + } + DoorData.getInstance().getDoor(25150042).closeMe(); + DoorData.getInstance().getDoor(25150043).closeMe(); + DoorData.getInstance().getDoor(25150045).closeMe(); + DoorData.getInstance().getDoor(25150046).closeMe(); + break; } - if (_weakScarlet != null) + case "camera_1": + { + GrandBossManager.getInstance().setBossStatus(FRINTEZZA, FIGHTING); + _frintezzaDummy = addSpawn(29052, 174240, -89805, -5022, 16048, false, 0); + _frintezzaDummy.setInvul(true); + _frintezzaDummy.setImmobilized(true); + _overheadDummy = addSpawn(29052, 174232, -88020, -5110, 16384, false, 0); + _overheadDummy.setInvul(true); + _overheadDummy.setImmobilized(true); + _overheadDummy.setCollisionHeight(600); + _zone.broadcastPacket(new NpcInfo(_overheadDummy, null)); + _portraitDummy1 = addSpawn(29052, 172450, -87890, -5100, 16048, false, 0); + _portraitDummy1.setImmobilized(true); + _portraitDummy1.setInvul(true); + _portraitDummy3 = addSpawn(29052, 176012, -87890, -5100, 16048, false, 0); + _portraitDummy3.setImmobilized(true); + _portraitDummy3.setInvul(true); + _scarletDummy = addSpawn(29053, 174232, -88020, -5110, 16384, false, 0); + _scarletDummy.setInvul(true); + _scarletDummy.setImmobilized(true); + startQuestTimer("stop_pc", 0, npc, null); + startQuestTimer("camera_2", 1000, _overheadDummy, null); + break; + } + case "camera_2": + { + _zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 0, 75, -89, 0, 100)); + startQuestTimer("camera_2b", 0, _overheadDummy, null); + break; + } + case "camera_2b": + { + _zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 0, 75, -89, 0, 100)); + startQuestTimer("camera_3", 0, _overheadDummy, null); + break; + } + case "camera_3": + { + _zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 300, 90, -10, 6500, 7000)); + _frintezza = (GrandBossInstance) addSpawn(FRINTEZZA, 174240, -89805, -5022, 16048, false, 0); + GrandBossManager.getInstance().addBoss(_frintezza); + _frintezza.setImmobilized(true); + _frintezza.setInvul(true); + _frintezza.disableAllSkills(); + _zone.updateKnownList(_frintezza); + _demon2 = (MonsterInstance) addSpawn(29051, 175876, -88713, -5100, 28205, false, 0); + _demon2.setImmobilized(true); + _demon2.disableAllSkills(); + _zone.updateKnownList(_demon2); + _demon3 = (MonsterInstance) addSpawn(29051, 172608, -88702, -5100, 64817, false, 0); + _demon3.setImmobilized(true); + _demon3.disableAllSkills(); + _zone.updateKnownList(_demon3); + _demon1 = (MonsterInstance) addSpawn(29050, 175833, -87165, -5100, 35048, false, 0); + _demon1.setImmobilized(true); + _demon1.disableAllSkills(); + _zone.updateKnownList(_demon1); + _demon4 = (MonsterInstance) addSpawn(29050, 172634, -87165, -5100, 57730, false, 0); + _demon4.setImmobilized(true); + _demon4.disableAllSkills(); + _zone.updateKnownList(_demon4); + startQuestTimer("camera_4", 6500, _overheadDummy, null); + break; + } + case "camera_4": + { + _zone.broadcastPacket(new SpecialCamera(_frintezzaDummy.getObjectId(), 1800, 90, 8, 6500, 7000)); + startQuestTimer("camera_5", 900, _frintezzaDummy, null); + break; + } + case "camera_5": + { + _zone.broadcastPacket(new SpecialCamera(_frintezzaDummy.getObjectId(), 140, 90, 10, 2500, 4500)); + startQuestTimer("camera_5b", 4000, _frintezzaDummy, null); + break; + } + case "camera_5b": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 40, 75, -10, 0, 1000)); + startQuestTimer("camera_6", 0, _frintezza, null); + break; + } + case "camera_6": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 40, 75, -10, 0, 12000)); + startQuestTimer("camera_7", 1350, _frintezza, null); + break; + } + case "camera_7": + { + _zone.broadcastPacket(new SocialAction(_frintezza.getObjectId(), 2)); + startQuestTimer("camera_8", 7000, _frintezza, null); + break; + } + case "camera_8": + { + startQuestTimer("camera_9", 1000, _frintezza, null); + _frintezzaDummy.deleteMe(); + _frintezzaDummy = null; + break; + } + case "camera_9": + { + _zone.broadcastPacket(new SocialAction(_demon2.getObjectId(), 1)); + _zone.broadcastPacket(new SocialAction(_demon3.getObjectId(), 1)); + startQuestTimer("camera_9b", 400, _frintezza, null); + break; + } + case "camera_9b": + { + _zone.broadcastPacket(new SocialAction(_demon1.getObjectId(), 1)); + _zone.broadcastPacket(new SocialAction(_demon4.getObjectId(), 1)); + for (Creature pc : _zone.getCharactersInside()) + { + if (pc instanceof PlayerInstance) + { + if (pc.getX() < 174232) + { + pc.broadcastPacket(new SpecialCamera(_portraitDummy1.getObjectId(), 1000, 118, 0, 0, 1000)); + } + else + { + pc.broadcastPacket(new SpecialCamera(_portraitDummy3.getObjectId(), 1000, 62, 0, 0, 1000)); + } + } + } + startQuestTimer("camera_9c", 0, _frintezza, null); + break; + } + case "camera_9c": + { + for (Creature pc : _zone.getCharactersInside()) + { + if (pc instanceof PlayerInstance) + { + if (pc.getX() < 174232) + { + pc.broadcastPacket(new SpecialCamera(_portraitDummy1.getObjectId(), 1000, 118, 0, 0, 10000)); + } + else + { + pc.broadcastPacket(new SpecialCamera(_portraitDummy3.getObjectId(), 1000, 62, 0, 0, 10000)); + } + } + } + startQuestTimer("camera_10", 2000, _frintezza, null); + break; + } + case "camera_10": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 240, 90, 0, 0, 1000)); + startQuestTimer("camera_11", 0, _frintezza, null); + break; + } + case "camera_11": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 240, 90, 25, 5500, 10000)); + _zone.broadcastPacket(new SocialAction(_frintezza.getObjectId(), 3)); + _portraitDummy1.deleteMe(); + _portraitDummy3.deleteMe(); + _portraitDummy1 = null; + _portraitDummy3 = null; + startQuestTimer("camera_12", 4500, _frintezza, null); + break; + } + case "camera_12": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 100, 195, 35, 0, 10000)); + startQuestTimer("camera_13", 700, _frintezza, null); + break; + } + case "camera_13": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 100, 195, 35, 0, 10000)); + startQuestTimer("camera_14", 1300, _frintezza, null); + break; + } + case "camera_14": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 120, 180, 45, 1500, 10000)); + _zone.broadcastPacket(new MagicSkillUse(_frintezza, _frintezza, 5006, 1, 34000, 0)); + startQuestTimer("camera_16", 1500, _frintezza, null); + break; + } + case "camera_16": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 520, 135, 45, 8000, 10000)); + startQuestTimer("camera_17", 7500, _frintezza, null); + break; + } + case "camera_17": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 1500, 110, 25, 10000, 13000)); + startQuestTimer("camera_18", 9500, _frintezza, null); + break; + } + case "camera_18": + { + _zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 930, 160, -20, 0, 1000)); + startQuestTimer("camera_18b", 0, _overheadDummy, null); + break; + } + case "camera_18b": + { + _zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 600, 180, -25, 0, 10000)); + _zone.broadcastPacket(new MagicSkillUse(_scarletDummy, _overheadDummy, 5004, 1, 5800, 0)); + _weakScarlet = (GrandBossInstance) addSpawn(SCARLET1, 174232, -88020, -5110, 16384, false, 0); + _weakScarlet.setInvul(true); + _weakScarlet.setImmobilized(true); + _weakScarlet.disableAllSkills(); + _zone.updateKnownList(_weakScarlet); + // startQuestTimer("camera_19", 2400, _scarletDummy, null); startQuestTimer("camera_19b", 5000, _scarletDummy, null); + startQuestTimer("camera_19", 5500, _scarletDummy, null); + startQuestTimer("camera_19b", 5400, _weakScarlet, null); + break; + } + case "camera_19": + { + _weakScarlet.teleToLocation(174232, -88020, -5110); + break; + } + case "camera_19b": + { + _zone.broadcastPacket(new SpecialCamera(_scarletDummy.getObjectId(), 800, 180, 10, 1000, 10000)); + startQuestTimer("camera_20", 2100, _scarletDummy, null); + break; + } + case "camera_20": + { + _zone.broadcastPacket(new SpecialCamera(_weakScarlet.getObjectId(), 300, 60, 8, 0, 10000)); + startQuestTimer("camera_21", 2000, _weakScarlet, null); + break; + } + case "camera_21": + { + _zone.broadcastPacket(new SpecialCamera(_weakScarlet.getObjectId(), 500, 90, 10, 3000, 5000)); + startQuestTimer("camera_22", 3000, _weakScarlet, null); + break; + } + case "camera_22": + { + _portrait2 = (MonsterInstance) addSpawn(29049, 175876, -88713, -5000, 28205, false, 0); + _portrait2.setImmobilized(true); + _portrait2.disableAllSkills(); + _zone.updateKnownList(_portrait2); + _portrait3 = (MonsterInstance) addSpawn(29049, 172608, -88702, -5000, 64817, false, 0); + _portrait3.setImmobilized(true); + _portrait3.disableAllSkills(); + _zone.updateKnownList(_portrait3); + _portrait1 = (MonsterInstance) addSpawn(29048, 175833, -87165, -5000, 35048, false, 0); + _portrait1.setImmobilized(true); + _portrait1.disableAllSkills(); + _zone.updateKnownList(_portrait1); + _portrait4 = (MonsterInstance) addSpawn(29048, 172634, -87165, -5000, 57730, false, 0); + _portrait4.setImmobilized(true); + _portrait4.disableAllSkills(); + _zone.updateKnownList(_portrait4); + _overheadDummy.deleteMe(); + _scarletDummy.deleteMe(); + _overheadDummy = null; + _scarletDummy = null; + startQuestTimer("camera_23", 2000, _weakScarlet, null); + startQuestTimer("start_pc", 2000, _weakScarlet, null); + startQuestTimer("songs_play", 10000 + Rnd.get(10000), _frintezza, null); + startQuestTimer("skill01", 10000 + Rnd.get(10000), _weakScarlet, null); + break; + } + case "camera_23": + { + _demon1.setImmobilized(false); + _demon2.setImmobilized(false); + _demon3.setImmobilized(false); + _demon4.setImmobilized(false); + _demon1.enableAllSkills(); + _demon2.enableAllSkills(); + _demon3.enableAllSkills(); + _demon4.enableAllSkills(); + _portrait1.setImmobilized(false); + _portrait2.setImmobilized(false); + _portrait3.setImmobilized(false); + _portrait4.setImmobilized(false); + _portrait1.enableAllSkills(); + _portrait2.enableAllSkills(); + _portrait3.enableAllSkills(); + _portrait4.enableAllSkills(); + _weakScarlet.setInvul(false); + _weakScarlet.setImmobilized(false); + _weakScarlet.enableAllSkills(); + _weakScarlet.setRunning(); + startQuestTimer("spawn_minion", 20000, _portrait1, null); + startQuestTimer("spawn_minion", 20000, _portrait2, null); + startQuestTimer("spawn_minion", 20000, _portrait3, null); + startQuestTimer("spawn_minion", 20000, _portrait4, null); + break; + } + case "stop_pc": + { + for (Creature creature : _zone.getCharactersInside()) + { + creature.abortAttack(); + creature.abortCast(); + creature.disableAllSkills(); + creature.setTarget(null); + creature.stopMove(null); + creature.setImmobilized(true); + creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + } + break; + } + case "stop_npc": + { + final int heading = npc.getHeading(); + if (heading < 32768) + { + _angle = Math.abs(180 - (int) (heading / 182.044444444)); + } + else + { + _angle = Math.abs(540 - (int) (heading / 182.044444444)); + } + break; + } + case "start_pc": + { + for (Creature creature : _zone.getCharactersInside()) + { + if (creature != _frintezza) + { + creature.enableAllSkills(); + creature.setImmobilized(false); + } + } + break; + } + case "start_npc": + { + npc.setRunning(); + npc.setInvul(false); + break; + } + case "morph_end": + { + _onMorph = 0; + break; + } + case "morph_01": + { + _zone.broadcastPacket(new SpecialCamera(_weakScarlet.getObjectId(), 250, _angle, 12, 2000, 15000)); + startQuestTimer("morph_02", 3000, _weakScarlet, null); + break; + } + case "morph_02": + { + _zone.broadcastPacket(new SocialAction(_weakScarlet.getObjectId(), 1)); + _weakScarlet.setRHandId(7903); + startQuestTimer("morph_03", 4000, _weakScarlet, null); + break; + } + case "morph_03": + { + startQuestTimer("morph_04", 1500, _weakScarlet, null); + break; + } + case "morph_04": + { + _zone.broadcastPacket(new SocialAction(_weakScarlet.getObjectId(), 4)); + final Skill skill = SkillTable.getInstance().getSkill(5017, 1); + if (skill != null) + { + skill.applyEffects(_weakScarlet, _weakScarlet, false, false, false); + } + startQuestTimer("morph_end", 6000, _weakScarlet, null); + startQuestTimer("start_pc", 3000, _weakScarlet, null); + startQuestTimer("start_npc", 3000, _weakScarlet, null); + startQuestTimer("songs_play", 10000 + Rnd.get(10000), _frintezza, null); + startQuestTimer("skill02", 10000 + Rnd.get(10000), _weakScarlet, null); + break; + } + case "morph_05a": + { + _zone.broadcastPacket(new SocialAction(_frintezza.getObjectId(), 4)); + break; + } + case "morph_05": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 250, 120, 15, 0, 1000)); + startQuestTimer("morph_06", 0, _frintezza, null); + break; + } + case "morph_06": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 250, 120, 15, 0, 10000)); + _scarletX = _weakScarlet.getX(); + _scarletY = _weakScarlet.getY(); + _scarletZ = _weakScarlet.getZ(); + _scarletHeading = _weakScarlet.getHeading(); + _weakScarlet.deleteMe(); + _weakScarlet = null; + _weakScarlet = (GrandBossInstance) addSpawn(SCARLET1, _scarletX, _scarletY, _scarletZ, _scarletHeading, false, 0); + _weakScarlet.setInvul(true); + _weakScarlet.setImmobilized(true); + _weakScarlet.disableAllSkills(); + _weakScarlet.setRHandId(7903); + _zone.updateKnownList(_weakScarlet); + startQuestTimer("morph_07", 7000, _frintezza, null); + break; + } + case "morph_07": + { + _zone.broadcastPacket(new MagicSkillUse(_frintezza, _frintezza, 5006, 1, 34000, 0)); + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 500, 70, 15, 3000, 10000)); + startQuestTimer("morph_08", 3000, _frintezza, null); + break; + } + case "morph_08": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 2500, 90, 12, 6000, 10000)); + startQuestTimer("morph_09", 3000, _frintezza, null); + break; + } + case "morph_09": + { + _zone.broadcastPacket(new SpecialCamera(_weakScarlet.getObjectId(), 250, _angle, 12, 0, 1000)); + startQuestTimer("morph_10", 0, _weakScarlet, null); + break; + } + case "morph_10": + { + _zone.broadcastPacket(new SpecialCamera(_weakScarlet.getObjectId(), 250, _angle, 12, 0, 10000)); + startQuestTimer("morph_11", 500, _weakScarlet, null); + break; + } + case "morph_11": + { + _weakScarlet.doDie(_weakScarlet); + _zone.broadcastPacket(new SpecialCamera(_weakScarlet.getObjectId(), 450, _angle, 14, 8000, 8000)); + startQuestTimer("morph_12", 6250, _weakScarlet, null); + startQuestTimer("morph_13", 7200, _weakScarlet, null); + break; + } + case "morph_12": { _weakScarlet.deleteMe(); + _weakScarlet = null; + break; } - if (_strongScarlet != null) + case "morph_13": { - _strongScarlet.deleteMe(); + _strongScarlet = (GrandBossInstance) addSpawn(SCARLET2, _scarletX, _scarletY, _scarletZ, _scarletHeading, false, 0); + _strongScarlet.setInvul(true); + _strongScarlet.setImmobilized(true); + _strongScarlet.disableAllSkills(); + _zone.updateKnownList(_strongScarlet); + _zone.broadcastPacket(new SpecialCamera(_strongScarlet.getObjectId(), 450, _angle, 12, 500, 14000)); + startQuestTimer("morph_14", 3000, _strongScarlet, null); + break; } - - _demon1 = null; - _demon2 = null; - _demon3 = null; - _demon4 = null; - _portrait1 = null; - _portrait2 = null; - _portrait3 = null; - _portrait4 = null; - _frintezza = null; - _weakScarlet = null; - _strongScarlet = null; - _activeScarlet = null; - } - else if (event.equals("clean")) - { - _lastAction = 0; - _locCycle = 0; - _checkDie = 0; - _onCheck = 0; - _abnormal = 0; - _onMorph = 0; - _secondMorph = 0; - _thirdMorph = 0; - _killHallAlarmDevice = 0; - _killDarkChoirPlayer = 0; - _killDarkChoirCaptain = 0; - _playersInside.clear(); - } - else if (event.equals("close")) - { - for (int i = 25150051; i <= 25150058; i++) + case "morph_14": { - DoorData.getInstance().getDoor(i).closeMe(); + startQuestTimer("morph_15", 5100, _strongScarlet, null); + break; } - for (int i = 25150061; i <= 25150070; i++) + case "morph_15": { - DoorData.getInstance().getDoor(i).closeMe(); - } - - DoorData.getInstance().getDoor(25150042).closeMe(); - DoorData.getInstance().getDoor(25150043).closeMe(); - DoorData.getInstance().getDoor(25150045).closeMe(); - DoorData.getInstance().getDoor(25150046).closeMe(); - } - else if (event.equals("camera_1")) - { - GrandBossManager.getInstance().setBossStatus(FRINTEZZA, FIGHTING); - _frintezzaDummy = addSpawn(29052, 174240, -89805, -5022, 16048, false, 0); - _frintezzaDummy.setInvul(true); - _frintezzaDummy.setImmobilized(true); - - _overheadDummy = addSpawn(29052, 174232, -88020, -5110, 16384, false, 0); - _overheadDummy.setInvul(true); - _overheadDummy.setImmobilized(true); - _overheadDummy.setCollisionHeight(600); - _zone.broadcastPacket(new NpcInfo(_overheadDummy, null)); - _portraitDummy1 = addSpawn(29052, 172450, -87890, -5100, 16048, false, 0); - _portraitDummy1.setImmobilized(true); - _portraitDummy1.setInvul(true); - - _portraitDummy3 = addSpawn(29052, 176012, -87890, -5100, 16048, false, 0); - _portraitDummy3.setImmobilized(true); - _portraitDummy3.setInvul(true); - - _scarletDummy = addSpawn(29053, 174232, -88020, -5110, 16384, false, 0); - _scarletDummy.setInvul(true); - _scarletDummy.setImmobilized(true); - - startQuestTimer("stop_pc", 0, npc, null); - startQuestTimer("camera_2", 1000, _overheadDummy, null); - } - else if (event.equals("camera_2")) - { - _zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 0, 75, -89, 0, 100)); - startQuestTimer("camera_2b", 0, _overheadDummy, null); - } - else if (event.equals("camera_2b")) - { - _zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 0, 75, -89, 0, 100)); - startQuestTimer("camera_3", 0, _overheadDummy, null); - } - else if (event.equals("camera_3")) - { - _zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 300, 90, -10, 6500, 7000)); - _frintezza = (GrandBossInstance) addSpawn(FRINTEZZA, 174240, -89805, -5022, 16048, false, 0); - GrandBossManager.getInstance().addBoss(_frintezza); - _frintezza.setImmobilized(true); - _frintezza.setInvul(true); - _frintezza.disableAllSkills(); - _zone.updateKnownList(_frintezza); - - _demon2 = (MonsterInstance) addSpawn(29051, 175876, -88713, -5100, 28205, false, 0); - _demon2.setImmobilized(true); - _demon2.disableAllSkills(); - _zone.updateKnownList(_demon2); - - _demon3 = (MonsterInstance) addSpawn(29051, 172608, -88702, -5100, 64817, false, 0); - _demon3.setImmobilized(true); - _demon3.disableAllSkills(); - _zone.updateKnownList(_demon3); - - _demon1 = (MonsterInstance) addSpawn(29050, 175833, -87165, -5100, 35048, false, 0); - _demon1.setImmobilized(true); - _demon1.disableAllSkills(); - _zone.updateKnownList(_demon1); - - _demon4 = (MonsterInstance) addSpawn(29050, 172634, -87165, -5100, 57730, false, 0); - _demon4.setImmobilized(true); - _demon4.disableAllSkills(); - _zone.updateKnownList(_demon4); - - startQuestTimer("camera_4", 6500, _overheadDummy, null); - } - else if (event.equals("camera_4")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezzaDummy.getObjectId(), 1800, 90, 8, 6500, 7000)); - startQuestTimer("camera_5", 900, _frintezzaDummy, null); - } - else if (event.equals("camera_5")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezzaDummy.getObjectId(), 140, 90, 10, 2500, 4500)); - startQuestTimer("camera_5b", 4000, _frintezzaDummy, null); - } - else if (event.equals("camera_5b")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 40, 75, -10, 0, 1000)); - startQuestTimer("camera_6", 0, _frintezza, null); - } - else if (event.equals("camera_6")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 40, 75, -10, 0, 12000)); - startQuestTimer("camera_7", 1350, _frintezza, null); - } - else if (event.equals("camera_7")) - { - _zone.broadcastPacket(new SocialAction(_frintezza.getObjectId(), 2)); - startQuestTimer("camera_8", 7000, _frintezza, null); - } - else if (event.equals("camera_8")) - { - startQuestTimer("camera_9", 1000, _frintezza, null); - _frintezzaDummy.deleteMe(); - _frintezzaDummy = null; - } - else if (event.equals("camera_9")) - { - _zone.broadcastPacket(new SocialAction(_demon2.getObjectId(), 1)); - _zone.broadcastPacket(new SocialAction(_demon3.getObjectId(), 1)); - startQuestTimer("camera_9b", 400, _frintezza, null); - } - else if (event.equals("camera_9b")) - { - _zone.broadcastPacket(new SocialAction(_demon1.getObjectId(), 1)); - _zone.broadcastPacket(new SocialAction(_demon4.getObjectId(), 1)); - for (Creature pc : _zone.getCharactersInside()) - { - if (pc instanceof PlayerInstance) + _zone.broadcastPacket(new SocialAction(_strongScarlet.getObjectId(), 2)); + final Skill skill = SkillTable.getInstance().getSkill(5017, 1); + if (skill != null) { - if (pc.getX() < getXFix(174232)) + skill.applyEffects(_strongScarlet, _strongScarlet, false, false, false); + } + startQuestTimer("morph_end", 9000, _strongScarlet, null); + startQuestTimer("start_pc", 6000, _strongScarlet, null); + startQuestTimer("start_npc", 6000, _strongScarlet, null); + startQuestTimer("songs_play", 10000 + Rnd.get(10000), _frintezza, null); + startQuestTimer("skill03", 10000 + Rnd.get(10000), _strongScarlet, null); + break; + } + case "morph_16": + { + _zone.broadcastPacket(new SpecialCamera(_strongScarlet.getObjectId(), 300, _angle - 180, 5, 0, 7000)); + startQuestTimer("morph_17", 0, _strongScarlet, null); + break; + } + case "morph_17": + { + _zone.broadcastPacket(new SpecialCamera(_strongScarlet.getObjectId(), 200, _angle, 85, 4000, 10000)); + startQuestTimer("morph_17b", 7400, _frintezza, null); + startQuestTimer("morph_18", 7500, _frintezza, null); + break; + } + case "morph_17b": + { + _frintezza.doDie(_frintezza); + break; + } + case "morph_18": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 100, 120, 5, 0, 7000)); + startQuestTimer("morph_19", 0, _frintezza, null); + break; + } + case "morph_19": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 100, 90, 5, 5000, 15000)); + startQuestTimer("morph_20", 7000, _frintezza, null); + startQuestTimer("spawn_cubes", 7000, _frintezza, null); + break; + } + case "morph_20": + { + _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 900, 90, 25, 7000, 10000)); + startQuestTimer("start_pc", 7000, _frintezza, null); + break; + } + case "songs_play": + { + if ((_frintezza != null) && !_frintezza.isDead() && (_onMorph == 0)) + { + _onSong = Rnd.get(1, 5); + // To fix skill exception. + if (_onSong == 3) { - pc.broadcastPacket(new SpecialCamera(_portraitDummy1.getObjectId(), 1000, 118, 0, 0, 1000)); + _onSong = 2; + } + + String songName = ""; + + // Name of the songs are custom, named with client side description. + switch (_onSong) + { + case 1: + { + songName = "Frintezza's Healing Rhapsody"; + break; + } + case 2: + { + songName = "Frintezza's Rampaging Opus"; + break; + } + case 3: + { + songName = "Frintezza's Power Concerto"; + break; + } + case 4: + { + songName = "Frintezza's Plagued Concerto"; + break; + } + case 5: + { + songName = "Frintezza's Psycho Symphony"; + break; + } + default: + { + songName = "Frintezza's Song"; + break; + } + } + + // Like L2OFF the skill name is printed on screen. + _zone.broadcastPacket(new ExShowScreenMessage(songName, 6000)); + if ((_onSong == 1) && (_thirdMorph == 1) && (_strongScarlet.getCurrentHp() < (_strongScarlet.getMaxHp() * 0.6)) && (Rnd.get(100) < 80)) + { + _zone.broadcastPacket(new MagicSkillUse(_frintezza, _frintezza, 5007, 1, 32000, 0)); + startQuestTimer("songs_effect", 5000, _frintezza, null); + startQuestTimer("songs_play", 32000 + Rnd.get(10000), _frintezza, null); + } + else if ((_onSong == 2) || (_onSong == 3)) + { + _zone.broadcastPacket(new MagicSkillUse(_frintezza, _frintezza, 5007, _onSong, 32000, 0)); + startQuestTimer("songs_effect", 5000, _frintezza, null); + startQuestTimer("songs_play", 32000 + Rnd.get(10000), _frintezza, null); + } + else if ((_onSong == 4) && (_secondMorph == 1)) + { + _zone.broadcastPacket(new MagicSkillUse(_frintezza, _frintezza, 5007, 4, 31000, 0)); + startQuestTimer("songs_effect", 5000, _frintezza, null); + startQuestTimer("songs_play", 31000 + Rnd.get(10000), _frintezza, null); + } + else if ((_onSong == 5) && (_thirdMorph == 1) && (_abnormal == 0)) + { + _abnormal = 1; + _zone.broadcastPacket(new MagicSkillUse(_frintezza, _frintezza, 5007, 5, 35000, 0)); + startQuestTimer("songs_effect", 5000, _frintezza, null); + startQuestTimer("songs_play", 35000 + Rnd.get(10000), _frintezza, null); } else { - pc.broadcastPacket(new SpecialCamera(_portraitDummy3.getObjectId(), 1000, 62, 0, 0, 1000)); + startQuestTimer("songs_play", 5000 + Rnd.get(5000), _frintezza, null); } } + break; } - startQuestTimer("camera_9c", 0, _frintezza, null); - } - else if (event.equals("camera_9c")) - { - for (Creature pc : _zone.getCharactersInside()) + case "songs_effect": { - if (pc instanceof PlayerInstance) + final Skill skill = SkillTable.getInstance().getSkill(5008, _onSong); + if (skill == null) { - if (pc.getX() < getXFix(174232)) - { - pc.broadcastPacket(new SpecialCamera(_portraitDummy1.getObjectId(), 1000, 118, 0, 0, 10000)); - } - else - { - pc.broadcastPacket(new SpecialCamera(_portraitDummy3.getObjectId(), 1000, 62, 0, 0, 10000)); - } + return null; } - } - startQuestTimer("camera_10", 2000, _frintezza, null); - } - else if (event.equals("camera_10")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 240, 90, 0, 0, 1000)); - startQuestTimer("camera_11", 0, _frintezza, null); - } - else if (event.equals("camera_11")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 240, 90, 25, 5500, 10000)); - _zone.broadcastPacket(new SocialAction(_frintezza.getObjectId(), 3)); - _portraitDummy1.deleteMe(); - _portraitDummy3.deleteMe(); - _portraitDummy1 = null; - _portraitDummy3 = null; - startQuestTimer("camera_12", 4500, _frintezza, null); - } - else if (event.equals("camera_12")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 100, 195, 35, 0, 10000)); - startQuestTimer("camera_13", 700, _frintezza, null); - } - else if (event.equals("camera_13")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 100, 195, 35, 0, 10000)); - startQuestTimer("camera_14", 1300, _frintezza, null); - } - else if (event.equals("camera_14")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 120, 180, 45, 1500, 10000)); - _zone.broadcastPacket(new MagicSkillUse(_frintezza, _frintezza, 5006, 1, 34000, 0)); - startQuestTimer("camera_16", 1500, _frintezza, null); - } - else if (event.equals("camera_16")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 520, 135, 45, 8000, 10000)); - startQuestTimer("camera_17", 7500, _frintezza, null); - } - else if (event.equals("camera_17")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 1500, 110, 25, 10000, 13000)); - startQuestTimer("camera_18", 9500, _frintezza, null); - } - else if (event.equals("camera_18")) - { - _zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 930, 160, -20, 0, 1000)); - startQuestTimer("camera_18b", 0, _overheadDummy, null); - } - else if (event.equals("camera_18b")) - { - _zone.broadcastPacket(new SpecialCamera(_overheadDummy.getObjectId(), 600, 180, -25, 0, 10000)); - _zone.broadcastPacket(new MagicSkillUse(_scarletDummy, _overheadDummy, 5004, 1, 5800, 0)); - _weakScarlet = (GrandBossInstance) addSpawn(SCARLET1, 174232, -88020, -5110, 16384, false, 0); - _weakScarlet.setInvul(true); - _weakScarlet.setImmobilized(true); - _weakScarlet.disableAllSkills(); - _zone.updateKnownList(_weakScarlet); - _activeScarlet = _weakScarlet; - - /* - * startQuestTimer("camera_19", 2400, _scarletDummy, null); startQuestTimer("camera_19b", 5000, _scarletDummy, null); - */ - startQuestTimer("camera_19", 5500, _scarletDummy, null); - startQuestTimer("camera_19b", 5400, _weakScarlet, null); - } - else if (event.equals("camera_19")) - { - _weakScarlet.teleToLocation(getXFix(174232), getYFix(-88020), getZFix(-5110)); - } - else if (event.equals("camera_19b")) - { - _zone.broadcastPacket(new SpecialCamera(_scarletDummy.getObjectId(), 800, 180, 10, 1000, 10000)); - startQuestTimer("camera_20", 2100, _scarletDummy, null); - } - else if (event.equals("camera_20")) - { - _zone.broadcastPacket(new SpecialCamera(_weakScarlet.getObjectId(), 300, 60, 8, 0, 10000)); - startQuestTimer("camera_21", 2000, _weakScarlet, null); - } - else if (event.equals("camera_21")) - { - _zone.broadcastPacket(new SpecialCamera(_weakScarlet.getObjectId(), 500, 90, 10, 3000, 5000)); - startQuestTimer("camera_22", 3000, _weakScarlet, null); - } - else if (event.equals("camera_22")) - { - _portrait2 = (MonsterInstance) addSpawn(29049, 175876, -88713, -5000, 28205, false, 0); - _portrait2.setImmobilized(true); - _portrait2.disableAllSkills(); - _zone.updateKnownList(_portrait2); - - _portrait3 = (MonsterInstance) addSpawn(29049, 172608, -88702, -5000, 64817, false, 0); - _portrait3.setImmobilized(true); - _portrait3.disableAllSkills(); - _zone.updateKnownList(_portrait3); - - _portrait1 = (MonsterInstance) addSpawn(29048, 175833, -87165, -5000, 35048, false, 0); - _portrait1.setImmobilized(true); - _portrait1.disableAllSkills(); - _zone.updateKnownList(_portrait1); - - _portrait4 = (MonsterInstance) addSpawn(29048, 172634, -87165, -5000, 57730, false, 0); - _portrait4.setImmobilized(true); - _portrait4.disableAllSkills(); - _zone.updateKnownList(_portrait4); - - _overheadDummy.deleteMe(); - _scarletDummy.deleteMe(); - _overheadDummy = null; - _scarletDummy = null; - startQuestTimer("camera_23", 2000, _weakScarlet, null); - startQuestTimer("start_pc", 2000, _weakScarlet, null); - startQuestTimer("songs_play", 10000 + Rnd.get(10000), _frintezza, null); - startQuestTimer("skill01", 10000 + Rnd.get(10000), _weakScarlet, null); - } - else if (event.equals("camera_23")) - { - _demon1.setImmobilized(false); - _demon2.setImmobilized(false); - _demon3.setImmobilized(false); - _demon4.setImmobilized(false); - _demon1.enableAllSkills(); - _demon2.enableAllSkills(); - _demon3.enableAllSkills(); - _demon4.enableAllSkills(); - _portrait1.setImmobilized(false); - _portrait2.setImmobilized(false); - _portrait3.setImmobilized(false); - _portrait4.setImmobilized(false); - _portrait1.enableAllSkills(); - _portrait2.enableAllSkills(); - _portrait3.enableAllSkills(); - _portrait4.enableAllSkills(); - _weakScarlet.setInvul(false); - _weakScarlet.setImmobilized(false); - _weakScarlet.enableAllSkills(); - _weakScarlet.setRunning(); - - startQuestTimer("spawn_minion", 20000, _portrait1, null); - startQuestTimer("spawn_minion", 20000, _portrait2, null); - startQuestTimer("spawn_minion", 20000, _portrait3, null); - startQuestTimer("spawn_minion", 20000, _portrait4, null); - } - else if (event.equals("stop_pc")) - { - for (Creature creature : _zone.getCharactersInside()) - { - creature.abortAttack(); - creature.abortCast(); - creature.disableAllSkills(); - creature.setTarget(null); - creature.stopMove(null); - creature.setImmobilized(true); - creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); - } - } - else if (event.equals("stop_npc")) - { - final int heading = npc.getHeading(); - if (heading < 32768) - { - _angle = Math.abs(180 - (int) (heading / 182.044444444)); - } - else - { - _angle = Math.abs(540 - (int) (heading / 182.044444444)); - } - } - else if (event.equals("start_pc")) - { - for (Creature creature : _zone.getCharactersInside()) - { - if (creature != _frintezza) - { - creature.enableAllSkills(); - creature.setImmobilized(false); - } - } - } - else if (event.equals("start_npc")) - { - npc.setRunning(); - npc.setInvul(false); - } - else if (event.equals("morph_end")) - { - _onMorph = 0; - } - else if (event.equals("morph_01")) - { - _zone.broadcastPacket(new SpecialCamera(_weakScarlet.getObjectId(), 250, _angle, 12, 2000, 15000)); - startQuestTimer("morph_02", 3000, _weakScarlet, null); - } - else if (event.equals("morph_02")) - { - _zone.broadcastPacket(new SocialAction(_weakScarlet.getObjectId(), 1)); - _weakScarlet.setRHandId(7903); - startQuestTimer("morph_03", 4000, _weakScarlet, null); - } - else if (event.equals("morph_03")) - { - startQuestTimer("morph_04", 1500, _weakScarlet, null); - } - else if (event.equals("morph_04")) - { - _zone.broadcastPacket(new SocialAction(_weakScarlet.getObjectId(), 4)); - final Skill skill = SkillTable.getInstance().getSkill(5017, 1); - if (skill != null) - { - skill.applyEffects(_weakScarlet, _weakScarlet, false, false, false); - } - - startQuestTimer("morph_end", 6000, _weakScarlet, null); - startQuestTimer("start_pc", 3000, _weakScarlet, null); - startQuestTimer("start_npc", 3000, _weakScarlet, null); - startQuestTimer("songs_play", 10000 + Rnd.get(10000), _frintezza, null); - startQuestTimer("skill02", 10000 + Rnd.get(10000), _weakScarlet, null); - } - else if (event.equals("morph_05a")) - { - _zone.broadcastPacket(new SocialAction(_frintezza.getObjectId(), 4)); - } - else if (event.equals("morph_05")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 250, 120, 15, 0, 1000)); - startQuestTimer("morph_06", 0, _frintezza, null); - } - else if (event.equals("morph_06")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 250, 120, 15, 0, 10000)); - - _scarletX = _weakScarlet.getX(); - _scarletY = _weakScarlet.getY(); - _scarletZ = _weakScarlet.getZ(); - _scarletHeading = _weakScarlet.getHeading(); - _weakScarlet.deleteMe(); - _weakScarlet = null; - _activeScarlet = null; - _weakScarlet = (GrandBossInstance) addSpawn(SCARLET1, _scarletX, _scarletY, _scarletZ, _scarletHeading, false, 0); - _weakScarlet.setInvul(true); - _weakScarlet.setImmobilized(true); - _weakScarlet.disableAllSkills(); - _weakScarlet.setRHandId(7903); - _zone.updateKnownList(_weakScarlet); - - startQuestTimer("morph_07", 7000, _frintezza, null); - } - else if (event.equals("morph_07")) - { - _zone.broadcastPacket(new MagicSkillUse(_frintezza, _frintezza, 5006, 1, 34000, 0)); - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 500, 70, 15, 3000, 10000)); - startQuestTimer("morph_08", 3000, _frintezza, null); - } - else if (event.equals("morph_08")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 2500, 90, 12, 6000, 10000)); - startQuestTimer("morph_09", 3000, _frintezza, null); - } - else if (event.equals("morph_09")) - { - _zone.broadcastPacket(new SpecialCamera(_weakScarlet.getObjectId(), 250, _angle, 12, 0, 1000)); - startQuestTimer("morph_10", 0, _weakScarlet, null); - } - else if (event.equals("morph_10")) - { - _zone.broadcastPacket(new SpecialCamera(_weakScarlet.getObjectId(), 250, _angle, 12, 0, 10000)); - startQuestTimer("morph_11", 500, _weakScarlet, null); - } - else if (event.equals("morph_11")) - { - _weakScarlet.doDie(_weakScarlet); - _zone.broadcastPacket(new SpecialCamera(_weakScarlet.getObjectId(), 450, _angle, 14, 8000, 8000)); - startQuestTimer("morph_12", 6250, _weakScarlet, null); - startQuestTimer("morph_13", 7200, _weakScarlet, null); - } - else if (event.equals("morph_12")) - { - _weakScarlet.deleteMe(); - _weakScarlet = null; - } - else if (event.equals("morph_13")) - { - _strongScarlet = (GrandBossInstance) addSpawn(SCARLET2, reverseXFix(_scarletX), reverseYFix(_scarletY), reverseZFix(_scarletZ), _scarletHeading, false, 0); - _strongScarlet.setInvul(true); - _strongScarlet.setImmobilized(true); - _strongScarlet.disableAllSkills(); - _zone.updateKnownList(_strongScarlet); - _activeScarlet = _strongScarlet; - _zone.broadcastPacket(new SpecialCamera(_strongScarlet.getObjectId(), 450, _angle, 12, 500, 14000)); - startQuestTimer("morph_14", 3000, _strongScarlet, null); - } - else if (event.equals("morph_14")) - { - startQuestTimer("morph_15", 5100, _strongScarlet, null); - } - else if (event.equals("morph_15")) - { - _zone.broadcastPacket(new SocialAction(_strongScarlet.getObjectId(), 2)); - final Skill skill = SkillTable.getInstance().getSkill(5017, 1); - if (skill != null) - { - skill.applyEffects(_strongScarlet, _strongScarlet, false, false, false); - } - - startQuestTimer("morph_end", 9000, _strongScarlet, null); - startQuestTimer("start_pc", 6000, _strongScarlet, null); - startQuestTimer("start_npc", 6000, _strongScarlet, null); - startQuestTimer("songs_play", 10000 + Rnd.get(10000), _frintezza, null); - startQuestTimer("skill03", 10000 + Rnd.get(10000), _strongScarlet, null); - } - else if (event.equals("morph_16")) - { - _zone.broadcastPacket(new SpecialCamera(_strongScarlet.getObjectId(), 300, _angle - 180, 5, 0, 7000)); - startQuestTimer("morph_17", 0, _strongScarlet, null); - } - else if (event.equals("morph_17")) - { - _zone.broadcastPacket(new SpecialCamera(_strongScarlet.getObjectId(), 200, _angle, 85, 4000, 10000)); - startQuestTimer("morph_17b", 7400, _frintezza, null); - startQuestTimer("morph_18", 7500, _frintezza, null); - } - else if (event.equals("morph_17b")) - { - _frintezza.doDie(_frintezza); - } - else if (event.equals("morph_18")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 100, 120, 5, 0, 7000)); - startQuestTimer("morph_19", 0, _frintezza, null); - } - else if (event.equals("morph_19")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 100, 90, 5, 5000, 15000)); - startQuestTimer("morph_20", 7000, _frintezza, null); - startQuestTimer("spawn_cubes", 7000, _frintezza, null); - } - else if (event.equals("morph_20")) - { - _zone.broadcastPacket(new SpecialCamera(_frintezza.getObjectId(), 900, 90, 25, 7000, 10000)); - startQuestTimer("start_pc", 7000, _frintezza, null); - } - else if (event.equals("songs_play")) - { - if ((_frintezza != null) && !_frintezza.isDead() && (_onMorph == 0)) - { - _onSong = Rnd.get(1, 5); - if (_onSong == 3) - { // to fix skill exception - _onSong = 2; - } - String songName = ""; - // Name of the songs are custom, named with client side description. switch (_onSong) { case 1: { - songName = "Frintezza's Healing Rhapsody"; + songName = "Frintezza's Concert Hall Melody"; break; } case 2: { - songName = "Frintezza's Rampaging Opus"; + songName = "Frintezza's Rampaging Opus en masse"; break; } case 3: { - songName = "Frintezza's Power Concerto"; + songName = "Frintezza Power Encore"; break; } case 4: { - songName = "Frintezza's Plagued Concerto"; + songName = "Mournful Chorale Prelude"; break; } case 5: { - songName = "Frintezza's Psycho Symphony"; + songName = "Hypnotic Mazurka "; break; } default: @@ -1062,363 +1155,299 @@ public class Frintezza extends Quest break; } } - - // Like L2OFF the skill name is printed on screen + // Like L2OFF the skill name is printed on screen. _zone.broadcastPacket(new ExShowScreenMessage(songName, 6000)); - if ((_onSong == 1) && (_thirdMorph == 1) && (_strongScarlet.getCurrentHp() < (_strongScarlet.getMaxHp() * 0.6)) && (Rnd.get(100) < 80)) + if ((_onSong == 1) || (_onSong == 2) || (_onSong == 3)) { - _zone.broadcastPacket(new MagicSkillUse(_frintezza, _frintezza, 5007, 1, 32000, 0)); - startQuestTimer("songs_effect", 5000, _frintezza, null); - startQuestTimer("songs_play", 32000 + Rnd.get(10000), _frintezza, null); + // TODO: Frintezza songs to be fixed like retail if (frintezza != null && !frintezza.isDead() && activeScarlet != null && !activeScarlet.isDead()) skill.getEffects(frintezza, activeScarlet, false, false, false); } - else if ((_onSong == 2) || (_onSong == 3)) + else if (_onSong == 4) { - _zone.broadcastPacket(new MagicSkillUse(_frintezza, _frintezza, 5007, _onSong, 32000, 0)); - startQuestTimer("songs_effect", 5000, _frintezza, null); - startQuestTimer("songs_play", 32000 + Rnd.get(10000), _frintezza, null); + for (Creature creature : _zone.getCharactersInside()) + { + if ((creature instanceof PlayerInstance) && (Rnd.get(100) < 80)) + { + skill.applyEffects(_frintezza, creature, false, false, false); + creature.sendPacket(new SystemMessage(SystemMessageId.THE_EFFECTS_OF_S1_FLOW_THROUGH_YOU).addSkillName(5008, 4)); + } + } } - else if ((_onSong == 4) && (_secondMorph == 1)) + else if (_onSong == 5) { - _zone.broadcastPacket(new MagicSkillUse(_frintezza, _frintezza, 5007, 4, 31000, 0)); - startQuestTimer("songs_effect", 5000, _frintezza, null); - startQuestTimer("songs_play", 31000 + Rnd.get(10000), _frintezza, null); - } - else if ((_onSong == 5) && (_thirdMorph == 1) && (_abnormal == 0)) - { - _abnormal = 1; - _zone.broadcastPacket(new MagicSkillUse(_frintezza, _frintezza, 5007, 5, 35000, 0)); - startQuestTimer("songs_effect", 5000, _frintezza, null); - startQuestTimer("songs_play", 35000 + Rnd.get(10000), _frintezza, null); - } - else - { - startQuestTimer("songs_play", 5000 + Rnd.get(5000), _frintezza, null); + for (Creature creature : _zone.getCharactersInside()) + { + if ((creature instanceof PlayerInstance) && (Rnd.get(100) < 70)) + { + creature.abortAttack(); + creature.abortCast(); + creature.disableAllSkills(); + creature.stopMove(null); + creature.setImmobilized(true); + creature.setParalyzed(true); + creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + skill.applyEffects(_frintezza, creature, false, false, false); + creature.startAbnormalEffect(Creature.ABNORMAL_EFFECT_DANCE_STUNNED); + creature.sendPacket(new SystemMessage(SystemMessageId.THE_EFFECTS_OF_S1_FLOW_THROUGH_YOU).addSkillName(5008, 5)); + } + } + startQuestTimer("stop_effect", 25000, _frintezza, null); } + break; } - } - else if (event.equals("songs_effect")) - { - final Skill skill = SkillTable.getInstance().getSkill(5008, _onSong); - if (skill == null) - { - return null; - } - - String songName = ""; - - // Name of the songs are custom, named with client side description. - switch (_onSong) - { - case 1: - { - songName = "Frintezza's Concert Hall Melody"; - break; - } - case 2: - { - songName = "Frintezza's Rampaging Opus en masse"; - break; - } - case 3: - { - songName = "Frintezza Power Encore"; - break; - } - case 4: - { - songName = "Mournful Chorale Prelude"; - break; - } - case 5: - { - songName = "Hypnotic Mazurka "; - break; - } - default: - { - songName = "Frintezza's Song"; - break; - } - } - - // Like L2OFF the skill name is printed on screen - _zone.broadcastPacket(new ExShowScreenMessage(songName, 6000)); - if ((_onSong == 1) || (_onSong == 2) || (_onSong == 3)) - { - /* - * TODO: Frintezza songs to be fixed like retail if (frintezza != null && !frintezza.isDead() && activeScarlet != null && !activeScarlet.isDead()) skill.getEffects(frintezza, activeScarlet, false, false, false); - */ - } - else if (_onSong == 4) + case "stop_effect": { for (Creature creature : _zone.getCharactersInside()) { - if ((creature instanceof PlayerInstance) && (Rnd.get(100) < 80)) + if (creature instanceof PlayerInstance) { - skill.applyEffects(_frintezza, creature, false, false, false); - creature.sendPacket(new SystemMessage(SystemMessageId.THE_EFFECTS_OF_S1_FLOW_THROUGH_YOU).addSkillName(5008, 4)); + creature.stopAbnormalEffect(Creature.ABNORMAL_EFFECT_DANCE_STUNNED); + creature.stopAbnormalEffect(Creature.ABNORMAL_EFFECT_FLOATING_ROOT); + creature.enableAllSkills(); + creature.setImmobilized(false); + creature.setParalyzed(false); } } + _abnormal = 0; + break; } - else if (_onSong == 5) + case "attack_stop": { - for (Creature creature : _zone.getCharactersInside()) + cancelQuestTimer("skill01", npc, null); + cancelQuestTimer("skill02", npc, null); + cancelQuestTimer("skill03", npc, null); + cancelQuestTimer("songs_play", npc, null); + cancelQuestTimer("songs_effect", npc, null); + if (_frintezza != null) { - if ((creature instanceof PlayerInstance) && (Rnd.get(100) < 70)) - { - creature.abortAttack(); - creature.abortCast(); - creature.disableAllSkills(); - creature.stopMove(null); - creature.setImmobilized(true); - creature.setParalyzed(true); - creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); - skill.applyEffects(_frintezza, creature, false, false, false); - creature.startAbnormalEffect(Creature.ABNORMAL_EFFECT_DANCE_STUNNED); - creature.sendPacket(new SystemMessage(SystemMessageId.THE_EFFECTS_OF_S1_FLOW_THROUGH_YOU).addSkillName(5008, 5)); - } + _zone.broadcastPacket(new MagicSkillCanceld(_frintezza.getObjectId())); } - startQuestTimer("stop_effect", 25000, _frintezza, null); + break; } - } - else if (event.equals("stop_effect")) - { - for (Creature creature : _zone.getCharactersInside()) + case "check_hp": { - if (creature instanceof PlayerInstance) + if (npc.isDead()) { - creature.stopAbnormalEffect(Creature.ABNORMAL_EFFECT_DANCE_STUNNED); - creature.stopAbnormalEffect(Creature.ABNORMAL_EFFECT_FLOATING_ROOT); - creature.enableAllSkills(); - creature.setImmobilized(false); - creature.setParalyzed(false); - } - } - _abnormal = 0; - } - else if (event.equals("attack_stop")) - { - cancelQuestTimer("skill01", npc, null); - cancelQuestTimer("skill02", npc, null); - cancelQuestTimer("skill03", npc, null); - cancelQuestTimer("songs_play", npc, null); - cancelQuestTimer("songs_effect", npc, null); - if (_frintezza != null) - { - _zone.broadcastPacket(new MagicSkillCanceld(_frintezza.getObjectId())); - } - } - else if (event.equals("check_hp")) - { - if (npc.isDead()) - { - _onMorph = 1; - _zone.broadcastPacket(new PlaySound(1, "BS01_D", npc)); - startQuestTimer("attack_stop", 0, _frintezza, null); - startQuestTimer("stop_pc", 0, npc, null); - startQuestTimer("stop_npc", 0, npc, null); - startQuestTimer("morph_16", 0, npc, null); - } - else - { - _checkDie = _checkDie + 10; - if (_checkDie < 3000) - { - startQuestTimer("check_hp", 10, npc, null); + _onMorph = 1; + _zone.broadcastPacket(new PlaySound(1, "BS01_D", npc)); + startQuestTimer("attack_stop", 0, _frintezza, null); + startQuestTimer("stop_pc", 0, npc, null); + startQuestTimer("stop_npc", 0, npc, null); + startQuestTimer("morph_16", 0, npc, null); } else { - _onCheck = 0; - _checkDie = 0; - } - } - } - else if (event.equals("skill01")) - { - if ((_weakScarlet != null) && !_weakScarlet.isDead() && (_secondMorph == 0) && (_thirdMorph == 0) && (_onMorph == 0)) - { - final int i = Rnd.get(0, 1); - final Skill skill = SkillTable.getInstance().getSkill(_skill[i][0], _skill[i][1]); - if (skill != null) - { - _weakScarlet.stopMove(null); - // weakScarlet.setCastingNow(true); - _weakScarlet.doCast(skill); - } - startQuestTimer("skill01", _skill[i][2] + 5000 + Rnd.get(10000), npc, null); - } - } - else if (event.equals("skill02")) - { - if ((_weakScarlet != null) && !_weakScarlet.isDead() && (_secondMorph == 1) && (_thirdMorph == 0) && (_onMorph == 0)) - { - int i = 0; - if (_abnormal == 0) - { - i = Rnd.get(2, 5); - } - else - { - i = Rnd.get(2, 4); - } - - final Skill skill = SkillTable.getInstance().getSkill(_skill[i][0], _skill[i][1]); - if (skill != null) - { - _weakScarlet.stopMove(null); - // weakScarlet.setCastingNow(true); - _weakScarlet.doCast(skill); - } - startQuestTimer("skill02", _skill[i][2] + 5000 + Rnd.get(10000), npc, null); - if (i == 5) - { - _abnormal = 1; - startQuestTimer("float_effect", 4000, _weakScarlet, null); - } - } - } - else if (event.equals("skill03")) - { - if ((_strongScarlet != null) && !_strongScarlet.isDead() && (_secondMorph == 1) && (_thirdMorph == 1) && (_onMorph == 0)) - { - int i = 0; - if (_abnormal == 0) - { - i = Rnd.get(6, 10); - } - else - { - i = Rnd.get(6, 9); - } - - final Skill skill = SkillTable.getInstance().getSkill(_skill[i][0], _skill[i][1]); - if (skill != null) - { - _strongScarlet.stopMove(null); - // strongScarlet.setCastingNow(true); - _strongScarlet.doCast(skill); - } - startQuestTimer("skill03", _skill[i][2] + 5000 + Rnd.get(10000), npc, null); - if (i == 10) - { - _abnormal = 1; - startQuestTimer("float_effect", 3000, npc, null); - } - } - } - else if (event.equals("float_effect")) - { - if (npc.isCastingNow()) - { - startQuestTimer("float_effect", 500, npc, null); - } - else - { - for (Creature creature : _zone.getCharactersInside()) - { - if ((creature instanceof PlayerInstance) && (creature.getFirstEffect(5016) != null)) + _checkDie = _checkDie + 10; + if (_checkDie < 3000) { - creature.abortAttack(); - creature.abortCast(); - creature.disableAllSkills(); - creature.stopMove(null); - creature.setImmobilized(true); - creature.setParalyzed(true); - creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); - creature.startAbnormalEffect(Creature.ABNORMAL_EFFECT_FLOATING_ROOT); + startQuestTimer("check_hp", 10, npc, null); + } + else + { + _onCheck = 0; + _checkDie = 0; } } - startQuestTimer("stop_effect", 25000, npc, null); + break; } - } - else if (event.equals("action")) - { - _zone.broadcastPacket(new SocialAction(npc.getObjectId(), 1)); - } - else if (event.equals("bomber")) - { - _bomber = 0; - } - else if (event.equals("room_final")) - { - _zone.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.SHOUT, npc.getName(), "Exceeded his time limit, challenge failed!")); - _zone.oustAllPlayers(); - cancelQuestTimers("waiting"); - cancelQuestTimers("frintezza_despawn"); - startQuestTimer("clean", 1000, npc, null); - startQuestTimer("close", 1000, npc, null); - startQuestTimer("room1_del", 1000, npc, null); - startQuestTimer("room2_del", 1000, npc, null); - GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT); - } - else if (event.equals("frintezza_despawn")) - { - temp = (Chronos.currentTimeMillis() - _lastAction); - if (temp > 900000) + case "skill01": { + if ((_weakScarlet != null) && !_weakScarlet.isDead() && (_secondMorph == 0) && (_thirdMorph == 0) && (_onMorph == 0)) + { + final int i = Rnd.get(0, 1); + final Skill skill = SkillTable.getInstance().getSkill(SKILLS[i][0], SKILLS[i][1]); + if (skill != null) + { + _weakScarlet.stopMove(null); + // weakScarlet.setCastingNow(true); + _weakScarlet.doCast(skill); + } + startQuestTimer("skill01", SKILLS[i][2] + 5000 + Rnd.get(10000), npc, null); + } + break; + } + case "skill02": + { + if ((_weakScarlet != null) && !_weakScarlet.isDead() && (_secondMorph == 1) && (_thirdMorph == 0) && (_onMorph == 0)) + { + int i = 0; + if (_abnormal == 0) + { + i = Rnd.get(2, 5); + } + else + { + i = Rnd.get(2, 4); + } + + final Skill skill = SkillTable.getInstance().getSkill(SKILLS[i][0], SKILLS[i][1]); + if (skill != null) + { + _weakScarlet.stopMove(null); + // weakScarlet.setCastingNow(true); + _weakScarlet.doCast(skill); + } + startQuestTimer("skill02", SKILLS[i][2] + 5000 + Rnd.get(10000), npc, null); + if (i == 5) + { + _abnormal = 1; + startQuestTimer("float_effect", 4000, _weakScarlet, null); + } + } + break; + } + case "skill03": + { + if ((_strongScarlet != null) && !_strongScarlet.isDead() && (_secondMorph == 1) && (_thirdMorph == 1) && (_onMorph == 0)) + { + int i = 0; + if (_abnormal == 0) + { + i = Rnd.get(6, 10); + } + else + { + i = Rnd.get(6, 9); + } + + final Skill skill = SkillTable.getInstance().getSkill(SKILLS[i][0], SKILLS[i][1]); + if (skill != null) + { + _strongScarlet.stopMove(null); + // strongScarlet.setCastingNow(true); + _strongScarlet.doCast(skill); + } + startQuestTimer("skill03", SKILLS[i][2] + 5000 + Rnd.get(10000), npc, null); + if (i == 10) + { + _abnormal = 1; + startQuestTimer("float_effect", 3000, npc, null); + } + } + break; + } + case "float_effect": + { + if (npc.isCastingNow()) + { + startQuestTimer("float_effect", 500, npc, null); + } + else + { + for (Creature creature : _zone.getCharactersInside()) + { + if ((creature instanceof PlayerInstance) && (creature.getFirstEffect(5016) != null)) + { + creature.abortAttack(); + creature.abortCast(); + creature.disableAllSkills(); + creature.stopMove(null); + creature.setImmobilized(true); + creature.setParalyzed(true); + creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + creature.startAbnormalEffect(Creature.ABNORMAL_EFFECT_FLOATING_ROOT); + } + } + startQuestTimer("stop_effect", 25000, npc, null); + } + break; + } + case "action": + { + _zone.broadcastPacket(new SocialAction(npc.getObjectId(), 1)); + break; + } + case "bomber": + { + _bomber = 0; + break; + } + case "room_final": + { + _zone.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.SHOUT, npc.getName(), "Exceeded his time limit, challenge failed!")); _zone.oustAllPlayers(); cancelQuestTimers("waiting"); - cancelQuestTimers("room_final"); - cancelQuestTimers("spawn_minion"); + cancelQuestTimers("frintezza_despawn"); startQuestTimer("clean", 1000, npc, null); startQuestTimer("close", 1000, npc, null); - startQuestTimer("attack_stop", 1000, npc, null); startQuestTimer("room1_del", 1000, npc, null); startQuestTimer("room2_del", 1000, npc, null); - startQuestTimer("room3_del", 1000, npc, null); - startQuestTimer("minions_despawn", 1000, npc, null); GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT); - cancelQuestTimers("frintezza_despawn"); + break; } - else + case "frintezza_despawn": { - final int status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA); - if ((status != DORMANT) && (status != DEAD)) + if ((Chronos.currentTimeMillis() - _lastAction) > 900000) { - startQuestTimer("frintezza_despawn", 60000, npc, null); + _zone.oustAllPlayers(); + cancelQuestTimers("waiting"); + cancelQuestTimers("room_final"); + cancelQuestTimers("spawn_minion"); + startQuestTimer("clean", 1000, npc, null); + startQuestTimer("close", 1000, npc, null); + startQuestTimer("attack_stop", 1000, npc, null); + startQuestTimer("room1_del", 1000, npc, null); + startQuestTimer("room2_del", 1000, npc, null); + startQuestTimer("room3_del", 1000, npc, null); + startQuestTimer("minions_despawn", 1000, npc, null); + GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT); + cancelQuestTimers("frintezza_despawn"); } - } - } - else if (event.equals("minions_despawn")) - { - synchronized (_minions) - { - for (Attackable mob : _minions) + else { - if (mob != null) + final int status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA); + if ((status != DORMANT) && (status != DEAD)) { - mob.decayMe(); + startQuestTimer("frintezza_despawn", 60000, npc, null); } } - _minions.clear(); + break; } - } - else if (event.equals("spawn_minion")) - { - if ((npc != null) && !npc.isDead() && (_frintezza != null) && !_frintezza.isDead()) + case "minions_despawn": { - final NpcInstance mob = addSpawn(npc.getNpcId() + 2, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0); - // mob.setIsRaidMinion(true); synchronized (_minions) { - _minions.add((Attackable) mob); + for (Attackable mob : _minions) + { + if (mob != null) + { + mob.decayMe(); + } + } + _minions.clear(); } - - startQuestTimer("action", 200, mob, null); - startQuestTimer("spawn_minion", 18000, npc, null); + break; + } + case "spawn_minion": + { + if ((npc != null) && !npc.isDead() && (_frintezza != null) && !_frintezza.isDead()) + { + final NpcInstance mob = addSpawn(npc.getNpcId() + 2, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0); + // mob.setIsRaidMinion(true); + synchronized (_minions) + { + _minions.add((Attackable) mob); + } + + startQuestTimer("action", 200, mob, null); + startQuestTimer("spawn_minion", 18000, npc, null); + } + break; + } + case "spawn_cubes": + { + addSpawn(CUBE, 174232, -88020, -5114, 16384, false, 900000); + break; + } + case "frintezza_unlock": + { + GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT); + break; + } + case "remove_players": + { + _zone.oustAllPlayers(); + break; } - } - else if (event.equals("spawn_cubes")) - { - addSpawn(CUBE, 174232, -88020, -5114, 16384, false, 900000); - } - else if (event.equals("frintezza_unlock")) - { - GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DORMANT); - } - else if (event.equals("remove_players")) - { - _zone.oustAllPlayers(); } return super.onAdvEvent(event, npc, player); @@ -1437,83 +1466,121 @@ public class Frintezza extends Quest String htmltext = ""; - final Integer status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA); - if (status == DEAD) + final int status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA); + switch (status) { - htmltext = "There is nothing beyond the Magic Force Field. Come back later.
(You may not enter because Frintezza is not inside the Imperial Tomb.)"; - } - else if (status == DORMANT) - { - boolean partyCheckSuccess = true; - if (!Config.BYPASS_FRINTEZZA_PARTIES_CHECK) + case DEAD: { - if ((!player.isInParty() || !player.getParty().isLeader(player)) || (player.getParty().getCommandChannel() == null) || (player.getParty().getCommandChannel().getChannelLeader() != player)) - { - htmltext = "No reaction. Contact must be initiated by the Command Channel Leader."; - partyCheckSuccess = false; - } - else if ((player.getParty().getCommandChannel().getParties().size() < Config.FRINTEZZA_MIN_PARTIES) || (player.getParty().getCommandChannel().getParties().size() > Config.FRINTEZZA_MAX_PARTIES)) - { - htmltext = "Your command channel needs to have at least " + Config.FRINTEZZA_MIN_PARTIES + " parties and a maximum of " + Config.FRINTEZZA_MAX_PARTIES + "."; - partyCheckSuccess = false; - } + htmltext = "There is nothing beyond the Magic Force Field. Come back later.
(You may not enter because Frintezza is not inside the Imperial Tomb.)"; + break; } - - if (partyCheckSuccess) + case DORMANT: { - if (player.getInventory().getItemByItemId(8073) == null) + boolean partyCheckSuccess = true; + if (!Config.BYPASS_FRINTEZZA_PARTIES_CHECK) { - htmltext = "You dont have required item."; - } - else - { - player.destroyItemByItemId("Quest", 8073, 1, player, true); - GrandBossManager.getInstance().setBossStatus(FRINTEZZA, WAITING); - startQuestTimer("close", 0, npc, null); - startQuestTimer("room1_spawn", 5000, npc, null); - startQuestTimer("room_final", 2100000, npc, null); - startQuestTimer("frintezza_despawn", 60000, npc, null); - _lastAction = Chronos.currentTimeMillis(); - if (Config.BYPASS_FRINTEZZA_PARTIES_CHECK) + if ((!player.isInParty() || !player.getParty().isLeader(player)) || (player.getParty().getCommandChannel() == null) || (player.getParty().getCommandChannel().getChannelLeader() != player)) { - if (player.getParty() != null) + htmltext = "No reaction. Contact must be initiated by the Command Channel Leader."; + partyCheckSuccess = false; + } + else if ((player.getParty().getCommandChannel().getParties().size() < Config.FRINTEZZA_MIN_PARTIES) || (player.getParty().getCommandChannel().getParties().size() > Config.FRINTEZZA_MAX_PARTIES)) + { + htmltext = "Your command channel needs to have at least " + Config.FRINTEZZA_MIN_PARTIES + " parties and a maximum of " + Config.FRINTEZZA_MAX_PARTIES + "."; + partyCheckSuccess = false; + } + } + if (partyCheckSuccess) + { + if (player.getInventory().getItemByItemId(8073) == null) + { + htmltext = "You dont have required item."; + } + else + { + player.destroyItemByItemId("Quest", 8073, 1, player, true); + GrandBossManager.getInstance().setBossStatus(FRINTEZZA, WAITING); + startQuestTimer("close", 0, npc, null); + startQuestTimer("room1_spawn", 5000, npc, null); + startQuestTimer("room_final", 2100000, npc, null); + startQuestTimer("frintezza_despawn", 60000, npc, null); + _lastAction = Chronos.currentTimeMillis(); + if (Config.BYPASS_FRINTEZZA_PARTIES_CHECK) { - final CommandChannel cc = player.getParty().getCommandChannel(); - if (cc != null) + if (player.getParty() != null) { - // teleport all parties into CC - for (Party party : cc.getParties()) + final CommandChannel cc = player.getParty().getCommandChannel(); + if (cc != null) { - if (party == null) + // Teleport all parties into CC. + for (Party party : cc.getParties()) { - continue; - } - - synchronized (_playersInside) - { - for (PlayerInstance member : party.getPartyMembers()) + if (party == null) { - if ((member == null) || (member.getLevel() < 74)) + continue; + } + + synchronized (_playersInside) + { + for (PlayerInstance member : party.getPartyMembers()) { - continue; + if ((member == null) || (member.getLevel() < 74)) + { + continue; + } + if (!member.isInsideRadius2D(npc, 700)) + { + continue; + } + if (_playersInside.size() > 45) + { + member.sendMessage("The number of challenges have been full, so can not enter."); + break; + } + _playersInside.add(member); + _zone.allowPlayerEntry(member, 300); + member.teleToLocation(INVADE_LOC[_locCycle][0] + Rnd.get(50), INVADE_LOC[_locCycle][1] + Rnd.get(50), INVADE_LOC[_locCycle][2]); } - if (!member.isInsideRadius2D(npc, 700)) + if (_playersInside.size() > 45) { - continue; + break; } + } + + _locCycle++; + if (_locCycle >= 6) + { + _locCycle = 1; + } + } + } + else + { + // Teleport just actual party. + final Party party = player.getParty(); + for (PlayerInstance member : party.getPartyMembers()) + { + if ((member == null) || (member.getLevel() < 74)) + { + continue; + } + if (!member.isInsideRadius2D(npc, 700)) + { + continue; + } + + synchronized (_playersInside) + { if (_playersInside.size() > 45) { member.sendMessage("The number of challenges have been full, so can not enter."); break; } _playersInside.add(member); - _zone.allowPlayerEntry(member, 300); - member.teleToLocation(getXFix(_invadeLoc[_locCycle][0]) + Rnd.get(50), getYFix(_invadeLoc[_locCycle][1]) + Rnd.get(50), getZFix(_invadeLoc[_locCycle][2])); - } - if (_playersInside.size() > 45) - { - break; } + + _zone.allowPlayerEntry(member, 300); + member.teleToLocation(INVADE_LOC[_locCycle][0] + Rnd.get(50), INVADE_LOC[_locCycle][1] + Rnd.get(50), INVADE_LOC[_locCycle][2]); } _locCycle++; @@ -1523,33 +1590,51 @@ public class Frintezza extends Quest } } } - else + else if (player.isInsideRadius2D(npc, 700)) { - // teleport just actual party - final Party party = player.getParty(); - for (PlayerInstance member : party.getPartyMembers()) + synchronized (_playersInside) { - if ((member == null) || (member.getLevel() < 74)) - { - continue; - } - if (!member.isInsideRadius2D(npc, 700)) - { - continue; - } - - synchronized (_playersInside) + _playersInside.add(player); + } + _zone.allowPlayerEntry(player, 300); + player.teleToLocation(INVADE_LOC[_locCycle][0] + Rnd.get(50), INVADE_LOC[_locCycle][1] + Rnd.get(50), INVADE_LOC[_locCycle][2]); + } + } + else + { + final CommandChannel cc = player.getParty().getCommandChannel(); + for (Party party : cc.getParties()) + { + if (party == null) + { + continue; + } + + synchronized (_playersInside) + { + for (PlayerInstance member : party.getPartyMembers()) { + if ((member == null) || (member.getLevel() < 74)) + { + continue; + } + if (!member.isInsideRadius2D(npc, 700)) + { + continue; + } if (_playersInside.size() > 45) { member.sendMessage("The number of challenges have been full, so can not enter."); break; } _playersInside.add(member); + _zone.allowPlayerEntry(member, 300); + member.teleToLocation(INVADE_LOC[_locCycle][0] + Rnd.get(50), INVADE_LOC[_locCycle][1] + Rnd.get(50), INVADE_LOC[_locCycle][2]); + } + if (_playersInside.size() > 45) + { + break; } - - _zone.allowPlayerEntry(member, 300); - member.teleToLocation(getXFix(_invadeLoc[_locCycle][0]) + Rnd.get(50), getYFix(_invadeLoc[_locCycle][1]) + Rnd.get(50), getZFix(_invadeLoc[_locCycle][2])); } _locCycle++; @@ -1559,66 +1644,15 @@ public class Frintezza extends Quest } } } - else if (player.isInsideRadius2D(npc, 700)) - { - synchronized (_playersInside) - { - _playersInside.add(player); - } - _zone.allowPlayerEntry(player, 300); - player.teleToLocation(getXFix(_invadeLoc[_locCycle][0]) + Rnd.get(50), getYFix(_invadeLoc[_locCycle][1]) + Rnd.get(50), getZFix(_invadeLoc[_locCycle][2])); - } - } - else - { - final CommandChannel cc = player.getParty().getCommandChannel(); - for (Party party : cc.getParties()) - { - if (party == null) - { - continue; - } - - synchronized (_playersInside) - { - for (PlayerInstance member : party.getPartyMembers()) - { - if ((member == null) || (member.getLevel() < 74)) - { - continue; - } - if (!member.isInsideRadius2D(npc, 700)) - { - continue; - } - if (_playersInside.size() > 45) - { - member.sendMessage("The number of challenges have been full, so can not enter."); - break; - } - _playersInside.add(member); - _zone.allowPlayerEntry(member, 300); - member.teleToLocation(getXFix(_invadeLoc[_locCycle][0]) + Rnd.get(50), getYFix(_invadeLoc[_locCycle][1]) + Rnd.get(50), getZFix(_invadeLoc[_locCycle][2])); - } - if (_playersInside.size() > 45) - { - break; - } - } - - _locCycle++; - if (_locCycle >= 6) - { - _locCycle = 1; - } - } } } + break; + } + default: + { + htmltext = "Someone else is already inside the Magic Force Field. Try again later."; + break; } - } - else - { - htmltext = "Someone else is already inside the Magic Force Field. Try again later."; } return htmltext; @@ -1678,150 +1712,120 @@ public class Frintezza extends Quest @Override public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet) { - final Integer status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA); - if (npc.getNpcId() == FRINTEZZA) + final int status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA); + switch (npc.getNpcId()) { - return null; - } - else if ((npc.getNpcId() == SCARLET2) && (_onCheck == 0) && (status == FIGHTING)) - { - _onCheck = 1; - startQuestTimer("stop_pc", 0, npc, null); - startQuestTimer("stop_npc", 0, npc, null); - startQuestTimer("morph_16", 0, npc, null); - } - else if ((npc.getNpcId() == SCARLET2) && (_onCheck == 1) && (status == FIGHTING)) - { - cancelQuestTimers("spawn_minion"); - cancelQuestTimers("frintezza_despawn"); - startQuestTimer("clean", 30000, npc, null); - startQuestTimer("close", 30000, npc, null); - startQuestTimer("room3_del", 60000, npc, null); - startQuestTimer("minions_despawn", 60000, npc, null); - startQuestTimer("remove_players", 900000, npc, null); - GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DEAD); - final long respawnTime = (Config.FRINTEZZA_RESP_FIRST + Rnd.get(Config.FRINTEZZA_RESP_SECOND)) * 3600000; - startQuestTimer("frintezza_unlock", respawnTime, npc, null); - // also save the respawn time so that the info is maintained past reboots - final StatSet info = GrandBossManager.getInstance().getStatSet(FRINTEZZA); - info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime); - GrandBossManager.getInstance().setStatSet(FRINTEZZA, info); - } - else if (npc.getNpcId() == 18328) - { - _killHallAlarmDevice++; - if (_killHallAlarmDevice == 3) // open walls + case FRINTEZZA: { - for (int i = 25150051; i <= 25150058; i++) - { - DoorData.getInstance().getDoor(i).openMe(); - } + return null; } - if (_killHallAlarmDevice == 4) + case SCARLET2: { - startQuestTimer("room1_del", 100, npc, null); - startQuestTimer("room2_spawn", 100, npc, null); - DoorData.getInstance().getDoor(25150042).openMe(); - DoorData.getInstance().getDoor(25150043).openMe(); - } - } - else if (npc.getNpcId() == 18339) - { - _killDarkChoirPlayer++; - if (_killDarkChoirPlayer == 2) - { - DoorData.getInstance().getDoor(25150042).closeMe(); - DoorData.getInstance().getDoor(25150043).closeMe(); - DoorData.getInstance().getDoor(25150045).closeMe(); - DoorData.getInstance().getDoor(25150046).closeMe(); - int outside = 0; - - synchronized (_playersInside) + if (status == FIGHTING) { - for (PlayerInstance room2_pc : _playersInside) + if (_onCheck == 0) { - if (_zone.isInsideZone(room2_pc) && (room2_pc.getY() > -86130)) - { - outside++; - } + _onCheck = 1; + startQuestTimer("stop_pc", 0, npc, null); + startQuestTimer("stop_npc", 0, npc, null); + startQuestTimer("morph_16", 0, npc, null); + } + else if (_onCheck == 1) + { + cancelQuestTimers("spawn_minion"); + cancelQuestTimers("frintezza_despawn"); + startQuestTimer("clean", 30000, npc, null); + startQuestTimer("close", 30000, npc, null); + startQuestTimer("room3_del", 60000, npc, null); + startQuestTimer("minions_despawn", 60000, npc, null); + startQuestTimer("remove_players", 900000, npc, null); + GrandBossManager.getInstance().setBossStatus(FRINTEZZA, DEAD); + final long respawnTime = (Config.FRINTEZZA_RESP_FIRST + Rnd.get(Config.FRINTEZZA_RESP_SECOND)) * 3600000; + startQuestTimer("frintezza_unlock", respawnTime, npc, null); + // Also save the respawn time so that the info is maintained past restarts. + final StatSet info = GrandBossManager.getInstance().getStatSet(FRINTEZZA); + info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime); + GrandBossManager.getInstance().setStatSet(FRINTEZZA, info); } } - - if (outside == 0) + break; + } + case 18328: + { + _killHallAlarmDevice++; + if (_killHallAlarmDevice == 3) // open walls { - startQuestTimer("room2_del", 100, npc, null); - startQuestTimer("waiting", 180000, npc, null); - cancelQuestTimers("room_final"); - } - else - { - for (int i = 25150061; i <= 25150070; i++) + for (int i = 25150051; i <= 25150058; i++) { DoorData.getInstance().getDoor(i).openMe(); } - - startQuestTimer("room2_spawn2", 1000, npc, null); } + if (_killHallAlarmDevice == 4) + { + startQuestTimer("room1_del", 100, npc, null); + startQuestTimer("room2_spawn", 100, npc, null); + DoorData.getInstance().getDoor(25150042).openMe(); + DoorData.getInstance().getDoor(25150043).openMe(); + } + break; } - } - else if (npc.getNpcId() == 18334) - { - _killDarkChoirCaptain++; - if (_killDarkChoirCaptain == 8) + case 18339: { - startQuestTimer("room2_del", 100, npc, null); - DoorData.getInstance().getDoor(25150045).openMe(); - DoorData.getInstance().getDoor(25150046).openMe(); - - startQuestTimer("waiting", 180000, npc, null); - cancelQuestTimers("room_final"); + _killDarkChoirPlayer++; + if (_killDarkChoirPlayer == 2) + { + DoorData.getInstance().getDoor(25150042).closeMe(); + DoorData.getInstance().getDoor(25150043).closeMe(); + DoorData.getInstance().getDoor(25150045).closeMe(); + DoorData.getInstance().getDoor(25150046).closeMe(); + int outside = 0; + + synchronized (_playersInside) + { + for (PlayerInstance room2_pc : _playersInside) + { + if (_zone.isInsideZone(room2_pc) && (room2_pc.getY() > -86130)) + { + outside++; + } + } + } + + if (outside == 0) + { + startQuestTimer("room2_del", 100, npc, null); + startQuestTimer("waiting", 180000, npc, null); + cancelQuestTimers("room_final"); + } + else + { + for (int i = 25150061; i <= 25150070; i++) + { + DoorData.getInstance().getDoor(i).openMe(); + } + startQuestTimer("room2_spawn2", 1000, npc, null); + } + } + break; + } + case 18334: + { + _killDarkChoirCaptain++; + if (_killDarkChoirCaptain == 8) + { + startQuestTimer("room2_del", 100, npc, null); + DoorData.getInstance().getDoor(25150045).openMe(); + DoorData.getInstance().getDoor(25150046).openMe(); + startQuestTimer("waiting", 180000, npc, null); + cancelQuestTimers("room_final"); + } + break; } } return super.onKill(npc, killer, isPet); } - /** - * Override spawn method to correct spawn cords after lair move
- * TODO: Update cords in script, im just lazy :) - */ - @Override - public NpcInstance addSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffset, int despawnDelay) - { - // cords fix: - return super.addSpawn(npcId, getXFix(x), getYFix(y), getZFix(z), heading, randomOffset, despawnDelay); - } - - public int getXFix(int x) - { - return x/* - 262016 */; - } - - public int getYFix(int y) - { - return y/* - 65278 */; - } - - public int getZFix(int z) - { - return z/* - 4065 */; - } - - public int reverseXFix(int x) - { - return x/* + 262016 */; - } - - public int reverseYFix(int y) - { - return y/* + 65278 */; - } - - public int reverseZFix(int z) - { - return z/* + 4065 */; - } - public static void main(String[] args) { new Frintezza(); diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Gordon.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Gordon.java index 03ac1fa7d8..7a963890c2 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Gordon.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Gordon.java @@ -36,11 +36,6 @@ import org.l2jmobius.gameserver.model.spawn.Spawn; public class Gordon extends Quest { private static final int GORDON = 29095; - private static int _npcMoveX = 0; - private static int _npcMoveY = 0; - private static int _isWalkTo = 0; - private static int _npcBlock = 0; - // @formatter:off private static final int[][] WALKS = { @@ -101,9 +96,13 @@ public class Gordon extends Quest {141569, -45908, -2387} }; // @formatter:on - + // Misc. private static boolean _isAttacked = false; private static boolean _isSpawned = false; + private static int _npcMoveX = 0; + private static int _npcMoveY = 0; + private static int _isWalkTo = 0; + private static int _npcBlock = 0; public Gordon() { @@ -113,7 +112,7 @@ public class Gordon extends Quest addEventId(GORDON, EventType.ON_ATTACK); addEventId(GORDON, EventType.ON_SPAWN); - // wait 2 minutes after Start AI + // Wait 2 minutes after Start AI. startQuestTimer("check_ai", 120000, null, null, true); _isSpawned = false; @@ -163,7 +162,7 @@ public class Gordon extends Quest // startQuestTimer("Start", 1000, npc, null); if ((npc != null) && _isSpawned) { - // check if player have Cursed Weapon and in radius + // Check if player have Cursed Weapon and in radius. if (npc.getNpcId() == GORDON) { final Collection chars = npc.getKnownList().getKnownPlayers().values(); @@ -184,7 +183,7 @@ public class Gordon extends Quest } } } - // end check + if (_isAttacked) { return super.onAdvEvent(event, npc, player); @@ -201,13 +200,15 @@ public class Gordon extends Quest y = WALKS[_isWalkTo - 1][1]; z = WALKS[_isWalkTo - 1][2]; npc.setWalking(); - // TODO: find better way to prevent teleporting to the home location + + // TODO: Find better way to prevent teleporting to home location. npc.getSpawn().setX(x); npc.getSpawn().setY(y); npc.getSpawn().setZ(z); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(x, y, z, 0)); } - // Test for unblock Npc + + // Test for unblock NPC. if ((npc.getX() != _npcMoveX) && (npc.getY() != _npcMoveY)) { _npcMoveX = npc.getX(); @@ -224,14 +225,13 @@ public class Gordon extends Quest } if (_npcBlock > 0) { - // TODO: find better way to prevent teleporting to the home location + // TODO: Find better way to prevent teleporting to home location. npc.getSpawn().setX(x); npc.getSpawn().setY(y); npc.getSpawn().setZ(z); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(x, y, z, 0)); } } - // End Test unblock Npc } break; } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/IceFairySirra.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/IceFairySirra.java index aa5e11cf79..7d9ddab59c 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/IceFairySirra.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/IceFairySirra.java @@ -45,8 +45,22 @@ import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; */ public class IceFairySirra extends Quest { + // NPC private static final int STEWARD = 32029; + // Item private static final int SILVER_HEMOCYTE = 8057; + // Spawns + // @formatter:off + private static final int[][] MONSTER_SPAWNS = + { + {29060, 105546, -127892, -2768}, + {29056, 102779, -125920, -2840}, + {22100, 111719, -126646, -2992}, + {22102, 109509, -128946, -3216}, + {22104, 109680, -125756, -3136} + }; + // @formatter:on + // Misc. private static BossZone _freyasZone; private static PlayerInstance _player = null; protected Collection _allMobs = ConcurrentHashMap.newKeySet(); @@ -55,6 +69,7 @@ public class IceFairySirra extends Quest public IceFairySirra() { super(-1, "ai/bosses"); + final int[] mobs = { STEWARD, @@ -65,7 +80,6 @@ public class IceFairySirra extends Quest for (int mob : mobs) { - // TODO: addEventId(mob, EventType.QUEST_START); addEventId(mob, EventType.QUEST_TALK); addEventId(mob, EventType.NPC_FIRST_TALK); @@ -98,75 +112,84 @@ public class IceFairySirra extends Quest @Override public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player) { - if (event.equals("check_condition")) + switch (event) { - if (npc.isBusy()) + case "check_condition": { - return super.onAdvEvent(event, npc, player); - } - - String filename = ""; - if (player.isInParty() && (player.getParty().getPartyLeaderOID() == player.getObjectId())) - { - if (checkItems(player)) + if (npc.isBusy()) { - startQuestTimer("start", 100000, null, player); - _player = player; - destroyItems(player); - player.getInventory().addItem("Scroll", 8379, 3, player, null); - npc.setBusy(true); - screenMessage(player, "Steward: Please wait a moment.", 100000); - filename = getHtmlPath(3); + return super.onAdvEvent(event, npc, player); + } + String filename = ""; + if (player.isInParty() && (player.getParty().getPartyLeaderOID() == player.getObjectId())) + { + if (checkItems(player)) + { + startQuestTimer("start", 100000, null, player); + _player = player; + destroyItems(player); + player.getInventory().addItem("Scroll", 8379, 3, player, null); + npc.setBusy(true); + screenMessage(player, "Steward: Please wait a moment.", 100000); + filename = getHtmlPath(3); + } + else + { + filename = getHtmlPath(2); + } } else { - filename = getHtmlPath(2); + filename = getHtmlPath(1); } + sendHtml(npc, player, filename); + break; } - else + case "start": { - filename = getHtmlPath(1); + if (_freyasZone == null) + { + LOGGER.warning("IceFairySirraManager: Failed to load zone"); + cleanUp(); + return super.onAdvEvent(event, npc, player); + } + _freyasZone.setZoneEnabled(true); + closeGates(); + doSpawns(); + startQuestTimer("Party_Port", 2000, null, player); + startQuestTimer("End", 1802000, null, player); + break; } - sendHtml(npc, player, filename); - } - else if (event.equals("start")) - { - if (_freyasZone == null) + case "Party_Port": { - LOGGER.warning("IceFairySirraManager: Failed to load zone"); + teleportInside(player); + screenMessage(player, "Steward: Please restore the Queen's appearance!", 10000); + startQuestTimer("30MinutesRemaining", 300000, null, player); + break; + } + case "30MinutesRemaining": + { + screenMessage(player, "30 minute(s) are remaining.", 10000); + startQuestTimer("20minutesremaining", 600000, null, player); + break; + } + case "20MinutesRemaining": + { + screenMessage(player, "20 minute(s) are remaining.", 10000); + startQuestTimer("10minutesremaining", 600000, null, player); + break; + } + case "10MinutesRemaining": + { + screenMessage(player, "Steward: Waste no time! Please hurry!", 10000); + break; + } + case "End": + { + screenMessage(player, "Steward: Was it indeed too much to ask.", 10000); cleanUp(); - return super.onAdvEvent(event, npc, player); + break; } - _freyasZone.setZoneEnabled(true); - closeGates(); - doSpawns(); - startQuestTimer("Party_Port", 2000, null, player); - startQuestTimer("End", 1802000, null, player); - } - else if (event.equals("Party_Port")) - { - teleportInside(player); - screenMessage(player, "Steward: Please restore the Queen's appearance!", 10000); - startQuestTimer("30MinutesRemaining", 300000, null, player); - } - else if (event.equals("30MinutesRemaining")) - { - screenMessage(player, "30 minute(s) are remaining.", 10000); - startQuestTimer("20minutesremaining", 600000, null, player); - } - else if (event.equals("20MinutesRemaining")) - { - screenMessage(player, "20 minute(s) are remaining.", 10000); - startQuestTimer("10minutesremaining", 600000, null, player); - } - else if (event.equals("10MinutesRemaining")) - { - screenMessage(player, "Steward: Waste no time! Please hurry!", 10000); - } - else if (event.equals("End")) - { - screenMessage(player, "Steward: Was it indeed too much to ask.", 10000); - cleanUp(); } return super.onAdvEvent(event, npc, player); } @@ -345,53 +368,20 @@ public class IceFairySirra extends Quest public void doSpawns() { - final int[][] mobs = - { - { - 29060, - 105546, - -127892, - -2768 - }, - { - 29056, - 102779, - -125920, - -2840 - }, - { - 22100, - 111719, - -126646, - -2992 - }, - { - 22102, - 109509, - -128946, - -3216 - }, - { - 22104, - 109680, - -125756, - -3136 - } - }; Spawn spawnDat; NpcTemplate template; try { for (int i = 0; i < 5; i++) { - template = NpcTable.getInstance().getTemplate(mobs[i][0]); + template = NpcTable.getInstance().getTemplate(MONSTER_SPAWNS[i][0]); if (template != null) { spawnDat = new Spawn(template); spawnDat.setAmount(1); - spawnDat.setX(mobs[i][1]); - spawnDat.setY(mobs[i][2]); - spawnDat.setZ(mobs[i][3]); + spawnDat.setX(MONSTER_SPAWNS[i][1]); + spawnDat.setY(MONSTER_SPAWNS[i][2]); + spawnDat.setZ(MONSTER_SPAWNS[i][3]); spawnDat.setHeading(0); spawnDat.setRespawnDelay(60); SpawnTable.getInstance().addNewSpawn(spawnDat, false); @@ -400,7 +390,7 @@ public class IceFairySirra extends Quest } else { - LOGGER.warning("IceFairySirraManager: Data missing in NPC table for ID: " + mobs[i][0]); + LOGGER.warning("IceFairySirraManager: Data missing in NPC table for ID: " + MONSTER_SPAWNS[i][0]); } } } @@ -422,7 +412,7 @@ public class IceFairySirra extends Quest final String temp = "data/html/default/" + pom + ".htm"; if (!Config.LAZY_CACHE) { - // If not running lazy cache the file must be in the cache or it doesnt exist + // If not running lazy cache the file must be in the cache or it does not exist. if (HtmCache.getInstance().contains(temp)) { return temp; @@ -433,7 +423,7 @@ public class IceFairySirra extends Quest return temp; } - // If the file is not found, the standard message "I have nothing to say to you" is returned + // If the file is not found, the standard message "I have nothing to say to you" is returned. return "data/html/npcdefault.htm"; } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Orfen.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Orfen.java index 6192e06573..7515f9acae 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Orfen.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Orfen.java @@ -85,16 +85,9 @@ public class Orfen extends Quest } case LIVE: { - /* - * int loc_x = info.getInteger("loc_x"); int loc_y = info.getInteger("loc_y"); int loc_z = info.getInteger("loc_z"); int heading = info.getInteger("heading"); - */ - final int loc_x = 55024; - final int loc_y = 17368; - final int loc_z = -5412; - final int heading = 0; final int hp = info.getInt("currentHP"); final int mp = info.getInt("currentMP"); - _orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0); + _orfen = (GrandBossInstance) addSpawn(ORFEN, 55024, 17368, -5412, 0, false, 0); if (Config.ANNOUNCE_TO_ALL_SPAWN_RB) { AnnouncementsTable.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world."); @@ -166,7 +159,8 @@ public class Orfen extends Quest startQuestTimer("ORFEN_RETURN", 10000, npc, null); } else - { // restart the refresh scheduling + { + // Restart the refresh scheduling. startQuestTimer("ORFEN_REFRESH", 10000, npc, null); } break; @@ -236,11 +230,11 @@ public class Orfen extends Quest { npc.broadcastPacket(new PlaySound(1, "BS02_D", npc)); GrandBossManager.getInstance().setBossStatus(ORFEN, DEAD); - // time is 48hour +/- 20hour + // Time is 48hour +/- 20hour. final long respawnTime = (Config.ORFEN_RESP_FIRST + Rnd.get(Config.ORFEN_RESP_SECOND)) * 3600000; cancelQuestTimer("ORFEN_REFRESH", npc, null); startQuestTimer("ORFEN_SPAWN", respawnTime, null, null); - // also save the respawn time so that the info is maintained past reboots + // Also save the respawn time so that the info is maintained past restarts. final StatSet info = GrandBossManager.getInstance().getStatSet(ORFEN); info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime); GrandBossManager.getInstance().setStatSet(ORFEN, info); diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/QueenAnt.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/QueenAnt.java index 8a8aa3d7ee..6c2ffc6f90 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/QueenAnt.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/QueenAnt.java @@ -34,24 +34,21 @@ import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.EventType; import org.l2jmobius.gameserver.model.quest.Quest; -import org.l2jmobius.gameserver.model.zone.type.BossZone; import org.l2jmobius.gameserver.network.serverpackets.PlaySound; import org.l2jmobius.gameserver.network.serverpackets.SocialAction; public class QueenAnt extends Quest { + // Queen Ant status + private static final int LIVE = 0; // Queen Ant is spawned. + private static final int DEAD = 1; // Queen Ant has been killed. + // NPCs private static final int QUEEN = 29001; private static final int LARVA = 29002; private static final int NURSE = 29003; private static final int GUARD = 29004; private static final int ROYAL = 29005; - - // QUEEN Status Tracking : - private static final int LIVE = 0; // Queen Ant is spawned. - private static final int DEAD = 1; // Queen Ant has been killed. - - @SuppressWarnings("unused") - private static BossZone _zone; + // Misc private MonsterInstance _larva = null; private MonsterInstance _queen = null; private final List _minions = new CopyOnWriteArrayList<>(); @@ -59,7 +56,7 @@ public class QueenAnt extends Quest enum Event { - QUEEN_SPAWN, /* CHECK_QA_ZONE, */ + QUEEN_SPAWN, CHECK_MINIONS_ZONE, CHECK_NURSE_ALIVE, ACTION, @@ -90,8 +87,6 @@ public class QueenAnt extends Quest addEventId(mob, EventType.ON_ATTACK); } - _zone = GrandBossManager.getInstance().getZone(-21610, 181594, -5734); - final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN); final Integer status = GrandBossManager.getInstance().getBossStatus(QUEEN); @@ -115,13 +110,10 @@ public class QueenAnt extends Quest GrandBossManager.getInstance().addBoss(queen); spawnBoss(queen); } - } break; + } case LIVE: { - /* - * int loc_x = info.getInteger("loc_x"); int loc_y = info.getInteger("loc_y"); int loc_z = info.getInteger("loc_z"); int heading = info.getInteger("heading"); - */ final int hp = info.getInt("currentHP"); final int mp = info.getInt("currentMP"); final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0); @@ -132,8 +124,8 @@ public class QueenAnt extends Quest GrandBossManager.getInstance().addBoss(queen); queen.setCurrentHpMp(hp, mp); spawnBoss(queen); - } break; + } default: { final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0); @@ -144,6 +136,7 @@ public class QueenAnt extends Quest GrandBossManager.getInstance().setBossStatus(QUEEN, LIVE); GrandBossManager.getInstance().addBoss(queen); spawnBoss(queen); + break; } } } @@ -365,7 +358,7 @@ public class QueenAnt extends Quest { npc.broadcastPacket(new PlaySound(1, "BS02_D", npc)); GrandBossManager.getInstance().setBossStatus(QUEEN, DEAD); - // time is 36hour +/- 17hour + // Time is 36hour +/- 17hour. final long respawnTime = (Config.QA_RESP_FIRST + Rnd.get(Config.QA_RESP_SECOND)) * 3600000; startQuestTimer("QUEEN_SPAWN", respawnTime, null, null); startQuestTimer("LARVA_DESPAWN", 4 * 60 * 60 * 1000, null, null); @@ -375,7 +368,7 @@ public class QueenAnt extends Quest cancelQuestTimer("CHECK_NURSE_ALIVE", npc, null); cancelQuestTimer("HEAL", null, null); // cancelQuestTimer("CHECK_QA_ZONE", npc, null); - // also save the respawn time so that the info is maintained past reboots + // Also save the respawn time so that the info is maintained past restarts. final StatSet info = GrandBossManager.getInstance().getStatSet(QUEEN); info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime); GrandBossManager.getInstance().setStatSet(QUEEN, info); diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Valakas.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Valakas.java index a6aec93720..09d52c194c 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Valakas.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Valakas.java @@ -50,40 +50,35 @@ import org.l2jmobius.gameserver.util.Util; */ public class Valakas extends Quest { + // Valakas status + private static final byte DORMANT = 0; // Valakas is spawned and no one has entered yet. Entry is unlocked. + private static final byte WAITING = 1; // Valakas is spawend and someone has entered, triggering a 30 minute window for additional people to enter before he unleashes his attack. Entry is unlocked. + private static final byte FIGHTING = 2; // Valakas is engaged in battle, annihilating his foes. Entry is locked. + private static final byte DEAD = 3; // Valakas has been killed. Entry is locked. + // NPC + private static final int VALAKAS = 29028; + // Misc private int i_ai0 = 0; private int i_ai1 = 0; private int i_ai2 = 0; private int i_ai3 = 0; private int i_ai4 = 0; private int i_quest0 = 0; - private long lastAttackTime = 0; // time to tracking valakas when was last time attacked - private int i_quest2 = 0; // hate value for 1st player - private int i_quest3 = 0; // hate value for 2nd player - private int i_quest4 = 0; // hate value for 3rd player - private Creature c_quest2 = null; // 1st most hated target - private Creature c_quest3 = null; // 2nd most hated target - private Creature c_quest4 = null; // 3rd most hated target + private long lastAttackTime = 0; // Time to tracking valakas when was last time attacked. + private int i_quest2 = 0; // Hate value for 1st player. + private int i_quest3 = 0; // Hate value for 2nd player. + private int i_quest4 = 0; // Hate value for 3rd player. + private Creature c_quest2 = null; // 1st most hated target. + private Creature c_quest3 = null; // 2nd most hated target. + private Creature c_quest4 = null; // 3rd most hated target. + private static BossZone _zone; - private static final int VALAKAS = 29028; - - // Valakas Status Tracking : - private static final byte DORMANT = 0; // Valakas is spawned and no one has entered yet. Entry is unlocked - private static final byte WAITING = 1; // Valakas is spawend and someone has entered, triggering a 30 minute window for additional people to enter - // before he unleashes his attack. Entry is unlocked - private static final byte FIGHTING = 2; // Valakas is engaged in battle, annihilating his foes. Entry is locked - private static final byte DEAD = 3; // Valakas has been killed. Entry is locked - - private static BossZone _Zone; - - // Boss: Valakas public Valakas() { super(-1, "ai/bosses"); - final int[] mob = - { - VALAKAS - }; - registerMobs(mob); + + registerMobs(VALAKAS); + i_ai0 = 0; i_ai1 = 0; i_ai2 = 0; @@ -91,38 +86,33 @@ public class Valakas extends Quest i_ai4 = 0; i_quest0 = 0; lastAttackTime = Chronos.currentTimeMillis(); - _Zone = GrandBossManager.getInstance().getZone(212852, -114842, -1632); + _zone = GrandBossManager.getInstance().getZone(212852, -114842, -1632); + final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS); final Integer status = GrandBossManager.getInstance().getBossStatus(VALAKAS); if (status == DEAD) { - // load the unlock date and time for valakas from DB + // Load the unlock date and time for valakas from DB. final long temp = (info.getLong("respawn_time") - Chronos.currentTimeMillis()); - // if valakas is locked until a certain time, mark it so and start the unlock timer - // the unlock time has not yet expired. Mark valakas as currently locked. Setup a timer - // to fire at the correct time (calculate the time between now and the unlock time, - // setup a timer to fire after that many msec) + // If valakas is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired. + // Mark valakas as currently locked. Setup a timer to fire at the correct time (calculate the time between now and the unlock time, setup a timer to fire after that many msec). if (temp > 0) { startQuestTimer("valakas_unlock", temp, null, null); } else { - // the time has already expired while the server was offline. - // the status needs to be changed to DORMANT + // The time has already expired while the server was offline. + // The status needs to be changed to DORMANT. GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT); } } else if (status == FIGHTING) { - // respawn to original location - final int loc_x = 213004; - final int loc_y = -114890; - final int loc_z = -1595; - final int heading = 0; + // Respawn to original location. final int hp = info.getInt("currentHP"); final int mp = info.getInt("currentMP"); - final GrandBossInstance valakas = (GrandBossInstance) addSpawn(VALAKAS, loc_x, loc_y, loc_z, heading, false, 0); + final GrandBossInstance valakas = (GrandBossInstance) addSpawn(VALAKAS, 213004, -114890, -1595, 0, false, 0); GrandBossManager.getInstance().addBoss(valakas); ThreadPool.schedule(() -> { @@ -134,18 +124,18 @@ public class Valakas extends Quest catch (Throwable e) { } - }, 100L); + }, 100); startQuestTimer("launch_random_skill", 60000, valakas, null, true); - // Start repeating timer to check for inactivity + // Start repeating timer to check for inactivity. startQuestTimer("check_activity_and_do_actions", 60000, valakas, null, true); } else if (status == WAITING) { - // Start timer to lock entry after 30 minutes and spawn valakas + // Start timer to lock entry after 30 minutes and spawn Valakas. startQuestTimer("lock_entry_and_spawn_valakas", (Config.VALAKAS_WAIT_TIME * 60000), null, null); - } // if it was dormant, just leave it as it was: - // the valakas NPC is not spawned yet and his instance is not loaded + } + // If it was dormant, just leave it as it was. The valakas NPC is not spawned yet and his instance is not loaded. } @Override @@ -153,174 +143,193 @@ public class Valakas extends Quest { if (npc != null) { - long temp = 0; - if (event.equals("check_activity_and_do_actions")) + switch (event) { - int level = 0; - int sk4691 = 0; - for (Effect e : npc.getAllEffects()) + case "check_activity_and_do_actions": { - if (e.getSkill().getId() == 4629) + int level = 0; + int sk4691 = 0; + for (Effect e : npc.getAllEffects()) { - sk4691 = 1; - level = e.getSkill().getLevel(); - break; + if (e.getSkill().getId() == 4629) + { + sk4691 = 1; + level = e.getSkill().getLevel(); + break; + } } - } - - final Integer status = GrandBossManager.getInstance().getBossStatus(VALAKAS); - temp = (Chronos.currentTimeMillis() - lastAttackTime); - if ((status == FIGHTING) && (temp > (Config.VALAKAS_DESPAWN_TIME * 60000))) // 15 mins by default - { - npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); - - // delete the actual boss - final GrandBossInstance boss = GrandBossManager.getInstance().deleteBoss(VALAKAS); - boss.decayMe(); - GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT); - // npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp()); - _Zone.oustAllPlayers(); - cancelQuestTimer("check_activity_and_do_actions", npc, null); - i_quest2 = 0; - i_quest3 = 0; - i_quest4 = 0; - } - else if (npc.getCurrentHp() > ((npc.getMaxHp() * 1) / 4)) - { - if ((sk4691 == 0) || ((sk4691 == 1) && (level != 4))) + final Integer status = GrandBossManager.getInstance().getBossStatus(VALAKAS); + if ((status == FIGHTING) && ((Chronos.currentTimeMillis() - lastAttackTime) > (Config.VALAKAS_DESPAWN_TIME * 60000))) // 15 mins by default. + { + npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + + // delete the actual boss + final GrandBossInstance boss = GrandBossManager.getInstance().deleteBoss(VALAKAS); + boss.decayMe(); + GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT); + // npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp()); + _zone.oustAllPlayers(); + cancelQuestTimer("check_activity_and_do_actions", npc, null); + i_quest2 = 0; + i_quest3 = 0; + i_quest4 = 0; + } + else if (npc.getCurrentHp() > ((npc.getMaxHp() * 1) / 4)) + { + if ((sk4691 == 0) || ((sk4691 == 1) && (level != 4))) + { + npc.setTarget(npc); + npc.doCast(SkillTable.getInstance().getSkill(4691, 4)); + } + } + else if (npc.getCurrentHp() > ((npc.getMaxHp() * 2) / 4.0)) + { + if ((sk4691 == 0) || ((sk4691 == 1) && (level != 3))) + { + npc.setTarget(npc); + npc.doCast(SkillTable.getInstance().getSkill(4691, 3)); + } + } + else if (npc.getCurrentHp() > ((npc.getMaxHp() * 3) / 4.0)) + { + if ((sk4691 == 0) || ((sk4691 == 1) && (level != 2))) + { + npc.setTarget(npc); + npc.doCast(SkillTable.getInstance().getSkill(4691, 2)); + } + } + else if ((sk4691 == 0) || ((sk4691 == 1) && (level != 1))) { npc.setTarget(npc); - npc.doCast(SkillTable.getInstance().getSkill(4691, 4)); + npc.doCast(SkillTable.getInstance().getSkill(4691, 1)); } + break; } - else if (npc.getCurrentHp() > ((npc.getMaxHp() * 2) / 4.0)) + case "launch_random_skill": { - if ((sk4691 == 0) || ((sk4691 == 1) && (level != 3))) + if (!npc.isInvul()) { - npc.setTarget(npc); - npc.doCast(SkillTable.getInstance().getSkill(4691, 3)); + getRandomSkill(npc); } - } - else if (npc.getCurrentHp() > ((npc.getMaxHp() * 3) / 4.0)) - { - if ((sk4691 == 0) || ((sk4691 == 1) && (level != 2))) + else { - npc.setTarget(npc); - npc.doCast(SkillTable.getInstance().getSkill(4691, 2)); + npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); } + break; } - else if ((sk4691 == 0) || ((sk4691 == 1) && (level != 1))) + case "1004": { - npc.setTarget(npc); - npc.doCast(SkillTable.getInstance().getSkill(4691, 1)); + startQuestTimer("1102", 1500, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1300, 180, -5, 3000, 15000)); + break; } - } - else if (event.equals("launch_random_skill")) - { - if (!npc.isInvul()) + case "1102": { + startQuestTimer("1103", 3300, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 500, 180, -8, 600, 15000)); + break; + } + case "1103": + { + startQuestTimer("1104", 2900, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 800, 180, -8, 2700, 15000)); + break; + } + case "1104": + { + startQuestTimer("1105", 2700, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 200, 250, 70, 0, 15000)); + break; + } + case "1105": + { + startQuestTimer("1106", 1, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1100, 250, 70, 2500, 15000)); + break; + } + case "1106": + { + startQuestTimer("1107", 3200, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 700, 150, 30, 0, 15000)); + break; + } + case "1107": + { + startQuestTimer("1108", 1400, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1200, 150, 20, 2900, 15000)); + break; + } + case "1108": + { + startQuestTimer("1109", 6700, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 750, 170, 15, 3400, 15000)); + break; + } + case "1109": + { + startQuestTimer("1110", 5700, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 750, 170, -10, 3400, 15000)); + break; + } + case "1110": + { + GrandBossManager.getInstance().setBossStatus(VALAKAS, FIGHTING); + startQuestTimer("check_activity_and_do_actions", 60000, npc, null, true); + npc.setInvul(false); getRandomSkill(npc); + break; } - else + case "1111": { - npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + startQuestTimer("1112", 3500, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1100, 210, -5, 3000, 10000)); + break; } - } - else if (event.equals("1004")) - { - startQuestTimer("1102", 1500, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1300, 180, -5, 3000, 15000)); - } - else if (event.equals("1102")) - { - startQuestTimer("1103", 3300, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 500, 180, -8, 600, 15000)); - } - else if (event.equals("1103")) - { - startQuestTimer("1104", 2900, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 800, 180, -8, 2700, 15000)); - } - else if (event.equals("1104")) - { - startQuestTimer("1105", 2700, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 200, 250, 70, 0, 15000)); - } - else if (event.equals("1105")) - { - startQuestTimer("1106", 1, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1100, 250, 70, 2500, 15000)); - } - else if (event.equals("1106")) - { - startQuestTimer("1107", 3200, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 700, 150, 30, 0, 15000)); - } - else if (event.equals("1107")) - { - startQuestTimer("1108", 1400, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1200, 150, 20, 2900, 15000)); - } - else if (event.equals("1108")) - { - startQuestTimer("1109", 6700, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 750, 170, 15, 3400, 15000)); - } - else if (event.equals("1109")) - { - startQuestTimer("1110", 5700, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 750, 170, -10, 3400, 15000)); - } - else if (event.equals("1110")) - { - GrandBossManager.getInstance().setBossStatus(VALAKAS, FIGHTING); - startQuestTimer("check_activity_and_do_actions", 60000, npc, null, true); - npc.setInvul(false); - getRandomSkill(npc); - } - else if (event.equals("1111")) - { - startQuestTimer("1112", 3500, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1100, 210, -5, 3000, 10000)); - } - else if (event.equals("1112")) - { - startQuestTimer("1113", 4500, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1300, 200, -8, 3000, 10000)); - } - else if (event.equals("1113")) - { - startQuestTimer("1114", 500, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1000, 190, 0, 3000, 10000)); - } - else if (event.equals("1114")) - { - startQuestTimer("1115", 4600, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 120, 0, 2500, 10000)); - } - else if (event.equals("1115")) - { - startQuestTimer("1116", 750, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 20, 0, 3000, 10000)); - } - else if (event.equals("1116")) - { - startQuestTimer("1117", 2500, npc, null); - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 10, 0, 3000, 10000)); - } - else if (event.equals("1117")) - { - npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 10, 0, 3000, 250)); - addSpawn(31759, 212852, -114842, -1632, 0, false, 900000); - final int radius = 1500; - for (int i = 0; i < 20; i++) + case "1112": { - final int x = (int) (radius * Math.cos(i * .331)); // .331~2pi/19 - final int y = (int) (radius * Math.sin(i * .331)); - addSpawn(31759, 212852 + x, -114842 + y, -1632, 0, false, 900000); + startQuestTimer("1113", 4500, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1300, 200, -8, 3000, 10000)); + break; + } + case "1113": + { + startQuestTimer("1114", 500, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1000, 190, 0, 3000, 10000)); + break; + } + case "1114": + { + startQuestTimer("1115", 4600, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 120, 0, 2500, 10000)); + break; + } + case "1115": + { + startQuestTimer("1116", 750, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 20, 0, 3000, 10000)); + break; + } + case "1116": + { + startQuestTimer("1117", 2500, npc, null); + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 10, 0, 3000, 10000)); + break; + } + case "1117": + { + npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 10, 0, 3000, 250)); + addSpawn(31759, 212852, -114842, -1632, 0, false, 900000); + final int radius = 1500; + for (int i = 0; i < 20; i++) + { + final int x = (int) (radius * Math.cos(i * .331)); // .331~2pi/19 + final int y = (int) (radius * Math.sin(i * .331)); + addSpawn(31759, 212852 + x, -114842 + y, -1632, 0, false, 900000); + } + startQuestTimer("remove_players", 900000, null, null); + cancelQuestTimer("check_activity_and_do_actions", npc, null); + break; } - startQuestTimer("remove_players", 900000, null, null); - cancelQuestTimer("check_activity_and_do_actions", npc, null); } } else if (event.equals("lock_entry_and_spawn_valakas")) @@ -353,8 +362,9 @@ public class Valakas extends Quest } else if (event.equals("remove_players")) { - _Zone.oustAllPlayers(); + _zone.oustAllPlayers(); } + return super.onAdvEvent(event, npc, player); } @@ -365,10 +375,9 @@ public class Valakas extends Quest { return null; } + lastAttackTime = Chronos.currentTimeMillis(); - /* - * if (!Config.ALLOW_DIRECT_TP_TO_BOSS_ROOM && GrandBossManager.getInstance().getBossStatus(VALAKAS) != FIGHTING && !npc.getSpawn().isCustomBossInstance()) { attacker.teleToLocation(150037, -57255, -2976); } - */ + // if (!Config.ALLOW_DIRECT_TP_TO_BOSS_ROOM && GrandBossManager.getInstance().getBossStatus(VALAKAS) != FIGHTING && !npc.getSpawn().isCustomBossInstance()) { attacker.teleToLocation(150037, -57255, -2976); } if (attacker.getMountType() == 1) { int sk4258 = 0; @@ -583,10 +592,9 @@ public class Valakas extends Quest npc.broadcastPacket(new PlaySound(1, "B03_D", npc)); startQuestTimer("1111", 500, npc, null); GrandBossManager.getInstance().setBossStatus(VALAKAS, DEAD); - final long respawnTime = (Config.VALAKAS_RESP_FIRST + Rnd.get(Config.VALAKAS_RESP_SECOND)) * 3600000; startQuestTimer("valakas_unlock", respawnTime, null, null); - // also save the respawn time so that the info is maintained past reboots + // Also save the respawn time so that the info is maintained past restarts. final StatSet info = GrandBossManager.getInstance().getStatSet(VALAKAS); info.set("respawn_time", (Chronos.currentTimeMillis() + respawnTime)); GrandBossManager.getInstance().setStatSet(VALAKAS, info); diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/VanHalter.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/VanHalter.java index 828dfb32f2..a6b9d4374d 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/VanHalter.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/VanHalter.java @@ -61,9 +61,12 @@ public class VanHalter extends Quest { private static final Logger LOGGER = Logger.getLogger(VanHalter.class.getName()); + // VanHalter status. + private static final byte INTERVAL = 0; + private static final byte NOTSPAWN = 1; + private static final byte ALIVE = 2; // List of intruders. protected Map> _bleedingPlayers = new HashMap<>(); - // Spawn data of monsters. protected Map _monsterSpawn = new ConcurrentHashMap<>(); protected Collection _royalGuardSpawn = ConcurrentHashMap.newKeySet(); @@ -76,7 +79,6 @@ public class VanHalter extends Quest protected Spawn _ritualOfferingSpawn = null; protected Spawn _ritualSacrificeSpawn = null; protected Spawn _vanHalterSpawn = null; - // Instance of monsters. protected Collection _monsters = ConcurrentHashMap.newKeySet(); protected Collection _royalGuard = ConcurrentHashMap.newKeySet(); @@ -90,8 +92,7 @@ public class VanHalter extends Quest protected NpcInstance _ritualOffering = null; protected NpcInstance _ritualSacrifice = null; protected RaidBossInstance _vanHalter = null; - - // Task + // Tasks. protected ScheduledFuture _movieTask = null; protected ScheduledFuture _closeDoorOfAltarTask = null; protected ScheduledFuture _openDoorOfAltarTask = null; @@ -101,7 +102,6 @@ public class VanHalter extends Quest protected ScheduledFuture _intervalTask = null; protected ScheduledFuture _halterEscapeTask = null; protected ScheduledFuture _setBleedTask = null; - // State of High Priestess van Halter boolean _isLocked = false; boolean _isHalterSpawned = false; @@ -109,12 +109,6 @@ public class VanHalter extends Quest boolean _isCaptainSpawned = false; boolean _isHelperCalled = false; - // VanHalter Status Tracking : - private static final byte INTERVAL = 0; - private static final byte NOTSPAWN = 1; - private static final byte ALIVE = 2; - - // Initialize public VanHalter() { super(-1, "ai/bosses"); @@ -140,7 +134,6 @@ public class VanHalter extends Quest addEventId(mob, EventType.ON_KILL); } - // GrandBossManager.getInstance().addBoss(29062); // Clear flag. _isLocked = false; _isCaptainSpawned = false; @@ -175,11 +168,11 @@ public class VanHalter extends Quest _cameraMarkerSpawn.clear(); try { - final NpcTemplate template1 = NpcTable.getInstance().getTemplate(13014); // Dummy npc + final NpcTemplate template = NpcTable.getInstance().getTemplate(13014); // Dummy npc Spawn tempSpawn; // Dummy camera marker. - tempSpawn = new Spawn(template1); + tempSpawn = new Spawn(template); tempSpawn.setX(-16397); tempSpawn.setY(-55200); tempSpawn.setZ(-10449); @@ -189,7 +182,7 @@ public class VanHalter extends Quest SpawnTable.getInstance().addNewSpawn(tempSpawn, false); _cameraMarkerSpawn.put(1, tempSpawn); - tempSpawn = new Spawn(template1); + tempSpawn = new Spawn(template); tempSpawn.setX(-16397); tempSpawn.setY(-55200); tempSpawn.setZ(-10051); @@ -199,7 +192,7 @@ public class VanHalter extends Quest SpawnTable.getInstance().addNewSpawn(tempSpawn, false); _cameraMarkerSpawn.put(2, tempSpawn); - tempSpawn = new Spawn(template1); + tempSpawn = new Spawn(template); tempSpawn.setX(-16397); tempSpawn.setY(-55200); tempSpawn.setZ(-9741); @@ -209,7 +202,7 @@ public class VanHalter extends Quest SpawnTable.getInstance().addNewSpawn(tempSpawn, false); _cameraMarkerSpawn.put(3, tempSpawn); - tempSpawn = new Spawn(template1); + tempSpawn = new Spawn(template); tempSpawn.setX(-16397); tempSpawn.setY(-55200); tempSpawn.setZ(-9394); @@ -219,7 +212,7 @@ public class VanHalter extends Quest SpawnTable.getInstance().addNewSpawn(tempSpawn, false); _cameraMarkerSpawn.put(4, tempSpawn); - tempSpawn = new Spawn(template1); + tempSpawn = new Spawn(template); tempSpawn.setX(-16397); tempSpawn.setY(-55197); tempSpawn.setZ(-8739); @@ -231,7 +224,7 @@ public class VanHalter extends Quest } catch (Exception e) { - LOGGER.warning("VanHalterManager : " + e.getMessage() + " :" + e); + LOGGER.warning("VanHalter : " + e.getMessage() + " :" + e); } // Set time up. @@ -241,7 +234,7 @@ public class VanHalter extends Quest } _timeUpTask = ThreadPool.schedule(new TimeUp(), Config.HPH_ACTIVITYTIMEOFHALTER); - // Set bleeding to palyers. + // Set bleeding to players. if (_setBleedTask != null) { _setBleedTask.cancel(false); @@ -289,7 +282,6 @@ public class VanHalter extends Quest return super.onKill(npc, killer, isPet); } - // Load Royal Guard. protected void loadRoyalGuard() { _royalGuardSpawn.clear(); @@ -321,7 +313,7 @@ public class VanHalter extends Quest } else { - LOGGER.warning("VanHalterManager.loadRoyalGuard: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); + LOGGER.warning("VanHalter.loadRoyalGuard: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); } } @@ -330,8 +322,8 @@ public class VanHalter extends Quest } catch (Exception e) { - // Problem with initializing spawn, go to next one - LOGGER.warning("VanHalterManager.loadRoyalGuard: Spawn could not be initialized: " + e); + // Problem with initializing spawn, go to next one. + LOGGER.warning("VanHalter.loadRoyalGuard: Spawn could not be initialized: " + e); } } @@ -360,7 +352,6 @@ public class VanHalter extends Quest _royalGuard.clear(); } - // Load Triol's Revelation. protected void loadTriolRevelation() { _triolRevelationSpawn.clear(); @@ -392,7 +383,7 @@ public class VanHalter extends Quest } else { - LOGGER.warning("VanHalterManager.loadTriolRevelation: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); + LOGGER.warning("VanHalter.loadTriolRevelation: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); } } @@ -401,8 +392,8 @@ public class VanHalter extends Quest } catch (Exception e) { - // Problem with initializing spawn, go to next one - LOGGER.warning("VanHalterManager.loadTriolRevelation: Spawn could not be initialized: " + e); + // Problem with initializing spawn, go to next one. + LOGGER.warning("VanHalter.loadTriolRevelation: Spawn could not be initialized: " + e); } } @@ -435,7 +426,6 @@ public class VanHalter extends Quest _bleedingPlayers.clear(); } - // Load Royal Guard Captain. protected void loadRoyalGuardCaptain() { _royalGuardCaptainSpawn.clear(); @@ -466,7 +456,7 @@ public class VanHalter extends Quest } else { - LOGGER.warning("VanHalterManager.loadRoyalGuardCaptain: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); + LOGGER.warning("VanHalter.loadRoyalGuardCaptain: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); } } @@ -475,8 +465,8 @@ public class VanHalter extends Quest } catch (Exception e) { - // Problem with initializing spawn, go to next one - LOGGER.warning("VanHalterManager.loadRoyalGuardCaptain: Spawn could not be initialized: " + e); + // Problem with initializing spawn, go to next one. + LOGGER.warning("VanHalter.loadRoyalGuardCaptain: Spawn could not be initialized: " + e); } } @@ -505,7 +495,6 @@ public class VanHalter extends Quest _royalGuardCaptain.clear(); } - // Load Royal Guard Helper. protected void loadRoyalGuardHelper() { _royalGuardHelperSpawn.clear(); @@ -536,7 +525,7 @@ public class VanHalter extends Quest } else { - LOGGER.warning("VanHalterManager.loadRoyalGuardHelper: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); + LOGGER.warning("VanHalter.loadRoyalGuardHelper: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); } } @@ -545,8 +534,8 @@ public class VanHalter extends Quest } catch (Exception e) { - // Problem with initializing spawn, go to next one - LOGGER.warning("VanHalterManager.loadRoyalGuardHelper: Spawn could not be initialized: " + e); + // Problem with initializing spawn, go to next one. + LOGGER.warning("VanHalter.loadRoyalGuardHelper: Spawn could not be initialized: " + e); } } @@ -569,7 +558,6 @@ public class VanHalter extends Quest _royalGuardHepler.clear(); } - // Load Guard Of Altar protected void loadGuardOfAltar() { _guardOfAltarSpawn.clear(); @@ -600,7 +588,7 @@ public class VanHalter extends Quest } else { - LOGGER.warning("VanHalterManager.loadGuardOfAltar: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); + LOGGER.warning("VanHalter.loadGuardOfAltar: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); } } @@ -609,8 +597,8 @@ public class VanHalter extends Quest } catch (Exception e) { - // Problem with initializing spawn, go to next one - LOGGER.warning("VanHalterManager.loadGuardOfAltar: Spawn could not be initialized: " + e); + // Problem with initializing spawn, go to next one. + LOGGER.warning("VanHalter.loadGuardOfAltar: Spawn could not be initialized: " + e); } } @@ -639,7 +627,6 @@ public class VanHalter extends Quest _guardOfAltar.clear(); } - // Load High Priestess van Halter. protected void loadVanHalter() { _vanHalterSpawn = null; @@ -670,7 +657,7 @@ public class VanHalter extends Quest } else { - LOGGER.warning("VanHalterManager.loadVanHalter: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); + LOGGER.warning("VanHalter.loadVanHalter: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); } } @@ -679,8 +666,8 @@ public class VanHalter extends Quest } catch (Exception e) { - // Problem with initializing spawn, go to next one - LOGGER.warning("VanHalterManager.loadVanHalter: Spawn could not be initialized: " + e); + // Problem with initializing spawn, go to next one. + LOGGER.warning("VanHalter.loadVanHalter: Spawn could not be initialized: " + e); } } @@ -700,7 +687,6 @@ public class VanHalter extends Quest _vanHalter.deleteMe(); } - // Load Ritual Offering. protected void loadRitualOffering() { _ritualOfferingSpawn = null; @@ -731,7 +717,7 @@ public class VanHalter extends Quest } else { - LOGGER.warning("VanHalterManager.loadRitualOffering: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); + LOGGER.warning("VanHalter.loadRitualOffering: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); } } @@ -740,8 +726,8 @@ public class VanHalter extends Quest } catch (Exception e) { - // Problem with initializing spawn, go to next one - LOGGER.warning("VanHalterManager.loadRitualOffering: Spawn could not be initialized: " + e); + // Problem with initializing spawn, go to next one. + LOGGER.warning("VanHalter.loadRitualOffering: Spawn could not be initialized: " + e); } } @@ -762,7 +748,6 @@ public class VanHalter extends Quest _ritualOffering.deleteMe(); } - // Load Ritual Sacrifice. protected void loadRitualSacrifice() { _ritualSacrificeSpawn = null; @@ -793,7 +778,7 @@ public class VanHalter extends Quest } else { - LOGGER.warning("VanHalterManager.loadRitualSacrifice: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); + LOGGER.warning("VanHalter.loadRitualSacrifice: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + "."); } } @@ -802,8 +787,8 @@ public class VanHalter extends Quest } catch (Exception e) { - // Problem with initializing spawn, go to next one - LOGGER.warning("VanHalterManager.loadRitualSacrifice: Spawn could not be initialized: " + e); + // Problem with initializing spawn, go to next one. + LOGGER.warning("VanHalter.loadRitualSacrifice: Spawn could not be initialized: " + e); } } @@ -971,7 +956,6 @@ public class VanHalter extends Quest } } - // event public void checkTriolRevelationDestroy() { if (_isCaptainSpawned) @@ -1018,7 +1002,6 @@ public class VanHalter extends Quest _movieTask = ThreadPool.schedule(new Movie(1), Config.HPH_APPTIMEOFHALTER); } - // Start fight against High Priestess van Halter. protected void combatBeginning() { if (_timeUpTask != null) @@ -1038,7 +1021,6 @@ public class VanHalter extends Quest _vanHalter.reduceCurrentHp(1, targets.get(Rnd.get(1, i))); } - // Call Royal Guard Helper and escape from player. public void callRoyalGuardHelper() { if (!_isHelperCalled) @@ -1136,7 +1118,6 @@ public class VanHalter extends Quest } } - // Check bleeding player. protected void addBleeding() { final Skill bleed = SkillTable.getInstance().getSkill(4615, 12); @@ -1194,10 +1175,9 @@ public class VanHalter extends Quest } } - // High Priestess van Halter dead or time up. public void enterInterval() { - // Cancel all task + // Cancel all task. if (_callRoyalGuardHelperTask != null) { _callRoyalGuardHelperTask.cancel(false); @@ -1246,7 +1226,7 @@ public class VanHalter extends Quest } _timeUpTask = null; - // Delete monsters + // Delete monsters. if (_vanHalter.isDead()) { _vanHalter.getSpawn().stopRespawn(); @@ -1283,7 +1263,6 @@ public class VanHalter extends Quest _intervalTask = ThreadPool.schedule(new Interval(), temp); } - // Interval. protected class Interval implements Runnable { @Override @@ -1293,10 +1272,9 @@ public class VanHalter extends Quest } } - // Interval end. public void setupAltar() { - // Cancel all task + // Cancel all tasks. if (_callRoyalGuardHelperTask != null) { _callRoyalGuardHelperTask.cancel(false); @@ -1345,7 +1323,7 @@ public class VanHalter extends Quest } _timeUpTask = null; - // Delete all monsters + // Delete all monsters. deleteVanHalter(); deleteTriolRevelation(); deleteRoyalGuardHepler(); @@ -1362,7 +1340,7 @@ public class VanHalter extends Quest _isHelperCalled = false; _isHalterSpawned = false; - // Set door state + // Set door state. closeDoorOfSacrifice(); openDoorOfAltar(true); @@ -1382,7 +1360,6 @@ public class VanHalter extends Quest _timeUpTask = ThreadPool.schedule(new TimeUp(), Config.HPH_ACTIVITYTIMEOFHALTER); } - // Time up. protected class TimeUp implements Runnable { @Override @@ -1392,7 +1369,6 @@ public class VanHalter extends Quest } } - // Appearance movie. private class Movie implements Runnable { private static final int DISTANCE = 6502500; diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Zaken.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Zaken.java index 4f15f1a0f7..5dc6cce784 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Zaken.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Zaken.java @@ -47,6 +47,10 @@ public class Zaken extends Quest { protected static final Logger LOGGER = Logger.getLogger(Zaken.class.getName()); + // Zaken status + private static final byte ALIVE = 0; // Zaken is spawned. + private static final byte DEAD = 1; // Zaken has been killed. + // NPCs private static final int ZAKEN = 29022; private static final int DOLL_BLADER_B = 29023; private static final int VALE_MASTER_B = 29024; @@ -106,31 +110,28 @@ public class Zaken extends Quest -2944, -2944 }; - // Zaken status tracking - private static final byte ALIVE = 0; // Zaken is spawned. - private static final byte DEAD = 1; // Zaken has been killed. // Misc private static BossZone _zone; - private int _1001 = 0; // used for first cancel of QuestTimer "1001" - private int _ai0 = 0; // used for zaken coords updater - private int _ai1 = 0; // used for X coord tracking for non-random teleporting in zaken's self teleport skill - private int _ai2 = 0; // used for Y coord tracking for non-random teleporting in zaken's self teleport skill - private int _ai3 = 0; // used for Z coord tracking for non-random teleporting in zaken's self teleport skill - private int _ai4 = 0; // used for spawning minions cycles - private int _quest0 = 0; // used for teleporting progress - private int _quest1 = 0; // used for most hated players progress - private int _quest2 = 0; // used for zaken HP check for teleport - private PlayerInstance c_quest0 = null; // 1st player used for area teleport - private PlayerInstance c_quest1 = null; // 2nd player used for area teleport - private PlayerInstance c_quest2 = null; // 3rd player used for area teleport - private PlayerInstance c_quest3 = null; // 4th player used for area teleport - private PlayerInstance c_quest4 = null; // 5th player used for area teleport + private int _1001 = 0; // Used for first cancel of QuestTimer "1001". + private int _ai0 = 0; // Used for zaken coords updater. + private int _ai1 = 0; // Used for X coord tracking for non-random teleporting in zaken's self teleport skill. + private int _ai2 = 0; // Used for Y coord tracking for non-random teleporting in zaken's self teleport skill. + private int _ai3 = 0; // Used for Z coord tracking for non-random teleporting in zaken's self teleport skill. + private int _ai4 = 0; // Used for spawning minions cycles. + private int _quest0 = 0; // Used for teleporting progress. + private int _quest1 = 0; // Used for most hated players progress. + private int _quest2 = 0; // Used for zaken HP check for teleport. + private PlayerInstance c_quest0 = null; // 1st player used for area teleport. + private PlayerInstance c_quest1 = null; // 2nd player used for area teleport. + private PlayerInstance c_quest2 = null; // 3rd player used for area teleport. + private PlayerInstance c_quest3 = null; // 4th player used for area teleport. + private PlayerInstance c_quest4 = null; // 5th player used for area teleport. public Zaken() { super(-1, "ai/bosses"); - // Zaken doors handling + // Zaken doors handling. ThreadPool.scheduleAtFixedRate(() -> { try @@ -168,17 +169,17 @@ public class Zaken extends Quest final Integer status = GrandBossManager.getInstance().getBossStatus(ZAKEN); if (status == DEAD) { - // load the unlock date and time for zaken from DB + // Load the unlock date and time for zaken from DB. final long temp = info.getLong("respawn_time") - Chronos.currentTimeMillis(); - // if zaken is locked until a certain time, mark it so and start the unlock timer - // the unlock time has not yet expired. + // If Zaken is locked until a certain time, mark it so and start the unlock timer. + // The unlock time has not yet expired. if (temp > 0) { startQuestTimer("zaken_unlock", temp, null, null); } else { - // the time has already expired while the server was offline. Immediately spawn zaken. + // The time has already expired while the server was offline. Immediately spawn Zaken. final GrandBossInstance zaken = (GrandBossInstance) addSpawn(ZAKEN, 55312, 219168, -3223, 0, false, 0); GrandBossManager.getInstance().setBossStatus(ZAKEN, ALIVE); spawnBoss(zaken); @@ -186,13 +187,13 @@ public class Zaken extends Quest } else { - final int loc_x = info.getInt("loc_x"); - final int loc_y = info.getInt("loc_y"); - final int loc_z = info.getInt("loc_z"); + final int x = info.getInt("loc_x"); + final int y = info.getInt("loc_y"); + final int z = info.getInt("loc_z"); final int heading = info.getInt("heading"); final int hp = info.getInt("currentHP"); final int mp = info.getInt("currentMP"); - final GrandBossInstance zaken = (GrandBossInstance) addSpawn(ZAKEN, loc_x, loc_y, loc_z, heading, false, 0); + final GrandBossInstance zaken = (GrandBossInstance) addSpawn(ZAKEN, x, y, z, heading, false, 0); zaken.setCurrentHpMp(hp, mp); spawnBoss(zaken); } @@ -225,7 +226,7 @@ public class Zaken extends Quest } if (getTimeHour() < 5) { - if (sk4223 == 1) // use night face if zaken have day face + if (sk4223 == 1) // Use night face if Zaken have day face. { npc.setTarget(npc); npc.doCast(SkillTable.getInstance().getSkill(4224, 1)); @@ -233,7 +234,7 @@ public class Zaken extends Quest _ai2 = npc.getY(); _ai3 = npc.getZ(); } - if (sk4227 == 0) // use zaken regeneration + if (sk4227 == 0) // Use Zaken regeneration. { npc.setTarget(npc); npc.doCast(SkillTable.getInstance().getSkill(4227, 1)); @@ -405,13 +406,13 @@ public class Zaken extends Quest _quest1 = 0; } } - else if (sk4223 == 0) // use day face if not night time + else if (sk4223 == 0) // Use day face if not night time. { npc.setTarget(npc); npc.doCast(SkillTable.getInstance().getSkill(4223, 1)); _quest2 = 3; } - if (sk4227 == 1) // when switching to day time, cancel zaken night regen + if (sk4227 == 1) // When switching to day time, cancel zaken night regen. { npc.setTarget(npc); npc.doCast(SkillTable.getInstance().getSkill(4242, 1)); @@ -442,131 +443,131 @@ public class Zaken extends Quest case 1: { final int rr = Rnd.get(15); - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, X_COORDS[rr] + Rnd.get(650), Y_COORDS[rr] + Rnd.get(650), Z_COORDS[rr], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, X_COORDS[rr] + Rnd.get(650), Y_COORDS[rr] + Rnd.get(650), Z_COORDS[rr], Rnd.get(65536), false, 0); _ai4 = 2; break; } case 2: { final int rr = Rnd.get(15); - addSpawn(DOLL_BLADER_B, X_COORDS[rr] + Rnd.get(650), Y_COORDS[rr] + Rnd.get(650), Z_COORDS[rr], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(DOLL_BLADER_B, X_COORDS[rr] + Rnd.get(650), Y_COORDS[rr] + Rnd.get(650), Z_COORDS[rr], Rnd.get(65536), false, 0); _ai4 = 3; break; } case 3: { - addSpawn(VALE_MASTER_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(VALE_MASTER_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); _ai4 = 4; break; } case 4: { - addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, X_COORDS[Rnd.get(15)] + Rnd.get(650), Y_COORDS[Rnd.get(15)] + Rnd.get(650), Z_COORDS[Rnd.get(15)], Rnd.get(65536), false, 0); _ai4 = 5; break; } case 5: { - addSpawn(DOLL_BLADER_B, 52675, 219371, -3290, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 52687, 219596, -3368, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 52672, 219740, -3418, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 52857, 219992, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 52959, 219997, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 53381, 220151, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54236, 220948, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54885, 220144, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55264, 219860, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55399, 220263, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55679, 220129, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 56276, 220783, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 57173, 220234, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 56267, 218826, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56294, 219482, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56094, 219113, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56364, 218967, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 57113, 218079, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56186, 217153, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55440, 218081, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55202, 217940, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55225, 218236, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54973, 218075, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 53412, 218077, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54226, 218797, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54394, 219067, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54139, 219253, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 54262, 219480, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(DOLL_BLADER_B, 52675, 219371, -3290, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 52687, 219596, -3368, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 52672, 219740, -3418, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 52857, 219992, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 52959, 219997, -3488, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 53381, 220151, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54236, 220948, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54885, 220144, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55264, 219860, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55399, 220263, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55679, 220129, -3488, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 56276, 220783, -3488, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 57173, 220234, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 56267, 218826, -3488, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56294, 219482, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56094, 219113, -3488, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56364, 218967, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 57113, 218079, -3488, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56186, 217153, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55440, 218081, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55202, 217940, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55225, 218236, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54973, 218075, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 53412, 218077, -3488, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54226, 218797, -3488, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54394, 219067, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54139, 219253, -3488, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 54262, 219480, -3488, Rnd.get(65536), false, 0); _ai4 = 6; break; } case 6: { - addSpawn(PIRATES_ZOMBIE_B, 53412, 218077, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54413, 217132, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 54841, 217132, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 55372, 217128, -3343, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 55893, 217122, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56282, 217237, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 56963, 218080, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 56267, 218826, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56294, 219482, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56094, 219113, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56364, 218967, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 56276, 220783, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 57173, 220234, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54885, 220144, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55264, 219860, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55399, 220263, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55679, 220129, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54236, 220948, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54464, 219095, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54226, 218797, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54394, 219067, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54139, 219253, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 54262, 219480, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 53412, 218077, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55440, 218081, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55202, 217940, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55225, 218236, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54973, 218075, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(PIRATES_ZOMBIE_B, 53412, 218077, -3488, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54413, 217132, -3488, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 54841, 217132, -3488, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 55372, 217128, -3343, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 55893, 217122, -3488, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56282, 217237, -3216, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 56963, 218080, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 56267, 218826, -3216, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56294, 219482, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56094, 219113, -3216, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56364, 218967, -3216, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 56276, 220783, -3216, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 57173, 220234, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54885, 220144, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55264, 219860, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55399, 220263, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55679, 220129, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54236, 220948, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54464, 219095, -3216, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54226, 218797, -3216, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54394, 219067, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54139, 219253, -3216, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 54262, 219480, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 53412, 218077, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55440, 218081, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55202, 217940, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55225, 218236, -3216, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54973, 218075, -3216, Rnd.get(65536), false, 0); _ai4 = 7; break; } case 7: { - addSpawn(PIRATES_ZOMBIE_B, 54228, 217504, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54181, 217168, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 54714, 217123, -3168, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 55298, 217127, -3073, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 55787, 217130, -2993, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56284, 217216, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 56963, 218080, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 56267, 218826, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56294, 219482, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56094, 219113, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 56364, 218967, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 56276, 220783, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 57173, 220234, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54885, 220144, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55264, 219860, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55399, 220263, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55679, 220129, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54236, 220948, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54464, 219095, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54226, 218797, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(VALE_MASTER_B, 54394, 219067, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54139, 219253, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(DOLL_BLADER_B, 54262, 219480, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 53412, 218077, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54280, 217200, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55440, 218081, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55202, 217940, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 55225, 218236, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; - addSpawn(PIRATES_ZOMBIE_B, 54973, 218075, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */; + addSpawn(PIRATES_ZOMBIE_B, 54228, 217504, -3216, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54181, 217168, -3216, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 54714, 217123, -3168, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 55298, 217127, -3073, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 55787, 217130, -2993, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56284, 217216, -2944, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 56963, 218080, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 56267, 218826, -2944, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56294, 219482, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 56094, 219113, -2944, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 56364, 218967, -2944, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 56276, 220783, -2944, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 57173, 220234, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54885, 220144, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55264, 219860, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55399, 220263, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55679, 220129, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54236, 220948, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54464, 219095, -2944, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54226, 218797, -2944, Rnd.get(65536), false, 0); + addSpawn(VALE_MASTER_B, 54394, 219067, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54139, 219253, -2944, Rnd.get(65536), false, 0); + addSpawn(DOLL_BLADER_B, 54262, 219480, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 53412, 218077, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 54280, 217200, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55440, 218081, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_CAPTAIN_B, 55202, 217940, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 55225, 218236, -2944, Rnd.get(65536), false, 0); + addSpawn(PIRATES_ZOMBIE_B, 54973, 218075, -2944, Rnd.get(65536), false, 0); _ai4 = 8; cancelQuestTimer("1003", null, null); break; @@ -586,7 +587,7 @@ public class Zaken extends Quest } case "CreateOnePrivateEx": { - addSpawn(npc.getNpcId(), npc.getX(), npc.getY(), npc.getZ(), 0, false, 0)/* .setIsRaidMinion(true) */; + addSpawn(npc.getNpcId(), npc.getX(), npc.getY(), npc.getZ(), 0, false, 0); break; } } @@ -605,7 +606,7 @@ public class Zaken extends Quest final int callerId = caller.getNpcId(); if ((getTimeHour() < 5) && (callerId != ZAKEN) && (npcId == ZAKEN)) { - final int damage = 0; // well damage required :x + final int damage = 0; if ((npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE) && (_ai0 == 0) && (damage < 10) && (Rnd.get((30 * 15)) < 1))// todo - damage missing { _ai0 = 1; @@ -833,12 +834,12 @@ public class Zaken extends Quest { npc.broadcastPacket(new PlaySound(1, "BS02_D", npc)); GrandBossManager.getInstance().setBossStatus(ZAKEN, DEAD); - // time is 36hour +/- 17hour + // Time is 36hour +/- 17hour. final long respawnTime = (Config.ZAKEN_RESP_FIRST + Rnd.get(Config.ZAKEN_RESP_SECOND)) * 3600000; startQuestTimer("zaken_unlock", respawnTime, null, null); cancelQuestTimer("1001", npc, null); cancelQuestTimer("1003", npc, null); - // also save the respawn time so that the info is maintained past reboots + // Also save the respawn time so that the info is maintained past reboots. final StatSet info = GrandBossManager.getInstance().getStatSet(ZAKEN); info.set("respawn_time", Chronos.currentTimeMillis() + respawnTime); GrandBossManager.getInstance().setStatSet(ZAKEN, info); @@ -964,7 +965,7 @@ public class Zaken extends Quest startQuestTimer("1003", 1700, null, null); } _1001 = 1; - startQuestTimer("1001", 1000, npc, null); // buffs,random teleports + startQuestTimer("1001", 1000, npc, null); // Buffs, random teleports. } public int getTimeHour() diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/quest/Quest.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/quest/Quest.java index c015ebb6f3..aae93fcea3 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/quest/Quest.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/quest/Quest.java @@ -1733,7 +1733,7 @@ public class Quest extends ManagedScript * @param mobs * @see #registerMobs(int[], EventType...) */ - public void registerMobs(int[] mobs) + public void registerMobs(int... mobs) { for (int id : mobs) {