Code style changes.

This commit is contained in:
MobiusDev
2016-04-26 19:21:19 +00:00
parent 6a13705766
commit fc070c9238
768 changed files with 3338 additions and 4252 deletions

View File

@@ -214,8 +214,8 @@ public final class Antharas extends AbstractNpcAI
{
final L2Party party = player.getParty();
final boolean isInCC = party.isInCommandChannel();
final List<L2PcInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
final boolean isPartyLeader = (isInCC) ? party.getCommandChannel().isLeader(player) : party.isLeader(player);
final List<L2PcInstance> members = isInCC ? party.getCommandChannel().getMembers() : party.getMembers();
final boolean isPartyLeader = isInCC ? party.getCommandChannel().isLeader(player) : party.isLeader(player);
if (!isPartyLeader)
{
htmltext = "13001-05.html";
@@ -244,20 +244,17 @@ public final class Antharas extends AbstractNpcAI
}
}
}
else if (!hasQuestItems(player, STONE))
{
htmltext = "13001-03.html";
}
else
{
if (!hasQuestItems(player, STONE))
player.teleToLocation(179700 + getRandom(700), 113800 + getRandom(2100), -7709);
if (getStatus() != WAITING)
{
htmltext = "13001-03.html";
}
else
{
player.teleToLocation(179700 + getRandom(700), 113800 + getRandom(2100), -7709);
if (getStatus() != WAITING)
{
setStatus(WAITING);
startQuestTimer("SPAWN_ANTHARAS", Config.ANTHARAS_WAIT_TIME * 60000, null, null);
}
setStatus(WAITING);
startQuestTimer("SPAWN_ANTHARAS", Config.ANTHARAS_WAIT_TIME * 60000, null, null);
}
}
return htmltext;
@@ -418,7 +415,7 @@ public final class Antharas extends AbstractNpcAI
addSpawn(BEHEMOTH, npc, true);
addSpawn(TERASQUE, npc, true);
}
_minionCount += (minionMultipler * 2);
_minionCount += minionMultipler * 2;
}
else if (_minionCount < 98)
{
@@ -428,7 +425,7 @@ public final class Antharas extends AbstractNpcAI
}
else if (_minionCount < 99)
{
addSpawn((getRandomBoolean() ? BEHEMOTH : TERASQUE), npc, true);
addSpawn(getRandomBoolean() ? BEHEMOTH : TERASQUE, npc, true);
_minionCount++;
}
@@ -641,23 +638,23 @@ public final class Antharas extends AbstractNpcAI
if (skill == null)
{
refreshAiParams(attacker, (damage * 1000));
refreshAiParams(attacker, damage * 1000);
}
else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.25))
{
refreshAiParams(attacker, ((damage / 3) * 100));
refreshAiParams(attacker, (damage / 3) * 100);
}
else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.5))
{
refreshAiParams(attacker, (damage * 20));
refreshAiParams(attacker, damage * 20);
}
else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.75))
{
refreshAiParams(attacker, (damage * 10));
refreshAiParams(attacker, damage * 10);
}
else
{
refreshAiParams(attacker, ((damage / 3) * 20));
refreshAiParams(attacker, (damage / 3) * 20);
}
manageSkills(npc);
}
@@ -761,7 +758,7 @@ public final class Antharas extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
GrandBossManager.getInstance().getStatsSet(ANTHARAS).set("respawn_time", (System.currentTimeMillis() + respawnTime));
GrandBossManager.getInstance().getStatsSet(ANTHARAS).set("respawn_time", System.currentTimeMillis() + respawnTime);
}
private final void refreshAiParams(L2PcInstance attacker, int damage)

View File

@@ -492,23 +492,23 @@ public final class Baium extends AbstractNpcAI
if (skill == null)
{
refreshAiParams(attacker, npc, (damage * 1000));
refreshAiParams(attacker, npc, damage * 1000);
}
else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.25))
{
refreshAiParams(attacker, npc, ((damage / 3) * 100));
refreshAiParams(attacker, npc, (damage / 3) * 100);
}
else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.5))
{
refreshAiParams(attacker, npc, (damage * 20));
refreshAiParams(attacker, npc, damage * 20);
}
else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.75))
{
refreshAiParams(attacker, npc, (damage * 10));
refreshAiParams(attacker, npc, damage * 10);
}
else
{
refreshAiParams(attacker, npc, ((damage / 3) * 20));
refreshAiParams(attacker, npc, (damage / 3) * 20);
}
manageSkills(npc);
}
@@ -658,7 +658,7 @@ public final class Baium extends AbstractNpcAI
private void setRespawn(long respawnTime)
{
GrandBossManager.getInstance().getStatsSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
GrandBossManager.getInstance().getStatsSet(BAIUM).set("respawn_time", System.currentTimeMillis() + respawnTime);
}
private void manageSkills(L2Npc npc)
@@ -672,7 +672,7 @@ public final class Baium extends AbstractNpcAI
for (int i = 0; i < 3; i++)
{
final L2Character attacker = vars.getObject("c_quest" + i, L2Character.class);
if ((attacker == null) || ((npc.calculateDistance(attacker, true, false) > 9000) || attacker.isDead()))
if ((attacker == null) || (npc.calculateDistance(attacker, true, false) > 9000) || attacker.isDead())
{
vars.set("i_quest" + i, 0);
}

View File

@@ -108,7 +108,7 @@ final class Beleth extends AbstractNpcAI
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
if (status == DEAD)
{
final long time = (info.getLong("respawn_time") - System.currentTimeMillis());
final long time = info.getLong("respawn_time") - System.currentTimeMillis();
if (time > 0)
{
startQuestTimer("BELETH_UNLOCK", time, null, null);
@@ -634,7 +634,7 @@ final class Beleth extends AbstractNpcAI
{
npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
startQuestTimer("CAST", ((int) (((distance2 - 890) / (npc.isRunning() ? npc.getRunSpeed() : npc.getWalkSpeed())) * 1000)), npc, null);
startQuestTimer("CAST", (int) (((distance2 - 890) / (npc.isRunning() ? npc.getRunSpeed() : npc.getWalkSpeed())) * 1000), npc, null);
}
else if (distance2 < 890)
{

View File

@@ -65,7 +65,7 @@ final class Core extends AbstractNpcAI
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
{
final long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
if (temp > 0)
{
startQuestTimer("core_unlock", temp, null, null);
@@ -194,7 +194,7 @@ final class Core extends AbstractNpcAI
startQuestTimer("core_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatsSet(CORE, info);
startQuestTimer("despawn_minions", 20000, null, null);
cancelQuestTimers("spawn_minion");

View File

@@ -85,19 +85,19 @@ final class DarkWaterDragon extends AbstractNpcAI
}
else if (event.equalsIgnoreCase("1")) // spawns a detractor
{
addSpawn(DETRACTOR1, (npc.getX() + 100), (npc.getY() + 100), npc.getZ(), 0, false, 40000);
addSpawn(DETRACTOR1, npc.getX() + 100, npc.getY() + 100, npc.getZ(), 0, false, 40000);
}
else if (event.equalsIgnoreCase("2")) // spawns a detractor
{
addSpawn(DETRACTOR2, (npc.getX() + 100), (npc.getY() - 100), npc.getZ(), 0, false, 40000);
addSpawn(DETRACTOR2, npc.getX() + 100, npc.getY() - 100, npc.getZ(), 0, false, 40000);
}
else if (event.equalsIgnoreCase("3")) // spawns a detractor
{
addSpawn(DETRACTOR1, (npc.getX() - 100), (npc.getY() + 100), npc.getZ(), 0, false, 40000);
addSpawn(DETRACTOR1, npc.getX() - 100, npc.getY() + 100, npc.getZ(), 0, false, 40000);
}
else if (event.equalsIgnoreCase("4")) // spawns a detractor
{
addSpawn(DETRACTOR2, (npc.getX() - 100), (npc.getY() - 100), npc.getZ(), 0, false, 40000);
addSpawn(DETRACTOR2, npc.getX() - 100, npc.getY() - 100, npc.getZ(), 0, false, 40000);
}
else if (event.equalsIgnoreCase("fafurion_despawn")) // Fafurion Kindred disappears and drops reward
{
@@ -156,7 +156,7 @@ final class DarkWaterDragon extends AbstractNpcAI
spawnShade(originalAttacker, SHADE2, npc.getX() - 100, npc.getY() - 100, npc.getZ());
spawnShade(originalAttacker, SHADE1, npc.getX() - 150, npc.getY() + 150, npc.getZ());
}
else if ((npc.getCurrentHp() < (npc.getMaxHp() / 2.0)) && !(SECOND_SPAWN.contains(npcObjId)))
else if ((npc.getCurrentHp() < (npc.getMaxHp() / 2.0)) && !SECOND_SPAWN.contains(npcObjId))
{
SECOND_SPAWN.add(npcObjId);
// Spawn second 5 shades on half hp of on Dark Water Dragon

View File

@@ -39,7 +39,7 @@ final class Devno extends AbstractNpcAI
NpcStringId.I_SEE_THAT_ADVENTURERS_ARE_RETURNING_TO_TALKING_ISLAND_FOR_THE_AWAKENING,
NpcStringId.YOU_CAN_SEE_VARIOUS_STATISTICS_IN_THE_MUSEUM_STATS_IN_THE_MAIN_MENU
};
private final static Location[] DEVNO_LOC =
private static final Location[] DEVNO_LOC =
{
new Location(-114448, 259106, -1203),
new Location(-114565, 258686, -1203),

View File

@@ -38,7 +38,7 @@ final class Eleve extends AbstractNpcAI
NpcStringId.DON_T_KNOW_WHAT_TO_DO_LOOK_AT_THE_MAP,
NpcStringId.DO_YOU_SEE_A_SCROLL_ICON_GO_THAT_LOCATION
};
private final static Location[] ELEVE_LOC =
private static final Location[] ELEVE_LOC =
{
new Location(-114936, 259918, -1203),
new Location(-114687, 259872, -1203),

View File

@@ -122,7 +122,7 @@ final class FrightenedRagnaOrc extends AbstractNpcAI
}
else
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, (getRandomBoolean() ? NpcStringId.THANKS_BUT_THAT_THING_ABOUT_10_000_000_ADENA_WAS_A_LIE_SEE_YA : NpcStringId.YOU_RE_PRETTY_DUMB_TO_BELIEVE_ME));
broadcastNpcSay(npc, ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.THANKS_BUT_THAT_THING_ABOUT_10_000_000_ADENA_WAS_A_LIE_SEE_YA : NpcStringId.YOU_RE_PRETTY_DUMB_TO_BELIEVE_ME);
}
startQuestTimer("despawn", 1000, npc, null);
}

View File

@@ -38,7 +38,7 @@ final class Karonf extends AbstractNpcAI
NpcStringId.WHEN_YOU_GO_TO_THE_MUSEUM_SPEAK_TO_PANTHEON,
NpcStringId.SOME_FOLKS_DON_T_KNOW_WHAT_THEY_ARE_DOING
};
private final static Location[] KARONF_LOC =
private static final Location[] KARONF_LOC =
{
new Location(-113984, 259782, -1203),
new Location(-113786, 259475, -1203),

View File

@@ -306,12 +306,9 @@ final class QueenAnt extends AbstractNpcAI
curse = CommonSkill.RAID_CURSE.getSkill();
}
}
else
else if (!character.isParalyzed() && (getRandom(4) == 0))
{
if (!character.isParalyzed() && (getRandom(4) == 0))
{
curse = CommonSkill.RAID_CURSE2.getSkill();
}
curse = CommonSkill.RAID_CURSE2.getSkill();
}
if (curse != null)
@@ -360,7 +357,7 @@ final class QueenAnt extends AbstractNpcAI
{
if (((L2MonsterInstance) npc).getLeader() != null)
{
((L2MonsterInstance) npc).getLeader().getMinionList().onMinionDie(((L2MonsterInstance) npc), (280 + getRandom(40)) * 1000);
((L2MonsterInstance) npc).getLeader().getMinionList().onMinionDie((L2MonsterInstance) npc, (280 + getRandom(40)) * 1000);
}
}
else if (npcId == NURSE)
@@ -391,13 +388,10 @@ final class QueenAnt extends AbstractNpcAI
_task.cancel(false);
_task = null;
}
else
else if (_queen.calculateDistance(QUEEN_X, QUEEN_Y, QUEEN_Z, false, false) > 2000.)
{
if (_queen.calculateDistance(QUEEN_X, QUEEN_Y, QUEEN_Z, false, false) > 2000.)
{
_queen.clearAggroList();
_queen.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(QUEEN_X, QUEEN_Y, QUEEN_Z, 0));
}
_queen.clearAggroList();
_queen.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(QUEEN_X, QUEEN_Y, QUEEN_Z, 0));
}
}
}

