Advertisement
deadx2

Untitled

Aug 10th, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.86 KB | None | 0 0
  1. quest nagroda_boss begin
  2.     state start begin
  3.         function settings()
  4.             return {
  5.             [691] = {
  6.             ['vnum'] = {70, 170, 270, 370},
  7.             ['count'] = {1, 1, 1, 1},
  8.             ['ilosc_itemow'] = 4,
  9.             },
  10.         end
  11.        
  12.         when kill with npc.get_race() == 691 begin
  13.             chat("zabiles")
  14.             local settings = nagroda_boss.settings()
  15.             local przedmioty = settings[npc.get_race()]['ilosc_itemow']
  16.  
  17.             local numerek1 = number(0, przedmioty)
  18.             local numerek2 = number(0, przedmioty)
  19.             local numerek3 = number(0, przedmioty)
  20.  
  21.             local nagrody = {settings[npc.get_race()]['vnum'][nagroda1], settings[npc.get_race()]['vnum'][nagroda2], settings[npc.get_race()]['vnum'][nagroda3]}
  22.             local ilosc = {settings[npc.get_race()]['count'][nagroda1], settings[npc.get_race()]['count'][nagroda2], settings[npc.get_race()]['count'][nagroda3]}
  23.            
  24.             pc.setqf("boss_nagroda_1", numerek1)
  25.             pc.setqf("boss_nagroda_2", numerek2)
  26.             pc.setqf("boss_nagroda_3", numerek3)
  27.             pc.setqf("boss_nagroda_boss", npc.get_race())
  28.             cmdchat("Gui_Wybor_Boss_Nagroda "..nagrody.." "..ilosc)
  29.             chat("zabiles")
  30.         end
  31.        
  32.         when button or info begin
  33.             local wybor = get_input()
  34.             local settings = nagroda_boss.settings()
  35.             if wybor == "1" then
  36.                 chat("Gratulacje, wybrales nagrode!")
  37.                 pc.give_item2(settings[pc.getqf("boss_nagroda_boss")]['vnum'][pc.getqf("boss_nagroda_1")],settings[pc.getqf("boss_nagroda_boss")]['count'][pc.getqf("boss_nagroda_1")])
  38.  
  39.             elseif wybor == "2" then
  40.                 chat("Gratulacje, wybrales nagrode!")
  41.                 pc.give_item2(settings[pc.getqf("boss_nagroda_boss")]['vnum'][pc.getqf("boss_nagroda_2")],settings[pc.getqf("boss_nagroda_boss")]['count'][pc.getqf("boss_nagroda_2")])
  42.  
  43.             elseif wybor == "3" then
  44.                 chat("Gratulacje, wybrales nagrode!")
  45.                 pc.give_item2(settings[pc.getqf("boss_nagroda_boss")]['vnum'][pc.getqf("boss_nagroda_3")],settings[pc.getqf("boss_nagroda_boss")]['count'][pc.getqf("boss_nagroda_3")])
  46.             end
  47.         end
  48.        
  49.     end
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement