Advertisement
deadx2

Untitled

Aug 10th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.03 KB | None | 0 0
  1. quest nagroda_boss begin
  2.     state start begin
  3.         function settings()
  4.             return
  5.             {
  6.                 ['Nagroda'] =
  7.                 {
  8.                     [5491] = {70, 170},
  9.                 },
  10.                 ['Ilosc'] =
  11.                 {
  12.                     [5491] = {1, 1},
  13.                 },
  14.                 ['IloscItemow'] =
  15.                 {
  16.                     [5491] = 2,
  17.                 },
  18.             }
  19.         end
  20.        
  21.         when kill with npc.get_race() == 5491 begin
  22.             chat("zabiles1")
  23.             local settings = nagroda_boss.settings()
  24.             local przedmioty = settings.IloscItemow[npc.get_race()]
  25.  
  26.             local numerek1 = number(1, przedmioty)
  27.             local numerek2 = number(1, przedmioty)
  28.             local numerek3 = number(1, przedmioty)
  29.            
  30.             local item1 = settings.Nagroda[npc.get_race()][numerek1]
  31.             local item2 = settings.Nagroda[npc.get_race()][numerek2]
  32.             local item3 = settings.Nagroda[npc.get_race()][numerek3]
  33.            
  34.             local ilosc1 = settings.Ilosc[npc.get_race()][numerek1]
  35.             local ilosc2 = settings.Ilosc[npc.get_race()][numerek2]
  36.             local ilosc3 = settings.Ilosc[npc.get_race()][numerek3]
  37.  
  38.            
  39.             pc.setqf("boss_nagroda_1", numerek1)
  40.             pc.setqf("boss_nagroda_2", numerek2)
  41.             pc.setqf("boss_nagroda_3", numerek3)
  42.             pc.setqf("boss_nagroda_boss", npc.get_race())
  43.             cmdchat("Gui_Wybor_Boss_Nagroda "..item1.." "..item2.." "..item3.." "..ilosc1.." "..ilosc2.." "..ilosc3)
  44.             chat("zabiles2")
  45.         end
  46.        
  47.         when button or info begin
  48.             local wybor = get_input()
  49.             local settings = nagroda_boss.settings()
  50.             if wybor == "1" then
  51.                 chat("Gratulacje, wybrales nagrode!")
  52.                 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")])
  53.  
  54.             elseif wybor == "2" then
  55.                 chat("Gratulacje, wybrales nagrode!")
  56.                 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")])
  57.  
  58.             elseif wybor == "3" then
  59.                 chat("Gratulacje, wybrales nagrode!")
  60.                 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")])
  61.             end
  62.         end
  63.        
  64.     end
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement