Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.49 KB | None | 0 0
  1. quest system_smocza_alchemia begin
  2. state start begin
  3. when 30303.use with pc.is_gm() begin
  4. cmdchat("openRune 0|0|0|2|0|3|0|5|0|4|0|1")
  5. cmdchat("setRune "..pc.getqf("rune_0").."#0")
  6. cmdchat("setRune "..pc.getqf("rune_1").."#1")
  7. cmdchat("setRune "..pc.getqf("rune_2").."#2")
  8. cmdchat("setRune "..pc.getqf("rune_3").."#3")
  9. cmdchat("setRune "..pc.getqf("rune_4").."#4")
  10. notice(pc.getqf("rune_0").." - "..pc.getqf("rune_1").." - "..pc.getqf("rune_2").." - "..pc.getqf("rune_3").." - "..pc.getqf("rune_4"))
  11. end
  12. function getGrade(vnum)
  13. if table_is_in({33411, 33421, 33431}, vnum) then
  14. return 1
  15. elseif table_is_in({33412, 33422, 33432}, vnum) then
  16. return 2
  17. elseif table_is_in({33413, 33423, 33433}, vnum) then
  18. return 3
  19. elseif table_is_in({33414, 33424, 33434}, vnum) then
  20. return 4
  21. else
  22. return 5
  23. end
  24. end
  25. when letter begin
  26. cmdchat("przycisk_alchemia "..q.getcurrentquestindex())
  27. end
  28. when button or info begin
  29. cmdchat("openRune 0|0|0|2|0|3|0|5|0|4|0|1")
  30. cmdchat("setRune "..pc.getqf("rune_0").."#0")
  31. cmdchat("setRune "..pc.getqf("rune_1").."#1")
  32. cmdchat("setRune "..pc.getqf("rune_2").."#2")
  33. cmdchat("setRune "..pc.getqf("rune_3").."#3")
  34. cmdchat("setRune "..pc.getqf("rune_4").."#4")
  35. end
  36. -- ## FIX ## --
  37. when login or kill begin
  38. for i = 1, 5 do
  39. local vnum = pc.getqf("grade_"..i)
  40. if vnum > 0 and pc.countitem(vnum) < 1 then
  41. chat(chat_color("[Smocza Alchemia]", "blue").." Nie posiadasz runy: "..chat_color(item_name(vnum), "orange")..". Bonus zostaje zdjęty...")
  42. affect.new_remove(850+i)
  43. pc.delqf("grade_"..i)
  44. pc.setqf("rune_"..(i-1), 0)
  45. cmdchat("setRune 0#"..(i-1))
  46. end
  47. if pc.getqf("fl_rn") == 0 then
  48. pc.setqf("rune_"..(i-1), vnum)
  49. cmdchat("setRune "..(i-1).."#"..vnum)
  50. end
  51. end
  52. -- pc.setqf("fl_rn", 1)
  53. end
  54. -- ## UŻYCIE ## --
  55. when 33411.use or 33412.use or 33413.use or 33414.use or 33415.use or
  56. 33421.use or 33422.use or 33423.use or 33424.use or 33425.use or
  57. 33431.use or 33432.use or 33433.use or 33434.use or 33435.use begin
  58. local grade = system_smocza_alchemia.getGrade(item.vnum)
  59. if pc.getqf("is_active_"..grade) > 0 then
  60. affect.new_remove(850+grade)
  61. pc.delqf("is_active_"..grade)
  62. pc.delqf("grade_"..grade)
  63. pc.setqf("rune_"..(grade-1), 0)
  64. cmdchat("setRune 0#"..(grade-1))
  65. chat(chat_color("[Smocza Alchemia]", "blue").." "..item_name(item.vnum).." została zdezaktywowana.")
  66. else
  67. local affects =
  68. {
  69. [33411] = {53, 5, 1},
  70. [33412] = {43, 5, 2},
  71. [33413] = {6, 1000, 3},
  72. [33414] = {41, 5, 4},
  73. [33415] = {40, 5, 5},
  74. [33421] = {53, 10, 1},
  75. [33422] = {43, 10, 2},
  76. [33423] = {6, 2500, 3},
  77. [33424] = {41, 10, 4},
  78. [33425] = {40, 10, 5},
  79. [33431] = {53, 15, 1},
  80. [33432] = {43, 15, 2},
  81. [33433] = {6, 5000, 3},
  82. [33434] = {41, 15, 4},
  83. [33435] = {40, 15, 5},
  84. }
  85. pc.setqf("grade_"..grade, item.vnum)
  86. affect.new(850+system_smocza_alchemia.getGrade(item.vnum), affects[item.vnum][1], affects[item.vnum][2])
  87. pc.setqf("is_active_"..grade, 1)
  88. pc.setqf("rune_"..(affects[item.vnum][3]-1), item.vnum)
  89. cmdchat("setRune "..item.vnum.."#"..(affects[item.vnum][3]-1))
  90. chat(chat_color("[Smocza Alchemia]", "blue").." "..item_name(item.vnum).." została aktywowana.")
  91. end
  92. end
  93. -- ## DROP ## --
  94. when kill with pc.level >= 100 and npc.get_level()+20 > pc.level or pc.level >= 100 and npc.get_level() >= 90 begin
  95. if number(1, 1000) <= 7 then
  96. pc.give_item2(33400, 1)
  97. end
  98. end
  99. when 33400.use begin
  100. if not pc.can_warp() then
  101. chat(chat_color("[Smocza Skrzynia]", "blue").." Nie możesz teraz tego zrobić, spróbuj za 10 sekund.")
  102. else
  103. item.remove_one()
  104. pc.give_item2(number(33401, 33405), 1)
  105. end
  106. end
  107. -- ## ALCHEMIK ## ==
  108. when 20001.chat."Smocza Alchemia" begin
  109. snn()
  110. say("Cześć!")
  111. say("Zajmuję się w tym mieście Smoczą Alchemią,")
  112. say("potężną zdolnością jest możliwość jej wytwarzania.")
  113. say("Co chciałbyś zrobić?")
  114. local s = select("Wytwórz Smoczą Runę ", "Ulepsz Smoczą Runę ", "O Smoczej Alchemii...", "Wyjdź ")
  115. if s == 1 then
  116. snn()
  117. say("Wybierz rodzaj:")
  118. local ss = select("Szmaragdowa (5%/10%/15% Silny na Potwory)", "Onyksowa (5%/10%/15% Silny na Ludzi)", "Rubinowa (1000, 2500, 5000 Maks. PŻ)", "Szafirowa (5%/10%/15% Penetrujące Uderzenie)", "Bursztynowa (5%/10%/15% Krytyczne Uderzenie)", "Anuluj")
  119. if ss >= 1 and ss <= 5 then
  120. snn()
  121. say("Aby wytworzyć:")
  122. say_item_vnum2(33410+ss, "Smocza Runa")
  123. say("będziesz potrzebował:")
  124. say_item_vnum2(33400+ss, "Wymagane: 15")
  125. say_reward("- 15x Smoczy Kamień ")
  126. say_reward("- 100.000.000 Yang")
  127. say()
  128. say()
  129. local sss = select("Wytwórz Runę!", "Anuluj")
  130. if sss == 1 then
  131. if not pc.can_warp() then
  132. chat(chat_color("[Alchemik]", "blue").." Nie możesz teraz tego zrobić, spróbuj za 10 sekund.")
  133. elseif pc.money < 100000000 then
  134. chat(chat_color("[Alchemik]", "blue").." Nie posiadasz 100.000.000 Yang.")
  135. elseif pc.countitem(33400+ss) < 15 then
  136. chat(chat_color("[Alchemik]", "blue").." Nie posiadasz odpowiedniej ilości Smoczych Kamieni. Wymagane: 15.")
  137. else
  138. pc.remove_item(33400+ss, 15)
  139. pc.changemoney(-100000000)
  140. pc.give_item2(33410+ss, 1)
  141. chat(chat_color("[Alchemik]", "blue").." Poprawnie wytworzono Smoczą Runę.")
  142. end
  143. end
  144. end
  145. elseif s == 2 then
  146. snn()
  147. say("Aby ulepszyć swoją Smoczą Duszę będziesz potrzebował ")
  148. say("odpowiednią ilość jednego ze Smoczych Kamieni:")
  149. say_item_vnum2(number(33401, 33405), "Jeden z pięciu Kamieni")
  150. say_reward("Na poziom mistyczny: 30")
  151. say_reward("Na poziom legendarny: 45")
  152. elseif s == 3 then
  153. snn()
  154. say("Smocza Alchemia polega na wytworzeniu pięciu")
  155. say("rodzai Smoczych Run i ulepszeniu ich")
  156. say("do poziomu ostatecznego - legendarnego,")
  157. say("gdzie będą niezwykle silne w walce z przeciwieństwami.")
  158. say_reward("- Szmaragdowa (5%/10%/15% Silny na Potwory)")
  159. say_reward("- Onyksowa (5%/10%/15% Silny na Ludzi)")
  160. say_reward("- Rubinowa (1000, 2000, 3000 Maks. PŻ)")
  161. say_reward("- Szafirowa (5%/10%/15% Penetrujące Uderzenie)")
  162. say_reward("- Bursztynowa (5%/10%/15% Krytyczne Uderzenie)")
  163. say_item_vnum2(number(33431, 33435), "Przykładowa Legendarna Runa")
  164. wait()
  165. snn()
  166. say("Aby wytworzyć jedną z run:")
  167. say_item_vnum2(33411, "Smocza Runa")
  168. say("będziesz potrzebował:")
  169. say_item_vnum2(33401, "Wymagane: 15")
  170. say_reward("- 15x Smoczy Kamień ")
  171. say_reward("- 100.000.000 Yang")
  172. say_reward("Szansa powodzenia: 50%")
  173. end
  174. end
  175. when 20001.take with item.get_vnum() >= 33411 and item.get_vnum() <= 33425 begin
  176. local grade = system_smocza_alchemia.getGrade(item.vnum)
  177. local count = 30
  178. local money = 100000000
  179. local newruna = item.get_vnum()+10
  180. if item.vnum >= 33421 then
  181. count = 45
  182. money = 200000000
  183. end
  184. snn()
  185. say("Aby ulepszyć swoją runę na lepszą:")
  186. say_item_vnum2(newruna, "Nowa Smocza Runa")
  187. say("będziesz potrzebował:")
  188. say_item_vnum2(33400+grade, "Wymagane: "..count)
  189. say_reward("- "..count.."x Smoczy Kamień ")
  190. say_reward("- "..numtomoney(money).." Yang")
  191. say_reward("Szansa powodzenia: 50%")
  192. say()
  193. say()
  194. local s = select("Ulepsz Runę!", "Anuluj")
  195. if s == 1 then
  196. if not pc.can_warp() then
  197. chat(chat_color("[Alchemik]", "blue").." Nie możesz teraz tego zrobić, spróbuj za 10 sekund.")
  198. elseif pc.money < money then
  199. chat(chat_color("[Alchemik]", "blue").." Nie posiadasz "..numtomoney(money).." Yang.")
  200. elseif pc.countitem(33400+grade) < count then
  201. chat(chat_color("[Alchemik]", "blue").." Nie posiadasz odpowiedniej ilości Smoczych Kamieni. Wymagane: "..count..".")
  202. else
  203. if number(1, 100) <= 50 then
  204. pc.remove_item(33400+grade, count)
  205. if newruna < 33411 or newruna > 33435 then return end
  206. pc.give_item2(newruna, 1)
  207. item.remove_one()
  208. pc.changemoney(-money)
  209. chat(chat_color("[Alchemik]", "blue").." Poprawnie ulepszono Smoczą Runę.")
  210. else
  211. pc.remove_item(33400+grade, count)
  212. pc.changemoney(-money)
  213. chat(chat_color("[Alchemik]", "blue").." Ulepszanie runy zakończyło się niepowodzeniem.")
  214. end
  215. end
  216. end
  217. end
  218. end
  219. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement