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,18 +205,15 @@ 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()) // respawn eye
final L2Npc npc = (L2Npc) character;
if (CommonUtil.contains(EYE_IDS, npc.getId()))
{ {
// respawn eye ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000);
final L2Npc npc = (L2Npc) character;
if (CommonUtil.contains(EYE_IDS, npc.getId()))
{
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000);
}
} }
} }
} }

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,18 +360,15 @@ 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);
{ GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas);
final L2Npc valakas = addSpawn(VALAKAS, -105200, -253104, -15264, 32768, false, 0); GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT);
GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas); }
GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT); else if (event.equalsIgnoreCase("remove_players"))
} {
else if (event.equalsIgnoreCase("remove_players")) 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,20 +246,17 @@ public final class Antharas extends AbstractNpcAI
} }
} }
} }
else if (!hasQuestItems(player, STONE))
{
htmltext = "13001-03.html";
}
else else
{ {
if (!hasQuestItems(player, STONE)) player.teleToLocation(179700 + getRandom(700), 113800 + getRandom(2100), -7709);
if (getStatus() != WAITING)
{ {
htmltext = "13001-03.html"; setStatus(WAITING);
} startQuestTimer("SPAWN_ANTHARAS", Config.ANTHARAS_WAIT_TIME * 60000, null, null);
else
{
player.teleToLocation(179700 + getRandom(700), 113800 + getRandom(2100), -7709);
if (getStatus() != WAITING)
{
setStatus(WAITING);
startQuestTimer("SPAWN_ANTHARAS", Config.ANTHARAS_WAIT_TIME * 60000, null, null);
}
} }
} }
return htmltext; return htmltext;

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,12 +317,9 @@ 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,16 +169,13 @@ 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 if ((npc.getCastle().getOwnerId() == player.getClanId()) && (player.getClanId() != 0) && (player.getSiegeState() == 2)) // Deffender
{
htmltext = getHtmlName(npc) + ".html";
}
else else
{ {
if ((npc.getCastle().getOwnerId() == player.getClanId()) && (player.getClanId() != 0) && (player.getSiegeState() == 2)) // Deffender htmltext = getHtmlName(npc) + "-no.html";
{
htmltext = getHtmlName(npc) + ".html";
}
else
{
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,23 +290,20 @@ 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.burnThemAll();
room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_VE_FAILED_ANY_FURTHER_ATTEMPTS_WOULD_BE_WASTEFUL); startQuestTimer("off", 2000, room.getManager(), null);
room.burnThemAll(); room.getParticipant().removeListenerIf(EventType.ON_CREATURE_SKILL_USE, listener -> listener.getOwner() == room);
startQuestTimer("off", 2000, room.getManager(), null); startQuestTimer("end", 4000, room.getManager(), null);
room.getParticipant().removeListenerIf(EventType.ON_CREATURE_SKILL_USE, listener -> listener.getOwner() == room); }
startQuestTimer("end", 4000, room.getManager(), null); else if (room.getAttemptNumber() < MAX_ATTEMPTS)
} {
else if (room.getAttemptNumber() < MAX_ATTEMPTS) room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TOO_BAD_I_WILL_NOT_GIVE_UP_ON_THIS_THOUGH);
{ room.burnThemAll();
room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TOO_BAD_I_WILL_NOT_GIVE_UP_ON_THIS_THOUGH); startQuestTimer("off", 2000, room.getManager(), null);
room.burnThemAll(); room.setAttemptNumber(room.getAttemptNumber() + 1);
startQuestTimer("off", 2000, room.getManager(), null);
room.setAttemptNumber(room.getAttemptNumber() + 1);
}
} }
} }
} }

View File

@@ -57,18 +57,15 @@ 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)) htmltext = "33980-05.html";
{ }
htmltext = "33980-05.html"; else if (qs.isCond(7))
} {
else if (qs.isCond(7)) htmltext = "33980-04.html";
{
htmltext = "33980-04.html";
}
} }
} }
return htmltext; return htmltext;

View File

@@ -156,16 +156,13 @@ 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 if (event.equals("register1v1"))
{
OlympiadManager.getInstance().registerNoble(player, CompetitionType.NON_CLASSED);
}
else else
{ {
if (event.equals("register1v1")) OlympiadManager.getInstance().registerNoble(player, CompetitionType.CLASSED);
{
OlympiadManager.getInstance().registerNoble(player, CompetitionType.NON_CLASSED);
}
else
{
OlympiadManager.getInstance().registerNoble(player, CompetitionType.CLASSED);
}
} }
break; break;
} }
@@ -340,42 +337,39 @@ public final class OlyManager extends AbstractNpcAI implements IBypassHandler
activeChar.sendPacket(new ExOlympiadMatchList()); activeChar.sendPacket(new ExOlympiadMatchList());
} }
else if ((olymanager == null) || (olymanager.getId() != MANAGER) || (!activeChar.inObserverMode() && !activeChar.isInsideRadius(olymanager, 300, false, false)))
{
return false;
}
else if (OlympiadManager.getInstance().isRegisteredInComp(activeChar))
{
activeChar.sendPacket(SystemMessageId.YOU_MAY_NOT_OBSERVE_A_OLYMPIAD_GAMES_MATCH_WHILE_YOU_ARE_ON_THE_WAITING_LIST);
return false;
}
else if (!Olympiad.getInstance().inCompPeriod())
{
activeChar.sendPacket(SystemMessageId.THE_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
return false;
}
else if (activeChar.isOnEvent())
{
activeChar.sendMessage("You can not observe games while registered on an event");
return false;
}
else else
{ {
if ((olymanager == null) || (olymanager.getId() != MANAGER) || (!activeChar.inObserverMode() && !activeChar.isInsideRadius(olymanager, 300, false, false))) final int arenaId = Integer.parseInt(command.substring(12).trim());
final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(arenaId);
if (nextArena != null)
{ {
return false; final List<Location> spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns();
} if (spectatorSpawns.isEmpty())
else if (OlympiadManager.getInstance().isRegisteredInComp(activeChar))
{
activeChar.sendPacket(SystemMessageId.YOU_MAY_NOT_OBSERVE_A_OLYMPIAD_GAMES_MATCH_WHILE_YOU_ARE_ON_THE_WAITING_LIST);
return false;
}
else if (!Olympiad.getInstance().inCompPeriod())
{
activeChar.sendPacket(SystemMessageId.THE_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
return false;
}
else if (activeChar.isOnEvent())
{
activeChar.sendMessage("You can not observe games while registered on an event");
return false;
}
else
{
final int arenaId = Integer.parseInt(command.substring(12).trim());
final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(arenaId);
if (nextArena != null)
{ {
final List<Location> spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); _LOG.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!");
if (spectatorSpawns.isEmpty()) return false;
{
_LOG.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!");
return false;
}
final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size()));
activeChar.enterOlympiadObserverMode(loc, arenaId);
} }
final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size()));
activeChar.enterOlympiadObserverMode(loc, arenaId);
} }
} }
return true; return true;

View File

@@ -94,14 +94,11 @@ 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.doCast(STONE.getSkill());
npc.setTarget(player); npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE);
npc.doCast(STONE.getSkill());
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,12 +130,9 @@ 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,29 +51,26 @@ 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 content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename);
final NpcHtmlMessage html = new NpcHtmlMessage(staticObject.getObjectId());
if (content == null)
{ {
final String filename = (staticObject.getId() == 24230101) ? "data/html/signboards/tomb_of_crystalgolem.htm" : "data/html/signboards/pvp_signboard.htm"; html.setHtml("<html><body>Signboard is missing:<br>" + filename + "</body></html>");
final String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename);
final NpcHtmlMessage html = new NpcHtmlMessage(staticObject.getObjectId());
if (content == null)
{
html.setHtml("<html><body>Signboard is missing:<br>" + filename + "</body></html>");
}
else
{
html.setHtml(content);
}
activeChar.sendPacket(html);
} }
else if (staticObject.getType() == 0) else
{ {
activeChar.sendPacket(staticObject.getMap()); html.setHtml(content);
} }
activeChar.sendPacket(html);
}
else if (staticObject.getType() == 0)
{
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,17 +620,13 @@ public class AdminEditChar implements IAdminCommandHandler
ps.setString(1, playerName); ps.setString(1, playerName);
ps.execute(); ps.execute();
} }
else if (changeCreateExpiryTime) // removing penalty
{
player.setClanCreateExpiryTime(0);
}
else else
{ {
// removing penalty player.setClanJoinExpiryTime(0);
if (changeCreateExpiryTime)
{
player.setClanCreateExpiryTime(0);
}
else
{
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,12 +1288,9 @@ 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;
@@ -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,12 +381,9 @@ 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);
} }
@@ -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,18 +82,15 @@ public class AdminFortSiege implements IAdminCommandHandler
{ {
activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET); activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
} }
else if (fort.getSiege().addAttacker(player, false) == 4)
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_CLAN_HAS_BEEN_REGISTERED_TO_S1_S_FORTRESS_BATTLE);
sm.addCastleId(fort.getResidenceId());
player.sendPacket(sm);
}
else else
{ {
if (fort.getSiege().addAttacker(player, false) == 4) player.sendMessage("During registering error occurred!");
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_CLAN_HAS_BEEN_REGISTERED_TO_S1_S_FORTRESS_BATTLE);
sm.addCastleId(fort.getResidenceId());
player.sendPacket(sm);
}
else
{
player.sendMessage("During registering error occurred!");
}
} }
} }
else if (command.equalsIgnoreCase("admin_clear_fortsiege_list")) else if (command.equalsIgnoreCase("admin_clear_fortsiege_list"))

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,16 +324,13 @@ public class AdminSpawn implements IAdminCommandHandler
} }
} }
} }
else if (showposition && (npc != null))
{
activeChar.sendMessage(index + " - " + spawn.getTemplate().getName() + " (" + spawn + "): " + npc.getX() + " " + npc.getY() + " " + npc.getZ());
}
else else
{ {
if (showposition && (npc != null)) activeChar.sendMessage(index + " - " + spawn.getTemplate().getName() + " (" + spawn + "): " + spawn.getX() + " " + spawn.getY() + " " + spawn.getZ());
{
activeChar.sendMessage(index + " - " + spawn.getTemplate().getName() + " (" + spawn + "): " + npc.getX() + " " + npc.getY() + " " + npc.getZ());
}
else
{
activeChar.sendMessage(index + " - " + spawn.getTemplate().getName() + " (" + spawn + "): " + spawn.getX() + " " + spawn.getY() + " " + spawn.getZ());
}
} }
} }

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,21 +131,18 @@ public final class Heal extends AbstractEffect
{ {
effected.sendPacket(SystemMessageId.REJUVENATING_HP); effected.sendPacket(SystemMessageId.REJUVENATING_HP);
} }
else if (effector.isPlayer() && (effector != effected))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_HAS_BEEN_RESTORED_BY_C1);
sm.addString(effector.getName());
sm.addInt((int) amount);
effected.sendPacket(sm);
}
else else
{ {
if (effector.isPlayer() && (effector != effected)) final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HP_HAS_BEEN_RESTORED);
{ sm.addInt((int) amount);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_HAS_BEEN_RESTORED_BY_C1); effected.sendPacket(sm);
sm.addString(effector.getName());
sm.addInt((int) amount);
effected.sendPacket(sm);
}
else
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HP_HAS_BEEN_RESTORED);
sm.addInt((int) amount);
effected.sendPacket(sm);
}
} }
} }
} }

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,20 +91,17 @@ 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 if (CategoryData.getInstance().isInCategory(CategoryType.SUB_GROUP_ROGUE, classId.getId()))
{
player.addItem(getClass().getSimpleName(), FATED_BOX_ROGUE, 1, player, true);
}
else if (CategoryData.getInstance().isInCategory(CategoryType.SUB_GROUP_KNIGHT, classId.getId()))
{
player.addItem(getClass().getSimpleName(), FATED_BOX_FIGHTER, 1, player, true);
}
else else
{ {
if (CategoryData.getInstance().isInCategory(CategoryType.SUB_GROUP_ROGUE, classId.getId())) player.addItem(getClass().getSimpleName(), FATED_BOX_WARRIOR, 1, player, true);
{
player.addItem(getClass().getSimpleName(), FATED_BOX_ROGUE, 1, player, true);
}
else if (CategoryData.getInstance().isInCategory(CategoryType.SUB_GROUP_KNIGHT, classId.getId()))
{
player.addItem(getClass().getSimpleName(), FATED_BOX_FIGHTER, 1, player, true);
}
else
{
player.addItem(getClass().getSimpleName(), FATED_BOX_WARRIOR, 1, player, true);
}
} }
break; break;
} }

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,13 +784,10 @@ 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.doCast(ICE_BALL.getSkill());
npc.setTarget(mostHated);
npc.doCast(ICE_BALL.getSkill());
}
} }
} }
else if (getRandom(10000) < 800) else if (getRandom(10000) < 800)
@@ -803,13 +800,10 @@ 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.doCast(SUMMON_ELEMENTAL.getSkill());
npc.setTarget(mostHated);
npc.doCast(SUMMON_ELEMENTAL.getSkill());
}
} }
} }
else if (getRandom(10000) < 1500) else if (getRandom(10000) < 1500)
@@ -871,13 +865,10 @@ 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.doCast(ICE_BALL.getSkill());
npc.setTarget(mostHated);
npc.doCast(ICE_BALL.getSkill());
}
} }
} }
else if (getRandom(10000) < 1333) else if (getRandom(10000) < 1333)
@@ -890,13 +881,10 @@ 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.doCast(SUMMON_ELEMENTAL.getSkill());
npc.setTarget(mostHated);
npc.doCast(SUMMON_ELEMENTAL.getSkill());
}
} }
} }
else if (getRandom(10000) < 1500) else if (getRandom(10000) < 1500)

View File

@@ -140,16 +140,13 @@ 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); else if (event.equals("enterInstanceExtreme"))
} {
else if (event.equals("enterInstanceExtreme")) enterInstance(player, npc, TEMPLATE_ID_EXTREME);
{
enterInstance(player, npc, TEMPLATE_ID_EXTREME);
}
} }
return htmltext; return htmltext;
} }

View File

@@ -584,20 +584,17 @@ 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);
{ addMoveToDesire(npc, instance.getTemplateParameters().getLocation("bossEscapeLoc2"), 23);
npc.setScriptValue(2); }
addMoveToDesire(npc, instance.getTemplateParameters().getLocation("bossEscapeLoc2"), 23); else if (npc.isScriptValue(2))
} {
else if (npc.isScriptValue(2)) instance.setParameter("MINIBOSS_SURVIVED", true);
{ instance.openCloseDoor(instance.getTemplateParameters().getInt("thirdDoorId"), true);
instance.setParameter("MINIBOSS_SURVIVED", true); instance.setStatus(3); // Used for notify helper's AI
instance.openCloseDoor(instance.getTemplateParameters().getInt("thirdDoorId"), true); npc.deleteMe();
instance.setStatus(3); // Used for notify helper's AI
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,12 +219,9 @@ 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;
} }
@@ -234,12 +231,9 @@ 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;
} }
@@ -249,12 +243,9 @@ 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;
} }
@@ -264,12 +255,9 @@ 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;
} }
@@ -279,12 +267,9 @@ 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,12 +204,9 @@ 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;
} }
@@ -219,12 +216,9 @@ 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;
} }
@@ -234,12 +228,9 @@ 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;
} }
@@ -249,12 +240,9 @@ 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,56 +235,53 @@ public final class Q00177_SplitDestiny extends Quest
{ {
htmltext = "33344-12.htm"; htmltext = "33344-12.htm";
} }
else if (!player.isSubClassActive() || !player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) || (player.getLevel() < 80))
{
htmltext = "33344-02.htm";
}
else if (!CategoryData.getInstance().isInCategory(CategoryType.AWAKEN_GROUP, player.getBaseClass()))
{
htmltext = "33344-03.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.SIGEL_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.SIGEL_CANDIDATE))
{
htmltext = "33344-sigel.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.TYRR_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.TYRR_CANDIDATE))
{
htmltext = "33344-tyrr.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.OTHELL_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.OTHELL_CANDIDATE))
{
htmltext = "33344-othell.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.YUL_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.YUL_CANDIDATE))
{
htmltext = "33344-yul.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.FEOH_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.FEOH_CANDIDATE))
{
htmltext = "33344-feoh.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.ISS_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.ISS_CANDIDATE))
{
htmltext = "33344-iss.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.WYNN_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.WYNN_CANDIDATE))
{
htmltext = "33344-wynn.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.AEORE_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.AEORE_CANDIDATE))
{
htmltext = "33344-aeore.htm";
}
else if (player.hasDualClass())
{
htmltext = "33344-12.htm";
}
else else
{ {
if (!player.isSubClassActive() || !player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) || (player.getLevel() < 80)) htmltext = "33344-01.htm";
{
htmltext = "33344-02.htm";
}
else if (!CategoryData.getInstance().isInCategory(CategoryType.AWAKEN_GROUP, player.getBaseClass()))
{
htmltext = "33344-03.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.SIGEL_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.SIGEL_CANDIDATE))
{
htmltext = "33344-sigel.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.TYRR_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.TYRR_CANDIDATE))
{
htmltext = "33344-tyrr.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.OTHELL_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.OTHELL_CANDIDATE))
{
htmltext = "33344-othell.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.YUL_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.YUL_CANDIDATE))
{
htmltext = "33344-yul.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.FEOH_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.FEOH_CANDIDATE))
{
htmltext = "33344-feoh.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.ISS_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.ISS_CANDIDATE))
{
htmltext = "33344-iss.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.WYNN_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.WYNN_CANDIDATE))
{
htmltext = "33344-wynn.htm";
}
else if (CategoryData.getInstance().isInCategory(CategoryType.AEORE_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.AEORE_CANDIDATE))
{
htmltext = "33344-aeore.htm";
}
else if (player.hasDualClass())
{
htmltext = "33344-12.htm";
}
else
{
htmltext = "33344-01.htm";
}
} }
} }
else if ((npc.getId() == ISHUMA) && qs.isStarted()) else if ((npc.getId() == ISHUMA) && qs.isStarted())

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,18 +223,15 @@ public class Q00463_IMustBeaGenius extends Quest
{ {
htmltext = "32069-04.html"; htmltext = "32069-04.html";
} }
else if (st.getInt("var") == 1)
{
htmltext = "32069-06a.html";
}
else else
{ {
if (st.getInt("var") == 1) takeItems(player, COLLECTION, -1);
{ st.set("var", "1");
htmltext = "32069-06a.html"; htmltext = "32069-06.html";
}
else
{
takeItems(player, COLLECTION, -1);
st.set("var", "1");
htmltext = "32069-06.html";
}
} }
break; break;
} }

View File

@@ -109,25 +109,22 @@ 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) giveAdena(player, 194000, true);
if (player.getLevel() >= MIN_LEVEL)
{ {
giveAdena(player, 194000, true); addExpAndSp(player, 1879400, 451);
if (player.getLevel() >= MIN_LEVEL)
{
addExpAndSp(player, 1879400, 451);
}
qs.exitQuest(QuestType.DAILY, true);
} }
htmltext = "31981-01.html"; qs.exitQuest(QuestType.DAILY, true);
}
else if (qs.isCompleted() && !qs.isNowAvailable())
{
htmltext = "31981-02.html";
} }
htmltext = "31981-01.html";
}
else if (qs.isCompleted() && !qs.isNowAvailable())
{
htmltext = "31981-02.html";
} }
return htmltext; return htmltext;
} }

View File

@@ -210,14 +210,11 @@ 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++;
{ st.set("killed_" + GRENDEL[0], killedGrendel);
killedGrendel++; playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
st.set("killed_" + GRENDEL[0], killedGrendel);
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,18 +524,15 @@ public class Q00620_FourGoblets extends Quest
st.getPlayer().teleToLocation(178298, -84574, -7216); st.getPlayer().teleToLocation(178298, -84574, -7216);
htmltext = null; htmltext = null;
} }
else if (getQuestItemsCount(player, GRAVE_PASS) >= 1)
{
takeItems(player, GRAVE_PASS, 1);
st.getPlayer().teleToLocation(178298, -84574, -7216);
htmltext = null;
}
else else
{ {
if (getQuestItemsCount(player, GRAVE_PASS) >= 1) htmltext = "31919-0.htm";
{
takeItems(player, GRAVE_PASS, 1);
st.getPlayer().teleToLocation(178298, -84574, -7216);
htmltext = null;
}
else
{
htmltext = "31919-0.htm";
}
} }
break; break;
} }
@@ -546,18 +543,15 @@ public class Q00620_FourGoblets extends Quest
st.getPlayer().teleToLocation(186942, -75602, -2834); st.getPlayer().teleToLocation(186942, -75602, -2834);
htmltext = null; htmltext = null;
} }
else if (getQuestItemsCount(player, GRAVE_PASS) >= 1)
{
takeItems(player, GRAVE_PASS, 1);
st.getPlayer().teleToLocation(186942, -75602, -2834);
htmltext = null;
}
else else
{ {
if (getQuestItemsCount(player, GRAVE_PASS) >= 1) htmltext = "31920-0.htm";
{
takeItems(player, GRAVE_PASS, 1);
st.getPlayer().teleToLocation(186942, -75602, -2834);
htmltext = null;
}
else
{
htmltext = "31920-0.htm";
}
} }
break; break;
} }
@@ -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,75 +1070,54 @@ public class Q00620_FourGoblets extends Quest
{ {
htmltext = "31454-4.htm"; htmltext = "31454-4.htm";
} }
else if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{
htmltext = "31454-8.htm";
}
else else
{ {
if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1) htmltext = "31454-12.htm";
{
htmltext = "31454-8.htm";
}
else
{
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))
{
htmltext = "31454-3.htm";
}
else if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{
htmltext = "31454-7.htm";
}
else else
{ {
if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && ((getQuestItemsCount(talker, GOBLETS[3])) >= 1)) htmltext = "31454-11.htm";
{
htmltext = "31454-3.htm";
}
else
{
if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{
htmltext = "31454-7.htm";
}
else
{
htmltext = "31454-11.htm";
}
}
} }
} }
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))
{
htmltext = "31454-2.htm";
}
else if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{
htmltext = "31454-6.htm";
}
else
{
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))
{
htmltext = "31454-1.htm";
}
else if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{
htmltext = "31454-5.htm";
}
else else
{ {
if (getQuestItemsCount(talker, SEALED_BOX) >= 1) htmltext = "31454-9.htm";
{
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";
}
else
{
if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{
htmltext = "31454-6.htm";
}
else
{
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))
{
htmltext = "31454-1.htm";
}
else
{
if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1)
{
htmltext = "31454-5.htm";
}
else
{
htmltext = "31454-9.htm";
}
}
}
} }
break; break;
} }
@@ -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,19 +330,16 @@ public class Q00663_SeductiveWhispers extends Quest
htmltext = htmltext.replace("%table%", table); htmltext = htmltext.replace("%table%", table);
} }
} }
else if ((playerCard != null) && (npcCard != null) && isWinner(playerCard, npcCard, false))
{
htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-24.html" : "30846-21.html");
htmltext = htmltext.replace("%table%", table);
isNpcWin = true;
}
else else
{ {
if ((playerCard != null) && (npcCard != null) && isWinner(playerCard, npcCard, false)) htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-23.html" : "30846-17.html");
{ htmltext = htmltext.replace("%table%", table);
htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-24.html" : "30846-21.html");
htmltext = htmltext.replace("%table%", table);
isNpcWin = true;
}
else
{
htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-23.html" : "30846-17.html");
htmltext = htmltext.replace("%table%", table);
}
} }
htmltext = htmltext.replaceAll("%player_name%", player.getName()); htmltext = htmltext.replaceAll("%player_name%", player.getName());

View File

@@ -157,12 +157,9 @@ 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,12 +232,9 @@ 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,14 +179,11 @@ 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++;
{ st.set("killed_" + VEELEAN, killedVeelans);
killedVeelans++; playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
st.set("killed_" + VEELEAN, killedVeelans);
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,13 +166,10 @@ 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);
{ playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
st.set("KillCount_" + EMBRYO_WIZARD, ++wizardCount);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
} }
if ((shooterCount >= 50) && (wizardCount >= 50)) if ((shooterCount >= 50) && (wizardCount >= 50))
@@ -180,27 +177,21 @@ public final class Q10420_TheVarkaSilenosSupporters extends Quest
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) final L2Npc embryo = addSpawn(EMBRYO_WIZARD, npc, false, 60000);
{ addAttackPlayerDesire(embryo, killer);
final L2Npc embryo = addSpawn(EMBRYO_WIZARD, npc, false, 60000); embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH);
addAttackPlayerDesire(embryo, killer);
embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH);
}
}
else
{
if (st.getInt("KillCount_" + EMBRYO_SHOOTER) < 50)
{
final L2Npc embryo = addSpawn(EMBRYO_SHOOTER, npc, false, 60000);
addAttackPlayerDesire(embryo, killer);
embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH);
}
} }
} }
else if (st.getInt("KillCount_" + EMBRYO_SHOOTER) < 50)
{
final L2Npc embryo = addSpawn(EMBRYO_SHOOTER, npc, false, 60000);
addAttackPlayerDesire(embryo, killer);
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,13 +169,10 @@ 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);
{ playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
qs.set("KillCount_" + EMBRYO_WIZARD, ++wizardCount);
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
} }
if ((shooterCount >= 50) && (wizardCount >= 50)) if ((shooterCount >= 50) && (wizardCount >= 50))
@@ -183,27 +180,21 @@ public final class Q10425_TheKetraOrcSupporters extends Quest
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) final L2Npc embryo = addSpawn(EMBRYO_WIZARD, npc, false, 60000);
{ addAttackPlayerDesire(embryo, killer);
final L2Npc embryo = addSpawn(EMBRYO_WIZARD, npc, false, 60000); embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH);
addAttackPlayerDesire(embryo, killer);
embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH);
}
}
else
{
if (qs.getInt("KillCount_" + EMBRYO_SHOOTER) < 50)
{
final L2Npc embryo = addSpawn(EMBRYO_SHOOTER, npc, false, 60000);
addAttackPlayerDesire(embryo, killer);
embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH);
}
} }
} }
else if (qs.getInt("KillCount_" + EMBRYO_SHOOTER) < 50)
{
final L2Npc embryo = addSpawn(EMBRYO_SHOOTER, npc, false, 60000);
addAttackPlayerDesire(embryo, killer);
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,26 +96,22 @@ 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 showOnScreenMsg(player, NpcStringId.TAKE_RICKY_TO_LEIRA_IN_UNDER_2_MINUTES, ExShowScreenMessage.MIDDLE_CENTER, 5000);
if (!L2World.getInstance().getVisibleObjects(player, L2Npc.class, 500).stream().anyMatch(n -> (n.getId() == RICKY) && (n.getSummoner() == player))) player.sendPacket(new ExSendUIEvent(player, false, false, 120, 0, NpcStringId.REMAINING_TIME));
{
showOnScreenMsg(player, NpcStringId.TAKE_RICKY_TO_LEIRA_IN_UNDER_2_MINUTES, ExShowScreenMessage.MIDDLE_CENTER, 5000); // Spawn Ricky
player.sendPacket(new ExSendUIEvent(player, false, false, 120, 0, NpcStringId.REMAINING_TIME)); final L2Npc ricky = addSpawn(RICKY, player, true, 120000);
ricky.setSummoner(player);
// Spawn Ricky ricky.setTitle(player.getAppearance().getVisibleName());
final L2Npc ricky = addSpawn(RICKY, player, true, 120000); ricky.setIsRunning(true);
ricky.setSummoner(player); ricky.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
ricky.setTitle(player.getAppearance().getVisibleName()); startQuestTimer("CHECK_RICKY_DISTANCE", 2500, ricky, player);
ricky.setIsRunning(true); }
ricky.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); else // Already have Ricky
startQuestTimer("CHECK_RICKY_DISTANCE", 2500, ricky, player); {
} htmltext = "33995-03.html";
else // Already have Ricky
{
htmltext = "33995-03.html";
}
} }
} }
break; break;

View File

@@ -134,13 +134,10 @@ 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);
{ sendNpcLogList(killer);
qs.set(WINDIMA_COUNT_VAR, ++windimaCount);
sendNpcLogList(killer);
}
} }
if ((vortexCount >= 5) && (windimaCount >= 1)) if ((vortexCount >= 5) && (windimaCount >= 1))

View File

@@ -120,26 +120,23 @@ public final class Q10764_FreeSpirit extends Quest
break; break;
} }
} }
else if (qs.isStarted() && qs.isCond(1))
{
final int npcId = (npc.getId() == WIND_SPIRIT) ? LIBERATED_WIND_SPIRIT : LIBERATED_TREE_SPIRIT;
giveItems(player, LOOSENED_CHAIN, 1);
addSpawn(npcId, npc, false, 2500);
npc.deleteMe();
if (getQuestItemsCount(player, LOOSENED_CHAIN) >= 10)
{
qs.setCond(2, true);
}
htmltext = null;
}
else else
{ {
if (qs.isStarted() && qs.isCond(1)) htmltext = npc.getId() + "-01.html";
{
final int npcId = (npc.getId() == WIND_SPIRIT) ? LIBERATED_WIND_SPIRIT : LIBERATED_TREE_SPIRIT;
giveItems(player, LOOSENED_CHAIN, 1);
addSpawn(npcId, npc, false, 2500);
npc.deleteMe();
if (getQuestItemsCount(player, LOOSENED_CHAIN) >= 10)
{
qs.setCond(2, true);
}
htmltext = null;
}
else
{
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,16 +391,13 @@ public abstract class AirShipController extends AbstractNpcAI
{ {
_log.warning(getName() + ": Fuel consumption not defined."); _log.warning(getName() + ": Fuel consumption not defined.");
} }
else if (_teleportsTable.length != _fuelTable.length)
{
_log.warning(getName() + ": Fuel consumption not match teleport list.");
}
else else
{ {
if (_teleportsTable.length != _fuelTable.length) AirShipManager.getInstance().registerAirShipTeleportList(_dockZone, _locationId, _teleportsTable, _fuelTable);
{
_log.warning(getName() + ": Fuel consumption not match teleport list.");
}
else
{
AirShipManager.getInstance().registerAirShipTeleportList(_dockZone, _locationId, _teleportsTable, _fuelTable);
}
} }
} }
} }

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,17 +222,14 @@ 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 int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius(loc, range + range, true, false))
{ {
final Location loc = npc.getSpawn().getLocation(); intention = AI_INTENTION_ACTIVE;
final int range = Config.MAX_DRIFT_RANGE;
if (!npc.isInsideRadius(loc, range + range, true, false))
{
intention = AI_INTENTION_ACTIVE;
}
} }
} }
} }

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,49 +525,46 @@ public class NpcData implements IGameXmlReader
aiSkillScopes.add(shortOrLongRangeScope); aiSkillScopes.add(shortOrLongRangeScope);
} }
} }
else if (skill.hasEffectType(L2EffectType.DISPEL, L2EffectType.DISPEL_BY_SLOT))
{
aiSkillScopes.add(AISkillScope.NEGATIVE);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.HEAL))
{
aiSkillScopes.add(AISkillScope.HEAL);
}
else if (skill.hasEffectType(L2EffectType.PHYSICAL_ATTACK, L2EffectType.PHYSICAL_ATTACK_HP_LINK, L2EffectType.MAGICAL_ATTACK, L2EffectType.DEATH_LINK, L2EffectType.HP_DRAIN))
{
aiSkillScopes.add(AISkillScope.ATTACK);
aiSkillScopes.add(AISkillScope.UNIVERSAL);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.SLEEP))
{
aiSkillScopes.add(AISkillScope.IMMOBILIZE);
}
else if (skill.hasEffectType(L2EffectType.BLOCK_ACTIONS, L2EffectType.ROOT))
{
aiSkillScopes.add(AISkillScope.IMMOBILIZE);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.MUTE, L2EffectType.BLOCK_CONTROL))
{
aiSkillScopes.add(AISkillScope.COT);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.DMG_OVER_TIME, L2EffectType.DMG_OVER_TIME_PERCENT))
{
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.RESURRECTION))
{
aiSkillScopes.add(AISkillScope.RES);
}
else else
{ {
if (skill.hasEffectType(L2EffectType.DISPEL, L2EffectType.DISPEL_BY_SLOT)) aiSkillScopes.add(AISkillScope.UNIVERSAL);
{
aiSkillScopes.add(AISkillScope.NEGATIVE);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.HEAL))
{
aiSkillScopes.add(AISkillScope.HEAL);
}
else if (skill.hasEffectType(L2EffectType.PHYSICAL_ATTACK, L2EffectType.PHYSICAL_ATTACK_HP_LINK, L2EffectType.MAGICAL_ATTACK, L2EffectType.DEATH_LINK, L2EffectType.HP_DRAIN))
{
aiSkillScopes.add(AISkillScope.ATTACK);
aiSkillScopes.add(AISkillScope.UNIVERSAL);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.SLEEP))
{
aiSkillScopes.add(AISkillScope.IMMOBILIZE);
}
else if (skill.hasEffectType(L2EffectType.BLOCK_ACTIONS, L2EffectType.ROOT))
{
aiSkillScopes.add(AISkillScope.IMMOBILIZE);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.MUTE, L2EffectType.BLOCK_CONTROL))
{
aiSkillScopes.add(AISkillScope.COT);
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.DMG_OVER_TIME, L2EffectType.DMG_OVER_TIME_PERCENT))
{
aiSkillScopes.add(shortOrLongRangeScope);
}
else if (skill.hasEffectType(L2EffectType.RESURRECTION))
{
aiSkillScopes.add(AISkillScope.RES);
}
else
{
aiSkillScopes.add(AISkillScope.UNIVERSAL);
}
} }
} }

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