Added missing final modifiers.
This commit is contained in:
@@ -71,15 +71,15 @@ public class HandysBlockCheckerEvent extends Quest
|
||||
|
||||
if (HandysBlockCheckerManager.getInstance().addPlayerToArena(player, arena))
|
||||
{
|
||||
ArenaParticipantsHolder holder = HandysBlockCheckerManager.getInstance().getHolder(arena);
|
||||
final ArenaParticipantsHolder holder = HandysBlockCheckerManager.getInstance().getHolder(arena);
|
||||
|
||||
final ExCubeGameTeamList tl = new ExCubeGameTeamList(holder.getRedPlayers(), holder.getBluePlayers(), arena);
|
||||
|
||||
player.sendPacket(tl);
|
||||
|
||||
int countBlue = holder.getBlueTeamSize();
|
||||
int countRed = holder.getRedTeamSize();
|
||||
int minMembers = Config.MIN_BLOCK_CHECKER_TEAM_MEMBERS;
|
||||
final int countBlue = holder.getBlueTeamSize();
|
||||
final int countRed = holder.getRedTeamSize();
|
||||
final int minMembers = Config.MIN_BLOCK_CHECKER_TEAM_MEMBERS;
|
||||
|
||||
if ((countBlue >= minMembers) && (countRed >= minMembers))
|
||||
{
|
||||
|
@@ -290,9 +290,9 @@ public class MC_Show extends AbstractNpcAI
|
||||
|
||||
private void scheduleTimer()
|
||||
{
|
||||
int gameTime = GameTimeController.getInstance().getGameTime();
|
||||
int hours = (gameTime / 60) % 24;
|
||||
int minutes = gameTime % 60;
|
||||
final int gameTime = GameTimeController.getInstance().getGameTime();
|
||||
final int hours = (gameTime / 60) % 24;
|
||||
final int minutes = gameTime % 60;
|
||||
int hourDiff, minDiff;
|
||||
hourDiff = (20 - hours);
|
||||
if (hourDiff < 0)
|
||||
@@ -310,7 +310,7 @@ public class MC_Show extends AbstractNpcAI
|
||||
diff = hourDiff + minDiff;
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||
final SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||
_log.info("Fantasy Isle: MC show script starting at " + format.format(System.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
|
||||
}
|
||||
// TODO startRepeatingQuestTimer("Start", diff, 14400000, null, null);
|
||||
|
@@ -160,7 +160,7 @@ public class Parade extends AbstractNpcAI
|
||||
|
||||
private long timeLeftMilli(int hh, int mm, int ss)
|
||||
{
|
||||
int now = (GameTimeController.getInstance().getGameTicks() * 60) / 100;
|
||||
final int now = (GameTimeController.getInstance().getGameTicks() * 60) / 100;
|
||||
int dd = ((hh * 3600) + (mm * 60) + ss) - (now % 86400);
|
||||
if (dd < 0)
|
||||
{
|
||||
@@ -194,16 +194,16 @@ public class Parade extends AbstractNpcAI
|
||||
spawnTask.cancel(false);
|
||||
break;
|
||||
}
|
||||
int npcId = ACTORS[npcIndex++];
|
||||
final int npcId = ACTORS[npcIndex++];
|
||||
if (npcId == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
for (int route = 0; route < 5; ++route)
|
||||
{
|
||||
int[] start = START[route][i];
|
||||
int[] goal = GOAL[route][i];
|
||||
L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
||||
final int[] start = START[route][i];
|
||||
final int[] goal = GOAL[route][i];
|
||||
final L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
||||
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(goal[0], goal[1], goal[2], goal[3]));
|
||||
spawns.add(actor);
|
||||
}
|
||||
|
@@ -226,7 +226,7 @@ public class ArcanRitual extends Quest
|
||||
player.sendPacket(trigger);
|
||||
if (message)
|
||||
{
|
||||
L2GameServerPacket sm = new ExShowScreenMessage(NpcStringId.DARK_POWER_SEEPS_OUT_FROM_THE_MIDDLE_OF_THE_TOWN, ExShowScreenMessage.TOP_CENTER, 5000);
|
||||
final L2GameServerPacket sm = new ExShowScreenMessage(NpcStringId.DARK_POWER_SEEPS_OUT_FROM_THE_MIDDLE_OF_THE_TOWN, ExShowScreenMessage.TOP_CENTER, 5000);
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
|
@@ -254,7 +254,7 @@ public final class BeastFarm extends AbstractNpcAI
|
||||
{
|
||||
final L2TamedBeastInstance nextNpc = new L2TamedBeastInstance(nextNpcId, player, food, npc.getX(), npc.getY(), npc.getZ(), true);
|
||||
|
||||
TamedBeast beast = TAMED_BEAST_DATA.get(getRandom(TAMED_BEAST_DATA.size()));
|
||||
final TamedBeast beast = TAMED_BEAST_DATA.get(getRandom(TAMED_BEAST_DATA.size()));
|
||||
String name = beast.getName();
|
||||
switch (nextNpcId)
|
||||
{
|
||||
@@ -275,7 +275,7 @@ public final class BeastFarm extends AbstractNpcAI
|
||||
nextNpc.broadcastPacket(new NpcInfo(nextNpc));
|
||||
nextNpc.setRunning();
|
||||
|
||||
SkillData st = SkillData.getInstance();
|
||||
final SkillData st = SkillData.getInstance();
|
||||
for (SkillHolder sh : beast.getSkills())
|
||||
{
|
||||
nextNpc.addBeastSkill(st.getSkill(sh.getSkillId(), sh.getSkillLvl()));
|
||||
@@ -287,7 +287,7 @@ public final class BeastFarm extends AbstractNpcAI
|
||||
{
|
||||
// if not trained, the newly spawned mob will automatically be agro against its feeder
|
||||
// (what happened to "never bite the hand that feeds you" anyway?!)
|
||||
L2Attackable nextNpc = (L2Attackable) addSpawn(nextNpcId, npc);
|
||||
final L2Attackable nextNpc = (L2Attackable) addSpawn(nextNpcId, npc);
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
||||
@@ -309,8 +309,8 @@ public final class BeastFarm extends AbstractNpcAI
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
// gather some values on local variables
|
||||
int npcId = npc.getId();
|
||||
int skillId = skill.getId();
|
||||
final int npcId = npc.getId();
|
||||
final int skillId = skill.getId();
|
||||
// check if the npc and skills used are valid for this script. Exit if invalid.
|
||||
if (!Util.contains(FEEDABLE_BEASTS, npcId) || ((skillId != SKILL_GOLDEN_SPICE) && (skillId != SKILL_CRYSTAL_SPICE) && (skillId != SKILL_BLESSED_GOLDEN_SPICE) && (skillId != SKILL_BLESSED_CRYSTAL_SPICE) && (skillId != SKILL_SGRADE_GOLDEN_SPICE) && (skillId != SKILL_SGRADE_CRYSTAL_SPICE)))
|
||||
{
|
||||
@@ -318,7 +318,7 @@ public final class BeastFarm extends AbstractNpcAI
|
||||
}
|
||||
|
||||
// first gather some values on local variables
|
||||
int objectId = npc.getObjectId();
|
||||
final int objectId = npc.getObjectId();
|
||||
int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3)
|
||||
if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId))
|
||||
{
|
||||
@@ -351,7 +351,7 @@ public final class BeastFarm extends AbstractNpcAI
|
||||
if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId))
|
||||
{
|
||||
// do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect).
|
||||
int newNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getLeveledNpcId(skillId);
|
||||
final int newNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getLeveledNpcId(skillId);
|
||||
if (newNpcId == -1)
|
||||
{
|
||||
if (growthLevel == 0)
|
||||
|
@@ -121,7 +121,7 @@ public final class DenOfEvil extends AbstractNpcAI
|
||||
{
|
||||
npc.disableCoreAI(true);
|
||||
npc.setIsImmobilized(true);
|
||||
L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
|
||||
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
|
||||
if (zone == null)
|
||||
{
|
||||
if (DEBUG)
|
||||
@@ -130,8 +130,8 @@ public final class DenOfEvil extends AbstractNpcAI
|
||||
}
|
||||
return null;
|
||||
}
|
||||
int skillId = getSkillIdByNpcId(npc.getId());
|
||||
int skillLevel = zone.getSkillLevel(skillId);
|
||||
final int skillId = getSkillIdByNpcId(npc.getId());
|
||||
final int skillLevel = zone.getSkillLevel(skillId);
|
||||
zone.addSkill(skillId, skillLevel + 1);
|
||||
if (skillLevel == 3) // 3+1=4
|
||||
{
|
||||
@@ -149,7 +149,7 @@ public final class DenOfEvil extends AbstractNpcAI
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000);
|
||||
L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
|
||||
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
|
||||
if (zone == null)
|
||||
{
|
||||
if (DEBUG)
|
||||
@@ -158,8 +158,8 @@ public final class DenOfEvil extends AbstractNpcAI
|
||||
}
|
||||
return null;
|
||||
}
|
||||
int skillId = getSkillIdByNpcId(npc.getId());
|
||||
int skillLevel = zone.getSkillLevel(skillId);
|
||||
final int skillId = getSkillIdByNpcId(npc.getId());
|
||||
final int skillLevel = zone.getSkillLevel(skillId);
|
||||
zone.addSkill(skillId, skillLevel - 1);
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
@@ -213,7 +213,7 @@ public final class DenOfEvil extends AbstractNpcAI
|
||||
}
|
||||
if (character.isPlayable())
|
||||
{
|
||||
Skill skill = SkillData.getInstance().getSkill(6149, 1);
|
||||
final Skill skill = SkillData.getInstance().getSkill(6149, 1);
|
||||
skill.applyEffects(character, character);
|
||||
}
|
||||
else
|
||||
@@ -223,7 +223,7 @@ public final class DenOfEvil extends AbstractNpcAI
|
||||
if (character.isNpc())
|
||||
{
|
||||
// respawn eye
|
||||
L2Npc npc = (L2Npc) character;
|
||||
final L2Npc npc = (L2Npc) character;
|
||||
if (Util.contains(EYE_IDS, npc.getId()))
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000);
|
||||
|
@@ -165,7 +165,7 @@ public final class FeedableBeasts extends AbstractNpcAI
|
||||
{
|
||||
int[][] temp;
|
||||
temp = _spiceToMob.get(spice);
|
||||
int rand = getRandom(temp[0].length);
|
||||
final int rand = getRandom(temp[0].length);
|
||||
return temp[0][rand];
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ public final class FeedableBeasts extends AbstractNpcAI
|
||||
|
||||
private void spawnNext(L2Npc npc, int growthLevel, L2PcInstance player, int food)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
final int npcId = npc.getId();
|
||||
int nextNpcId = 0;
|
||||
|
||||
// find the next mob to spawn, based on the current npcId, growthlevel, and food.
|
||||
@@ -442,8 +442,8 @@ public final class FeedableBeasts extends AbstractNpcAI
|
||||
// also, perform a rare random chat
|
||||
if (getRandom(20) == 0)
|
||||
{
|
||||
NpcStringId message = NpcStringId.getNpcStringId(getRandom(2024, 2029));
|
||||
NpcSay packet = new NpcSay(nextNpc, ChatType.NPC_GENERAL, message);
|
||||
final NpcStringId message = NpcStringId.getNpcStringId(getRandom(2024, 2029));
|
||||
final NpcSay packet = new NpcSay(nextNpc, ChatType.NPC_GENERAL, message);
|
||||
if (message.getParamCount() > 0) // player name, $s1
|
||||
{
|
||||
packet.addStringParameter(player.getName());
|
||||
@@ -469,7 +469,7 @@ public final class FeedableBeasts extends AbstractNpcAI
|
||||
{
|
||||
// if not trained, the newly spawned mob will automatically be aggro against its feeder
|
||||
// (what happened to "never bite the hand that feeds you" anyway?!)
|
||||
L2Attackable nextNpc = (L2Attackable) addSpawn(nextNpcId, npc);
|
||||
final L2Attackable nextNpc = (L2Attackable) addSpawn(nextNpcId, npc);
|
||||
|
||||
if (MAD_COW_POLYMORPH.containsKey(nextNpcId))
|
||||
{
|
||||
@@ -499,7 +499,7 @@ public final class FeedableBeasts extends AbstractNpcAI
|
||||
// despawn the mad cow
|
||||
npc.deleteMe();
|
||||
// spawn the new mob
|
||||
L2Attackable nextNpc = (L2Attackable) addSpawn(MAD_COW_POLYMORPH.get(npc.getId()), npc);
|
||||
final L2Attackable nextNpc = (L2Attackable) addSpawn(MAD_COW_POLYMORPH.get(npc.getId()), npc);
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
||||
@@ -521,8 +521,8 @@ public final class FeedableBeasts extends AbstractNpcAI
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
// gather some values on local variables
|
||||
int npcId = npc.getId();
|
||||
int skillId = skill.getId();
|
||||
final int npcId = npc.getId();
|
||||
final int skillId = skill.getId();
|
||||
// check if the npc and skills used are valid for this script. Exit if invalid.
|
||||
if ((skillId != SKILL_GOLDEN_SPICE) && (skillId != SKILL_CRYSTAL_SPICE))
|
||||
{
|
||||
@@ -530,7 +530,7 @@ public final class FeedableBeasts extends AbstractNpcAI
|
||||
}
|
||||
|
||||
// first gather some values on local variables
|
||||
int objectId = npc.getObjectId();
|
||||
final int objectId = npc.getObjectId();
|
||||
int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3)
|
||||
if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId))
|
||||
{
|
||||
@@ -571,8 +571,8 @@ public final class FeedableBeasts extends AbstractNpcAI
|
||||
// rare random talk...
|
||||
if (getRandom(20) == 0)
|
||||
{
|
||||
NpcStringId message = TEXT[growthLevel][getRandom(TEXT[growthLevel].length)];
|
||||
NpcSay packet = new NpcSay(npc, ChatType.NPC_GENERAL, message);
|
||||
final NpcStringId message = TEXT[growthLevel][getRandom(TEXT[growthLevel].length)];
|
||||
final NpcSay packet = new NpcSay(npc, ChatType.NPC_GENERAL, message);
|
||||
if (message.getParamCount() > 0) // player name, $s1
|
||||
{
|
||||
packet.addStringParameter(caster.getName());
|
||||
@@ -595,12 +595,12 @@ public final class FeedableBeasts extends AbstractNpcAI
|
||||
}
|
||||
else if (Util.contains(TAMED_BEASTS, npcId) && (npc instanceof L2TamedBeastInstance))
|
||||
{
|
||||
L2TamedBeastInstance beast = ((L2TamedBeastInstance) npc);
|
||||
final L2TamedBeastInstance beast = ((L2TamedBeastInstance) npc);
|
||||
if (skillId == beast.getFoodType())
|
||||
{
|
||||
beast.onReceiveFood();
|
||||
NpcStringId message = TAMED_TEXT[getRandom(TAMED_TEXT.length)];
|
||||
NpcSay packet = new NpcSay(npc, ChatType.NPC_GENERAL, message);
|
||||
final NpcStringId message = TAMED_TEXT[getRandom(TAMED_TEXT.length)];
|
||||
final NpcSay packet = new NpcSay(npc, ChatType.NPC_GENERAL, message);
|
||||
if (message.getParamCount() > 0)
|
||||
{
|
||||
packet.addStringParameter(caster.getName());
|
||||
|
@@ -84,13 +84,13 @@ public class HillsOfGold extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
L2Npc mob1 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||
final L2Npc mob1 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||
((L2MonsterInstance) mob1).addDamage(attacker, 1, null);
|
||||
L2Npc mob2 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||
final L2Npc mob2 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||
((L2MonsterInstance) mob2).addDamage(attacker, 1, null);
|
||||
L2Npc mob3 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||
final L2Npc mob3 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||
((L2MonsterInstance) mob3).addDamage(attacker, 1, null);
|
||||
L2Npc mob4 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||
final L2Npc mob4 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||
((L2MonsterInstance) mob4).addDamage(attacker, 1, null);
|
||||
npc.deleteMe();
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
|
@@ -97,7 +97,7 @@ public final class PolymorphingOnAttack extends AbstractNpcAI
|
||||
{
|
||||
if (tmp.get(3) >= 0)
|
||||
{
|
||||
NpcStringId npcString = MOBTEXTS[tmp.get(3)][getRandom(MOBTEXTS[tmp.get(3)].length)];
|
||||
final NpcStringId npcString = MOBTEXTS[tmp.get(3)][getRandom(MOBTEXTS[tmp.get(3)].length)];
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), npcString));
|
||||
|
||||
}
|
||||
|
@@ -331,7 +331,7 @@ public final class PrimevalIsle extends AbstractNpcAI
|
||||
{
|
||||
if ((characters != null) && (characters.isAttackable()) && (getRandomBoolean()))
|
||||
{
|
||||
L2Attackable monster = (L2Attackable) characters;
|
||||
final L2Attackable monster = (L2Attackable) characters;
|
||||
addAttackPlayerDesire(monster, playable);
|
||||
}
|
||||
}
|
||||
|
@@ -99,7 +99,7 @@ public final class StakatoNest extends AbstractNpcAI
|
||||
|
||||
if (_follower != null)
|
||||
{
|
||||
double _hp = _follower.getCurrentHp();
|
||||
final double _hp = _follower.getCurrentHp();
|
||||
|
||||
if (_hp > (_follower.getMaxHp() * 0.3))
|
||||
{
|
||||
@@ -129,7 +129,7 @@ public final class StakatoNest extends AbstractNpcAI
|
||||
Broadcast.toSelfAndKnownPlayers(npc, new MagicSkillUse(npc, 2046, 1, 1000, 0));
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
L2Npc spawned = addSpawn(STAKATO_CAPTAIN, monster, true);
|
||||
final L2Npc spawned = addSpawn(STAKATO_CAPTAIN, monster, true);
|
||||
addAttackPlayerDesire(spawned, killer);
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public final class StakatoNest extends AbstractNpcAI
|
||||
Broadcast.toSelfAndKnownPlayers(npc, new MagicSkillUse(npc, 2046, 1, 1000, 0));
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
L2Npc spawned = addSpawn(STAKATO_GUARD, monster, true);
|
||||
final L2Npc spawned = addSpawn(STAKATO_GUARD, monster, true);
|
||||
addAttackPlayerDesire(spawned, killer);
|
||||
}
|
||||
}
|
||||
@@ -163,7 +163,7 @@ public final class StakatoNest extends AbstractNpcAI
|
||||
case STAKATO_CHIEF:
|
||||
if (killer.isInParty())
|
||||
{
|
||||
List<L2PcInstance> party = killer.getParty().getMembers();
|
||||
final List<L2PcInstance> party = killer.getParty().getMembers();
|
||||
for (L2PcInstance member : party)
|
||||
{
|
||||
giveCocoon(member, npc);
|
||||
|
@@ -59,13 +59,13 @@ public final class Anais extends AbstractNpcAI
|
||||
|
||||
private void burnerOnAttack(int pot, L2Npc anais)
|
||||
{
|
||||
L2Npc npc = _divineBurners.get(pot);
|
||||
final L2Npc npc = _divineBurners.get(pot);
|
||||
npc.setDisplayEffect(1);
|
||||
npc.setIsRunning(false);
|
||||
if (pot < 4)
|
||||
{
|
||||
_current = npc;
|
||||
QuestTimer checkAround = getQuestTimer("CHECK", anais, null);
|
||||
final QuestTimer checkAround = getQuestTimer("CHECK", anais, null);
|
||||
if (checkAround == null) // || !checkAround.getIsActive()
|
||||
{
|
||||
startQuestTimer("CHECK", 3000, anais, null);
|
||||
@@ -101,7 +101,7 @@ public final class Anais extends AbstractNpcAI
|
||||
_pot = _pot + 1;
|
||||
b.setDisplayEffect(1);
|
||||
b.setIsRunning(false);
|
||||
L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0);
|
||||
final L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0);
|
||||
((L2Attackable) ward).addDamageHate(_nextTarget, 0, 999);
|
||||
ward.setIsRunning(true);
|
||||
ward.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _nextTarget, null);
|
||||
|
@@ -682,7 +682,7 @@ public final class Antharas extends AbstractNpcAI
|
||||
zone.broadcastPacket(new SpecialCamera(npc, 1200, 20, -10, 0, 10000, 13000, 0, 0, 0, 0, 0));
|
||||
zone.broadcastPacket(new PlaySound("BS01_D"));
|
||||
addSpawn(CUBE, 177615, 114941, -7709, 0, false, 900000);
|
||||
long respawnTime = (Config.ANTHARAS_SPAWN_INTERVAL + getRandom(-Config.ANTHARAS_SPAWN_RANDOM, Config.ANTHARAS_SPAWN_RANDOM)) * 3600000;
|
||||
final long respawnTime = (Config.ANTHARAS_SPAWN_INTERVAL + getRandom(-Config.ANTHARAS_SPAWN_RANDOM, Config.ANTHARAS_SPAWN_RANDOM)) * 3600000;
|
||||
setRespawn(respawnTime);
|
||||
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
|
||||
cancelQuestTimer("SET_REGEN", npc, null);
|
||||
|
@@ -254,7 +254,7 @@ public final class Baium extends AbstractNpcAI
|
||||
}
|
||||
else
|
||||
{
|
||||
L2PcInstance randomPlayer = getRandomPlayer(npc);
|
||||
final L2PcInstance randomPlayer = getRandomPlayer(npc);
|
||||
if (randomPlayer != null)
|
||||
{
|
||||
randomPlayer.teleToLocation(BAIUM_GIFT_LOC);
|
||||
@@ -305,7 +305,7 @@ public final class Baium extends AbstractNpcAI
|
||||
}
|
||||
else
|
||||
{
|
||||
L2PcInstance randomPlayer = getRandomPlayer(npc);
|
||||
final L2PcInstance randomPlayer = getRandomPlayer(npc);
|
||||
if (randomPlayer != null)
|
||||
{
|
||||
addAttackPlayerDesire(npc, randomPlayer);
|
||||
@@ -556,7 +556,7 @@ public final class Baium extends AbstractNpcAI
|
||||
setStatus(DEAD);
|
||||
addSpawn(TELE_CUBE, TELEPORT_CUBIC_LOC, false, 900000);
|
||||
zone.broadcastPacket(new PlaySound("BS01_D"));
|
||||
long respawnTime = (Config.BAIUM_SPAWN_INTERVAL + getRandom(-Config.BAIUM_SPAWN_RANDOM, Config.BAIUM_SPAWN_RANDOM)) * 3600000;
|
||||
final long respawnTime = (Config.BAIUM_SPAWN_INTERVAL + getRandom(-Config.BAIUM_SPAWN_RANDOM, Config.BAIUM_SPAWN_RANDOM)) * 3600000;
|
||||
setRespawn(respawnTime);
|
||||
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
|
||||
startQuestTimer("CLEAR_ZONE", 900000, null, null);
|
||||
|
@@ -106,8 +106,8 @@ public final class Beleth extends AbstractNpcAI
|
||||
addStartNpc(STONE_COFFIN);
|
||||
addTalkId(STONE_COFFIN);
|
||||
addFirstTalkId(ELF);
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH);
|
||||
int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH);
|
||||
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
|
||||
if (status == DEAD)
|
||||
{
|
||||
final long time = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
@@ -247,9 +247,9 @@ public final class Beleth extends AbstractNpcAI
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
int x = (int) ((150 * Math.cos(i * 1.046666667)) + 16323);
|
||||
int y = (int) ((150 * Math.sin(i * 1.046666667)) + 213059);
|
||||
L2Npc minion = addSpawn(FAKE_BELETH, new Location(x, y, -9357, 49152));
|
||||
final int x = (int) ((150 * Math.cos(i * 1.046666667)) + 16323);
|
||||
final int y = (int) ((150 * Math.sin(i * 1.046666667)) + 213059);
|
||||
final L2Npc minion = addSpawn(FAKE_BELETH, new Location(x, y, -9357, 49152));
|
||||
minion.setShowSummonAnimation(true);
|
||||
minion.decayMe();
|
||||
|
||||
@@ -391,8 +391,8 @@ public final class Beleth extends AbstractNpcAI
|
||||
{
|
||||
a++;
|
||||
|
||||
int x = (int) ((650 * Math.cos(i * 0.39)) + 16323);
|
||||
int y = (int) ((650 * Math.sin(i * 0.39)) + 213170);
|
||||
final int x = (int) ((650 * Math.cos(i * 0.39)) + 16323);
|
||||
final int y = (int) ((650 * Math.sin(i * 0.39)) + 213170);
|
||||
|
||||
npc = addSpawn(FAKE_BELETH, new Location(x, y, -9357, 49152));
|
||||
_minions.add(npc);
|
||||
@@ -404,8 +404,8 @@ public final class Beleth extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
int[] xm = new int[16];
|
||||
int[] ym = new int[16];
|
||||
final int[] xm = new int[16];
|
||||
final int[] ym = new int[16];
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
xm[i] = (int) ((1700 * Math.cos((i * 1.57) + 0.78)) + 16323);
|
||||
@@ -523,7 +523,7 @@ public final class Beleth extends AbstractNpcAI
|
||||
ZONE.broadcastPacket(new SpecialCamera(_camera2, 800, 180, 0, 0, 4000, 0, 10, 1, 0, 0));
|
||||
ZONE.broadcastPacket(new SpecialCamera(_camera2, 800, 180, 0, 0, 4000, 0, 10, 1, 0, 0));
|
||||
|
||||
L2DoorInstance door2 = DoorData.getInstance().getDoor(DOOR2);
|
||||
final L2DoorInstance door2 = DoorData.getInstance().getDoor(DOOR2);
|
||||
door2.openMe();
|
||||
|
||||
ZONE.broadcastPacket(new StaticObject(door2, false));
|
||||
@@ -639,8 +639,8 @@ public final class Beleth extends AbstractNpcAI
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
||||
double speed = npc.isRunning() ? npc.getRunSpeed() : npc.getWalkSpeed();
|
||||
int time = (int) (((distance2 - 890) / speed) * 1000);
|
||||
final double speed = npc.isRunning() ? npc.getRunSpeed() : npc.getWalkSpeed();
|
||||
final int time = (int) (((distance2 - 890) / speed) * 1000);
|
||||
startQuestTimer("CAST", time, npc, null);
|
||||
}
|
||||
else if (distance2 < 890)
|
||||
@@ -759,7 +759,7 @@ public final class Beleth extends AbstractNpcAI
|
||||
setBelethKiller(killer);
|
||||
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
|
||||
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(REAL_BELETH, info);
|
||||
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
|
||||
|
@@ -69,7 +69,7 @@ public final class Core extends AbstractNpcAI
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for Core from DB
|
||||
long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
final long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
// if Core is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
@@ -79,7 +79,7 @@ public final class Core extends AbstractNpcAI
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn Core.
|
||||
L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
final L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
|
||||
spawnBoss(core);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public final class Core extends AbstractNpcAI
|
||||
}
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int x = 16800 + (i * 450);
|
||||
final int x = 16800 + (i * 450);
|
||||
mob = (L2Attackable) addSpawn(SUSCEPTOR, x, 110300, npc.getZ(), 280 + getRandom(40), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_minions.add(mob);
|
||||
@@ -143,13 +143,13 @@ public final class Core extends AbstractNpcAI
|
||||
{
|
||||
if (event.equalsIgnoreCase("core_unlock"))
|
||||
{
|
||||
L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
final L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
|
||||
spawnBoss(core);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("spawn_minion"))
|
||||
{
|
||||
L2Attackable mob = (L2Attackable) addSpawn(npc.getId(), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
final L2Attackable mob = (L2Attackable) addSpawn(npc.getId(), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
_minions.add(mob);
|
||||
}
|
||||
@@ -188,7 +188,7 @@ public final class Core extends AbstractNpcAI
|
||||
{
|
||||
if (npc.getId() == CORE)
|
||||
{
|
||||
int objId = npc.getObjectId();
|
||||
final int objId = npc.getObjectId();
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, objId, npc.getX(), npc.getY(), npc.getZ()));
|
||||
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.A_FATAL_ERROR_HAS_OCCURRED));
|
||||
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SYSTEM_IS_BEING_SHUT_DOWN));
|
||||
@@ -197,10 +197,10 @@ public final class Core extends AbstractNpcAI
|
||||
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, DEAD);
|
||||
// Calculate Min and Max respawn times randomly.
|
||||
long respawnTime = (Config.CORE_SPAWN_INTERVAL + getRandom(-Config.CORE_SPAWN_RANDOM, Config.CORE_SPAWN_RANDOM)) * 3600000;
|
||||
final long respawnTime = (Config.CORE_SPAWN_INTERVAL + getRandom(-Config.CORE_SPAWN_RANDOM, Config.CORE_SPAWN_RANDOM)) * 3600000;
|
||||
startQuestTimer("core_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||
GrandBossManager.getInstance().setStatsSet(CORE, info);
|
||||
startQuestTimer("despawn_minions", 20000, null, null);
|
||||
|
@@ -49,7 +49,7 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
||||
private DarkWaterDragon()
|
||||
{
|
||||
super(DarkWaterDragon.class.getSimpleName(), "ai/individual");
|
||||
int[] mobs =
|
||||
final int[] mobs =
|
||||
{
|
||||
DRAGON,
|
||||
SHADE1,
|
||||
@@ -144,15 +144,15 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
int npcObjId = npc.getObjectId();
|
||||
final int npcId = npc.getId();
|
||||
final int npcObjId = npc.getObjectId();
|
||||
if (npcId == DRAGON)
|
||||
{
|
||||
if (!MY_TRACKING_SET.contains(npcObjId)) // this allows to handle multiple instances of npc
|
||||
{
|
||||
MY_TRACKING_SET.add(npcObjId);
|
||||
// Spawn first 5 shades on first attack on Dark Water Dragon
|
||||
L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
final L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
spawnShade(originalAttacker, SHADE1, npc.getX() + 100, npc.getY() + 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE2, npc.getX() + 100, npc.getY() - 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE1, npc.getX() - 100, npc.getY() + 100, npc.getZ());
|
||||
@@ -163,7 +163,7 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
||||
{
|
||||
SECOND_SPAWN.add(npcObjId);
|
||||
// Spawn second 5 shades on half hp of on Dark Water Dragon
|
||||
L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
final L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
spawnShade(originalAttacker, SHADE2, npc.getX() + 100, npc.getY() + 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE1, npc.getX() + 100, npc.getY() - 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE2, npc.getX() - 100, npc.getY() + 100, npc.getZ());
|
||||
@@ -177,13 +177,13 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
int npcObjId = npc.getObjectId();
|
||||
final int npcId = npc.getId();
|
||||
final int npcObjId = npc.getObjectId();
|
||||
if (npcId == DRAGON)
|
||||
{
|
||||
MY_TRACKING_SET.remove(npcObjId);
|
||||
SECOND_SPAWN.remove(npcObjId);
|
||||
L2Attackable faf = (L2Attackable) addSpawn(FAFURION, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0); // spawns Fafurion Kindred when Dard Water Dragon is dead
|
||||
final L2Attackable faf = (L2Attackable) addSpawn(FAFURION, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0); // spawns Fafurion Kindred when Dard Water Dragon is dead
|
||||
ID_MAP.put(faf.getObjectId(), killer);
|
||||
}
|
||||
else if (npcId == FAFURION)
|
||||
@@ -207,16 +207,16 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
int npcObjId = npc.getObjectId();
|
||||
final int npcId = npc.getId();
|
||||
final int npcObjId = npc.getObjectId();
|
||||
if (npcId == FAFURION)
|
||||
{
|
||||
if (!MY_TRACKING_SET.contains(npcObjId))
|
||||
{
|
||||
MY_TRACKING_SET.add(npcObjId);
|
||||
// Spawn 4 Detractors on spawn of Fafurion
|
||||
int x = npc.getX();
|
||||
int y = npc.getY();
|
||||
final int x = npc.getX();
|
||||
final int y = npc.getY();
|
||||
addSpawn(DETRACTOR2, x + 100, y + 100, npc.getZ(), 0, false, 40000);
|
||||
addSpawn(DETRACTOR1, x + 100, y - 100, npc.getZ(), 0, false, 40000);
|
||||
addSpawn(DETRACTOR2, x - 100, y + 100, npc.getZ(), 0, false, 40000);
|
||||
|
@@ -75,9 +75,9 @@ public final class Epidos extends AbstractNpcAI
|
||||
{
|
||||
if ((getRandom(1000) > 250) && _lastHp.containsKey(npc.getObjectId()))
|
||||
{
|
||||
int hpDecreasePercent = (int) (((_lastHp.get(npc.getObjectId()) - npc.getCurrentHp()) * 100) / npc.getMaxHp());
|
||||
final int hpDecreasePercent = (int) (((_lastHp.get(npc.getObjectId()) - npc.getCurrentHp()) * 100) / npc.getMaxHp());
|
||||
int minionsCount = 0;
|
||||
int spawnedMinions = ((L2MonsterInstance) npc).getMinionList().countSpawnedMinions();
|
||||
final int spawnedMinions = ((L2MonsterInstance) npc).getMinionList().countSpawnedMinions();
|
||||
|
||||
if ((hpDecreasePercent > 5) && (hpDecreasePercent <= 15) && (spawnedMinions <= 9))
|
||||
{
|
||||
|
@@ -81,7 +81,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
private Orfen()
|
||||
{
|
||||
super(Orfen.class.getSimpleName(), "ai/individual");
|
||||
int[] mobs =
|
||||
final int[] mobs =
|
||||
{
|
||||
ORFEN,
|
||||
RAIKEL_LEOS,
|
||||
@@ -90,12 +90,12 @@ public final class Orfen extends AbstractNpcAI
|
||||
registerMobs(mobs);
|
||||
_IsTeleported = false;
|
||||
ZONE = GrandBossManager.getInstance().getZone(POS[0]);
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||
int status = GrandBossManager.getInstance().getBossStatus(ORFEN);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||
final int status = GrandBossManager.getInstance().getBossStatus(ORFEN);
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for Orfen from DB
|
||||
long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
// if Orfen is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
@@ -105,7 +105,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn Orfen.
|
||||
int i = getRandom(10);
|
||||
final int i = getRandom(10);
|
||||
Location loc;
|
||||
if (i < 4)
|
||||
{
|
||||
@@ -119,20 +119,20 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
loc = POS[3];
|
||||
}
|
||||
L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc, false, 0);
|
||||
final L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(ORFEN, ALIVE);
|
||||
spawnBoss(orfen);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int loc_x = info.getInt("loc_x");
|
||||
int loc_y = info.getInt("loc_y");
|
||||
int loc_z = info.getInt("loc_z");
|
||||
int heading = info.getInt("heading");
|
||||
int hp = info.getInt("currentHP");
|
||||
int mp = info.getInt("currentMP");
|
||||
L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
final int loc_x = info.getInt("loc_x");
|
||||
final int loc_y = info.getInt("loc_y");
|
||||
final int loc_z = info.getInt("loc_z");
|
||||
final int heading = info.getInt("heading");
|
||||
final int hp = info.getInt("currentHP");
|
||||
final int mp = info.getInt("currentMP");
|
||||
final L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
orfen.setCurrentHpMp(hp, mp);
|
||||
spawnBoss(orfen);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
((L2Attackable) npc).clearAggroList();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);
|
||||
L2Spawn spawn = npc.getSpawn();
|
||||
final L2Spawn spawn = npc.getSpawn();
|
||||
spawn.setLocation(POS[index]);
|
||||
npc.teleToLocation(POS[index], false);
|
||||
}
|
||||
@@ -153,8 +153,8 @@ public final class Orfen extends AbstractNpcAI
|
||||
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
startQuestTimer("check_orfen_pos", 10000, npc, null, true);
|
||||
// Spawn minions
|
||||
int x = npc.getX();
|
||||
int y = npc.getY();
|
||||
final int x = npc.getX();
|
||||
final int y = npc.getY();
|
||||
L2Attackable mob;
|
||||
mob = (L2Attackable) addSpawn(RAIKEL_LEOS, x + 100, y + 100, npc.getZ(), 0, false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
@@ -176,7 +176,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
if (event.equalsIgnoreCase("orfen_unlock"))
|
||||
{
|
||||
int i = getRandom(10);
|
||||
final int i = getRandom(10);
|
||||
Location loc;
|
||||
if (i < 4)
|
||||
{
|
||||
@@ -190,7 +190,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
loc = POS[3];
|
||||
}
|
||||
L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc, false, 0);
|
||||
final L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(ORFEN, ALIVE);
|
||||
spawnBoss(orfen);
|
||||
}
|
||||
@@ -210,7 +210,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
for (int i = 0; i < MINIONS.size(); i++)
|
||||
{
|
||||
L2Attackable mob = MINIONS.get(i);
|
||||
final L2Attackable mob = MINIONS.get(i);
|
||||
if (!npc.isInsideRadius(mob, 3000, false, false))
|
||||
{
|
||||
mob.teleToLocation(npc.getLocation());
|
||||
@@ -223,7 +223,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
for (int i = 0; i < MINIONS.size(); i++)
|
||||
{
|
||||
L2Attackable mob = MINIONS.get(i);
|
||||
final L2Attackable mob = MINIONS.get(i);
|
||||
if (mob != null)
|
||||
{
|
||||
mob.decayMe();
|
||||
@@ -233,7 +233,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
}
|
||||
else if (event.equalsIgnoreCase("spawn_minion"))
|
||||
{
|
||||
L2Attackable mob = (L2Attackable) addSpawn(RAIKEL_LEOS, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0);
|
||||
final L2Attackable mob = (L2Attackable) addSpawn(RAIKEL_LEOS, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0);
|
||||
mob.setIsRaidMinion(true);
|
||||
MINIONS.add(mob);
|
||||
}
|
||||
@@ -245,10 +245,10 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
if (npc.getId() == ORFEN)
|
||||
{
|
||||
L2Character originalCaster = isSummon ? caster.getServitors().values().stream().findFirst().orElse(caster.getPet()) : caster;
|
||||
final L2Character originalCaster = isSummon ? caster.getServitors().values().stream().findFirst().orElse(caster.getPet()) : caster;
|
||||
if ((skill.getEffectPoint() > 0) && (getRandom(5) == 0) && npc.isInsideRadius(originalCaster, 1000, false, false))
|
||||
{
|
||||
NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), TEXT[getRandom(4)]);
|
||||
final NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), TEXT[getRandom(4)]);
|
||||
packet.addStringParameter(caster.getName().toString());
|
||||
npc.broadcastPacket(packet);
|
||||
originalCaster.teleToLocation(npc.getLocation());
|
||||
@@ -266,8 +266,8 @@ public final class Orfen extends AbstractNpcAI
|
||||
{
|
||||
return super.onFactionCall(npc, caller, attacker, isSummon);
|
||||
}
|
||||
int npcId = npc.getId();
|
||||
int callerId = caller.getId();
|
||||
final int npcId = npc.getId();
|
||||
final int callerId = caller.getId();
|
||||
if ((npcId == RAIKEL_LEOS) && (getRandom(20) == 0))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
@@ -293,7 +293,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
final int npcId = npc.getId();
|
||||
if (npcId == ORFEN)
|
||||
{
|
||||
if (!_IsTeleported && ((npc.getCurrentHp() - damage) < (npc.getMaxHp() / 2)))
|
||||
@@ -303,7 +303,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
}
|
||||
else if (npc.isInsideRadius(attacker, 1000, false, false) && !npc.isInsideRadius(attacker, 300, false, false) && (getRandom(10) == 0))
|
||||
{
|
||||
NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npcId, TEXT[getRandom(3)]);
|
||||
final NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npcId, TEXT[getRandom(3)]);
|
||||
packet.addStringParameter(attacker.getName().toString());
|
||||
npc.broadcastPacket(packet);
|
||||
attacker.teleToLocation(npc.getLocation());
|
||||
@@ -334,7 +334,7 @@ public final class Orfen extends AbstractNpcAI
|
||||
respawnTime *= 3600000;
|
||||
startQuestTimer("orfen_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(ORFEN, info);
|
||||
cancelQuestTimer("check_minion_loc", npc, null);
|
||||
|
@@ -95,12 +95,12 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
addFactionCallId(NURSE);
|
||||
|
||||
_zone = GrandBossManager.getInstance().getZone(QUEEN_X, QUEEN_Y, QUEEN_Z);
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||
int status = GrandBossManager.getInstance().getBossStatus(QUEEN);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||
final int status = GrandBossManager.getInstance().getBossStatus(QUEEN);
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for queen ant from DB
|
||||
long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
// if queen ant is locked until a certain time, mark it so and start the unlock timer
|
||||
// the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
@@ -110,21 +110,21 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Immediately spawn queen ant.
|
||||
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
||||
final L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int loc_x = QUEEN_X;
|
||||
int loc_y = QUEEN_Y;
|
||||
int loc_z = QUEEN_Z;
|
||||
int heading = info.getInt("heading");
|
||||
int hp = info.getInt("currentHP");
|
||||
int mp = info.getInt("currentMP");
|
||||
final int loc_x = QUEEN_X;
|
||||
final int loc_y = QUEEN_Y;
|
||||
final int loc_z = QUEEN_Z;
|
||||
final int heading = info.getInt("heading");
|
||||
final int hp = info.getInt("currentHP");
|
||||
final int mp = info.getInt("currentMP");
|
||||
|
||||
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
final L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
queen.setCurrentHpMp(hp, mp);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
@@ -215,7 +215,7 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
}
|
||||
else if (event.equalsIgnoreCase("queen_unlock"))
|
||||
{
|
||||
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
||||
final L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
||||
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
@@ -329,7 +329,7 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
final int npcId = npc.getId();
|
||||
if (npcId == QUEEN)
|
||||
{
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
@@ -341,7 +341,7 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
cancelQuestTimer("action", npc, null);
|
||||
cancelQuestTimer("heal", null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(QUEEN, info);
|
||||
_nurses.clear();
|
||||
@@ -358,7 +358,7 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
{
|
||||
if (npcId == ROYAL)
|
||||
{
|
||||
L2MonsterInstance mob = (L2MonsterInstance) npc;
|
||||
final L2MonsterInstance mob = (L2MonsterInstance) npc;
|
||||
if (mob.getLeader() != null)
|
||||
{
|
||||
mob.getLeader().getMinionList().onMinionDie(mob, (280 + getRandom(40)) * 1000);
|
||||
@@ -366,7 +366,7 @@ public final class QueenAnt extends AbstractNpcAI
|
||||
}
|
||||
else if (npcId == NURSE)
|
||||
{
|
||||
L2MonsterInstance mob = (L2MonsterInstance) npc;
|
||||
final L2MonsterInstance mob = (L2MonsterInstance) npc;
|
||||
_nurses.remove(mob);
|
||||
if (mob.getLeader() != null)
|
||||
{
|
||||
|
@@ -176,7 +176,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
|
||||
_skill = getRndSkills(npc);
|
||||
_target = getRandomTarget(npc, _skill);
|
||||
}
|
||||
L2Character target = _target;
|
||||
final L2Character target = _target;
|
||||
Skill skill = _skill;
|
||||
if (skill == null)
|
||||
{
|
||||
@@ -213,7 +213,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
|
||||
private L2Character getRandomTarget(L2Npc npc, Skill skill)
|
||||
{
|
||||
final Collection<L2Object> objs = npc.getKnownList().getKnownObjects().values();
|
||||
ArrayList<L2Character> result = new ArrayList<>();
|
||||
final ArrayList<L2Character> result = new ArrayList<>();
|
||||
{
|
||||
for (L2Object obj : objs)
|
||||
{
|
||||
@@ -269,7 +269,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
|
||||
}
|
||||
if (!result.isEmpty() && (result.size() != 0))
|
||||
{
|
||||
Object[] characters = result.toArray();
|
||||
final Object[] characters = result.toArray();
|
||||
return (L2Character) characters[Rnd.get(characters.length)];
|
||||
}
|
||||
return null;
|
||||
|
@@ -129,7 +129,7 @@ public final class Valakas extends AbstractNpcAI
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for valakas from DB
|
||||
long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
final long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
if (temp > 0)
|
||||
{
|
||||
// The time has not yet expired. Mark Valakas as currently locked (dead).
|
||||
@@ -446,7 +446,7 @@ public final class Valakas extends AbstractNpcAI
|
||||
|
||||
startQuestTimer("valakas_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
|
||||
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||
GrandBossManager.getInstance().setStatsSet(VALAKAS, info);
|
||||
|
||||
@@ -477,12 +477,12 @@ public final class Valakas extends AbstractNpcAI
|
||||
{
|
||||
if (getRandom(10) == 0)
|
||||
{
|
||||
int x = npc.getX();
|
||||
int y = npc.getY();
|
||||
int z = npc.getZ();
|
||||
final int x = npc.getX();
|
||||
final int y = npc.getY();
|
||||
final int z = npc.getZ();
|
||||
|
||||
int posX = x + getRandom(-1400, 1400);
|
||||
int posY = y + getRandom(-1400, 1400);
|
||||
final int posX = x + getRandom(-1400, 1400);
|
||||
final int posY = y + getRandom(-1400, 1400);
|
||||
|
||||
if (GeoData.getInstance().canMove(x, y, z, posX, posY, z, npc.getInstanceId()))
|
||||
{
|
||||
@@ -547,7 +547,7 @@ public final class Valakas extends AbstractNpcAI
|
||||
*/
|
||||
private L2Playable getRandomTarget(L2Npc npc)
|
||||
{
|
||||
List<L2Playable> result = new ArrayList<>();
|
||||
final List<L2Playable> result = new ArrayList<>();
|
||||
|
||||
for (L2Character obj : npc.getKnownList().getKnownCharacters())
|
||||
{
|
||||
|
@@ -330,7 +330,7 @@ public final class Venom extends AbstractNpcAI
|
||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.IT_S_NOT_OVER_YET_IT_WON_T_BE_OVER_LIKE_THIS_NEVER);
|
||||
if (!CastleManager.getInstance().getCastleById(CASTLE).getSiege().isInProgress())
|
||||
{
|
||||
L2Npc cube = addSpawn(TELEPORT_CUBE, CUBE, false, 0);
|
||||
final L2Npc cube = addSpawn(TELEPORT_CUBE, CUBE, false, 0);
|
||||
startQuestTimer("cube_despawn", 120000, cube, null);
|
||||
}
|
||||
cancelQuestTimer("raid_check", npc, null);
|
||||
|
@@ -168,7 +168,7 @@ public final class Alarm extends AbstractNpcAI
|
||||
{
|
||||
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
|
||||
{
|
||||
int i0 = getMemoStateEx(player, ART_OF_PERSUASION_ID, 1);
|
||||
final int i0 = getMemoStateEx(player, ART_OF_PERSUASION_ID, 1);
|
||||
if (i0 >= 3)
|
||||
{
|
||||
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
|
||||
@@ -187,7 +187,7 @@ public final class Alarm extends AbstractNpcAI
|
||||
}
|
||||
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
|
||||
{
|
||||
int i0 = getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1);
|
||||
final int i0 = getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1);
|
||||
if (i0 >= 3)
|
||||
{
|
||||
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
|
||||
|
@@ -85,7 +85,7 @@ public final class AwakeningMaster extends AbstractNpcAI
|
||||
{
|
||||
return null;
|
||||
}
|
||||
String htmltext = null;
|
||||
final String htmltext = null;
|
||||
switch (event)
|
||||
{
|
||||
case "awakening":
|
||||
|
@@ -70,7 +70,7 @@ public class BlackJudge extends AbstractNpcAI
|
||||
{
|
||||
if (player.getShilensBreathDebuffLevel() > 0)
|
||||
{
|
||||
int cost = COSTS[level];
|
||||
final int cost = COSTS[level];
|
||||
|
||||
if (player.getAdena() >= cost)
|
||||
{
|
||||
|
@@ -159,7 +159,7 @@ public final class DragonVortex extends AbstractNpcAI
|
||||
*/
|
||||
public void spawnRaid(int raidId, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
L2Spawn spawnDat = addSpawn(raidId, npc.getX() + getRandom(-500, 500), npc.getY() + getRandom(-500, 500), npc.getZ() + 10, 0, false, DESPAWN_DELAY, true).getSpawn();
|
||||
final L2Spawn spawnDat = addSpawn(raidId, npc.getX() + getRandom(-500, 500), npc.getY() + getRandom(-500, 500), npc.getZ() + 10, 0, false, DESPAWN_DELAY, true).getSpawn();
|
||||
SpawnTable.getInstance().addNewSpawn(spawnDat, false);
|
||||
takeItems(player, LARGE_DRAGON_BONE, 1);
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public final class DragonVortex extends AbstractNpcAI
|
||||
{
|
||||
for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(npcId))
|
||||
{
|
||||
L2Npc spawnedWarpgate = spawn.getLastSpawn();
|
||||
final L2Npc spawnedWarpgate = spawn.getLastSpawn();
|
||||
if ((spawnedWarpgate != null))
|
||||
{
|
||||
return true;
|
||||
|
@@ -111,7 +111,7 @@ public final class ForgeOfTheGods extends AbstractNpcAI
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
int rand = getRandom(100);
|
||||
final int rand = getRandom(100);
|
||||
L2Npc mob = null;
|
||||
_npcCount++;
|
||||
|
||||
|
@@ -508,7 +508,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
||||
return;
|
||||
}
|
||||
|
||||
int amount = MENTEE_COINS.get(player.getLevel());
|
||||
final int amount = MENTEE_COINS.get(player.getLevel());
|
||||
if (amount > 0)
|
||||
{
|
||||
sendMail(mentor.getObjectId(), player, LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||
|
@@ -146,7 +146,7 @@ public final class Minigame extends AbstractNpcAI
|
||||
{
|
||||
if (room.getCurrentPot() < 9)
|
||||
{
|
||||
L2Npc b = room.getBurners()[room.getOrder()[room.getCurrentPot()]];
|
||||
final L2Npc b = room.getBurners()[room.getOrder()[room.getCurrentPot()]];
|
||||
b.setDisplayEffect(1);
|
||||
b.setIsRunning(false);
|
||||
startQuestTimer("off", 2000, b, null); // Stopping burning each pot 2s after
|
||||
@@ -220,7 +220,7 @@ public final class Minigame extends AbstractNpcAI
|
||||
}
|
||||
else
|
||||
{
|
||||
int attemptNumber = room.getAttemptNumber();
|
||||
final int attemptNumber = room.getAttemptNumber();
|
||||
|
||||
if (attemptNumber == 2)
|
||||
{
|
||||
@@ -270,7 +270,7 @@ public final class Minigame extends AbstractNpcAI
|
||||
{
|
||||
if ((obj != null) && obj.isNpc())
|
||||
{
|
||||
L2Npc npc = (L2Npc) obj;
|
||||
final L2Npc npc = (L2Npc) obj;
|
||||
if (npc.getId() == BURNER)
|
||||
{
|
||||
npc.doCast(TRIGGER_MIRAGE.getSkill());
|
||||
|
@@ -100,7 +100,7 @@ public final class MonumentOfHeroes extends AbstractNpcAI
|
||||
}
|
||||
default:
|
||||
{
|
||||
int weaponId = Integer.parseInt(event);
|
||||
final int weaponId = Integer.parseInt(event);
|
||||
if (Util.contains(WEAPONS, weaponId))
|
||||
{
|
||||
giveItems(player, weaponId, 1);
|
||||
|
@@ -646,7 +646,7 @@ public final class Raina extends AbstractNpcAI
|
||||
{
|
||||
final int currentBaseId = player.getBaseClassId();
|
||||
final ClassId baseCID = ClassId.getClassId(currentBaseId);
|
||||
int baseClassId = (baseCID.level() > 2) ? baseCID.getParent().ordinal() : currentBaseId;
|
||||
final int baseClassId = (baseCID.level() > 2) ? baseCID.getParent().ordinal() : currentBaseId;
|
||||
|
||||
final Set<PlayerClass> availSubs = getSubclasses(player, baseClassId);
|
||||
|
||||
@@ -803,7 +803,7 @@ public final class Raina extends AbstractNpcAI
|
||||
subclasses.removeAll(PlayerClass.getSet(Race.KAMAEL, THIRD));
|
||||
}
|
||||
|
||||
Set<PlayerClass> unavailableClasses = subclassSetMap.get(this);
|
||||
final Set<PlayerClass> unavailableClasses = subclassSetMap.get(this);
|
||||
|
||||
if (unavailableClasses != null)
|
||||
{
|
||||
|
@@ -95,7 +95,7 @@ public final class GrandBossTeleporters extends AbstractNpcAI
|
||||
{
|
||||
if (valakasAI() != null)
|
||||
{
|
||||
int status = GrandBossManager.getInstance().getBossStatus(29028);
|
||||
final int status = GrandBossManager.getInstance().getBossStatus(29028);
|
||||
|
||||
if ((status == 0) || (status == 1))
|
||||
{
|
||||
@@ -106,7 +106,7 @@ public final class GrandBossTeleporters extends AbstractNpcAI
|
||||
else if (st.getInt("allowEnter") == 1)
|
||||
{
|
||||
st.unset("allowEnter");
|
||||
L2BossZone zone = GrandBossManager.getInstance().getZone(212852, -114842, -1632);
|
||||
final L2BossZone zone = GrandBossManager.getInstance().getZone(212852, -114842, -1632);
|
||||
|
||||
if (zone != null)
|
||||
{
|
||||
@@ -119,7 +119,7 @@ public final class GrandBossTeleporters extends AbstractNpcAI
|
||||
|
||||
if (status == 0)
|
||||
{
|
||||
L2GrandBossInstance valakas = GrandBossManager.getInstance().getBoss(29028);
|
||||
final L2GrandBossInstance valakas = GrandBossManager.getInstance().getBoss(29028);
|
||||
valakasAI().startQuestTimer("beginning", Config.VALAKAS_WAIT_TIME * 60000, valakas, null);
|
||||
GrandBossManager.getInstance().setBossStatus(29028, 1);
|
||||
}
|
||||
|
@@ -54,10 +54,10 @@ public final class MithrilMinesTeleporter extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
int index = Integer.parseInt(event) - 1;
|
||||
final int index = Integer.parseInt(event) - 1;
|
||||
if (LOCS.length > index)
|
||||
{
|
||||
Location loc = LOCS[index];
|
||||
final Location loc = LOCS[index];
|
||||
player.teleToLocation(loc, false);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
|
@@ -54,11 +54,11 @@ public final class StakatoNestTeleporter extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
int index = Integer.parseInt(event) - 1;
|
||||
final int index = Integer.parseInt(event) - 1;
|
||||
|
||||
if (LOCS.length > index)
|
||||
{
|
||||
Location loc = LOCS[index];
|
||||
final Location loc = LOCS[index];
|
||||
|
||||
if (player.getParty() != null)
|
||||
{
|
||||
@@ -78,7 +78,7 @@ public final class StakatoNestTeleporter extends AbstractNpcAI
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
QuestState accessQuest = player.getQuestState(Q00240_ImTheOnlyOneYouCanTrust.class.getSimpleName());
|
||||
final QuestState accessQuest = player.getQuestState(Q00240_ImTheOnlyOneYouCanTrust.class.getSimpleName());
|
||||
return (((accessQuest != null) && accessQuest.isCompleted()) ? "32640.htm" : "32640-no.htm");
|
||||
}
|
||||
|
||||
|
@@ -108,7 +108,7 @@ public final class TeleportToUndergroundColiseum extends AbstractNpcAI
|
||||
}
|
||||
else if (Util.isDigit(event))
|
||||
{
|
||||
int val = Integer.parseInt(event) - 1;
|
||||
final int val = Integer.parseInt(event) - 1;
|
||||
player.teleToLocation(MANAGERS_LOCS[val][getRandom(MANAGERS_LOCS[val].length)], false);
|
||||
}
|
||||
return null;
|
||||
|
@@ -91,7 +91,7 @@ public final class ToIVortex extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
final int npcId = npc.getId();
|
||||
|
||||
switch (event)
|
||||
{
|
||||
|
@@ -56,7 +56,7 @@ public final class Tunatun extends AbstractNpcAI
|
||||
return "31537-01.html";
|
||||
}
|
||||
|
||||
QuestState st = player.getQuestState(Q00020_BringUpWithLove.class.getSimpleName());
|
||||
final QuestState st = player.getQuestState(Q00020_BringUpWithLove.class.getSimpleName());
|
||||
if ((st == null) && (player.getLevel() < MIN_LEVEL))
|
||||
{
|
||||
return "31537-02.html";
|
||||
|
@@ -164,7 +164,7 @@ public final class WeaverOlf extends AbstractNpcAI
|
||||
{
|
||||
if (event.contains("_grade_"))
|
||||
{
|
||||
int grade = Integer.parseInt(event.substring(0, 1));
|
||||
final int grade = Integer.parseInt(event.substring(0, 1));
|
||||
int price;
|
||||
int[] itemIds;
|
||||
if (event.endsWith("_pin"))
|
||||
@@ -198,7 +198,7 @@ public final class WeaverOlf extends AbstractNpcAI
|
||||
{
|
||||
takeItems(player, Inventory.ADENA_ID, price);
|
||||
takeItems(player, itemIds[0], 1);
|
||||
int rand = getRandom(200);
|
||||
final int rand = getRandom(200);
|
||||
if (rand <= CHANCES[0])
|
||||
{
|
||||
giveItems(player, itemIds[1], 1);
|
||||
|
@@ -172,7 +172,7 @@ public final class WyvernManager extends AbstractNpcAI
|
||||
}
|
||||
case CLAN_HALL:
|
||||
{
|
||||
SiegableHall hall = npc.getConquerableHall();
|
||||
final SiegableHall hall = npc.getConquerableHall();
|
||||
return (hall != null) ? hall.isInSiege() : npc.getCastle().getSiege().isInProgress();
|
||||
}
|
||||
case FORT:
|
||||
|
Reference in New Issue
Block a user