View File

@@ -87,7 +87,7 @@ final class QueenShyeed extends AbstractNpcAI
private void spawnShyeed()
{
final String respawn = loadGlobalQuestVar("Respawn");
final long remain = (!respawn.isEmpty()) ? Long.parseLong(respawn) - System.currentTimeMillis() : 0;
final long remain = !respawn.isEmpty() ? Long.parseLong(respawn) - System.currentTimeMillis() : 0;
if (remain > 0)
{
startQuestTimer("respawn", remain, null, null);

View File

@@ -178,7 +178,7 @@ final class ScarletVanHalisha extends AbstractNpcAI
Skill skill = _skill;
if (skill == null)
{
skill = (getRndSkills(npc));
skill = getRndSkills(npc);
}
if (npc.isPhysicalMuted())
@@ -222,7 +222,7 @@ final class ScarletVanHalisha extends AbstractNpcAI
continue;
}
if (((((L2Character) obj).getZ() < (npc.getZ() - 100)) && (((L2Character) obj).getZ() > (npc.getZ() + 100))) || !(GeoData.getInstance().canSeeTarget(((L2Character) obj).getX(), ((L2Character) obj).getY(), ((L2Character) obj).getZ(), npc.getX(), npc.getY(), npc.getZ())))
if (((((L2Character) obj).getZ() < (npc.getZ() - 100)) && (((L2Character) obj).getZ() > (npc.getZ() + 100))) || !GeoData.getInstance().canSeeTarget(((L2Character) obj).getX(), ((L2Character) obj).getY(), ((L2Character) obj).getZ(), npc.getX(), npc.getY(), npc.getZ()))
{
continue;
}

View File

@@ -71,7 +71,7 @@ final class SinWardens extends AbstractNpcAI
int killedCount = killedMinionsCount.containsKey(master.getObjectId()) ? killedMinionsCount.get(master.getObjectId()) : 0;
killedCount++;
if ((killedCount) == 5)
if (killedCount == 5)
{
master.broadcastPacket(new NpcSay(master.getObjectId(), ChatType.NPC_GENERAL, master.getId(), NpcStringId.WE_MIGHT_NEED_NEW_SLAVES_I_LL_BE_BACK_SOON_SO_WAIT));
master.doDie(killer);

View File

@@ -127,7 +127,7 @@ public final class Valakas extends AbstractNpcAI
if (status == DEAD)
{
// load the unlock date and time for valakas from DB
final 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).
@@ -178,7 +178,7 @@ public final class Valakas extends AbstractNpcAI
// Start timer to lock entry after 30 minutes
if (status == WAITING)
{
startQuestTimer("beginning", (Config.VALAKAS_WAIT_TIME * 60000), valakas, null);
startQuestTimer("beginning", Config.VALAKAS_WAIT_TIME * 60000, valakas, null);
}
}
}
@@ -356,18 +356,15 @@ public final class Valakas extends AbstractNpcAI
callSkillAI(npc);
}
}
else
else if (event.equalsIgnoreCase("valakas_unlock"))
{
if (event.equalsIgnoreCase("valakas_unlock"))
{
final L2Npc valakas = addSpawn(VALAKAS, -105200, -253104, -15264, 32768, false, 0);
GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas);
GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT);
}
else if (event.equalsIgnoreCase("remove_players"))
{
ZONE.oustAllPlayers();
}
final L2Npc valakas = addSpawn(VALAKAS, -105200, -253104, -15264, 32768, false, 0);
GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas);
GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT);
}
else if (event.equalsIgnoreCase("remove_players"))
{
ZONE.oustAllPlayers();
}
return super.onAdvEvent(event, npc, player);
}
@@ -436,7 +433,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
final StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatsSet(VALAKAS, info);
return super.onKill(npc, killer, isSummon);
@@ -456,7 +453,7 @@ public final class Valakas extends AbstractNpcAI
}
// Pickup a target if no or dead victim. 10% luck he decides to reconsiders his target.
if ((_actualVictim == null) || _actualVictim.isDead() || !(npc.getKnownList().knowsObject(_actualVictim)) || (getRandom(10) == 0))
if ((_actualVictim == null) || _actualVictim.isDead() || !npc.getKnownList().knowsObject(_actualVictim) || (getRandom(10) == 0))
{
_actualVictim = getRandomTarget(npc);
}
@@ -550,7 +547,7 @@ public final class Valakas extends AbstractNpcAI
}
}
return (result.isEmpty()) ? null : result.get(getRandom(result.size()));
return result.isEmpty() ? null : result.get(getRandom(result.size()));
}
public static void main(String[] args)