Ver código fonte

JYTHON: Fixes and cleanups for Kerb's latest bouts of quests. Plus a small cleanup in 501.

Emperorc 17 anos atrás
pai
commit
28a04612f9

+ 1 - 1
datapack_development/data/scripts/quests/135_TempleExecutor/30291-06.htm

@@ -1,5 +1,5 @@
 <html><body>Alex:<br>
-Hunt the <font color="LEVEL">Delu Lizardman Suppliers, Special Agents, Commanders, Shaman and Cursed Seers</font>.  After you have collected all of the items, you should let Warehouse Keeper Sonin and Grocer Pano know that you have recovered their items. Then take the <br>
+Hunt the <font color="LEVEL">Delu Lizardman Suppliers, Special Agents, Commanders, Shaman and Cursed Seers</font>.  After you have collected all of the items, you should let Warehouse Keeper Sonin and Grocer Pano know that you have recovered their items. Then take the 
 <font color="LEVEL">10 Stolen Cargo items</font> to Sonin and<br1>take the <font color="LEVEL">10 Hate Crystals</font> to Pano.<br1>
 After you have received reference letters written by Sonin and Pano, bring the <font color="LEVEL">10 Old Treasure Maps</font> to me.<br>
 Please do not delay!

+ 2 - 3
datapack_development/data/scripts/quests/138_TempleChampionPart2/__init__.py

@@ -148,9 +148,8 @@ class Quest (JQuest) :
       st = self.newQuestState(player)
    qs = st.getPlayer().getQuestState("137_TempleChampionPart1")
    if qs :
-      if qs.getState() == State.COMPLETED :
-         if st.getState() == State.CREATED :
-            st.setState(State.STARTED)
+      if qs.getState() == State.COMPLETED and st.getState() == State.CREATED :
+          st.setState(State.STARTED)
    npc.showChatWindow(player)
    return
 

+ 5 - 6
datapack_development/data/scripts/quests/139_ShadowFoxPart1/__init__.py

@@ -68,11 +68,11 @@ class Quest (JQuest) :
           htmltext = "30896-03.htm"
        elif cond == 2 :
           if st.getQuestItemsCount(FRAGMENT) >= 10 and st.getQuestItemsCount(CHEST) >= 1:
-             htmltext = "31418-13.htm"
+             htmltext = "30896-13.htm"
           elif st.getInt("talk"):
-             htmltext = "31418-14.htm"
+             htmltext = "30896-14.htm"
           else:
-             htmltext = "31418-12.htm"
+             htmltext = "30896-12.htm"
     return htmltext
 
  def onKill(self,npc,player,isPet):
@@ -92,9 +92,8 @@ class Quest (JQuest) :
       st = self.newQuestState(player)
    qs = st.getPlayer().getQuestState("138_TempleChampionPart2")
    if qs :
-      if qs.getState() == State.COMPLETED :
-         if st.getState() == State.CREATED :
-            st.setState(State.STARTED)
+      if qs.getState() == State.COMPLETED and st.getState() == State.CREATED :
+          st.setState(State.STARTED)
    npc.showChatWindow(player)
    return
 

+ 2 - 3
datapack_development/data/scripts/quests/140_ShadowFoxPart2/__init__.py

@@ -117,9 +117,8 @@ class Quest (JQuest) :
       st = self.newQuestState(player)
    qs = st.getPlayer().getQuestState("139_ShadowFoxPart1")
    if qs :
-      if qs.getState() == State.COMPLETED :
-         if st.getState() == State.CREATED :
-            st.setState(State.STARTED)
+      if qs.getState() == State.COMPLETED and st.getState() == State.CREATED :
+          st.setState(State.STARTED)
    npc.showChatWindow(player)
    return
 

+ 1 - 1
datapack_development/data/scripts/quests/141_ShadowFoxPart3/30894-18.htm

@@ -2,5 +2,5 @@
 Yes... Peace can be achieved through both centralized authority and the harmony of diversity...<br>
 However, history shows that words like "order" and "peace" can be used to justify tyranny.<br>
 On the other hand, words like "harmony" and "diversity" may only be ideals impossible to achieve in reality...<br>
