Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- (c) 2014 Zetsu --
- -- Metin2.Dev --
- quest thsgiftdev begin
- state start begin
- when login begin
- cmdchat("zetsugfsys "..q.getcurrentquestindex())
- if pc.getqf("giftsystemuse") <= get_time() then
- cmdchat("giftsyshide")
- end
- end
- function giverandomitem()
- local random_nr = number(1,5)
- chat("I: The box it's opening...") -- Opening
- pc.give_item2(tonumber(mysql_query('SELECT box'..random_nr..' as gift_box from player.surprisebox WHERE openorclose=1 LIMIT 1;').gift_box[1])) -- Thanks Denis!! :D
- pc.setqf("giftsystemuse", get_time()+60*60*12) -- 12 HRS (Captain math: cause 1hr has 60 min, 1min=60sec)
- cmdchat("giftsyshide")
- end
- when 17609.use with pc.get_level() >= 10 begin
- local random_nr = number(1,5)
- chat("I: The box it's opening...")
- pc.give_item2(tonumber(mysql_query('SELECT box'..random_nr..' as gift_box from player.surprisebox WHERE openorclose=1 LIMIT 1;').gift_box[1])) -- Thanks Denis again!! :D
- end
- when button or info begin
- if pc.getqf("giftsystemuse") <= get_time() then
- thsgiftdev.giverandomitem() -- yeah..function -_- don't try to bind that condition with this..
- else
- chat("W: You have no gift. Try after 12 hours...") -- Played
- cmdchat("giftsyshide")
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement