diff --git a/trunk/dist/game/data/html/default/33647-1.htm b/trunk/dist/game/data/html/default/33647-1.htm deleted file mode 100644 index f2db042f2d..0000000000 --- a/trunk/dist/game/data/html/default/33647-1.htm +++ /dev/null @@ -1,9 +0,0 @@ -Kartia Researcher:
-If you'll accept the challenge, you have to tell me where to send you. So where?
- - - - - - - \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-1.htm b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-1.htm new file mode 100644 index 0000000000..64a6a78ee6 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-1.htm @@ -0,0 +1,9 @@ +Kartia Researcher:
+If you'll accept the challenge, you have to tell me where to send you. So where?
+ + + + + + + \ No newline at end of file diff --git a/trunk/dist/game/data/html/default/33647-2.htm b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-2.htm similarity index 82% rename from trunk/dist/game/data/html/default/33647-2.htm rename to trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-2.htm index 87b3f6f1d7..b611253aa7 100644 --- a/trunk/dist/game/data/html/default/33647-2.htm +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-2.htm @@ -1,6 +1,6 @@ -Kartia Researcher:
-You've heard of Dimensional Rifts, I'm assuming. How outside of the physical world we inhabit there are still other dimensions?
-Of course the dimensions were kept apart to keep them from interfering with one another.
-Ever since Shilen's rising however the balance has been completely thrown off. As for Kartia's Labyrinth, we've discovered that she built it specifically as a stronghold amongst the dimensional rifts, guarded by three hand-picked demons.
- +Kartia Researcher:
+You've heard of Dimensional Rifts, I'm assuming. How outside of the physical world we inhabit there are still other dimensions?
+Of course the dimensions were kept apart to keep them from interfering with one another.
+Ever since Shilen's rising however the balance has been completely thrown off. As for Kartia's Labyrinth, we've discovered that she built it specifically as a stronghold amongst the dimensional rifts, guarded by three hand-picked demons.
+ \ No newline at end of file diff --git a/trunk/dist/game/data/html/default/33647-3.htm b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-3.htm similarity index 62% rename from trunk/dist/game/data/html/default/33647-3.htm rename to trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-3.htm index 77412f6998..a971e8bb1e 100644 --- a/trunk/dist/game/data/html/default/33647-3.htm +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-3.htm @@ -1,7 +1,7 @@ -Kartia Researcher:
-Don't waste my time! I'm a researcher sent directly by the Kingdom of Aden after all.
-The monsters that crossed space and time to Kartia's Labyrinth are part of Shilen's plot to infiltrate the whole of Aden. Our goal is to stop them, but we're only researchers. We need heroes.
- - - +Kartia Researcher:
+Don't waste my time! I'm a researcher sent directly by the Kingdom of Aden after all.
+The monsters that crossed space and time to Kartia's Labyrinth are part of Shilen's plot to infiltrate the whole of Aden. Our goal is to stop them, but we're only researchers. We need heroes.
+ + + \ No newline at end of file diff --git a/trunk/dist/game/data/html/default/33647-4.htm b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-4.htm similarity index 74% rename from trunk/dist/game/data/html/default/33647-4.htm rename to trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-4.htm index 5cbfb78ffc..871b05de3d 100644 --- a/trunk/dist/game/data/html/default/33647-4.htm +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-4.htm @@ -1,6 +1,6 @@ -Kartia Researcher:
-My, you don't know anything about the history of Kartia's Labyrinth, do you?
-But I can see you're curious about its history.
-Well, if you bring me something they left behind, I will probably be able to give you some information. A cronicle, perhaps?
- +Kartia Researcher:
+My, you don't know anything about the history of Kartia's Labyrinth, do you?
+But I can see you're curious about its history.
+Well, if you bring me something they left behind, I will probably be able to give you some information. A cronicle, perhaps?
+ \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-5.htm b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-5.htm new file mode 100644 index 0000000000..d3afed7372 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-5.htm @@ -0,0 +1,3 @@ +Kartia Researcher:
+Good luck with your journey, and please be careful! + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/condNoLevel.html b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-6.htm similarity index 98% rename from trunk/dist/game/data/scripts/instances/KartiasLabyrinth/condNoLevel.html rename to trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-6.htm index a8cd62cc05..717d4241e1 100644 --- a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/condNoLevel.html +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-6.htm @@ -1,3 +1,3 @@ -Kartia Researcher:
-You must not overstep your abilities. Please choose a location that suits your level. +Kartia Researcher:
+You must not overstep your abilities. Please choose a location that suits your level. \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/condNoParty.html b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-7.htm similarity index 98% rename from trunk/dist/game/data/scripts/instances/KartiasLabyrinth/condNoParty.html rename to trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-7.htm index a3a53e9032..ff033588c9 100644 --- a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/condNoParty.html +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-7.htm @@ -1,3 +1,3 @@ -Kartia Researcher:
-The party leader must ask me while you are in a party. +Kartia Researcher:
+The party leader must ask me while you are in a party. \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/condOtherError.html b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-8.htm similarity index 98% rename from trunk/dist/game/data/scripts/instances/KartiasLabyrinth/condOtherError.html rename to trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-8.htm index 046f91d0ea..4c65fb76a3 100644 --- a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/condOtherError.html +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647-8.htm @@ -1,3 +1,3 @@ -Kartia Researcher:
-I think there is a problem with the Dimensional Rift. Come back later when I've sorted it out. +Kartia Researcher:
+I think there is a problem with the Dimensional Rift. Come back later when I've sorted it out. \ No newline at end of file diff --git a/trunk/dist/game/data/html/default/33647.htm b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647.htm similarity index 52% rename from trunk/dist/game/data/html/default/33647.htm rename to trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647.htm index 8cc09db749..f1b9dd7533 100644 --- a/trunk/dist/game/data/html/default/33647.htm +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/33647.htm @@ -1,8 +1,8 @@ -Kartia Researcher:
-Don't waste my time! I'm a researcher sent directly by the Kingdom of Aden after all.
-The monsters that crossed space and time to Kartia's Labyrinth are part of Shilen's plot to infiltrate the whole of Aden. Our goal is to stop them, but we're only researchers. We need heroes.
- - - - +Kartia Researcher:
+Don't waste my time! I'm a researcher sent directly by the Kingdom of Aden after all.
+The monsters that crossed space and time to Kartia's Labyrinth are part of Shilen's plot to infiltrate the whole of Aden. Our goal is to stop them, but we're only researchers. We need heroes.
+ + + + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/KartiasLabyrinth.java b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/KartiasLabyrinth.java index f5d067a318..1e92c6e2ef 100644 --- a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/KartiasLabyrinth.java +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/KartiasLabyrinth.java @@ -16,6 +16,7 @@ */ package instances.KartiasLabyrinth; +import java.util.Calendar; import java.util.List; import com.l2jmobius.commons.util.CommonUtil; @@ -36,6 +37,7 @@ import com.l2jmobius.gameserver.model.quest.State; import com.l2jmobius.gameserver.model.zone.L2ZoneType; import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; +import com.l2jmobius.gameserver.util.Util; import instances.AbstractInstance; import quests.Q00494_IncarnationOfGreedZellakaGroup.Q00494_IncarnationOfGreedZellakaGroup; @@ -60,6 +62,30 @@ public final class KartiasLabyrinth extends AbstractInstance 33619, 33630, }; + private static final int[] BARTON = + { + 33610, + 33621, + 33632, + }; + private static final int[] ELISE = + { + 33616, + 33627, + 33638, + }; + private static final int[] ELIYAH = + { + 33614, + 33625, + 33636, + }; + private static final int[] HAYUK = + { + 33612, + 33623, + 33634, + }; // @formatter:off private static final int[] MONSTERS = { @@ -130,12 +156,26 @@ public final class KartiasLabyrinth extends AbstractInstance private static final int TEMPLATE_ID_GROUP_85 = 208; private static final int TEMPLATE_ID_GROUP_90 = 209; private static final int TEMPLATE_ID_GROUP_95 = 210; + private static final int MIN_LVL_85 = 85; + private static final int MIN_LVL_90 = 90; + private static final int MIN_LVL_95 = 95; + private static final int MAX_LVL_85 = 89; + private static final int MAX_LVL_90 = 94; + private static final int MAX_LVL_95 = 99; + private static final String KARTIA_ENTRY_VAR = "Last_Kartia_entry"; + private static final String KARTIA_PARTY_ENTRY_VAR = "Last_Kartia_party_entry"; public KartiasLabyrinth() { addStartNpc(KARTIA_RESEARCHER); + addFirstTalkId(KARTIA_RESEARCHER); addFirstTalkId(ADOLPH); + addFirstTalkId(BARTON); + addFirstTalkId(ELISE); + addFirstTalkId(ELIYAH); + addFirstTalkId(HAYUK); addTalkId(ADOLPH); + addTalkId(KARTIA_RESEARCHER); addSpawnId(BOZ_ENERGY); addSpawnId(BOSSES); addAttackId(MINI_BOSSES); @@ -157,35 +197,132 @@ public final class KartiasLabyrinth extends AbstractInstance { switch (event) { - case "enter_85_solo": + case "33647-1.htm": + case "33647-2.htm": + case "33647-3.htm": + case "33647-4.htm": { - enterInstance(player, npc, TEMPLATE_ID_SOLO_85); - break; + return event; } - case "enter_90_solo": + case "request_zellaka_solo": { - enterInstance(player, npc, TEMPLATE_ID_SOLO_90); - break; + if (!checkConditions(player, TEMPLATE_ID_SOLO_85)) + { + return "33647-8.htm"; + } + else if ((player.getLevel() >= MIN_LVL_85) && (player.getLevel() <= MAX_LVL_85)) + { + enterInstance(player, npc, TEMPLATE_ID_SOLO_85); + savePlayer(player); + return "33647-5.htm"; + } + else + { + return "33647-6.htm"; + } } - case "enter_95_solo": + case "request_pelline_solo": { - enterInstance(player, npc, TEMPLATE_ID_SOLO_95); - break; + if (!checkConditions(player, TEMPLATE_ID_SOLO_90)) + { + return "33647-8.htm"; + } + else if ((player.getLevel() >= MIN_LVL_90) && (player.getLevel() <= MAX_LVL_90)) + { + enterInstance(player, npc, TEMPLATE_ID_SOLO_90); + savePlayer(player); + return "33647-5.htm"; + } + else + { + return "33647-6.htm"; + } } - case "enter_85_group": + case "request_kalios_solo": { + if (!checkConditions(player, TEMPLATE_ID_SOLO_95)) + { + return "33647-8.htm"; + } + else if ((player.getLevel() >= MIN_LVL_95) && (player.getLevel() <= MAX_LVL_95)) + { + enterInstance(player, npc, TEMPLATE_ID_SOLO_95); + savePlayer(player); + return "33647-5.htm"; + } + else + { + return "33647-6.htm"; + } + } + case "request_zellaka_party": + { + if ((player.getParty() == null) || !player.getParty().isLeader(player)) + { + return "33647-7.htm"; + } + for (L2PcInstance member : player.getParty().getMembers()) + { + if (!checkConditions(member, TEMPLATE_ID_GROUP_85) || (member.getLevel() < MIN_LVL_85) || (member.getLevel() > MAX_LVL_85) || (Util.calculateDistance(player, member, false, false) > 500)) + { + return "33647-8.htm"; + } + } enterInstance(player, npc, TEMPLATE_ID_GROUP_85); - break; + savePlayer(player); + for (L2PcInstance member : player.getParty().getMembers()) + { + player.getInstanceWorld().addAllowed(member); + member.teleToLocation(player, true); + savePlayer(member); + } + return "33647-5.htm"; } - case "enter_90_group": + case "request_pelline_party": { + if ((player.getParty() == null) || !player.getParty().isLeader(player)) + { + return "33647-7.htm"; + } + for (L2PcInstance member : player.getParty().getMembers()) + { + if (!checkConditions(member, TEMPLATE_ID_GROUP_90) || (member.getLevel() < MIN_LVL_90) || (member.getLevel() > MAX_LVL_90) || (Util.calculateDistance(player, member, false, false) > 500)) + { + return "33647-8.htm"; + } + } enterInstance(player, npc, TEMPLATE_ID_GROUP_90); - break; + savePlayer(player); + for (L2PcInstance member : player.getParty().getMembers()) + { + player.getInstanceWorld().addAllowed(member); + member.teleToLocation(player, true); + savePlayer(member); + } + return "33647-5.htm"; } - case "enter_95_group": + case "request_kalios_party": { + if ((player.getParty() == null) || !player.getParty().isLeader(player)) + { + return "33647-7.htm"; + } + for (L2PcInstance member : player.getParty().getMembers()) + { + if (!checkConditions(member, TEMPLATE_ID_GROUP_95) || (member.getLevel() < MIN_LVL_95) || (member.getLevel() > MAX_LVL_95) || (Util.calculateDistance(player, member, false, false) > 500)) + { + return "33647-8.htm"; + } + } enterInstance(player, npc, TEMPLATE_ID_GROUP_95); - break; + savePlayer(player); + for (L2PcInstance member : player.getParty().getMembers()) + { + player.getInstanceWorld().addAllowed(member); + member.teleToLocation(player, true); + savePlayer(member); + } + return "33647-5.htm"; } default: { @@ -925,7 +1062,31 @@ public final class KartiasLabyrinth extends AbstractInstance @Override public String onFirstTalk(L2Npc npc, L2PcInstance player) { - return "adolph.html"; + if (npc.getId() == KARTIA_RESEARCHER) + { + return "33647.htm"; + } + if (CommonUtil.contains(ADOLPH, npc.getId())) + { + return "adolph.html"; + } + if (CommonUtil.contains(BARTON, npc.getId())) + { + return "barton.html"; + } + if (CommonUtil.contains(ELISE, npc.getId())) + { + return "elise.html"; + } + if (CommonUtil.contains(ELIYAH, npc.getId())) + { + return "eliyah.html"; + } + if (CommonUtil.contains(HAYUK, npc.getId())) + { + return "hayuk.html"; + } + return ""; } private boolean isSoloKartia(Instance instance) @@ -933,6 +1094,36 @@ public final class KartiasLabyrinth extends AbstractInstance return (instance.getTemplateId() == TEMPLATE_ID_SOLO_85) || (instance.getTemplateId() == TEMPLATE_ID_SOLO_90) || (instance.getTemplateId() == TEMPLATE_ID_SOLO_95); } + protected void savePlayer(L2PcInstance player) + { + if (isSoloKartia(player.getInstanceWorld())) + { + player.getVariables().set(KARTIA_ENTRY_VAR, System.currentTimeMillis()); + } + else + { + player.getVariables().set(KARTIA_PARTY_ENTRY_VAR, System.currentTimeMillis()); + } + } + + protected boolean checkConditions(L2PcInstance player, int templateId) + { + long lastEntry = 0; + if ((templateId == TEMPLATE_ID_SOLO_85) || (templateId == TEMPLATE_ID_SOLO_90) || (templateId == TEMPLATE_ID_SOLO_95)) + { + lastEntry = player.getVariables().getLong(KARTIA_ENTRY_VAR, 0); + } + else + { + lastEntry = player.getVariables().getLong(KARTIA_PARTY_ENTRY_VAR, 0); + } + final Calendar entryResetTime = Calendar.getInstance(); + entryResetTime.set(Calendar.HOUR, 6); + entryResetTime.set(Calendar.MINUTE, 30); + entryResetTime.set(Calendar.AM_PM, Calendar.AM); + return lastEntry < entryResetTime.getTimeInMillis(); + } + public static void main(String[] args) { new KartiasLabyrinth(); diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/barton.html b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/barton.html new file mode 100644 index 0000000000..6d2cadd5f7 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/barton.html @@ -0,0 +1,4 @@ +Barton:
+Always procrastinating... Why doesn't the Captain attack? +What? Me? As you can see, I am Tyrr Warrior Barton, best warrior in the Aden Kingdom. You weren't going to fight without me, were you? + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/elise.html b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/elise.html new file mode 100644 index 0000000000..1a933edd52 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/elise.html @@ -0,0 +1,3 @@ +Elise:
+I am Priestess Elise. I will heal your wounds and support your efforts. Do not underestimate my importance in battle, or you may wind up healing your own foolish self. + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/eliyah.html b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/eliyah.html new file mode 100644 index 0000000000..3a8fdf7b30 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/eliyah.html @@ -0,0 +1,3 @@ +Eliyah:
+Hayuk acts smart, but he is nothing compared to me. My guardian spirits cannot stand their master being in danger, and they attack accordingly. You must fight numbers with numbers, don't you think? + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/hayuk.html b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/hayuk.html new file mode 100644 index 0000000000..49f3503a58 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/hayuk.html @@ -0,0 +1,3 @@ +Hayuk:
+Unlike my colleague Barton, who is not the sharpest tool in the shed, I prefer to engage in smart combat. It would be a mistake to think that I am weaker than him. + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/kartiaEnter.html b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/kartiaEnter.html deleted file mode 100644 index 3ab0219f93..0000000000 --- a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/kartiaEnter.html +++ /dev/null @@ -1,3 +0,0 @@ -Kartia Researcher:
-Good luck on your journey, and please be careful! - \ No newline at end of file