Code review Part 5.

This commit is contained in:
MobiusDevelopment
2019-12-22 15:33:46 +00:00
parent 4a563b8832
commit 7f3befa63c
4071 changed files with 23938 additions and 28938 deletions

View File

@@ -124,7 +124,7 @@ public class CemeteryMonsters extends AbstractNpcAI
{
for (int i = 0; i < 6; i++)
{
Npc raider = addSpawn(ADEN_RAIDER, killer, true, 180000, false);
final Npc raider = addSpawn(ADEN_RAIDER, killer, true, 180000, false);
addAttackPlayerDesire(raider, killer);
}
break;

View File

@@ -103,7 +103,7 @@ public class GainakSiege extends AbstractNpcAI
startQuestTimer("GAINAK_WAR", getTimeBetweenSieges() * 60000, null, null);
if (Config.ANNOUNCE_GAINAK_SIEGE)
{
SystemMessage s = new SystemMessage(SystemMessageId.PROGRESS_EVENT_STAGE_S1);
final SystemMessage s = new SystemMessage(SystemMessageId.PROGRESS_EVENT_STAGE_S1);
s.addString("Gainak is now in peace.");
Broadcast.toAllOnlinePlayers(s);
}
@@ -123,7 +123,7 @@ public class GainakSiege extends AbstractNpcAI
startQuestTimer("GAINAK_WAR", SIEGE_DURATION * 60000, null, null);
if (Config.ANNOUNCE_GAINAK_SIEGE)
{
SystemMessage s = new SystemMessage(SystemMessageId.PROGRESS_EVENT_STAGE_S1);
final SystemMessage s = new SystemMessage(SystemMessageId.PROGRESS_EVENT_STAGE_S1);
s.addString("Gainak is now under siege.");
Broadcast.toAllOnlinePlayers(s);
}

View File

@@ -130,7 +130,7 @@ public class TavernEmployee extends AbstractNpcAI
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
final String htmltext = null;
switch (event)
{
case "spam_text1":

View File

@@ -42,7 +42,7 @@ public class ApherusLookout extends AbstractNpcAI
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
final String htmltext = null;
if (event.equals("open_bag"))
{
if (getRandom(100) < 7)
@@ -58,11 +58,11 @@ public class ApherusLookout extends AbstractNpcAI
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isPet)
{
Npc aPackage = addSpawn(APHERUS_PACKAGE, npc.getX(), npc.getY(), npc.getZ(), 0, true, 120000, false);
final Npc aPackage = addSpawn(APHERUS_PACKAGE, npc.getX(), npc.getY(), npc.getZ(), 0, true, 120000, false);
aPackage.setIsImmobilized(true);
Npc bPackage = addSpawn(APHERUS_PACKAGE1, npc.getX(), npc.getY(), npc.getZ(), 0, true, 120000, false);
final Npc bPackage = addSpawn(APHERUS_PACKAGE1, npc.getX(), npc.getY(), npc.getZ(), 0, true, 120000, false);
bPackage.setIsImmobilized(true);
Npc cPackage = addSpawn(APHERUS_PACKAGE2, npc.getX(), npc.getY(), npc.getZ(), 0, true, 120000, false);
final Npc cPackage = addSpawn(APHERUS_PACKAGE2, npc.getX(), npc.getY(), npc.getZ(), 0, true, 120000, false);
cPackage.setIsImmobilized(true);
return super.onKill(npc, killer, isPet);
}

View File

@@ -52,7 +52,7 @@ public class FuryKiku extends AbstractNpcAI
{
case "SPAWN":
{
Party party = player.getParty();
final Party party = player.getParty();
if (party != null)
{
party.getMembers().forEach(p -> addSpawn(FURYKIKU, p, true, 180000, true, 0));

View File

@@ -70,7 +70,7 @@ public class Hardin extends AbstractNpcAI
if (event.equals("list"))
{
StringBuilder classes = new StringBuilder();
final StringBuilder classes = new StringBuilder();
for (ClassId c : ClassId.values())
{
if ((((c.level() != 4) && (c.getRace() != Race.ERTHEIA)) //

View File

@@ -64,9 +64,9 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
{
for (int zoneId = 60142; zoneId <= 60165; zoneId++)
{
ZoneType zone = ZoneManager.getInstance().getZoneById(zoneId);
final ZoneType zone = ZoneManager.getInstance().getZoneById(zoneId);
_roomInfo.put(zone, new zoneInfo());
String zoneName = zone.getName().toLowerCase().replace(" ", "_");
final String zoneName = zone.getName().toLowerCase().replace(" ", "_");
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName), null));
}
}
@@ -131,7 +131,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
{
try
{
zoneInfo currentInfo = _roomInfo.get(_zone);
final zoneInfo currentInfo = _roomInfo.get(_zone);
switch (currentInfo.getZoneStage())
{
case 0:
@@ -169,7 +169,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (currentInfo.getCurrentMonitorizedDamage() >= 10)
{
_zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.DEMONIC_SYSTEM_WILL_ACTIVATE, ExShowScreenMessage.TOP_CENTER, 3000));
String zoneName = _zone.getName().toLowerCase().replace(" ", "_");
final String zoneName = _zone.getName().toLowerCase().replace(" ", "_");
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName)));
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"), null));
_zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED)));
@@ -193,7 +193,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
player.sendPacket(new ExSendUIEvent(player));
}
}
String zoneName = _zone.getName().toLowerCase().replace(" ", "_");
final String zoneName = _zone.getName().toLowerCase().replace(" ", "_");
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic")));
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName), null));
return;
@@ -219,14 +219,14 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (currentZone.getKey().isInsideZone(npc))
{
final zoneInfo currentInfo = currentZone.getValue();
int currentPoints = currentInfo.getCurrentPoints();
final int currentPoints = currentInfo.getCurrentPoints();
if (currentPoints == 300)
{
if (currentInfo.getZoneStage() < 1)
{
return super.onKill(npc, killer, isSummon);
}
int currentDamage = currentInfo.getCurrentMonitorizedDamage();
final int currentDamage = currentInfo.getCurrentMonitorizedDamage();
int calcDamage = currentDamage + 1;
if (calcDamage >= 10)
{
@@ -262,7 +262,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
if (npc.getDisplayEffect() > 0)
{
MonsterInstance copy = (MonsterInstance) addSpawn(npc.getId(), npc.getX(), npc.getY(), npc.getZ(), 0, true, 0, false);
final MonsterInstance copy = (MonsterInstance) addSpawn(npc.getId(), npc.getX(), npc.getY(), npc.getZ(), 0, true, 0, false);
copy.setTarget(killer);
copy.addDamageHate(killer, 500, 99999);
copy.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, killer);

View File

@@ -672,7 +672,7 @@ public class Raina extends AbstractNpcAI
{
final int currentBaseId = player.getBaseClass();
final ClassId baseCID = ClassId.getClassId(currentBaseId);
int baseClassId = (CategoryData.getInstance().isInCategory(CategoryType.FOURTH_CLASS_GROUP, baseCID.getId()) || CategoryData.getInstance().isInCategory(CategoryType.FIFTH_CLASS_GROUP, baseCID.getId()) || CategoryData.getInstance().isInCategory(CategoryType.SIXTH_CLASS_GROUP, baseCID.getId())) ? baseCID.getParent().getId() : currentBaseId;
final int baseClassId = (CategoryData.getInstance().isInCategory(CategoryType.FOURTH_CLASS_GROUP, baseCID.getId()) || CategoryData.getInstance().isInCategory(CategoryType.FIFTH_CLASS_GROUP, baseCID.getId()) || CategoryData.getInstance().isInCategory(CategoryType.SIXTH_CLASS_GROUP, baseCID.getId())) ? baseCID.getParent().getId() : currentBaseId;
final Set<ClassId> availSubs = getSubclasses(player, baseClassId);
@@ -830,7 +830,7 @@ public class Raina extends AbstractNpcAI
}
}
Set<ClassId> unavailableClasses = subclassSetMap.get(pClass);
final Set<ClassId> unavailableClasses = subclassSetMap.get(pClass);
if (unavailableClasses != null)
{
subclasses.removeAll(unavailableClasses);

View File

@@ -408,7 +408,7 @@ public class Anakim extends AbstractNpcAI
randomSpawn = _spawns.get(Rnd.get(_spawns.size()));
if (randomSpawn != null)
{
Npc remnant = addSpawn(REMNANT, randomSpawn.getX(), randomSpawn.getY(), randomSpawn.getZ(), randomSpawn.getHeading(), true, 0, false, 0);
final Npc remnant = addSpawn(REMNANT, randomSpawn.getX(), randomSpawn.getY(), randomSpawn.getZ(), randomSpawn.getHeading(), true, 0, false, 0);
_remnants.add(remnant);
}
}
@@ -426,13 +426,13 @@ public class Anakim extends AbstractNpcAI
}
case "cancel_timers":
{
QuestTimer activityTimer = getQuestTimer("check_activity_task", null, null);
final QuestTimer activityTimer = getQuestTimer("check_activity_task", null, null);
if (activityTimer != null)
{
activityTimer.cancel();
}
QuestTimer forceEnd = getQuestTimer("end_anakim", null, null);
final QuestTimer forceEnd = getQuestTimer("end_anakim", null, null);
if (forceEnd != null)
{
forceEnd.cancel();
@@ -588,7 +588,7 @@ public class Anakim extends AbstractNpcAI
}
if (!BOSS_ZONE.isInsideZone(npc)) // Npc moved out of the zone
{
Spawn spawn = npc.getSpawn();
final Spawn spawn = npc.getSpawn();
if (spawn != null)
{
npc.teleToLocation(spawn.getX(), spawn.getY(), spawn.getZ());
@@ -661,13 +661,13 @@ public class Anakim extends AbstractNpcAI
private long calcReuseFromDays(int day1Minute, int day1Hour, int day1Day, int day2Minute, int day2Hour, int day2Day)
{
Calendar now = Calendar.getInstance();
Calendar day1 = (Calendar) now.clone();
final Calendar now = Calendar.getInstance();
final Calendar day1 = (Calendar) now.clone();
day1.set(Calendar.MINUTE, day1Minute);
day1.set(Calendar.HOUR_OF_DAY, day1Hour);
day1.set(Calendar.DAY_OF_WEEK, day1Day);
Calendar day2 = (Calendar) day1.clone();
final Calendar day2 = (Calendar) day1.clone();
day2.set(Calendar.MINUTE, day2Minute);
day2.set(Calendar.HOUR_OF_DAY, day2Hour);
day2.set(Calendar.DAY_OF_WEEK, day2Day);

View File

@@ -150,7 +150,7 @@ public class BalokWarzone extends AbstractInstance
case "stage_last_send_minions":
{
Npc minion = _minionList.get(Rnd.get(_minionList.size()));
final Npc minion = _minionList.get(Rnd.get(_minionList.size()));
if (minion != null)
{
minion.setRunning();
@@ -183,14 +183,14 @@ public class BalokWarzone extends AbstractInstance
{
for (int i = 0; i < 4; i++)
{
Npc disciple = addSpawn(HELL_DISCIPLE, npc.getX(), npc.getY(), npc.getZ(), 0, true, 600000, false, world.getId());
final Npc disciple = addSpawn(HELL_DISCIPLE, npc.getX(), npc.getY(), npc.getZ(), 0, true, 600000, false, world.getId());
addAttackPlayerDesire(disciple, player);
}
break;
}
case "imprission_minions":
{
int[] randomJail = PRISONS_SPAWN[Rnd.get(PRISONS_SPAWN.length)]; // Random jail
final int[] randomJail = PRISONS_SPAWN[Rnd.get(PRISONS_SPAWN.length)]; // Random jail
player.teleToLocation(randomJail[0], randomJail[1], randomJail[2]);
world.broadcastPacket(new ExShowScreenMessage("$s1, locked away in the prison.".replace("$s1", player.getName()), 5000));
break;
@@ -209,7 +209,7 @@ public class BalokWarzone extends AbstractInstance
{
for (int[] a : MINION_SPAWN)
{
Npc minion = addSpawn(MINION, a[0], a[1], a[2], a[3], false, 0, false, world.getId());
final Npc minion = addSpawn(MINION, a[0], a[1], a[2], a[3], false, 0, false, world.getId());
_minionList.add(minion);
INVINCIBILITY_ACTIVATION.getSkill().applyEffects(minion, minion);
world.setStatus(2);

View File

@@ -200,14 +200,14 @@ public class Kelbim extends AbstractNpcAI
{
for (int i = 0; i < Rnd.get((_bossStage * 5) / 2, _bossStage * 5); i++)
{
Npc minion = addSpawn(KELBIM_GUARD, _kelbimBoss.getX(), _kelbimBoss.getY(), _kelbimBoss.getZ(), 0, true, 0, true, 0);
final Npc minion = addSpawn(KELBIM_GUARD, _kelbimBoss.getX(), _kelbimBoss.getY(), _kelbimBoss.getZ(), 0, true, 0, true, 0);
minion.setRunning();
((Attackable) minion).setIsRaidMinion(true);
_minions.add(minion);
}
for (int i = 0; i < Rnd.get((_bossStage * 2) / 2, _bossStage * 2); i++)
{
Npc minion = addSpawn(KELBIM_GUARDIANS[Rnd.get(KELBIM_GUARDIANS.length)], _kelbimBoss.getX(), _kelbimBoss.getY(), _kelbimBoss.getZ(), 0, true, 0, true, 0);
final Npc minion = addSpawn(KELBIM_GUARDIANS[Rnd.get(KELBIM_GUARDIANS.length)], _kelbimBoss.getX(), _kelbimBoss.getY(), _kelbimBoss.getZ(), 0, true, 0, true, 0);
minion.setRunning();
((Attackable) minion).setIsRaidMinion(true);
_minions.add(minion);
@@ -220,8 +220,8 @@ public class Kelbim extends AbstractNpcAI
{
if (_kelbimBoss.isInCombat())
{
Skill randomAttackSkill = AREA_SKILLS[Rnd.get(AREA_SKILLS.length)];
List<Npc> skillNpcs = new ArrayList<>();
final Skill randomAttackSkill = AREA_SKILLS[Rnd.get(AREA_SKILLS.length)];
final List<Npc> skillNpcs = new ArrayList<>();
for (PlayerInstance pl : ZONE.getPlayersInside())
{
if (pl == null)
@@ -230,7 +230,7 @@ public class Kelbim extends AbstractNpcAI
}
if (Rnd.get(100) > 40)
{
Npc skillMob = addSpawn(KELBIM_SHOUT, pl.getX(), pl.getY(), pl.getZ() + 10, 0, true, 60000, false, 0);
final Npc skillMob = addSpawn(KELBIM_SHOUT, pl.getX(), pl.getY(), pl.getZ() + 10, 0, true, 60000, false, 0);
skillNpcs.add(skillMob);
_minions.add(skillMob);
}
@@ -250,7 +250,7 @@ public class Kelbim extends AbstractNpcAI
}
case "cancel_timers":
{
QuestTimer activityTimer = getQuestTimer("check_activity_task", null, null);
final QuestTimer activityTimer = getQuestTimer("check_activity_task", null, null);
if (activityTimer != null)
{
activityTimer.cancel();
@@ -306,7 +306,7 @@ public class Kelbim extends AbstractNpcAI
{
if (npc.getId() == ENTER_DEVICE)
{
int status = GrandBossManager.getInstance().getBossStatus(KELBIM);
final int status = GrandBossManager.getInstance().getBossStatus(KELBIM);
if (status > ALIVE)
{
return "34052-1.html";

View File

@@ -434,7 +434,7 @@ public class Lilith extends AbstractNpcAI
randomSpawn = _spawns.get(Rnd.get(_spawns.size()));
if (randomSpawn != null)
{
Npc remnant = addSpawn(REMNANT, randomSpawn.getX(), randomSpawn.getY(), randomSpawn.getZ(), randomSpawn.getHeading(), true, 0, false, 0);
final Npc remnant = addSpawn(REMNANT, randomSpawn.getX(), randomSpawn.getY(), randomSpawn.getZ(), randomSpawn.getHeading(), true, 0, false, 0);
_remnants.add(remnant);
}
}
@@ -452,13 +452,13 @@ public class Lilith extends AbstractNpcAI
}
case "cancel_timers":
{
QuestTimer activityTimer = getQuestTimer("check_activity_task", null, null);
final QuestTimer activityTimer = getQuestTimer("check_activity_task", null, null);
if (activityTimer != null)
{
activityTimer.cancel();
}
QuestTimer forceEnd = getQuestTimer("end_lilith", null, null);
final QuestTimer forceEnd = getQuestTimer("end_lilith", null, null);
if (forceEnd != null)
{
forceEnd.cancel();
@@ -604,7 +604,7 @@ public class Lilith extends AbstractNpcAI
}
if (!BOSS_ZONE.isInsideZone(npc)) // Npc moved out of the zone
{
Spawn spawn = npc.getSpawn();
final Spawn spawn = npc.getSpawn();
if (spawn != null)
{
npc.teleToLocation(spawn.getX(), spawn.getY(), spawn.getZ());
@@ -677,13 +677,13 @@ public class Lilith extends AbstractNpcAI
private long calcReuseFromDays(int day1Minute, int day1Hour, int day1Day, int day2Minute, int day2Hour, int day2Day)
{
Calendar now = Calendar.getInstance();
Calendar day1 = (Calendar) now.clone();
final Calendar now = Calendar.getInstance();
final Calendar day1 = (Calendar) now.clone();
day1.set(Calendar.MINUTE, day1Minute);
day1.set(Calendar.HOUR_OF_DAY, day1Hour);
day1.set(Calendar.DAY_OF_WEEK, day1Day);
Calendar day2 = (Calendar) day1.clone();
final Calendar day2 = (Calendar) day1.clone();
day2.set(Calendar.MINUTE, day2Minute);
day2.set(Calendar.HOUR_OF_DAY, day2Hour);
day2.set(Calendar.DAY_OF_WEEK, day2Day);

View File

@@ -279,7 +279,7 @@ public class Lindvior extends AbstractNpcAI
LOGGER.warning(getName() + ": Character: " + attacker.getName() + " attacked: " + npc.getName() + " wich is out of the boss zone!");
}
double percent = ((npc.getCurrentHp() - damage) / npc.getMaxHp()) * 100;
final double percent = ((npc.getCurrentHp() - damage) / npc.getMaxHp()) * 100;
if ((percent <= 80) && (_status == 0))
{
_zoneLair.broadcastPacket(new OnEventTrigger(RED_ZONE_EFFECT, true));
@@ -466,7 +466,7 @@ public class Lindvior extends AbstractNpcAI
{
synchronized (_chargedValues)
{
int index = npc.getScriptValue();
final int index = npc.getScriptValue();
if (!hasFlag(_chargedMask, 1 << index))
{
_chargedValues[index] += caster.isGM() ? (30 / 4) + 2 : (1 / 4) + 2;
@@ -707,7 +707,7 @@ public class Lindvior extends AbstractNpcAI
}
case "stage_1_activate_generator":
{
int index = npc.getScriptValue();
final int index = npc.getScriptValue();
if (!hasFlag(_activeMask, 1 << index))
{
_activeMask |= 1 << index;
@@ -740,7 +740,7 @@ public class Lindvior extends AbstractNpcAI
{
_skillCastTask = ThreadPool.scheduleAtFixedRate(() -> _generatorSpawn.forEach(generators ->
{
int index = generators.getScriptValue();
final int index = generators.getScriptValue();
if (!generators.isCastingNow() && (generators.getEffectList().getBuffInfoBySkillId(SKILL_RECHARGE_POSIBLE.getSkillId()) == null) && !hasFlag(_chargedMask, 1 << index))
{
// TODO Need core implemented combo skill packet.
@@ -878,7 +878,7 @@ public class Lindvior extends AbstractNpcAI
private void sendEventTrigger(boolean status, int... triggers)
{
IClientOutgoingPacket[] pakets = new IClientOutgoingPacket[triggers.length];
final IClientOutgoingPacket[] pakets = new IClientOutgoingPacket[triggers.length];
for (int i = 0; i < triggers.length; i++)
{
pakets[i] = new OnEventTrigger(triggers[i], status);

View File

@@ -68,7 +68,7 @@ public class LindviorBoss extends AbstractNpcAI
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon)
{
double percent = ((npc.getCurrentHp() - damage) / npc.getMaxHp()) * 100;
final double percent = ((npc.getCurrentHp() - damage) / npc.getMaxHp()) * 100;
final int chance = getRandom(100);
switch (npc.getId())
{

View File

@@ -296,7 +296,7 @@ public class Trasken extends AbstractNpcAI
super();
_zoneLair = ZoneManager.getInstance().getZoneById(ZONE_ID, NoSummonFriendZone.class);
_zoneLair2 = ZoneManager.getInstance().getZoneById(ZONE_ID_HEART, NoSummonFriendZone.class);
int[] creature = new int[]
final int[] creature = new int[]
{
TRASKEN,
TIE,
@@ -344,7 +344,7 @@ public class Trasken extends AbstractNpcAI
private void init()
{
int size = _zoneLair.getPlayersInside().size();
final int size = _zoneLair.getPlayersInside().size();
if ((size >= 14) && (size <= 28))
{
_playersToEnter = 7;

View File

@@ -73,7 +73,7 @@ public class SellBuff implements IVoicedCommandHandler, IBypassHandler
public boolean useBypass(String command, PlayerInstance player, Creature target)
{
String cmd = "";
StringBuilder params = new StringBuilder();
final StringBuilder params = new StringBuilder();
final StringTokenizer st = new StringTokenizer(command, " ");
if (st.hasMoreTokens())
@@ -130,7 +130,7 @@ public class SellBuff implements IVoicedCommandHandler, IBypassHandler
}
else
{
StringBuilder title = new StringBuilder();
final StringBuilder title = new StringBuilder();
title.append("BUFF SELL: ");
final StringTokenizer st = new StringTokenizer(params, " ");
while (st.hasMoreTokens())

View File

@@ -65,7 +65,7 @@ public class RudolphsBlessing extends LongTimeEvent
if (takeItems(player, ITEM_REQUIREMENT.getId(), ITEM_REQUIREMENT.getCount()))
{
SkillCaster.triggerCast(player, player, RUDOLPH_TRYUCK.getSkill());
Skill rudolphsBlessing = SkillData.getInstance().getSkill(23297, 1);
final Skill rudolphsBlessing = SkillData.getInstance().getSkill(23297, 1);
rudolphsBlessing.applyEffects(player, player);
}
startQuestTimer("rudolph_eat", 10 * 60 * 1000, null, player);

View File

@@ -199,7 +199,7 @@ public class SavingSanta extends LongTimeEvent
continue;
}
int result = pl.getEffectList().getBuffInfoBySkillId(23019).getSkill().getLevel() - skill.getLevel();
final int result = pl.getEffectList().getBuffInfoBySkillId(23019).getSkill().getLevel() - skill.getLevel();
if (result == 0)
{
@@ -216,7 +216,7 @@ public class SavingSanta extends LongTimeEvent
}
else if ((result == 1) || (result == -2))
{
int level = (pl.isAffectedBySkill(23022) ? (pl.getEffectList().getBuffInfoBySkillId(23022).getSkill().getLevel() + 1) : 1);
final int level = (pl.isAffectedBySkill(23022) ? (pl.getEffectList().getBuffInfoBySkillId(23022).getSkill().getLevel() + 1) : 1);
pl.broadcastPacket(new MagicSkillUse(pl, pl, 23022, level, 3000, 1));
SkillData.getInstance().getSkill(23022, level).applyEffects(pl, pl);
@@ -324,7 +324,7 @@ public class SavingSanta extends LongTimeEvent
{
if (_rewardedPlayers.containsKey(pl.getAccountName()))
{
long elapsedTimeSinceLastRewarded = System.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
final long elapsedTimeSinceLastRewarded = System.currentTimeMillis() - _rewardedPlayers.get(pl.getAccountName());
if (elapsedTimeSinceLastRewarded < MIN_TIME_BETWEEN_2_REWARDS)
{
continue;
@@ -339,10 +339,10 @@ public class SavingSanta extends LongTimeEvent
continue;
}
}
int locx = (int) (pl.getX() + (Math.pow(-1, getRandom(1, 2)) * 50));
int locy = (int) (pl.getY() + (Math.pow(-1, getRandom(1, 2)) * 50));
int heading = Util.calculateHeadingFrom(locx, locy, pl.getX(), pl.getY());
Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
final int locx = (int) (pl.getX() + (Math.pow(-1, getRandom(1, 2)) * 50));
final int locy = (int) (pl.getY() + (Math.pow(-1, getRandom(1, 2)) * 50));
final int heading = Util.calculateHeadingFrom(locx, locy, pl.getX(), pl.getY());
final Npc santa = addSpawn(HOLIDAY_SANTA_ID, locx, locy, pl.getZ(), heading, false, 30000);
_rewardedPlayers.put(pl.getAccountName(), System.currentTimeMillis());
player.getVariables().set("LAST_SANTA_REWARD", System.currentTimeMillis());
startQuestTimer("SantaRewarding0", 500, santa, pl);
@@ -446,7 +446,7 @@ public class SavingSanta extends LongTimeEvent
{
if (_blessedPlayers.containsKey(plb.getAccountName()))
{
long elapsedTimeSinceLastBlessed = currentTime - _blessedPlayers.get(plb.getAccountName());
final long elapsedTimeSinceLastBlessed = currentTime - _blessedPlayers.get(plb.getAccountName());
if (elapsedTimeSinceLastBlessed < MIN_TIME_BETWEEN_2_BLESSINGS)
{
continue;
@@ -504,12 +504,12 @@ public class SavingSanta extends LongTimeEvent
{
for (PlayerInstance playerr : World.getInstance().getVisibleObjects(tree, PlayerInstance.class))
{
int xxMin = tree.getX() - 60;
int yyMin = tree.getY() - 60;
int xxMax = tree.getX() + 60;
int yyMax = tree.getY() + 60;
int playerX = playerr.getX();
int playerY = playerr.getY();
final int xxMin = tree.getX() - 60;
final int yyMin = tree.getY() - 60;
final int xxMax = tree.getX() + 60;
final int yyMax = tree.getY() + 60;
final int playerX = playerr.getX();
final int playerY = playerr.getY();
if ((playerX > xxMin) && (playerX < xxMax) && (playerY > yyMin) && (playerY < yyMax))
{
@@ -528,7 +528,7 @@ public class SavingSanta extends LongTimeEvent
for (ItemHolder item : TREE_REQUIRED_ITEMS)
{
long pieceCount = player.getInventory().getInventoryItemCount(item.getId(), -1);
final long pieceCount = player.getInventory().getInventoryItemCount(item.getId(), -1);
if (pieceCount >= item.getCount())
{
itemsOk = itemsOk + 1;
@@ -573,7 +573,7 @@ public class SavingSanta extends LongTimeEvent
else if (event.equalsIgnoreCase("SpecialTree"))
{
htmltext = "<html><title>Christmas Event</title><body><br><br><table width=260><tr><td></td><td width=40></td><td width=40></td></tr><tr><td><font color=LEVEL>Special Christmas Tree</font></td><td width=40><img src=\"Icon.etc_x_mas_tree_i00\" width=32 height=32></td><td width=40></td></tr></table><br><br><table width=260>";
long pieceCount = player.getInventory().getInventoryItemCount(X_MAS_TREE1, -1);
final long pieceCount = player.getInventory().getInventoryItemCount(X_MAS_TREE1, -1);
int itemsOk = 0;
if (pieceCount >= 10)
@@ -613,7 +613,7 @@ public class SavingSanta extends LongTimeEvent
else if (event.equalsIgnoreCase("SantaHat"))
{
htmltext = "<html><title>Christmas Event</title><body><br><br><table width=260><tr><td></td><td width=40></td><td width=40></td></tr><tr><td><font color=LEVEL>Santa's Hat</font></td><td width=40><img src=\"Icon.Accessory_santas_cap_i00\" width=32 height=32></td><td width=40></td></tr></table><br><br><table width=260>";
long pieceCount = player.getInventory().getInventoryItemCount(X_MAS_TREE1, -1);
final long pieceCount = player.getInventory().getInventoryItemCount(X_MAS_TREE1, -1);
int itemsOk = 0;
if (pieceCount >= 10)
@@ -651,7 +651,7 @@ public class SavingSanta extends LongTimeEvent
else if (event.equalsIgnoreCase("SavingSantaHat"))
{
htmltext = "<html><title>Christmas Event</title><body><br><br><table width=260><tr><td></td><td width=40></td><td width=40></td></tr><tr><td><font color=LEVEL>Saving Santa's Hat</font></td><td width=40><img src=\"Icon.Accessory_santas_cap_i00\" width=32 height=32></td><td width=40></td></tr></table><br><br><table width=260>";
long pieceCount = player.getInventory().getAdena();
final long pieceCount = player.getInventory().getAdena();
int itemsOk = 0;
if (pieceCount >= 50000)

View File

@@ -86,9 +86,9 @@ public class SkillTransfer extends AbstractNpcAI
return;
}
int pomanderId = PORMANDERS[index].getId();
final int pomanderId = PORMANDERS[index].getId();
// remove unsused HolyPomander
PlayerInventory inv = player.getInventory();
final PlayerInventory inv = player.getInventory();
for (ItemInstance itemI : inv.getAllItemsByItemId(pomanderId))
{
inv.destroyItem("[HolyPomander - remove]", itemI, player, null);

View File

@@ -732,7 +732,6 @@ public class MasterHandler
catch (Exception e)
{
LOGGER.log(Level.WARNING, "Failed loading handler: " + c.getSimpleName(), e);
continue;
}
}
}

View File

@@ -176,9 +176,9 @@ public class AdminBuffs implements IAdminCommandHandler
{
try
{
StringTokenizer st = new StringTokenizer(command, " ");
final StringTokenizer st = new StringTokenizer(command, " ");
st.nextToken();
int objectId = Integer.parseInt(st.nextToken());
final int objectId = Integer.parseInt(st.nextToken());
viewBlockedEffects(activeChar, objectId);
return true;
}
@@ -362,6 +362,7 @@ public class AdminBuffs implements IAdminCommandHandler
}
catch (Exception e)
{
// Checked bellow.
}
if ((target != null) && (skillId > 0))
@@ -389,6 +390,7 @@ public class AdminBuffs implements IAdminCommandHandler
}
catch (Exception e)
{
// Checked bellow.
}
if (target != null)

View File

@@ -120,7 +120,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
{
int hours = 0;
int minutes = 0;
int id = entry.getKey();
final int id = entry.getKey();
final long remainingTime = (entry.getValue() - System.currentTimeMillis()) / 1000;
if (remainingTime > 0)
{

View File

@@ -30,8 +30,8 @@ import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - kill = kills target Creature - kill_monster = kills target non-player - kill <radius> = If radius is specified, then ALL players only in that radius will be killed. - kill_monster <radius> = If radius is specified, then ALL non-players only in
* that radius will be killed.
* This class handles following admin commands: - kill = kills target Creature - kill_monster = kills target non-player - kill <radius> = If radius is specified, then ALL players only in that radius will be killed. - kill_monster <radius> = If radius is specified, then ALL non-players only in that
* radius will be killed.
* @version $Revision: 1.2.4.5 $ $Date: 2007/07/31 10:06:06 $
*/
public class AdminKill implements IAdminCommandHandler

View File

@@ -316,7 +316,7 @@ public class AdminQuest implements IAdminCommandHandler
{
continue;
}
else if (n.isDirectory())
if (n.isDirectory())
{
sb.append("<a action=\"bypass -h admin_script_dir " + c + "\">" + c + "</a><br1>");
}
@@ -348,7 +348,7 @@ public class AdminQuest implements IAdminCommandHandler
{
continue;
}
else if (n.isDirectory())
if (n.isDirectory())
{
sb.append("<a action=\"bypass -h admin_script_dir " + currentPath + "/" + c + "\">" + (questReducedNames ? getQuestName(c) : c) + "</a><br1>");
}

View File

@@ -69,7 +69,7 @@ public class AdminShop implements IAdminCommandHandler
{
try
{
int listId = Integer.parseInt(command.substring(16).trim());
final int listId = Integer.parseInt(command.substring(16).trim());
MultisellData.getInstance().separateAndSend(listId, activeChar, null, false);
}
catch (NumberFormatException | IndexOutOfBoundsException e)
@@ -81,7 +81,7 @@ public class AdminShop implements IAdminCommandHandler
{
try
{
int listId = Integer.parseInt(command.substring(20).trim());
final int listId = Integer.parseInt(command.substring(20).trim());
MultisellData.getInstance().separateAndSend(listId, activeChar, null, true);
}
catch (NumberFormatException | IndexOutOfBoundsException e)

View File

@@ -101,6 +101,7 @@ public class AdminSkill implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{
// Not important.
}
}
else if (command.startsWith("admin_skill_list"))
@@ -116,6 +117,7 @@ public class AdminSkill implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{
// Not important.
}
}
else if (command.startsWith("admin_add_skill"))

View File

@@ -84,7 +84,7 @@ public class FindPvP implements IBypassHandler
// Check if the player's clan is already outnumbering the PvP
if (player.getClan() != null)
{
Map<Integer, Integer> clanNumbers = new HashMap<>();
final Map<Integer, Integer> clanNumbers = new HashMap<>();
int allyId = player.getAllyId();
if (allyId == 0)
{

View File

@@ -33,7 +33,7 @@ import org.l2jmobius.gameserver.network.serverpackets.ExItemAuctionInfoPacket;
public class ItemAuctionLink implements IBypassHandler
{
private static final SimpleDateFormat fmt = new SimpleDateFormat("HH:mm:ss dd.MM.yyyy");
private static final SimpleDateFormat SDF = new SimpleDateFormat("HH:mm:ss dd.MM.yyyy");
private static final String[] COMMANDS =
{
@@ -91,7 +91,7 @@ public class ItemAuctionLink implements IBypassHandler
if (nextAuction != null)
{
player.sendMessage("The next auction will begin on the " + fmt.format(new Date(nextAuction.getStartingTime())) + ".");
player.sendMessage("The next auction will begin on the " + SDF.format(new Date(nextAuction.getStartingTime())) + ".");
}
return true;
}

View File

@@ -408,7 +408,7 @@ public class NpcViewMod implements IBypassHandler
{
final StringBuilder sb = new StringBuilder();
int height = 64;
final int height = 64;
final DropHolder dropItem = dropList.get(i);
final Item item = ItemTable.getInstance().getTemplate(dropItem.getItemId());

View File

@@ -38,22 +38,19 @@ public class ChatPartyRoomAll implements IChatHandler
@Override
public void handleChat(ChatType type, PlayerInstance activeChar, String target, String text)
{
if (activeChar.isInParty())
if (activeChar.isInParty() && activeChar.getParty().isInCommandChannel() && activeChar.getParty().isLeader(activeChar))
{
if (activeChar.getParty().isInCommandChannel() && activeChar.getParty().isLeader(activeChar))
if (activeChar.isChatBanned() && Config.BAN_CHAT_CHANNELS.contains(type))
{
if (activeChar.isChatBanned() && Config.BAN_CHAT_CHANNELS.contains(type))
{
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER);
return;
}
if (Config.JAIL_DISABLE_CHAT && activeChar.isJailed() && !activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS))
{
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return;
}
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar);
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER);
return;
}
if (Config.JAIL_DISABLE_CHAT && activeChar.isJailed() && !activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS))
{
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return;
}
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar);
}
}

View File

@@ -38,22 +38,19 @@ public class ChatPartyRoomCommander implements IChatHandler
@Override
public void handleChat(ChatType type, PlayerInstance activeChar, String target, String text)
{
if (activeChar.isInParty())
if (activeChar.isInParty() && activeChar.getParty().isInCommandChannel() && activeChar.getParty().getCommandChannel().getLeader().equals(activeChar))
{
if (activeChar.getParty().isInCommandChannel() && activeChar.getParty().getCommandChannel().getLeader().equals(activeChar))
if (activeChar.isChatBanned() && Config.BAN_CHAT_CHANNELS.contains(type))
{
if (activeChar.isChatBanned() && Config.BAN_CHAT_CHANNELS.contains(type))
{
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER);
return;
}
if (Config.JAIL_DISABLE_CHAT && activeChar.isJailed() && !activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS))
{
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return;
}
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar);
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER);
return;
}
if (Config.JAIL_DISABLE_CHAT && activeChar.isJailed() && !activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS))
{
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return;
}
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar);
}
}

View File

@@ -143,38 +143,38 @@ public class DropSearchBoard implements IParseBoardHandler
public boolean parseCommunityBoardCommand(String command, PlayerInstance player)
{
final String navigation = HtmCache.getInstance().getHtm(player, NAVIGATION_PATH);
String[] params = command.split(" ");
final String[] params = command.split(" ");
String html = HtmCache.getInstance().getHtm(player, "data/html/CommunityBoard/Custom/dropsearch/main.html");
switch (params[0])
{
case "_bbs_search_item":
{
String itemName = buildItemName(params);
String result = buildItemSearchResult(itemName);
final String itemName = buildItemName(params);
final String result = buildItemSearchResult(itemName);
html = html.replace("%searchResult%", result);
break;
}
case "_bbs_search_drop":
{
final DecimalFormat chanceFormat = new DecimalFormat("0.00##");
int itemId = Integer.parseInt(params[1]);
final int itemId = Integer.parseInt(params[1]);
int page = Integer.parseInt(params[2]);
List<CBDropHolder> list = DROP_INDEX_CACHE.get(itemId);
final List<CBDropHolder> list = DROP_INDEX_CACHE.get(itemId);
int pages = list.size() / 14;
if (pages == 0)
{
pages++;
}
int start = (page - 1) * 14;
int end = Math.min(list.size() - 1, start + 14);
StringBuilder builder = new StringBuilder();
final int start = (page - 1) * 14;
final int end = Math.min(list.size() - 1, start + 14);
final StringBuilder builder = new StringBuilder();
final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
final double spoilRateEffectBonus = player.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
for (int index = start; index <= end; index++)
{
CBDropHolder cbDropHolder = list.get(index);
final CBDropHolder cbDropHolder = list.get(index);
// real time server rate calculations
double rateChance = 1;
@@ -299,15 +299,15 @@ public class DropSearchBoard implements IParseBoardHandler
}
case "_bbs_npc_trace":
{
int npcId = Integer.parseInt(params[1]);
List<NpcSpawnTemplate> spawnList = SpawnsData.getInstance().getNpcSpawns(npc -> npc.getId() == npcId);
final int npcId = Integer.parseInt(params[1]);
final List<NpcSpawnTemplate> spawnList = SpawnsData.getInstance().getNpcSpawns(npc -> npc.getId() == npcId);
if (spawnList.isEmpty())
{
player.sendMessage("Cannot find any spawn. Maybe dropped by a boss or instance monster.");
}
else
{
NpcSpawnTemplate spawn = spawnList.get(Rnd.get(spawnList.size()));
final NpcSpawnTemplate spawn = spawnList.get(Rnd.get(spawnList.size()));
player.getRadar().addMarker(spawn.getSpawnLocation().getX(), spawn.getSpawnLocation().getY(), spawn.getSpawnLocation().getZ());
}
break;
@@ -330,8 +330,8 @@ public class DropSearchBoard implements IParseBoardHandler
private String buildItemSearchResult(String itemName)
{
int limit = 0;
Set<Integer> existInDropData = DROP_INDEX_CACHE.keySet();
List<Item> items = new ArrayList<>();
final Set<Integer> existInDropData = DROP_INDEX_CACHE.keySet();
final List<Item> items = new ArrayList<>();
for (Item item : ItemTable.getInstance().getAllItems())
{
if (item == null)
@@ -363,7 +363,7 @@ public class DropSearchBoard implements IParseBoardHandler
int line = 0;
StringBuilder builder = new StringBuilder(items.size() * 28);
final StringBuilder builder = new StringBuilder(items.size() * 28);
int i = 0;
for (Item item : items)
{
@@ -416,7 +416,7 @@ public class DropSearchBoard implements IParseBoardHandler
*/
private String buildItemName(String[] params)
{
StringJoiner joiner = new StringJoiner(" ");
final StringJoiner joiner = new StringJoiner(" ");
for (int i = 1; i < params.length; i++)
{
joiner.add(params[i]);

View File

@@ -102,7 +102,7 @@ public class HomeBoard implements IParseBoardHandler
@Override
public String[] getCommunityBoardCommands()
{
List<String> commands = new ArrayList<>();
final List<String> commands = new ArrayList<>();
commands.addAll(Arrays.asList(COMMANDS));
commands.addAll(Arrays.asList(CUSTOM_COMMANDS));
return commands.stream().filter(Objects::nonNull).toArray(String[]::new);
@@ -204,7 +204,7 @@ public class HomeBoard implements IParseBoardHandler
{
player.destroyItemByItemId("CB_Buff", Config.COMMUNITYBOARD_CURRENCY, Config.COMMUNITYBOARD_BUFF_PRICE * buffCount, player, true);
final PetInstance pet = player.getPet();
List<Creature> targets = new ArrayList<>(4);
final List<Creature> targets = new ArrayList<>(4);
targets.add(player);
if (pet != null)
{

View File

@@ -36,7 +36,7 @@ public class DisableSkill extends AbstractEffect
public DisableSkill(StatsSet params)
{
String disable = params.getString("disable");
final String disable = params.getString("disable");
if ((disable != null) && !disable.isEmpty())
{
disableSkills = new HashSet<>();

View File

@@ -38,7 +38,7 @@ public class DispelBySlotMyself extends AbstractEffect
public DispelBySlotMyself(StatsSet params)
{
String dispel = params.getString("dispel");
final String dispel = params.getString("dispel");
if ((dispel != null) && !dispel.isEmpty())
{
_dispelAbnormals = new HashSet<>();

View File

@@ -51,7 +51,7 @@ public class FatalBlow extends AbstractEffect
_criticalChance = params.getDouble("criticalChance", 0);
_overHit = params.getBoolean("overHit", false);
String abnormals = params.getString("abnormalType", null);
final String abnormals = params.getString("abnormalType", null);
if ((abnormals != null) && !abnormals.isEmpty())
{
_abnormals = new HashSet<>();

View File

@@ -87,7 +87,7 @@ public class RebalanceHP extends AbstractEffect
}
}
double percentHP = currentHPs / fullHP;
final double percentHP = currentHPs / fullHP;
for (PlayerInstance member : party.getMembers())
{
if (!member.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, member, true))

View File

@@ -70,7 +70,7 @@ public class RebalanceHPSummon extends AbstractEffect
fullHP += effector.getMaxHp();
currentHPs += effector.getCurrentHp();
double percentHP = currentHPs / fullHP;
final double percentHP = currentHPs / fullHP;
for (Summon summon : effector.getServitors().values())
{
if (!summon.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, summon, true))

View File

@@ -109,7 +109,7 @@ public class RestorationRandom extends AbstractEffect
continue;
}
long itemCount = (long) (createdItem.getCount() * Config.RATE_EXTRACTABLE);
final long itemCount = (long) (createdItem.getCount() * Config.RATE_EXTRACTABLE);
final ItemInstance newItem = player.addItem("Extract", createdItem.getId(), itemCount, effector, false);
if (createdItem.getMaxEnchant() > 0)

View File

@@ -279,7 +279,7 @@ public class AltarOfShilen extends AbstractInstance
final Instance world = npc.getInstanceWorld();
if (world != null)
{
int npcId = npc.getId();
final int npcId = npc.getId();
if (!killedMonsters.containsKey(npcId))
{
killedMonsters.put(npcId, 1);
@@ -412,7 +412,7 @@ public class AltarOfShilen extends AbstractInstance
public String onFirstTalk(Npc npc, PlayerInstance player)
{
final Instance world = npc.getInstanceWorld();
String htmltext = null;
final String htmltext = null;
if (isInInstance(world))
{
switch (npc.getId())

View File

@@ -103,13 +103,13 @@ public class CrystalCavernsEmeraldSquare extends AbstractInstance
{
case "HP_REGEN_TIMER":
{
int value = ((baseId == 5) || (baseId == 6)) ? 5 : baseId;
final int value = ((baseId == 5) || (baseId == 6)) ? 5 : baseId;
npc.getStat().addFixedValue(Stats.REGENERATE_HP_RATE, Double.valueOf(value * 1000));
break;
}
case "SUPPORT_SPAWN_TIMER":
{
int supportVal = npcVars.getInt("SUPPORT_VALUE", 0);
final int supportVal = npcVars.getInt("SUPPORT_VALUE", 0);
if (supportVal > 3)
{

View File

@@ -166,7 +166,7 @@ public class KartiaHelperElise extends AbstractNpcAI
final Map<WorldObject, Integer> hpMap = new HashMap<>();
instance.getAliveNpcs(KARTIA_FRIENDS).forEach(friend -> hpMap.put(friend, friend != null ? friend.getCurrentHpPercent() : 100));
hpMap.put(plr, plr != null ? plr.getCurrentHpPercent() : 100);
Map<WorldObject, Integer> sortedHpMap = Util.sortByValue(hpMap, false);
final Map<WorldObject, Integer> sortedHpMap = Util.sortByValue(hpMap, false);
// See if any friends are below 80% HP and add to list of people to heal.
final List<WorldObject> peopleToHeal = new ArrayList<>();
@@ -195,12 +195,12 @@ public class KartiaHelperElise extends AbstractNpcAI
{
if (personToHeal.getInstanceType() == InstanceType.PlayerInstance)
{
PlayerInstance thePlayer = (PlayerInstance) personToHeal;
final PlayerInstance thePlayer = (PlayerInstance) personToHeal;
thePlayer.setCurrentHp((thePlayer.getMaxHp() * .20) + thePlayer.getCurrentHp());
}
else
{
Npc npcToHeal = (Npc) personToHeal;
final Npc npcToHeal = (Npc) personToHeal;
npcToHeal.setCurrentHp((npcToHeal.getMaxHp() * .20) + npcToHeal.getCurrentHp());
}
}

View File

@@ -225,7 +225,7 @@ public class StoryOfTauti extends AbstractInstance
{
if (!npc.isDead())
{
for (final Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000))
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000))
{
if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0))
{
@@ -786,7 +786,7 @@ public class StoryOfTauti extends AbstractInstance
case FLAME_FLOWER:
{
npc.setCurrentHp(npc.getMaxHp() * 0.20);
for (final Npc tombstone : World.getInstance().getVisibleObjectsInRange(npc, MonsterInstance.class, 500))
for (Npc tombstone : World.getInstance().getVisibleObjectsInRange(npc, MonsterInstance.class, 500))
{
if (tombstone.getId() == SEAL_TOMBSTONE)
{
@@ -863,7 +863,7 @@ public class StoryOfTauti extends AbstractInstance
}
case NPC_1:
{
for (final PlayerInstance nearby : World.getInstance().getVisibleObjectsInRange(npc, PlayerInstance.class, 2000))
for (PlayerInstance nearby : World.getInstance().getVisibleObjectsInRange(npc, PlayerInstance.class, 2000))
{
if (npc.isScriptValue(0) && (nearby != null))
{

View File

@@ -46,7 +46,7 @@ public class Q00032_AnObviousLie extends Quest
// Misc
private static final int MIN_LVL = 45;
// Reward
private static final Map<String, Integer> EARS = new HashMap<>();
private static final Map<String, Integer> EARS = new HashMap<>();
static
{
EARS.put("cat", 6843); // Cat Ears

View File

@@ -81,7 +81,7 @@ public class Q00245_ComeToMe extends Quest
{
if (player.isMentor() && event.equals("30847-13.html"))
{
PlayerInstance mentee = getCurrentMentee(player);
final PlayerInstance mentee = getCurrentMentee(player);
if (mentee != null)
{
if (player.destroyItemByItemId("quest_245", CRYSTAL_A, 100, npc, true))
@@ -94,7 +94,7 @@ public class Q00245_ComeToMe extends Quest
return "30847-12.html";
}
QuestState qs = getQuestState(player, false);
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return event;
@@ -151,7 +151,7 @@ public class Q00245_ComeToMe extends Quest
}
else if (player.isMentee())
{
PlayerInstance mentor = MentorManager.getInstance().getMentor(player.getObjectId()).getPlayerInstance();
final PlayerInstance mentor = MentorManager.getInstance().getMentor(player.getObjectId()).getPlayerInstance();
if ((mentor != null) && mentor.isOnline() && Util.checkIfInRange(200, npc, mentor, true))
{
htmltext = "30847-10.html";
@@ -239,7 +239,7 @@ public class Q00245_ComeToMe extends Quest
{
if (killer.isMentee())
{
PlayerInstance mentor = MentorManager.getInstance().getMentor(killer.getObjectId()).getPlayerInstance();
final PlayerInstance mentor = MentorManager.getInstance().getMentor(killer.getObjectId()).getPlayerInstance();
if ((mentor != null) && Util.checkIfInRange(500, killer, mentor, false))
{
giveItems(killer, CRYSTALS_OF_EXPERIENCE, 1);

View File

@@ -221,6 +221,7 @@ public class Q00336_CoinsOfMagic extends Quest
{
return "30702-02a.html";
}
break;
}
case WAREHOUSE_KEEPER_SORINT:
{
@@ -1345,28 +1346,28 @@ public class Q00336_CoinsOfMagic extends Quest
* @param npcId
* @param weightPoint
* @param base
* @param ITEM_1_1
* @param ITEM_1_2
* @param ITEM_1_MUL
* @param ITEM_2
* @param ITEM_3
* @param ITEM_4
* @param item1a
* @param item1b
* @param item1Mul
* @param item2
* @param item3
* @param item4
* @return
*/
private String shortFirstSteps(QuestState qs, int npcId, int weightPoint, int base, int ITEM_1_1, int ITEM_1_2, int ITEM_1_MUL, int ITEM_2, int ITEM_3, int ITEM_4)
private String shortFirstSteps(QuestState qs, int npcId, int weightPoint, int base, int item1a, int item1b, int item1Mul, int item2, int item3, int item4)
{
final PlayerInstance player = qs.getPlayer();
switch (qs.getInt(PARAM_2))
{
case 42:
{
if ((getQuestItemsCount(player, ITEM_1_1) >= (base * ITEM_1_MUL)) && ((ITEM_1_2 == 0) || (getQuestItemsCount(player, ITEM_1_2) >= base)))
if ((getQuestItemsCount(player, item1a) >= (base * item1Mul)) && ((item1b == 0) || (getQuestItemsCount(player, item1b) >= base)))
{
qs.set(FLAG, 1);
takeItems(player, ITEM_1_1, base * ITEM_1_MUL);
if (ITEM_1_2 > 0)
takeItems(player, item1a, base * item1Mul);
if (item1b > 0)
{
takeItems(player, ITEM_1_2, base);
takeItems(player, item1b, base);
}
qs.set(WEIGHT_POINT, weightPoint);
int param1 = getRandom(3) + 1;
@@ -1379,10 +1380,10 @@ public class Q00336_CoinsOfMagic extends Quest
}
case 31:
{
if (getQuestItemsCount(player, ITEM_2) >= base)
if (getQuestItemsCount(player, item2) >= base)
{
qs.set(FLAG, 1);
takeItems(player, ITEM_2, base);
takeItems(player, item2, base);
qs.set(WEIGHT_POINT, weightPoint);
int param1 = getRandom(3) + 1;
param1 += (getRandom(3) + 1) * 4;
@@ -1394,10 +1395,10 @@ public class Q00336_CoinsOfMagic extends Quest
}
case 21:
{
if (getQuestItemsCount(player, ITEM_3) >= base)
if (getQuestItemsCount(player, item3) >= base)
{
qs.set(FLAG, 1);
takeItems(player, ITEM_3, base);
takeItems(player, item3, base);
qs.set(WEIGHT_POINT, weightPoint);
int param1 = getRandom(3) + 1;
param1 += (getRandom(3) + 1) * 4;
@@ -1409,10 +1410,10 @@ public class Q00336_CoinsOfMagic extends Quest
}
case 11:
{
if (getQuestItemsCount(player, ITEM_4) >= base)
if (getQuestItemsCount(player, item4) >= base)
{
qs.set(FLAG, 1);
takeItems(player, ITEM_4, base);
takeItems(player, item4, base);
qs.set(WEIGHT_POINT, weightPoint);
int param1 = getRandom(3) + 1;
param1 += (getRandom(3) + 1) * 4;
@@ -1430,28 +1431,28 @@ public class Q00336_CoinsOfMagic extends Quest
* @param qs
* @param npcId
* @param mul
* @param ITEM_1
* @param ITEM_1_MUL
* @param REWARD_1
* @param ITEM_2
* @param REWARD_2
* @param ITEM_3
* @param REWARD_3
* @param ITEM_4
* @param REWARD_4
* @param item1
* @param item1Mul
* @param reward1
* @param item2
* @param reward2
* @param item3
* @param reward3
* @param item4
* @param reward4
* @return
*/
private String shortSecondStepOneItem(QuestState qs, int npcId, int mul, int ITEM_1, int ITEM_1_MUL, int REWARD_1, int ITEM_2, int REWARD_2, int ITEM_3, int REWARD_3, int ITEM_4, int REWARD_4)
private String shortSecondStepOneItem(QuestState qs, int npcId, int mul, int item1, int item1Mul, int reward1, int item2, int reward2, int item3, int reward3, int item4, int reward4)
{
final PlayerInstance player = qs.getPlayer();
switch (qs.getInt(PARAM_2))
{
case 42:
{
if (getQuestItemsCount(player, ITEM_1) >= (10 * mul * ITEM_1_MUL))
if (getQuestItemsCount(player, item1) >= (10 * mul * item1Mul))
{
takeItems(player, ITEM_1, 10 * mul * ITEM_1_MUL);
giveItems(player, REWARD_1, 1 * mul);
takeItems(player, item1, 10 * mul * item1Mul);
giveItems(player, reward1, 1 * mul);
playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
return npcId + "-07.html";
}
@@ -1459,10 +1460,10 @@ public class Q00336_CoinsOfMagic extends Quest
}
case 31:
{
if (getQuestItemsCount(player, ITEM_2) >= (5 * mul))
if (getQuestItemsCount(player, item2) >= (5 * mul))
{
takeItems(player, ITEM_2, 5 * mul);
giveItems(player, REWARD_2, 1 * mul);
takeItems(player, item2, 5 * mul);
giveItems(player, reward2, 1 * mul);
playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
return npcId + "-07.html";
}
@@ -1470,10 +1471,10 @@ public class Q00336_CoinsOfMagic extends Quest
}
case 21:
{
if (getQuestItemsCount(player, ITEM_3) >= (5 * mul))
if (getQuestItemsCount(player, item3) >= (5 * mul))
{
takeItems(player, ITEM_3, 5 * mul);
giveItems(player, REWARD_3, 1 * mul);
takeItems(player, item3, 5 * mul);
giveItems(player, reward3, 1 * mul);
playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
return npcId + "-07.html";
}
@@ -1481,10 +1482,10 @@ public class Q00336_CoinsOfMagic extends Quest
}
case 11:
{
if (getQuestItemsCount(player, ITEM_4) >= (5 * mul))
if (getQuestItemsCount(player, item4) >= (5 * mul))
{
takeItems(player, ITEM_4, 5 * mul);
giveItems(player, REWARD_4, 1 * mul);
takeItems(player, item4, 5 * mul);
giveItems(player, reward4, 1 * mul);
playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
return npcId + "-07.html";
}
@@ -1498,32 +1499,32 @@ public class Q00336_CoinsOfMagic extends Quest
* @param qs
* @param npcId
* @param mul
* @param ITEM_1_1
* @param ITEM_1_2
* @param REWARD_1
* @param ITEM_2_1
* @param ITEM_2_2
* @param REWARD_2
* @param ITEM_3_1
* @param ITEM_3_2
* @param REWARD_3
* @param ITEM_4_1
* @param ITEM_4_2
* @param REWARD_4
* @param item1a
* @param item1b
* @param reward1
* @param item2a
* @param item2b
* @param reward2
* @param item3a
* @param item3b
* @param reward3
* @param item4a
* @param item4b
* @param reward4
* @return
*/
private String shortSecondStepTwoItems(QuestState qs, int npcId, int mul, int ITEM_1_1, int ITEM_1_2, int REWARD_1, int ITEM_2_1, int ITEM_2_2, int REWARD_2, int ITEM_3_1, int ITEM_3_2, int REWARD_3, int ITEM_4_1, int ITEM_4_2, int REWARD_4)
private String shortSecondStepTwoItems(QuestState qs, int npcId, int mul, int item1a, int item1b, int reward1, int item2a, int item2b, int reward2, int item3a, int item3b, int reward3, int item4a, int item4b, int reward4)
{
final PlayerInstance player = qs.getPlayer();
switch (qs.getInt(PARAM_2))
{
case 42:
{
if ((getQuestItemsCount(player, ITEM_1_1) >= (10 * mul)) && (getQuestItemsCount(player, ITEM_1_2) >= (10 * mul)))
if ((getQuestItemsCount(player, item1a) >= (10 * mul)) && (getQuestItemsCount(player, item1b) >= (10 * mul)))
{
takeItems(player, ITEM_1_1, 10 * mul);
takeItems(player, ITEM_1_2, 10 * mul);
giveItems(player, REWARD_1, 1 * mul);
takeItems(player, item1a, 10 * mul);
takeItems(player, item1b, 10 * mul);
giveItems(player, reward1, 1 * mul);
playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
return npcId + "-07.html";
}
@@ -1531,11 +1532,11 @@ public class Q00336_CoinsOfMagic extends Quest
}
case 31:
{
if ((getQuestItemsCount(player, ITEM_2_1) >= (5 * mul)) && (getQuestItemsCount(player, ITEM_2_2) >= (5 * mul)))
if ((getQuestItemsCount(player, item2a) >= (5 * mul)) && (getQuestItemsCount(player, item2b) >= (5 * mul)))
{
takeItems(player, ITEM_2_1, 5 * mul);
takeItems(player, ITEM_2_2, 5 * mul);
giveItems(player, REWARD_2, 1 * mul);
takeItems(player, item2a, 5 * mul);
takeItems(player, item2b, 5 * mul);
giveItems(player, reward2, 1 * mul);
playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
return npcId + "-07.html";
}
@@ -1543,11 +1544,11 @@ public class Q00336_CoinsOfMagic extends Quest
}
case 21:
{
if ((getQuestItemsCount(player, ITEM_3_1) >= (5 * mul)) && (getQuestItemsCount(player, ITEM_3_2) >= (5 * mul)))
if ((getQuestItemsCount(player, item3a) >= (5 * mul)) && (getQuestItemsCount(player, item3b) >= (5 * mul)))
{
takeItems(player, ITEM_3_1, 5 * mul);
takeItems(player, ITEM_3_2, 5 * mul);
giveItems(player, REWARD_3, 1 * mul);
takeItems(player, item3a, 5 * mul);
takeItems(player, item3b, 5 * mul);
giveItems(player, reward3, 1 * mul);
playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
return npcId + "-07.html";
}
@@ -1555,11 +1556,11 @@ public class Q00336_CoinsOfMagic extends Quest
}
case 11:
{
if ((getQuestItemsCount(player, ITEM_4_1) >= (5 * mul)) && (getQuestItemsCount(player, ITEM_4_2) >= (5 * mul)))
if ((getQuestItemsCount(player, item4a) >= (5 * mul)) && (getQuestItemsCount(player, item4b) >= (5 * mul)))
{
takeItems(player, ITEM_4_1, 5 * mul);
takeItems(player, ITEM_4_2, 5 * mul);
giveItems(player, REWARD_4, 1 * mul);
takeItems(player, item4a, 5 * mul);
takeItems(player, item4b, 5 * mul);
giveItems(player, reward4, 1 * mul);
playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
return npcId + "-07.html";
}
@@ -1573,13 +1574,13 @@ public class Q00336_CoinsOfMagic extends Quest
* @param qs
* @param npcId
* @param flag
* @param ITEM_1
* @param ITEM_2
* @param ITEM_3
* @param ITEM_4
* @param item1
* @param item2
* @param item3
* @param item4
* @return
*/
private String shortThirdStep(QuestState qs, int npcId, int flag, int ITEM_1, int ITEM_2, int ITEM_3, int ITEM_4)
private String shortThirdStep(QuestState qs, int npcId, int flag, int item1, int item2, int item3, int item4)
{
final PlayerInstance player = qs.getPlayer();
qs.set(PARAM_3, 0);
@@ -1591,22 +1592,22 @@ public class Q00336_CoinsOfMagic extends Quest
{
case 42:
{
giveItems(player, ITEM_1, 1);
giveItems(player, item1, 1);
break;
}
case 31:
{
giveItems(player, ITEM_2, 1);
giveItems(player, item2, 1);
break;
}
case 21:
{
giveItems(player, ITEM_3, 1);
giveItems(player, item3, 1);
break;
}
case 11:
{
giveItems(player, ITEM_4, 1);
giveItems(player, item4, 1);
break;
}
}

View File

@@ -90,7 +90,7 @@ public class Q00454_CompletelyLost extends Quest
final PlayerInstance leader = npc.getVariables().getObject("leader", PlayerInstance.class);
if (leader != null)
{
double dist = Util.calculateDistance(npc, leader, false, false);
final double dist = Util.calculateDistance(npc, leader, false, false);
if (dist > 1000)
{
if (((dist > 5000) && (dist < 6900)) || ((dist > 31000) && (dist < 32000)))

View File

@@ -205,7 +205,7 @@ public class Q00457_LostAndFound extends Quest
public String onTalk(Npc npc, PlayerInstance player)
{
String htmltext = getNoQuestMsg(player);
QuestState qs = getQuestState(player, true);
final QuestState qs = getQuestState(player, true);
switch (qs.getState())
{

View File

@@ -307,10 +307,10 @@ public class Q00482_RecertificationOfValue extends Quest
final QuestState qs = getQuestState(killer, false);
if ((qs != null) && qs.isCond(1))
{
int npcId = npc.getId();
final int npcId = npc.getId();
String variable = String.valueOf(npcId); // i3
int currentValue = qs.getInt(variable);
final String variable = String.valueOf(npcId); // i3
final int currentValue = qs.getInt(variable);
if (currentValue < 10)
{
qs.set(variable, String.valueOf(currentValue + 1)); // IncreaseNPCLogByID

View File

@@ -134,7 +134,7 @@ public class Q00833_DevilsTreasureTauti extends Quest
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
Party party = killer.getParty();
final Party party = killer.getParty();
if (party != null)
{
party.getMembers().forEach(p -> onKill(npc, p));

View File

@@ -41,7 +41,7 @@ public class Q10274_CollectingInTheAir extends Quest
private static final int BLUE = 13859;
private static final int GREEN = 13860;
// Monsters
private static final int MOBS[] =
private static final int[] MOBS =
{
18684, // Red Star Stone
18685, // Red Star Stone

View File

@@ -183,8 +183,8 @@ public class Q10304_ForForgottenHeroes extends Quest
final QuestState qs = getQuestState(player, false);
if (qs != null)
{
int cond = qs.getCond();
int npcId = npc.getId();
final int cond = qs.getCond();
final int npcId = npc.getId();
if (player.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE))
{
if ((npcId == YUI) && (cond == 2))

View File

@@ -190,7 +190,7 @@ public class Q10339_FightingTheForgotten extends Quest
public Set<NpcLogListHolder> getNpcLogList(PlayerInstance player)
{
final QuestState qs = getQuestState(player, false);
if(qs != null)
if (qs != null)
{
final Set<NpcLogListHolder> npcLogList = new HashSet<>(1);
npcLogList.add(new NpcLogListHolder(NpcStringId.ELIMINATING_THE_ANCIENT_GHOSTS, qs.getMemoState()));

View File

@@ -120,7 +120,7 @@ public class Q10377_TheInvadedExecutionGrounds extends Quest
@Override
public String onFirstTalk(Npc npc, PlayerInstance player)
{
QuestState qs = getQuestState(player, false);
final QuestState qs = getQuestState(player, false);
if (qs != null)
{
switch (npc.getId())

View File

@@ -135,7 +135,7 @@ public class Q10462_TemperARustingBlade extends Quest
{
final PlayerInstance player = event.getPlayer();
final QuestState qs = getQuestState(player, false);
ItemInstance item = qs.getPlayer().getInventory().getItemByItemId(PRACTICE_WEAPON);
final ItemInstance item = qs.getPlayer().getInventory().getItemByItemId(PRACTICE_WEAPON);
if ((item != null) && qs.isCond(1) && item.isAugmented())
{
qs.setCond(2, true);

View File

@@ -183,6 +183,6 @@ public class Q10707_FlamesOfSorrow extends Quest
public String onFirstTalk(Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, false);
return(qs != null) && qs.isCond(1) ? "19545.html" : "19545-no.html";
return (qs != null) && qs.isCond(1) ? "19545.html" : "19545-no.html";
}
}

View File

@@ -549,7 +549,7 @@ public class Q10751_WindsOfFateEncounters extends Quest
final PlayerInstance player = event.getPlayer();
final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId()));

View File

@@ -572,7 +572,7 @@ public class Q10752_WindsOfFateAPromise extends Quest
final PlayerInstance player = event.getPlayer();
final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{
if (player.isMageClass())
{

View File

@@ -835,7 +835,7 @@ public class Q10753_WindsOfFateChoices extends Quest
final PlayerInstance player = event.getPlayer();
final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{
if (player.isMageClass())
{

View File

@@ -64,7 +64,7 @@ public class Q10755_LettersFromTheQueenWindyHill extends LetterQuest
return null;
}
String htmltext = event;
final String htmltext = event;
switch (event)
{
case "30037-02.html":

View File

@@ -64,7 +64,7 @@ public class Q10760_LettersFromTheQueenOrcBarracks extends LetterQuest
return null;
}
String htmltext = event;
final String htmltext = event;
switch (event)
{
case "30037-02.html":

View File

@@ -48,7 +48,7 @@ public class Q10790_AMercenaryHelper extends Quest
private static final int NEEDLE_STAKATO_WORKER = 21514;
private static final int NEEDLE_STAKATO_SOLDIER = 21515;
private static final int NEEDLE_STAKATO_DRONE = 21516;
private static final Map<Integer, Integer> MOBS_REQUIRED = new HashMap<>();
private static final Map<Integer, Integer> MOBS_REQUIRED = new HashMap<>();
static
{
MOBS_REQUIRED.put(SPLINTER_STAKATO, 50);

View File

@@ -55,7 +55,7 @@ public class Q10796_TheEyeThatDefiedTheGods extends Quest
{
return null;
}
String htmltext = event;
final String htmltext = event;
switch (event)
{
case "31616-02.htm":

View File

@@ -60,7 +60,7 @@ public class Q10797_CrossingFate extends Quest
{
return null;
}
String htmltext = event;
final String htmltext = event;
switch (event)
{
case "31683-02.htm":

View File

@@ -131,7 +131,7 @@ public class Q10801_TheDimensionalWarpPart1 extends Quest
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
Party party = killer.getParty();
final Party party = killer.getParty();
if (party != null)
{
party.getMembers().forEach(p -> onKill(npc, p));

View File

@@ -131,7 +131,7 @@ public class Q10802_TheDimensionalWarpPart2 extends Quest
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
Party party = killer.getParty();
final Party party = killer.getParty();
if (party != null)
{
party.getMembers().forEach(p -> onKill(npc, p));

View File

@@ -133,7 +133,7 @@ public class Q10803_TheDimensionalWarpPart3 extends Quest
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
Party party = killer.getParty();
final Party party = killer.getParty();
if (party != null)
{
party.getMembers().forEach(p -> onKill(npc, p));

View File

@@ -133,7 +133,7 @@ public class Q10804_TheDimensionalWarpPart4 extends Quest
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
Party party = killer.getParty();
final Party party = killer.getParty();
if (party != null)
{
party.getMembers().forEach(p -> onKill(npc, p));

View File

@@ -133,7 +133,7 @@ public class Q10805_TheDimensionalWarpPart5 extends Quest
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
Party party = killer.getParty();
final Party party = killer.getParty();
if (party != null)
{
party.getMembers().forEach(p -> onKill(npc, p));

View File

@@ -131,7 +131,7 @@ public class Q10806_TheDimensionalWarpPart6 extends Quest
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
Party party = killer.getParty();
final Party party = killer.getParty();
if (party != null)
{
party.getMembers().forEach(p -> onKill(npc, p));

View File

@@ -131,7 +131,7 @@ public class Q10807_TheDimensionalWarpPart7 extends Quest
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
Party party = killer.getParty();
final Party party = killer.getParty();
if (party != null)
{
party.getMembers().forEach(p -> onKill(npc, p));

View File

@@ -276,28 +276,25 @@ public abstract class AirShipController extends AbstractNpcAI
@Override
public String onEnterZone(Creature creature, ZoneType zone)
{
if (creature instanceof ControllableAirShipInstance)
if ((creature instanceof ControllableAirShipInstance) && (_dockedShip == null))
{
if (_dockedShip == null)
_dockedShip = (ControllableAirShipInstance) creature;
_dockedShip.setInDock(_dockZone);
_dockedShip.setOustLoc(_oustLoc);
// Ship is not empty - display movie to passengers and dock
if (!_dockedShip.isEmpty())
{
_dockedShip = (ControllableAirShipInstance) creature;
_dockedShip.setInDock(_dockZone);
_dockedShip.setOustLoc(_oustLoc);
if (_movie != null)
{
playMovie(_dockedShip.getPassengers(), _movie);
}
// Ship is not empty - display movie to passengers and dock
if (!_dockedShip.isEmpty())
{
if (_movie != null)
{
playMovie(_dockedShip.getPassengers(), _movie);
}
ThreadPool.schedule(_decayTask, 1000);
}
else
{
_departSchedule = ThreadPool.schedule(_departTask, DEPART_INTERVAL);
}
ThreadPool.schedule(_decayTask, 1000);
}
else
{
_departSchedule = ThreadPool.schedule(_departTask, DEPART_INTERVAL);
}
}
return null;
@@ -306,20 +303,17 @@ public abstract class AirShipController extends AbstractNpcAI
@Override
public String onExitZone(Creature creature, ZoneType zone)
{
if (creature instanceof ControllableAirShipInstance)
if ((creature instanceof ControllableAirShipInstance) && creature.equals(_dockedShip))
{
if (creature.equals(_dockedShip))
if (_departSchedule != null)
{
if (_departSchedule != null)
{
_departSchedule.cancel(false);
_departSchedule = null;
}
_dockedShip.setInDock(0);
_dockedShip = null;
_isBusy = false;
_departSchedule.cancel(false);
_departSchedule = null;
}
_dockedShip.setInDock(0);
_dockedShip = null;
_isBusy = false;
}
return null;
}
@@ -358,14 +352,11 @@ public abstract class AirShipController extends AbstractNpcAI
}
}
}
if (_arrivalPath == null)
else if (!ZoneManager.getInstance().getZoneById(_dockZone, ScriptZone.class).isInsideZone(_shipSpawnX, _shipSpawnY, _shipSpawnZ))
{
if (!ZoneManager.getInstance().getZoneById(_dockZone, ScriptZone.class).isInsideZone(_shipSpawnX, _shipSpawnY, _shipSpawnZ))
{
LOGGER.warning(getName() + ": Arrival path is null and spawn point not in zone " + _dockZone + ", controller disabled");
_isBusy = true;
return;
}
LOGGER.warning(getName() + ": Arrival path is null and spawn point not in zone " + _dockZone + ", controller disabled");
_isBusy = true;
return;
}
if (_departPath != null)