Guest User

Item_80009_dziala

a guest
Jul 3rd, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.80 KB | None | 0 0
  1. quest item_80009 begin
  2.         state start begin
  3.                 function pc.set_level(lev)
  4.                         if pc.getqf("__NEXT_LEVEL__") == 0 then
  5.                                 pc.setqf("__NEXT_LEVEL__", 1)
  6.  
  7.                                         if pc.level >= lev then
  8.                                                 return
  9.                                         end
  10.                                 repeat
  11.                                 pc.give_exp2(pc.get_next_exp())
  12.                                 until pc.level == lev
  13.                         end
  14.                 end
  15.                 when 80009.use begin
  16.                         local nazwa_item = "Pierścień Teleportacji:"
  17.                         say_title(nazwa_item)
  18.                         say("Wybierz interesującą Ciebie opcje:")
  19.                         say()
  20.                         local wybor = select("Poziom", "Ranga", "Yang", "Anuluj")
  21.                                 if wybor == 4 then
  22.                                         return
  23.                                 elseif wybor == 1 then
  24.                                         say_title(nazwa_item)
  25.                                         say("Podaj jaki chcesz posiadać poziom:")
  26.                                         local poziom_ilosc = tonumber(input())
  27.                                                 if poziom_ilosc < 1 or poziom_ilosc > 250 then
  28.                                                         say_title(nazwa_item)
  29.                                                         say("Podałeś niepoprawną wartość ")
  30.                                                 else
  31.                                                         pc.set_level(poziom_ilosc)
  32.                                                         say_title(nazwa_item)
  33.                                                         say("Otrzymałeś: "..poziom_ilosc.." poziom")
  34.                                                 end
  35.                                 elseif wybor == 2 then
  36.                                         say_title(nazwa_item)
  37.                                         say("Wybierz rangę: ")
  38.                                         local ilosc_ranga = tonumber(input())
  39.                                                 if ilosc_ranga < -30000 or ilosc_ranga > 30000 then
  40.                                                         say_title(nazwa_item)
  41.                                                         say("Zła wartość!")
  42.                                                 else
  43.                                                         pc.get_alignment(pc.change_alignment()+ilosc_ranga)
  44.                                                         say_title(nazwa_item)
  45.                                                         say("Otrzymałeś: "..ilosc_ranga.." pkt. rangi")
  46.                                                 end
  47.                                 elseif wybor == 3 then
  48.                                         say_title(nazwa_item)
  49.                                         say("Podaj ile yang chcesz otrzymać: ")
  50.                                         local ilosc_yang = tonumber(input())
  51.                                                 if ilosc_yang < 1 or ilosc_yang > 1999999999 then
  52.                                                         say_title(nazwa_item)
  53.                                                         say("Podałeś złą ilość yang")
  54.                                                 else
  55.                                                          pc.change_money(ilosc_yang)
  56.                                                         say_title(nazwa_item)
  57.                                                         say("Otrzymałeś: "..ilosc_yang.." yang")
  58.                                                 end
  59.                                 end
  60.                 end
  61.         end
  62. end
Advertisement
Add Comment
Please, Sign In to add comment