Browse Source

Quest 406: fixes and further cleanup (tnx kmarty)

DrLecter 19 years ago
parent
commit
4e320f740b

+ 3 - 9
datapack_development/data/jscript/quests/406_PathToElvenKnight/7317-01.htm

@@ -1,10 +1,4 @@
-<html>
-<head>
-<body>
-Blacksmith Kluto:<br>
+<html><head><body>Blacksmith Kluto:<br>
 Oh ho, so you want to be an Elven Knight? Of course, I know how to make the brooch. However, nothing in this world is free ... If you want the Elven Knight brooch, you must first do me a service.<br>
-<a action="bypass -h Quest 406_PathToElvenKnight 406_2">Ask about the favor</a>
-
-
-</body>
-</html>
+<a action="bypass -h Quest 406_PathToElvenKnight 7317-02.htm">Ask about the favor</a>
+</body></html>

+ 2 - 8
datapack_development/data/jscript/quests/406_PathToElvenKnight/7317-02.htm

@@ -1,10 +1,4 @@
-<html>
-<head>
-<body>
-Blacksmith Kluto:<br>
+<html><head><body>Blacksmith Kluto:<br>
 East of here, there is a camp of the ol mahums. They are indeed ferocious scoundrels. Their trainees come out to the outskirts of the camp, and I want you to get rid of them. You need not know the reason.<br>
 There will be about twenty of them. Hmm ... I would have to know whether or not you really killed all twenty. If you bring me <font color="LEVEL">twenty of the jewels that the Ol mahums carry with them, I will accommodate you</font>. I'll give you this so you do not forget. Now, off you go!
-
-
-</body>
-</html>
+</body></html>

+ 2 - 8
datapack_development/data/jscript/quests/406_PathToElvenKnight/7317-03.htm

@@ -1,10 +1,4 @@
-<html>
-<head>
-<body>
-Blacksmith Kluto:<br>
+<html><head><body>Blacksmith Kluto:<br>
 Why have you returned so early? Were you afraid? They are only ol mahum rookies ... You are quite a timid fellow.<br>
 If I may give you a piece of advice, don't go deep into the camp. If the ol mahum come upon you in a group, with your skills you'd never be able to deal with them. Do you understand what I'm saying? Well, be off now!
-
-
-</body>
-</html>
+</body></html>

+ 2 - 8
datapack_development/data/jscript/quests/406_PathToElvenKnight/7317-04.htm

@@ -1,9 +1,3 @@
-<html>
-<head>
-<body>
-Blacksmith Kluto:<br>
+<html><head><body>Blacksmith Kluto:<br>
 Did I not tell you to bring twenty jewels? I cannot accommodate you even if you are only one short.
-
-
-</body>
-</html>
+</body></html>

+ 2 - 8
datapack_development/data/jscript/quests/406_PathToElvenKnight/7317-05.htm

@@ -1,11 +1,5 @@
-<html>
-<head>
-<body>
-Blacksmith Kluto:<br>
+<html><head><body>Blacksmith Kluto:<br>
 Amazing! To be frank, I wasn't expecting much out of you. Indeed, Master Sorius knows a good candidate. To tell the truth, bringing back the emeralds was also part of the test. Since Sorius saved my life long ago, I have been assisting him in testing young Elven Fighters. When we have some time, I will tell you how Sorius saved me from the Orcs.<br>
 Give me the topaz pieces and emerald pieces. These jewels will be used as materials to make the brooches for the next youngsters who qualify to become Elven Knights. Your brooch has already been made from the jewels collected by those that took the test before you.<br>
 Now take this box. In it is the completed Elven Knight brooch. Take this to <font color="LEVEL">Master Sorius</font> and he will conduct the official presentation. You have rightfully earned it.
-
-
-</body>
-</html>
+</body></html>

+ 2 - 8
datapack_development/data/jscript/quests/406_PathToElvenKnight/7317-06.htm

