hachiwari

Untitled

Jul 13th, 2014
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. [quote name="Endymion_" post="10639647" timestamp="1405266865"]
  2.  
  3.  
  4. Będę szczery, totalnie nie wiem o c**j chodzi w pythonie więc w queście mogę występować jakieś błędy, ale w tedy mówicie to będę naprawiał.[code=:0]
  5. quest tombola begin
  6. state start begin
  7. function tablica(vnum, pozycja, pozycja2)
  8. local itemy = {
  9. {
  10. {71001, 1},
  11. {71084, 25},
  12. {71085, 25},
  13. {25040, 3},
  14. {27992, 2},
  15. {27993, 2},
  16. {27994, 2},
  17. {27987, 5},
  18. {72002, 1},
  19. {71027, 5},
  20. {71028, 5},
  21. {71029, 5},
  22. {71030, 5},
  23. {71036, 1},
  24. {50008, 15},
  25. {70021, 3},
  26. {71001, 1},
  27. },
  28. {
  29. {25041, 1},
  30. {71084, 25},
  31. {71085, 25},
  32. {25040, 3},
  33. {27992, 2},
  34. {27993, 2},
  35. {27994, 2},
  36. {27987, 5},
  37. {72002, 1},
  38. {71027, 5},
  39. {71028, 5},
  40. {71029, 5},
  41. {71030, 5},
  42. {71036, 1},
  43. {50008, 15},
  44. {70021, 3},
  45. {25041, 1},
  46. }
  47. }
  48. return itemy[vnum][pozycja][pozycja2]
  49. end
  50.  
  51.  
  52.  
  53. when login begin
  54. cmdchat("tombola "..q.getcurrentquestindex())
  55. end
  56.  
  57. when 9005.chat."Open Tombola" with pc.is_gm() begin
  58. local losowo = number(1,2)
  59. local str = " "
  60. for i = 1,16 do
  61. if i == 16 then
  62. str = str..tombola.tablica(losowo, i, 1).."|"..tombola.tablica(losowo, i, 2)
  63. else
  64. str = str..tombola.tablica(losowo, i, 1).."|"..tombola.tablica(losowo, i, 2).."|"
  65. end
  66. end
  67. cmdchat("OnPrepare"..str)
  68. cmdchat("openTombola")
  69. setskin(NOWINDOW)
  70. end
  71.  
  72. when info or button begin
  73. local losowo = number(1,2)
  74. local str = " "
  75. for i = 1,16 do
  76. if i == 16 then
  77. str = str..tombola.tablica(losowo, i, 1).."|"..tombola.tablica(losowo, i, 2)
  78. else
  79. str = str..tombola.tablica(losowo, i, 1).."|"..tombola.tablica(losowo, i, 2).."|"
  80. end
  81. end
  82. cmdchat("OnPrepare"..str)
  83. if pc.get_empty_inventory_count() < 3 then
  84. syschat("Nie możesz losować, gdyż masz za mało miejsca w ekwipunku.")
  85. return
  86. end
  87. cmdchat("get_input_start")
  88. local czynnosc = input(cmdchat("get_input_value"))
  89. cmdchat("get_input_end")
  90. if czynnosc == "tombola|begin" then
  91. pc.setqf("slot", number(1, 16))
  92. cmdchat("OnRun "..number(2,3)*16+pc.getqf("slot").."|5")
  93. elseif czynnosc == "tombola|end" then
  94. syschat("Gratulacje! Otrzymałeś "..tombola.tablica(losowo, pc.getqf("slot")+1, 2).."x "..item_name(tombola.tablica(losowo, pc.getqf("slot")+1, 1)).." jako nagroda w Tomboli!")
  95. pc.give_item2(tombola.tablica(losowo, pc.getqf("slot")+1, 1), tombola.tablica(losowo, pc.getqf("slot")+1, 2))
  96. end
  97. end
  98. end
  99. end
  100.  
  101. [/code][/quote]
Advertisement
Add Comment
Please, Sign In to add comment