Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.74 KB | None | 0 0
  1. quest medale begin
  2. state start begin
  3. when 50050.use begin
  4. if not pc.can_warp() then
  5. syschat(" Nie możesz teraz tego zrobić.")
  6. elseif horse.get_level() == 10 and pc.level < 35 then
  7. syschat("Nie posiadasz minimum 35. poziom.")
  8. elseif horse.get_level() == 20 and pc.level < 50 then
  9. syschat("Nie posiadasz minimum 50. poziom.")
  10. elseif horse.get_level() >= 21 then
  11. syschat("Twój koń osiągnął maksymalny poziom.")
  12. end
  13. end
  14.  
  15. if get_time() < pc.getqf("durationm") and not pc.is_skill_book_no_delay() then
  16. local czas = (pc.getqf("durationm") - get_time())/3600 -- 9000 / 3600 = 2.5
  17. local h = math.floor(czas) -- 2.5 = 2
  18. local min = (czas - h)*60 -- (2.5 - 2)*60 = 0.5 * 60 = 30
  19. local m = math.floor(min)
  20. syschat("Pozostały czas "..h.." godzin, "..m.." min..")
  21. elseif get_time() < pc.getqf("durationm") and pc.is_skill_book_no_delay() then
  22. if horse.get_level() >= 0 and horse.get_level() <= 20 then
  23. local socket0 = item.get_socket(0)
  24. local plus = horse.get_level()+1
  25. local s = number(1,100)
  26. local pass_percent = 40
  27. if s<= pass_percent then
  28. if horse.get_level() == 0 then
  29. pc.remove_item(50050, 1)
  30. pc.setqf("durationm",get_time()+60*60*1) -- 1 godzina
  31. syschat("Brawo! Udało się.")
  32. chat("Twój Koń osiągnął tytuł Zwykłego Konia.")
  33. horse.set_level(plus)
  34. elseif horse.get_level() == 1 or horse.get_level() == 2 or horse.get_level() == 3 or horse.get_level() == 4 or horse.get_level() == 5 or horse.get_level() == 6 or horse.get_level() == 7 or horse.get_level() == 8 or horse.get_level() == 9 then
  35. pc.remove_item(50050, 1)
  36. horse.set_level(plus)
  37. pc.setqf("durationm",get_time()+60*60*1) -- 1 godzina
  38. syschat("Brawo! Udało się.")
  39. chat("Pomyślnie zrozumiałeś wiedzę zawartą w medalu.")
  40. elseif horse.get_level() == 10 then
  41. pc.remove_item(50050, 1)
  42. pc.setqf("durationm",get_time()+60*60*1) -- 1 godzina
  43. syschat("Brawo! Udało się.")
  44. chat("Twój Koń osiągnął tytuł Bojowego Konia.")
  45. horse.set_level(plus)
  46. elseif horse.get_level() == 11 or horse.get_level() == 12 or horse.get_level() == 13 or horse.get_level() == 14 or horse.get_level() == 15 or horse.get_level() == 16 or horse.get_level() == 17 or horse.get_level() == 18 or horse.get_level() == 19 then
  47. pc.remove_item(50050, 1)
  48. horse.set_level(plus)
  49. pc.setqf("durationm",get_time()+60*60*1) -- 1 godzina
  50. syschat("Brawo! Udało się.")
  51. chat("Pomyślnie zrozumiałeś wiedzę zawartą w medalu.")
  52. local czas = (pc.getqf("durationm") - get_time())/3600 -- 9000 / 3600 = 2.5
  53. local h = math.floor(czas) -- 2.5 = 2
  54. local min = (czas - h)*60 -- (2.5 - 2)*60 = 0.5 * 60 = 30
  55. local m = math.floor(min)
  56. syschat("Potrzeba czasu aby zrozumieć wiedzę zawartą w Medalach Konnych.")
  57. chat("Pozostały czas "..h.." godzin, "..m.." min..")
  58. elseif horse.get_level() == 20 then
  59. pc.remove_item(50050, 1)
  60. pc.setqf("durationm",get_time()+60*60*1) -- 1 godzina
  61. syschat("Brawo! Udało się.")
  62. chat("Twój Koń osiągnął tytuł Wojskowego Konia.")
  63. horse.set_level(plus)
  64. end
  65. end
  66. end
  67. else
  68. if horse.get_level() >= 0 and horse.get_level() <= 20 then
  69. local socket0 = item.get_socket(0)
  70. local plus = horse.get_level()+1
  71. local s = number(1,100)
  72. local pass_percent = 40
  73. if s<= pass_percent then
  74. if horse.get_level() == 0 then
  75. pc.remove_item(50050, 1)
  76. pc.setqf("durationm",get_time()+60*60*1) -- 1 godzina
  77. syschat("Brawo! Udało się.")
  78. chat("Twój Koń osiągnął tytuł Zwykłego Konia.")
  79. horse.set_level(plus)
  80. elseif horse.get_level() == 1 or horse.get_level() == 2 or horse.get_level() == 3 or horse.get_level() == 4 or horse.get_level() == 5 or horse.get_level() == 6 or horse.get_level() == 7 or horse.get_level() == 8 or horse.get_level() == 9 then
  81. pc.remove_item(50050, 1)
  82. horse.set_level(plus)
  83. pc.setqf("durationm",get_time()+60*60*1) -- 1 godzina
  84. syschat("Brawo! Udało się.")
  85. chat("Pomyślnie zrozumiałeś wiedzę zawartą w medalu.")
  86. elseif horse.get_level() == 10 then
  87. pc.remove_item(50050, 1)
  88. pc.setqf("durationm",get_time()+60*60*1) -- 1 godzina
  89. syschat("Brawo! Udało się.")
  90. chat("Twój Koń osiągnął tytuł Bojowego Konia.")
  91. horse.set_level(plus)
  92. elseif horse.get_level() == 11 or horse.get_level() == 12 or horse.get_level() == 13 or horse.get_level() == 14 or horse.get_level() == 15 or horse.get_level() == 16 or horse.get_level() == 17 or horse.get_level() == 18 or horse.get_level() == 19 then
  93. pc.remove_item(50050, 1)
  94. horse.set_level(plus)
  95. pc.setqf("durationm",get_time()+60*60*1) -- 1 godzina
  96. syschat("Brawo! Udało się.")
  97. chat("Pomyślnie zrozumiałeś wiedzę zawartą w medalu.")
  98. local czas = (pc.getqf("durationm") - get_time())/3600 -- 9000 / 3600 = 2.5
  99. local h = math.floor(czas) -- 2.5 = 2
  100. local min = (czas - h)*60 -- (2.5 - 2)*60 = 0.5 * 60 = 30
  101. local m = math.floor(min)
  102. syschat("Potrzeba czasu aby zrozumieć wiedzę zawartą w Medalach Konnych.")
  103. chat("Pozostały czas "..h.." godzin, "..m.." min..")
  104. elseif horse.get_level() == 20 then
  105. pc.remove_item(50050, 1)
  106. pc.setqf("durationm",get_time()+60*60*1) -- 1 godzina
  107. syschat("Brawo! Udało się.")
  108. chat("Twój Koń osiągnął tytuł Wojskowego Konia.")
  109. horse.set_level(plus)
  110. end
  111. end
  112. end
  113. end
  114. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement