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

@@ -48,7 +48,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
private static final int[] NORMAL_MOBS = {22931, 22932, 22933, 22934, 22935, 22936, 22937, 22938, 23349};
//@formatter:on
static Map<L2ZoneType, zoneInfo> _roomInfo = new HashMap<>(24);
final static Set<SpawnTemplate> _templates = ConcurrentHashMap.newKeySet();
static final Set<SpawnTemplate> _templates = ConcurrentHashMap.newKeySet();
public HarnakUndergroundRuinsZone()
{

View File

@@ -43,16 +43,16 @@ public class NornilsGarden extends AbstractInstance
private static final int BOZ_CORE = 33781;
private static final int SPICULA_ZERO = 25901;
// Monsters
private final static int BOZ_STAGE1 = 19298;
private final static int BOZ_STAGE2 = 19305;
private final static int BOZ_STAGE3 = 19403;
private final static int BOZ_STAGE4 = BOZ_STAGE2;
private final static int SPICULA_ELITE_CAPTAIN = 19299;
private final static int SPICULA_ELITE_LIEUTNANT = 19300;
private final static int ELITE_SOLDIER_CLONE_1 = 19301;
private final static int SPICULA_ELITE_GUARD_1 = 19302;
private final static int ELITE_SOLDIER_CLONE_2 = 19303;
private final static int SPICULA_ELITE_GUARD_2 = 19304;
private static final int BOZ_STAGE1 = 19298;
private static final int BOZ_STAGE2 = 19305;
private static final int BOZ_STAGE3 = 19403;
private static final int BOZ_STAGE4 = BOZ_STAGE2;
private static final int SPICULA_ELITE_CAPTAIN = 19299;
private static final int SPICULA_ELITE_LIEUTNANT = 19300;
private static final int ELITE_SOLDIER_CLONE_1 = 19301;
private static final int SPICULA_ELITE_GUARD_1 = 19302;
private static final int ELITE_SOLDIER_CLONE_2 = 19303;
private static final int SPICULA_ELITE_GUARD_2 = 19304;
private static final int[] ATTACABLE_MONSTERS =
{
SPICULA_ELITE_CAPTAIN,
@@ -70,11 +70,11 @@ public class NornilsGarden extends AbstractInstance
private static final SkillHolder DARK_BUSTER = new SkillHolder(15237, 1);
private static final SkillHolder DARK_BREATH = new SkillHolder(15238, 1);
// Chance
private final static int CHANCE_DARK_SPHERES = 15;
private final static int CHANCE_DARK_WIND = 30;
private final static int CHANCE_DARK_THRUST = 15;
private final static int CHANCE_DARK_BUSTER = 15;
private final static int CHANCE_DARK_BREATH = 30;
private static final int CHANCE_DARK_SPHERES = 15;
private static final int CHANCE_DARK_WIND = 30;
private static final int CHANCE_DARK_THRUST = 15;
private static final int CHANCE_DARK_BUSTER = 15;
private static final int CHANCE_DARK_BREATH = 30;
// Misc
private static final int TEMPLATE_ID = 231;

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;
}