amosth 9 Posted October 20, 2018 Share Posted October 20, 2018 Hello How I would create a quest where the player enters the map is 20 minutes and leaves. In case one player can not see the other. Thanksssssss Link to comment Share on other sites More sharing options...
iBeast 106 Posted October 20, 2018 Share Posted October 20, 2018 Then switch map to CH99 and then quest function with timer and after timer ends, warp player back to town. Hope I helped, iBeast Link to comment Share on other sites More sharing options...
amosth 9 Posted October 20, 2018 Author Share Posted October 20, 2018 9 minutes ago, iBeast said: Then switch map to CH99 and then quest function with timer and after timer ends, warp player back to town. Hope I helped, iBeast I do not know how to do the timer the way the player is taken to town. Link to comment Share on other sites More sharing options...
iBeast 106 Posted October 20, 2018 Share Posted October 20, 2018 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 More sharing options...
amosth 9 Posted October 20, 2018 Author Share Posted October 20, 2018 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 More sharing options...
iBeast 106 Posted October 20, 2018 Share Posted October 20, 2018 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 More sharing options...
amosth 9 Posted October 20, 2018 Author Share Posted October 20, 2018 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 More sharing options...
iBeast 106 Posted October 20, 2018 Share Posted October 20, 2018 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 More sharing options...
amosth 9 Posted October 20, 2018 Author Share Posted October 20, 2018 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 More sharing options...
iBeast 106 Posted October 20, 2018 Share Posted October 20, 2018 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 More sharing options...
Premium msnas 1416 Posted October 21, 2018 Premium Share Posted October 21, 2018 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 More sharing options...
iBeast 106 Posted October 21, 2018 Share Posted October 21, 2018 1 hour ago, Mário. said: You can't put pc functions inside of global functions, it will crash the server. I cant use it only inside of server_timer I think. "Timer" is player related... But I am not sure... It was only sample. iBeast Link to comment Share on other sites More sharing options...
Xploitz 8 Posted October 21, 2018 Share Posted October 21, 2018 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. 1 Link to comment Share on other sites More sharing options...
amosth 9 Posted October 25, 2018 Author Share Posted October 25, 2018 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 More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now