Advertisement
deadx2

Untitled

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