Small code improvements.

This commit is contained in:
MobiusDev
2017-08-28 03:19:28 +00:00
parent cfb8cc59e2
commit aec0c9dddb
114 changed files with 549 additions and 606 deletions

View File

@@ -41,12 +41,12 @@ public class Q00245_ComeToMe extends Quest
// NPC
private static final int FERRIS = 30847;
// Monsters
private final static int[] BLAZING_MOBS_1 = new int[]
private static final int[] BLAZING_MOBS_1 = new int[]
{
21110, // Swamp Predator
21111 // Lava Wyrm
};
private final static int[] BLAZING_MOBS_2 = new int[]
private static final int[] BLAZING_MOBS_2 = new int[]
{
21112, // Hames Orc Foot Soldier
21113, // Hames Orc Sniper
@@ -54,12 +54,12 @@ public class Q00245_ComeToMe extends Quest
21116 // Hames Orc Prefect
};
// Items
private final static int FLAME_ASHES = 30322;
private final static int CRYSTALS_OF_EXPERIENCE = 30323;
private final static int CRYSTAL_A = 1461;
private final static int MENTOR_RING = 30383;
private final static int ACADEMY_DYE_STR = 47205;
private final static int ACADEMY_DYE_WIT = 47210;
private static final int FLAME_ASHES = 30322;
private static final int CRYSTALS_OF_EXPERIENCE = 30323;
private static final int CRYSTAL_A = 1461;
private static final int MENTOR_RING = 30383;
private static final int ACADEMY_DYE_STR = 47205;
private static final int ACADEMY_DYE_WIT = 47210;
// Misc
private static final int MIN_LEVEL = 70;
private static final int MAX_LEVEL = 75;
@@ -152,25 +152,22 @@ public class Q00245_ComeToMe extends Quest
{
htmltext = "30847-06.html";
}
else
else if (player.isMentee())
{
if (player.isMentee())
L2PcInstance mentor = MentorManager.getInstance().getMentor(player.getObjectId()).getPlayerInstance();
if ((mentor != null) && mentor.isOnline() && Util.checkIfInRange(200, npc, mentor, true))
{
L2PcInstance mentor = MentorManager.getInstance().getMentor(player.getObjectId()).getPlayerInstance();
if ((mentor != null) && mentor.isOnline() && Util.checkIfInRange(200, npc, mentor, true))
{
htmltext = "30847-10.html";
}
else
{
htmltext = "30847-08.html";
}
htmltext = "30847-10.html";
}
else
{
htmltext = "30847-09.html";
htmltext = "30847-08.html";
}
}
else
{
htmltext = "30847-09.html";
}
break;
}
case 3:

View File

@@ -151,12 +151,9 @@ public class Q00483_IntendedTactic extends Quest
}
}
}
else
else if (qs.isCompleted() && !qs.isNowAvailable())
{
if (qs.isCompleted() && !qs.isNowAvailable())
{
htmltext = "33357-03.html";
}
htmltext = "33357-03.html";
}
return htmltext;
}

View File

@@ -201,12 +201,9 @@ public class Q00775_RetrievingTheChaosFragment extends Quest
}
}
}
else
else if (qs.isCompleted() && !qs.isNowAvailable())
{
if (qs.isCompleted() && !qs.isNowAvailable())
{
htmltext = "31595-08.html";
}
htmltext = "31595-08.html";
}
return htmltext;
}

View File

@@ -164,13 +164,10 @@ public class Q10447_TimingIsEverything extends Quest
showOnScreenMsg(qs.getPlayer(), NpcStringId.YOU_TOOK_DOWN_THE_NERVA_ORCS_AND_GOT_THEIR_TEMPORARY_PRISON_KEY, ExShowScreenMessage.BOTTOM_RIGHT, 5000);
qs.setCond(2, true);
}
else
else if (getRandom(100) < 0.03)
{
if (getRandom(100) < 0.03)
{
showOnScreenMsg(killer, NpcStringId.YOU_HAVE_OBTAINED_NERVA_S_TEMPORARY_PRISON_KEY, ExShowScreenMessage.BOTTOM_RIGHT, 5000);
giveItems(killer, NARVAS_PRISON_KEY, 1);
}
showOnScreenMsg(killer, NpcStringId.YOU_HAVE_OBTAINED_NERVA_S_TEMPORARY_PRISON_KEY, ExShowScreenMessage.BOTTOM_RIGHT, 5000);
giveItems(killer, NARVAS_PRISON_KEY, 1);
}
return super.onKill(npc, killer, isSummon);
}

View File

@@ -126,48 +126,45 @@ public final class Q10771_VolatilePower extends Quest
break;
}
}
else
else if (qs.isStarted())
{
if (qs.isStarted())
if (qs.isCond(1))
{
if (qs.isCond(1))
final int itemCount = (int) getQuestItemsCount(player, SHINING_MYSTERIOUS_FRAGMENT);
int reduceCount = getRandom(1, 3);
if (reduceCount > itemCount)
{
final int itemCount = (int) getQuestItemsCount(player, SHINING_MYSTERIOUS_FRAGMENT);
int reduceCount = getRandom(1, 3);
if (reduceCount > itemCount)
{
reduceCount = itemCount;
}
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_CRUSHER_IS_ACTIVATED);
npc.setScriptValue(reduceCount);
for (int i = 0; i < 3; i++)
{
final L2Npc mob = addSpawn(FRAGMENT_EATER, player, true, 70000);
mob.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.KILL_THEM_DON_T_LET_THEM_GET_AWAY_WITH_THE_FRAGMENT);
addAttackPlayerDesire(mob, player);
}
takeItems(player, SHINING_MYSTERIOUS_FRAGMENT, reduceCount);
giveItems(player, NORMAL_FRAGMENT_DUST, reduceCount);
getTimers().addTimer("DESTROY_COUNT", 2000, npc, player);
if (getQuestItemsCount(player, NORMAL_FRAGMENT_DUST) >= 20)
{
qs.setCond(3, true); // Looks like cond 2 is skipped.
}
htmltext = null;
reduceCount = itemCount;
}
else
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_CRUSHER_IS_ACTIVATED);
npc.setScriptValue(reduceCount);
for (int i = 0; i < 3; i++)
{
htmltext = "33990-02.html";
final L2Npc mob = addSpawn(FRAGMENT_EATER, player, true, 70000);
mob.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.KILL_THEM_DON_T_LET_THEM_GET_AWAY_WITH_THE_FRAGMENT);
addAttackPlayerDesire(mob, player);
}
takeItems(player, SHINING_MYSTERIOUS_FRAGMENT, reduceCount);
giveItems(player, NORMAL_FRAGMENT_DUST, reduceCount);
getTimers().addTimer("DESTROY_COUNT", 2000, npc, player);
if (getQuestItemsCount(player, NORMAL_FRAGMENT_DUST) >= 20)
{
qs.setCond(3, true); // Looks like cond 2 is skipped.
}
htmltext = null;
}
else
{
htmltext = "33990-01.html";
htmltext = "33990-02.html";
}
}
else
{
htmltext = "33990-01.html";
}
return htmltext;
}