Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- quest tombola_start begin
- state start begin
- when login begin
- chat("tombola1")
- local number_list = number(1,TOMBOLA_QUANTITY_LIST)
- local item_reward_list = string.format(TOMBOLA_REWARD_LIST[number_list][1][1]).."|".. string.format(TOMBOLA_REWARD_LIST[number_list][1][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][2][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][2][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][3][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][3][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][4][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][4][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][5][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][5][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][6][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][6][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][7][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][7][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][8][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][8][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][9][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][9][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][10][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][10][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][11][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][11][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][12][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][12][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][13][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][13][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][14][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][14][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][15][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][15][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][16][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][16][2])
- cmdchat("tombola_start "..q.getcurrentquestindex()) --- this command send quest index to client, you'll see now why is important
- --chat("tombola_prepare "..item_reward_list)
- cmdchat("tombola_prepare "..item_reward_list)
- end
- when button or info begin
- chat("tombola2")
- if pc.getqf("start_game") == 0 then
- --local number_use = pc.getf("tombola_start","used_today")
- chat("tombola3")
- if pc.get_level() < TOMBOLA_LIMIT_LVL then
- notice("Ta przyjemność zarezerwowana jest dla bardziej doświadczonych graczy.")
- notice("Zdobądź "..TOMBOLA_LIMIT_LVL.." poziom i wygrywaj w Tomboli!")
- return
- end
- --local first_use = pc.getf("tombola_start","limit_time")--time when use first time of day
- --if first_use + TOMBOLA_LIMIT_TIME < get_time() then
- -- pc.setf("tombola_start","used_today",TOMBOLA_COUNT_FREE)
- -- number_use = TOMBOLA_COUNT_FREE
- -- pc.setf("tombola_start","limit_time",get_time())
- -- end
- local ilosc_sm = pc.get_sm()
- local ilosc_sz = pc.get_sz()
- -- if number_use > 0 then
- -- tombola_start.losuj()
- -- else
- --if number_use == 0 then
- -- notice("TOMBOLA ERROR 12")
- -- return
- -- end
- chat("tombola4")
- if ilosc_sm < TOMBOLA_PRICE then
- chat("tombola5")
- notice("Nie masz wystarczającej ilości SM.")
- notice("Możesz skorzystać z losowania za jedyne "..TOMBOLA_PRICE.." Smoczych Monet.")
- notice("Doładuj Smocze Monety na naszej stronie "..ADRES_WWW.." i zagraj jeszcze raz!")
- return
- end
- tombola_start.losuj()
- end
- --end
- end
- function losuj()
- local number_list = number(1,TOMBOLA_QUANTITY_LIST)
- local item_reward_list = string.format(TOMBOLA_REWARD_LIST[number_list][1][1]).."|".. string.format(TOMBOLA_REWARD_LIST[number_list][1][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][2][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][2][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][3][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][3][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][4][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][4][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][5][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][5][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][6][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][6][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][7][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][7][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][8][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][8][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][9][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][9][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][10][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][10][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][11][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][11][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][12][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][12][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][13][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][13][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][14][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][14][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][15][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][15][2]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][16][1]).."|"..string.format(TOMBOLA_REWARD_LIST[number_list][16][2])
- cmdchat("tombola_prepare "..item_reward_list)
- local liczba_okrazen = math.random(1,3)
- local ktory_item = math.random(1,16)
- local item_reward = TOMBOLA_REWARD_LIST[number_list][ktory_item][1]
- local reward_count = TOMBOLA_REWARD_LIST[number_list][ktory_item][2]
- local to_position = (ktory_item-1)+(liczba_okrazen*16)
- local speed_down = math.random(2,10)
- pc.setqf("item_reward",item_reward)
- pc.setqf("reward_count",reward_count)
- cmdchat("tombola_run "..to_position.."|"..speed_down)
- --chat("item wylosowany:"..item_name(item_reward))--debug mode
- pc.setqf("start_game", 1)
- end
- end
- end
Add Comment
Please, Sign In to add comment