Added missing final modifiers.

This commit is contained in:
MobiusDev
2015-12-26 12:03:36 +00:00
parent cc92e5d062
commit e0d681a17e
974 changed files with 5919 additions and 5917 deletions

View File

@@ -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);
}
}

View File

@@ -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)

View File

@@ -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);

View File

@@ -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());

View File

@@ -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);

View File

@@ -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));
}

View File

@@ -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);
}
}

View File

@@ -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);