Advertisement
deadx2

Untitled

Aug 28th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.15 KB | None | 0 0
  1. quest tombola_start begin
  2.     state start begin
  3.         when login begin
  4.             chat("tombola1")
  5.             local number_list = number(1,TOMBOLA_QUANTITY_LIST1)
  6.             local item_reward_list = string.format(TOMBOLA_REWARD_LIST1[number_list][1][1]).."|".. string.format(TOMBOLA_REWARD_LIST1[number_list][1][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][2][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][2][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][3][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][3][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][4][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][4][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][5][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][5][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][6][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][6][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][7][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][7][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][8][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][8][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][9][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][9][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][10][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][10][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][11][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][11][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][12][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][12][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][13][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][13][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][14][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][14][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][15][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][15][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][16][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][16][2])
  7.             cmdchat("tombola_start "..q.getcurrentquestindex()) --- this command send quest index to client, you'll see now why is important  
  8.             --chat("tombola_prepare "..item_reward_list)
  9.             cmdchat("tombola_prepare "..item_reward_list)
  10.         end
  11.        
  12.         when button or info begin
  13.             chat("tombola2")
  14.             local x = get_input("GetInput")
  15.             chat("Tombola input - pobrano")
  16.             if x == "poziom1" then
  17.                 chat("Poziom 1")
  18.             end
  19.             if x == "poziom2" then
  20.                 chat("Poziom 2")
  21.             end
  22.             if x == "poziom3" then
  23.                 chat("Poziom 3")
  24.             end
  25.             if pc.getqf("start_game") == 0 then
  26.                 --local number_use = pc.getf("tombola_start","used_today")
  27.                 chat("tombola3")
  28.  
  29.                 if x == "poziom1" and pc.get_level() < TOMBOLA_LIMIT_LVL1 then
  30.                     notice("Ta przyjemność zarezerwowana jest dla bardziej doświadczonych graczy.")
  31.                     notice("Zdobądź "..TOMBOLA_LIMIT_LVL1.." poziom i wygrywaj w Tomboli!")
  32.                     return
  33.                 end
  34.                
  35.                 if x == "poziom2" and pc.get_level() < TOMBOLA_LIMIT_LVL2 then
  36.                     notice("Ta przyjemność zarezerwowana jest dla bardziej doświadczonych graczy.")
  37.                     notice("Zdobądź "..TOMBOLA_LIMIT_LVL2.." poziom i wygrywaj w Tomboli!")
  38.                     return
  39.                 end
  40.                
  41.                 if x == "poziom3" and pc.get_level() < TOMBOLA_LIMIT_LVL3 then
  42.                     notice("Ta przyjemność zarezerwowana jest dla bardziej doświadczonych graczy.")
  43.                     notice("Zdobądź "..TOMBOLA_LIMIT_LVL3.." poziom i wygrywaj w Tomboli!")
  44.                     return
  45.                 end
  46.                 --local first_use = pc.getf("tombola_start","limit_time")--time when use first time of day
  47.  
  48.                 --if first_use + TOMBOLA_LIMIT_TIME < get_time() then
  49.             --      pc.setf("tombola_start","used_today",TOMBOLA_COUNT_FREE)
  50.             --      number_use = TOMBOLA_COUNT_FREE
  51.             --      pc.setf("tombola_start","limit_time",get_time())
  52.             --  end
  53.                 local ilosc_sm = pc.get_sm()
  54.                 local ilosc_sz = pc.get_sz()
  55.             --  if number_use > 0 then
  56.             --      tombola_start.losuj()
  57.             --  else
  58.                     --if number_use == 0 then
  59.                 --      notice("TOMBOLA ERROR 12")
  60.                 --      return
  61.                 --  end
  62.                     chat("tombola4")
  63.                     if ilosc_sm < TOMBOLA_PRICE then
  64.                         chat("tombola5")
  65.                         notice("Nie masz wystarczającej ilości SM.")
  66.                         notice("Możesz skorzystać z losowania za jedyne "..TOMBOLA_PRICE.." Smoczych Monet.")
  67.                         notice("Doładuj Smocze Monety na naszej stronie "..ADRES_WWW.." i zagraj jeszcze raz!")
  68.                         return
  69.                     end
  70.                     tombola_start.losuj(x)
  71.                 end
  72.             --end
  73.         end
  74.  
  75.  
  76.  
  77.         function losuj(koyger)
  78.             if koyger == "poziom1" then
  79.                 local number_list = number(1,TOMBOLA_QUANTITY_LIST1)
  80.                 local item_reward_list = string.format(TOMBOLA_REWARD_LIST1[number_list][1][1]).."|".. string.format(TOMBOLA_REWARD_LIST1[number_list][1][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][2][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][2][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][3][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][3][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][4][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][4][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][5][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][5][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][6][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][6][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][7][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][7][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][8][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][8][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][9][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][9][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][10][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][10][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][11][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][11][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][12][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][12][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][13][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][13][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][14][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][14][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][15][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][15][2]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][16][1]).."|"..string.format(TOMBOLA_REWARD_LIST1[number_list][16][2])
  81.                 cmdchat("tombola_prepare "..item_reward_list)
  82.                 local liczba_okrazen = math.random(1,3)
  83.                 local ktory_item = math.random(1,16)
  84.                 local item_reward = TOMBOLA_REWARD_LIST1[number_list][ktory_item][1]
  85.                 local reward_count = TOMBOLA_REWARD_LIST1[number_list][ktory_item][2]
  86.                 local to_position = (ktory_item-1)+(liczba_okrazen*16)
  87.                 local speed_down =  math.random(2,10)
  88.                 pc.setqf("item_reward",item_reward)
  89.                 pc.setqf("reward_count",reward_count)
  90.                 cmdchat("tombola_run "..to_position.."|"..speed_down)
  91.                 --chat("item wylosowany:"..item_name(item_reward))--debug mode
  92.                 pc.setqf("start_game", 1)
  93.             elseif koyger == "poziom2" then
  94.            
  95.             elseif koyger == "poziom3" then
  96.            
  97.             end
  98.         end
  99.     end
  100. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement