Browse Source

update for Quest Little Wings Adventure (strider quest)
removed some custom parts and replaced with proper one..now guides on net should be matching =)

Kerberos 16 years ago
parent
commit
8ea591aa81

+ 1 - 0
datapack_development/data/scripts.cfg

@@ -10,6 +10,7 @@
 ai/fantasy_isle/mc_show.py
 
 ai/group_template/chests.py
+ai/group_template/fairy_trees.py
 ai/group_template/feedable_beasts.py
 ai/group_template/polymorphing_angel.py
 

+ 42 - 0
datapack_development/data/scripts/ai/group_template/fairy_trees.py

@@ -0,0 +1,42 @@
+import sys
+
+from net.sf.l2j.gameserver.ai import CtrlIntention
+from net.sf.l2j.gameserver.datatables import SkillTable
+from net.sf.l2j.gameserver.model.quest import Quest as JQuest
+from net.sf.l2j.gameserver.serverpackets import NpcSay
+from net.sf.l2j.util import Rnd
+
+class trees(JQuest) :
+
+    def __init__(self,id,name,descr):
+        JQuest.__init__(self,id,name,descr)
+
+    def onAdvEvent (self,event,npc,pc) :
+        if npc:
+           npc.deleteMe()
+        return
+
+    def onKill (self,npc,player,isPet):
+        npcId = npc.getNpcId()
+        if npcId in range(27185,27189) :
+           for x in xrange(20):
+               newNpc = self.addSpawn(27189,npc)
+               killer = player
+               if isPet :
+                   killer = player.getPet()
+               newNpc.setRunning()
+               newNpc.addDamageHate(killer,0,999)
+               newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, killer)
+               self.startQuestTimer("despawn",300000, newNpc, None)
+               if Rnd.get(2) :
+                  skill = SkillTable.getInstance().getInfo(4243,1)
+                  if skill != None :
+                     skill.getEffects(newNpc, killer)
+        return 
+
+
+QUEST		= trees(-2,"fairy trees","ai")
+
+for i in range(27185,27189):
+    QUEST.addKillId(i)
+QUEST.addSpawnId(27189)

+ 23 - 37
datapack_development/data/scripts/quests/421_LittleWingAdventures/__init__.py

@@ -28,14 +28,6 @@ qston_1 = "<html><body>Sage Cronos:<br>So, you want to turn your hatchling into
 qston_2 = "<html><body>Sage Cronos:<br>I've said you need to talk to <font color=\"LEVEL\">Fairy Mimyu</font>!!!. Am i clear???</body></html>"
 qston_3 = "<html><body>Fairy Mimyu:<br>You weren't yet able to find the <font color=\"LEVEL\">Fairy Trees of Wind, Star, Twilight and Abyss</font>? Don't give up! They are all in <font color=\"LEVEL\">Hunter's Valley</font></body></html>"
 order_1 = "<html><body>Fairy Mimyu:<br>Your pet must drink the sap of <font color=\"LEVEL\">Fairy Trees of Wind, Star, Twilight and Abyss</font> to grow up. The trees will probably agree but as we don't want to hurt them, take that leafs to heal any wound your hatchling could cause them</body></html>"
-ftm_11  = "<html><body>Fairy Tree of Wind: <br>I'll let your hatchling drink from my sap, but you will have to cover the wound your pet will do on me with one of these leafs you have, they are hypoallergenic<br><br><a action=\"bypass -h Quest "+str(QUEST_NUMBER)+"_"+QUEST_NAME+" 1\">It's ok</a></body></html>"
-ftm_12  = "The hatchling has drunk the sap of the fairy tree of the wind."
-ftm_21  = "<html><body>Fairy Tree of Star: <br>Oh! One of those nasty ghosts hurted my bark... look! Only a fairy leaf could cure my wound... <br><br><a action=\"bypass -h Quest "+str(QUEST_NUMBER)+"_"+QUEST_NAME+" 2\">Give it a leaf</a></body></html>"
-ftm_22  = "The hatchling has drunk the sap of the fairy tree of the star."
-ftm_31  = "<html><body>Fairy Tree of Twilight: <br>Ok, i do know the way this is supposed to be, but we don't have the time to wait your hacthling to hit me for hours... Let's make it quick<br><br><a action=\"bypass -h Quest "+str(QUEST_NUMBER)+"_"+QUEST_NAME+" 4\">Fine, take the leaf</a></body></html>"
-ftm_32  = "The hatchling has drunk the sap of the fairy tree of the twilight."
-ftm_41  = "<html><body>Fairy Tree of Abyss: <br>That your pet will bite me and you gonna put a leaf in my wound? No way! No! Wait!... argh... if i could run like Black Willows do...<br><br><a action=\"bypass -h Quest "+str(QUEST_NUMBER)+"_"+QUEST_NAME+" 8\">Say sorry</a></body></html>"
-ftm_42  = "The hatchling has drunk the sap of the fairy tree of the abyss."
 end_msg = "<html><body>Fairy Mimyu:<br>Great job, your hatchling"
 end_msg2= "has become an strider, enjoy!</body></html>"
 
@@ -46,11 +38,7 @@ CONTROL_ITEMS = { 3500:4422, 3501:4423, 3502:4424 }
 #NPCs
 SG_CRONOS = 30610
 FY_MYMYU  = 30747
-#NpcId, bitmask, spawnX,spawnY,spawnZ,msg1,msg2
-FAIRY_TREES = [ [27185,1,113356,93848,-2072,ftm_11,ftm_12],
-                [27186,2,117733,94108,-2068,ftm_21,ftm_22],
-                [27187,4,127714,90495,-2095,ftm_31,ftm_32],
-                [27188,8,106671,93905,-2070,ftm_41,ftm_42] ]
+
 #Mobs
 GUARDIAN = 27189
 
@@ -58,6 +46,7 @@ import sys
 from net.sf.l2j.gameserver.model.quest import State
 from net.sf.l2j.gameserver.model.quest import QuestState
 from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
+from net.sf.l2j.gameserver.serverpackets import NpcSay
 
 def get_control_item(st) :
   item = st.getPlayer().getPet().getControlItemId()
@@ -82,20 +71,10 @@ class Quest (JQuest) :
  def __init__(self,id,name,descr):
    JQuest.__init__(self,id,name,descr)
    self.questItemIds = [FT_LEAF]
+   self.killedTrees = []
 
  def onEvent (self,event,st) :
     htmltext = event
-    leafs = st.getQuestItemsCount(FT_LEAF) 
-    for i in range(4) :
-       if event == str(FAIRY_TREES[i][1]) :
-           st.set("id", str(st.getInt("id") | FAIRY_TREES[i][1]))
-           htmltext = FAIRY_TREES[i][6]
-           st.takeItems(FT_LEAF,1)
-           if 1 < leafs <= 4 :
-              st.playSound("ItemSound.quest_itemget")
-           elif leafs == 1 and st.getInt("id") == 15:
-              st.playSound("ItemSound.quest_middle")
-              st.set("cond","3")
     if event == "16" :
        htmltext = event_1
        st.setState(State.STARTED)
@@ -157,19 +136,26 @@ class Quest (JQuest) :
         st.giveItems(item,1)
         st.exitQuest(1)
         st.playSound("ItemSound.quest_finish")
-   elif id == State.STARTED and cond < 3 :
-     leafs = st.getQuestItemsCount(FT_LEAF)
-     if 0 < leafs :
-        for i in range(4) :
-           if npcId == FAIRY_TREES[i][0] and (st.getInt("id") | FAIRY_TREES[i][1] != st.getInt("id")) :
-              for j in range(2):
-                 for k in range(2): 
-                    st.addSpawn(GUARDIAN,FAIRY_TREES[i][2]+70*pow(-1,j%2),FAIRY_TREES[i][3]+70*pow(-1,k%2),FAIRY_TREES[i][4])
-              htmltext = FAIRY_TREES[i][5]
    return htmltext
 
- def onKill(self,npc,player,isPet) :
-   return  
+ def onAttack(self, npc, player, damage, isPet) :
+   st = player.getQuestState(str(QUEST_NUMBER)+"_"+QUEST_NAME)
+   if not st:
+     return
+   npcId = npc.getNpcId()
+   for pc, mobId, in self.killedTrees:
+      if pc == player and mobId == npcId:
+         return
+   if isPet :
+      pet = player.getPet()
+      if st.getRandom(100) <= 2 and st.getQuestItemsCount(FT_LEAF) >= 0:
+         st.takeItems(FT_LEAF,1)
+         st.playSound("ItemSound.quest_middle")
+         npc.broadcastPacket(NpcSay(npc.getNpcId(),0,npcId,"gives me spirit leaf...!"))
+         self.killedTrees.append([player,npcId])
+         if st.getQuestItemsCount(FT_LEAF) == 0 :
+            st.set("cond","3")
+   return 
 
 # Quest class and state definition
 QUEST       = Quest(QUEST_NUMBER, str(QUEST_NUMBER)+"_"+QUEST_NAME, QUEST_DESCRIPTION)
@@ -181,5 +167,5 @@ QUEST.addTalkId(SG_CRONOS)
 
 QUEST.addTalkId(FY_MYMYU)
 
-for i in range(4) :
-  QUEST.addTalkId(FAIRY_TREES[i][0])
+for i in range(27185,27189):
+   QUEST.addAttackId(i)

+ 4 - 4
datapack_development/sql/npc.sql

@@ -4524,10 +4524,10 @@ INSERT INTO `npc` VALUES
 (27182, 27182, "Ark Guardian Elberoth", 0, "Quest Monster", 0, "Monster.archangel", 15, 80, 60, "male", "L2Monster", 40, 3054, 1150, 10.27, 2.45, 40, 43, 30, 21, 20, 10, 0, 0, 782, 405, 478, 299, 278, 0, 333, 6370, 0, 0, 55, 220, "NULL", 0, 0, 0, "LAST_HIT", 0, 0, 0, "fighter"),
 (27183, 27183, "Ark Guardian Shadowfang", 0, "Quest Monster", 0, "Monster.kel_mahum_archer", 13, 27, 60, "male", "L2Monster", 500, 3054, 1150, 10.27, 2.45, 40, 43, 30, 21, 20, 10, 0, 0, 2313, 259, 478, 299, 249, 0, 333, 288, 0, 0, 55, 176, "NULL", 0, 0, 0, "LAST_HIT", 0, 0, 0, "archer"),
 (27184, 27184, "Angel Killer", 0, "Quest Monster", 0, "Monster.death_lord", 21, 40, 60, "male", "L2Monster", 40, 3054, 1150, 92.43, 2.45, 40, 43, 30, 21, 20, 10, 0, 0, 711, 446, 478, 299, 278, 0, 333, 130, 0, 0, 44, 220, "NULL", 0, 1, 0, "LAST_HIT", 0, 0, 0, "balanced"),
-(27185, 27185, "Fairy Tree of Wind", 0, "Quest Monster", 0, "NPC.human_tree", 35, 90, 55, "etc", "L2Npc", 40, 2643, 987, 10.27, 2.45, 40, 43, 30, 21, 20, 10, 0, 0, 670, 273, 360, 261, 278, 0, 333, 0, 0, 0, 55, 0, "q421_tree_clan", 100, 0, 0, "LAST_HIT", 0, 0, 0, "fighter"),
-(27186, 27186, "Fairy Tree of Star", 0, "Quest Monster", 0, "NPC.human_tree", 35, 90, 55, "etc", "L2Npc", 40, 2643, 987, 10.27, 2.45, 40, 43, 30, 21, 20, 10, 0, 0, 554, 389, 360, 261, 278, 0, 333, 0, 0, 0, 55, 0, "q421_tree_clan", 100, 0, 0, "LAST_HIT", 0, 0, 0, "fighter"),
-(27187, 27187, "Fairy Tree of Twilight", 0, "Quest Monster", 0, "NPC.human_tree", 35, 90, 55, "etc", "L2Npc", 40, 2643, 987, 10.27, 2.45, 40, 43, 30, 21, 20, 10, 0, 0, 737, 292, 360, 261, 278, 0, 333, 0, 0, 0, 55, 0, "q421_tree_clan", 100, 0, 0, "LAST_HIT", 0, 0, 0, "fighter"),
-(27188, 27188, "Fairy Tree of Abyss", 0, "Quest Monster", 0, "NPC.human_tree", 35, 90, 55, "etc", "L2Npc", 40, 2643, 987, 10.27, 2.45, 40, 43, 30, 21, 20, 10, 0, 0, 670, 322, 360, 261, 278, 0, 333, 0, 0, 0, 55, 0, "q421_tree_clan", 100, 0, 0, "LAST_HIT", 0, 0, 0, "fighter"),
+(27185, 27185, "Fairy Tree of Wind", 0, "Quest Monster", 0, "NPC.human_tree", 35, 90, 55, "etc", "L2Monster", 0, 2643, 987, 10.27, 2.45, 40, 43, 30, 21, 20, 10, 0, 0, 0, 273, 0, 261, 278, 0, 333, 0, 0, 0, 0, 0, "q421_tree_clan", 100, 0, 0, "LAST_HIT", 0, 0, 0, "fighter"),
+(27186, 27186, "Fairy Tree of Star", 0, "Quest Monster", 0, "NPC.human_tree", 35, 90, 55, "etc", "L2Monster", 0, 2643, 987, 10.27, 2.45, 40, 43, 30, 21, 20, 10, 0, 0, 0, 389, 0, 261, 278, 0, 333, 0, 0, 0, 0, 0, "q421_tree_clan", 100, 0, 0, "LAST_HIT", 0, 0, 0, "fighter"),
+(27187, 27187, "Fairy Tree of Twilight", 0, "Quest Monster", 0, "NPC.human_tree", 35, 90, 55, "etc", "L2Monster", 0, 2643, 987, 10.27, 2.45, 40, 43, 30, 21, 20, 10, 0, 0, 0, 292, 0, 261, 278, 0, 333, 0, 0, 0, 0, 0, "q421_tree_clan", 100, 0, 0, "LAST_HIT", 0, 0, 0, "fighter"),
+(27188, 27188, "Fairy Tree of Abyss", 0, "Quest Monster", 0, "NPC.human_tree", 35, 90, 55, "etc", "L2Monster", 0, 2643, 987, 10.27, 2.45, 40, 43, 30, 21, 20, 10, 0, 0, 0, 322, 0, 261, 278, 0, 333, 0, 0, 0, 0, 0, "q421_tree_clan", 100, 0, 0, "LAST_HIT", 0, 0, 0, "fighter"),
 (27189, 27189, "Soul of Tree Guardian", 0, "Quest Monster", 0, "Monster.elf_ghost", 7, 21, 50, "male", "L2Monster", 40, 2245, 830, 4.35, 2.14, 40, 43, 30, 21, 20, 10, 0, 0, 509, 236, 264, 226, 278, 500, 333, 0, 0, 0, 88, 154, "q421_tree_clan", 100, 1, 0, "LAST_HIT", 0, 0, 0, "fighter"),
 (27190, 27190, "Ol Mahum Support Troop", 0, "Quest Monster", 0, "Monster.ol_mahum_champion", 14, 27, 26, "male", "L2Monster", 40, 770, 303, 5.53, 1.53, 40, 43, 30, 21, 20, 10, 0, 0, 96, 120, 41, 98, 278, 500, 333, 69, 0, 0, 55, 165, "orc_clan", 200, 0, 0, "LAST_HIT", 0, 0, 0, "fighter"),
 (27191, 27191, "Malcom", 0, "Quest Monster", 0, "Monster.grizzly", 21, 40, 25, "male", "L2Monster", 40, 728, 287, 5.53, 1.53, 40, 43, 30, 21, 20, 10, 0, 0, 103, 116, 37, 94, 237, 500, 333, 0, 0, 0, 44, 174, "NULL", 0, 0, 0, "LAST_HIT", 0, 0, 0, "fighter"),