Minor code improvements.

This commit is contained in:
MobiusDev
2016-12-11 20:32:47 +00:00
parent 6a2ccc62e4
commit 70f0330eb0
182 changed files with 1006 additions and 1328 deletions

View File

@@ -247,7 +247,7 @@ public final class Alarm extends AbstractNpcAI
* @param memoState the memo state, if memo state is less than zero, only quest state is checked * @param memoState the memo state, if memo state is less than zero, only quest state is checked
* @return {@code true} if the player has the memo state, {@code false} otherwise * @return {@code true} if the player has the memo state, {@code false} otherwise
*/ */
private static final boolean verifyMemoState(L2PcInstance player, int questId, int memoState) private static boolean verifyMemoState(L2PcInstance player, int questId, int memoState)
{ {
QuestState qs = null; QuestState qs = null;
switch (questId) switch (questId)
@@ -272,7 +272,7 @@ public final class Alarm extends AbstractNpcAI
* @param questId the quest ID * @param questId the quest ID
* @param memoState the memo state * @param memoState the memo state
*/ */
private static final void setMemoState(L2PcInstance player, int questId, int memoState) private static void setMemoState(L2PcInstance player, int questId, int memoState)
{ {
QuestState qs = null; QuestState qs = null;
switch (questId) switch (questId)
@@ -301,7 +301,7 @@ public final class Alarm extends AbstractNpcAI
* @param slot the slot * @param slot the slot
* @return the memo state ex * @return the memo state ex
*/ */
private static final int getMemoStateEx(L2PcInstance player, int questId, int slot) private static int getMemoStateEx(L2PcInstance player, int questId, int slot)
{ {
QuestState qs = null; QuestState qs = null;
switch (questId) switch (questId)
@@ -327,7 +327,7 @@ public final class Alarm extends AbstractNpcAI
* @param slot the slot * @param slot the slot
* @param memoStateEx the memo state ex * @param memoStateEx the memo state ex
*/ */
private static final void setMemoStateEx(L2PcInstance player, int questId, int slot, int memoStateEx) private static void setMemoStateEx(L2PcInstance player, int questId, int slot, int memoStateEx)
{ {
QuestState qs = null; QuestState qs = null;
switch (questId) switch (questId)

View File

@@ -205,9 +205,7 @@ public final class DenOfEvil extends AbstractNpcAI
final Skill skill = SkillData.getInstance().getSkill(6149, 1); final Skill skill = SkillData.getInstance().getSkill(6149, 1);
skill.applyEffects(character, character); skill.applyEffects(character, character);
} }
else else if (character.doDie(null)) // mobs die
{
if (character.doDie(null)) // mobs die
{ {
if (character.isNpc()) if (character.isNpc())
{ {
@@ -220,7 +218,6 @@ public final class DenOfEvil extends AbstractNpcAI
} }
} }
} }
}
for (int i = SKILL_ID; i <= (SKILL_ID + 4); i = i + 2) for (int i = SKILL_ID; i <= (SKILL_ID + 4); i = i + 2)
{ {
_zone.removeSkill(i); _zone.removeSkill(i);

View File

@@ -32,17 +32,17 @@ import ai.AbstractNpcAI;
public final class LairOfAntharas extends AbstractNpcAI public final class LairOfAntharas extends AbstractNpcAI
{ {
// NPC // NPC
final private static int KNORIKS = 22857; private static final int KNORIKS = 22857;
final private static int DRAGON_KNIGHT = 22844; private static final int DRAGON_KNIGHT = 22844;
final private static int DRAGON_KNIGHT2 = 22845; private static final int DRAGON_KNIGHT2 = 22845;
final private static int ELITE_DRAGON_KNIGHT = 22846; private static final int ELITE_DRAGON_KNIGHT = 22846;
final private static int DRAGON_GUARD = 22852; private static final int DRAGON_GUARD = 22852;
final private static int DRAGON_MAGE = 22853; private static final int DRAGON_MAGE = 22853;
// Misc // Misc
final private static int KNIGHT_CHANCE = 30; private static final int KNIGHT_CHANCE = 30;
final private static int KNORIKS_CHANCE = 60; private static final int KNORIKS_CHANCE = 60;
final private static int KNORIKS_CHANCE2 = 50; private static final int KNORIKS_CHANCE2 = 50;
private LairOfAntharas() private LairOfAntharas()
{ {

View File

@@ -360,9 +360,7 @@ public final class Valakas extends AbstractNpcAI
callSkillAI(npc); 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); final L2Npc valakas = addSpawn(VALAKAS, -105200, -253104, -15264, 32768, false, 0);
GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas); GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas);
@@ -372,7 +370,6 @@ public final class Valakas extends AbstractNpcAI
{ {
ZONE.oustAllPlayers(); ZONE.oustAllPlayers();
} }
}
return super.onAdvEvent(event, npc, player); return super.onAdvEvent(event, npc, player);
} }

View File

@@ -198,9 +198,9 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
STORED_PROGRESS.put(3, 1); STORED_PROGRESS.put(3, 1);
STORED_PROGRESS.put(4, 1); STORED_PROGRESS.put(4, 1);
} }
private final static int PARTY_MEMBER_COUNT = 4; private static final int PARTY_MEMBER_COUNT = 4;
private final static int ENTRY_DELAY = 3; // minutes private static final int ENTRY_DELAY = 3; // minutes
private final static int TIME_ATTACK = 60; // minutes private static final int TIME_ATTACK = 60; // minutes
private FourSepulchers() private FourSepulchers()
{ {

View File

@@ -246,9 +246,7 @@ public final class Antharas extends AbstractNpcAI
} }
} }
} }
else else if (!hasQuestItems(player, STONE))
{
if (!hasQuestItems(player, STONE))
{ {
htmltext = "13001-03.html"; htmltext = "13001-03.html";
} }
@@ -261,7 +259,6 @@ public final class Antharas extends AbstractNpcAI
startQuestTimer("SPAWN_ANTHARAS", Config.ANTHARAS_WAIT_TIME * 60000, null, null); startQuestTimer("SPAWN_ANTHARAS", Config.ANTHARAS_WAIT_TIME * 60000, null, null);
} }
} }
}
return htmltext; return htmltext;
} }
case "teleportOut": case "teleportOut":

View File

@@ -29,7 +29,7 @@ import ai.AbstractNpcAI;
public final class MithrilMinesTeleporter extends AbstractNpcAI public final class MithrilMinesTeleporter extends AbstractNpcAI
{ {
// NPC // NPC
private final static int TELEPORT_CRYSTAL = 32652; private static final int TELEPORT_CRYSTAL = 32652;
// Location // Location
private static final Location[] LOCS = private static final Location[] LOCS =
{ {

View File

@@ -31,7 +31,7 @@ import quests.Q00240_ImTheOnlyOneYouCanTrust.Q00240_ImTheOnlyOneYouCanTrust;
public final class StakatoNestTeleporter extends AbstractNpcAI public final class StakatoNestTeleporter extends AbstractNpcAI
{ {
// Locations // Locations
private final static Location[] LOCS = private static final Location[] LOCS =
{ {
new Location(80456, -52322, -5640), new Location(80456, -52322, -5640),
new Location(88718, -46214, -4640), new Location(88718, -46214, -4640),
@@ -40,7 +40,7 @@ public final class StakatoNestTeleporter extends AbstractNpcAI
new Location(87682, -43291, -4128) new Location(87682, -43291, -4128)
}; };
// NPC // NPC
private final static int KINTAIJIN = 32640; private static final int KINTAIJIN = 32640;
private StakatoNestTeleporter() private StakatoNestTeleporter()
{ {

View File

@@ -67,14 +67,14 @@ public final class Raina extends AbstractNpcAI
// Items // Items
private static final int SUBCLASS_CERTIFICATE = 30433; private static final int SUBCLASS_CERTIFICATE = 30433;
private static final int CHAOS_POMANDER = 37375; private static final int CHAOS_POMANDER = 37375;
private final static int ABELIUS_POWER = 32264; private static final int ABELIUS_POWER = 32264;
private final static int SAPYROS_POWER = 32265; private static final int SAPYROS_POWER = 32265;
private final static int ASHAGEN_POWER = 32266; private static final int ASHAGEN_POWER = 32266;
private final static int CRANIGG_POWER = 32267; private static final int CRANIGG_POWER = 32267;
private final static int SOLTKREIG_POWER = 32268; private static final int SOLTKREIG_POWER = 32268;
private final static int NAVIAROPE_POWER = 32269; private static final int NAVIAROPE_POWER = 32269;
private final static int LEISTER_POWER = 32270; private static final int LEISTER_POWER = 32270;
private final static int LAKCIS_POWER = 32271; private static final int LAKCIS_POWER = 32271;
// Misc // Misc
private static final Set<PlayerClass> mainSubclassSet; private static final Set<PlayerClass> mainSubclassSet;
private static final Set<PlayerClass> neverSubclassed = EnumSet.of(PlayerClass.Overlord, PlayerClass.Warsmith); private static final Set<PlayerClass> neverSubclassed = EnumSet.of(PlayerClass.Overlord, PlayerClass.Warsmith);

View File

@@ -317,13 +317,10 @@ public final class QueenAnt extends AbstractNpcAI
curse = CommonSkill.RAID_CURSE.getSkill(); curse = CommonSkill.RAID_CURSE.getSkill();
} }
} }
else else if (!character.hasAbnormalType(CommonSkill.RAID_CURSE2.getSkill().getAbnormalType()) && (getRandom(4) == 0))
{
if (!character.hasAbnormalType(CommonSkill.RAID_CURSE2.getSkill().getAbnormalType()) && (getRandom(4) == 0))
{ {
curse = CommonSkill.RAID_CURSE2.getSkill(); curse = CommonSkill.RAID_CURSE2.getSkill();
} }
}
if (curse != null) if (curse != null)
{ {

View File

@@ -139,7 +139,7 @@ public final class CastleAmbassador extends AbstractNpcAI
} }
htmltext = getHtm(player.getHtmlPrefix(), htmltext); htmltext = getHtm(player.getHtmlPrefix(), htmltext);
htmltext = htmltext.replace("%castleName%", String.valueOf(fortresss.getCastleByAmbassador(npc.getId()).getName())); htmltext = htmltext.replace("%castleName%", fortresss.getCastleByAmbassador(npc.getId()).getName());
return htmltext; return htmltext;
} }

View File

@@ -1100,8 +1100,8 @@ public final class CastleChamberlain extends AbstractNpcAI
else else
{ {
final NpcHtmlMessage html = getHtmlPacket(player, npc, "chamberlain-25.html"); final NpcHtmlMessage html = getHtmlPacket(player, npc, "chamberlain-25.html");
html.replace("%owner_name%", String.valueOf(player.getName())); html.replace("%owner_name%", player.getName());
html.replace("%feud_name%", String.valueOf(String.valueOf(1001000 + castle.getResidenceId()))); html.replace("%feud_name%", String.valueOf(1001000 + castle.getResidenceId()));
player.sendPacket(html); player.sendPacket(html);
giveItems(player, CROWN, 1); giveItems(player, CROWN, 1);
} }

View File

@@ -169,9 +169,7 @@ public final class CastleTeleporter extends AbstractNpcAI
final Siege siege = npc.getCastle().getSiege(); final Siege siege = npc.getCastle().getSiege();
htmltext = (npc.isScriptValue(0)) ? (siege.isInProgress() && (siege.getControlTowerCount() == 0)) ? "CastleTeleporter-05.html" : "CastleTeleporter-04.html" : "CastleTeleporter-06.html"; htmltext = (npc.isScriptValue(0)) ? (siege.isInProgress() && (siege.getControlTowerCount() == 0)) ? "CastleTeleporter-05.html" : "CastleTeleporter-04.html" : "CastleTeleporter-06.html";
} }
else else if ((npc.getCastle().getOwnerId() == player.getClanId()) && (player.getClanId() != 0) && (player.getSiegeState() == 2)) // Deffender
{
if ((npc.getCastle().getOwnerId() == player.getClanId()) && (player.getClanId() != 0) && (player.getSiegeState() == 2)) // Deffender
{ {
htmltext = getHtmlName(npc) + ".html"; htmltext = getHtmlName(npc) + ".html";
} }
@@ -179,7 +177,6 @@ public final class CastleTeleporter extends AbstractNpcAI
{ {
htmltext = getHtmlName(npc) + "-no.html"; htmltext = getHtmlName(npc) + "-no.html";
} }
}
return htmltext; return htmltext;
} }

View File

@@ -490,10 +490,10 @@ public final class ClanHallManager extends AbstractNpcAI
{ {
if (func != null) if (func != null)
{ {
htmltext = htmltext.replaceAll("%" + name + "recovery%", String.valueOf((int) func.getTemplate().getValue()) + "%"); htmltext = htmltext.replaceAll("%" + name + "recovery%", (int) func.getTemplate().getValue() + "%");
htmltext = htmltext.replaceAll("%" + name + "price%", "<fstring p1=\"" + func.getTemplate().getCost().getCount() + "\" p2=\"" + func.getTemplate().getDurationAsDays() + "\">" + NpcStringId.FONT_COLOR_FFAABB_S1_FONT_ADENA_S2_DAY_S.getId() + "</fstring>"); htmltext = htmltext.replaceAll("%" + name + "price%", "<fstring p1=\"" + func.getTemplate().getCost().getCount() + "\" p2=\"" + func.getTemplate().getDurationAsDays() + "\">" + NpcStringId.FONT_COLOR_FFAABB_S1_FONT_ADENA_S2_DAY_S.getId() + "</fstring>");
htmltext = htmltext.replace("%" + name + "expire%", "Withdraw the fee for the next time at " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(func.getExpiration()))); htmltext = htmltext.replace("%" + name + "expire%", "Withdraw the fee for the next time at " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(func.getExpiration())));
htmltext = htmltext.replaceAll("%" + name + "deactive%", "[<a action=\"bypass -h Quest ClanHallManager manageFunctions removeFunction confirm " + func.getType().toString() + "\">Deactivate</a>]"); htmltext = htmltext.replaceAll("%" + name + "deactive%", "[<a action=\"bypass -h Quest ClanHallManager manageFunctions removeFunction confirm " + func.getType() + "\">Deactivate</a>]");
} }
else else
{ {

View File

@@ -73,12 +73,12 @@ public final class MentorGuide extends AbstractNpcAI implements IGameXmlReader
private static final int MENTEE_HEADPHONE = 34759; private static final int MENTEE_HEADPHONE = 34759;
private static final int DIPLOMA = 33805; private static final int DIPLOMA = 33805;
// Skills // Skills
private final static SkillHolder[] MENTEE_BUFFS = private static final SkillHolder[] MENTEE_BUFFS =
{ {
new SkillHolder(9233, 1), // Mentor's Guidance new SkillHolder(9233, 1), // Mentor's Guidance
}; };
// Skills // Skills
private final static SkillHolder[] MENTEE_BUFFS_WITHOUT_MENTOR_ONLINE = private static final SkillHolder[] MENTEE_BUFFS_WITHOUT_MENTOR_ONLINE =
{ {
new SkillHolder(9227, 1), // Mentor's Poem of Horn new SkillHolder(9227, 1), // Mentor's Poem of Horn
new SkillHolder(9228, 1), // Mentor's Poem of Drum new SkillHolder(9228, 1), // Mentor's Poem of Drum

View File

@@ -290,9 +290,7 @@ public final class Minigame extends AbstractNpcAI
startQuestTimer("end", 4000, room.getManager(), null); startQuestTimer("end", 4000, room.getManager(), null);
} }
} }
else else if (room.getAttemptNumber() == MAX_ATTEMPTS)
{
if (room.getAttemptNumber() == MAX_ATTEMPTS)
{ {
room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_VE_FAILED_ANY_FURTHER_ATTEMPTS_WOULD_BE_WASTEFUL); room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_VE_FAILED_ANY_FURTHER_ATTEMPTS_WOULD_BE_WASTEFUL);
room.burnThemAll(); room.burnThemAll();
@@ -311,7 +309,6 @@ public final class Minigame extends AbstractNpcAI
} }
} }
} }
}
/** /**
* Create and initialize a MinigameRoom<br> * Create and initialize a MinigameRoom<br>

View File

@@ -57,9 +57,7 @@ public final class MysteriousWizard extends AbstractNpcAI
{ {
htmltext = "33980.html"; htmltext = "33980.html";
} }
else else if (qs != null)
{
if (qs != null)
{ {
if (qs.isCond(6)) if (qs.isCond(6))
{ {
@@ -70,7 +68,6 @@ public final class MysteriousWizard extends AbstractNpcAI
htmltext = "33980-04.html"; htmltext = "33980-04.html";
} }
} }
}
return htmltext; return htmltext;
} }

View File

@@ -156,9 +156,7 @@ public final class OlyManager extends AbstractNpcAI implements IBypassHandler
{ {
player.sendPacket(SystemMessageId.UNABLE_TO_PROCESS_THIS_REQUEST_UNTIL_YOUR_INVENTORY_S_WEIGHT_AND_SLOT_COUNT_ARE_LESS_THAN_80_PERCENT_OF_CAPACITY); player.sendPacket(SystemMessageId.UNABLE_TO_PROCESS_THIS_REQUEST_UNTIL_YOUR_INVENTORY_S_WEIGHT_AND_SLOT_COUNT_ARE_LESS_THAN_80_PERCENT_OF_CAPACITY);
} }
else else if (event.equals("register1v1"))
{
if (event.equals("register1v1"))
{ {
OlympiadManager.getInstance().registerNoble(player, CompetitionType.NON_CLASSED); OlympiadManager.getInstance().registerNoble(player, CompetitionType.NON_CLASSED);
} }
@@ -166,7 +164,6 @@ public final class OlyManager extends AbstractNpcAI implements IBypassHandler
{ {
OlympiadManager.getInstance().registerNoble(player, CompetitionType.CLASSED); OlympiadManager.getInstance().registerNoble(player, CompetitionType.CLASSED);
} }
}
break; break;
} }
case "unregister": case "unregister":
@@ -340,9 +337,7 @@ public final class OlyManager extends AbstractNpcAI implements IBypassHandler
activeChar.sendPacket(new ExOlympiadMatchList()); activeChar.sendPacket(new ExOlympiadMatchList());
} }
else else if ((olymanager == null) || (olymanager.getId() != MANAGER) || (!activeChar.inObserverMode() && !activeChar.isInsideRadius(olymanager, 300, false, false)))
{
if ((olymanager == null) || (olymanager.getId() != MANAGER) || (!activeChar.inObserverMode() && !activeChar.isInsideRadius(olymanager, 300, false, false)))
{ {
return false; return false;
} }
@@ -377,7 +372,6 @@ public final class OlyManager extends AbstractNpcAI implements IBypassHandler
activeChar.enterOlympiadObserverMode(loc, arenaId); activeChar.enterOlympiadObserverMode(loc, arenaId);
} }
} }
}
return true; return true;
} }
catch (Exception e) catch (Exception e)

View File

@@ -94,15 +94,12 @@ public final class PrisonGuards extends AbstractNpcAI
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IT_S_NOT_EASY_TO_OBTAIN); npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IT_S_NOT_EASY_TO_OBTAIN);
} }
} }
else else if (!player.isAffectedBySkill(TIMER) && (npc.calculateDistance(npc.getSpawn().getLocation(), false, false) < 2000))
{
if (!player.isAffectedBySkill(TIMER) && (npc.calculateDistance(npc.getSpawn().getLocation(), false, false) < 2000))
{ {
npc.setTarget(player); npc.setTarget(player);
npc.doCast(STONE.getSkill()); npc.doCast(STONE.getSkill());
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE); npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE);
} }
}
return super.onAttack(npc, player, damage, isSummon); return super.onAttack(npc, player, damage, isSummon);
} }

View File

@@ -29,14 +29,14 @@ import ai.AbstractNpcAI;
public final class TeleportWithCharm extends AbstractNpcAI public final class TeleportWithCharm extends AbstractNpcAI
{ {
// NPCs // NPCs
private final static int WHIRPY = 30540; private static final int WHIRPY = 30540;
private final static int TAMIL = 30576; private static final int TAMIL = 30576;
// Items // Items
private final static int ORC_GATEKEEPER_CHARM = 1658; private static final int ORC_GATEKEEPER_CHARM = 1658;
private final static int DWARF_GATEKEEPER_TOKEN = 1659; private static final int DWARF_GATEKEEPER_TOKEN = 1659;
// Locations // Locations
private final static Location ORC_TELEPORT = new Location(-80826, 149775, -3043); private static final Location ORC_TELEPORT = new Location(-80826, 149775, -3043);
private final static Location DWARF_TELEPORT = new Location(-80826, 149775, -3043); private static final Location DWARF_TELEPORT = new Location(-80826, 149775, -3043);
private TeleportWithCharm() private TeleportWithCharm()
{ {

View File

@@ -46,8 +46,8 @@ public final class GateOfUnlimitedSummoning extends AbstractNpcAI
} }
// Skills // Skills
final static private int GATE_ROOT = 11289; private static final int GATE_ROOT = 11289;
final static private int GATE_VORTEX = 11291; private static final int GATE_VORTEX = 11291;
private GateOfUnlimitedSummoning() private GateOfUnlimitedSummoning()
{ {

View File

@@ -223,7 +223,7 @@ public final class Elpies extends Event
} }
} }
private static final void dropItem(L2Npc mob, L2PcInstance player, int[][] droplist) private static void dropItem(L2Npc mob, L2PcInstance player, int[][] droplist)
{ {
final int chance = getRandom(100); final int chance = getRandom(100);

View File

@@ -32,7 +32,7 @@ public final class CharacterBirthday extends AbstractNpcAI
private static final int ALEGRIA = 32600; private static final int ALEGRIA = 32600;
private static int SPAWNS = 0; private static int SPAWNS = 0;
private final static int[] GK = private static final int[] GK =
{ {
30006, 30006,
30059, 30059,

View File

@@ -130,14 +130,11 @@ public final class FreyaCelebration extends LongTimeEvent
caster.addItem("FreyaCelebration", FREYA_GIFT, 1, npc, true); caster.addItem("FreyaCelebration", FREYA_GIFT, 1, npc, true);
} }
else else if (getRandom(10) < 2)
{
if (getRandom(10) < 2)
{ {
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), FREYA_TEXT[getRandom(FREYA_TEXT.length - 1)])); npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), FREYA_TEXT[getRandom(FREYA_TEXT.length - 1)]));
} }
} }
}
return super.onSkillSee(npc, caster, skill, targets, isSummon); return super.onSkillSee(npc, caster, skill, targets, isSummon);
} }

View File

@@ -27,20 +27,20 @@ import com.l2jmobius.gameserver.model.quest.LongTimeEvent;
*/ */
public final class HeavyMedal extends LongTimeEvent public final class HeavyMedal extends LongTimeEvent
{ {
private final static int CAT_ROY = 31228; private static final int CAT_ROY = 31228;
private final static int CAT_WINNIE = 31229; private static final int CAT_WINNIE = 31229;
private final static int GLITTERING_MEDAL = 6393; private static final int GLITTERING_MEDAL = 6393;
private final static int WIN_CHANCE = 50; private static final int WIN_CHANCE = 50;
private final static int[] MEDALS = private static final int[] MEDALS =
{ {
5, 5,
10, 10,
20, 20,
40 40
}; };
private final static int[] BADGES = private static final int[] BADGES =
{ {
6399, 6399,
6400, 6400,
@@ -92,12 +92,12 @@ public final class HeavyMedal extends LongTimeEvent
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET); playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
level++; level++;
} }
htmltext = "31229-" + event.toLowerCase() + "-" + String.valueOf(level) + ".htm"; htmltext = "31229-" + event.toLowerCase() + "-" + level + ".htm";
} }
} }
else if (event.equalsIgnoreCase("talk")) else if (event.equalsIgnoreCase("talk"))
{ {
htmltext = String.valueOf(npc.getId()) + "-lvl-" + String.valueOf(level) + ".htm"; htmltext = npc.getId() + "-lvl-" + level + ".htm";
} }
return htmltext; return htmltext;
} }

View File

@@ -51,9 +51,7 @@ public class L2StaticObjectInstanceAction implements IActionHandler
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT // Notify the L2PcInstance AI with AI_INTENTION_INTERACT
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, staticObject); activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, staticObject);
} }
else else if (staticObject.getType() == 2)
{
if (staticObject.getType() == 2)
{ {
final String filename = (staticObject.getId() == 24230101) ? "data/html/signboards/tomb_of_crystalgolem.htm" : "data/html/signboards/pvp_signboard.htm"; final String filename = (staticObject.getId() == 24230101) ? "data/html/signboards/tomb_of_crystalgolem.htm" : "data/html/signboards/pvp_signboard.htm";
final String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename); final String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename);
@@ -75,7 +73,6 @@ public class L2StaticObjectInstanceAction implements IActionHandler
activeChar.sendPacket(staticObject.getMap()); activeChar.sendPacket(staticObject.getMap());
} }
} }
}
return true; return true;
} }

View File

@@ -39,7 +39,7 @@ import com.l2jmobius.gameserver.util.GMAudit;
public class AdminBuffs implements IAdminCommandHandler public class AdminBuffs implements IAdminCommandHandler
{ {
private final static int PAGE_LIMIT = 20; private static final int PAGE_LIMIT = 20;
private static final String[] ADMIN_COMMANDS = private static final String[] ADMIN_COMMANDS =
{ {
@@ -381,7 +381,7 @@ public class AdminBuffs implements IAdminCommandHandler
String slots = ""; String slots = "";
for (AbnormalType slot : target.getEffectList().getBlockedAbnormalTypes()) for (AbnormalType slot : target.getEffectList().getBlockedAbnormalTypes())
{ {
slots += slot.toString() + ", "; slots += slot + ", ";
} }
if (!slots.isEmpty() && (slots.length() > 3)) if (!slots.isEmpty() && (slots.length() > 3))
@@ -395,7 +395,7 @@ public class AdminBuffs implements IAdminCommandHandler
if (Config.GMAUDIT) if (Config.GMAUDIT)
{ {
GMAudit.auditGMAction(activeChar.getName() + " [" + activeChar.getObjectId() + "]", "getbuffs", target.getName() + " (" + Integer.toString(target.getObjectId()) + ")", ""); GMAudit.auditGMAction(activeChar.getName() + " [" + activeChar.getObjectId() + "]", "getbuffs", target.getName() + " (" + target.getObjectId() + ")", "");
} }
} }

View File

@@ -620,10 +620,7 @@ public class AdminEditChar implements IAdminCommandHandler
ps.setString(1, playerName); ps.setString(1, playerName);
ps.execute(); ps.execute();
} }
else else if (changeCreateExpiryTime) // removing penalty
{
// removing penalty
if (changeCreateExpiryTime)
{ {
player.setClanCreateExpiryTime(0); player.setClanCreateExpiryTime(0);
} }
@@ -631,7 +628,6 @@ public class AdminEditChar implements IAdminCommandHandler
{ {
player.setClanJoinExpiryTime(0); player.setClanJoinExpiryTime(0);
} }
}
activeChar.sendMessage("Clan penalty successfully removed to character: " + playerName); activeChar.sendMessage("Clan penalty successfully removed to character: " + playerName);
} }
@@ -1161,8 +1157,8 @@ public class AdminEditChar implements IAdminCommandHandler
adminReply.replace("%account%", player.getAccountName()); adminReply.replace("%account%", player.getAccountName());
adminReply.replace("%ip%", ip); adminReply.replace("%ip%", ip);
adminReply.replace("%hwid%", (player.getClient() != null) && (player.getClient().getHardwareInfo() != null) ? player.getClient().getHardwareInfo().getMacAddress() : "Unknown"); adminReply.replace("%hwid%", (player.getClient() != null) && (player.getClient().getHardwareInfo() != null) ? player.getClient().getHardwareInfo().getMacAddress() : "Unknown");
adminReply.replace("%ai%", String.valueOf(player.getAI().getIntention().name())); adminReply.replace("%ai%", player.getAI().getIntention().name());
adminReply.replace("%inst%", player.isInInstance() ? "<tr><td>InstanceId:</td><td><a action=\"bypass -h admin_instance_spawns " + String.valueOf(player.getInstanceId()) + "\">" + String.valueOf(player.getInstanceId()) + "</a></td></tr>" : ""); adminReply.replace("%inst%", player.isInInstance() ? "<tr><td>InstanceId:</td><td><a action=\"bypass -h admin_instance_spawns " + player.getInstanceId() + "\">" + player.getInstanceId() + "</a></td></tr>" : "");
adminReply.replace("%noblesse%", player.isNoble() ? "Yes" : "No"); adminReply.replace("%noblesse%", player.isNoble() ? "Yes" : "No");
activeChar.sendPacket(adminReply); activeChar.sendPacket(adminReply);
} }
@@ -1292,13 +1288,10 @@ public class AdminEditChar implements IAdminCommandHandler
{ {
findDisconnected = true; findDisconnected = true;
} }
else else if (!IpAdress.matches("^(?:(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2(?:[0-4][0-9]|5[0-5]))\\.){3}(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2(?:[0-4][0-9]|5[0-5]))$"))
{
if (!IpAdress.matches("^(?:(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2(?:[0-4][0-9]|5[0-5]))\\.){3}(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2(?:[0-4][0-9]|5[0-5]))$"))
{ {
throw new IllegalArgumentException("Malformed IPv4 number"); throw new IllegalArgumentException("Malformed IPv4 number");
} }
}
int CharactersFound = 0; int CharactersFound = 0;
L2GameClient client; L2GameClient client;
@@ -1365,7 +1358,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else if (CharactersFound > 20) else if (CharactersFound > 20)
{ {
adminReply.replace("%number%", " more than " + String.valueOf(CharactersFound)); adminReply.replace("%number%", " more than " + CharactersFound);
replyMSG2 = "s.<br>In order to avoid you a client crash I won't <br1>display results beyond the 20th character."; replyMSG2 = "s.<br>In order to avoid you a client crash I won't <br1>display results beyond the 20th character.";
} }
else if (CharactersFound == 1) else if (CharactersFound == 1)
@@ -1605,7 +1598,7 @@ public class AdminEditChar implements IAdminCommandHandler
final String owner = target.getActingPlayer().getName(); final String owner = target.getActingPlayer().getName();
html.replace("%owner%", " <a action=\"bypass -h admin_character_info " + owner + "\">" + owner + "</a>"); html.replace("%owner%", " <a action=\"bypass -h admin_character_info " + owner + "\">" + owner + "</a>");
html.replace("%class%", target.getClass().getSimpleName()); html.replace("%class%", target.getClass().getSimpleName());
html.replace("%ai%", target.hasAI() ? String.valueOf(target.getAI().getIntention().name()) : "NULL"); html.replace("%ai%", target.hasAI() ? target.getAI().getIntention().name() : "NULL");
html.replace("%hp%", (int) target.getStatus().getCurrentHp() + "/" + target.getStat().getMaxHp()); html.replace("%hp%", (int) target.getStatus().getCurrentHp() + "/" + target.getStat().getMaxHp());
html.replace("%mp%", (int) target.getStatus().getCurrentMp() + "/" + target.getStat().getMaxMp()); html.replace("%mp%", (int) target.getStatus().getCurrentMp() + "/" + target.getStat().getMaxMp());
html.replace("%karma%", Integer.toString(target.getReputation())); html.replace("%karma%", Integer.toString(target.getReputation()));
@@ -1649,7 +1642,7 @@ public class AdminEditChar implements IAdminCommandHandler
text.append("<tr><td><table width=270 border=0 cellpadding=2><tr><td width=30 align=right>"); text.append("<tr><td><table width=270 border=0 cellpadding=2><tr><td width=30 align=right>");
} }
text.append(member.getLevel() + "</td><td width=130><a action=\"bypass -h admin_character_info " + member.getName() + "\">" + member.getName() + "</a>"); text.append(member.getLevel() + "</td><td width=130><a action=\"bypass -h admin_character_info " + member.getName() + "\">" + member.getName() + "</a>");
text.append("</td><td width=110 align=right>" + member.getClassId().toString() + "</td></tr></table></td></tr>"); text.append("</td><td width=110 align=right>" + member.getClassId() + "</td></tr></table></td></tr>");
color = !color; color = !color;
} }
html.replace("%player%", target.getName()); html.replace("%player%", target.getName());

View File

@@ -381,13 +381,10 @@ public class AdminEventEngine implements IAdminCommandHandler
} }
} }
} }
else else if ((activeChar.getTarget() != null) && (activeChar.getTarget() instanceof L2PcInstance))
{
if ((activeChar.getTarget() != null) && (activeChar.getTarget() instanceof L2PcInstance))
{ {
L2Event.removeAndResetPlayer((L2PcInstance) activeChar.getTarget()); L2Event.removeAndResetPlayer((L2PcInstance) activeChar.getTarget());
} }
}
showEventControl(activeChar); showEventControl(activeChar);
} }
else if (actualCommand.startsWith("admin_event_control_prize")) else if (actualCommand.startsWith("admin_event_control_prize"))
@@ -464,7 +461,7 @@ public class AdminEventEngine implements IAdminCommandHandler
result.append("</table>"); result.append("</table>");
return note + result.toString(); return note + result;
} }
public void showMainPage(L2PcInstance activeChar) public void showMainPage(L2PcInstance activeChar)

View File

@@ -82,9 +82,7 @@ public class AdminFortSiege implements IAdminCommandHandler
{ {
activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET); activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
} }
else else if (fort.getSiege().addAttacker(player, false) == 4)
{
if (fort.getSiege().addAttacker(player, false) == 4)
{ {
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_CLAN_HAS_BEEN_REGISTERED_TO_S1_S_FORTRESS_BATTLE); final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_CLAN_HAS_BEEN_REGISTERED_TO_S1_S_FORTRESS_BATTLE);
sm.addCastleId(fort.getResidenceId()); sm.addCastleId(fort.getResidenceId());
@@ -95,7 +93,6 @@ public class AdminFortSiege implements IAdminCommandHandler
player.sendMessage("During registering error occurred!"); player.sendMessage("During registering error occurred!");
} }
} }
}
else if (command.equalsIgnoreCase("admin_clear_fortsiege_list")) else if (command.equalsIgnoreCase("admin_clear_fortsiege_list"))
{ {
fort.getSiege().clearSiegeClan(); fort.getSiege().clearSiegeClan();

View File

@@ -454,7 +454,7 @@ public final class AdminPForge implements IAdminCommandHandler
target = activeChar.getTarget(); target = activeChar.getTarget();
if ((target != null) && (target instanceof L2Character)) if ((target != null) && (target instanceof L2Character))
{ {
value = String.valueOf(((L2Character) target).getTitle()); value = ((L2Character) target).getTitle();
} }
else else
{ {
@@ -465,7 +465,7 @@ public final class AdminPForge implements IAdminCommandHandler
target = activeChar.getTarget(); target = activeChar.getTarget();
if (target != null) if (target != null)
{ {
value = String.valueOf(target.getName()); value = target.getName();
} }
else else
{ {

View File

@@ -119,14 +119,14 @@ public class AdminPremium implements IAdminCommandHandler
// TODO: Add check if account exists XD // TODO: Add check if account exists XD
PremiumManager.getInstance().updatePremiumData(months, accountName); PremiumManager.getInstance().updatePremiumData(months, accountName);
admin.sendMessage("Account " + accountName + " will now have premium status until " + String.valueOf(new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumEndDate(accountName))) + "."); admin.sendMessage("Account " + accountName + " will now have premium status until " + new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumEndDate(accountName)) + ".");
} }
private void viewPremiumInfo(L2PcInstance admin, String accountName) private void viewPremiumInfo(L2PcInstance admin, String accountName)
{ {
if (PremiumManager.getInstance().getPremiumEndDate(accountName) > 0) if (PremiumManager.getInstance().getPremiumEndDate(accountName) > 0)
{ {
admin.sendMessage("Account " + accountName + " has premium status until " + String.valueOf(new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumEndDate(accountName))) + "."); admin.sendMessage("Account " + accountName + " has premium status until " + new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumEndDate(accountName)) + ".");
} }
else else
{ {

View File

@@ -385,7 +385,7 @@ public class AdminPunishment implements IAdminCommandHandler
return true; return true;
} }
private static final String findCharId(String key) private static String findCharId(String key)
{ {
final int charId = CharNameTable.getInstance().getIdByName(key); final int charId = CharNameTable.getInstance().getIdByName(key);
if (charId > 0) // Yeah its a char name! if (charId > 0) // Yeah its a char name!

View File

@@ -90,7 +90,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{ {
val[0] = "full"; val[0] = "full";
} }
if (cmdParams[2].indexOf("_") != -1) if (cmdParams[2].contains("_"))
{ {
val[0] = "name"; val[0] = "name";
val[1] = cmdParams[2]; val[1] = cmdParams[2];

View File

@@ -324,9 +324,7 @@ public class AdminSpawn implements IAdminCommandHandler
} }
} }
} }
else else if (showposition && (npc != null))
{
if (showposition && (npc != null))
{ {
activeChar.sendMessage(index + " - " + spawn.getTemplate().getName() + " (" + spawn + "): " + npc.getX() + " " + npc.getY() + " " + npc.getZ()); activeChar.sendMessage(index + " - " + spawn.getTemplate().getName() + " (" + spawn + "): " + npc.getX() + " " + npc.getY() + " " + npc.getZ());
} }
@@ -335,7 +333,6 @@ public class AdminSpawn implements IAdminCommandHandler
activeChar.sendMessage(index + " - " + spawn.getTemplate().getName() + " (" + spawn + "): " + spawn.getX() + " " + spawn.getY() + " " + spawn.getZ()); activeChar.sendMessage(index + " - " + spawn.getTemplate().getName() + " (" + spawn + "): " + spawn.getX() + " " + spawn.getY() + " " + spawn.getZ());
} }
} }
}
if (index == 0) if (index == 0)
{ {

View File

@@ -154,7 +154,7 @@ public class Observation implements IBypassHandler
return false; return false;
} }
private static final void doObserve(L2PcInstance player, L2Npc npc, Location pos, long cost) private static void doObserve(L2PcInstance player, L2Npc npc, Location pos, long cost)
{ {
if (player.reduceAdena("Broadcast", cost, npc, true)) if (player.reduceAdena("Broadcast", cost, npc, true))
{ {

View File

@@ -42,7 +42,7 @@ public class PlayerHelp implements IBypassHandler
} }
final String path = command.substring(12); final String path = command.substring(12);
if (path.indexOf("..") != -1) if (path.contains(".."))
{ {
return false; return false;
} }

View File

@@ -73,7 +73,7 @@ public class PrivateWarehouse implements IBypassHandler
return false; return false;
} }
private static final void showWithdrawWindow(L2PcInstance player) private static void showWithdrawWindow(L2PcInstance player)
{ {
player.sendPacket(ActionFailed.STATIC_PACKET); player.sendPacket(ActionFailed.STATIC_PACKET);
player.setActiveWarehouse(player.getWarehouse()); player.setActiveWarehouse(player.getWarehouse());

View File

@@ -68,7 +68,7 @@ public class Wear implements IBypassHandler
return false; return false;
} }
private static final void showWearWindow(L2PcInstance player, int val) private static void showWearWindow(L2PcInstance player, int val)
{ {
final L2BuyList buyList = BuyListData.getInstance().getBuyList(val); final L2BuyList buyList = BuyListData.getInstance().getBuyList(val);
if (buyList == null) if (buyList == null)

View File

@@ -69,7 +69,7 @@ public class FavoriteBoard implements IParseBoardHandler
{ {
while (rs.next()) while (rs.next())
{ {
String link = list.replaceAll("%fav_bypass%", String.valueOf(rs.getString("favBypass"))); String link = list.replaceAll("%fav_bypass%", rs.getString("favBypass"));
link = link.replaceAll("%fav_title%", rs.getString("favTitle")); link = link.replaceAll("%fav_title%", rs.getString("favTitle"));
final SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); final SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
link = link.replaceAll("%fav_add_date%", date.format(rs.getTimestamp("favAddDate"))); link = link.replaceAll("%fav_add_date%", date.format(rs.getTimestamp("favAddDate")));

View File

@@ -64,7 +64,7 @@ public class RegionBoard implements IWriteBoardHandler
link = link.replace("%region_name%", String.valueOf(REGIONS[i])); link = link.replace("%region_name%", String.valueOf(REGIONS[i]));
link = link.replace("%region_owning_clan%", (clan != null ? clan.getName() : "NPC")); link = link.replace("%region_owning_clan%", (clan != null ? clan.getName() : "NPC"));
link = link.replace("%region_owning_clan_alliance%", ((clan != null) && (clan.getAllyName() != null) ? clan.getAllyName() : "")); link = link.replace("%region_owning_clan_alliance%", ((clan != null) && (clan.getAllyName() != null) ? clan.getAllyName() : ""));
link = link.replace("%region_tax_rate%", String.valueOf(castle.getTaxRate() * 100) + "%"); link = link.replace("%region_tax_rate%", (castle.getTaxRate() * 100) + "%");
sb.append(link); sb.append(link);
} }

View File

@@ -37,7 +37,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ability.ExAcquireAPSkillLi
public class ClassChange extends AbstractEffect public class ClassChange extends AbstractEffect
{ {
private final int _index; private final int _index;
private final static int IDENTITY_CRISIS_SKILL_ID = 1570; private static final int IDENTITY_CRISIS_SKILL_ID = 1570;
public ClassChange(StatsSet params) public ClassChange(StatsSet params)
{ {

View File

@@ -69,7 +69,8 @@ public class CreateItemRandom extends AbstractEffect
double comulativeChance = 0; double comulativeChance = 0;
for (ItemChanceHolder holder : item.getItem().getCreateItems()) for (ItemChanceHolder holder : item.getItem().getCreateItems())
{ {
if ((comulativeChance += holder.getChance()) >= random) comulativeChance += holder.getChance();
if (comulativeChance >= random)
{ {
selectedItem = holder; selectedItem = holder;
break; break;

View File

@@ -131,9 +131,7 @@ public final class Heal extends AbstractEffect
{ {
effected.sendPacket(SystemMessageId.REJUVENATING_HP); effected.sendPacket(SystemMessageId.REJUVENATING_HP);
} }
else else if (effector.isPlayer() && (effector != effected))
{
if (effector.isPlayer() && (effector != effected))
{ {
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_HAS_BEEN_RESTORED_BY_C1); final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_HAS_BEEN_RESTORED_BY_C1);
sm.addString(effector.getName()); sm.addString(effector.getName());
@@ -149,4 +147,3 @@ public final class Heal extends AbstractEffect
} }
} }
} }
}

View File

@@ -33,8 +33,8 @@ import com.l2jmobius.gameserver.model.stats.Stats;
*/ */
public class TwoHandedBluntBonus extends AbstractEffect public class TwoHandedBluntBonus extends AbstractEffect
{ {
private final static Condition _weaponTypeCondition = new ConditionUsingItemType(WeaponType.BLUNT.mask()); private static final Condition _weaponTypeCondition = new ConditionUsingItemType(WeaponType.BLUNT.mask());
private final static Condition _slotCondition = new ConditionUsingSlotType(L2Item.SLOT_LR_HAND); private static final Condition _slotCondition = new ConditionUsingSlotType(L2Item.SLOT_LR_HAND);
protected final double _pAtkAmount; protected final double _pAtkAmount;
protected final StatModifierType _pAtkmode; protected final StatModifierType _pAtkmode;

View File

@@ -33,8 +33,8 @@ import com.l2jmobius.gameserver.model.stats.Stats;
*/ */
public class TwoHandedSwordBonus extends AbstractEffect public class TwoHandedSwordBonus extends AbstractEffect
{ {
private final static Condition _weaponTypeCondition = new ConditionUsingItemType(WeaponType.SWORD.mask()); private static final Condition _weaponTypeCondition = new ConditionUsingItemType(WeaponType.SWORD.mask());
private final static Condition _slotCondition = new ConditionUsingSlotType(L2Item.SLOT_LR_HAND); private static final Condition _slotCondition = new ConditionUsingSlotType(L2Item.SLOT_LR_HAND);
protected final double _pAtkAmount; protected final double _pAtkAmount;
protected final StatModifierType _pAtkmode; protected final StatModifierType _pAtkmode;

View File

@@ -91,9 +91,7 @@ public class FatedSupportBox implements IItemHandler
{ {
player.addItem(getClass().getSimpleName(), FATED_BOX_WIZARD, 1, player, true); player.addItem(getClass().getSimpleName(), FATED_BOX_WIZARD, 1, player, true);
} }
else else if (CategoryData.getInstance().isInCategory(CategoryType.SUB_GROUP_ROGUE, classId.getId()))
{
if (CategoryData.getInstance().isInCategory(CategoryType.SUB_GROUP_ROGUE, classId.getId()))
{ {
player.addItem(getClass().getSimpleName(), FATED_BOX_ROGUE, 1, player, true); player.addItem(getClass().getSimpleName(), FATED_BOX_ROGUE, 1, player, true);
} }
@@ -105,7 +103,6 @@ public class FatedSupportBox implements IItemHandler
{ {
player.addItem(getClass().getSimpleName(), FATED_BOX_WARRIOR, 1, player, true); player.addItem(getClass().getSimpleName(), FATED_BOX_WARRIOR, 1, player, true);
} }
}
break; break;
} }
case ORC: case ORC:

View File

@@ -252,7 +252,7 @@ public class Debug implements ITelnetCommand
final StackTraceElement[] stes = entry.getValue(); final StackTraceElement[] stes = entry.getValue();
final Thread t = entry.getKey(); final Thread t = entry.getKey();
sb.append("--------------\r\n"); sb.append("--------------\r\n");
sb.append(t.toString() + " (" + t.getId() + ")\r\n"); sb.append(t + " (" + t.getId() + ")\r\n");
sb.append("State: " + t.getState() + "\r\n"); sb.append("State: " + t.getState() + "\r\n");
sb.append("isAlive: " + t.isAlive() + " | isDaemon: " + t.isDaemon() + " | isInterrupted: " + t.isInterrupted() + "\r\n"); sb.append("isAlive: " + t.isAlive() + " | isDaemon: " + t.isDaemon() + " | isInterrupted: " + t.isInterrupted() + "\r\n");
sb.append("\r\n"); sb.append("\r\n");

View File

@@ -136,7 +136,7 @@ public class ThreadPoolDebug implements ITelnetCommand
return sb.toString(); return sb.toString();
} }
private static final <T> T getObject(Class<?> sourceClass, Object sourceInstance, String fieldName, Class<T> targetClass) private static <T> T getObject(Class<?> sourceClass, Object sourceInstance, String fieldName, Class<T> targetClass)
{ {
try try
{ {

View File

@@ -784,15 +784,12 @@ public final class IceQueensCastleBattle extends AbstractInstance
npc.doCast(ICE_BALL.getSkill()); npc.doCast(ICE_BALL.getSkill());
} }
} }
else else if (canReachMostHated && SkillCaster.checkUseConditions(npc, ICE_BALL.getSkill()))
{
if (canReachMostHated && SkillCaster.checkUseConditions(npc, ICE_BALL.getSkill()))
{ {
npc.setTarget(mostHated); npc.setTarget(mostHated);
npc.doCast(ICE_BALL.getSkill()); npc.doCast(ICE_BALL.getSkill());
} }
} }
}
else if (getRandom(10000) < 800) else if (getRandom(10000) < 800)
{ {
if (getRandomBoolean()) if (getRandomBoolean())
@@ -803,15 +800,12 @@ public final class IceQueensCastleBattle extends AbstractInstance
npc.doCast(SUMMON_ELEMENTAL.getSkill()); npc.doCast(SUMMON_ELEMENTAL.getSkill());
} }
} }
else else if (canReachMostHated && SkillCaster.checkUseConditions(npc, SUMMON_ELEMENTAL.getSkill()))
{
if (canReachMostHated && SkillCaster.checkUseConditions(npc, SUMMON_ELEMENTAL.getSkill()))
{ {
npc.setTarget(mostHated); npc.setTarget(mostHated);
npc.doCast(SUMMON_ELEMENTAL.getSkill()); npc.doCast(SUMMON_ELEMENTAL.getSkill());
} }
} }
}
else if (getRandom(10000) < 1500) else if (getRandom(10000) < 1500)
{ {
if (!npc.isAffectedBySkill(SELF_NOVA.getSkillId()) && SkillCaster.checkUseConditions(npc, SELF_NOVA.getSkill())) if (!npc.isAffectedBySkill(SELF_NOVA.getSkillId()) && SkillCaster.checkUseConditions(npc, SELF_NOVA.getSkill()))
@@ -871,15 +865,12 @@ public final class IceQueensCastleBattle extends AbstractInstance
npc.doCast(ICE_BALL.getSkill()); npc.doCast(ICE_BALL.getSkill());
} }
} }
else else if (canReachMostHated && SkillCaster.checkUseConditions(npc, ICE_BALL.getSkill()))
{
if (canReachMostHated && SkillCaster.checkUseConditions(npc, ICE_BALL.getSkill()))
{ {
npc.setTarget(mostHated); npc.setTarget(mostHated);
npc.doCast(ICE_BALL.getSkill()); npc.doCast(ICE_BALL.getSkill());
} }
} }
}
else if (getRandom(10000) < 1333) else if (getRandom(10000) < 1333)
{ {
if (getRandomBoolean()) if (getRandomBoolean())
@@ -890,15 +881,12 @@ public final class IceQueensCastleBattle extends AbstractInstance
npc.doCast(SUMMON_ELEMENTAL.getSkill()); npc.doCast(SUMMON_ELEMENTAL.getSkill());
} }
} }
else else if (canReachMostHated && SkillCaster.checkUseConditions(npc, SUMMON_ELEMENTAL.getSkill()))
{
if (canReachMostHated && SkillCaster.checkUseConditions(npc, SUMMON_ELEMENTAL.getSkill()))
{ {
npc.setTarget(mostHated); npc.setTarget(mostHated);
npc.doCast(SUMMON_ELEMENTAL.getSkill()); npc.doCast(SUMMON_ELEMENTAL.getSkill());
} }
} }
}
else if (getRandom(10000) < 1500) else if (getRandom(10000) < 1500)
{ {
if (!npc.isAffectedBySkill(SELF_NOVA.getSkillId()) && SkillCaster.checkUseConditions(npc, SELF_NOVA.getSkill())) if (!npc.isAffectedBySkill(SELF_NOVA.getSkillId()) && SkillCaster.checkUseConditions(npc, SELF_NOVA.getSkill()))

View File

@@ -140,9 +140,7 @@ public final class IstinaCavern extends AbstractInstance
} }
} }
} }
else else if (event.equals("enterInstanceCommon"))
{
if (event.equals("enterInstanceCommon"))
{ {
enterInstance(player, npc, TEMPLATE_ID_COMMON); enterInstance(player, npc, TEMPLATE_ID_COMMON);
} }
@@ -150,7 +148,6 @@ public final class IstinaCavern extends AbstractInstance
{ {
enterInstance(player, npc, TEMPLATE_ID_EXTREME); enterInstance(player, npc, TEMPLATE_ID_EXTREME);
} }
}
return htmltext; return htmltext;
} }

View File

@@ -584,9 +584,7 @@ public final class KartiasLabyrinth extends AbstractInstance
npc.deleteMe(); npc.deleteMe();
} }
} }
else // Mini bosses else if (npc.isScriptValue(1))
{
if (npc.isScriptValue(1))
{ {
npc.setScriptValue(2); npc.setScriptValue(2);
addMoveToDesire(npc, instance.getTemplateParameters().getLocation("bossEscapeLoc2"), 23); addMoveToDesire(npc, instance.getTemplateParameters().getLocation("bossEscapeLoc2"), 23);
@@ -599,7 +597,6 @@ public final class KartiasLabyrinth extends AbstractInstance
npc.deleteMe(); npc.deleteMe();
} }
} }
}
super.onMoveFinished(npc); super.onMoveFinished(npc);
} }

View File

@@ -406,7 +406,7 @@ public final class LastImperialTomb extends AbstractInstance
case "FRINTEZZA_INTRO_19": case "FRINTEZZA_INTRO_19":
{ {
final Instance world = player.getInstanceWorld(); final Instance world = player.getInstanceWorld();
Map<L2Npc, Integer> portraits = new HashMap<>(); final Map<L2Npc, Integer> portraits = new HashMap<>();
for (int i = 0; i < PORTRAIT_SPAWNS.length; i++) for (int i = 0; i < PORTRAIT_SPAWNS.length; i++)
{ {
final L2Npc portrait = addSpawn(PORTRAIT_SPAWNS[i][0], PORTRAIT_SPAWNS[i][1], PORTRAIT_SPAWNS[i][2], PORTRAIT_SPAWNS[i][3], PORTRAIT_SPAWNS[i][4], false, 0, false, world.getId()); final L2Npc portrait = addSpawn(PORTRAIT_SPAWNS[i][0], PORTRAIT_SPAWNS[i][1], PORTRAIT_SPAWNS[i][2], PORTRAIT_SPAWNS[i][3], PORTRAIT_SPAWNS[i][4], false, 0, false, world.getId());

View File

@@ -219,13 +219,10 @@ public final class Q00016_TheComingDarkness extends Quest
{ {
htmltext = "31512-01.html"; htmltext = "31512-01.html";
} }
else else if (qs.isMemoState(1))
{
if (qs.isMemoState(1))
{ {
htmltext = "31512-04.html"; htmltext = "31512-04.html";
} }
}
break; break;
} }
case EVIL_ALTAR_2: case EVIL_ALTAR_2:
@@ -234,13 +231,10 @@ public final class Q00016_TheComingDarkness extends Quest
{ {
htmltext = "31513-01.html"; htmltext = "31513-01.html";
} }
else else if (qs.isMemoState(2))
{
if (qs.isMemoState(2))
{ {
htmltext = "31513-04.html"; htmltext = "31513-04.html";
} }
}
break; break;
} }
case EVIL_ALTAR_3: case EVIL_ALTAR_3:
@@ -249,13 +243,10 @@ public final class Q00016_TheComingDarkness extends Quest
{ {
htmltext = "31514-01.html"; htmltext = "31514-01.html";
} }
else else if (qs.isMemoState(3))
{
if (qs.isMemoState(3))
{ {
htmltext = "31514-04.html"; htmltext = "31514-04.html";
} }
}
break; break;
} }
case EVIL_ALTAR_4: case EVIL_ALTAR_4:
@@ -264,13 +255,10 @@ public final class Q00016_TheComingDarkness extends Quest
{ {
htmltext = "31515-01.html"; htmltext = "31515-01.html";
} }
else else if (qs.isMemoState(4))
{
if (qs.isMemoState(4))
{ {
htmltext = "31515-04.html"; htmltext = "31515-04.html";
} }
}
break; break;
} }
case EVIL_ALTAR_5: case EVIL_ALTAR_5:
@@ -279,13 +267,10 @@ public final class Q00016_TheComingDarkness extends Quest
{ {
htmltext = "31516-01.html"; htmltext = "31516-01.html";
} }
else else if (qs.isMemoState(5))
{
if (qs.isMemoState(5))
{ {
htmltext = "31516-04.html"; htmltext = "31516-04.html";
} }
}
break; break;
} }
} }

View File

@@ -204,13 +204,10 @@ public final class Q00017_LightAndDarkness extends Quest
{ {
htmltext = "31508-01.html"; htmltext = "31508-01.html";
} }
else else if (qs.isMemoState(1))
{
if (qs.isMemoState(1))
{ {
htmltext = "31508-04.html"; htmltext = "31508-04.html";
} }
}
break; break;
} }
case SAINT_ALTAR_2: case SAINT_ALTAR_2:
@@ -219,13 +216,10 @@ public final class Q00017_LightAndDarkness extends Quest
{ {
htmltext = "31509-01.html"; htmltext = "31509-01.html";
} }
else else if (qs.isMemoState(2))
{
if (qs.isMemoState(2))
{ {
htmltext = "31509-04.html"; htmltext = "31509-04.html";
} }
}
break; break;
} }
case SAINT_ALTAR_3: case SAINT_ALTAR_3:
@@ -234,13 +228,10 @@ public final class Q00017_LightAndDarkness extends Quest
{ {
htmltext = "31510-01.html"; htmltext = "31510-01.html";
} }
else else if (qs.isMemoState(3))
{
if (qs.isMemoState(3))
{ {
htmltext = "31510-04.html"; htmltext = "31510-04.html";
} }
}
break; break;
} }
case SAINT_ALTAR_4: case SAINT_ALTAR_4:
@@ -249,13 +240,10 @@ public final class Q00017_LightAndDarkness extends Quest
{ {
htmltext = "31511-01.html"; htmltext = "31511-01.html";
} }
else else if (qs.isMemoState(4))
{
if (qs.isMemoState(4))
{ {
htmltext = "31511-04.html"; htmltext = "31511-04.html";
} }
}
break; break;
} }
} }

View File

@@ -235,9 +235,7 @@ public final class Q00177_SplitDestiny extends Quest
{ {
htmltext = "33344-12.htm"; htmltext = "33344-12.htm";
} }
else else if (!player.isSubClassActive() || !player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) || (player.getLevel() < 80))
{
if (!player.isSubClassActive() || !player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) || (player.getLevel() < 80))
{ {
htmltext = "33344-02.htm"; htmltext = "33344-02.htm";
} }
@@ -286,7 +284,6 @@ public final class Q00177_SplitDestiny extends Quest
htmltext = "33344-01.htm"; htmltext = "33344-01.htm";
} }
} }
}
else if ((npc.getId() == ISHUMA) && qs.isStarted()) else if ((npc.getId() == ISHUMA) && qs.isStarted())
{ {
switch (qs.getCond()) switch (qs.getCond())

View File

@@ -233,7 +233,7 @@ public final class Q00193_SevenSignsDyingMessage extends Quest
@Override @Override
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
QuestState st = getQuestState(player, true); final QuestState st = getQuestState(player, true);
String htmltext = getNoQuestMsg(player); String htmltext = getNoQuestMsg(player);
switch (st.getState()) switch (st.getState())
{ {

View File

@@ -347,7 +347,7 @@ public final class Q00194_SevenSignsMammonsContract extends Quest
@Override @Override
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
QuestState st = getQuestState(player, true); final QuestState st = getQuestState(player, true);
String htmltext = getNoQuestMsg(player); String htmltext = getNoQuestMsg(player);
switch (st.getState()) switch (st.getState())
{ {

View File

@@ -223,7 +223,7 @@ public final class Q00195_SevenSignsSecretRitualOfThePriests extends Quest
@Override @Override
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
QuestState st = getQuestState(player, true); final QuestState st = getQuestState(player, true);
String htmltext = getNoQuestMsg(player); String htmltext = getNoQuestMsg(player);
switch (st.getState()) switch (st.getState())
{ {

View File

@@ -234,7 +234,7 @@ public final class Q00196_SevenSignsSealOfTheEmperor extends Quest
@Override @Override
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
QuestState st = getQuestState(player, true); final QuestState st = getQuestState(player, true);
String htmltext = getNoQuestMsg(player); String htmltext = getNoQuestMsg(player);
switch (st.getState()) switch (st.getState())
{ {

View File

@@ -247,7 +247,7 @@ public final class Q00197_SevenSignsTheSacredBookOfSeal extends Quest
@Override @Override
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
QuestState st = getQuestState(player, true); final QuestState st = getQuestState(player, true);
String htmltext = getNoQuestMsg(player); String htmltext = getNoQuestMsg(player);
switch (st.getState()) switch (st.getState())
{ {

View File

@@ -197,7 +197,7 @@ public final class Q00198_SevenSignsEmbryo extends Quest
@Override @Override
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
QuestState st = getQuestState(player, true); final QuestState st = getQuestState(player, true);
String htmltext = getNoQuestMsg(player); String htmltext = getNoQuestMsg(player);
switch (st.getState()) switch (st.getState())
{ {

View File

@@ -223,9 +223,7 @@ public class Q00463_IMustBeaGenius extends Quest
{ {
htmltext = "32069-04.html"; htmltext = "32069-04.html";
} }
else else if (st.getInt("var") == 1)
{
if (st.getInt("var") == 1)
{ {
htmltext = "32069-06a.html"; htmltext = "32069-06a.html";
} }
@@ -235,7 +233,6 @@ public class Q00463_IMustBeaGenius extends Quest
st.set("var", "1"); st.set("var", "1");
htmltext = "32069-06.html"; htmltext = "32069-06.html";
} }
}
break; break;
} }
return htmltext; return htmltext;

View File

@@ -109,9 +109,7 @@ public final class Q00474_WaitingForTheSummer extends Quest
break; break;
} }
} }
else else if (qs.isStarted() && qs.isCond(2))
{
if (qs.isStarted() && qs.isCond(2))
{ {
if (!isSimulated) if (!isSimulated)
{ {
@@ -128,7 +126,6 @@ public final class Q00474_WaitingForTheSummer extends Quest
{ {
htmltext = "31981-02.html"; htmltext = "31981-02.html";
} }
}
return htmltext; return htmltext;
} }

View File

@@ -210,15 +210,12 @@ public final class Q00476_PlainMission extends Quest
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
} }
} }
else else if (killedGrendel < 45)
{
if (killedGrendel < 45)
{ {
killedGrendel++; killedGrendel++;
st.set("killed_" + GRENDEL[0], killedGrendel); st.set("killed_" + GRENDEL[0], killedGrendel);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
} }
}
if ((killedAntelope == 45) && (killedBandersnatch == 45) && (killedBuffalo == 45) && (killedGrendel == 45)) if ((killedAntelope == 45) && (killedBandersnatch == 45) && (killedBuffalo == 45) && (killedGrendel == 45))
{ {

View File

@@ -30,16 +30,16 @@ import com.l2jmobius.gameserver.model.quest.QuestState;
public class Q00620_FourGoblets extends Quest public class Q00620_FourGoblets extends Quest
{ {
// NPCs // NPCs
private final static int NAMELESS_SPIRIT = 31453; private static final int NAMELESS_SPIRIT = 31453;
private final static int GHOST_OF_WIGOTH_1 = 31452; private static final int GHOST_OF_WIGOTH_1 = 31452;
private final static int GHOST_OF_WIGOTH_2 = 31454; private static final int GHOST_OF_WIGOTH_2 = 31454;
private final static int CONQ_SM = 31921; private static final int CONQ_SM = 31921;
private final static int EMPER_SM = 31922; private static final int EMPER_SM = 31922;
private final static int SAGES_SM = 31923; private static final int SAGES_SM = 31923;
private final static int JUDGE_SM = 31924; private static final int JUDGE_SM = 31924;
private final static int GHOST_CHAMBERLAIN_1 = 31919; private static final int GHOST_CHAMBERLAIN_1 = 31919;
private final static int GHOST_CHAMBERLAIN_2 = 31920; private static final int GHOST_CHAMBERLAIN_2 = 31920;
private final static int[] NPCS = private static final int[] NPCS =
{ {
NAMELESS_SPIRIT, NAMELESS_SPIRIT,
GHOST_OF_WIGOTH_1, GHOST_OF_WIGOTH_1,
@@ -53,25 +53,25 @@ public class Q00620_FourGoblets extends Quest
}; };
// Reward // Reward
private final static int ANTIQUE_BROOCH = 7262; private static final int ANTIQUE_BROOCH = 7262;
// Items // Items
private final static int ENTRANCE_PASS = 7075; private static final int ENTRANCE_PASS = 7075;
private final static int GRAVE_PASS = 7261; private static final int GRAVE_PASS = 7261;
private final static int[] GOBLETS = private static final int[] GOBLETS =
{ {
7256, 7256,
7257, 7257,
7258, 7258,
7259 7259
}; };
private final static int BOSS_1 = 25339; private static final int BOSS_1 = 25339;
private final static int BOSS_2 = 25342; private static final int BOSS_2 = 25342;
private final static int BOSS_3 = 25346; private static final int BOSS_3 = 25346;
private final static int BOSS_4 = 25349; private static final int BOSS_4 = 25349;
private final static int RELIC = 7254; private static final int RELIC = 7254;
private final static int SEALED_BOX = 7255; private static final int SEALED_BOX = 7255;
private final static int[] QI = private static final int[] QI =
{ {
ANTIQUE_BROOCH, ANTIQUE_BROOCH,
SEALED_BOX, SEALED_BOX,
@@ -112,7 +112,7 @@ public class Q00620_FourGoblets extends Quest
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event; String htmltext = event;
QuestState st = player.getQuestState(getName()); final QuestState st = player.getQuestState(getName());
if (st == null) if (st == null)
{ {
return htmltext; return htmltext;
@@ -141,7 +141,7 @@ public class Q00620_FourGoblets extends Quest
htmltext = "31454-13.htm"; htmltext = "31454-13.htm";
takeItems(player, SEALED_BOX, 1); takeItems(player, SEALED_BOX, 1);
int reward = 0; int reward = 0;
int rnd = Rnd.get(5); final int rnd = Rnd.get(5);
if (rnd == 0) if (rnd == 0)
{ {
giveItems(player, 57, 10000); giveItems(player, 57, 10000);
@@ -152,7 +152,7 @@ public class Q00620_FourGoblets extends Quest
if (Rnd.get(1000) < 848) if (Rnd.get(1000) < 848)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 43) if (i < 43)
{ {
giveItems(player, 1884, 42); giveItems(player, 1884, 42);
@@ -197,7 +197,7 @@ public class Q00620_FourGoblets extends Quest
else if (Rnd.get(1000) < 323) else if (Rnd.get(1000) < 323)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 335) if (i < 335)
{ {
giveItems(player, 1888, 1); giveItems(player, 1888, 1);
@@ -233,7 +233,7 @@ public class Q00620_FourGoblets extends Quest
if (Rnd.get(1000) < 847) if (Rnd.get(1000) < 847)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 148) if (i < 148)
{ {
giveItems(player, 1878, 8); giveItems(player, 1878, 8);
@@ -278,7 +278,7 @@ public class Q00620_FourGoblets extends Quest
else if (Rnd.get(1000) < 251) else if (Rnd.get(1000) < 251)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 350) if (i < 350)
{ {
giveItems(player, 1887, 1); giveItems(player, 1887, 1);
@@ -314,7 +314,7 @@ public class Q00620_FourGoblets extends Quest
if (Rnd.get(1000) < 31) if (Rnd.get(1000) < 31)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 223) if (i < 223)
{ {
giveItems(player, 730, 1); giveItems(player, 730, 1);
@@ -331,7 +331,7 @@ public class Q00620_FourGoblets extends Quest
else if (Rnd.get(1000) < 50) else if (Rnd.get(1000) < 50)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 202) if (i < 202)
{ {
giveItems(player, 729, 1); giveItems(player, 729, 1);
@@ -351,7 +351,7 @@ public class Q00620_FourGoblets extends Quest
if (Rnd.get(1000) < 329) if (Rnd.get(1000) < 329)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 88) if (i < 88)
{ {
giveItems(player, 6698, 1); giveItems(player, 6698, 1);
@@ -424,7 +424,7 @@ public class Q00620_FourGoblets extends Quest
else if (Rnd.get(1000) < 54) else if (Rnd.get(1000) < 54)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 100) if (i < 100)
{ {
giveItems(player, 6688, 1); giveItems(player, 6688, 1);
@@ -524,9 +524,7 @@ public class Q00620_FourGoblets extends Quest
st.getPlayer().teleToLocation(178298, -84574, -7216); st.getPlayer().teleToLocation(178298, -84574, -7216);
htmltext = null; htmltext = null;
} }
else else if (getQuestItemsCount(player, GRAVE_PASS) >= 1)
{
if (getQuestItemsCount(player, GRAVE_PASS) >= 1)
{ {
takeItems(player, GRAVE_PASS, 1); takeItems(player, GRAVE_PASS, 1);
st.getPlayer().teleToLocation(178298, -84574, -7216); st.getPlayer().teleToLocation(178298, -84574, -7216);
@@ -536,7 +534,6 @@ public class Q00620_FourGoblets extends Quest
{ {
htmltext = "31919-0.htm"; htmltext = "31919-0.htm";
} }
}
break; break;
} }
case "16": case "16":
@@ -546,9 +543,7 @@ public class Q00620_FourGoblets extends Quest
st.getPlayer().teleToLocation(186942, -75602, -2834); st.getPlayer().teleToLocation(186942, -75602, -2834);
htmltext = null; htmltext = null;
} }
else else if (getQuestItemsCount(player, GRAVE_PASS) >= 1)
{
if (getQuestItemsCount(player, GRAVE_PASS) >= 1)
{ {
takeItems(player, GRAVE_PASS, 1); takeItems(player, GRAVE_PASS, 1);
st.getPlayer().teleToLocation(186942, -75602, -2834); st.getPlayer().teleToLocation(186942, -75602, -2834);
@@ -558,7 +553,6 @@ public class Q00620_FourGoblets extends Quest
{ {
htmltext = "31920-0.htm"; htmltext = "31920-0.htm";
} }
}
break; break;
} }
case "17": case "17":
@@ -596,7 +590,7 @@ public class Q00620_FourGoblets extends Quest
htmltext = "31919-3.htm"; htmltext = "31919-3.htm";
takeItems(player, SEALED_BOX, 1); takeItems(player, SEALED_BOX, 1);
int reward = 0; int reward = 0;
int rnd = Rnd.get(5); final int rnd = Rnd.get(5);
if (rnd == 0) if (rnd == 0)
{ {
giveItems(player, 57, 10000); giveItems(player, 57, 10000);
@@ -607,7 +601,7 @@ public class Q00620_FourGoblets extends Quest
if (Rnd.get(1000) < 848) if (Rnd.get(1000) < 848)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 43) if (i < 43)
{ {
giveItems(player, 1884, 42); giveItems(player, 1884, 42);
@@ -652,7 +646,7 @@ public class Q00620_FourGoblets extends Quest
else if (Rnd.get(1000) < 323) else if (Rnd.get(1000) < 323)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 335) if (i < 335)
{ {
giveItems(player, 1888, 1); giveItems(player, 1888, 1);
@@ -688,7 +682,7 @@ public class Q00620_FourGoblets extends Quest
if (Rnd.get(1000) < 847) if (Rnd.get(1000) < 847)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 148) if (i < 148)
{ {
giveItems(player, 1878, 8); giveItems(player, 1878, 8);
@@ -733,7 +727,7 @@ public class Q00620_FourGoblets extends Quest
else if (Rnd.get(1000) < 251) else if (Rnd.get(1000) < 251)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 350) if (i < 350)
{ {
giveItems(player, 1887, 1); giveItems(player, 1887, 1);
@@ -769,7 +763,7 @@ public class Q00620_FourGoblets extends Quest
if (Rnd.get(1000) < 31) if (Rnd.get(1000) < 31)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 223) if (i < 223)
{ {
giveItems(player, 730, 1); giveItems(player, 730, 1);
@@ -787,7 +781,7 @@ public class Q00620_FourGoblets extends Quest
{ {
reward = 1; reward = 1;
} }
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 202) if (i < 202)
{ {
giveItems(player, 729, 1); giveItems(player, 729, 1);
@@ -806,7 +800,7 @@ public class Q00620_FourGoblets extends Quest
if (Rnd.get(1000) < 329) if (Rnd.get(1000) < 329)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 88) if (i < 88)
{ {
giveItems(player, 6698, 1); giveItems(player, 6698, 1);
@@ -879,7 +873,7 @@ public class Q00620_FourGoblets extends Quest
else if (Rnd.get(1000) < 54) else if (Rnd.get(1000) < 54)
{ {
reward = 1; reward = 1;
int i = Rnd.get(1000); final int i = Rnd.get(1000);
if (i < 100) if (i < 100)
{ {
giveItems(player, 6688, 1); giveItems(player, 6688, 1);
@@ -1076,9 +1070,7 @@ public class Q00620_FourGoblets extends Quest
{ {
htmltext = "31454-4.htm"; htmltext = "31454-4.htm";
} }
else else if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{
if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{ {
htmltext = "31454-8.htm"; htmltext = "31454-8.htm";
} }
@@ -1087,16 +1079,11 @@ public class Q00620_FourGoblets extends Quest
htmltext = "31454-12.htm"; htmltext = "31454-12.htm";
} }
} }
} else if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && ((getQuestItemsCount(talker, GOBLETS[3])) >= 1))
else
{
if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && ((getQuestItemsCount(talker, GOBLETS[3])) >= 1))
{ {
htmltext = "31454-3.htm"; htmltext = "31454-3.htm";
} }
else else if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{
if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{ {
htmltext = "31454-7.htm"; htmltext = "31454-7.htm";
} }
@@ -1105,19 +1092,13 @@ public class Q00620_FourGoblets extends Quest
htmltext = "31454-11.htm"; htmltext = "31454-11.htm";
} }
} }
} else if (getQuestItemsCount(talker, SEALED_BOX) >= 1)
}
else
{
if (getQuestItemsCount(talker, SEALED_BOX) >= 1)
{ {
if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && (getQuestItemsCount(talker, GOBLETS[3]) >= 1)) if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && (getQuestItemsCount(talker, GOBLETS[3]) >= 1))
{ {
htmltext = "31454-2.htm"; htmltext = "31454-2.htm";
} }
else else if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{
if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{ {
htmltext = "31454-6.htm"; htmltext = "31454-6.htm";
} }
@@ -1126,16 +1107,11 @@ public class Q00620_FourGoblets extends Quest
htmltext = "31454-10.htm"; htmltext = "31454-10.htm";
} }
} }
} else if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && (getQuestItemsCount(talker, GOBLETS[3]) >= 1))
else
{
if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && (getQuestItemsCount(talker, GOBLETS[3]) >= 1))
{ {
htmltext = "31454-1.htm"; htmltext = "31454-1.htm";
} }
else else if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{
if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{ {
htmltext = "31454-5.htm"; htmltext = "31454-5.htm";
} }
@@ -1143,9 +1119,6 @@ public class Q00620_FourGoblets extends Quest
{ {
htmltext = "31454-9.htm"; htmltext = "31454-9.htm";
} }
}
}
}
break; break;
} }
case CONQ_SM: case CONQ_SM:
@@ -1182,7 +1155,7 @@ public class Q00620_FourGoblets extends Quest
{ {
final QuestState st = killer.getQuestState(getName()); final QuestState st = killer.getQuestState(getName());
final L2PcInstance partyMember = getRandomPartyMember(killer, 3); final L2PcInstance partyMember = getRandomPartyMember(killer, 3);
int npcId = npc.getId(); final int npcId = npc.getId();
if ((st != null) && (st.getCond() > 0) && (npcId >= 18120) && (npcId <= 18256)) if ((st != null) && (st.getCond() > 0) && (npcId >= 18120) && (npcId <= 18256))
{ {
if (Rnd.get(100) < 15) if (Rnd.get(100) < 15)

View File

@@ -296,7 +296,7 @@ public class Q00663_SeductiveWhispers extends Quest
boolean isPlayerWin = false; boolean isPlayerWin = false;
boolean isNpcWin = false; boolean isNpcWin = false;
String htmltext; String htmltext;
String table = getHtm(player.getHtmlPrefix(), "table.html"); final String table = getHtm(player.getHtmlPrefix(), "table.html");
if (isPlayerTurn) if (isPlayerTurn)
{ {
@@ -330,9 +330,7 @@ public class Q00663_SeductiveWhispers extends Quest
htmltext = htmltext.replace("%table%", table); htmltext = htmltext.replace("%table%", table);
} }
} }
else else if ((playerCard != null) && (npcCard != null) && isWinner(playerCard, npcCard, false))
{
if ((playerCard != null) && (npcCard != null) && isWinner(playerCard, npcCard, false))
{ {
htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-24.html" : "30846-21.html"); htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-24.html" : "30846-21.html");
htmltext = htmltext.replace("%table%", table); htmltext = htmltext.replace("%table%", table);
@@ -343,7 +341,6 @@ public class Q00663_SeductiveWhispers extends Quest
htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-23.html" : "30846-17.html"); htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-23.html" : "30846-17.html");
htmltext = htmltext.replace("%table%", table); htmltext = htmltext.replace("%table%", table);
} }
}
htmltext = htmltext.replaceAll("%player_name%", player.getName()); htmltext = htmltext.replaceAll("%player_name%", player.getName());
htmltext = htmltext.replaceAll("%player_card%", playerCard.toString()); htmltext = htmltext.replaceAll("%player_card%", playerCard.toString());

View File

@@ -157,13 +157,10 @@ public class Q00772_PurifyingSouls extends Quest
} }
} }
} }
else else if (qs.isCompleted() && !qs.isNowAvailable())
{
if (qs.isCompleted() && !qs.isNowAvailable())
{ {
htmltext = "33838-10.htm"; htmltext = "33838-10.htm";
} }
}
return htmltext; return htmltext;
} }

View File

@@ -232,13 +232,10 @@ public class Q00784_TheQuietKiller extends Quest
} }
} }
} }
else else if (qs.isCompleted() && !qs.isNowAvailable())
{
if (qs.isCompleted() && !qs.isNowAvailable())
{ {
htmltext = "31554-10.html"; htmltext = "31554-10.html";
} }
}
return htmltext; return htmltext;
} }

View File

@@ -119,7 +119,7 @@ public class Q10275_ContainingTheAttributePower extends Quest
if (Util.isDigit(event)) if (Util.isDigit(event))
{ {
htmltext = Integer.toString(npc.getId()) + "-1" + event + ".html"; htmltext = npc.getId() + "-1" + event + ".html";
giveItems(player, 10520 + CommonUtil.constrain(Integer.parseInt(event), 0, 6), 2); giveItems(player, 10520 + CommonUtil.constrain(Integer.parseInt(event), 0, 6), 2);
addExpAndSp(player, 202160, 20375); addExpAndSp(player, 202160, 20375);
st.exitQuest(false, true); st.exitQuest(false, true);

View File

@@ -229,7 +229,7 @@ public final class Q10292_SevenSignsGirlOfDoubt extends Quest
@Override @Override
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
QuestState st = getQuestState(player, true); final QuestState st = getQuestState(player, true);
String htmltext = getNoQuestMsg(player); String htmltext = getNoQuestMsg(player);
switch (npc.getId()) switch (npc.getId())
{ {

View File

@@ -220,7 +220,7 @@ public final class Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom extends
@Override @Override
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
QuestState qs = getQuestState(player, true); final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player); String htmltext = getNoQuestMsg(player);
switch (npc.getId()) switch (npc.getId())
{ {

View File

@@ -303,7 +303,7 @@ public final class Q10294_SevenSignsToTheMonasteryOfSilence extends Quest
@Override @Override
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
QuestState qs = getQuestState(player, true); final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player); String htmltext = getNoQuestMsg(player);
switch (npc.getId()) switch (npc.getId())
{ {

View File

@@ -53,7 +53,7 @@ public final class Q10295_SevenSignsSolinasTomb extends Quest
return null; return null;
} }
String htmltext = null; final String htmltext = null;
switch (event) switch (event)
{ {
@@ -65,7 +65,7 @@ public final class Q10295_SevenSignsSolinasTomb extends Quest
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
// QuestState qs = getQuestState(player, true); // QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player); final String htmltext = getNoQuestMsg(player);
switch (npc.getId()) switch (npc.getId())
{ {

View File

@@ -53,7 +53,7 @@ public final class Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal extends Quest
return null; return null;
} }
String htmltext = null; final String htmltext = null;
switch (event) switch (event)
{ {
@@ -65,7 +65,7 @@ public final class Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal extends Quest
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
// QuestState qs = getQuestState(player, true); // QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player); final String htmltext = getNoQuestMsg(player);
switch (npc.getId()) switch (npc.getId())
{ {

View File

@@ -41,7 +41,7 @@ public final class Q10326_RespectYourElders extends Quest
private static final int HANDERMONKEY = 32971; private static final int HANDERMONKEY = 32971;
// Locations // Locations
private static final Location HANDERMONKEY_SPAWN = new Location(-116617, 255497, -1432); private static final Location HANDERMONKEY_SPAWN = new Location(-116617, 255497, -1432);
private final static Location[] HANDERMONKEY_LOC = private static final Location[] HANDERMONKEY_LOC =
{ {
new Location(-116560, 255951, -1457), new Location(-116560, 255951, -1457),
new Location(-116688, 256597, -1472), new Location(-116688, 256597, -1472),

View File

@@ -46,7 +46,7 @@ public final class Q10329_BackupSeekers extends Quest
// Locations // Locations
private static final Location BART_SPAWN_1 = new Location(-117955, 255832, -1320); private static final Location BART_SPAWN_1 = new Location(-117955, 255832, -1320);
private static final Location BART_SPAWN_2 = new Location(-114121, 252445, -1560); private static final Location BART_SPAWN_2 = new Location(-114121, 252445, -1560);
private final static Location[] BART_LOC_1 = private static final Location[] BART_LOC_1 =
{ {
new Location(-117063, 255528, -1296), new Location(-117063, 255528, -1296),
new Location(-115766, 254791, -1504), new Location(-115766, 254791, -1504),
@@ -54,7 +54,7 @@ public final class Q10329_BackupSeekers extends Quest
new Location(-114606, 253534, -1528), new Location(-114606, 253534, -1528),
new Location(-114375, 252807, -1536), new Location(-114375, 252807, -1536),
}; };
private final static Location[] BART_LOC_2 = private static final Location[] BART_LOC_2 =
{ {
new Location(-114410, 252220, -1591), new Location(-114410, 252220, -1591),
new Location(-114416, 250812, -1760), new Location(-114416, 250812, -1760),

View File

@@ -179,15 +179,12 @@ public final class Q10358_DividedSakumPoslof extends Quest
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
} }
} }
else else if (killedVeelans < 23)
{
if (killedVeelans < 23)
{ {
killedVeelans++; killedVeelans++;
st.set("killed_" + VEELEAN, killedVeelans); st.set("killed_" + VEELEAN, killedVeelans);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
} }
}
if ((killedZombies == 20) && (killedVeelans == 23)) if ((killedZombies == 20) && (killedVeelans == 23))
{ {

View File

@@ -46,7 +46,7 @@ public final class Q10365_SeekerEscort extends Quest
// Locations // Locations
private static final Location BLOODHOUND_SPAWN_1 = new Location(-110624, 238369, -2920); private static final Location BLOODHOUND_SPAWN_1 = new Location(-110624, 238369, -2920);
private static final Location BLOODHOUND_SPAWN_2 = new Location(-112660, 233942, -3072); private static final Location BLOODHOUND_SPAWN_2 = new Location(-112660, 233942, -3072);
private final static Location[] BLOODHOUND_LOC_1 = private static final Location[] BLOODHOUND_LOC_1 =
{ {
new Location(-110574, 238972, -2920), new Location(-110574, 238972, -2920),
new Location(-110723, 239275, -2920), new Location(-110723, 239275, -2920),
@@ -68,7 +68,7 @@ public final class Q10365_SeekerEscort extends Quest
new Location(-112199, 240141, -2920), new Location(-112199, 240141, -2920),
new Location(-112291, 240201, -2920), new Location(-112291, 240201, -2920),
}; };
private final static Location[] BLOODHOUND_LOC_2 = private static final Location[] BLOODHOUND_LOC_2 =
{ {
new Location(-112403, 233676, -3096), new Location(-112403, 233676, -3096),
new Location(-112174, 233487, -3120), new Location(-112174, 233487, -3120),

View File

@@ -166,23 +166,18 @@ public final class Q10420_TheVarkaSilenosSupporters extends Quest
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
} }
} }
else else if (wizardCount < 50)
{
if (wizardCount < 50)
{ {
st.set("KillCount_" + EMBRYO_WIZARD, ++wizardCount); st.set("KillCount_" + EMBRYO_WIZARD, ++wizardCount);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
} }
}
if ((shooterCount >= 50) && (wizardCount >= 50)) if ((shooterCount >= 50) && (wizardCount >= 50))
{ {
st.setCond(2, true); st.setCond(2, true);
} }
} }
else else if (CommonUtil.contains(WIZARD_MONSTERS, npc.getId()))
{
if (CommonUtil.contains(WIZARD_MONSTERS, npc.getId()))
{ {
if (st.getInt("KillCount_" + EMBRYO_WIZARD) < 50) if (st.getInt("KillCount_" + EMBRYO_WIZARD) < 50)
{ {
@@ -191,17 +186,13 @@ public final class Q10420_TheVarkaSilenosSupporters extends Quest
embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH); embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH);
} }
} }
else else if (st.getInt("KillCount_" + EMBRYO_SHOOTER) < 50)
{
if (st.getInt("KillCount_" + EMBRYO_SHOOTER) < 50)
{ {
final L2Npc embryo = addSpawn(EMBRYO_SHOOTER, npc, false, 60000); final L2Npc embryo = addSpawn(EMBRYO_SHOOTER, npc, false, 60000);
addAttackPlayerDesire(embryo, killer); addAttackPlayerDesire(embryo, killer);
embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH); embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH);
} }
} }
}
}
return super.onKill(npc, killer, isSummon); return super.onKill(npc, killer, isSummon);
} }

View File

@@ -169,23 +169,18 @@ public final class Q10425_TheKetraOrcSupporters extends Quest
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
} }
} }
else else if (wizardCount < 50)
{
if (wizardCount < 50)
{ {
qs.set("KillCount_" + EMBRYO_WIZARD, ++wizardCount); qs.set("KillCount_" + EMBRYO_WIZARD, ++wizardCount);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
} }
}
if ((shooterCount >= 50) && (wizardCount >= 50)) if ((shooterCount >= 50) && (wizardCount >= 50))
{ {
qs.setCond(2, true); qs.setCond(2, true);
} }
} }
else else if (CommonUtil.contains(WIZARD_MONSTERS, npc.getId()))
{
if (CommonUtil.contains(WIZARD_MONSTERS, npc.getId()))
{ {
if (qs.getInt("KillCount_" + EMBRYO_WIZARD) < 50) if (qs.getInt("KillCount_" + EMBRYO_WIZARD) < 50)
{ {
@@ -194,17 +189,13 @@ public final class Q10425_TheKetraOrcSupporters extends Quest
embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH); embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH);
} }
} }
else else if (qs.getInt("KillCount_" + EMBRYO_SHOOTER) < 50)
{
if (qs.getInt("KillCount_" + EMBRYO_SHOOTER) < 50)
{ {
final L2Npc embryo = addSpawn(EMBRYO_SHOOTER, npc, false, 60000); final L2Npc embryo = addSpawn(EMBRYO_SHOOTER, npc, false, 60000);
addAttackPlayerDesire(embryo, killer); addAttackPlayerDesire(embryo, killer);
embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH); embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH);
} }
} }
}
}
return super.onKill(npc, killer, isSummon); return super.onKill(npc, killer, isSummon);
} }

View File

@@ -16,8 +16,6 @@
*/ */
package quests.Q10436_KekropusLetterTheSealOfPunishment; package quests.Q10436_KekropusLetterTheSealOfPunishment;
import quests.LetterQuest;
import com.l2jmobius.gameserver.enums.CategoryType; import com.l2jmobius.gameserver.enums.CategoryType;
import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -27,6 +25,8 @@ import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import quests.LetterQuest;
/** /**
* Kekropus' Letter: The Seal of Punishment (10436) * Kekropus' Letter: The Seal of Punishment (10436)
* @author Stayway * @author Stayway

View File

@@ -107,7 +107,7 @@ public class Q10440_TheSealOfPunishmentTheFields extends Quest
final int stoneId = Integer.parseInt(event.replaceAll("reward_", "")); final int stoneId = Integer.parseInt(event.replaceAll("reward_", ""));
giveItems(player, stoneId, 15); giveItems(player, stoneId, 15);
giveStoryQuestReward(player, 60); giveStoryQuestReward(player, 60);
int count = qs.getInt(KILL_COUNT_VAR); final int count = qs.getInt(KILL_COUNT_VAR);
if ((count >= 50) && (count < 100)) if ((count >= 50) && (count < 100))
{ {
addExpAndSp(player, 28240800, 6777); addExpAndSp(player, 28240800, 6777);
@@ -226,7 +226,7 @@ public class Q10440_TheSealOfPunishmentTheFields extends Quest
final QuestState qs = getQuestState(killer, false); final QuestState qs = getQuestState(killer, false);
if ((qs != null) && (qs.getCond() > 0)) if ((qs != null) && (qs.getCond() > 0))
{ {
int count = qs.getInt(KILL_COUNT_VAR) + 1; final int count = qs.getInt(KILL_COUNT_VAR) + 1;
qs.set(KILL_COUNT_VAR, count); qs.set(KILL_COUNT_VAR, count);
if ((count >= 50) && (qs.isMemoState(1))) if ((count >= 50) && (qs.isMemoState(1)))
{ {

View File

@@ -41,7 +41,7 @@ public final class Q10734_DoOrDie extends Quest
private static final int ADVENTURER_S_GUIDE_APPRENTICE = 33950; private static final int ADVENTURER_S_GUIDE_APPRENTICE = 33950;
private static final int TRAINING_DUMMY = 19546; private static final int TRAINING_DUMMY = 19546;
// Skills // Skills
private final static SkillHolder[] COMMON_BUFFS = private static final SkillHolder[] COMMON_BUFFS =
{ {
new SkillHolder(5182, 1), // Blessing of Protection new SkillHolder(5182, 1), // Blessing of Protection
new SkillHolder(15642, 1), // Horn Melody new SkillHolder(15642, 1), // Horn Melody

View File

@@ -96,10 +96,7 @@ public final class Q10742_AFurryFriend extends Quest
showOnScreenMsg(player, NpcStringId.RICKY_IS_NOT_HERE_NTRY_SEARCHING_ANOTHER_KIKU_S_CAVE, ExShowScreenMessage.TOP_CENTER, 8000); showOnScreenMsg(player, NpcStringId.RICKY_IS_NOT_HERE_NTRY_SEARCHING_ANOTHER_KIKU_S_CAVE, ExShowScreenMessage.TOP_CENTER, 8000);
htmltext = "33995-02.html"; htmltext = "33995-02.html";
} }
else else if (!L2World.getInstance().getVisibleObjects(player, L2Npc.class, 500).stream().anyMatch(n -> (n.getId() == RICKY) && (n.getSummoner() == player)))
{
// Check if player has Ricky spawned
if (!L2World.getInstance().getVisibleObjects(player, L2Npc.class, 500).stream().anyMatch(n -> (n.getId() == RICKY) && (n.getSummoner() == player)))
{ {
showOnScreenMsg(player, NpcStringId.TAKE_RICKY_TO_LEIRA_IN_UNDER_2_MINUTES, ExShowScreenMessage.MIDDLE_CENTER, 5000); showOnScreenMsg(player, NpcStringId.TAKE_RICKY_TO_LEIRA_IN_UNDER_2_MINUTES, ExShowScreenMessage.MIDDLE_CENTER, 5000);
player.sendPacket(new ExSendUIEvent(player, false, false, 120, 0, NpcStringId.REMAINING_TIME)); player.sendPacket(new ExSendUIEvent(player, false, false, 120, 0, NpcStringId.REMAINING_TIME));
@@ -117,7 +114,6 @@ public final class Q10742_AFurryFriend extends Quest
htmltext = "33995-03.html"; htmltext = "33995-03.html";
} }
} }
}
break; break;
} }
case "CHECK_RICKY_DISTANCE": case "CHECK_RICKY_DISTANCE":

View File

@@ -134,14 +134,11 @@ public final class Q10757_QuietingTheStorm extends Quest
sendNpcLogList(killer); sendNpcLogList(killer);
} }
} }
else else if (windimaCount != 1)
{
if (windimaCount != 1)
{ {
qs.set(WINDIMA_COUNT_VAR, ++windimaCount); qs.set(WINDIMA_COUNT_VAR, ++windimaCount);
sendNpcLogList(killer); sendNpcLogList(killer);
} }
}
if ((vortexCount >= 5) && (windimaCount >= 1)) if ((vortexCount >= 5) && (windimaCount >= 1))
{ {

View File

@@ -120,9 +120,7 @@ public final class Q10764_FreeSpirit extends Quest
break; break;
} }
} }
else else if (qs.isStarted() && qs.isCond(1))
{
if (qs.isStarted() && qs.isCond(1))
{ {
final int npcId = (npc.getId() == WIND_SPIRIT) ? LIBERATED_WIND_SPIRIT : LIBERATED_TREE_SPIRIT; final int npcId = (npc.getId() == WIND_SPIRIT) ? LIBERATED_WIND_SPIRIT : LIBERATED_TREE_SPIRIT;
@@ -140,7 +138,6 @@ public final class Q10764_FreeSpirit extends Quest
{ {
htmltext = npc.getId() + "-01.html"; htmltext = npc.getId() + "-01.html";
} }
}
return htmltext; return htmltext;
} }

View File

@@ -195,7 +195,7 @@ public final class Q10794_InvestigateTheForest extends Quest
final QuestState qs = getQuestState(killer, false); final QuestState qs = getQuestState(killer, false);
if ((qs != null) && qs.isCond(1)) if ((qs != null) && qs.isCond(1))
{ {
int count = qs.getInt(KILL_COUNT_VAR) + 1; final int count = qs.getInt(KILL_COUNT_VAR) + 1;
qs.set(KILL_COUNT_VAR, count); qs.set(KILL_COUNT_VAR, count);
if (count >= 50) if (count >= 50)
{ {

View File

@@ -391,9 +391,7 @@ public abstract class AirShipController extends AbstractNpcAI
{ {
_log.warning(getName() + ": Fuel consumption not defined."); _log.warning(getName() + ": Fuel consumption not defined.");
} }
else else if (_teleportsTable.length != _fuelTable.length)
{
if (_teleportsTable.length != _fuelTable.length)
{ {
_log.warning(getName() + ": Fuel consumption not match teleport list."); _log.warning(getName() + ": Fuel consumption not match teleport list.");
} }
@@ -404,4 +402,3 @@ public abstract class AirShipController extends AbstractNpcAI
} }
} }
} }
}

View File

@@ -656,7 +656,7 @@ public interface IXmlReader
* @param node * @param node
* @return {@code true} if the node is an element type, {@code false} otherwise * @return {@code true} if the node is an element type, {@code false} otherwise
*/ */
public static boolean isNode(Node node) static boolean isNode(Node node)
{ {
return node.getNodeType() == Node.ELEMENT_NODE; return node.getNodeType() == Node.ELEMENT_NODE;
} }
@@ -665,7 +665,7 @@ public interface IXmlReader
* @param node * @param node
* @return {@code true} if the node is an element type, {@code false} otherwise * @return {@code true} if the node is an element type, {@code false} otherwise
*/ */
public static boolean isText(Node node) static boolean isText(Node node)
{ {
return node.getNodeType() == Node.TEXT_NODE; return node.getNodeType() == Node.TEXT_NODE;
} }

View File

@@ -303,7 +303,7 @@ public final class Rnd
protected static volatile long SEED_UNIQUIFIER = 8682522807148012L; protected static volatile long SEED_UNIQUIFIER = 8682522807148012L;
public static final Random directRandom() public static Random directRandom()
{ {
return rnd.directRandom(); return rnd.directRandom();
} }
@@ -313,7 +313,7 @@ public final class Rnd
* @return A random double number from 0 to 1 * @return A random double number from 0 to 1
* @see com.l2jmobius.commons.util.Rnd#nextDouble() * @see com.l2jmobius.commons.util.Rnd#nextDouble()
*/ */
public static final double get() public static double get()
{ {
return rnd.nextDouble(); return rnd.nextDouble();
} }
@@ -323,7 +323,7 @@ public final class Rnd
* @param n The superior limit (exclusive) * @param n The superior limit (exclusive)
* @return A random integer number from 0 to n-1 * @return A random integer number from 0 to n-1
*/ */
public static final int get(int n) public static int get(int n)
{ {
return rnd.get(n); return rnd.get(n);
} }
@@ -334,7 +334,7 @@ public final class Rnd
* @param max The maximum value * @param max The maximum value
* @return A random integer number from min to max * @return A random integer number from min to max
*/ */
public static final int get(int min, int max) public static int get(int min, int max)
{ {
return rnd.get(min, max); return rnd.get(min, max);
} }
@@ -345,12 +345,12 @@ public final class Rnd
* @param max The maximum value * @param max The maximum value
* @return A random long number from min to max * @return A random long number from min to max
*/ */
public static final long get(long min, long max) public static long get(long min, long max)
{ {
return rnd.get(min, max); return rnd.get(min, max);
} }
public static final RandomContainer newInstance(RandomType type) public static RandomContainer newInstance(RandomType type)
{ {
switch (type) switch (type)
{ {
@@ -375,7 +375,7 @@ public final class Rnd
* @return A random boolean state (true or false) * @return A random boolean state (true or false)
* @see java.util.Random#nextBoolean() * @see java.util.Random#nextBoolean()
*/ */
public static final boolean nextBoolean() public static boolean nextBoolean()
{ {
return rnd.nextBoolean(); return rnd.nextBoolean();
} }
@@ -385,7 +385,7 @@ public final class Rnd
* @param array The array to be filled with random byte numbers * @param array The array to be filled with random byte numbers
* @see java.util.Random#nextBytes(byte[] bytes) * @see java.util.Random#nextBytes(byte[] bytes)
*/ */
public static final void nextBytes(byte[] array) public static void nextBytes(byte[] array)
{ {
rnd.nextBytes(array); rnd.nextBytes(array);
} }
@@ -395,7 +395,7 @@ public final class Rnd
* @return A random double number from 0 to 1 * @return A random double number from 0 to 1
* @see java.util.Random#nextDouble() * @see java.util.Random#nextDouble()
*/ */
public static final double nextDouble() public static double nextDouble()
{ {
return rnd.nextDouble(); return rnd.nextDouble();
} }
@@ -405,7 +405,7 @@ public final class Rnd
* @return A random integer number from 0 to 1 * @return A random integer number from 0 to 1
* @see java.util.Random#nextFloat() * @see java.util.Random#nextFloat()
*/ */
public static final float nextFloat() public static float nextFloat()
{ {
return rnd.nextFloat(); return rnd.nextFloat();
} }
@@ -415,7 +415,7 @@ public final class Rnd
* @return A random gaussian double number from 0 to 1 * @return A random gaussian double number from 0 to 1
* @see java.util.Random#nextGaussian() * @see java.util.Random#nextGaussian()
*/ */
public static final double nextGaussian() public static double nextGaussian()
{ {
return rnd.nextGaussian(); return rnd.nextGaussian();
} }
@@ -425,7 +425,7 @@ public final class Rnd
* @return A random integer number from Integer.MIN_VALUE to Integer.MAX_VALUE * @return A random integer number from Integer.MIN_VALUE to Integer.MAX_VALUE
* @see java.util.Random#nextInt() * @see java.util.Random#nextInt()
*/ */
public static final int nextInt() public static int nextInt()
{ {
return rnd.nextInt(); return rnd.nextInt();
} }
@@ -435,7 +435,7 @@ public final class Rnd
* @return int * @return int
* @see com.l2jmobius.commons.util.Rnd#get(int n) * @see com.l2jmobius.commons.util.Rnd#get(int n)
*/ */
public static final int nextInt(int n) public static int nextInt(int n)
{ {
return get(n); return get(n);
} }
@@ -445,7 +445,7 @@ public final class Rnd
* @return A random integer number from Long.MIN_VALUE to Long.MAX_VALUE * @return A random integer number from Long.MIN_VALUE to Long.MAX_VALUE
* @see java.util.Random#nextLong() * @see java.util.Random#nextLong()
*/ */
public static final long nextLong() public static long nextLong()
{ {
return rnd.nextLong(); return rnd.nextLong();
} }

View File

@@ -621,6 +621,6 @@ public class GeoData
private static class SingletonHolder private static class SingletonHolder
{ {
protected final static GeoData _instance = new GeoData(); protected static final GeoData _instance = new GeoData();
} }
} }

View File

@@ -222,9 +222,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
{ {
intention = AI_INTENTION_ACTIVE; intention = AI_INTENTION_ACTIVE;
} }
else else if (npc.getSpawn() != null)
{
if (npc.getSpawn() != null)
{ {
final Location loc = npc.getSpawn().getLocation(); final Location loc = npc.getSpawn().getLocation();
final int range = Config.MAX_DRIFT_RANGE; final int range = Config.MAX_DRIFT_RANGE;
@@ -235,7 +233,6 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
} }
} }
} }
}
if (intention == AI_INTENTION_IDLE) if (intention == AI_INTENTION_IDLE)
{ {

View File

@@ -84,7 +84,7 @@ public class ActionData implements IGameXmlReader
* Gets the single instance of ActionData. * Gets the single instance of ActionData.
* @return single instance of ActionData * @return single instance of ActionData
*/ */
public static final ActionData getInstance() public static ActionData getInstance()
{ {
return SingletonHolder._instance; return SingletonHolder._instance;
} }

View File

@@ -128,7 +128,7 @@ public class AlchemyData implements IGameXmlReader
* Gets the single instance of AlchemyData. * Gets the single instance of AlchemyData.
* @return single instance of AlchemyData * @return single instance of AlchemyData
*/ */
public static final AlchemyData getInstance() public static AlchemyData getInstance()
{ {
return SingletonHolder._instance; return SingletonHolder._instance;
} }

View File

@@ -160,7 +160,7 @@ public class CubicData implements IGameXmlReader
* Gets the single instance of CubicData. * Gets the single instance of CubicData.
* @return single instance of CubicData * @return single instance of CubicData
*/ */
public static final CubicData getInstance() public static CubicData getInstance()
{ {
return SingletonHolder._instance; return SingletonHolder._instance;
} }

View File

@@ -128,7 +128,7 @@ public class DailyMissionData implements IGameXmlReader
* Gets the single instance of DailyMissionData. * Gets the single instance of DailyMissionData.
* @return single instance of DailyMissionData * @return single instance of DailyMissionData
*/ */
public static final DailyMissionData getInstance() public static DailyMissionData getInstance()
{ {
return SingletonHolder._instance; return SingletonHolder._instance;
} }

View File

@@ -110,7 +110,7 @@ public class EnchantItemHPBonusData implements IGameXmlReader
* Gets the single instance of EnchantHPBonusData. * Gets the single instance of EnchantHPBonusData.
* @return single instance of EnchantHPBonusData * @return single instance of EnchantHPBonusData
*/ */
public static final EnchantItemHPBonusData getInstance() public static EnchantItemHPBonusData getInstance()
{ {
return SingletonHolder._instance; return SingletonHolder._instance;
} }

View File

@@ -191,7 +191,7 @@ public class EnsoulData implements IGameXmlReader
* Gets the single instance of EnsoulData. * Gets the single instance of EnsoulData.
* @return single instance of EnsoulData * @return single instance of EnsoulData
*/ */
public static final EnsoulData getInstance() public static EnsoulData getInstance()
{ {
return SingletonHolder._instance; return SingletonHolder._instance;
} }

View File

@@ -60,7 +60,7 @@ public class NpcData implements IGameXmlReader
private final Map<Integer, L2NpcTemplate> _npcs = new HashMap<>(); private final Map<Integer, L2NpcTemplate> _npcs = new HashMap<>();
private final Map<String, Integer> _clans = new HashMap<>(); private final Map<String, Integer> _clans = new HashMap<>();
private final static List<Integer> _masterMonsterIDs = new ArrayList<>(); private static final List<Integer> _masterMonsterIDs = new ArrayList<>();
protected NpcData() protected NpcData()
{ {
@@ -525,9 +525,7 @@ public class NpcData implements IGameXmlReader
aiSkillScopes.add(shortOrLongRangeScope); aiSkillScopes.add(shortOrLongRangeScope);
} }
} }
else else if (skill.hasEffectType(L2EffectType.DISPEL, L2EffectType.DISPEL_BY_SLOT))
{
if (skill.hasEffectType(L2EffectType.DISPEL, L2EffectType.DISPEL_BY_SLOT))
{ {
aiSkillScopes.add(AISkillScope.NEGATIVE); aiSkillScopes.add(AISkillScope.NEGATIVE);
aiSkillScopes.add(shortOrLongRangeScope); aiSkillScopes.add(shortOrLongRangeScope);
@@ -569,7 +567,6 @@ public class NpcData implements IGameXmlReader
aiSkillScopes.add(AISkillScope.UNIVERSAL); aiSkillScopes.add(AISkillScope.UNIVERSAL);
} }
} }
}
for (AISkillScope aiSkillScope : aiSkillScopes) for (AISkillScope aiSkillScope : aiSkillScopes)
{ {

Some files were not shown because too many files have changed in this diff Show More