Added missing final modifiers.
This commit is contained in:
@@ -425,18 +425,18 @@ public abstract class Chamber extends AbstractInstance
|
||||
return;
|
||||
}
|
||||
final Instance inst = InstanceManager.getInstance().getInstance(player.getInstanceId());
|
||||
Location ret = inst.getExitLoc();
|
||||
final Location ret = inst.getExitLoc();
|
||||
final String return_point = player.getVariables().getString(RETURN, null);
|
||||
if (return_point != null)
|
||||
{
|
||||
String[] coords = return_point.split(";");
|
||||
final String[] coords = return_point.split(";");
|
||||
if (coords.length == 3)
|
||||
{
|
||||
try
|
||||
{
|
||||
int x = Integer.parseInt(coords[0]);
|
||||
int y = Integer.parseInt(coords[1]);
|
||||
int z = Integer.parseInt(coords[2]);
|
||||
final int x = Integer.parseInt(coords[0]);
|
||||
final int y = Integer.parseInt(coords[1]);
|
||||
final int z = Integer.parseInt(coords[2]);
|
||||
ret.setLocation(new Location(x, y, z));
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -622,7 +622,7 @@ public abstract class Chamber extends AbstractInstance
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
final int npcId = npc.getId();
|
||||
QuestState st = getQuestState(player, false);
|
||||
|
||||
if (st == null)
|
||||
|
@@ -538,30 +538,30 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
if (partyMember.getLevel() < 78)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
sm.addPcName(partyMember);
|
||||
party.broadcastPacket(sm);
|
||||
return false;
|
||||
}
|
||||
L2ItemInstance item = partyMember.getInventory().getItemByItemId(CONT_CRYSTAL);
|
||||
final L2ItemInstance item = partyMember.getInventory().getItemByItemId(CONT_CRYSTAL);
|
||||
if (item == null)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_ITEM_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_ITEM_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED);
|
||||
sm.addPcName(partyMember);
|
||||
party.broadcastPacket(sm);
|
||||
return false;
|
||||
}
|
||||
if (!Util.checkIfInRange(1000, player, partyMember, true))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
sm.addPcName(partyMember);
|
||||
party.broadcastPacket(sm);
|
||||
return false;
|
||||
}
|
||||
Long reentertime = InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), TEMPLATE_ID);
|
||||
final Long reentertime = InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), TEMPLATE_ID);
|
||||
if (System.currentTimeMillis() < reentertime)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
||||
sm.addPcName(partyMember);
|
||||
party.broadcastPacket(sm);
|
||||
return false;
|
||||
@@ -576,7 +576,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
return true;
|
||||
}
|
||||
L2Party party = player.getParty();
|
||||
final L2Party party = player.getParty();
|
||||
if (party == null)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_ARE_NOT_CURRENTLY_IN_A_PARTY_SO_YOU_CANNOT_ENTER);
|
||||
@@ -589,17 +589,17 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
}
|
||||
for (L2PcInstance partyMember : party.getMembers())
|
||||
{
|
||||
L2ItemInstance item = partyMember.getInventory().getItemByItemId(RED_CORAL);
|
||||
final L2ItemInstance item = partyMember.getInventory().getItemByItemId(RED_CORAL);
|
||||
if (item == null)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_ITEM_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_ITEM_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED);
|
||||
sm.addPcName(partyMember);
|
||||
party.broadcastPacket(sm);
|
||||
return false;
|
||||
}
|
||||
if (!Util.checkIfInRange(1000, player, partyMember, true))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
sm.addPcName(partyMember);
|
||||
party.broadcastPacket(sm);
|
||||
return false;
|
||||
@@ -610,7 +610,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
|
||||
private boolean checkBaylorConditions(L2PcInstance player)
|
||||
{
|
||||
L2Party party = player.getParty();
|
||||
final L2Party party = player.getParty();
|
||||
if (party == null)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_ARE_NOT_CURRENTLY_IN_A_PARTY_SO_YOU_CANNOT_ENTER);
|
||||
@@ -623,19 +623,19 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
}
|
||||
for (L2PcInstance partyMember : party.getMembers())
|
||||
{
|
||||
L2ItemInstance item1 = partyMember.getInventory().getItemByItemId(BOSS_CRYSTAL_1);
|
||||
L2ItemInstance item2 = partyMember.getInventory().getItemByItemId(BOSS_CRYSTAL_2);
|
||||
L2ItemInstance item3 = partyMember.getInventory().getItemByItemId(BOSS_CRYSTAL_3);
|
||||
final L2ItemInstance item1 = partyMember.getInventory().getItemByItemId(BOSS_CRYSTAL_1);
|
||||
final L2ItemInstance item2 = partyMember.getInventory().getItemByItemId(BOSS_CRYSTAL_2);
|
||||
final L2ItemInstance item3 = partyMember.getInventory().getItemByItemId(BOSS_CRYSTAL_3);
|
||||
if ((item1 == null) || (item2 == null) || (item3 == null))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_ITEM_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_ITEM_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED);
|
||||
sm.addPcName(partyMember);
|
||||
party.broadcastPacket(sm);
|
||||
return false;
|
||||
}
|
||||
if (!Util.checkIfInRange(1000, player, partyMember, true))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
sm.addPcName(partyMember);
|
||||
party.broadcastPacket(sm);
|
||||
return false;
|
||||
@@ -653,10 +653,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
final int curZ = effected.getZ();
|
||||
|
||||
// Calculate distance between effector and effected current position
|
||||
double dx = effector.getX() - curX;
|
||||
double dy = effector.getY() - curY;
|
||||
double dz = effector.getZ() - curZ;
|
||||
double distance = Math.sqrt((dx * dx) + (dy * dy));
|
||||
final double dx = effector.getX() - curX;
|
||||
final double dy = effector.getY() - curY;
|
||||
final double dz = effector.getZ() - curZ;
|
||||
final double distance = Math.sqrt((dx * dx) + (dy * dy));
|
||||
int offset = Math.min((int) distance + 300, 1400);
|
||||
|
||||
double cos;
|
||||
@@ -679,11 +679,11 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
cos = dx / distance;
|
||||
|
||||
// Calculate the new destination with offset included
|
||||
int _x = effector.getX() - (int) (offset * cos);
|
||||
int _y = effector.getY() - (int) (offset * sin);
|
||||
int _z = effected.getZ();
|
||||
final int _x = effector.getX() - (int) (offset * cos);
|
||||
final int _y = effector.getY() - (int) (offset * sin);
|
||||
final int _z = effected.getZ();
|
||||
|
||||
Location destination = GeoData.getInstance().moveCheck(effected.getX(), effected.getY(), effected.getZ(), _x, _y, _z, effected.getInstanceId());
|
||||
final Location destination = GeoData.getInstance().moveCheck(effected.getX(), effected.getY(), effected.getZ(), _x, _y, _z, effected.getInstanceId());
|
||||
|
||||
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
|
||||
|
||||
@@ -729,7 +729,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
player.breakAttack();
|
||||
player.breakCast();
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
L2Summon pet = player.getPet();
|
||||
final L2Summon pet = player.getPet();
|
||||
if (pet != null)
|
||||
{
|
||||
pet.setTarget(null);
|
||||
@@ -778,7 +778,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
|
||||
for (int[] spawn : HALL_SPAWNS)
|
||||
{
|
||||
L2Npc mob = addSpawn(CGMOBS[getRandom(CGMOBS.length)], spawn[0], spawn[1], spawn[2], spawn[3], false, 0, false, world.getInstanceId());
|
||||
final L2Npc mob = addSpawn(CGMOBS[getRandom(CGMOBS.length)], spawn[0], spawn[1], spawn[2], spawn[3], false, 0, false, world.getInstanceId());
|
||||
world.npcList1.put(mob, false);
|
||||
}
|
||||
}
|
||||
@@ -800,10 +800,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
world.setStatus(3);
|
||||
|
||||
Map<L2Npc, Boolean> spawnList = new HashMap<>();
|
||||
final Map<L2Npc, Boolean> spawnList = new HashMap<>();
|
||||
for (int[] spawn : EMERALD_SPAWNS)
|
||||
{
|
||||
L2Npc mob = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, world.getInstanceId());
|
||||
final L2Npc mob = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, world.getInstanceId());
|
||||
spawnList.put(mob, false);
|
||||
}
|
||||
world.npcList2.put(0, spawnList);
|
||||
@@ -811,10 +811,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
|
||||
protected void runEmeraldRooms(CCWorld world, int[][] spawnList, int room)
|
||||
{
|
||||
Map<L2Npc, Boolean> spawned = new HashMap<>();
|
||||
final Map<L2Npc, Boolean> spawned = new HashMap<>();
|
||||
for (int[] spawn : spawnList)
|
||||
{
|
||||
L2Npc mob = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, world.getInstanceId());
|
||||
final L2Npc mob = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, world.getInstanceId());
|
||||
spawned.put(mob, false);
|
||||
}
|
||||
if (room == 1)
|
||||
@@ -839,10 +839,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
world.setStatus(status);
|
||||
|
||||
Map<L2Npc, Boolean> spawned = new HashMap<>();
|
||||
final Map<L2Npc, Boolean> spawned = new HashMap<>();
|
||||
for (int[] spawn : spawnList)
|
||||
{
|
||||
L2Npc mob = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, world.getInstanceId());
|
||||
final L2Npc mob = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, world.getInstanceId());
|
||||
spawned.put(mob, false);
|
||||
}
|
||||
world.npcList2.put(0, spawned);
|
||||
@@ -885,10 +885,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
if (npc.getId() == ORACLE_GUIDE_1)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
final CCWorld world = (CCWorld) tmpworld;
|
||||
if ((world.getStatus() == 0) && world.oracle.contains(npc))
|
||||
{
|
||||
return "32281.htm";// TODO: Missing HTML.
|
||||
@@ -899,10 +899,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
}
|
||||
else if ((npc.getId() >= 32275) && (npc.getId() <= 32277))
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
final CCWorld world = (CCWorld) tmpworld;
|
||||
if (!world.OracleTriggered[npc.getId() - 32275])
|
||||
{
|
||||
return "no.htm"; // TODO: Missing HTML.
|
||||
@@ -913,7 +913,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
}
|
||||
else if (npc.getId() == 32274)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
return "no.htm"; // TODO: Missing HTML.
|
||||
@@ -969,7 +969,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
|
||||
if ((npc.getId() >= 32275) && (npc.getId() <= 32277) && (skill.getId() != 2360) && (skill.getId() != 2369))
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if ((tmpworld instanceof CCWorld) && (getRandom(100) < 15))
|
||||
{
|
||||
for (L2Npc oracle : ((CCWorld) tmpworld).oracles.keySet())
|
||||
@@ -988,10 +988,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
final CCWorld world = (CCWorld) tmpworld;
|
||||
|
||||
if (((world._dragonClawStart + DRAGONCLAWTIME) <= System.currentTimeMillis()) || (world._dragonClawNeed <= 0))
|
||||
{
|
||||
@@ -1015,10 +1015,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
}
|
||||
else if (npc.isInvul() && (npc.getId() == TEARS) && (skill.getId() == 2369) && (caster != null))
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
final CCWorld world = (CCWorld) tmpworld;
|
||||
if (caster.getParty() == null)
|
||||
{
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
@@ -1046,10 +1046,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
if (npc.getId() == TEARS)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
final CCWorld world = (CCWorld) tmpworld;
|
||||
if ((world.getStatus() != 4) && (attacker != null))
|
||||
{
|
||||
// Lucky cheater, the code only kicks his/her ass out of the dungeon
|
||||
@@ -1078,13 +1078,13 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
return "";
|
||||
}
|
||||
|
||||
int maxHp = npc.getMaxHp();
|
||||
double nowHp = npc.getStatus().getCurrentHp();
|
||||
int rand = getRandom(1000);
|
||||
final int maxHp = npc.getMaxHp();
|
||||
final double nowHp = npc.getStatus().getCurrentHp();
|
||||
final int rand = getRandom(1000);
|
||||
|
||||
if ((nowHp < (maxHp * 0.4)) && (rand < 5))
|
||||
{
|
||||
L2Party party = attacker.getParty();
|
||||
final L2Party party = attacker.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
for (L2PcInstance partyMember : party.getMembers())
|
||||
@@ -1096,10 +1096,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
stopAttack(attacker);
|
||||
}
|
||||
L2Character target = npc.getAI().getAttackTarget();
|
||||
final L2Character target = npc.getAI().getAttackTarget();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
L2Npc copy = addSpawn(TEARS_COPY, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0, false, attacker.getInstanceId());
|
||||
final L2Npc copy = addSpawn(TEARS_COPY, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0, false, attacker.getInstanceId());
|
||||
copy.setRunning();
|
||||
((L2Attackable) copy).addDamageHate(target, 0, 99999);
|
||||
copy.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
@@ -1125,7 +1125,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
if ((npc.getId() == BAYLOR) && (skill.getId() == 5225))
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
((CCWorld) tmpworld)._raidStatus++;
|
||||
@@ -1137,10 +1137,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
final CCWorld world = (CCWorld) tmpworld;
|
||||
if (event.equalsIgnoreCase("TeleportOut"))
|
||||
{
|
||||
teleportPlayer(player, new Location(149413, 173078, -5014), 0);
|
||||
@@ -1253,10 +1253,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
int radius = 300;
|
||||
int x = (int) (radius * Math.cos(i * 0.618));
|
||||
int y = (int) (radius * Math.sin(i * 0.618));
|
||||
L2Npc mob = addSpawn(29104, 153571 + x, 142075 + y, -12737, 0, false, 0, false, world.getInstanceId());
|
||||
final int radius = 300;
|
||||
final int x = (int) (radius * Math.cos(i * 0.618));
|
||||
final int y = (int) (radius * Math.sin(i * 0.618));
|
||||
final L2Npc mob = addSpawn(29104, 153571 + x, 142075 + y, -12737, 0, false, 0, false, world.getInstanceId());
|
||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
world._animationMobs.add(mob);
|
||||
}
|
||||
@@ -1307,7 +1307,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
if (world._alarm == null)
|
||||
{
|
||||
int[] spawnLoc = ALARMSPAWN[getRandom(ALARMSPAWN.length)];
|
||||
final int[] spawnLoc = ALARMSPAWN[getRandom(ALARMSPAWN.length)];
|
||||
npc.addSkill(SkillData.getInstance().getSkill(5244, 1));
|
||||
npc.addSkill(SkillData.getInstance().getSkill(5245, 1));
|
||||
world._alarm = addSpawn(ALARMID, spawnLoc[0], spawnLoc[1], spawnLoc[2], 10800, false, 0, false, world.getInstanceId());
|
||||
@@ -1324,9 +1324,9 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
}
|
||||
else
|
||||
{
|
||||
int maxHp = npc.getMaxHp();
|
||||
double nowHp = npc.getStatus().getCurrentHp();
|
||||
int rand = getRandom(100);
|
||||
final int maxHp = npc.getMaxHp();
|
||||
final double nowHp = npc.getStatus().getCurrentHp();
|
||||
final int rand = getRandom(100);
|
||||
|
||||
if ((nowHp < (maxHp * 0.2)) && (world._raidStatus < 3) && !npc.isAffectedBySkill(5224) && !npc.isAffectedBySkill(5225))
|
||||
{
|
||||
@@ -1380,15 +1380,15 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
return "";
|
||||
}
|
||||
|
||||
CrystalGolem cryGolem = world.crystalGolems.get(npc);
|
||||
final CrystalGolem cryGolem = world.crystalGolems.get(npc);
|
||||
int minDist = 300000;
|
||||
for (L2Object object : L2World.getInstance().getVisibleObjects(npc, 300))
|
||||
{
|
||||
if (object.isItem() && (object.getId() == CRYSTALFOOD))
|
||||
{
|
||||
int dx = npc.getX() - object.getX();
|
||||
int dy = npc.getY() - object.getY();
|
||||
int d = (dx * dx) + (dy * dy);
|
||||
final int dx = npc.getX() - object.getX();
|
||||
final int dy = npc.getY() - object.getY();
|
||||
final int d = (dx * dx) + (dy * dy);
|
||||
if (d < minDist)
|
||||
{
|
||||
minDist = d;
|
||||
@@ -1427,7 +1427,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
}
|
||||
else if (event.equalsIgnoreCase("reachFood"))
|
||||
{
|
||||
CrystalGolem cryGolem = world.crystalGolems.get(npc);
|
||||
final CrystalGolem cryGolem = world.crystalGolems.get(npc);
|
||||
int dx;
|
||||
int dy;
|
||||
if ((cryGolem.foodItem == null) || !cryGolem.foodItem.isVisible())
|
||||
@@ -1445,10 +1445,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
cryGolem.foodItem = null;
|
||||
dx = npc.getX() - 142999;
|
||||
dy = npc.getY() - 151671;
|
||||
int d1 = (dx * dx) + (dy * dy);
|
||||
final int d1 = (dx * dx) + (dy * dy);
|
||||
dx = npc.getX() - 139494;
|
||||
dy = npc.getY() - 151668;
|
||||
int d2 = (dx * dx) + (dy * dy);
|
||||
final int d2 = (dx * dx) + (dy * dy);
|
||||
if ((d1 < 10000) || (d2 < 10000))
|
||||
{
|
||||
npc.broadcastPacket(new MagicSkillUse(npc, npc, 5441, 1, 1, 0));
|
||||
@@ -1470,8 +1470,8 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
}
|
||||
else if (event.equalsIgnoreCase("getFood"))
|
||||
{
|
||||
CrystalGolem cryGolem = world.crystalGolems.get(npc);
|
||||
Location newLoc = new Location(cryGolem.foodItem.getX(), cryGolem.foodItem.getY(), cryGolem.foodItem.getZ(), 0);
|
||||
final CrystalGolem cryGolem = world.crystalGolems.get(npc);
|
||||
final Location newLoc = new Location(cryGolem.foodItem.getX(), cryGolem.foodItem.getY(), cryGolem.foodItem.getZ(), 0);
|
||||
cryGolem.oldLoc = new Location(npc.getX(), npc.getY(), npc.getZ(), npc.getHeading());
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, newLoc);
|
||||
startQuestTimer("reachFood", 2000, npc, null, true);
|
||||
@@ -1485,7 +1485,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
final int num = Math.max((int) Config.RATE_DEATH_DROP_CHANCE_MULTIPLIER, 1);
|
||||
|
||||
L2Party party = player.getParty();
|
||||
final L2Party party = player.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
for (L2PcInstance partyMember : party.getMembers())
|
||||
@@ -1530,10 +1530,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
final CCWorld world = (CCWorld) tmpworld;
|
||||
if ((world.getStatus() == 2) && world.npcList1.containsKey(npc))
|
||||
{
|
||||
world.npcList1.put(npc, true);
|
||||
@@ -1546,8 +1546,8 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
}
|
||||
world.setStatus(3);
|
||||
world.tears = addSpawn(TEARS, 144298, 154420, -11854, 32767, false, 0, false, world.getInstanceId()); // Tears
|
||||
CrystalGolem crygolem1 = new CrystalGolem();
|
||||
CrystalGolem crygolem2 = new CrystalGolem();
|
||||
final CrystalGolem crygolem1 = new CrystalGolem();
|
||||
final CrystalGolem crygolem2 = new CrystalGolem();
|
||||
world.crystalGolems.put(addSpawn(CRYSTAL_GOLEM, 140547, 151670, -11813, 32767, false, 0, false, world.getInstanceId()), crygolem1);
|
||||
world.crystalGolems.put(addSpawn(CRYSTAL_GOLEM, 141941, 151684, -11813, 63371, false, 0, false, world.getInstanceId()), crygolem2);
|
||||
for (L2Npc crygolem : world.crystalGolems.keySet())
|
||||
@@ -1572,7 +1572,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
npc.dropItem(player, 9699, 1);
|
||||
runSteamRooms(world, STEAM1_SPAWNS, 22);
|
||||
L2Party party = player.getParty();
|
||||
final L2Party party = player.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
for (L2PcInstance partyMember : party.getMembers())
|
||||
@@ -1692,7 +1692,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
break;
|
||||
case 25:
|
||||
world.setStatus(26);
|
||||
L2Party party = player.getParty();
|
||||
final L2Party party = player.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
for (L2PcInstance partyMember : party.getMembers())
|
||||
@@ -1704,7 +1704,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
cancelQuestTimers("Timer51");
|
||||
openDoor(DOOR3, npc.getInstanceId());
|
||||
openDoor(DOOR4, npc.getInstanceId());
|
||||
L2Npc kechi = addSpawn(KECHI, 154069, 149525, -12158, 51165, false, 0, false, world.getInstanceId());
|
||||
final L2Npc kechi = addSpawn(KECHI, 154069, 149525, -12158, 51165, false, 0, false, world.getInstanceId());
|
||||
startQuestTimer("checkKechiAttack", 1000, kechi, null);
|
||||
return "";
|
||||
default:
|
||||
@@ -1751,7 +1751,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
world.setStatus(31);
|
||||
world._baylor = null;
|
||||
npc.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
Instance baylorInstance = InstanceManager.getInstance().getInstance(npc.getInstanceId());
|
||||
final Instance baylorInstance = InstanceManager.getInstance().getInstance(npc.getInstanceId());
|
||||
baylorInstance.setDuration(300000);
|
||||
this.startQuestTimer("spawn_oracle", 1000, npc, null);
|
||||
giveRewards(player, npc.getInstanceId(), -1, true);
|
||||
@@ -1763,7 +1763,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
final int npcId = npc.getId();
|
||||
QuestState st = getQuestState(player, false);
|
||||
if (st == null)
|
||||
{
|
||||
@@ -1775,10 +1775,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
return "";
|
||||
}
|
||||
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
final CCWorld world = (CCWorld) tmpworld;
|
||||
if (npcId == CRYSTAL_GOLEM)
|
||||
{
|
||||
}
|
||||
@@ -1786,7 +1786,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
boolean doTeleport = false;
|
||||
Location loc = null;
|
||||
L2Party party = player.getParty();
|
||||
final L2Party party = player.getParty();
|
||||
doTeleport = true;
|
||||
switch (npc.getId())
|
||||
{
|
||||
@@ -1903,7 +1903,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
if ((world.getStatus() < 30) && checkBaylorConditions(player))
|
||||
{
|
||||
world._raiders.clear();
|
||||
L2Party party = player.getParty();
|
||||
final L2Party party = player.getParty();
|
||||
if (party == null)
|
||||
{
|
||||
world._raiders.add(player);
|
||||
@@ -1923,19 +1923,19 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
return "";
|
||||
}
|
||||
world.setStatus(30);
|
||||
long time = world.endTime - System.currentTimeMillis();
|
||||
Instance baylorInstance = InstanceManager.getInstance().getInstance(world.getInstanceId());
|
||||
final long time = world.endTime - System.currentTimeMillis();
|
||||
final Instance baylorInstance = InstanceManager.getInstance().getInstance(world.getInstanceId());
|
||||
baylorInstance.setDuration((int) time);
|
||||
|
||||
int radius = 150;
|
||||
final int radius = 150;
|
||||
int i = 0;
|
||||
int members = world._raiders.size();
|
||||
final int members = world._raiders.size();
|
||||
for (L2PcInstance p : world._raiders)
|
||||
{
|
||||
int x = (int) (radius * Math.cos((i * 2 * Math.PI) / members));
|
||||
int y = (int) (radius * Math.sin((i++ * 2 * Math.PI) / members));
|
||||
final int x = (int) (radius * Math.cos((i * 2 * Math.PI) / members));
|
||||
final int y = (int) (radius * Math.sin((i++ * 2 * Math.PI) / members));
|
||||
p.teleToLocation(new Location(153571 + x, 142075 + y, -12737));
|
||||
L2Summon pet = p.getPet();
|
||||
final L2Summon pet = p.getPet();
|
||||
if (pet != null)
|
||||
{
|
||||
pet.teleToLocation(new Location(153571 + x, 142075 + y, -12737), true);
|
||||
@@ -1962,10 +1962,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
@Override
|
||||
public String onTrapAction(L2TrapInstance trap, L2Character trigger, TrapAction action)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(trap.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(trap.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
final CCWorld world = (CCWorld) tmpworld;
|
||||
switch (action)
|
||||
{
|
||||
case TRAP_DISARMED:
|
||||
@@ -1985,10 +1985,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
if (character instanceof L2PcInstance)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(character.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(character.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
final CCWorld world = (CCWorld) tmpworld;
|
||||
if (world.getStatus() == 8)
|
||||
{
|
||||
int room;
|
||||
@@ -2044,10 +2044,10 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
{
|
||||
if (character instanceof L2PcInstance)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(character.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(character.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
final CCWorld world = (CCWorld) tmpworld;
|
||||
if (world.getStatus() == 8)
|
||||
{
|
||||
int doorId;
|
||||
|
@@ -260,14 +260,14 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
{
|
||||
if (partyMember.getLevel() < 78)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
sm.addPcName(partyMember);
|
||||
player.sendPacket(sm);
|
||||
return false;
|
||||
}
|
||||
if (!partyMember.isInsideRadius(player, 1000, true, true))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
sm.addPcName(partyMember);
|
||||
player.sendPacket(sm);
|
||||
return false;
|
||||
@@ -303,7 +303,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
protected void runStartRoom(DMCWorld world)
|
||||
{
|
||||
world.setStatus(0);
|
||||
DMCRoom StartRoom = new DMCRoom();
|
||||
final DMCRoom StartRoom = new DMCRoom();
|
||||
DMCNpc thisnpc;
|
||||
|
||||
thisnpc = new DMCNpc();
|
||||
@@ -326,7 +326,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
|
||||
protected void spawnHall(DMCWorld world)
|
||||
{
|
||||
DMCRoom Hall = new DMCRoom();
|
||||
final DMCRoom Hall = new DMCRoom();
|
||||
DMCNpc thisnpc;
|
||||
world.rooms.remove("Hall"); // remove room instance to avoid adding mob every time
|
||||
|
||||
@@ -406,7 +406,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
|
||||
protected void runFirstRoom(DMCWorld world)
|
||||
{
|
||||
DMCRoom FirstRoom = new DMCRoom();
|
||||
final DMCRoom FirstRoom = new DMCRoom();
|
||||
DMCNpc thisnpc;
|
||||
|
||||
thisnpc = new DMCNpc();
|
||||
@@ -455,7 +455,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
|
||||
protected void runSecondRoom(DMCWorld world)
|
||||
{
|
||||
DMCRoom SecondRoom = new DMCRoom();
|
||||
final DMCRoom SecondRoom = new DMCRoom();
|
||||
DMCNpc thisnpc;
|
||||
|
||||
// TODO: find a better way to initialize to [1,0,0,0,0,0,0]
|
||||
@@ -466,7 +466,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
SecondRoom.Order[i] = 0;
|
||||
}
|
||||
|
||||
int i = getRandom(MonolithOrder.length);
|
||||
final int i = getRandom(MonolithOrder.length);
|
||||
|
||||
thisnpc = new DMCNpc();
|
||||
thisnpc.npc = addSpawn(BSM, 147800, 181150, -6117, 0, false, 0, false, world.getInstanceId());
|
||||
@@ -512,8 +512,8 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
|
||||
protected void runThirdRoom(DMCWorld world)
|
||||
{
|
||||
DMCRoom ThirdRoom = new DMCRoom();
|
||||
DMCNpc thisnpc = new DMCNpc();
|
||||
final DMCRoom ThirdRoom = new DMCRoom();
|
||||
final DMCNpc thisnpc = new DMCNpc();
|
||||
thisnpc.isDead = false;
|
||||
thisnpc.npc = addSpawn(BM[1], 148765, 180450, -6117, 0, false, 0, false, world.getInstanceId());
|
||||
if (noRndWalk)
|
||||
@@ -559,8 +559,8 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
protected void runThirdRoom2(DMCWorld world)
|
||||
{
|
||||
addSpawn(SOAdventure, 148910, 178397, -6117, 16383, false, 0, false, world.getInstanceId());
|
||||
DMCRoom ThirdRoom = new DMCRoom();
|
||||
DMCNpc thisnpc = new DMCNpc();
|
||||
final DMCRoom ThirdRoom = new DMCRoom();
|
||||
final DMCNpc thisnpc = new DMCNpc();
|
||||
thisnpc.isDead = false;
|
||||
thisnpc.npc = addSpawn(BM[1], 148765, 180450, -6117, 0, false, 0, false, world.getInstanceId());
|
||||
if (noRndWalk)
|
||||
@@ -604,11 +604,11 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
|
||||
protected void runForthRoom(DMCWorld world)
|
||||
{
|
||||
DMCRoom ForthRoom = new DMCRoom();
|
||||
final DMCRoom ForthRoom = new DMCRoom();
|
||||
ForthRoom.counter = 0;
|
||||
DMCNpc thisnpc;
|
||||
int temp[] = new int[7];
|
||||
int templist[][] = new int[7][5];
|
||||
final int temp[] = new int[7];
|
||||
final int templist[][] = new int[7][5];
|
||||
int xx = 0;
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
@@ -660,7 +660,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
{
|
||||
int idx = 0;
|
||||
int temp[] = new int[6];
|
||||
DMCRoom FifthRoom = new DMCRoom();
|
||||
final DMCRoom FifthRoom = new DMCRoom();
|
||||
DMCNpc thisnpc;
|
||||
|
||||
temp = Beleths[getRandom(Beleths.length)];
|
||||
@@ -716,10 +716,10 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
return;
|
||||
}
|
||||
|
||||
int i = getRandom(GolemSpawn.length);
|
||||
int mobId = GolemSpawn[i][0];
|
||||
int x = GolemSpawn[i][1];
|
||||
int y = GolemSpawn[i][2];
|
||||
final int i = getRandom(GolemSpawn.length);
|
||||
final int mobId = GolemSpawn[i][0];
|
||||
final int x = GolemSpawn[i][1];
|
||||
final int y = GolemSpawn[i][2];
|
||||
|
||||
npc.golem = addSpawn(mobId, x, y, -6117, 0, false, 0, false, world.getInstanceId());
|
||||
if (noRndWalk)
|
||||
@@ -758,7 +758,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
|
||||
protected void checkBelethSample(DMCWorld world, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
DMCRoom FifthRoom = world.rooms.get("FifthRoom");
|
||||
final DMCRoom FifthRoom = world.rooms.get("FifthRoom");
|
||||
|
||||
for (DMCNpc mob : FifthRoom.npcList)
|
||||
{
|
||||
@@ -792,7 +792,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
protected void killedBelethSample(DMCWorld world, L2Npc npc)
|
||||
{
|
||||
int decayedSamples = 0;
|
||||
DMCRoom FifthRoom = world.rooms.get("FifthRoom");
|
||||
final DMCRoom FifthRoom = world.rooms.get("FifthRoom");
|
||||
|
||||
for (DMCNpc mob : FifthRoom.npcList)
|
||||
{
|
||||
@@ -841,7 +841,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
|
||||
protected boolean allStonesDone(DMCWorld world)
|
||||
{
|
||||
DMCRoom SecondRoom = world.rooms.get("SecondRoom");
|
||||
final DMCRoom SecondRoom = world.rooms.get("SecondRoom");
|
||||
|
||||
for (DMCNpc mob : SecondRoom.npcList)
|
||||
{
|
||||
@@ -857,7 +857,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
|
||||
protected void removeMonoliths(DMCWorld world)
|
||||
{
|
||||
DMCRoom SecondRoom = world.rooms.get("SecondRoom");
|
||||
final DMCRoom SecondRoom = world.rooms.get("SecondRoom");
|
||||
|
||||
for (DMCNpc mob : SecondRoom.npcList)
|
||||
{
|
||||
@@ -867,7 +867,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
|
||||
protected void chkShadowColumn(DMCWorld world, L2Npc npc)
|
||||
{
|
||||
DMCRoom ForthRoom = world.rooms.get("ForthRoom");
|
||||
final DMCRoom ForthRoom = world.rooms.get("ForthRoom");
|
||||
|
||||
for (DMCNpc mob : ForthRoom.npcList)
|
||||
{
|
||||
@@ -910,7 +910,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
|
||||
if (world.rooms.containsKey("FifthRoom"))
|
||||
{
|
||||
DMCRoom FifthRoom = world.rooms.get("FifthRoom");
|
||||
final DMCRoom FifthRoom = world.rooms.get("FifthRoom");
|
||||
if (event.equalsIgnoreCase("decayMe"))
|
||||
{
|
||||
for (DMCNpc mob : FifthRoom.npcList)
|
||||
@@ -994,7 +994,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
}
|
||||
if (world.getStatus() == 4)
|
||||
{
|
||||
DMCRoom SecondRoom = world.rooms.get("SecondRoom");
|
||||
final DMCRoom SecondRoom = world.rooms.get("SecondRoom");
|
||||
for (DMCNpc mob : SecondRoom.npcList)
|
||||
{
|
||||
if (mob.golem == npc)
|
||||
@@ -1046,7 +1046,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
world = (DMCWorld) tmpworld;
|
||||
if (world.getStatus() == 7)
|
||||
{
|
||||
DMCRoom ForthRoom = world.rooms.get("ForthRoom");
|
||||
final DMCRoom ForthRoom = world.rooms.get("ForthRoom");
|
||||
for (DMCNpc mob : ForthRoom.npcList)
|
||||
{
|
||||
if (mob.npc == npc)
|
||||
@@ -1070,14 +1070,14 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
DMCWorld world;
|
||||
if (tmpworld instanceof DMCWorld)
|
||||
{
|
||||
world = (DMCWorld) tmpworld;
|
||||
if (world.getStatus() == 4)
|
||||
{
|
||||
DMCRoom SecondRoom = world.rooms.get("SecondRoom");
|
||||
final DMCRoom SecondRoom = world.rooms.get("SecondRoom");
|
||||
for (DMCNpc mob : SecondRoom.npcList)
|
||||
{
|
||||
if (mob.npc == npc)
|
||||
@@ -1117,7 +1117,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
}
|
||||
else
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
DMCWorld world;
|
||||
if (tmpworld instanceof DMCWorld)
|
||||
{
|
||||
@@ -1135,8 +1135,8 @@ public final class DarkCloudMansion extends AbstractInstance
|
||||
world.removeAllowed(player.getObjectId());
|
||||
}
|
||||
teleportPlayer(player, new Location(139968, 150367, -3111), 0);
|
||||
int instanceId = npc.getInstanceId();
|
||||
Instance instance = InstanceManager.getInstance().getInstance(instanceId);
|
||||
final int instanceId = npc.getInstanceId();
|
||||
final Instance instance = InstanceManager.getInstance().getInstance(instanceId);
|
||||
if (instance.getPlayers().isEmpty())
|
||||
{
|
||||
InstanceManager.getInstance().destroyInstance(instanceId);
|
||||
|
@@ -346,7 +346,7 @@ public final class DisciplesNecropolisPast extends AbstractInstance
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance player, int damage, boolean isSummon)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
|
||||
if (tmpworld instanceof DNPWorld)
|
||||
{
|
||||
if (npc.isScriptValue(0))
|
||||
@@ -441,7 +441,7 @@ public final class DisciplesNecropolisPast extends AbstractInstance
|
||||
if (qs.getCond() >= 3)
|
||||
{
|
||||
takeItems(talker, SACRED_SWORD_OF_EINHASAD, -1);
|
||||
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(talker);
|
||||
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(talker);
|
||||
world.removeAllowed(talker.getObjectId());
|
||||
talker.teleToLocation(EXIT, 0);
|
||||
htmltext = "32587-01.html";
|
||||
@@ -452,10 +452,10 @@ public final class DisciplesNecropolisPast extends AbstractInstance
|
||||
{
|
||||
if (qs.getCond() >= 3)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof DNPWorld)
|
||||
{
|
||||
DNPWorld world = (DNPWorld) tmpworld;
|
||||
final DNPWorld world = (DNPWorld) tmpworld;
|
||||
openDoor(DISCIPLES_NECROPOLIS_DOOR, world.getInstanceId());
|
||||
talker.showQuestMovie(12);
|
||||
startQuestTimer("FIGHT", 1000, null, talker);
|
||||
|
@@ -257,19 +257,19 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
int spawnCount = 0;
|
||||
try
|
||||
{
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
factory.setValidating(false);
|
||||
factory.setIgnoringComments(true);
|
||||
|
||||
File file = new File(Config.DATAPACK_ROOT + "/spawnZones/final_emperial_tomb.xml");
|
||||
final File file = new File(Config.DATAPACK_ROOT + "/spawnZones/final_emperial_tomb.xml");
|
||||
if (!file.exists())
|
||||
{
|
||||
_log.severe("[Final Emperial Tomb] Missing final_emperial_tomb.xml. The quest wont work without it!");
|
||||
return;
|
||||
}
|
||||
|
||||
Document doc = factory.newDocumentBuilder().parse(file);
|
||||
Node first = doc.getFirstChild();
|
||||
final Document doc = factory.newDocumentBuilder().parse(file);
|
||||
final Node first = doc.getFirstChild();
|
||||
if ((first != null) && "list".equalsIgnoreCase(first.getNodeName()))
|
||||
{
|
||||
for (Node n = first.getFirstChild(); n != null; n = n.getNextSibling())
|
||||
@@ -287,7 +287,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
_log.severe("[Final Emperial Tomb] Missing npcId in npc List, skipping");
|
||||
continue;
|
||||
}
|
||||
int npcId = Integer.parseInt(attrs.getNamedItem("npcId").getNodeValue());
|
||||
final int npcId = Integer.parseInt(attrs.getNamedItem("npcId").getNodeValue());
|
||||
|
||||
att = attrs.getNamedItem("flag");
|
||||
if (att == null)
|
||||
@@ -296,7 +296,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
continue;
|
||||
}
|
||||
|
||||
int flag = Integer.parseInt(attrs.getNamedItem("flag").getNodeValue());
|
||||
final int flag = Integer.parseInt(attrs.getNamedItem("flag").getNodeValue());
|
||||
_spawnList.putIfAbsent(flag, new ArrayList<FETSpawn>());
|
||||
|
||||
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
|
||||
@@ -304,7 +304,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
if ("loc".equalsIgnoreCase(cd.getNodeName()))
|
||||
{
|
||||
attrs = cd.getAttributes();
|
||||
FETSpawn spw = new FETSpawn();
|
||||
final FETSpawn spw = new FETSpawn();
|
||||
spw.npcId = npcId;
|
||||
|
||||
att = attrs.getNamedItem("x");
|
||||
@@ -358,7 +358,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
else if ("zone".equalsIgnoreCase(cd.getNodeName()))
|
||||
{
|
||||
attrs = cd.getAttributes();
|
||||
FETSpawn spw = new FETSpawn();
|
||||
final FETSpawn spw = new FETSpawn();
|
||||
spw.npcId = npcId;
|
||||
spw.isZone = true;
|
||||
|
||||
@@ -409,22 +409,22 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
_log.severe("[Final Emperial Tomb] Missing id in spawnZones List, skipping");
|
||||
continue;
|
||||
}
|
||||
int id = Integer.parseInt(att.getNodeValue());
|
||||
final int id = Integer.parseInt(att.getNodeValue());
|
||||
att = attrs.getNamedItem("minZ");
|
||||
if (att == null)
|
||||
{
|
||||
_log.severe("[Final Emperial Tomb] Missing minZ in spawnZones List id: " + id + ", skipping");
|
||||
continue;
|
||||
}
|
||||
int minz = Integer.parseInt(att.getNodeValue());
|
||||
final int minz = Integer.parseInt(att.getNodeValue());
|
||||
att = attrs.getNamedItem("maxZ");
|
||||
if (att == null)
|
||||
{
|
||||
_log.severe("[Final Emperial Tomb] Missing maxZ in spawnZones List id: " + id + ", skipping");
|
||||
continue;
|
||||
}
|
||||
int maxz = Integer.parseInt(att.getNodeValue());
|
||||
L2Territory ter = new L2Territory(id);
|
||||
final int maxz = Integer.parseInt(att.getNodeValue());
|
||||
final L2Territory ter = new L2Territory(id);
|
||||
|
||||
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
|
||||
{
|
||||
@@ -501,7 +501,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
}
|
||||
else if (player.getInventory().getItemByItemId(8073) == null)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_ITEM_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_ITEM_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED);
|
||||
sm.addPcName(player);
|
||||
player.sendPacket(sm);
|
||||
return false;
|
||||
@@ -760,7 +760,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
{
|
||||
break;
|
||||
}
|
||||
L2MonsterInstance demon = (L2MonsterInstance) addSpawn(PORTRAIT_SPAWNS[i][0] + 2, PORTRAIT_SPAWNS[i][5], PORTRAIT_SPAWNS[i][6], PORTRAIT_SPAWNS[i][7], PORTRAIT_SPAWNS[i][8], false, 0, false, _world.getInstanceId());
|
||||
final L2MonsterInstance demon = (L2MonsterInstance) addSpawn(PORTRAIT_SPAWNS[i][0] + 2, PORTRAIT_SPAWNS[i][5], PORTRAIT_SPAWNS[i][6], PORTRAIT_SPAWNS[i][7], PORTRAIT_SPAWNS[i][8], false, 0, false, _world.getInstanceId());
|
||||
updateKnownList(_world, demon);
|
||||
_world.demons.add(demon);
|
||||
}
|
||||
@@ -813,7 +813,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
{
|
||||
if (_world.frintezza.getScriptValue() != 1)
|
||||
{
|
||||
int rnd = getRandom(100);
|
||||
final int rnd = getRandom(100);
|
||||
for (FrintezzaSong element : FRINTEZZASONGLIST)
|
||||
{
|
||||
if (rnd < element.chance)
|
||||
@@ -835,7 +835,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
break;
|
||||
case 1: // Frintezza song effect
|
||||
_world.songEffectTask = null;
|
||||
Skill skill = _world.OnSong.effectSkill.getSkill();
|
||||
final Skill skill = _world.OnSong.effectSkill.getSkill();
|
||||
if (skill == null)
|
||||
{
|
||||
return;
|
||||
@@ -848,7 +848,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
{
|
||||
for (int objId : _world.getAllowed())
|
||||
{
|
||||
L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
if ((player != null) && player.isOnline() && (player.getInstanceId() == _world.getInstanceId()))
|
||||
{
|
||||
if (!player.isDead())
|
||||
@@ -967,7 +967,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
|
||||
for (int[] element : PORTRAIT_SPAWNS)
|
||||
{
|
||||
L2MonsterInstance demon = (L2MonsterInstance) addSpawn(element[0] + 2, element[5], element[6], element[7], element[8], false, 0, false, _world.getInstanceId());
|
||||
final L2MonsterInstance demon = (L2MonsterInstance) addSpawn(element[0] + 2, element[5], element[6], element[7], element[8], false, 0, false, _world.getInstanceId());
|
||||
demon.setIsImmobilized(true);
|
||||
demon.disableAllSkills();
|
||||
updateKnownList(_world, demon);
|
||||
@@ -1071,7 +1071,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
case 21:
|
||||
for (int i = 0; i < PORTRAIT_SPAWNS.length; i++)
|
||||
{
|
||||
L2MonsterInstance portrait = (L2MonsterInstance) addSpawn(PORTRAIT_SPAWNS[i][0], PORTRAIT_SPAWNS[i][1], PORTRAIT_SPAWNS[i][2], PORTRAIT_SPAWNS[i][3], PORTRAIT_SPAWNS[i][4], false, 0, false, _world.getInstanceId());
|
||||
final L2MonsterInstance portrait = (L2MonsterInstance) addSpawn(PORTRAIT_SPAWNS[i][0], PORTRAIT_SPAWNS[i][1], PORTRAIT_SPAWNS[i][2], PORTRAIT_SPAWNS[i][3], PORTRAIT_SPAWNS[i][4], false, 0, false, _world.getInstanceId());
|
||||
updateKnownList(_world, portrait);
|
||||
_world.portraits.put(portrait, i);
|
||||
}
|
||||
@@ -1203,7 +1203,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
{
|
||||
for (int objId : _world.getAllowed())
|
||||
{
|
||||
L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
if ((player != null) && player.isOnline() && (player.getInstanceId() == _world.getInstanceId()))
|
||||
{
|
||||
player.abortAttack();
|
||||
@@ -1221,7 +1221,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
{
|
||||
for (int objId : _world.getAllowed())
|
||||
{
|
||||
L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
if ((player != null) && player.isOnline() && (player.getInstanceId() == _world.getInstanceId()))
|
||||
{
|
||||
player.enableAllSkills();
|
||||
@@ -1234,7 +1234,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
{
|
||||
for (int objId : _world.getAllowed())
|
||||
{
|
||||
L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
if ((player != null) && player.isOnline() && (player.getInstanceId() == _world.getInstanceId()))
|
||||
{
|
||||
if (player.getX() < x)
|
||||
@@ -1331,7 +1331,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
{
|
||||
for (int objId : world.getAllowed())
|
||||
{
|
||||
L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
if ((player != null) && player.isOnline() && (player.getInstanceId() == world.getInstanceId()))
|
||||
{
|
||||
player.sendPacket(packet);
|
||||
@@ -1341,10 +1341,10 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
|
||||
protected void updateKnownList(FETWorld world, L2Npc npc)
|
||||
{
|
||||
Map<Integer, L2PcInstance> npcKnownPlayers = npc.getKnownList().getKnownPlayers();
|
||||
final Map<Integer, L2PcInstance> npcKnownPlayers = npc.getKnownList().getKnownPlayers();
|
||||
for (int objId : world.getAllowed())
|
||||
{
|
||||
L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
if ((player != null) && player.isOnline() && (player.getInstanceId() == world.getInstanceId()))
|
||||
{
|
||||
npcKnownPlayers.put(player.getObjectId(), player);
|
||||
@@ -1398,10 +1398,10 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof FETWorld)
|
||||
{
|
||||
FETWorld world = (FETWorld) tmpworld;
|
||||
final FETWorld world = (FETWorld) tmpworld;
|
||||
if (npc.getId() == HALL_ALARM)
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(new StatusTask(world, 0), 2000);
|
||||
@@ -1456,7 +1456,7 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
final int npcId = npc.getId();
|
||||
getQuestState(player, true);
|
||||
if (npcId == GUIDE)
|
||||
{
|
||||
@@ -1464,8 +1464,8 @@ public final class FinalEmperialTomb extends AbstractInstance
|
||||
}
|
||||
else if (npc.getId() == CUBE)
|
||||
{
|
||||
int x = -87534 + getRandom(500);
|
||||
int y = -153048 + getRandom(500);
|
||||
final int x = -87534 + getRandom(500);
|
||||
final int y = -153048 + getRandom(500);
|
||||
player.teleToLocation(x, y, -9165);
|
||||
return null;
|
||||
}
|
||||
|
@@ -114,7 +114,7 @@ public final class HarnakUndergroundRuins extends AbstractInstance
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
final String htmltext = null;
|
||||
switch (event)
|
||||
{
|
||||
case "enter_instance":
|
||||
@@ -434,7 +434,7 @@ public final class HarnakUndergroundRuins extends AbstractInstance
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
|
||||
if (tmpworld instanceof HuRWorld)
|
||||
{
|
||||
HuRWorld world = (HuRWorld) tmpworld;
|
||||
final HuRWorld world = (HuRWorld) tmpworld;
|
||||
switch (world.timerCount)
|
||||
{
|
||||
case 0:
|
||||
@@ -695,7 +695,7 @@ public final class HarnakUndergroundRuins extends AbstractInstance
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
|
||||
if (tmpworld instanceof HuRWorld)
|
||||
{
|
||||
HuRWorld world = (HuRWorld) tmpworld;
|
||||
final HuRWorld world = (HuRWorld) tmpworld;
|
||||
|
||||
if (world.isStatus(1))
|
||||
{
|
||||
|
@@ -1303,28 +1303,28 @@ public final class IceQueensCastleBattle extends AbstractInstance
|
||||
{
|
||||
if (channelMember.getLevel() < MIN_LEVEL)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
sm.addPcName(channelMember);
|
||||
party.broadcastPacket(sm);
|
||||
return false;
|
||||
}
|
||||
else if (!Util.checkIfInRange(1000, player, channelMember, true))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
sm.addPcName(channelMember);
|
||||
party.broadcastPacket(sm);
|
||||
return false;
|
||||
}
|
||||
else if (System.currentTimeMillis() < InstanceManager.getInstance().getInstanceTime(channelMember.getObjectId(), TEMPLATE_ID_EASY))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
||||
sm.addPcName(channelMember);
|
||||
party.broadcastPacket(sm);
|
||||
return false;
|
||||
}
|
||||
else if (System.currentTimeMillis() < InstanceManager.getInstance().getInstanceTime(channelMember.getObjectId(), TEMPLATE_ID_HARD))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
||||
sm.addPcName(channelMember);
|
||||
party.broadcastPacket(sm);
|
||||
return false;
|
||||
|
@@ -1261,7 +1261,7 @@ public final class Kamaloka extends AbstractInstance
|
||||
// player level must be in range
|
||||
if (Math.abs(partyMember.getLevel() - level) > MAX_LEVEL_DIFFERENCE)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
sm.addPcName(partyMember);
|
||||
player.sendPacket(sm);
|
||||
return false;
|
||||
@@ -1269,7 +1269,7 @@ public final class Kamaloka extends AbstractInstance
|
||||
// player must be near party leader
|
||||
if (!partyMember.isInsideRadius(player, 1000, true, true))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
sm.addPcName(partyMember);
|
||||
player.sendPacket(sm);
|
||||
return false;
|
||||
@@ -1289,7 +1289,7 @@ public final class Kamaloka extends AbstractInstance
|
||||
// if found instance still can't be reentered - exit
|
||||
if (System.currentTimeMillis() < instanceTimes.get(id))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
||||
sm.addPcName(partyMember);
|
||||
player.sendPacket(sm);
|
||||
return false;
|
||||
@@ -1360,13 +1360,13 @@ public final class Kamaloka extends AbstractInstance
|
||||
// check for level difference again on reenter
|
||||
if (Math.abs(player.getLevel() - LEVEL[((KamaWorld) world).index]) > MAX_LEVEL_DIFFERENCE)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
sm.addPcName(player);
|
||||
player.sendPacket(sm);
|
||||
return;
|
||||
}
|
||||
// check what instance still exist
|
||||
Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
|
||||
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
|
||||
if (inst != null)
|
||||
{
|
||||
removeBuffs(player);
|
||||
@@ -1424,7 +1424,7 @@ public final class Kamaloka extends AbstractInstance
|
||||
{
|
||||
if (world instanceof KamaWorld)
|
||||
{
|
||||
Calendar reenter = Calendar.getInstance();
|
||||
final Calendar reenter = Calendar.getInstance();
|
||||
reenter.set(Calendar.MINUTE, RESET_MIN);
|
||||
// if time is >= RESET_HOUR - roll to the next day
|
||||
if (reenter.get(Calendar.HOUR_OF_DAY) >= RESET_HOUR)
|
||||
@@ -1433,13 +1433,13 @@ public final class Kamaloka extends AbstractInstance
|
||||
}
|
||||
reenter.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
|
||||
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_S_ENTRY_HAS_BEEN_RESTRICTED_YOU_CAN_CHECK_THE_NEXT_POSSIBLE_ENTRY_TIME_BY_USING_THE_COMMAND_INSTANCEZONE);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_S_ENTRY_HAS_BEEN_RESTRICTED_YOU_CAN_CHECK_THE_NEXT_POSSIBLE_ENTRY_TIME_BY_USING_THE_COMMAND_INSTANCEZONE);
|
||||
sm.addInstanceName(world.getTemplateId());
|
||||
|
||||
// set instance reenter time for all allowed players
|
||||
for (int objectId : world.getAllowed())
|
||||
{
|
||||
L2PcInstance obj = L2World.getInstance().getPlayer(objectId);
|
||||
final L2PcInstance obj = L2World.getInstance().getPlayer(objectId);
|
||||
if ((obj != null) && obj.isOnline())
|
||||
{
|
||||
InstanceManager.getInstance().setInstanceTime(objectId, world.getTemplateId(), reenter.getTimeInMillis());
|
||||
@@ -1448,7 +1448,7 @@ public final class Kamaloka extends AbstractInstance
|
||||
}
|
||||
|
||||
// destroy instance after EXIT_TIME
|
||||
Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
|
||||
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
|
||||
inst.setDuration(EXIT_TIME * 60000);
|
||||
inst.setEmptyDestroyTime(0);
|
||||
}
|
||||
@@ -1472,7 +1472,7 @@ public final class Kamaloka extends AbstractInstance
|
||||
if (npcs != null)
|
||||
{
|
||||
world.firstRoom = new ArrayList<L2Spawn>(spawns.length - 1);
|
||||
int shaman = getRandom(spawns.length); // random position for shaman
|
||||
final int shaman = getRandom(spawns.length); // random position for shaman
|
||||
|
||||
for (int i = 0; i < spawns.length; i++)
|
||||
{
|
||||
@@ -1485,7 +1485,7 @@ public final class Kamaloka extends AbstractInstance
|
||||
else
|
||||
{
|
||||
npc = addSpawn(npcs[1], spawns[i][0], spawns[i][1], spawns[i][2], 0, false, 0, false, world.getInstanceId());
|
||||
L2Spawn spawn = npc.getSpawn();
|
||||
final L2Spawn spawn = npc.getSpawn();
|
||||
spawn.setRespawnDelay(FIRST_ROOM_RESPAWN_DELAY);
|
||||
spawn.setAmount(1);
|
||||
spawn.startRespawn();
|
||||
@@ -1570,7 +1570,7 @@ public final class Kamaloka extends AbstractInstance
|
||||
// party members must be in the instance
|
||||
if (world.isAllowed(player.getObjectId()))
|
||||
{
|
||||
Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
|
||||
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
|
||||
|
||||
// teleports entire party away
|
||||
for (L2PcInstance partyMember : party.getMembers())
|
||||
|
@@ -725,7 +725,7 @@ public final class KartiasLabyrinth extends AbstractInstance
|
||||
{
|
||||
lastEntry = player.getVariables().getLong(KARTIA_PARTY_ENTRY_VAR, 0);
|
||||
}
|
||||
Calendar entryResetTime = Calendar.getInstance();
|
||||
final Calendar entryResetTime = Calendar.getInstance();
|
||||
entryResetTime.set(Calendar.HOUR, 6);
|
||||
entryResetTime.set(Calendar.MINUTE, 30);
|
||||
entryResetTime.set(Calendar.AM_PM, Calendar.AM);
|
||||
|
@@ -256,7 +256,7 @@ public class MonasteryOfSilence2 extends AbstractNpcAI
|
||||
|
||||
if ((holder != null) && (instanceId > 0))
|
||||
{
|
||||
L2Npc support = addSpawn(Elcadia_Support, player.getX(), player.getY(), player.getZ(), 0, false, 0L, false, player.getInstanceId());
|
||||
final L2Npc support = addSpawn(Elcadia_Support, player.getX(), player.getY(), player.getZ(), 0, false, 0L, false, player.getInstanceId());
|
||||
holder.mobs.add(support);
|
||||
startQuestTimer("check_follow", 3000, support, player);
|
||||
}
|
||||
@@ -272,7 +272,7 @@ public class MonasteryOfSilence2 extends AbstractNpcAI
|
||||
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON));
|
||||
return;
|
||||
}
|
||||
Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
|
||||
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
|
||||
if (inst != null)
|
||||
{
|
||||
teleportPlayer(npc, player, TELEPORTS[ENTER], world.getInstanceId());
|
||||
@@ -296,10 +296,10 @@ public class MonasteryOfSilence2 extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = getNoQuestMsg(player);
|
||||
final String htmltext = getNoQuestMsg(player);
|
||||
QuestState st = player.getQuestState(MonasteryOfSilence2.class.getSimpleName());
|
||||
QuestState qs = player.getQuestState(Q10294_SevenSignsToTheMonasteryOfSilence.class.getSimpleName());
|
||||
QuestState qs1 = player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName());
|
||||
final QuestState qs = player.getQuestState(Q10294_SevenSignsToTheMonasteryOfSilence.class.getSimpleName());
|
||||
final QuestState qs1 = player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName());
|
||||
if (st == null)
|
||||
{
|
||||
st = newQuestState(player);
|
||||
@@ -393,7 +393,7 @@ public class MonasteryOfSilence2 extends AbstractNpcAI
|
||||
player.showQuestMovie(29);
|
||||
startQuestTimer("teleport", 60000, npc, player);
|
||||
cancelQuestTimer("check_follow", npc, player);
|
||||
InstanceHolder holder = instanceWorlds.get(player.getInstanceId());
|
||||
final InstanceHolder holder = instanceWorlds.get(player.getInstanceId());
|
||||
if (holder != null)
|
||||
{
|
||||
for (L2Npc h : holder.mobs)
|
||||
@@ -433,7 +433,7 @@ public class MonasteryOfSilence2 extends AbstractNpcAI
|
||||
else if ("Exit".equals(event))
|
||||
{
|
||||
cancelQuestTimer("check_follow", npc, player);
|
||||
InstanceHolder holder = instanceWorlds.get(player.getInstanceId());
|
||||
final InstanceHolder holder = instanceWorlds.get(player.getInstanceId());
|
||||
if (holder != null)
|
||||
{
|
||||
for (L2Npc h : holder.mobs)
|
||||
@@ -497,7 +497,7 @@ public class MonasteryOfSilence2 extends AbstractNpcAI
|
||||
{
|
||||
st = newQuestState(player);
|
||||
}
|
||||
int npcId = npc.getId();
|
||||
final int npcId = npc.getId();
|
||||
if (npcId == OddGlobe)
|
||||
{
|
||||
if ((player.getQuestState(Q10294_SevenSignsToTheMonasteryOfSilence.class.getSimpleName()) != null) && (player.getQuestState(Q10294_SevenSignsToTheMonasteryOfSilence.class.getSimpleName()).getState() == State.STARTED))
|
||||
|
@@ -236,10 +236,10 @@ public final class NornilsGarden extends AbstractInstance
|
||||
|
||||
private void exitInstance(L2PcInstance player)
|
||||
{
|
||||
InstanceWorld inst = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
||||
final InstanceWorld inst = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
||||
if (inst instanceof NornilsWorld)
|
||||
{
|
||||
NornilsWorld world = ((NornilsWorld) inst);
|
||||
final NornilsWorld world = ((NornilsWorld) inst);
|
||||
world.removeAllowed(player.getObjectId());
|
||||
teleportPlayer(player, EXIT_PPL, 0);
|
||||
}
|
||||
@@ -258,7 +258,7 @@ public final class NornilsGarden extends AbstractInstance
|
||||
// check for level difference again on reenter
|
||||
if ((player.getLevel() > INSTANCE_LVL_MAX) || (player.getLevel() < INSTANCE_LVL_MIN))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
sm.addPcName(player);
|
||||
player.sendPacket(sm);
|
||||
return null;
|
||||
@@ -272,7 +272,7 @@ public final class NornilsGarden extends AbstractInstance
|
||||
return null;
|
||||
}
|
||||
// Creating new instance
|
||||
String result = checkConditions(npc, player);
|
||||
final String result = checkConditions(npc, player);
|
||||
if (!(result.equalsIgnoreCase("ok")))
|
||||
{
|
||||
return result;
|
||||
@@ -321,10 +321,10 @@ public final class NornilsGarden extends AbstractInstance
|
||||
|
||||
private void spawn1(L2Npc npc)
|
||||
{
|
||||
InstanceWorld inst = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld inst = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (inst instanceof NornilsWorld)
|
||||
{
|
||||
NornilsWorld world = ((NornilsWorld) inst);
|
||||
final NornilsWorld world = ((NornilsWorld) inst);
|
||||
if (npc.equals(world.first_npc) && !world.spawned_1)
|
||||
{
|
||||
world.spawned_1 = true;
|
||||
@@ -339,10 +339,10 @@ public final class NornilsGarden extends AbstractInstance
|
||||
|
||||
private void spawn2(L2Npc npc)
|
||||
{
|
||||
InstanceWorld inst = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld inst = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (inst instanceof NornilsWorld)
|
||||
{
|
||||
NornilsWorld world = ((NornilsWorld) inst);
|
||||
final NornilsWorld world = ((NornilsWorld) inst);
|
||||
if (!world.spawned_2)
|
||||
{
|
||||
world.spawned_2 = true;
|
||||
@@ -357,10 +357,10 @@ public final class NornilsGarden extends AbstractInstance
|
||||
|
||||
private void spawn3(L2Character cha)
|
||||
{
|
||||
InstanceWorld inst = InstanceManager.getInstance().getWorld(cha.getInstanceId());
|
||||
final InstanceWorld inst = InstanceManager.getInstance().getWorld(cha.getInstanceId());
|
||||
if (inst instanceof NornilsWorld)
|
||||
{
|
||||
NornilsWorld world = ((NornilsWorld) inst);
|
||||
final NornilsWorld world = ((NornilsWorld) inst);
|
||||
if (!world.spawned_3)
|
||||
{
|
||||
world.spawned_3 = true;
|
||||
@@ -375,10 +375,10 @@ public final class NornilsGarden extends AbstractInstance
|
||||
|
||||
private void spawn4(L2Character cha)
|
||||
{
|
||||
InstanceWorld inst = InstanceManager.getInstance().getWorld(cha.getInstanceId());
|
||||
final InstanceWorld inst = InstanceManager.getInstance().getWorld(cha.getInstanceId());
|
||||
if (inst instanceof NornilsWorld)
|
||||
{
|
||||
NornilsWorld world = ((NornilsWorld) inst);
|
||||
final NornilsWorld world = ((NornilsWorld) inst);
|
||||
if (!world.spawned_4)
|
||||
{
|
||||
world.spawned_4 = true;
|
||||
@@ -394,7 +394,7 @@ public final class NornilsGarden extends AbstractInstance
|
||||
public void openDoor(QuestState st, L2PcInstance player, int doorId)
|
||||
{
|
||||
st.unset("correct");
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
||||
if (tmpworld instanceof NornilsWorld)
|
||||
{
|
||||
openDoor(doorId, tmpworld.getInstanceId());
|
||||
@@ -423,21 +423,21 @@ public final class NornilsGarden extends AbstractInstance
|
||||
// player level must be in range
|
||||
if (partyMember.getLevel() > INSTANCE_LVL_MAX)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
sm.addPcName(partyMember);
|
||||
player.sendPacket(sm);
|
||||
return "32330-06.html";
|
||||
}
|
||||
if (partyMember.getLevel() < INSTANCE_LVL_MIN)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
sm.addPcName(partyMember);
|
||||
player.sendPacket(sm);
|
||||
return "32330-07.html";
|
||||
}
|
||||
if (partyMember.getClassId().level() != 0)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||
sm.addPcName(partyMember);
|
||||
player.sendPacket(sm);
|
||||
return "32330-06.html";
|
||||
@@ -445,7 +445,7 @@ public final class NornilsGarden extends AbstractInstance
|
||||
// player must be near party leader
|
||||
if (!partyMember.isInsideRadius(player, 500, true, true))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||
sm.addPcName(partyMember);
|
||||
player.sendPacket(sm);
|
||||
return "32330-08.html";
|
||||
@@ -467,7 +467,7 @@ public final class NornilsGarden extends AbstractInstance
|
||||
{
|
||||
if ((character instanceof L2PcInstance) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(character.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(character.getInstanceId());
|
||||
if (tmpworld instanceof NornilsWorld)
|
||||
{
|
||||
for (int _auto[] : _auto_gates)
|
||||
@@ -495,7 +495,7 @@ public final class NornilsGarden extends AbstractInstance
|
||||
public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = event;
|
||||
QuestState st = getQuestState(player, false);
|
||||
final QuestState st = getQuestState(player, false);
|
||||
if (st == null)
|
||||
{
|
||||
return getNoQuestMsg(player);
|
||||
@@ -536,7 +536,7 @@ public final class NornilsGarden extends AbstractInstance
|
||||
}
|
||||
else if (event.equalsIgnoreCase("check"))
|
||||
{
|
||||
int correct = st.getInt("correct");
|
||||
final int correct = st.getInt("correct");
|
||||
if ((npc.getId() == 32260) && (correct == 3))
|
||||
{
|
||||
openDoor(st, player, 16200014);
|
||||
@@ -611,7 +611,7 @@ public final class NornilsGarden extends AbstractInstance
|
||||
// Check if gatekeeper should open bridge, and open it
|
||||
if (_gk[2] > 0)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
||||
if (tmpworld instanceof NornilsWorld)
|
||||
{
|
||||
openDoor(_gk[2], tmpworld.getInstanceId());
|
||||
|
Reference in New Issue
Block a user