Added missing final modifiers.
This commit is contained in:
@@ -130,7 +130,7 @@ public class EnergySeeds extends AbstractNpcAI
|
||||
|
||||
if (_spawnedNpcs.containsKey(npc) && SPAWNS.containsKey(_spawnedNpcs.get(npc)))
|
||||
{
|
||||
ESSpawn spawn = SPAWNS.get(_spawnedNpcs.get(npc));
|
||||
final ESSpawn spawn = SPAWNS.get(_spawnedNpcs.get(npc));
|
||||
spawn.scheduleRespawn(RESPAWN + getRandom(RANDOM_RESPAWN_OFFSET));
|
||||
_spawnedNpcs.remove(npc);
|
||||
if (isSeedActive(spawn._seedId))
|
||||
@@ -184,7 +184,7 @@ public class EnergySeeds extends AbstractNpcAI
|
||||
{
|
||||
for (int doorId : SEED_OF_DESTRUCTION_DOORS)
|
||||
{
|
||||
L2DoorInstance doorInstance = DoorData.getInstance().getDoor(doorId);
|
||||
final L2DoorInstance doorInstance = DoorData.getInstance().getDoor(doorId);
|
||||
if (doorInstance != null)
|
||||
{
|
||||
doorInstance.openMe();
|
||||
@@ -196,7 +196,7 @@ public class EnergySeeds extends AbstractNpcAI
|
||||
{
|
||||
for (int doorId : SEED_OF_DESTRUCTION_DOORS)
|
||||
{
|
||||
L2DoorInstance doorInstance = DoorData.getInstance().getDoor(doorId);
|
||||
final L2DoorInstance doorInstance = DoorData.getInstance().getDoor(doorId);
|
||||
if (doorInstance != null)
|
||||
{
|
||||
doorInstance.closeMe();
|
||||
@@ -316,7 +316,7 @@ public class EnergySeeds extends AbstractNpcAI
|
||||
case ANNIHILATION_BISTAKON:
|
||||
if (getRandom(100) < 50)
|
||||
{
|
||||
L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[0][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[0].length)]);
|
||||
final L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[0][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[0].length)]);
|
||||
mob.setRunning();
|
||||
mob.addDamageHate(player, 0, 999);
|
||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
@@ -325,7 +325,7 @@ public class EnergySeeds extends AbstractNpcAI
|
||||
case ANNIHILATION_REPTILIKON:
|
||||
if (getRandom(100) < 50)
|
||||
{
|
||||
L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[1][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[1].length)]);
|
||||
final L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[1][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[1].length)]);
|
||||
mob.setRunning();
|
||||
mob.addDamageHate(player, 0, 999);
|
||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
@@ -334,7 +334,7 @@ public class EnergySeeds extends AbstractNpcAI
|
||||
case ANNIHILATION_COKRAKON:
|
||||
if (getRandom(100) < 50)
|
||||
{
|
||||
L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[2][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[2].length)]);
|
||||
final L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[2][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[2].length)]);
|
||||
mob.setRunning();
|
||||
mob.addDamageHate(player, 0, 999);
|
||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
@@ -345,8 +345,8 @@ public class EnergySeeds extends AbstractNpcAI
|
||||
|
||||
private L2MonsterInstance spawnSupriseMob(L2Npc energy, int npcId)
|
||||
{
|
||||
L2NpcTemplate surpriseMobTemplate = NpcData.getInstance().getTemplate(npcId);
|
||||
L2MonsterInstance monster = new L2MonsterInstance(surpriseMobTemplate);
|
||||
final L2NpcTemplate surpriseMobTemplate = NpcData.getInstance().getTemplate(npcId);
|
||||
final L2MonsterInstance monster = new L2MonsterInstance(surpriseMobTemplate);
|
||||
monster.setCurrentHpMp(monster.getMaxHp(), monster.getMaxMp());
|
||||
monster.setHeading(energy.getHeading());
|
||||
monster.setInstanceId(energy.getInstanceId());
|
||||
@@ -717,7 +717,7 @@ public class EnergySeeds extends AbstractNpcAI
|
||||
if (isSeedActive(_seedId))
|
||||
{
|
||||
// get a random NPC that should spawn at this location
|
||||
Integer spawnId = _spawnId; // the map uses "Integer", not "int"
|
||||
final Integer spawnId = _spawnId; // the map uses "Integer", not "int"
|
||||
_spawnedNpcs.put(addSpawn(_npcIds[getRandom(_npcIds.length)], _loc, false, 0), spawnId);
|
||||
}
|
||||
}, waitTime);
|
||||
|
@@ -102,13 +102,13 @@ public class Lindvior extends AbstractNpcAI
|
||||
|
||||
public void scheduleNextLindviorVisit()
|
||||
{
|
||||
long delay = (ALT_MODE) ? ALT_MODE_MIN * 60000 : scheduleNextLindviorDate();
|
||||
final long delay = (ALT_MODE) ? ALT_MODE_MIN * 60000 : scheduleNextLindviorDate();
|
||||
startQuestTimer("start", delay, null, null);
|
||||
}
|
||||
|
||||
protected long scheduleNextLindviorDate()
|
||||
{
|
||||
GregorianCalendar date = new GregorianCalendar();
|
||||
final GregorianCalendar date = new GregorianCalendar();
|
||||
date.set(Calendar.MINUTE, RESET_MIN);
|
||||
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
|
||||
if (System.currentTimeMillis() >= date.getTimeInMillis())
|
||||
@@ -116,7 +116,7 @@ public class Lindvior extends AbstractNpcAI
|
||||
date.add(Calendar.DAY_OF_WEEK, 1);
|
||||
}
|
||||
|
||||
int dayOfWeek = date.get(Calendar.DAY_OF_WEEK);
|
||||
final int dayOfWeek = date.get(Calendar.DAY_OF_WEEK);
|
||||
if (dayOfWeek <= RESET_DAY_1)
|
||||
{
|
||||
date.add(Calendar.DAY_OF_WEEK, RESET_DAY_1 - dayOfWeek);
|
||||
|
@@ -82,7 +82,7 @@ public final class GeneralDilios extends AbstractNpcAI
|
||||
}
|
||||
else if (event.startsWith("guard_animation_"))
|
||||
{
|
||||
int value = Integer.parseInt(event.substring(16));
|
||||
final int value = Integer.parseInt(event.substring(16));
|
||||
for (L2Spawn guard : _guards)
|
||||
{
|
||||
guard.getLastSpawn().broadcastSocialAction(4);
|
||||
|
@@ -228,7 +228,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
||||
});
|
||||
|
||||
int buffsNow = 0;
|
||||
String var = loadGlobalQuestVar("SeedNextStatusChange");
|
||||
final String var = loadGlobalQuestVar("SeedNextStatusChange");
|
||||
if (var.equalsIgnoreCase("") || (Long.parseLong(var) < System.currentTimeMillis()))
|
||||
{
|
||||
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
|
||||
@@ -249,7 +249,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
||||
|
||||
private Long getNextSeedsStatusChangeTime()
|
||||
{
|
||||
Calendar reenter = Calendar.getInstance();
|
||||
final Calendar reenter = Calendar.getInstance();
|
||||
reenter.set(Calendar.SECOND, 0);
|
||||
reenter.set(Calendar.MINUTE, 0);
|
||||
reenter.set(Calendar.HOUR_OF_DAY, 13);
|
||||
@@ -301,7 +301,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
||||
{
|
||||
if (event.equalsIgnoreCase("ChangeSeedsStatus"))
|
||||
{
|
||||
int buffsNow = getRandom(ZONE_BUFFS_LIST.length);
|
||||
final int buffsNow = getRandom(ZONE_BUFFS_LIST.length);
|
||||
saveGlobalQuestVar("SeedBuffsList", String.valueOf(buffsNow));
|
||||
_seedsNextStatusChange = getNextSeedsStatusChangeTime();
|
||||
saveGlobalQuestVar("SeedNextStatusChange", String.valueOf(_seedsNextStatusChange));
|
||||
@@ -314,7 +314,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
||||
af.setDisplayEffect(_regionsData[i].activeBuff);
|
||||
}
|
||||
|
||||
L2EffectZone zone = ZoneManager.getInstance().getZoneById(_regionsData[i].buff_zone, L2EffectZone.class);
|
||||
final L2EffectZone zone = ZoneManager.getInstance().getZoneById(_regionsData[i].buff_zone, L2EffectZone.class);
|
||||
zone.clearSkills();
|
||||
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
|
||||
}
|
||||
@@ -342,7 +342,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
||||
{
|
||||
if (TELEPORT_ZONES.containsKey(zone.getId()))
|
||||
{
|
||||
Location teleLoc = TELEPORT_ZONES.get(zone.getId());
|
||||
final Location teleLoc = TELEPORT_ZONES.get(zone.getId());
|
||||
character.teleToLocation(teleLoc, false);
|
||||
}
|
||||
return super.onEnterZone(character, zone);
|
||||
|
@@ -83,7 +83,7 @@ public final class SecretArea extends Quest
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = getNoQuestMsg(player);
|
||||
final String htmltext = getNoQuestMsg(player);
|
||||
if ((npc.getId() == GINBY) && event.equalsIgnoreCase("enter"))
|
||||
{
|
||||
enterInstance(player);
|
||||
|
@@ -249,19 +249,19 @@ public final class Stage1 extends Quest
|
||||
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/seed_of_destruction.xml");
|
||||
final File file = new File(Config.DATAPACK_ROOT + "/spawnZones/seed_of_destruction.xml");
|
||||
if (!file.exists())
|
||||
{
|
||||
_log.severe("[Seed of Destruction] Missing seed_of_destruction.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())
|
||||
@@ -279,7 +279,7 @@ public final class Stage1 extends Quest
|
||||
_log.severe("[Seed of Destruction] 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)
|
||||
@@ -287,7 +287,7 @@ public final class Stage1 extends Quest
|
||||
_log.severe("[Seed of Destruction] Missing flag in npc List npcId: " + npcId + ", skipping");
|
||||
continue;
|
||||
}
|
||||
int flag = Integer.parseInt(attrs.getNamedItem("flag").getNodeValue());
|
||||
final int flag = Integer.parseInt(attrs.getNamedItem("flag").getNodeValue());
|
||||
if (!_spawnList.containsKey(flag))
|
||||
{
|
||||
_spawnList.put(flag, new ArrayList<SODSpawn>());
|
||||
@@ -298,7 +298,7 @@ public final class Stage1 extends Quest
|
||||
if ("loc".equalsIgnoreCase(cd.getNodeName()))
|
||||
{
|
||||
attrs = cd.getAttributes();
|
||||
SODSpawn spw = new SODSpawn();
|
||||
final SODSpawn spw = new SODSpawn();
|
||||
spw.npcId = npcId;
|
||||
|
||||
att = attrs.getNamedItem("x");
|
||||
@@ -352,7 +352,7 @@ public final class Stage1 extends Quest
|
||||
else if ("zone".equalsIgnoreCase(cd.getNodeName()))
|
||||
{
|
||||
attrs = cd.getAttributes();
|
||||
SODSpawn spw = new SODSpawn();
|
||||
final SODSpawn spw = new SODSpawn();
|
||||
spw.npcId = npcId;
|
||||
spw.isZone = true;
|
||||
|
||||
@@ -403,22 +403,22 @@ public final class Stage1 extends Quest
|
||||
_log.severe("[Seed of Destruction] 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("[Seed of Destruction] 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("[Seed of Destruction] 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())
|
||||
{
|
||||
@@ -495,22 +495,22 @@ public final class Stage1 extends Quest
|
||||
{
|
||||
if (partyMember.getLevel() < 75)
|
||||
{
|
||||
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;
|
||||
}
|
||||
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(), INSTANCEID);
|
||||
final Long reentertime = InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), INSTANCEID);
|
||||
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;
|
||||
@@ -640,7 +640,7 @@ public final class Stage1 extends Quest
|
||||
spawnFlaggedNPCs(world, 0);
|
||||
break;
|
||||
case 1:
|
||||
ExShowScreenMessage message1 = new ExShowScreenMessage(NpcStringId.THE_ENEMIES_HAVE_ATTACKED_EVERYONE_COME_OUT_AND_FIGHT_URGH, 5, 1);
|
||||
final ExShowScreenMessage message1 = new ExShowScreenMessage(NpcStringId.THE_ENEMIES_HAVE_ATTACKED_EVERYONE_COME_OUT_AND_FIGHT_URGH, 5, 1);
|
||||
sendScreenMessage(world, message1);
|
||||
for (int i : ENTRANCE_ROOM_DOORS)
|
||||
{
|
||||
@@ -653,7 +653,7 @@ public final class Stage1 extends Quest
|
||||
// handled elsewhere
|
||||
return true;
|
||||
case 4:
|
||||
ExShowScreenMessage message2 = new ExShowScreenMessage(NpcStringId.OBELISK_HAS_COLLAPSED_DON_T_LET_THE_ENEMIES_JUMP_AROUND_WILDLY_ANYMORE, 5, 1);
|
||||
final ExShowScreenMessage message2 = new ExShowScreenMessage(NpcStringId.OBELISK_HAS_COLLAPSED_DON_T_LET_THE_ENEMIES_JUMP_AROUND_WILDLY_ANYMORE, 5, 1);
|
||||
sendScreenMessage(world, message2);
|
||||
for (int i : SQUARE_DOORS)
|
||||
{
|
||||
@@ -673,7 +673,7 @@ public final class Stage1 extends Quest
|
||||
spawnFlaggedNPCs(world, 7);
|
||||
break;
|
||||
case 8:
|
||||
ExShowScreenMessage message4 = new ExShowScreenMessage(NpcStringId.COME_OUT_WARRIORS_PROTECT_SEED_OF_DESTRUCTION, 5, 1);
|
||||
final ExShowScreenMessage message4 = new ExShowScreenMessage(NpcStringId.COME_OUT_WARRIORS_PROTECT_SEED_OF_DESTRUCTION, 5, 1);
|
||||
sendScreenMessage(world, message4);
|
||||
world.deviceSpawnedMobCount = 0;
|
||||
spawnFlaggedNPCs(world, 8);
|
||||
@@ -718,7 +718,7 @@ public final class Stage1 extends Quest
|
||||
addTrap(npcId, x, y, z, h, skill, world.getInstanceId());
|
||||
return;
|
||||
}
|
||||
L2Npc npc = addSpawn(npcId, x, y, z, h, false, 0, false, world.getInstanceId());
|
||||
final L2Npc npc = addSpawn(npcId, x, y, z, h, false, 0, false, world.getInstanceId());
|
||||
if (addToKillTable)
|
||||
{
|
||||
world.npcList.put(npc, false);
|
||||
@@ -748,7 +748,7 @@ public final class Stage1 extends Quest
|
||||
|
||||
protected void setInstanceTimeRestrictions(SOD1World world)
|
||||
{
|
||||
Calendar reenter = Calendar.getInstance();
|
||||
final Calendar reenter = Calendar.getInstance();
|
||||
reenter.set(Calendar.MINUTE, RESET_MIN);
|
||||
reenter.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
|
||||
// if time is >= RESET_HOUR - roll to the next day
|
||||
@@ -771,13 +771,13 @@ public final class Stage1 extends Quest
|
||||
}
|
||||
}
|
||||
|
||||
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(INSTANCEID);
|
||||
|
||||
// set instance reenter time for all allowed players
|
||||
for (int objectId : world.getAllowed())
|
||||
{
|
||||
L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
||||
InstanceManager.getInstance().setInstanceTime(objectId, INSTANCEID, reenter.getTimeInMillis());
|
||||
if ((player != null) && player.isOnline())
|
||||
{
|
||||
@@ -790,7 +790,7 @@ public final class Stage1 extends Quest
|
||||
{
|
||||
for (int objId : world.getAllowed())
|
||||
{
|
||||
L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||
if (player != null)
|
||||
{
|
||||
player.sendPacket(message);
|
||||
@@ -817,17 +817,17 @@ public final class Stage1 extends Quest
|
||||
{
|
||||
if (!isSummon && (player != null))
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
||||
if (tmpworld instanceof SOD1World)
|
||||
{
|
||||
SOD1World world = (SOD1World) tmpworld;
|
||||
final SOD1World world = (SOD1World) tmpworld;
|
||||
if (world.getStatus() == 7)
|
||||
{
|
||||
if (spawnState(world))
|
||||
{
|
||||
for (int objId : world.getAllowed())
|
||||
{
|
||||
L2PcInstance pl = L2World.getInstance().getPlayer(objId);
|
||||
final L2PcInstance pl = L2World.getInstance().getPlayer(objId);
|
||||
if (pl != null)
|
||||
{
|
||||
pl.showQuestMovie(5);
|
||||
@@ -844,10 +844,10 @@ public final class Stage1 extends Quest
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon, Skill skill)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof SOD1World)
|
||||
{
|
||||
SOD1World world = (SOD1World) tmpworld;
|
||||
final SOD1World world = (SOD1World) tmpworld;
|
||||
if ((world.getStatus() == 2) && (npc.getId() == OBELISK))
|
||||
{
|
||||
world.setStatus(4);
|
||||
@@ -876,16 +876,16 @@ public final class Stage1 extends Quest
|
||||
@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 SOD1World)
|
||||
{
|
||||
SOD1World world = (SOD1World) tmpworld;
|
||||
final SOD1World world = (SOD1World) tmpworld;
|
||||
if (event.equalsIgnoreCase("Spawn"))
|
||||
{
|
||||
L2PcInstance target = L2World.getInstance().getPlayer(world.getAllowed().get(getRandom(world.getAllowed().size())));
|
||||
final L2PcInstance target = L2World.getInstance().getPlayer(world.getAllowed().get(getRandom(world.getAllowed().size())));
|
||||
if ((world.deviceSpawnedMobCount < MAX_DEVICESPAWNEDMOBCOUNT) && (target != null) && (target.getInstanceId() == npc.getInstanceId()) && !target.isDead())
|
||||
{
|
||||
L2Attackable mob = (L2Attackable) addSpawn(SPAWN_MOB_IDS[getRandom(SPAWN_MOB_IDS.length)], npc.getSpawn().getLocation(), false, 0, false, world.getInstanceId());
|
||||
final L2Attackable mob = (L2Attackable) addSpawn(SPAWN_MOB_IDS[getRandom(SPAWN_MOB_IDS.length)], npc.getSpawn().getLocation(), false, 0, false, world.getInstanceId());
|
||||
world.deviceSpawnedMobCount++;
|
||||
mob.setSeeThroughSilentMove(true);
|
||||
mob.setRunning();
|
||||
@@ -901,12 +901,12 @@ public final class Stage1 extends Quest
|
||||
}
|
||||
else if (event.equalsIgnoreCase("DoorCheck"))
|
||||
{
|
||||
L2DoorInstance tmp = getDoor(FORTRESS_DOOR, npc.getInstanceId());
|
||||
final L2DoorInstance tmp = getDoor(FORTRESS_DOOR, npc.getInstanceId());
|
||||
if (tmp.getCurrentHp() < tmp.getMaxHp())
|
||||
{
|
||||
world.deviceSpawnedMobCount = 0;
|
||||
spawnFlaggedNPCs(world, 6);
|
||||
ExShowScreenMessage message3 = new ExShowScreenMessage(NpcStringId.ENEMIES_ARE_TRYING_TO_DESTROY_THE_FORTRESS_EVERYONE_DEFEND_THE_FORTRESS, 5, 1);
|
||||
final ExShowScreenMessage message3 = new ExShowScreenMessage(NpcStringId.ENEMIES_ARE_TRYING_TO_DESTROY_THE_FORTRESS_EVERYONE_DEFEND_THE_FORTRESS, 5, 1);
|
||||
sendScreenMessage(world, message3);
|
||||
}
|
||||
else
|
||||
@@ -926,7 +926,7 @@ public final class Stage1 extends Quest
|
||||
L2Character mostHate = ((L2Attackable) npc).getMostHated();
|
||||
if (mostHate != null)
|
||||
{
|
||||
double dist = Util.calculateDistance(mostHate.getXdestination(), mostHate.getYdestination(), 0, npc.getSpawn().getX(), npc.getSpawn().getY(), 0, false, false);
|
||||
final double dist = Util.calculateDistance(mostHate.getXdestination(), mostHate.getYdestination(), 0, npc.getSpawn().getX(), npc.getSpawn().getY(), 0, false, false);
|
||||
if (dist > 900)
|
||||
{
|
||||
((L2Attackable) npc).reduceHate(mostHate, ((L2Attackable) npc).getHating(mostHate));
|
||||
@@ -950,10 +950,10 @@ public final class Stage1 extends Quest
|
||||
cancelQuestTimer("Spawn", npc, null);
|
||||
return "";
|
||||
}
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof SOD1World)
|
||||
{
|
||||
SOD1World world = (SOD1World) tmpworld;
|
||||
final SOD1World world = (SOD1World) tmpworld;
|
||||
if (world.getStatus() == 1)
|
||||
{
|
||||
if (checkKillProgress(npc, world))
|
||||
@@ -993,7 +993,7 @@ public final class Stage1 extends Quest
|
||||
world.incStatus();
|
||||
for (int objId : world.getAllowed())
|
||||
{
|
||||
L2PcInstance pl = L2World.getInstance().getPlayer(objId);
|
||||
final L2PcInstance pl = L2World.getInstance().getPlayer(objId);
|
||||
if (pl != null)
|
||||
{
|
||||
pl.showQuestMovie(6);
|
||||
@@ -1018,11 +1018,11 @@ public final class Stage1 extends Quest
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
final int npcId = npc.getId();
|
||||
getQuestState(player, true);
|
||||
if (npcId == ALENOS)
|
||||
{
|
||||
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||
if ((GraciaSeedsManager.getInstance().getSoDState() == 1) || ((world != null) && (world instanceof SOD1World)))
|
||||
{
|
||||
enterInstance(player, "SeedOfDestructionStage1.xml", ENTER_TELEPORT_1);
|
||||
@@ -1042,10 +1042,10 @@ public final class Stage1 extends Quest
|
||||
@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 SOD1World)
|
||||
{
|
||||
SOD1World world = (SOD1World) tmpworld;
|
||||
final SOD1World world = (SOD1World) tmpworld;
|
||||
switch (action)
|
||||
{
|
||||
case TRAP_TRIGGERED:
|
||||
|
@@ -266,7 +266,7 @@ public final class HallOfSuffering extends AbstractNpcAI
|
||||
{
|
||||
return;
|
||||
}
|
||||
L2Party party = player.getParty();
|
||||
final L2Party party = player.getParty();
|
||||
final int instanceId = InstanceManager.getInstance().createDynamicInstance(template);
|
||||
world = new HSWorld();
|
||||
world.setInstanceId(instanceId);
|
||||
@@ -394,7 +394,7 @@ public final class HallOfSuffering extends AbstractNpcAI
|
||||
|
||||
private void calcRewardItemId(HSWorld world)
|
||||
{
|
||||
Long finishDiff = System.currentTimeMillis() - world.startTime;
|
||||
final Long finishDiff = System.currentTimeMillis() - world.startTime;
|
||||
if (finishDiff < 1260000)
|
||||
{
|
||||
world.rewardHtm = "32530-00.htm";
|
||||
@@ -472,10 +472,10 @@ public final class HallOfSuffering extends AbstractNpcAI
|
||||
@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 HSWorld)
|
||||
{
|
||||
HSWorld world = (HSWorld) tmpworld;
|
||||
final HSWorld world = (HSWorld) tmpworld;
|
||||
if (event.equalsIgnoreCase("spawnBossGuards"))
|
||||
{
|
||||
if (!world.klanikus.isInCombat() && !world.klodekus.isInCombat())
|
||||
@@ -508,14 +508,14 @@ public final class HallOfSuffering extends AbstractNpcAI
|
||||
}
|
||||
else if (event.equalsIgnoreCase("ressurectTwin"))
|
||||
{
|
||||
Skill skill = SkillData.getInstance().getSkill(5824, 1);
|
||||
L2Npc aliveTwin = (world.klanikus == npc ? world.klodekus : world.klanikus);
|
||||
final Skill skill = SkillData.getInstance().getSkill(5824, 1);
|
||||
final L2Npc aliveTwin = (world.klanikus == npc ? world.klodekus : world.klanikus);
|
||||
npc.doRevive();
|
||||
npc.doCast(skill);
|
||||
npc.setCurrentHp(aliveTwin.getCurrentHp());
|
||||
|
||||
// get most hated of other boss
|
||||
L2Character hated = ((L2MonsterInstance) aliveTwin).getMostHated();
|
||||
final L2Character hated = ((L2MonsterInstance) aliveTwin).getMostHated();
|
||||
if (hated != null)
|
||||
{
|
||||
npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, hated, 1000);
|
||||
@@ -542,16 +542,16 @@ public final class HallOfSuffering extends AbstractNpcAI
|
||||
if (!world.isBossesAttacked)
|
||||
{
|
||||
world.isBossesAttacked = true;
|
||||
Calendar reenter = Calendar.getInstance();
|
||||
final Calendar reenter = Calendar.getInstance();
|
||||
reenter.add(Calendar.HOUR, INSTANCE_PENALTY);
|
||||
|
||||
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(tmpworld.getTemplateId());
|
||||
|
||||
// set instance reenter time for all allowed players
|
||||
for (int objectId : tmpworld.getAllowed())
|
||||
{
|
||||
L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
||||
if ((player != null) && player.isOnline())
|
||||
{
|
||||
InstanceManager.getInstance().setInstanceTime(objectId, tmpworld.getTemplateId(), reenter.getTimeInMillis());
|
||||
@@ -588,10 +588,10 @@ public final class HallOfSuffering extends AbstractNpcAI
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof HSWorld)
|
||||
{
|
||||
HSWorld world = (HSWorld) tmpworld;
|
||||
final HSWorld world = (HSWorld) tmpworld;
|
||||
|
||||
if (npc.getId() == TUMOR_ALIVE)
|
||||
{
|
||||
@@ -635,7 +635,7 @@ public final class HallOfSuffering extends AbstractNpcAI
|
||||
{
|
||||
if (npc.getId() == TEPIOS)
|
||||
{
|
||||
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||
if (((HSWorld) world).rewardItemId == -1)
|
||||
{
|
||||
_log.warning("Hall of Suffering: " + player.getName() + "(" + player.getObjectId() + ") is try to cheat!");
|
||||
@@ -665,7 +665,7 @@ public final class HallOfSuffering extends AbstractNpcAI
|
||||
}
|
||||
else if (npc.getId() == TEPIOS)
|
||||
{
|
||||
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(talker);
|
||||
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(talker);
|
||||
if (((HSWorld) world).rewardItemId == -1)
|
||||
{
|
||||
_log.warning("Hall of Suffering: " + talker.getName() + "(" + talker.getObjectId() + ") is try to cheat!");
|
||||
|
@@ -140,7 +140,7 @@ public abstract class AirShipController extends Quest
|
||||
player.sendPacket(SystemMessageId.AIRSHIP_SUMMON_LICENSE_REGISTRATION_CAN_ONLY_BE_DONE_BY_THE_CLAN_LEADER);
|
||||
return null;
|
||||
}
|
||||
int ownerId = player.getClanId();
|
||||
final int ownerId = player.getClanId();
|
||||
if (!AirShipManager.getInstance().hasAirShipLicense(ownerId))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.AN_AIRSHIP_CANNOT_BE_SUMMONED_BECAUSE_EITHER_YOU_HAVE_NOT_REGISTERED_YOUR_AIRSHIP_LICENSE_OR_THE_AIRSHIP_HAS_NOT_YET_BEEN_SUMMONED);
|
||||
@@ -349,7 +349,7 @@ public abstract class AirShipController extends Quest
|
||||
|
||||
protected void validityCheck()
|
||||
{
|
||||
L2ScriptZone zone = ZoneManager.getInstance().getZoneById(_dockZone, L2ScriptZone.class);
|
||||
final L2ScriptZone zone = ZoneManager.getInstance().getZoneById(_dockZone, L2ScriptZone.class);
|
||||
if (zone == null)
|
||||
{
|
||||
_log.log(Level.WARNING, getName() + ": Invalid zone " + _dockZone + ", controller disabled");
|
||||
|
Reference in New Issue
Block a user