-<a action="bypass -h Quest 998_FallenAngelSelect 30894-01.htm">"I will make my decision now."</a>
+<a action="bypass -h npc_%objectId%_Quest 998_FallenAngelSelect">"I will make my decision now."</a>
 </body></html>

+ 2 - 1
datapack_development/data/scripts/quests/141_ShadowFoxPart3/__init__.py

@@ -42,7 +42,8 @@ class Quest (JQuest) :
        st.playSound("ItemSound.quest_finish")
        st.exitQuest(False)
        st.giveItems(57, 88888)
-       if st.getPlayer().getLevel() >= 37 and st.getPlayer().getLevel() <= 42:
+       player = st.getPlayer()
+       if player.getLevel() >= 37 and player.getLevel() <= 42:
           st.addExpAndSp(278005,17058)
        qs = player.getQuestState("998_FallenAngelSelect")
        if not qs:

+ 4 - 4
datapack_development/data/scripts/quests/142_FallenAngelRequestOfDawn/__init__.py

@@ -30,7 +30,7 @@ class Quest (JQuest) :
     self.questItemIds = [CRYPT,FRAGMENT,BLOOD]
 
  def onAdvEvent (self,event,npc,player) :
-    st = player.getQuestState(self.qn)
+    st = player.getQuestState(qn)
     if not st: return
     htmltext = event
     if event == "30894-01.htm" :
@@ -115,9 +115,9 @@ class Quest (JQuest) :
        st.playSound("ItemSound.quest_middle")
        st.giveItems(BLOOD, 1)
        self.isAngelSpawned = 0
-    elif st.getInt("cond")==4 and st.getRandom(100) <= 20 and st.getQuestItemsCount(REPORT)<30:
-       st.giveItems(REPORT,1)
-       if st.getQuestItemsCount(REPORT)>=30:
+    elif st.getInt("cond")==4 and st.getRandom(100) <= 20 and st.getQuestItemsCount(FRAGMENT)<30:
+       st.giveItems(FRAGMENT,1)
+       if st.getQuestItemsCount(FRAGMENT)>=30:
           st.set("cond","5")
           st.playSound("ItemSound.quest_middle")
        else:

+ 1 - 1
datapack_development/data/scripts/quests/501_ProofOfClanAlliance/__init__.py

@@ -208,7 +208,7 @@ class Quest (JQuest) :
                st.takeItems(VOUCHER_OF_FAITH,1)
                st.giveItems(PROOF_OF_ALLIANCE,1)
                st.addExpAndSp(0,120000)
-               st.setState(State.COMPLETED)
+               st.exitQuest(False)
                htmltext = "09"
    elif npcId == WITCH_KALIS :
        if id == State.CREATED : #not a valid leader (has not started the quest yet) or a clan member

+ 4 - 4
datapack_development/data/scripts/quests/998_FallenAngelSelect/__init__.py

@@ -19,17 +19,17 @@ class Quest (JQuest) :
     if event == "dawn" :
        q1 = QuestManager.getInstance().getQuest("142_FallenAngelRequestOfDawn")
        if q1 :
-          qs1 = q1.newQuestState(player)
+          qs1 = q1.newQuestState(st.getPlayer())
           qs1.setState(State.STARTED)
-          q1.onEvent(q1, "30894-01.htm", qs1)
+          q1.notifyEvent("30894-01.htm",None,st.getPlayer())
           st.setState(State.COMPLETED)
        return
     elif event == "dusk" :
        q2 = QuestManager.getInstance().getQuest("143_FallenAngelRequestOfDusk")
        if q2 :
-          qs2 = q2.newQuestState(player)
+          qs2 = q2.newQuestState(st.getPlayer())
           qs2.setState(State.STARTED)
-          q2.onEvent(q2, "30894-01.htm", qs2)
+          q2.notifyEvent("30894-01.htm",None,st.getPlayer())
           st.setState(State.COMPLETED)
        return
     return event