Guest User

Untitled

a guest
Jan 12th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. ---------------------------------
  2. -----Biolog by PoetaNapalmu------
  3. ---------------------------------
  4. quest biolog_poeta_20
  5. state start begin
  6. when login or levelup with pc.get_level() >= 20 begin
  7. set_state(dostawa)
  8. end
  9. end
  10. state dostawa begin
  11. when letter begin
  12. send_letter("")
  13. end
  14.  
  15. when button or info begin
  16. say_title("")
  17. say("")
  18. say("")
  19. say("")
  20. say("")
  21. say("")
  22. local left = x - pc.getqf("ilosc") -- x==ilosc itemkow do oddania
  23. say_reward(left.."x nazwaitemka")
  24. say_item_vnum(iditemka)
  25. end
  26.  
  27. when 71035.use or 76020.use begin
  28. if pc.getqf("duration") != 0 then
  29. pc.setqf("duration", 0)
  30. pc.setqf("procenty", 1)
  31. chat("Czas oddania przedmiotu został skasowany. Szansa pomyślnego oddania wzrosła.")
  32. pc.remove_item(71035, 1)
  33. return
  34. else
  35. chat("Możesz oddać przedmiot biologowi.")
  36. return
  37. end
  38. end
  39.  
  40. when 20084.chat."" with pc.count_item(iditemka) != 0 begin
  41. if pc.getqf("duration") > get_time() then
  42. say_title("")
  43. say("")
  44. say("")
  45.  
  46. local duration = (pc.getqf("duration") - get_time()) / 3600
  47. local hours = math.floor(duration)
  48. local minutes = math.floor((duration - hours) * 60)
  49.  
  50. if hours >= 1 and minutes >= 1 then
  51. say(string.format("Pozostały Czas: %dH %dM", hours, minutes))
  52. elseif hours >= 1 and minutes == 0 then
  53. say(string.format("Pozostały Czas: %dH", hours))
  54. else
  55. say(string.format("Pozostały Czas: %dM", minutes))
  56. end
  57. return
  58. end
  59. end
  60.  
  61. local percent = 50
  62. if pc.getqf("procenty") == 1 then
  63. percent = x --ilosc procent z eliksirem
  64. pc.setqf("procenty", 0)
  65. end
  66.  
  67. say_title("")
  68. say("")
  69. say("")
  70. say("")
  71. wait()
  72.  
  73. if number(1, 100) <= percent and pc.count_item(iditemka) != 0 then
  74. pc.setqf("ilosc", pc.getqf("ilosc") + 1)
  75. pc.remove_item(iditemka, 1)
  76. pc.setqf("duration", get_time() + 60 * 60)
  77.  
  78. if pc.getqf("ilosc") == 20 then
  79. say_title("")
  80. say("koniec")
  81. wait()
  82. say_title("")
  83. say("")
  84.  
  85. affect.add_collect_point()
  86. pc.give_item2()
  87.  
  88. clear_letter()
  89. set_quest_state("", "")
  90. set_state(gotowe)
  91. return
  92. end
  93.  
  94. local left_count = 20 - pc.getqf("ilosc")
  95.  
  96. say_title("Biolog Chaegirab")
  97. say("sukces")
  98. say_reward("Przynieś mi jeszcze: "..left_count.." sztuk.")
  99. pc.setqf("duration", get_time() + 60 * 60)
  100. else
  101. say_title("Biolog Chaegirab")
  102. say("spalil")
  103. pc.setqf("duration", get_time() + 60 * 60)
  104. pc.remove_item(item.get_vnum(), 1)
  105. end
  106. end
  107. state gotowe begin
  108. end
  109. end
Advertisement
Add Comment
Please, Sign In to add comment