JachuPL

hunting_v3_eng.quest

Aug 21st, 2014
1,172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.87 KB | None | 0 0
  1. quest hunting begin
  2. state start begin
  3. function setting()
  4. return {
  5. ["hTytul"] = "Hunting",
  6. ["hOpis1"] = "Go hunt, to gain experience in merciless",
  7. ["hOpis2"] = "killing as merciless monsters!",
  8. ["hOpis3"] = "On each character level you can pick one of ",
  9. ["hOpis4"] = "four monsters to kill.",
  10. ["hOpis5"] = "There is a reward. Hurry.",
  11. ["hOpis6"] = "Go to Yang-Shin, to hunt!",
  12. ["hDisc1"] = "Yang-Shin sent you for hunting.[ENTER]Your target is:",
  13. ["hDisc2a"] = "Still, You have to kill",
  14. ["hDisc2b"] = "[ENTER]of them.",
  15. ["hDisc3"] = "By now, you have killed",
  16. ["hNagTytul"] = "Reward",
  17. ["hNagOpis1"] = "Go back to Yang-Shin and report to him.",
  18. ["hNagOpis2"] = "You will be rewarded for your courage.",
  19. ["hNag1"] = "You can pick one of them. Think about it,",
  20. ["hNag2"] = "Choose wisely",
  21. ["hYouCant1"] = "I can't give you another mission! You need to train first.",
  22. ["hYouCant2"] = "Please come back when you level up.",
  23. ["hNoMission1"] = "Unfortunately, I have no mission for you.",
  24. ["hNoMission2"] = "Please come back when you get stronger.",
  25.  
  26. --[[ W tej tablicy przechowywane są odpowiednio
  27. [poziom] = {id 1 moba, ilość, id 2 moba, ilość, id 3 moba, ilość, id 4 moba, ilość, id nagrody 1, ilość, id nagrody 2, ilość, yang za misję, exp za misję}, ]]--
  28. ["hMobSetTable"] =
  29. {
  30. --[idx] = {id1, count1, id2, count2, id3, count3, id4, count4, reward_id1, count_reward1, reward_id2, count_reward2, yang, exp},
  31. [1] = {101, 10, 171, 10, 102, 7, 103, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 1500, ["EXP"] = 500},
  32. [2] = {102, 10, 172, 10, 103, 7, 104, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 2500, ["EXP"] = 1000},
  33. [3] = {103, 10, 173, 10, 104, 7, 105, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 3500, ["EXP"] = 1500},
  34. [4] = {104, 10, 174, 10, 105, 7, 106, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 4500, ["EXP"] = 2000},
  35. [5] = {105, 10, 175, 10, 106, 7, 107, 5, ["ID_R1"] = 8001, ["C_R1"] = 100, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 5500, ["EXP"] = 2500},
  36. [6] = {106, 10, 176, 10, 107, 7, 108, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 6500, ["EXP"] = 3000},
  37. [7] = {107, 10, 177, 10, 108, 7, 109, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 7500, ["EXP"] = 3500},
  38. [8] = {108, 10, 178, 10, 109, 7, 110, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 8500, ["EXP"] = 4000},
  39. [9] = {109, 10, 179, 10, 110, 7, 111, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 9500, ["EXP"] = 4500},
  40. [10] = {110, 10, 180, 10, 111, 7, 112, 5, ["ID_R1"] = 8001, ["C_R1"] = 100, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 10500, ["EXP"] = 5000},
  41. [11] = {111, 10, 181, 10, 112, 7, 113, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 11500, ["EXP"] = 6000},
  42. [12] = {112, 10, 182, 10, 113, 7, 114, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 12500, ["EXP"] = 6500},
  43. [13] = {113, 10, 183, 10, 114, 7, 115, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 13500, ["EXP"] = 7000},
  44. [14] = {114, 10, 184, 10, 115, 7, 131, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 14500, ["EXP"] = 7500},
  45. [15] = {115, 10, 185, 10, 131, 7, 132, 5, ["ID_R1"] = 8001, ["C_R1"] = 100, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 15500, ["EXP"] = 8000},
  46. [16] = {131, 10, 132, 10, 133, 7, 134, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 16500, ["EXP"] = 8500},
  47. [17] = {132, 10, 133, 10, 134, 7, 135, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 17500, ["EXP"] = 9000},
  48. [18] = {133, 10, 134, 10, 135, 7, 136, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 18500, ["EXP"] = 9500},
  49. [19] = {134, 10, 135, 10, 136, 7, 137, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 19500, ["EXP"] = 10000},
  50. [20] = {135, 10, 136, 10, 137, 7, 138, 5, ["ID_R1"] = 8001, ["C_R1"] = 100, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 20500, ["EXP"] = 10500},
  51. [21] = {301, 10, 351, 10, 303, 7, 304, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 1500, ["EXP"] = 500},
  52. [22] = {302, 10, 352, 10, 304, 7, 353, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 2500, ["EXP"] = 1000},
  53. [23] = {303, 10, 353, 10, 354, 7, 331, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 3500, ["EXP"] = 1500},
  54. [24] = {391, 10, 392, 10, 393, 10, 394, 10, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 4500, ["EXP"] = 2000},
  55. [25] = {191, 5, 192, 5, 193, 5, 194, 5, ["ID_R1"] = 8001, ["C_R1"] = 100, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 5500, ["EXP"] = 2500},
  56. [26] = {395, 10, 396, 10, 396, 10, 398, 10, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 6500, ["EXP"] = 3000},
  57. [27] = {401, 10, 402, 10, 403, 7, 404, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 7500, ["EXP"] = 3500},
  58. [28] = {402, 10, 403, 10, 404, 7, 405, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 8500, ["EXP"] = 4000},
  59. [29] = {403, 10, 404, 10, 405, 7, 406, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 9500, ["EXP"] = 4500},
  60. [30] = {404, 10, 405, 10, 406, 7, 431, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 40500, ["EXP"] = 5000},
  61. [31] = {405, 10, 406, 10, 431, 7, 432, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 11500, ["EXP"] = 6000},
  62. [32] = {406, 10, 431, 10, 432, 7, 433, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 12500, ["EXP"] = 6500},
  63. [33] = {431, 10, 432, 10, 433, 7, 434, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 13500, ["EXP"] = 7000},
  64. [34] = {432, 10, 433, 10, 434, 7, 435, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 14500, ["EXP"] = 7500},
  65. [35] = {433, 10, 434, 10, 435, 7, 436, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 15500, ["EXP"] = 8000},
  66. [36] = {434, 10, 435, 10, 436, 7, 451, 5, ["ID_R1"] = 71001, ["C_R1"] = 5, ["ID_R2"] = 71095, ["C_R2"] = 1, ["YANG"] = 16500, ["EXP"] = 8500},
  67. [37] = {435, 10, 436, 10, 451, 7, 452, 5, ["ID_R1"] = 71084, ["C_R1"] = 3, ["ID_R2"] = 72702, ["C_R2"] = 1, ["YANG"] = 17500, ["EXP"] = 9000},
  68. [38] = {436, 10, 451, 10, 452, 7, 453, 5, ["ID_R1"] = 71085, ["C_R1"] = 2, ["ID_R2"] = 7005, ["C_R2"] = 1, ["YANG"] = 18500, ["EXP"] = 9500},
  69. [39] = {451, 10, 452, 10, 453, 7, 454, 5, ["ID_R1"] = 90001, ["C_R1"] = 8, ["ID_R2"] = 15, ["C_R2"] = 1, ["YANG"] = 19500, ["EXP"] = 40000},
  70. [40] = {452, 10, 453, 10, 454, 20, 455, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13004, ["C_R2"] = 1, ["YANG"] = 20500, ["EXP"] = 40500},
  71. [41] = {531, 10, 532, 10, 533, 20, 534, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13023, ["C_R2"] = 1, ["YANG"] = 22500, ["EXP"] = 41500},
  72. [42] = {631, 10, 632, 10, 633, 20, 634, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13042, ["C_R2"] = 1, ["YANG"] = 25000, ["EXP"] = 42500},
  73. [43] = {651, 10, 652, 10, 653, 20, 654, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13042, ["C_R2"] = 1, ["YANG"] = 27500, ["EXP"] = 43500},
  74. [44] = {701, 10, 702, 10, 703, 20, 704, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13042, ["C_R2"] = 1, ["YANG"] = 27500, ["EXP"] = 43500},
  75. [45] = {702, 10, 703, 10, 704, 20, 705, 5, ["ID_R1"] = 8001, ["C_R1"] = 400, ["ID_R2"] = 13042, ["C_R2"] = 1, ["YANG"] = 27500, ["EXP"] = 43500},
  76. },
  77. ["hEnableQuestIMG"] = 0,
  78.  
  79. }
  80. end
  81.  
  82. when letter begin
  83. local settings = hunting.setting()
  84. if pc.get_level() < pc.getqf("current")+1 then --w ten sposób sprawdzam dostępność misji na aktualny poziom.
  85. --pc.getqf("current") jeśli wcześniej nie był ustawiany, wynosi 0, dlatego, żeby postać mogła otrzymać misję na swój poziom (rodzi się
  86. --z poziomem 1) muszę dodać do niego 1
  87. return
  88. end
  89. if settings.hMobSetTable[pc.getqf("current")+1] == nil then --jeśli nie ma w tablicy misji na mój poziom, a wszystkie poniżej już zrobiłem, to pokazuje się komunikat, że nie ma misji
  90. return
  91. end
  92. send_letter("Hunting- Expedition "..pc.getqf("current")+1)
  93. end
  94.  
  95. when button or info begin
  96. local settings = hunting.setting()
  97. local mobs_table = {} --pusta tablica, którą zaraz zapełnimy
  98. say("Pick your next target to hunt: ")
  99.  
  100. for i=1,7,2 do --ta pętla pobiera ID potworów możliwych do zabicia w misji i wrzuca ich nazwy do pustej tablicy mobs_table
  101. table.insert(mobs_table, mob_name(settings.hMobSetTable[pc.getqf("current")+1][i]))
  102. end
  103. table.insert(mobs_table, "Return") --do tablicy wrzucam sobie jeszcze przycisk "Anuluj"
  104. local s=select_table(mobs_table) --po czym wybieram sobie tablicę
  105.  
  106. if s == table.getn(mobs_table) then --zawraca, jeśli wybrany element jest równy wielkości tablicy (tablica ma 5 elementów, a piątym elementem jest przycisk "Anuluj")
  107. return
  108. end
  109. pc.setqf("current", pc.getqf("current")+1) --Tutaj ustawiam sobie Current do aktualnej misji
  110. local current = pc.getqf("current")
  111. pc.setqf("kill_vnum", settings.hMobSetTable[current][s*2-1]) --tutaj ustawiam sobie moba do zabicia. s * 2 - 1 zawsze daje ID potwora z tablicy zgodnie z wybranym przyciskiem
  112. -- -1 jest dlatego, że komórki od potworów mają nieparzyste ID, 1, 3, 5, 7. 1*2 to 2, 2*2 to 4 -1 to 3 (bo 3 jest 2 w tablicy) itd
  113. pc.setqf("kill_count", settings.hMobSetTable[current][s*2]) --zaś tutaj wrzucam sobie ilość
  114. pc.setqf("killed_count", 0)
  115. --syschat(current.." | "..pc.getqf("kill_vnum").." | "..pc.getqf("kill_count")) --używałem do debugowania
  116. set_state(zabij)
  117. end
  118. end
  119. state zabij begin
  120. when letter begin
  121. q.set_counter(mob_name(pc.getqf("kill_vnum")), pc.getqf("kill_count")-pc.getqf("killed_count")) --licznik w queście pod klawiszem N
  122. send_letter("Hunting")
  123. end
  124. when button or info begin
  125. local settings = hunting.setting()
  126. --[[ Tutaj wyświetlam sobie teksty i obrazek ]]--
  127. if hunting.setting().hEnableQuestIMG == 1 then
  128. setskin(SCROLL)
  129. setbgimage('level_bg.tga')
  130. addimage(20, 12, special.levelup_img[pc.getqf("kill_vnum")])
  131. end
  132. say_title(settings.hTytul)
  133. say_title(settings.hDisc1..""..mob_name(pc.getqf("kill_vnum")))
  134. say_title(settings.hDisc2a.." "..pc.getqf("kill_count")-pc.getqf("killed_count").." "..settings.hDisc2b)
  135. say_title(settings.hDisc3.." "..pc.getqf("killed_count").." "..mob_name(pc.getqf("kill_vnum")))
  136. end
  137.  
  138. when kill with not npc.is_pc() and npc.get_race()==pc.getqf("kill_vnum") begin --event zabicia
  139. local settings = hunting.setting()
  140. local current = pc.getqf("current")
  141. pc.setqf("killed_count", pc.getqf("killed_count") + 1) --zwiększam ilość zabitych, jeśli ID zabitego zgadza się z ID potwora który mam zabić
  142. q.set_counter(mob_name(pc.getqf("kill_vnum")), pc.getqf("kill_count")-pc.getqf("killed_count")) --aktualizuję licznik pod N
  143. if pc.getqf("killed_count") >= pc.getqf("kill_count") then --jeśli to wszystkie zabite...
  144. clear_letter()
  145. set_state(reward)
  146. end
  147. end
  148. end
  149. state reward begin
  150. when letter begin
  151. local v = find_npc_by_vnum(20019)
  152. if v != 0 then
  153. target.vid("__TARGET__", v, "Yang-Shin")
  154. end
  155. send_letter("Reward")
  156. end
  157.  
  158. when button or info begin
  159. local settings = hunting.setting()
  160. local current = pc.getqf("current")
  161. --[[ Wyświetlam sobie okienko z wyborem nagrody ]]--
  162. say_title(settings.hNagTytul)
  163. say(settings.hNag1)
  164. local s=select(item_name(settings.hMobSetTable[current].ID_R1).." x"..settings.hMobSetTable[current].C_R1, item_name(settings.hMobSetTable[current].ID_R2).." x"..settings.hMobSetTable[current].C_R2)
  165. if s==1 then
  166. pc.give_item2(settings.hMobSetTable[current].ID_R1, settings.hMobSetTable[current].C_R1)
  167. else
  168. pc.give_item2(settings.hMobSetTable[current].ID_R2, settings.hMobSetTable[current].C_R2)
  169. end
  170. pc.change_money(tonumber(settings.hMobSetTable[current].YANG))
  171. pc.give_exp2(tonumber(settings.hMobSetTable[current].EXP))
  172.  
  173. pc.delqf("kill_count")
  174. pc.delqf("killed_count")
  175. pc.delqf("kill_vnum")
  176. clear_letter()
  177. q.done()
  178. set_state(start)
  179. end
  180. end
  181. end
Advertisement
Add Comment
Please, Sign In to add comment