Jump to content

time in map quest


Recommended Posts

quest special map
	state start begin
		when xyz.chat."Take me to the map" begin
			say("Do you want to enter?")
			local s = select ("Yes", "No")
			if s == 2 then return end
			if s == 1 then pc.warp(x, y) timer("leave_timer", secs) end --Warping and setting timer
		end --when
		
		when "leave_timer".timer begin --When runs out - returns to basic position timer
			pc.warp(x, y)
		end --when
	end --state
end --quest

Try it this way... Code is not tested, only "sample".

 

iBeast

Link to comment
Share on other sites

3 minutes ago, iBeast said:

quest special map
	state start begin
		when xyz.chat."Take me to the map" begin
			say("Do you want to enter?")
        	local s = select ("Yes", "No")
			if s == 2 then return end
			if s == 1 then pc.warp(x, y) timer("leave_timer", secs) end --Warping and setting timer
		end --when
		
		when "leave_timer".timer begin --When runs out - returns to basic position timer
			pc.warp(x, y)
		end --when
	end --state
end --quest

 

my edit

quest special map
	state start begin
		when xyz.chat."Take me to the map" begin
			say("Do you want to enter?")
        	local s = select ("Yes", "No")
			if s == 2 then return end
			if s == 1 then pc.warp(772800, 774700) timer("leave_timer", 10) end --Warping and setting timer
		end --when
		
		when "leave_timer".timer begin --When runs out - returns to basic position timer
			warp_to_village()
		end --when
	end --state
end --quest

enjoy?

Link to comment
Share on other sites

1 minute ago, amosth said:

my edit


quest special map
	state start begin
		when xyz.chat."Take me to the map" begin
			say("Do you want to enter?")
        	local s = select ("Yes", "No")
			if s == 2 then return end
			if s == 1 then pc.warp(772800, 774700) timer("leave_timer", 10) end --Warping and setting timer
		end --when
		
		when "leave_timer".timer begin --When runs out - returns to basic position timer
			warp_to_village()
		end --when
	end --state
end --quest

enjoy?

You have not edited NPC ID in chat function.

Link to comment
Share on other sites

Just now, iBeast said:

You have not edited NPC ID in chat function.

sorry.

quest special map
	state start begin
		when 20006.chat."Take me to the map" begin
			say("Do you want to enter?")
        	local s = select ("Yes", "No")
			if s == 2 then return end
			if s == 1 then pc.warp(772800, 774700) timer("leave_timer", 10) end --Warping and setting timer
		end --when
		
		when "leave_timer".timer begin --When runs out - returns to basic position timer
			warp_to_village()
		end --when
	end --state
end --quest

is correct? warp_to_village() to leave time?

Link to comment
Share on other sites

Just now, amosth said:

sorry.


quest special map
	state start begin
		when 20006.chat."Take me to the map" begin
			say("Do you want to enter?")
        	local s = select ("Yes", "No")
			if s == 2 then return end
			if s == 1 then pc.warp(772800, 774700) timer("leave_timer", 10) end --Warping and setting timer
		end --when
		
		when "leave_timer".timer begin --When runs out - returns to basic position timer
			warp_to_village()
		end --when
	end --state
end --quest

is correct? warp_to_village() to leave time?

(As I wrote... It is not tested, so  theoretically yes)

And yes, when timer runs out, it will do "commands" in that "when".

 

iBeast

Link to comment
Share on other sites

13 minutes ago, iBeast said:

(As I wrote... It is not tested, so  theoretically yes)

 And yes, when timer runs out, it will do "commands" in that "when".

  

iBeast

not work =/

my quest complete

	when 20006.chat."test" with pc.get_map_index()== 1 or pc.get_map_index() == 21 or pc.get_map_index() == 41 begin
		----"111111222222333333444444555555666666777777888888999999000000"
	    say_title("Mirine:")
		say("")
	    say("test")
		say("")
		local lab  = select("Enter", "Exit")
		if lab == 1 then
		if pc.count_item(2498) >= 1 then
		pc.give_item2("2499",1)
		pc.remove_item("2498",1)
		pc.warp(772800,774700)
		timer("leave_timer", 10)
		else
	    say_title("Mirine:")
		say("")
		say("Not item sorry =/")
		say("")
		end
		end
		if lab == 2 then
		return
		end
	end

	when "leave_timer".timer begin --When runs out - returns to basic position timer
		--warp_to_village()
		say("teste")
	end --when	

 

Link to comment
Share on other sites

1 minute ago, amosth said:

not work =/

my quest complete


	when 20006.chat."Labirinto" with pc.get_map_index()== 1 or pc.get_map_index() == 21 or pc.get_map_index() == 41 begin
		----"111111222222333333444444555555666666777777888888999999000000"
	    say_title("Mirine:")
		say("")
	    say("test")
		say("")
		local lab  = select("Enter", "Exit")
		if lab == 1 then
		if pc.count_item(2498) >= 1 then
		pc.give_item2("2499",1)
		pc.remove_item("2498",1)
		pc.warp(772800,774700)
		timer("leave_timer", 10)
		else
	    say_title("Mirine:")
		say("")
		say("Not item sorry =/")
		say("")
		end
		end
		if lab == 2 then
		return
		end
	end

	when "leave_timer".timer begin --When runs out - returns to basic position timer
		--warp_to_village()
		say("teste")
	end --when	

 

Add me on Skype (contact on my website).

I will look at it.

Link to comment
Share on other sites

  • Premium
5 hours ago, iBeast said:

quest special map
	state start begin
		when xyz.chat."Take me to the map" begin
			say("Do you want to enter?")
			local s = select ("Yes", "No")
			if s == 2 then return end
			if s == 1 then pc.warp(x, y) timer("leave_timer", secs) end --Warping and setting timer
		end --when
		
		when "leave_timer".timer begin --When runs out - returns to basic position timer
			pc.warp(x, y)
		end --when
	end --state
end --quest

Try it this way... Code is not tested, only "sample".

 

iBeast

You can't put pc functions inside of global functions, it will crash the server.

Link to comment
Share on other sites

It is simple like a nail.

quest special_map begin
	state start begin	
		when 20006.chat."test" with pc.get_map_index()== 1 or pc.get_map_index() == 21 or pc.get_map_index() == 41 begin
			say_title("Mirine:")
			say("")
			say("test")
			say("")
			if select("Enter", "Exit") == 2 then return end
			if pc.count_item(2498) >= 1 then
				pc.remove_item("2498",1)
				pc.warp(x ,x ) -- Your coordinates are going here
				pc.setqf("duration",get_time()+ 60 * 20) -- The maximum duration the player can be on the map (60 * 20 = 20 minutes)
			else
				say_title("Mirine:")
				say("")
				say("Not item sorry =/")
				say("")
			end
		end

		when login or enter with pc.get_map_index() == x begin -- Put here the index of your special map
			loop_timer("check", 1)
		end
		
		when check.timer begin
			if get_time() > pc.getqf("duration") then
				warp_to_village()
			end
		end
	end
end
Quote

You can't put pc functions inside of global functions, it will crash the server.

The timer and loop_timer are player related. You can use any player related quest command.

  • Love 1
Link to comment
Share on other sites

On 10/21/2018 at 11:50 AM, Xploitz said:

It is simple like a nail.


quest special_map begin
	state start begin	
		when 20006.chat."test" with pc.get_map_index()== 1 or pc.get_map_index() == 21 or pc.get_map_index() == 41 begin
			say_title("Mirine:")
			say("")
			say("test")
			say("")
			if select("Enter", "Exit") == 2 then return end
			if pc.count_item(2498) >= 1 then
				pc.remove_item("2498",1)
				pc.warp(x ,x ) -- Your coordinates are going here
				pc.setqf("duration",get_time()+ 60 * 20) -- The maximum duration the player can be on the map (60 * 20 = 20 minutes)
			else
				say_title("Mirine:")
				say("")
				say("Not item sorry =/")
				say("")
			end
		end

		when login or enter with pc.get_map_index() == x begin -- Put here the index of your special map
			loop_timer("check", 1)
		end
		
		when check.timer begin
			if get_time() > pc.getqf("duration") then
				warp_to_village()
			end
		end
	end
end

The timer and loop_timer are player related. You can use any player related quest command.

Nice!!! Thanks!! 

One question.. the dc map return to map count time?

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



  • Similar Content

  • Activity

    1. 113

      Ulthar SF V2 (TMP4 Base)

    2. 2

      Feeding game source to LLM

    3. 0

      Target Information System

    4. 2

      Feeding game source to LLM

    5. 2

      anti exp explanation pls

    6. 2

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.