Jump to content

Quest Time - 1 Hour Daily


Recommended Posts

quest test begin
	state start begin
		when login with (pc.get_map_index()==INDEX and pc.getqf("time_pass")<=get_time()) or pc.get_level()<95 begin
			if pc.get_level()<95 then
                                chat("You need to be at least level 95, you will be warped")
                        else if pc.get_level()>=95 then
                                chat("Your trial period has ended")
                        end
			if pc.get_empire()==1 then 
				pc.warp(cords,cords)
			elseif pc.get_empire()==2 then
				pc.warp(cords,cords)
			else
				pc.warp(cords,cords)
			end
		end
		when npcvnum.chat."I want to teleport for one hour" begin
			if pc.getqf("timepass") <= get_time() then 
				say("You can't teleport now please wait.")
                        elseif pc.get_level()<95 then
                                say("You need to be at least level 95")
			else	
				pc.setqf("timepass",24*60*60)
				say("You can go have fun")
				pc.warp(cords,cords)
			end
		end
	end
end

I haven't got a test server atm so i can't tell you if it will work, replace the cords and map index, and try it :)

  • Metin2 Dev 1
  • Love 1
Link to comment
Share on other sites

  • Premium

At game (npc 20090):

 

"You can't teleport now please wait."


Why can't teleport first time? :(
  :(  :angry: 

quest event1 begin
    state start begin
        when login with (pc.get_map_index()==103 and pc.getqf("time_pass")<=get_time()) or pc.get_level()<95 begin
            if pc.get_level()<95 then
                                chat("You need to be at least level 95, you will be warped")
                        else if pc.get_level()>=95 then
                                chat("Your time period has ended.")
								chat("Back later!")
                        end
            if pc.get_empire()==1 then 
                pc.warp(3812585, 3799162)
            elseif pc.get_empire()==2 then
                pc.warp(3812585, 3799162)
            else
                pc.warp(3812585, 3799162)
            end
        end
		end
        when 20090.chat."Akapo Map (LV.95)" begin
            if pc.getqf("timepass") <= get_time() then 
                say("You can't teleport now please wait.")
                        elseif pc.get_level()<95 then
                                say("You need to be at least level 95")
            else   
                pc.setqf("timepass",24*60*60)
                say("You can go have fun")
                pc.warp(456,456)
            end
        end
    end
end
Link to comment
Share on other sites

  • Premium
quest event1 begin
    state start begin
		when login with (pc.get_map_index()==103 and pc.getqf("timepass2")<get_time()) or (pc.get_level()<95 and pc.get_map_index()==103) begin
            if pc.get_level()<95 then
                                chat("You need to be at least level 95, you will be warped")
                        else if pc.get_level()>=95 then
                                chat("Your time period has ended.")
                                chat("Back later!")
                        end
            if pc.get_empire()==1 then 
                pc.warp(3812585, 3799162)
            elseif pc.get_empire()==2 then
                pc.warp(3812585, 3799162)
            else
                pc.warp(3812585, 3799162)
            end
        end
        end
        when 20090.chat."Akapo Map (LV.95)" begin
            if pc.getqf("timepass2") < get_time() then 
                say("You can't teleport now please wait.")
                        elseif pc.get_level()<95 then
                                say("You need to be at least level 95")
            else  
                pc.setqf("timepass2",24)
                say("You can go now, have fun.")
                pc.warp(456,456)
            end
        end
    end
end

I just can see at game:

say("You can't teleport now please wait.")

I've put the timepass2 to 24 seconds (just to test)

pc.setqf("timepass2",24)

I can't enter to the map via the quest. I change the time's names to timepass2 (just to test). First try can't enter in the map too.  :unsure:  :excl:

Link to comment
Share on other sites

quest event1 begin
    state start begin
        when login with (pc.get_map_index()==103 and pc.getqf("timepass2")>=get_time()) or (pc.get_level()<95 and pc.get_map_index()==103) begin
            if pc.get_level()<95 then
				chat("You need to be at least level 95, you will be warped")
			else if pc.get_level()>=95 then
				chat("Your time period has ended.")
				chat("Back later!")
			end
            if pc.get_empire()==1 then 
                pc.warp(3812585, 3799162)
            elseif pc.get_empire()==2 then
                pc.warp(3812585, 3799162)
            else
                pc.warp(3812585, 3799162)
            end
        end
        end
        when 20090.chat."Akapo Map (LV.95)" begin
            if pc.getqf("timepass2") >= get_time() then 
                say("You can't teleport now please wait.")
			elseif pc.get_level()<95 then
				say("You need to be at least level 95")
            else 
                pc.setqf("timepass2",24*60*60)
                say("You can go now, have fun.")
                pc.warp(45600,45600)
            end
        end
    end
end

Okay try this out too, also i think that your cords should be (45600,45600) not (456,456)

Link to comment
Share on other sites

quest event1 begin
    state start begin
        when login with (pc.get_map_index()==103 and pc.getqf("timepass2")<=get_time()) or (pc.get_level()<95 and pc.get_map_index()==103) begin
            if pc.get_level()<95 then
                chat("You need to be at least level 95, you will be warped")
            else if pc.get_level()>=95 then
                chat("Your time period has ended.")
                chat("Back later!")
            end
            if pc.get_empire()==1 then 
                pc.warp(3812585, 3799162)
            elseif pc.get_empire()==2 then
                pc.warp(3812585, 3799162)
            else
                pc.warp(3812585, 3799162)
            end
        end
        end
        when 20090.chat."Akapo Map (LV.95)" begin
            if pc.getqf("timepass2") >= get_time() then 
                say("You can't teleport now please wait.")
            elseif pc.get_level()<95 then
                say("You need to be at least level 95")
            else
                pc.setqf("timepass2",24*60*60)
                say("You can go now, have fun.")
                pc.warp(45600,45600)
            end
        end
    end
end

Okay this will work normaly i think :D sorry as i told you i don't have a running server atm

  • Love 1
Link to comment
Share on other sites

quest event1 begin
    state start begin
        when login with (pc.get_map_index()==103 and pc.getqf("timepass2")<=get_time()) or (pc.get_level()<95 and pc.get_map_index()==103) begin
            if pc.get_level()<95 then
                chat("You need to be at least level 95, you will be warped")
            end
            if pc.get_empire()==1 then 
                pc.warp(3812585, 3799162)
            elseif pc.get_empire()==2 then
                pc.warp(3812585, 3799162)
            else
                pc.warp(3812585, 3799162)
            end
        end
        when 20090.chat."Akapo Map (LV.95)" begin
            if pc.getqf("timepass2") >= get_time() then 
                say("You can't teleport now please wait.")
            elseif pc.get_level()<95 then
                say("You need to be at least level 95")
            else
                pc.setqf("timepass2",get_time()+24*60*60)
                say("You can go now, have fun.")
                pc.warp(45600,45600)
            end
        end
    end
end
Link to comment
Share on other sites

Try it, I did in a few mins, you must modify the vars with #.

quest blabla begin
state start begin

when #xx.chat."Map" with pc.getqf("access")+3600*23 < get_time() begin
    pc.setqf("access",get_time()+3600)
    pc.warp(#x,#y)
end

when login with pc.get_map_index() == #MAP_ID begin
    if pc.getqf("access") < get_time() then
        warp_to_village()
    else
        timer("exit",pc.getqf("access")-get_time())
    end
end

when exit.timer begin
    warp_to_village()
end

when logout with pc.get_map_index() == #MAP_ID begin
    cleartimer("exit")
end

end
end


  • Love 1
Link to comment
Share on other sites

  • Premium

 

Try it, I did in a few mins, you must modify the vars with #.

quest blabla begin
state start begin

when #xx.chat."Map" with pc.getqf("access")+3600*23 < get_time() begin
    pc.setqf("access",get_time()+3600)
    pc.warp(#x,#y)
end

when login with pc.get_map_index() == #MAP_ID begin
    if pc.getqf("access") < get_time() then
        warp_to_village()
    else
        timer("exit",pc.getqf("access")-get_time())
    end
end

when exit.timer begin
    warp_to_village()
end

when logout with pc.get_map_index() == #MAP_ID begin
    cleartimer("exit")
end

end
end


I modified all vars with # made by Pepineitor.

Now I have this:

 

quest event1 begin
state start begin
 
when 20090.chat."Akapo Map (LVL.95)" with pc.getqf("access222")+3600*23 < get_time() begin
    pc.setqf("access222",get_time()+3600)
    pc.warp(45600,45600)
end
 
when login with pc.get_map_index() == 103 begin
    if pc.getqf("access222") < get_time() then
        warp_to_village()
    else
        timer("exit",pc.getqf("access222")-get_time())
    end
end
 
when exit.timer begin
    warp_to_village()
end
 
when logout with pc.get_map_index() == 103 begin
    cleartimer("exit")
end
 
end
end

I think I have all working. Thank you.

Can you help me with one more thing?

How can I display this Seconds in Minutes?

 

		akapotime = pc.getqf("access222")-get_time()
		say("Time left: "..akapotime.." Seconds")
        timer("exit",pc.getqf("access222")-get_time())

Thank you @Pepineitor and @Sober for helping me.

 

:D  :D  They rock!

Link to comment
Share on other sites

  • Premium

 

Use time_to_str:

akapotime = pc.getqf("access222")-get_time()
say(string.format("%s", time_to_str(akapotime)))
timer("exit",pc.getqf("access222")-get_time())

 

JiIPf.png

Quest still don't working. I get out the map after 1 hour. I can enter again without waiting 24 hours. Time not showing correctly.

 

quest event1 begin
state start begin
 
when 20090.chat."Akapo Map (LVL.95)" with pc.getqf("access222")+3600*23 < get_time() begin
    pc.setqf("access222",get_time()+3600)
    pc.warp(45600,45600)
end
 
when login with pc.get_map_index() == 103 begin
    if pc.getqf("access222") < get_time() then
        warp_to_village()
    else
		akapotime = pc.getqf("access222")-get_time()
		say(string.format("%s", time_to_str(akapotime)))
		timer("exit",pc.getqf("access222")-get_time())
    end
end
 
when exit.timer begin
    warp_to_village()
end
 
when logout with pc.get_map_index() == 103 begin
    cleartimer("exit")
end
 
end
end

:blush:  :blush:  :excl:  :excl:  :excl:  :excl:

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

I think you want this, try it

quest event1 begin
state start begin
  
when 20090.chat."Akapo Map (LVL.95)" begin
	if pc.getqf("access222")+3600*23 < get_time() then
		pc.setqf("access222",get_time()+3600)
		pc.warp(45600,45600)
	else
		local tr = (pc.getqf("access222")+3600*23)-get_time()
		say("You can enter other time to the map in: "..tr.." min.")
	end
end
  
when login with pc.get_map_index() == 103 begin
    if pc.getqf("access222") < get_time() then
        warp_to_village()
    else
		local tr = (pc.getqf("access222")-get_time())/60
		say("Time remaining in the map: "..tr.." min.")
        timer("exit",pc.getqf("access222")-get_time())
    end
end
  
when exit.timer begin
    warp_to_village()
end
  
when logout with pc.get_map_index() == 103 begin
    cleartimer("exit")
end
  
end
end
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.