Skip to content

Instantly share code, notes, and snippets.

@St3eT
Created April 5, 2013 18:01
Show Gist options
  • Save St3eT/5321324 to your computer and use it in GitHub Desktop.
Save St3eT/5321324 to your computer and use it in GitHub Desktop.
Quest Into The Flame (618) from py to java
Index: game/data/scripts.cfg
===================================================================
--- game/data/scripts.cfg (revision 9399)
+++ game/data/scripts.cfg (working copy)
@@ -650,7 +650,7 @@
quests/615_MagicalPowerOfFirePart1/__init__.py
quests/616_MagicalPowerOfFirePart2/__init__.py
quests/Q00617_GatherTheFlames/Q00617_GatherTheFlames.java
-quests/618_IntoTheFlame/__init__.py
+quests/Q00618_IntoTheFlame/Q00618_IntoTheFlame.java
quests/619_RelicsOfTheOldEmpire/__init__.py
quests/620_FourGoblets/__init__.py
quests/621_EggDelivery/__init__.py
Index: game/data/scripts/quests/Q00618_IntoTheFlame/31271-01.htm
===================================================================
--- game/data/scripts/quests/Q00618_IntoTheFlame/31271-01.htm (revision 0)
+++ game/data/scripts/quests/Q00618_IntoTheFlame/31271-01.htm (working copy)
@@ -0,0 +1,5 @@
+<html><body>Blacksmith Hilda:<br>
+Klein sent you here for a Vacualite, didn't he? ... I'm sorry, but I don't seem to have one at the moment.<br>
+I could make one, however. You can get the ore.<font color="LEVEL"> Bring me some Vacualite ore and I'll make a Vacualite for you.</font><br>
+<a action="bypass -h Quest Q00618_IntoTheFlame 31271-02.htm"> "Where can I find Vacualite ore?"</a>
+</body></html>
\ No newline at end of file
Index: game/data/scripts/quests/Q00618_IntoTheFlame/31271-02.htm
===================================================================
--- game/data/scripts/quests/Q00618_IntoTheFlame/31271-02.htm (revision 0)
+++ game/data/scripts/quests/Q00618_IntoTheFlame/31271-02.htm (working copy)
@@ -0,0 +1,3 @@
+<html><body>Blacksmith Hilda:<br>
+Open the bellies of the<font color="LEVEL"> Kookaburra, Bandersnatch and Grendel</font> in the Garden of Wild Beasts. Occasionally their entrails contain<font color="LEVEL"> Vacualite ore</font>. It's probably due to their bizarre diet! Bring<font color="LEVEL"> 50 pieces</font> of Vacualite ore to me and I'll make a Vacualite for you.
+</body></html>
\ No newline at end of file
Index: game/data/scripts/quests/Q00618_IntoTheFlame/31271-03.htm
===================================================================
--- game/data/scripts/quests/Q00618_IntoTheFlame/31271-03.htm (revision 0)
+++ game/data/scripts/quests/Q00618_IntoTheFlame/31271-03.htm (working copy)
@@ -0,0 +1,3 @@
+<html><body>Blacksmith Hilda:<br>
+You haven't brought enough! As I said, open the bellies of the<font color="LEVEL"> Kookaburra, Bandersnatch and Grendel</font> in the Garden of Wild Beasts. Sometimes their entrails contain<font color="LEVEL"> Vacualite ore</font>. This is probably due to their strange diet... Bring me<font color="LEVEL"> 50 pieces</font> of Vacualite ore and I'll make you a Vacualite.
+</body></html>
\ No newline at end of file
Index: game/data/scripts/quests/Q00618_IntoTheFlame/31271-04.htm
===================================================================
--- game/data/scripts/quests/Q00618_IntoTheFlame/31271-04.htm (revision 0)
+++ game/data/scripts/quests/Q00618_IntoTheFlame/31271-04.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Blacksmith Hilda:<br>
+You've brought them all? Let me see! Excellent! I can get started on your Vacualite right away! Now, let me have that Vacualite ore...<br>
+<a action="bypass -h Quest Q00618_IntoTheFlame 31271-05.htm">"Here you go."</a>
+</body></html>
\ No newline at end of file
Index: game/data/scripts/quests/Q00618_IntoTheFlame/31271-05.htm
===================================================================
--- game/data/scripts/quests/Q00618_IntoTheFlame/31271-05.htm (revision 0)
+++ game/data/scripts/quests/Q00618_IntoTheFlame/31271-05.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Blacksmith Hilda:<br>
+Where should I begin? First I must melt it in the furnace to separate the impurities and extract pure Vacualite. Then, once cooled... It's done!<br>
+Here it is! Take this Vacualite to<font color="LEVEL"> Klein</font>.
+</body></html>
\ No newline at end of file
Index: game/data/scripts/quests/Q00618_IntoTheFlame/31271-06.htm
===================================================================
--- game/data/scripts/quests/Q00618_IntoTheFlame/31271-06.htm (revision 0)
+++ game/data/scripts/quests/Q00618_IntoTheFlame/31271-06.htm (working copy)
@@ -0,0 +1,3 @@
+<html><body>Blacksmith Hilda:<br>
+Take the Vacualite to<font color="LEVEL"> Klein</font>.
+</body></html>
\ No newline at end of file
Index: game/data/scripts/quests/Q00618_IntoTheFlame/31540-01.htm
===================================================================
--- game/data/scripts/quests/Q00618_IntoTheFlame/31540-01.htm (revision 0)
+++ game/data/scripts/quests/Q00618_IntoTheFlame/31540-01.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Watcher of Valakas Klein:<br>
+Do you know what's behind this Hall of Flames? Not everyone can make it through. I don't think you're ready.<br>
+(Only characters of level 60 or above may undertake this quest.)
+</body></html>
\ No newline at end of file
Index: game/data/scripts/quests/Q00618_IntoTheFlame/31540-02.htm
===================================================================
--- game/data/scripts/quests/Q00618_IntoTheFlame/31540-02.htm (revision 0)
+++ game/data/scripts/quests/Q00618_IntoTheFlame/31540-02.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Watcher of Valakas Klein:<br>
+Do you know what's behind this Hall of Flames? Not everyone can make it through. You can't get there by foot, but I can tell you how.<br>
+<a action="bypass -h Quest Q00618_IntoTheFlame 31540-03.htm">Quest</a>
+</body></html>
\ No newline at end of file
Index: game/data/scripts/quests/Q00618_IntoTheFlame/31540-03.htm
===================================================================
--- game/data/scripts/quests/Q00618_IntoTheFlame/31540-03.htm (revision 0)
+++ game/data/scripts/quests/Q00618_IntoTheFlame/31540-03.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Watcher of Valakas Klein:<br>
+Meet<font color="LEVEL"> Blacksmith Hilda in Goddard Castle Town and bring me Vacualite</font>. If a magic power is infused in it, it can activate the magic. It's a very unique mineral, and can only be used once.<br>
+With it I can create a disposable<font color="LEVEL"> Floating Stone</font> to get through the Hall of Flames.
+</body></html>
\ No newline at end of file
Index: game/data/scripts/quests/Q00618_IntoTheFlame/31540-04.htm
===================================================================
--- game/data/scripts/quests/Q00618_IntoTheFlame/31540-04.htm (revision 0)
+++ game/data/scripts/quests/Q00618_IntoTheFlame/31540-04.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Watcher of Valakas Klein:<br>
+You brought some Vacualite! Now I can make a Floating Stone. Let me see it.<br>
+<a action="bypass -h Quest Q00618_IntoTheFlame 31540-05.htm">"Here it is."</a>
+</body></html>
\ No newline at end of file
Index: game/data/scripts/quests/Q00618_IntoTheFlame/31540-05.htm
===================================================================
--- game/data/scripts/quests/Q00618_IntoTheFlame/31540-05.htm (revision 0)
+++ game/data/scripts/quests/Q00618_IntoTheFlame/31540-05.htm (working copy)
@@ -0,0 +1,4 @@
+<html><body>Watcher of Valakas Klein:<br>
+You can defy gravity with this Floating Stone and travel with the wind.<br>
+You'll need it for the Hall of Flames.
+</body></html>
\ No newline at end of file
Index: game/data/scripts/quests/Q00618_IntoTheFlame/Q00618_IntoTheFlame.java
===================================================================
--- game/data/scripts/quests/Q00618_IntoTheFlame/Q00618_IntoTheFlame.java (revision 0)
+++ game/data/scripts/quests/Q00618_IntoTheFlame/Q00618_IntoTheFlame.java (working copy)
@@ -0,0 +1,186 @@
+/*
+ * Copyright (C) 2004-2013 L2J DataPack
+ *
+ * This file is part of L2J DataPack.
+ *
+ * L2J DataPack is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * L2J DataPack is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package quests.Q00618_IntoTheFlame;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.quest.Quest;
+import com.l2jserver.gameserver.model.quest.QuestState;
+
+/**
+ * Into The Flame (618)
+ * @author St3eT
+ */
+
+public class Q00618_IntoTheFlame extends Quest
+{
+ // NPC's
+ private static final int KLEIN = 31540;
+ private static final int HILDA = 31271;
+
+ private static final Map<Integer, Integer> MONSTERS = new HashMap<>();
+
+ static
+ {
+ MONSTERS.put(21274, 630);
+ MONSTERS.put(21276, 630);
+ MONSTERS.put(21282, 670);
+ MONSTERS.put(21283, 670);
+ MONSTERS.put(21284, 670);
+ MONSTERS.put(21290, 710);
+ MONSTERS.put(21291, 710);
+ MONSTERS.put(21292, 710);
+ }
+
+ // Item's
+ private static final int VACUALITE_ORE = 7265;
+ private static final int VACUALITE = 7266;
+ private static final int FLOATING_STONE = 7267;
+
+ @Override
+ public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+ {
+ final QuestState st = player.getQuestState(getName());
+ if (st == null)
+ {
+ return null;
+ }
+
+ switch (event)
+ {
+ case "31540-03.htm":
+ st.startQuest();
+ break;
+ case "31540-05.htm":
+ if (!st.hasQuestItems(VACUALITE))
+ {
+ return "31540-03.htm";
+ }
+ st.giveItems(FLOATING_STONE, 1);
+ st.exitQuest(true, true);
+ break;
+ case "31271-02.htm":
+ if (st.isCond(1))
+ {
+ st.setCond(2, true);
+ }
+ break;
+ case "31271-05.htm":
+ if ((st.getQuestItemsCount(VACUALITE_ORE) == 50) && (st.isCond(3)))
+ {
+ st.takeItems(VACUALITE_ORE, -1);
+ st.giveItems(VACUALITE, 1);
+ st.setCond(4, true);
+ }
+ else
+ {
+ return "31271-03.htm";
+ }
+ break;
+ }
+ return event;
+ }
+
+ @Override
+ public String onTalk(L2Npc npc, L2PcInstance player)
+ {
+ String htmltext = getNoQuestMsg(player);
+ final QuestState st = player.getQuestState(getName());
+
+ if (st == null)
+ {
+ return htmltext;
+ }
+
+ switch (npc.getNpcId())
+ {
+ case KLEIN:
+ if (st.isCreated())
+ {
+ htmltext = (player.getLevel() < 60) ? "31540-01.htm" : "31540-02.htm";
+ }
+ else if (st.isStarted())
+ {
+ htmltext = (st.isCond(4)) ? "31540-04.htm" : "31540-03.htm";
+ }
+ break;
+
+ case HILDA:
+ switch (st.getCond())
+ {
+ case 1:
+ htmltext = "31271-01.htm";
+ break;
+ case 2:
+ htmltext = "31271-03.htm";
+ break;
+ case 3:
+ htmltext = "31271-04.htm";
+ break;
+ case 4:
+ htmltext = "31271-06.htm";
+ break;
+ }
+ break;
+ }
+ return htmltext;
+ }
+
+ @Override
+ public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
+ {
+ final L2PcInstance member = getRandomPartyMember(player, "2");
+ if (member == null)
+ {
+ return super.onKill(npc, player, isPet);
+ }
+ final QuestState qs = member.getQuestState(getName());
+
+ if ((qs.getQuestItemsCount(VACUALITE_ORE) < 50) && (getRandom(1000) < MONSTERS.get(npc.getNpcId())))
+ {
+ qs.giveItems(VACUALITE_ORE, 1);
+ qs.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
+
+ if (qs.getQuestItemsCount(VACUALITE_ORE) >= 50)
+ {
+ qs.setCond(3, true);
+ }
+ }
+ return super.onKill(npc, player, isPet);
+ }
+
+ public Q00618_IntoTheFlame(int questId, String name, String descr)
+ {
+ super(questId, name, descr);
+ addStartNpc(KLEIN);
+ addTalkId(HILDA, KLEIN);
+ addKillId(MONSTERS.keySet());
+
+ registerQuestItems(VACUALITE_ORE, VACUALITE);
+ }
+
+ public static void main(String[] args)
+ {
+ new Q00618_IntoTheFlame(618, Q00618_IntoTheFlame.class.getSimpleName(), "Into the Flame");
+ }
+}
\ No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment