Added missing final modifiers.
This commit is contained in:
@@ -59,13 +59,13 @@ public final class Anais extends AbstractNpcAI
|
||||
|
||||
private void burnerOnAttack(int pot, L2Npc anais)
|
||||
{
|
||||
L2Npc npc = _divineBurners.get(pot);
|
||||
final L2Npc npc = _divineBurners.get(pot);
|
||||
npc.setDisplayEffect(1);
|
||||
npc.setIsRunning(false);
|
||||
if (pot < 4)
|
||||
{
|
||||
_current = npc;
|
||||
QuestTimer checkAround = getQuestTimer("CHECK", anais, null);
|
||||
final QuestTimer checkAround = getQuestTimer("CHECK", anais, null);
|
||||
if (checkAround == null) // || !checkAround.getIsActive()
|
||||
{
|
||||
startQuestTimer("CHECK", 3000, anais, null);
|
||||
@@ -101,7 +101,7 @@ public final class Anais extends AbstractNpcAI
|
||||
_pot = _pot + 1;
|
||||
b.setDisplayEffect(1);
|
||||
b.setIsRunning(false);
|
||||
L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0);
|
||||
final L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0);
|
||||
((L2Attackable) ward).addDamageHate(_nextTarget, 0, 999);
|
||||
ward.setIsRunning(true);
|
||||
ward.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _nextTarget, null);
|
||||
|
@@ -682,7 +682,7 @@ public final class Antharas extends AbstractNpcAI
|
||||
zone.broadcastPacket(new SpecialCamera(npc, 1200, 20, -10, 0, 10000, 13000, 0, 0, 0, 0, 0));
|
||||
zone.broadcastPacket(new PlaySound("BS01_D"));
|
||||
addSpawn(CUBE, 177615, 114941, -7709, 0, false, 900000);
|
||||
long respawnTime = (Config.ANTHARAS_SPAWN_INTERVAL + getRandom(-Config.ANTHARAS_SPAWN_RANDOM, Config.ANTHARAS_SPAWN_RANDOM)) * 3600000;
|
||||
final long respawnTime = (Config.ANTHARAS_SPAWN_INTERVAL + getRandom(-Config.ANTHARAS_SPAWN_RANDOM, Config.ANTHARAS_SPAWN_RANDOM)) * 3600000;
|
||||
setRespawn(respawnTime);
|
||||
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
|
||||
cancelQuestTimer("SET_REGEN", npc, null);
|
||||
|
@@ -254,7 +254,7 @@ public final class Baium extends AbstractNpcAI
|
||||
}
|
||||
else
|
||||
{
|
||||
L2PcInstance randomPlayer = getRandomPlayer(npc);
|
||||
final L2PcInstance randomPlayer = getRandomPlayer(npc);
|
||||
if (randomPlayer != null)
|
||||
{
|
||||
randomPlayer.teleToLocation(BAIUM_GIFT_LOC);
|
||||
@@ -305,7 +305,7 @@ public final class Baium extends AbstractNpcAI
|
||||
}
|
||||
else
|
||||
{
|
||||
L2PcInstance randomPlayer = getRandomPlayer(npc);
|
||||
final L2PcInstance randomPlayer = getRandomPlayer(npc);
|
||||
if (randomPlayer != null)
|
||||
{
|
||||
addAttackPlayerDesire(npc, randomPlayer);
|
||||
@@ -556,7 +556,7 @@ public final class Baium extends AbstractNpcAI
|
||||
setStatus(DEAD);
|
||||
addSpawn(TELE_CUBE, TELEPORT_CUBIC_LOC, false, 900000);
|
||||
zone.broadcastPacket(new PlaySound("BS01_D"));
|
||||
long respawnTime = (Config.BAIUM_SPAWN_INTERVAL + getRandom(-Config.BAIUM_SPAWN_RANDOM, Config.BAIUM_SPAWN_RANDOM)) * 3600000;
|
||||
final long respawnTime = (Config.BAIUM_SPAWN_INTERVAL + getRandom(-Config.BAIUM_SPAWN_RANDOM, Config.BAIUM_SPAWN_RANDOM)) * 3600000;
|
||||
setRespawn(respawnTime);
|
||||
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
|
||||
startQuestTimer("CLEAR_ZONE", 900000, null, null);
|
||||
|
@@ -106,8 +106,8 @@ public final class Beleth extends AbstractNpcAI
|
||||
addStartNpc(STONE_COFFIN);
|
||||
addTalkId(STONE_COFFIN);
|
||||
addFirstTalkId(ELF);
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH);
|
||||
int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH);
|
||||
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
|
||||
if (status == DEAD)
|
||||
{
|
||||
final long time = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
@@ -247,9 +247,9 @@ public final class Beleth extends AbstractNpcAI
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
int x = (int) ((150 * Math.cos(i * 1.046666667)) + 16323);
|
||||
int y = (int) ((150 * Math.sin(i * 1.046666667)) + 213059);
|
||||
L2Npc minion = addSpawn(FAKE_BELETH, new Location(x, y, -9357, 49152));
|
||||
final int x = (int) ((150 * Math.cos(i * 1.046666667)) + 16323);
|
||||
final int y = (int) ((150 * Math.sin(i * 1.046666667)) + 213059);
|
||||
final L2Npc minion = addSpawn(FAKE_BELETH, new Location(x, y, -9357, 49152));
|
||||
minion.setShowSummonAnimation(true);
|
||||
minion.decayMe();
|
||||
|
||||
@@ -391,8 +391,8 @@ public final class Beleth extends AbstractNpcAI
|
||||
{
|
||||
a++;
|
||||
|
||||
int x = (int) ((650 * Math.cos(i * 0.39)) + 16323);
|
||||
int y = (int) ((650 * Math.sin(i * 0.39)) + 213170);
|
||||
final int x = (int) ((650 * Math.cos(i * 0.39)) + 16323);
|
||||
final int y = (int) ((650 * Math.sin(i * 0.39)) + 213170);
|
||||
|
||||
npc = addSpawn(FAKE_BELETH, new Location(x, y, -9357, 49152));
|
||||
_minions.add(npc);
|
||||
@@ -404,8 +404,8 @@ public final class Beleth extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
int[] xm = new int[16];
|
||||
int[] ym = new int[16];
|
||||
final int[] xm = new int[16];
|
||||
final int[] ym = new int[16];
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
xm[i] = (int) ((1700 * Math.cos((i * 1.57) + 0.78)) + 16323);
|
||||
@@ -523,7 +523,7 @@ public final class Beleth extends AbstractNpcAI
|
||||
ZONE.broadcastPacket(new SpecialCamera(_camera2, 800, 180, 0, 0, 4000, 0, 10, 1, 0, 0));
|
||||
ZONE.broadcastPacket(new SpecialCamera(_camera2, 800, 180, 0, 0, 4000, 0, 10, 1, 0, 0));
|
||||
|
||||
L2DoorInstance door2 = DoorData.getInstance().getDoor(DOOR2);
|
||||
final L2DoorInstance door2 = DoorData.getInstance().getDoor(DOOR2);
|
||||
door2.openMe();
|
||||
|
||||
ZONE.broadcastPacket(new StaticObject(door2, false));
|
||||
@@ -639,8 +639,8 @@ public final class Beleth extends AbstractNpcAI
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
||||
double speed = npc.isRunning() ? npc.getRunSpeed() : npc.getWalkSpeed();
|
||||
int time = (int) (((distance2 - 890) / speed) * 1000);
|
||||
final double speed = npc.isRunning() ? npc.getRunSpeed() : npc.getWalkSpeed();
|
||||
final int time = (int) (((distance2 - 890) / speed) * 1000);
|
||||
startQuestTimer("CAST", time, npc, null);
|
||||
}
|
||||
else if (distance2 < 890)
|
||||
@@ -759,7 +759,7 @@ public final class Beleth extends AbstractNpcAI
|
||||
setBelethKiller(killer);
|
||||
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
|
||||
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(REAL_BELETH, info);
|
||||
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
|
||||
|
@@ -69,7 +69,7 @@ public final class Core extends AbstractNpcAI
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for Core from DB
|
||||
long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
final long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
// if Core is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
@@ -79,7 +79,7 @@ public final class Core extends AbstractNpcAI
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn Core.
|
||||
L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
final L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
|
||||
spawnBoss(core);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public final class Core extends AbstractNpcAI
|
||||
}
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int x = 16800 + (i * 450);
|
||||
final int x = 16800 + (i * 450);
|
||||
mob = (L2Attackable) addSpawn(SUSCEPTOR, x, 110300, npc.getZ(), 280 + getRandom(40), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_minions.add(mob);
|
||||
@@ -143,13 +143,13 @@ public final class Core extends AbstractNpcAI
|
||||
{
|
||||
if (event.equalsIgnoreCase("core_unlock"))
|
||||
{
|
||||
L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
final L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
|
||||
spawnBoss(core);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("spawn_minion"))
|
||||
{
|
||||
L2Attackable mob = (L2Attackable) addSpawn(npc.getId(), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
final L2Attackable mob = (L2Attackable) addSpawn(npc.getId(), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_minions.add(mob);
|
||||
}
|
||||
@@ -188,7 +188,7 @@ public final class Core extends AbstractNpcAI
|
||||
{
|
||||
if (npc.getId() == CORE)
|
||||
{
|
||||
int objId = npc.getObjectId();
|
||||
final int objId = npc.getObjectId();
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, objId, npc.getX(), npc.getY(), npc.getZ()));
|
||||
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.A_FATAL_ERROR_HAS_OCCURRED));
|
||||
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SYSTEM_IS_BEING_SHUT_DOWN));
|
||||
@@ -197,10 +197,10 @@ public final class Core extends AbstractNpcAI
|
||||
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, DEAD);
|
||||
// Calculate Min and Max respawn times randomly.
|
||||
long respawnTime = (Config.CORE_SPAWN_INTERVAL + getRandom(-Config.CORE_SPAWN_RANDOM, Config.CORE_SPAWN_RANDOM)) * 3600000;
|
||||
final long respawnTime = (Config.CORE_SPAWN_INTERVAL + getRandom(-Config.CORE_SPAWN_RANDOM, Config.CORE_SPAWN_RANDOM)) * 3600000;
|
||||
startQuestTimer("core_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||
GrandBossManager.getInstance().setStatsSet(CORE, info);
|
||||
startQuestTimer("despawn_minions", 20000, null, null);
|
||||
|
@@ -49,7 +49,7 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
||||
private DarkWaterDragon()
|
||||
{
|
||||
super(DarkWaterDragon.class.getSimpleName(), "ai/individual");
|
||||
int[] mobs =
|
||||
final int[] mobs =
|
||||
{
|
||||
DRAGON,
|
||||
SHADE1,
|
||||
@@ -144,15 +144,15 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
int npcObjId = npc.getObjectId();
|
||||
final int npcId = npc.getId();
|
||||
final int npcObjId = npc.getObjectId();
|
||||
if (npcId == DRAGON)
|
||||
{
|
||||
if (!MY_TRACKING_SET.contains(npcObjId)) // this allows to handle multiple instances of npc
|
||||
{
|
||||
MY_TRACKING_SET.add(npcObjId);
|
||||
// Spawn first 5 shades on first attack on Dark Water Dragon
|
||||
L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
final L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
spawnShade(originalAttacker, SHADE1, npc.getX() + 100, npc.getY() + 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE2, npc.getX() + 100, npc.getY() - 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE1, npc.getX() - 100, npc.getY() + 100, npc.getZ());
|
||||
@@ -163,7 +163,7 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
||||
{
|
||||
SECOND_SPAWN.add(npcObjId);
|
||||
// Spawn second 5 shades on half hp of on Dark Water Dragon
|
||||
L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
final L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
spawnShade(originalAttacker, SHADE2, npc.getX() + 100, npc.getY() + 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE1, npc.getX() + 100, npc.getY() - 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE2, npc.getX() - 100, npc.getY() + 100, npc.getZ());
|
||||
@@ -177,13 +177,13 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
int npcObjId = npc.getObjectId();
|
||||
final int npcId = npc.getId();
|
||||
final int npcObjId = npc.getObjectId();
|
||||
if (npcId == DRAGON)
|
||||
{
|
||||
MY_TRACKING_SET.remove(npcObjId);
|
||||
SECOND_SPAWN.remove(npcObjId);
|
||||
L2Attackable faf = (L2Attackable) addSpawn(FAFURION, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0); // spawns Fafurion Kindred when Dard Water Dragon is dead
|
||||
final L2Attackable faf = (L2Attackable) addSpawn(FAFURION, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0); // spawns Fafurion Kindred when Dard Water Dragon is dead
|
||||
ID_MAP.put(faf.getObjectId(), killer);
|
||||
}
|
||||
else if (npcId == FAFURION)
|
||||
@@ -207,16 +207,16 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
int npcObjId = npc.getObjectId();
|
||||
final int npcId = npc.getId();
|
||||
final int npcObjId = npc.getObjectId();
|
||||
if (npcId == FAFURION)
|
||||
{
|
||||
if (!MY_TRACKING_SET.contains(npcObjId))
|
||||
{
|
||||
MY_TRACKING_SET.add(npcObjId);
|
||||
// Spawn 4 Detractors on spawn of Fafurion
|
||||
int x = npc.getX();
|
||||
int y = npc.getY();
|
||||
final int x = npc.getX();
|
||||
final int y = npc.getY();
|
||||
addSpawn(DETRACTOR2, x + 100, y + 100, npc.getZ(), 0, false, 40000);
|
||||
addSpawn(DETRACTOR1, x + 100, y - 100, npc.getZ(), 0, false, 40000);
|
||||
addSpawn(DETRACTOR2, x - 100, y + 100, npc.getZ(), 0, false, 40000);
|
||||
|
@@ -75,9 +75,9 @@ public final class Epidos extends AbstractNpcAI
|
||||
{
|
||||
if ((getRandom(1000) > 250) && _lastHp.containsKey(npc.getObjectId()))
|
||||
{
|
||||
int hpDecreasePercent = (int) (((_lastHp.get(npc.getObjectId()) - npc.getCurrentHp()) * 100) / npc.getMaxHp());
|
||||
final int hpDecreasePercent = (int) (((_lastHp.get(npc.getObjectId()) - npc.getCurrentHp()) * 100) / npc.getMaxHp());
|
||||
int minionsCount = 0;
|
||||
int spawnedMinions = ((L2MonsterInstance) npc).getMinionList().countSpawnedMinions();
|
||||
final int spawnedMinions = ((L2MonsterInstance) npc).getMinionList().countSpawnedMinions();
|
||||
|
||||
if ((hpDecreasePercent > 5) && (hpDecreasePercent <= 15) && (spawnedMinions <= 9))
|
||||
{
|
||||
|
@@ -81,7 +81,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
private Orfen()
|
||||
{
|
||||
super(Orfen.class.getSimpleName(), "ai/individual");
|
||||
int[] mobs =
|
||||
final int[] mobs =
|
||||
{
|
||||
ORFEN,
|
||||
RAIKEL_LEOS,
|
||||
@@ -90,12 +90,12 @@ public final class Orfen extends AbstractNpcAI
|
||||
registerMobs(mobs);
|
||||
_IsTeleported = false;
|
||||
ZONE = GrandBossManager.getInstance().getZone(POS[0]);
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||
int status = GrandBossManager.getInstance().getBossStatus(ORFEN);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||
final int status = GrandBossManager.getInstance().getBossStatus(ORFEN);
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for Orfen from DB
|
||||
long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
// if Orfen is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
@@ -105,7 +105,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn Orfen.
|
||||
int i = getRandom(10);
|
||||
final int i = getRandom(10);
|
||||
Location loc;
|
||||
if (i < 4)
|
||||
{
|
||||
@@ -119,20 +119,20 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
loc = POS[3];
|
||||
}
|
||||
L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc, false, 0);
|
||||
final L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(ORFEN, ALIVE);
|
||||
spawnBoss(orfen);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int loc_x = info.getInt("loc_x");
|
||||
int loc_y = info.getInt("loc_y");
|
||||
int loc_z = info.getInt("loc_z");
|
||||
int heading = info.getInt("heading");
|
||||
int hp = info.getInt("currentHP");
|
||||
int mp = info.getInt("currentMP");
|
||||
L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
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 heading = info.getInt("heading");
|
||||
final int hp = info.getInt("currentHP");
|
||||
final int mp = info.getInt("currentMP");
|
||||
final L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
orfen.setCurrentHpMp(hp, mp);
|
||||
spawnBoss(orfen);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
((L2Attackable) npc).clearAggroList();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);
|
||||
L2Spawn spawn = npc.getSpawn();
|
||||
final L2Spawn spawn = npc.getSpawn();
|
||||
spawn.setLocation(POS[index]);
|
||||
npc.teleToLocation(POS[index], false);
|
||||
}
|
||||
@@ -153,8 +153,8 @@ public final class Orfen extends AbstractNpcAI
|
||||
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
startQuestTimer("check_orfen_pos", 10000, npc, null, true);
|
||||
// Spawn minions
|
||||
int x = npc.getX();
|
||||
int y = npc.getY();
|
||||
final int x = npc.getX();
|
||||
final int y = npc.getY();
|
||||
L2Attackable mob;
|
||||
mob = (L2Attackable) addSpawn(RAIKEL_LEOS, x + 100, y + 100, npc.getZ(), 0, false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
@@ -176,7 +176,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
if (event.equalsIgnoreCase("orfen_unlock"))
|
||||
{
|
||||
int i = getRandom(10);
|
||||
final int i = getRandom(10);
|
||||
Location loc;
|
||||
if (i < 4)
|
||||
{
|
||||
@@ -190,7 +190,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
loc = POS[3];
|
||||
}
|
||||
L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc, false, 0);
|
||||
final L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(ORFEN, ALIVE);
|
||||
spawnBoss(orfen);
|
||||
}
|
||||
@@ -210,7 +210,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
for (int i = 0; i < MINIONS.size(); i++)
|
||||
{
|
||||
L2Attackable mob = MINIONS.get(i);
|
||||
final L2Attackable mob = MINIONS.get(i);
|
||||
if (!npc.isInsideRadius(mob, 3000, false, false))
|
||||
{
|
||||
mob.teleToLocation(npc.getLocation());
|
||||
@@ -223,7 +223,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
for (int i = 0; i < MINIONS.size(); i++)
|
||||
{
|
||||
L2Attackable mob = MINIONS.get(i);
|
||||
final L2Attackable mob = MINIONS.get(i);
|
||||
if (mob != null)
|
||||
{
|
||||
mob.decayMe();
|
||||
@@ -233,7 +233,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
}
|
||||
else if (event.equalsIgnoreCase("spawn_minion"))
|
||||
{
|
||||
L2Attackable mob = (L2Attackable) addSpawn(RAIKEL_LEOS, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0);
|
||||
final L2Attackable mob = (L2Attackable) addSpawn(RAIKEL_LEOS, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
MINIONS.add(mob);
|
||||
}
|
||||
@@ -245,10 +245,10 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
if (npc.getId() == ORFEN)
|
||||
{
|
||||
L2Character originalCaster = isSummon ? caster.getServitors().values().stream().findFirst().orElse(caster.getPet()) : caster;
|
||||
final L2Character originalCaster = isSummon ? caster.getServitors().values().stream().findFirst().orElse(caster.getPet()) : caster;
|
||||
if ((skill.getEffectPoint() > 0) && (getRandom(5) == 0) && npc.isInsideRadius(originalCaster, 1000, false, false))
|
||||
{
|
||||
NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), TEXT[getRandom(4)]);
|
||||
final NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), TEXT[getRandom(4)]);
|
||||
packet.addStringParameter(caster.getName().toString());
|
||||
npc.broadcastPacket(packet);
|
||||
originalCaster.teleToLocation(npc.getLocation());
|
||||
@@ -266,8 +266,8 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
return super.onFactionCall(npc, caller, attacker, isSummon);
|
||||
}
|
||||
int npcId = npc.getId();
|
||||
int callerId = caller.getId();
|
||||
final int npcId = npc.getId();
|
||||
final int callerId = caller.getId();
|
||||
if ((npcId == RAIKEL_LEOS) && (getRandom(20) == 0))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
@@ -293,7 +293,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
final int npcId = npc.getId();
|
||||
if (npcId == ORFEN)
|
||||
{
|
||||
if (!_IsTeleported && ((npc.getCurrentHp() - damage) < (npc.getMaxHp() / 2)))
|
||||
@@ -303,7 +303,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
}
|
||||
else if (npc.isInsideRadius(attacker, 1000, false, false) && !npc.isInsideRadius(attacker, 300, false, false) && (getRandom(10) == 0))
|
||||
{
|
||||
NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npcId, TEXT[getRandom(3)]);
|
||||
final NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npcId, TEXT[getRandom(3)]);
|
||||
packet.addStringParameter(attacker.getName().toString());
|
||||
npc.broadcastPacket(packet);
|
||||
attacker.teleToLocation(npc.getLocation());
|
||||
@@ -334,7 +334,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
respawnTime *= 3600000;
|
||||
startQuestTimer("orfen_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(ORFEN, info);
|
||||
cancelQuestTimer("check_minion_loc", npc, null);
|
||||
|
@@ -95,12 +95,12 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
addFactionCallId(NURSE);
|
||||
|
||||
_zone = GrandBossManager.getInstance().getZone(QUEEN_X, QUEEN_Y, QUEEN_Z);
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||
int status = GrandBossManager.getInstance().getBossStatus(QUEEN);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||
final int status = GrandBossManager.getInstance().getBossStatus(QUEEN);
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for queen ant from DB
|
||||
long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
// if queen ant is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
@@ -110,21 +110,21 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn queen ant.
|
||||
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
||||
final L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int loc_x = QUEEN_X;
|
||||
int loc_y = QUEEN_Y;
|
||||
int loc_z = QUEEN_Z;
|
||||
int heading = info.getInt("heading");
|
||||
int hp = info.getInt("currentHP");
|
||||
int mp = info.getInt("currentMP");
|
||||
final int loc_x = QUEEN_X;
|
||||
final int loc_y = QUEEN_Y;
|
||||
final int loc_z = QUEEN_Z;
|
||||
final int heading = info.getInt("heading");
|
||||
final int hp = info.getInt("currentHP");
|
||||
final int mp = info.getInt("currentMP");
|
||||
|
||||
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
final L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
queen.setCurrentHpMp(hp, mp);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
@@ -215,7 +215,7 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
}
|
||||
else if (event.equalsIgnoreCase("queen_unlock"))
|
||||
{
|
||||
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
||||
final L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
@@ -329,7 +329,7 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
final int npcId = npc.getId();
|
||||
if (npcId == QUEEN)
|
||||
{
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
@@ -341,7 +341,7 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
cancelQuestTimer("action", npc, null);
|
||||
cancelQuestTimer("heal", null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(QUEEN, info);
|
||||
_nurses.clear();
|
||||
@@ -358,7 +358,7 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
{
|
||||
if (npcId == ROYAL)
|
||||
{
|
||||
L2MonsterInstance mob = (L2MonsterInstance) npc;
|
||||
final L2MonsterInstance mob = (L2MonsterInstance) npc;
|
||||
if (mob.getLeader() != null)
|
||||
{
|
||||
mob.getLeader().getMinionList().onMinionDie(mob, (280 + getRandom(40)) * 1000);
|
||||
@@ -366,7 +366,7 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
}
|
||||
else if (npcId == NURSE)
|
||||
{
|
||||
L2MonsterInstance mob = (L2MonsterInstance) npc;
|
||||
final L2MonsterInstance mob = (L2MonsterInstance) npc;
|
||||
_nurses.remove(mob);
|
||||
if (mob.getLeader() != null)
|
||||
{
|
||||
|
@@ -176,7 +176,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
|
||||
_skill = getRndSkills(npc);
|
||||
_target = getRandomTarget(npc, _skill);
|
||||
}
|
||||
L2Character target = _target;
|
||||
final L2Character target = _target;
|
||||
Skill skill = _skill;
|
||||
if (skill == null)
|
||||
{
|
||||
@@ -213,7 +213,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
|
||||
private L2Character getRandomTarget(L2Npc npc, Skill skill)
|
||||
{
|
||||
final Collection<L2Object> objs = npc.getKnownList().getKnownObjects().values();
|
||||
ArrayList<L2Character> result = new ArrayList<>();
|
||||
final ArrayList<L2Character> result = new ArrayList<>();
|
||||
{
|
||||
for (L2Object obj : objs)
|
||||
{
|
||||
@@ -269,7 +269,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
|
||||
}
|
||||
if (!result.isEmpty() && (result.size() != 0))
|
||||
{
|
||||
Object[] characters = result.toArray();
|
||||
final Object[] characters = result.toArray();
|
||||
return (L2Character) characters[Rnd.get(characters.length)];
|
||||
}
|
||||
return null;
|
||||
|
@@ -129,7 +129,7 @@ public final class Valakas extends AbstractNpcAI
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for valakas from DB
|
||||
long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
final long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
if (temp > 0)
|
||||
{
|
||||
// The time has not yet expired. Mark Valakas as currently locked (dead).
|
||||
@@ -446,7 +446,7 @@ public final class Valakas extends AbstractNpcAI
|
||||
|
||||
startQuestTimer("valakas_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
|
||||
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||
GrandBossManager.getInstance().setStatsSet(VALAKAS, info);
|
||||
|
||||
@@ -477,12 +477,12 @@ public final class Valakas extends AbstractNpcAI
|
||||
{
|
||||
if (getRandom(10) == 0)
|
||||
{
|
||||
int x = npc.getX();
|
||||
int y = npc.getY();
|
||||
int z = npc.getZ();
|
||||
final int x = npc.getX();
|
||||
final int y = npc.getY();
|
||||
final int z = npc.getZ();
|
||||
|
||||
int posX = x + getRandom(-1400, 1400);
|
||||
int posY = y + getRandom(-1400, 1400);
|
||||
final int posX = x + getRandom(-1400, 1400);
|
||||
final int posY = y + getRandom(-1400, 1400);
|
||||
|
||||
if (GeoData.getInstance().canMove(x, y, z, posX, posY, z, npc.getInstanceId()))
|
||||
{
|
||||
@@ -547,7 +547,7 @@ public final class Valakas extends AbstractNpcAI
|
||||
*/
|
||||
private L2Playable getRandomTarget(L2Npc npc)
|
||||
{
|
||||
List<L2Playable> result = new ArrayList<>();
|
||||
final List<L2Playable> result = new ArrayList<>();
|
||||
|
||||
for (L2Character obj : npc.getKnownList().getKnownCharacters())
|
||||
{
|
||||
|
@@ -330,7 +330,7 @@ public final class Venom extends AbstractNpcAI
|
||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.IT_S_NOT_OVER_YET_IT_WON_T_BE_OVER_LIKE_THIS_NEVER);
|
||||
if (!CastleManager.getInstance().getCastleById(CASTLE).getSiege().isInProgress())
|
||||
{
|
||||
L2Npc cube = addSpawn(TELEPORT_CUBE, CUBE, false, 0);
|
||||
final L2Npc cube = addSpawn(TELEPORT_CUBE, CUBE, false, 0);
|
||||
startQuestTimer("cube_despawn", 120000, cube, null);
|
||||
}
|
||||
cancelQuestTimer("raid_check", npc, null);
|
||||
|
Reference in New Issue
Block a user