@@ -1,9 +1,3 @@
-<html>
-<head>
-<body>
-Blacksmith Kluto:<br>
+<html><head><body>Blacksmith Kluto:<br>
 Have you not gone yet? Aren't you eager to begin your career as an Elven Knight. Get along now to Master Sorius!
-
-
-</body>
-</html>
+</body></html>

+ 3 - 9
datapack_development/data/jscript/quests/406_PathToElvenKnight/7327-01.htm

@@ -1,10 +1,4 @@
-<html>
-<head>
-<body>
-Master Sorius:<br>
+<html><head><body>Master Sorius:<br>
 Greetings, child in search of the training of the sword. When I look at the new candidates like yourself that seek me, I am sure that the long tradition of our Elven race is being continued.<br>
-<a action="bypass -h Quest 406_PathToElvenKnight 406_1">Say you want to be an Elven Knight</a>
-
-
-</body>
-</html>
+<a action="bypass -h Quest 406_PathToElvenKnight 7327-05.htm">Say you want to be an Elven Knight</a>
+</body></html>

+ 2 - 8
datapack_development/data/jscript/quests/406_PathToElvenKnight/7327-02.htm

@@ -1,9 +1,3 @@
-<html>
-<head>
-<body>
-Sorius:<br>
+<html><head><body>Sorius:<br>
 Haven't you already chosen the path that you must take? Train yourself more before aspiring to a higher level.
-
-
-</body>
-</html>
+</body></html>

+ 2 - 8
datapack_development/data/jscript/quests/406_PathToElvenKnight/7327-02a.htm

@@ -1,9 +1,3 @@
-<html>
-<head>
-<body>
-Sorius:<br>
+<html><head><body>Sorius:<br>
 You are already walking the path of an Elven Knight. Train yourself more before proceeding to a higher level. May the starlight guide you.
-
-
-</body>
-</html>
+</body></html>

+ 2 - 8
datapack_development/data/jscript/quests/406_PathToElvenKnight/7327-03.htm

@@ -1,9 +1,3 @@
-<html>
-<head>
-<body>
-Master Sorius:<br>
+<html><head><body>Master Sorius:<br>
 However, you do not have enough experience. I feel that your movements and steps are not enough to study the skills of a higher level. Be patient and train yourself. Your eyes are filled with passion and faith. I will wait for that time.
-
-
-</body>
-</html>
+</body></html>

+ 2 - 8
datapack_development/data/jscript/quests/406_PathToElvenKnight/7327-04.htm

@@ -1,9 +1,3 @@
-<html>
-<head>
-<body>
-Master Sorius:<br>
+<html><head><body>Master Sorius:<br>
 I see you have the <font color="LEVEL">Elven Knight brooch</font>. Take the brooch and go to <font color="LEVEL">Grand Master Ramos</font>. Then he will change your profession to Elven Knight.
-
-
-</body>
-</html>
+</body></html>

+ 3 - 9
datapack_development/data/jscript/quests/406_PathToElvenKnight/7327-05.htm

@@ -1,11 +1,5 @@
-<html>
-<head>
-<body>
-Master Sorius:<br>
+<html><head><body>Master Sorius:<br>
 Elven Knights choose the path of the sword over archery, both of which were developed by our race for thousands of years. These days, many Elven Knights enter the Human world to practice the will of Einhasad and Eva, even though they were originally created to protect the Mother Trees from invaders.<br>
 We must test your skills to see if you have what it takes to become an Elven Knight. This is a test to judge your skills, but I am sure one of your level will pass with no particular difficulties. What do you say? Will you assume the challenge of the test?<br>
-<a action="bypass -h Quest 406_PathToElvenKnight 1">Challenge the test</a>
-
-
-</body>
-</html>
+<a action="bypass -h Quest 406_PathToElvenKnight 7327-06.htm">Challenge the test</a>
+</body></html>

+ 2 - 8
datapack_development/data/jscript/quests/406_PathToElvenKnight/7327-08.htm

@@ -1,9 +1,3 @@
-<html>
-<head>
-<body>
-Master Sorius:<br>
+<html><head><body>Master Sorius:<br>
 It is still not enough. You must have <font color="LEVEL">20 topaz pieces</font>. May the divine blessing of Einhasad and Eva be with you.
-
-
-</body>
-</html>
+</body></html>

+ 2 - 9
datapack_development/data/jscript/quests/406_PathToElvenKnight/7327-09.htm

@@ -1,11 +1,4 @@
-<html>
-<head>
-<body>
-Master Sorius:<br>
+<html><head><body>Master Sorius:<br>
 Congratulations. You have safely completed the test. The topaz that you brought will be used to make the Elven Knight brooch, symbol of the Elven Knights. With this, you can prove your skills openly to the grandmaster.<br>
 However, the topaz piece is not enough to complete the Elven Knight brooch. Take this letter and go to <font color="LEVEL">Blacksmith Kluto of the village of Gludin</font>. He will tell you how to make these jewels into an Elven Knight brooch. If you don't know how to go to Gludin, ask Guard Praga.<br>
-
-
-
-</body>
-</html>
+</body></html>

+ 2 - 8
datapack_development/data/jscript/quests/406_PathToElvenKnight/7327-10.htm

@@ -1,10 +1,4 @@
-<html>
-<head>
-<body>
-Master Sorius:<br>
+<html><head><body>Master Sorius:<br>
 I see you have safely passed Kluto's test. Congratulations. You have proved through this test that you have the ability to not be timid, but to show the courage of an Elven Knight. This brooch is made of materials collected by other Elves who have gone through the Test of the Elven Knight before you. Thus, we are continuing the brilliant tradition of the Elven race in the circle of fate where we receive from our ancestors and pass on to our future generations.<br>
 You can change your profession to Elven Knight when you give this brooch to <font color="LEVEL">Grand Master Rains</font> of the Fighters Guild. Well then, until the next time we meet, may the protection of Eva be with you!
-
-
-</body>
-</html>
+</body></html>

+ 2 - 8
datapack_development/data/jscript/quests/406_PathToElvenKnight/7327-11.htm

@@ -1,9 +1,3 @@
-<html>
-<head>
-<body>
-Master Sorius:<br>
+<html><head><body>Master Sorius:<br>
 You haven't found Kluto yet? You can meet Kluto at the blacksmith's shop in Gludin. If you don't know how to get to Gludin, ask Guard Praga.
-
-
-</body>
-</html>
+</body></html>

+ 76 - 75
datapack_development/data/jscript/quests/406_PathToElvenKnight/__init__.py

@@ -1,4 +1,4 @@
-# Made by Mr. Have fun! Version 0.2
+# Made by Mr. - Version 0.3 by kmarty and DrLecter
 import sys
 from net.sf.l2j.gameserver.model.quest import State
 from net.sf.l2j.gameserver.model.quest import QuestState
@@ -10,6 +10,8 @@ ELVEN_KNIGHT_BROOCH_ID = 1204
 TOPAZ_PIECE_ID = 1205
 EMERALD_PIECE_ID = 1206
 KLUTO_MEMO_ID = 1276
+#messages
+default="<html><head><body>I have nothing to say you</body></html>"
 
 class Quest (JQuest) :
 
@@ -17,88 +19,92 @@ class Quest (JQuest) :
 
  def onEvent (self,event,st) :
     htmltext = event
-    if event == "406_1" :
-          if st.getPlayer().getClassId().getId() != 0x12 :
-            if st.getPlayer().getClassId().getId() == 0x13 :
-              htmltext = "7327-02a.htm"
-            else:
-              htmltext = "7327-02.htm"
-              st.exitQuest(1)
+    if event == "7327-05.htm" :
+       if st.getPlayer().getClassId().getId() != 0x12 :
+          if st.getPlayer().getClassId().getId() == 0x13 :
+             htmltext = "7327-02a.htm"
           else:
-            if st.getPlayer().getLevel()<19 :
-              htmltext = "7327-03.htm"
-              st.exitQuest(1)
-            else:
-              if st.getQuestItemsCount(ELVEN_KNIGHT_BROOCH_ID) :
+             htmltext = "7327-02.htm"
+             st.exitQuest(1)
+       else:
+          if st.getPlayer().getLevel()<19 :
+             htmltext = "7327-03.htm"
+             st.exitQuest(1)
+          else:
+             if st.getQuestItemsCount(ELVEN_KNIGHT_BROOCH_ID) :
                 htmltext = "7327-04.htm"
-              else:
-                htmltext = "7327-05.htm"
-    elif event == "1" :
-        st.set("cond","1")
-        st.setState(STARTED)
-        st.playSound("ItemSound.quest_accept")
-        htmltext = "7327-06.htm"
-    elif event == "406_2" :
-          if int(st.get("cond")) != 0 :
-            st.takeItems(SORIUS_LETTER1_ID,st.getQuestItemsCount(SORIUS_LETTER1_ID))
-            if st.getQuestItemsCount(KLUTO_MEMO_ID) == 0 :
-              st.giveItems(KLUTO_MEMO_ID,1)
-              st.set("cond","4")
-              htmltext = "7317-02.htm"
+    elif event == "7327-06.htm" :
+       st.set("cond","1")
+       st.setState(STARTED)
+       st.playSound("ItemSound.quest_accept")
+    elif event == "7317-02.htm" :
+       if int(st.get("cond")) == 3 :
+          st.takeItems(SORIUS_LETTER1_ID,-1)
+          if st.getQuestItemsCount(KLUTO_MEMO_ID) == 0 :
+             st.giveItems(KLUTO_MEMO_ID,1)
+             st.set("cond","4")
+          else :
+             htmltext = default
+       else :
+          htmltext = default
     return htmltext
 
-
  def onTalk (Self,npc,st):
    npcId = npc.getNpcId()
-   htmltext = "<html><head><body>I have nothing to say you</body></html>"
+   htmltext = default
    id = st.getState()
    if id == CREATED :
      st.set("cond","0")
-   if npcId == 7327 and int(st.get("cond"))==0 :
-        htmltext = "7327-01.htm"
-   elif npcId == 7327 and int(st.get("cond"))!=0 and st.getQuestItemsCount(KLUTO_BOX_ID)==0 and st.getQuestItemsCount(TOPAZ_PIECE_ID)==0 :
-        htmltext = "7327-07.htm"
-   elif npcId == 7327 and int(st.get("cond"))!=0 and st.getQuestItemsCount(KLUTO_BOX_ID)==0 and st.getQuestItemsCount(TOPAZ_PIECE_ID)>0 and st.getQuestItemsCount(TOPAZ_PIECE_ID)<19 :
-        htmltext = "7327-08.htm"
-   elif npcId == 7327 and int(st.get("cond"))!=0 and st.getQuestItemsCount(KLUTO_BOX_ID)==0 and st.getQuestItemsCount(TOPAZ_PIECE_ID)>=19 and st.getQuestItemsCount(SORIUS_LETTER1_ID)==0 and st.getQuestItemsCount(KLUTO_MEMO_ID)==0 :
-        if st.getQuestItemsCount(SORIUS_LETTER1_ID) == 0 :
-          st.giveItems(SORIUS_LETTER1_ID,1)
-          st.set("cond","3")
-        htmltext = "7327-09.htm"
-   elif npcId == 7327 and int(st.get("cond"))!=0 and st.getQuestItemsCount(KLUTO_BOX_ID)==0 and st.getQuestItemsCount(TOPAZ_PIECE_ID)>=19 and st.getQuestItemsCount(SORIUS_LETTER1_ID)!=0 :
-        htmltext = "7327-11.htm"
-   elif npcId == 7327 and int(st.get("cond"))!=0 and st.getQuestItemsCount(KLUTO_BOX_ID)==0 and st.getQuestItemsCount(TOPAZ_PIECE_ID)>=19 and st.getQuestItemsCount(KLUTO_MEMO_ID)!=0 :
-        htmltext = "7327-11.htm"
-   elif npcId == 7317 and int(st.get("cond"))!=0 and st.getQuestItemsCount(KLUTO_BOX_ID)==0 and st.getQuestItemsCount(TOPAZ_PIECE_ID)>=20 and st.getQuestItemsCount(SORIUS_LETTER1_ID)!=0 :
-        htmltext = "7317-01.htm"
-   elif npcId == 7317 and int(st.get("cond"))!=0 and st.getQuestItemsCount(KLUTO_BOX_ID)==0 and st.getQuestItemsCount(TOPAZ_PIECE_ID)>=20 and st.getQuestItemsCount(KLUTO_MEMO_ID)!=0 and st.getQuestItemsCount(EMERALD_PIECE_ID)==0 :
-        htmltext = "7317-03.htm"
-   elif npcId == 7317 and int(st.get("cond"))!=0 and st.getQuestItemsCount(KLUTO_BOX_ID)==0 and st.getQuestItemsCount(TOPAZ_PIECE_ID)>=20 and st.getQuestItemsCount(KLUTO_MEMO_ID)!=0 and st.getQuestItemsCount(EMERALD_PIECE_ID)>0 and st.getQuestItemsCount(EMERALD_PIECE_ID)<20 :
-        htmltext = "7317-04.htm"
-   elif npcId == 7317 and int(st.get("cond"))!=0 and st.getQuestItemsCount(KLUTO_BOX_ID)==0 and st.getQuestItemsCount(TOPAZ_PIECE_ID)>=20 and st.getQuestItemsCount(KLUTO_MEMO_ID)!=0 and st.getQuestItemsCount(EMERALD_PIECE_ID)>=20 :
-        st.takeItems(EMERALD_PIECE_ID,st.getQuestItemsCount(EMERALD_PIECE_ID))
-        st.takeItems(TOPAZ_PIECE_ID,st.getQuestItemsCount(TOPAZ_PIECE_ID))
-        if st.getQuestItemsCount(KLUTO_BOX_ID) == 0 :
-          st.giveItems(KLUTO_BOX_ID,1)
-          st.takeItems(KLUTO_MEMO_ID,1)
-          st.set("cond","6")
-        htmltext = "7317-05.htm"
-   elif npcId == 7317 and int(st.get("cond"))!=0 and st.getQuestItemsCount(KLUTO_BOX_ID)!=0 :
-        htmltext = "7317-06.htm"
-   elif npcId == 7327 and int(st.get("cond"))!=0 and st.getQuestItemsCount(KLUTO_BOX_ID)!=0 :
-        st.takeItems(KLUTO_BOX_ID,st.getQuestItemsCount(KLUTO_BOX_ID))
-        st.set("cond","0")
-        st.setState(COMPLETED)
-        st.playSound("ItemSound.quest_finish")
-        if st.getQuestItemsCount(ELVEN_KNIGHT_BROOCH_ID) == 0 :
-          st.giveItems(ELVEN_KNIGHT_BROOCH_ID,1)
-        htmltext = "7327-10.htm"
+     cond=0
+   else :
+     cond=int(st.get("cond"))
+   if npcId == 7327 :
+        if cond == 0 :
+            htmltext = "7327-01.htm"
+        elif cond == 1 :
+            if st.getQuestItemsCount(TOPAZ_PIECE_ID)==0 :
+              htmltext = "7327-07.htm"
+            else:
+              htmltext = "7327-08.htm"
+        elif cond == 2 :
+            if st.getQuestItemsCount(SORIUS_LETTER1_ID) == 0 :
+              st.giveItems(SORIUS_LETTER1_ID,1)
+            st.set("cond","3")
+            htmltext = "7327-09.htm"
+        elif cond in [3, 4, 5] :
+            htmltext = "7327-11.htm"
+        elif cond == 6 :
+            st.takeItems(KLUTO_BOX_ID,-1)
+            st.set("cond","0")
+            st.setState(COMPLETED)
+            st.playSound("ItemSound.quest_finish")
+            if st.getQuestItemsCount(ELVEN_KNIGHT_BROOCH_ID) == 0 :
+              st.giveItems(ELVEN_KNIGHT_BROOCH_ID,1)
+            htmltext = "7327-10.htm"
+   elif npcId == 7317 :
+        if cond == 3 :
+            htmltext = "7317-01.htm"
+        elif  cond == 4 :
+            if st.getQuestItemsCount(EMERALD_PIECE_ID)==0 :
+              htmltext = "7317-03.htm"
+            else:
+              htmltext = "7317-04.htm"
+        elif cond == 5 :
+            st.takeItems(EMERALD_PIECE_ID,-1)
+            st.takeItems(TOPAZ_PIECE_ID,-1)
+            if st.getQuestItemsCount(KLUTO_BOX_ID) == 0 :
+              st.giveItems(KLUTO_BOX_ID,1)
+            st.takeItems(KLUTO_MEMO_ID,-1)
+            st.set("cond","6")
+            htmltext = "7317-05.htm"
+        elif cond == 6 :
+            htmltext = "7317-06.htm"
    return htmltext
 
  def onKill (self,npc,st):
    npcId = npc.getNpcId()
    if npcId != 782 :
-        if int(st.get("cond")) and st.getQuestItemsCount(KLUTO_BOX_ID) == 0 and st.getQuestItemsCount(TOPAZ_PIECE_ID)<20 and st.getRandom(100)<70 :
+        if int(st.get("cond"))==1 and st.getQuestItemsCount(TOPAZ_PIECE_ID)<20 and st.getRandom(100)<70 :
             st.giveItems(TOPAZ_PIECE_ID,1)
             if st.getQuestItemsCount(TOPAZ_PIECE_ID) == 20 :
               st.playSound("ItemSound.quest_middle")
@@ -106,7 +112,7 @@ class Quest (JQuest) :
             else:
               st.playSound("ItemSound.quest_itemget")
    else :
-        if int(st.get("cond")) and st.getQuestItemsCount(KLUTO_MEMO_ID) and st.getQuestItemsCount(EMERALD_PIECE_ID)<20 and st.getRandom(100)<50 :
+        if int(st.get("cond"))==4 and st.getQuestItemsCount(EMERALD_PIECE_ID)<20 and st.getRandom(100)<50 :
             st.giveItems(EMERALD_PIECE_ID,1)
             if st.getQuestItemsCount(EMERALD_PIECE_ID) == 20 :
               st.playSound("ItemSound.quest_middle")
@@ -143,11 +149,6 @@ STARTED.addKillId(782)
 STARTED.addQuestDrop(7327,SORIUS_LETTER1_ID,1)
 STARTED.addQuestDrop(782,EMERALD_PIECE_ID,1)
 STARTED.addQuestDrop(54,TOPAZ_PIECE_ID,1)
-STARTED.addQuestDrop(60,TOPAZ_PIECE_ID,1)
-STARTED.addQuestDrop(35,TOPAZ_PIECE_ID,1)
-STARTED.addQuestDrop(42,TOPAZ_PIECE_ID,1)
-STARTED.addQuestDrop(51,TOPAZ_PIECE_ID,1)
-STARTED.addQuestDrop(45,TOPAZ_PIECE_ID,1)
 STARTED.addQuestDrop(7317,KLUTO_MEMO_ID,1)
 STARTED.addQuestDrop(7317,KLUTO_BOX_ID,1)