Jump to content

Quest Time - 1 Hour Daily


Recommended Posts

  • Premium

Try

quest event1 begin
    state start begin
    when 20090.chat."Akapo Map (LVL.95)" begin
        if pc.getqf("24h") == 0 then
            pc.setqf("access222",get_time()+3600)
            pc.warp(45600,45600)
        else
        say_title(" test ")
        say(" can't in this time ")
    end
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(" stil have "..akapotime.." seconds. ")
            timer("exit",pc.getqf("access222")-get_time())
            pc.setqf("24h", 1)
    end
end
 
    when exit.timer begin
        warp_to_village()
        pc.setqf("24h", 0)
        end
    end
end

If you're going to do something, then do it right.

Link to comment
Share on other sites

  • Premium

Okay devs, I end the quest with correct times and no bugs.

Thanks for help.  :wub:  :wub: 

 

quest event1 begin
    state start begin
    when 20090.chat."Akapo Map (LVL.95)" begin
        if pc.getqf("24h") == 0 then
            pc.setqf("akapo2223",get_time()+3600)
            pc.warp(45600,45600)
		elseif pc.getqf("24h") == 2 then
			pc.warp(45600,45600)
		elseif pc.getqf("access666")< get_time() then
			pc.setqf("akapo2223",get_time()+3600)
            pc.warp(45600,45600)
		elseif pc.getqf("access666")> get_time() then
			akapotim3 = pc.getqf("access666")-get_time()
            say("You have to wait "..akapotim3.." seconds to enter.")
        elseif pc.get_level() < 95 then
        say_title("Heuk-Young")
        say("You need to be at level 95.")
		say("Akapo Map not made for noobs.")
    end
end
  
    when login with pc.get_map_index() == 103 begin
        if pc.getqf("akapo2223") < get_time() then
            warp_to_village()
        else
            akapotime = pc.getqf("akapo2223")-get_time()
            say("You have "..akapotime.." seconds. ")
            timer("exit",pc.getqf("akapo2223")-get_time())
            pc.setqf("24h", 2)
    end
end
  
    when exit.timer begin
        warp_to_village()
        pc.setqf("24h", 22)
		pc.setqf("access666",get_time()+86400)
        end
    end
end
  • Love 1
Link to comment
Share on other sites

  • Premium

Okay devs, I end the quest with correct times and no bugs.

Thanks for help.  :wub:  :wub: 

 

quest event1 begin
    state start begin
    when 20090.chat."Akapo Map (LVL.95)" begin
        if pc.getqf("24h") == 0 then
            pc.setqf("akapo2223",get_time()+3600)
            pc.warp(45600,45600)
		elseif pc.getqf("24h") == 2 then
			pc.warp(45600,45600)
		elseif pc.getqf("access666")< get_time() then
			pc.setqf("akapo2223",get_time()+3600)
            pc.warp(45600,45600)
		elseif pc.getqf("access666")> get_time() then
			akapotim3 = pc.getqf("access666")-get_time()
            say("You have to wait "..akapotim3.." seconds to enter.")
        elseif pc.get_level() < 95 then
        say_title("Heuk-Young")
        say("You need to be at level 95.")
		say("Akapo Map not made for noobs.")
    end
end
  
    when login with pc.get_map_index() == 103 begin
        if pc.getqf("akapo2223") < get_time() then
            warp_to_village()
        else
            akapotime = pc.getqf("akapo2223")-get_time()
            say("You have "..akapotime.." seconds. ")
            timer("exit",pc.getqf("akapo2223")-get_time())
            pc.setqf("24h", 2)
    end
end
  
    when exit.timer begin
        warp_to_village()
        pc.setqf("24h", 22)
		pc.setqf("access666",get_time()+86400)
        end
    end
end

 

 

Good ;) But you can still use my version

 

quest akapo_map begin
	state start begin
		when enter begin
			if pc.get_map_index() == 103 then
				if pc.getqf("enter_time") <= get_time() then
					say_title("Information:")
					say("One hour passed. [ENTER][ENTER] You will be teleported to village soon.")
					wait()
					pc.setqf("enter_time", 0)
					warp_to_village()
				end
			end
		end
		
		when 20090.chat."Akapo Map (Lvl. 95)" begin
			say_title(mob_name(20090)..":")
			----"01234567890123456789012345678901234567890"
			if pc.get_level() >= 95 then
				say("Do you really want to warp to[ENTER]Akapo Map?")
				say("")
				local s = select("Yes", "No")
				if s == 2 then
					return
				elseif s == 1 then
					say_title(mob_name(20090)..":")
					say("You will warp for a moment.[ENTER][ENTER]Please be carefull.")
					wait()
					set_state(warp_to_map)
				end
			else
				say("You must have at least 95 level.")
				say("Akapo Map isn't made for noobs.")
			end
		end
	end
	
	state warp_to_map begin
		when enter begin
			pc.setqf("enter_time", get_time() + 60 * 60)
			pc.warp(45600, 45600)
			loop_timer('check_time', 1 * 30) -- one time per 30 seconds
		end
		
		when check_time.timer begin
			if pc.getqf("enter_time") <= get_time() then
				set_state(start)
			end
		end
		
		when login begin
			if pc.getqf("enter_time") <= get_time() then
				set_state(start)
			end
			loop_timer('check_time', 1 * 30)
		end
		
		when 20090.chat."Return to Akapo" begin
			say_title(mob_name(20090)..":")
			say2("I'll teleport you soon.[ENTER][ENTER]Please be carefull.")
			pc.warp(45600, 45600)
		end
	end
end
  • Love 2
Link to comment
Share on other sites

  • Premium

I can enter at map (first time). How I can see time? (no time)
Would be perfect if I can see 1 hour time and 24 hour time. (just saying)

Error find: "say2"
 

quest akapo_map begin
    state start begin
        when enter begin
            if pc.get_map_index() == 103 then
                if pc.getqf("enter_time") <= get_time() then
                    say_title("Information:")
                    say("One hour passed. [ENTER][ENTER] You will be teleported to village soon.")
                    wait()
                    pc.setqf("enter_time", 0)
                    warp_to_village()
                end
            end
        end
         
        when 20090.chat."Akapo Map (Lvl. 95)" begin
            say_title(mob_name(20090)..":")
            ----"01234567890123456789012345678901234567890"
            if pc.get_level() >= 95 then
                say("Do you really want to warp to[ENTER]Akapo Map?")
                say("")
                local s = select("Yes", "No")
                if s == 2 then
                    return
                elseif s == 1 then
                    say_title(mob_name(20090)..":")
                    say("You will warp for a moment.[ENTER][ENTER]Please be carefull.")
                    wait()
                    set_state(warp_to_map)
                end
            else
                say("You must have at least 95 level.")
                say("Akapo Map isn't made for noobs.")
            end
        end
    end
     
    state warp_to_map begin
        when enter begin
            pc.setqf("enter_time", get_time() + 60 * 60)
            pc.warp(45600, 45600)
            loop_timer('check_time', 1 * 30) -- one time per 30 seconds
        end
         
        when check_time.timer begin
            if pc.getqf("enter_time") <= get_time() then
                set_state(start)
            end
        end
         
        when login begin
            if pc.getqf("enter_time") <= get_time() then
                set_state(start)
            end
            loop_timer('check_time', 1 * 30)
        end
         
        when 20090.chat."Return to Akapo" begin
            say_title(mob_name(20090)..":")
            say("I'll teleport you soon.[ENTER][ENTER]Please be carefull.")
            pc.warp(45600, 45600)
        end
    end
end
Link to comment
Share on other sites

  • Premium

Change say2 to say :D I'm using say2 function to show text, sorry :P

I need to show times at your quest.

quest akapo_map begin
	state start begin
		when enter begin
			if pc.get_map_index() == 103 then
				if pc.getqf("enter_time") <= get_time() then
					say_title("Information:")
					say("One hour passed. [ENTER][ENTER] You will be teleported to village soon.")
					wait()
					pc.setqf("enter_time", 0)
					warp_to_village()
				end
			end
			clear_letter()
		end
		
		when 20090.chat."Akapo Map (Lvl. 95)" begin
			say_title(mob_name(20090)..":")
			----"01234567890123456789012345678901234567890"
			if pc.get_level() >= 95 then
				say("Do you really want to warp to[ENTER]Akapo Map?")
				say("")
				local s = select("Yes", "No")
				if s == 2 then
					return
				elseif s == 1 then
					say_title(mob_name(20090)..":")
					say("You will warp for a moment.[ENTER][ENTER]Please be carefull.")
					wait()
					set_state(warp_to_map)
				end
			else
				say("You must have at least 95 level.")
				say("Akapo Map isn't made for noobs.")
			end
		end
	end
	
	state warp_to_map begin
		when enter begin
			pc.setqf("enter_time", get_time() + 60 * 60)
			pc.warp(45600, 45600)
			loop_timer('check_time', 1 * 30) -- one time per 30 seconds
		end
		
		when check_time.timer begin
			if pc.getqf("enter_time") <= get_time() then
				set_state(start)
			end
		end
		
		when login begin
			if pc.getqf("enter_time") <= get_time() then
				set_state(start)
			end
			if pc.get_map_index() == 103 then
				send_letter("Akapo Map")
				local rest_time = pc.getqf("enter_time") - get_time()
				q.set_clock("Rest time", rest_time)
			end
			loop_timer('check_time', 1 * 30)
		end
		
		when button or info begin
			say_title("Akapo Map")
			say("You're allowed to enter to Akapo Map.")
			if pc.get_map_index() == 103 then
				local remain_minutes = math.ceil((pc.getqf("enter_time") - get_time()) / 60)
				local remain_seconds = pc.getqf("enter_time") - (remain_minutes) * 60
				say("")
				say_reward("Remaining time: "..remain_minutes.."m "..remain_seconds.."s.")
			else
				say("Go to "..mob_name(20090) to enter there.")
			end
		end
		
		when 20090.chat."Return to Akapo" begin
			say_title(mob_name(20090)..":")
			say("I'll teleport you soon.[ENTER][ENTER]Please be carefull.")
			pc.warp(45600, 45600)
		end
	end
end
Link to comment
Share on other sites

  • Premium

 

 

Change say2 to say :D I'm using say2 function to show text, sorry :P

I need to show times at your quest.

 

quest akapo_map begin
	state start begin
		when enter begin
			if pc.get_map_index() == 103 then
				if pc.getqf("enter_time") <= get_time() then
					say_title("Information:")
					say("One hour passed. [ENTER][ENTER] You will be teleported to village soon.")
					wait()
					pc.setqf("enter_time", 0)
					warp_to_village()
				end
			end
			clear_letter()
		end
		
		when 20090.chat."Akapo Map (Lvl. 95)" begin
			say_title(mob_name(20090)..":")
			----"01234567890123456789012345678901234567890"
			if pc.get_level() >= 95 then
				say("Do you really want to warp to[ENTER]Akapo Map?")
				say("")
				local s = select("Yes", "No")
				if s == 2 then
					return
				elseif s == 1 then
					say_title(mob_name(20090)..":")
					say("You will warp for a moment.[ENTER][ENTER]Please be carefull.")
					wait()
					set_state(warp_to_map)
				end
			else
				say("You must have at least 95 level.")
				say("Akapo Map isn't made for noobs.")
			end
		end
	end
	
	state warp_to_map begin
		when enter begin
			pc.setqf("enter_time", get_time() + 60 * 60)
			pc.warp(45600, 45600)
			loop_timer('check_time', 1 * 30) -- one time per 30 seconds
		end
		
		when check_time.timer begin
			if pc.getqf("enter_time") <= get_time() then
				set_state(start)
			end
		end
		
		when login begin
			if pc.getqf("enter_time") <= get_time() then
				set_state(start)
			end
			if pc.get_map_index() == 103 then
				send_letter("Akapo Map")
				local rest_time = pc.getqf("enter_time") - get_time()
				q.set_clock("Rest time", rest_time)
			end
			loop_timer('check_time', 1 * 30)
		end
		
		when button or info begin
			say_title("Akapo Map")
			say("You're allowed to enter to Akapo Map.")
			if pc.get_map_index() == 103 then
				local remain_minutes = math.ceil((pc.getqf("enter_time") - get_time()) / 60)
				local remain_seconds = pc.getqf("enter_time") - (remain_minutes) * 60
				say("")
				say_reward("Remaining time: "..remain_minutes.."m "..remain_seconds.."s.")
			else
				say("Go to "..mob_name(20090) to enter there.")
			end
		end
		
		when 20090.chat."Return to Akapo" begin
			say_title(mob_name(20090)..":")
			say("I'll teleport you soon.[ENTER][ENTER]Please be carefull.")
			pc.warp(45600, 45600)
		end
	end
end

Quest does not open at NPC.

Link to comment
Share on other sites

  • Premium

Last quest is giving this error:

0V4Pe.png

quest akapo_map begin
    state start begin
        when enter begin
            if pc.get_map_index() == 103 then
                if pc.getqf("enter_time") <= get_time() then
                    say_title("Information:")
                    say("One hour passed.")
					say("You will be teleported to village soon.")
                    wait()
                    warp_to_village()
                end
            end
            clear_letter()
        end
         
        when 20090.chat."Akapo Map (Lvl. 95)" begin
            say_title("Heuk Young:")
            ----"01234567890123456789012345678901234567890"
            if pc.get_level() >= 95 then
                if pc.getqf("enter_time") + (60* 60 * 24) <= get_time() then -- if player character flag "enter_time" + (60s * 60m * 24h) is lower than actual time tell player he can't enter
                    say("Do you really want to warp to")
					say("Akapo Map?")
                    say("")
                    local s = select("Yes", "No")
                    if s == 2 then
                        return
                    elseif s == 1 then
                        say_title("Heuk Young:")
                        say("You will warp for a moment.")
						say("Please be carefull.")
                        wait()
                        set_state(warp_to_map)
                    end
                else
                    local remain_hours = math.ceil((pc.getqf("enter_time") + (60* 60 * 24) - get_time()) / 60 / 60)
                    say("You can't enter right now to Akapo Map.")
					say("Please wait "..remain_hours.." hours more.")
            else
                say("You must have at least 95 level.")
                say("Akapo Map isn't made for noobs.")
            end
        end
    end
     
    state warp_to_map begin
        when enter begin
            pc.setqf("enter_time", get_time() + 60 * 60)
            pc.warp(45600, 45600)
            loop_timer('check_time', 1 * 30) -- one time per 30 seconds
        end
         
        when check_time.timer begin
            if pc.getqf("enter_time") <= get_time() then
                set_state(start)
            end
        end
         
        when login begin
            if pc.getqf("enter_time") <= get_time() then
                set_state(start)
            end
            if pc.get_map_index() == 103 then
                send_letter("Akapo Map")
                local rest_time = pc.getqf("enter_time") - get_time()
                q.set_clock("Rest time", rest_time)
            end
            loop_timer('check_time', 1 * 30)
        end
         
        when button or info begin
            say_title("Akapo Map")
            say("You're allowed to enter to Akapo Map.")
            if pc.get_map_index() == 103 then
                local remain_minutes = math.ceil((pc.getqf("enter_time") - get_time()) / 60)
                local remain_seconds = pc.getqf("enter_time") - (remain_minutes) * 60
                say("")
                say_reward("Remaining time: "..remain_minutes.."m "..remain_seconds.."s.")
            else
                say("Go to Heuk Young to enter there.")
            end
        end
         
        when 20090.chat."Return to Akapo" begin
            say_title("Heuk Young:")
            say("I'll teleport you soon.")
			say("Please be carefull.")
            pc.warp(45600, 45600)
        end
    end
end
Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • 2 years later...
On 2014. 12. 22. at 11:24 AM, iRETEMAG said:

Hello,
Fixed here

Spoiler

quest akapo_map begin
    state start begin
        when enter begin
            if pc.get_map_index() == 103 then
                if pc.getqf("enter_time") <= get_time() then
                    say_title("Information:")
                    say("One hour passed.")
                    say("You will be teleported to village soon.")
                    wait()
                    warp_to_village()
                end
            end
            clear_letter()
        end
         
        when 20090.chat."Akapo Map (Lvl. 95)" begin
            say_title("Heuk Young:")
            if pc.get_level() < 95 then
                if pc.getqf("enter_time") + (60* 60 * 24) <= get_time() then -- if player character flag "enter_time" + (60s * 60m * 24h) is lower than actual time tell player he can't enter
                    say("Do you really want to warp to")
                    say("Akapo Map?")
                    say("")
                    local s = select("Yes", "No")
                    if s == 2 then
                        return
                    end
                    elseif s == 1 then
                        say_title("Heuk Young:")
                        say("You will warp for a moment.")
                        say("Please be carefull.")
                        wait()
                        set_state(warp_to_map)
                    end

                else
                    local remain_hours = math.ceil((pc.getqf("enter_time") + (60* 60 * 24) - get_time()) / 60 / 60)
                    say("You can't enter right now to Akapo Map.")
                    say("Please wait "..remain_hours.." hours more.")
            end
        end
    end
     
    state warp_to_map begin
        when enter begin
            pc.setqf("enter_time", get_time() + 60 * 60)
            pc.warp(45600, 45600)
            loop_timer('check_time', 1 * 30) -- one time per 30 seconds
        end
         
        when check_time.timer begin
            if pc.getqf("enter_time") <= get_time() then
                set_state(start)
            end
        end
         
        when login begin
            if pc.getqf("enter_time") <= get_time() then
                set_state(start)
            end
            if pc.get_map_index() == 103 then
                send_letter("Akapo Map")
                local rest_time = pc.getqf("enter_time") - get_time()
                q.set_clock("Rest time", rest_time)
            end
            loop_timer('check_time', 1 * 30)
        end
         
        when button or info begin
            say_title("Akapo Map")
            say("You're allowed to enter to Akapo Map.")
            if pc.get_map_index() == 103 then
                local remain_minutes = math.ceil((pc.getqf("enter_time") - get_time()) / 60)
                local remain_seconds = pc.getqf("enter_time") - (remain_minutes) * 60
                say("")
                say_reward("Remaining time: "..remain_minutes.."m "..remain_seconds.."s.")
            else
                say("Go to Heuk Young to enter there.")
            end
        end
         
        when 20090.chat."Return to Akapo" begin
            say_title("Heuk Young:")
            say("I'll teleport you soon.")
            say("Please be carefull.")
            pc.warp(45600, 45600)
        end
    end
end

Last quest is giving this error:

0V4Pe.png


quest akapo_map begin
    state start begin
        when enter begin
            if pc.get_map_index() == 103 then
                if pc.getqf("enter_time") <= get_time() then
                    say_title("Information:")
                    say("One hour passed.")
					say("You will be teleported to village soon.")
                    wait()
                    warp_to_village()
                end
            end
            clear_letter()
        end
         
        when 20090.chat."Akapo Map (Lvl. 95)" begin
            say_title("Heuk Young:")
            ----"01234567890123456789012345678901234567890"
            if pc.get_level() >= 95 then
                if pc.getqf("enter_time") + (60* 60 * 24) <= get_time() then -- if player character flag "enter_time" + (60s * 60m * 24h) is lower than actual time tell player he can't enter
                    say("Do you really want to warp to")
					say("Akapo Map?")
                    say("")
                    local s = select("Yes", "No")
                    if s == 2 then
                        return
                    elseif s == 1 then
                        say_title("Heuk Young:")
                        say("You will warp for a moment.")
						say("Please be carefull.")
                        wait()
                        set_state(warp_to_map)
                    end
                else
                    local remain_hours = math.ceil((pc.getqf("enter_time") + (60* 60 * 24) - get_time()) / 60 / 60)
                    say("You can't enter right now to Akapo Map.")
					say("Please wait "..remain_hours.." hours more.")
            else
                say("You must have at least 95 level.")
                say("Akapo Map isn't made for noobs.")
            end
        end
    end
     
    state warp_to_map begin
        when enter begin
            pc.setqf("enter_time", get_time() + 60 * 60)
            pc.warp(45600, 45600)
            loop_timer('check_time', 1 * 30) -- one time per 30 seconds
        end
         
        when check_time.timer begin
            if pc.getqf("enter_time") <= get_time() then
                set_state(start)
            end
        end
         
        when login begin
            if pc.getqf("enter_time") <= get_time() then
                set_state(start)
            end
            if pc.get_map_index() == 103 then
                send_letter("Akapo Map")
                local rest_time = pc.getqf("enter_time") - get_time()
                q.set_clock("Rest time", rest_time)
            end
            loop_timer('check_time', 1 * 30)
        end
         
        when button or info begin
            say_title("Akapo Map")
            say("You're allowed to enter to Akapo Map.")
            if pc.get_map_index() == 103 then
                local remain_minutes = math.ceil((pc.getqf("enter_time") - get_time()) / 60)
                local remain_seconds = pc.getqf("enter_time") - (remain_minutes) * 60
                say("")
                say_reward("Remaining time: "..remain_minutes.."m "..remain_seconds.."s.")
            else
                say("Go to Heuk Young to enter there.")
            end
        end
         
        when 20090.chat."Return to Akapo" begin
            say_title("Heuk Young:")
            say("I'll teleport you soon.")
			say("Please be carefull.")
            pc.warp(45600, 45600)
        end
    end
end

 

Edited by Metin2 Dev
Core X - External 2 Internal

787292068_Nvtelen.png.6faa7b0bbb3398fd29

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.