Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- quest lotto_dziwko begin
- state start begin
- when 20095.take with item.get_type() == 10 begin
- npc.name()
- say("Twoje punkty wymiany: "..pc.getqf("lotto"))
- say("Czy chcesz oddać :")
- say_item_vnum(item.get_vnum())
- if select(locale.yes,locale.no) == 1 then
- local limit = 50
- local xd = math.random(limit)
- npc.name()
- say("Za "..item_name(item.get_vnum()).." otrzymano "..xd.." punktów.")
- say("Punkty te możesz wymienić za punkty na loterii")
- say("Pamiętaj, że im więcej masz")
- say("punktów, tym większa ilość losów!")
- pc.setqf("lotto", pc.getqf("lotto")+xd)
- item.remove()
- end
- end
- when 20095.chat."Loteria!" begin
- npc.name()
- say("Witaj!")
- say("Zajmuję się małym konkursem.")
- say("Obracam wartościowymi przedmiotami w loterii.")
- say("Jeśli masz wystarczającą ilość punktów, mogę ")
- say("wpuścić Cię do loterii. Ale! Możesz losować ")
- say("raz na 12 godzin. Chyba, że zagadasz")
- say("do mnie i ubijemy mały biznes... To jak?")
- wait()
- if pc.getqf("lotto") < 1 then
- npc.name()
- say("Wybacz, ale nie masz żadnych punktów!")
- return
- else
- local y = {
- [1] = {71084},
- [2] = {71085},
- [3] = {71001},
- [4] = {71004},
- [5] = {71018},
- [6] = {71019},
- [7] = {71020},
- [8] = {71034},
- [9] = {71044},
- [10] = {71045},
- }
- local n = number(1, table.getn(y))
- local limit_count = 100
- local z = math.random(limit_count)
- local acc_time = get_time()
- local old_time = pc.getqf("lotto_limit")
- if acc_time < old_time and pc.getqf("lotto_troll") == 0 then
- local diff = math.ceil((old_time - acc_time)/3600)
- local h
- if diff == 1 then
- h = "godzinę."
- elseif (diff >= 2 and diff <= 4) or diff >= 22 then
- h = "godziny."
- else
- h = "godzin."
- end
- npc.name()
- say("Musisz poczekać jeszcze "..diff.." "..h)
- else
- pc.setqf("lotto", pc.getqf("lotto")-1)
- npc.name()
- say("Twój wylosowany przedmiot to:")
- say_item_vnum(y[n][1])
- say("W ilości "..z.." sztuk.")
- say("")
- say_reward("Pozostałe losy: "..pc.getqf("lotto"))
- say_reward("Została nałożona blokada czasowa.")
- say_reward("Do zobaczenia za 12 godzin!")
- if pc.getqf("lotto_troll") == 1 then
- pc.setqf("lotto_troll", 0)
- end
- pc.give_item2(y[n][1], z)
- pc.setqf("lotto_limit", get_time()+12*60*60)
- end
- end
- end
- when 20095.chat."Obejście Limitu" begin
- local xd = 50
- npc.name()
- say("Mogę zrobić dla Ciebie wyjątek")
- say("jeśli posiadasz "..xd.." losów.")
- say("Wtedy zdejmę Twoją blokadę.")
- say_reward("Kontynuować?")
- if select(locale.yes,locale.no) == 1 then
- if pc.getqf("lotto_troll") == 1 then
- npc.name()
- say("Ale Ty nie masz blokady!")
- return
- else
- if pc.getqf("lotto") < x then
- npc.name()
- say("Nie masz "..xd.." punktów!")
- else
- npc.name()
- say("Dobrze, zdjąłem Twoją blokadę.")
- say("Teraz znów możesz brać udział w loterii.")
- pc.setqf("lotto_troll", 1)
- pc.setqf("lotto", pc.getqf("lotto")-xd)
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment