Jump to content

Recommended Posts

  • Premium

Hello developers!

My monkey cave dungeon, when I die or the time is up without killing the boss, I will be teleported back to the village and transformed into a monkey for 10 minutes, but it will be restored in 1 second after returning to the village. I don't know what's wrong, can you help me? Thank you

 

this my file:

Just now, Torres said:

Hello developers!

My monkey cave dungeon, when I die or the time is up without killing the boss, I will be teleported back to the village and transformed into a monkey for 10 minutes, but it will be restored in 1 second after returning to the village. I don't know what's wrong, can you help me? Thank you

 

this my file:

quest monkey_dungeon begin
    state start begin
        when login begin
            pc.setqf("clear", 0)
            local i = pc.get_map_index()
            if i == 107 or i == 108 or i == 109 then
                local warp_to =
                {
                    [107] =
                        {
                            {  3,  979, 564 },
                            { 23,  575,  97 },
                            { 43,  535,  66 },
                        },
                    [108] =
                        {
                            { 63, 1016, 1352 },
                            { 63, 1016, 1352 },
                            { 63, 1016, 1352 },
                        },
                    [109] =
                        {
                            { 63,  831, 549 },
                            { 63,  831, 549 },
                            { 63,  831, 549 },
                        },
                }
                pc.setqf("fail", 0)
                pc.warp_local(warp_to[i][pc.empire][1], warp_to[i][pc.empire][2] * 100, warp_to[i][pc.empire][3] * 100)
                elseif pc.getqf("level") != 0 then
                if i >= 1070000 and i < 1100000 then
                    q.set_title(locale.monkey_dungeon.quest_title)
                    q.set_clock(locale.monkey_dungeon.quest_rest_time, 20*60)
                    q.start()
                    timer("failtimer", 20*60)
                    if pc.getqf("level") >= 2 then
                    timer("regen_middle_boss", 10*60)
                    end
                else
                    pc.setqf("level", 0)
                    q.done()
                    if pc.getqf("fail") != 0 then
                    pc.setqf("fail", 0)
                    pc.polymorph(5003, 10*60)
                    makequestbutton(locale.monkey_dungeon.curse_of_monkey_button)
                    setskin(NOWINDOW)
                    end
                end
            end
        end
        when button begin
            say(locale.monkey_dungeon.curse_of_monkey)
        end
        when logout with pc.get_map_index() >= 1070000 and pc.get_map_index() < 1100000 begin
            if pc.getqf("clear") == 0 then
                pc.setqf("fail", 1)
                local map_index, x, y = pc.get_start_location()
                pc.set_warp_location(map_index, x, y)
            end
            if pc.getqf("level") != 0 then
                d.exit_all()
                d.purge()
            end
        end
        function determine_level()
            if pc.get_map_index() == 63 then
                if pc.local_y < 800 then
                    return 3
                else
                    return 2
                end
            else
                return 1
            end
        end
        when 20350.chat.locale.monkey_dungeon.button begin
            local delay = 3600
            if is_test_server() then
                delay = 10
            end
            if get_global_time() - pc.getqf("time") < delay and pc.getqf("time") != 0 then
                say(locale.monkey_dungeon.cannot_enter_yet)
            else
                local s = monkey_dungeon.determine_level()
                local msgs = { locale.monkey_dungeon.low_entrance, locale.monkey_dungeon.middle_entrance, locale.monkey_dungeon.high_entrance }
                local maps = { 107, 108, 109 }
                say(msgs[s])
                say(locale.monkey_dungeon.notice)
                local r = select(locale.monkey_dungeon.enter, locale.monkey_dungeon.no_enter)
                if r == 1 then
                    pc.setqf("time", get_global_time())
                    d.join(maps[s])
                    -- if maps[s] == 107 then
                    -- pc.warp(819200, 51200)  --下仙洞
                    -- elseif maps[s] == 108 then
                    -- pc.warp(128000, 640000) --中仙洞
                    -- elseif maps[s] == 109 then
                    -- pc.warp(128000, 716800) --上仙洞
                    -- end
                    monkey_dungeon.spawn_goto_mobs(s)
                    d.regen_file("data/dungeon/monkey/monkey"..s..".txt")
                    pc.setqf("level", s);
                end
            end
        end
        when regen_middle_boss.timer begin
            if pc.getqf("level") == 2 then
                d.spawn_group(5017, 596, 332, 1, true, 1)
            elseif pc.getqf("level") == 3 then
                d.spawn_group(5028, 596, 332, 1, true, 1)
            end
        end
        when 5116.party_kill with pc.getf("monkey_dungeon","level") == 2 begin
            d.spawn_goto_mob(595, 335, 601, 560)
        end
        when 5127.party_kill with pc.getf("monkey_dungeon","level") == 3 begin
            d.spawn_goto_mob(595, 335, 601, 560)
        end
        when 5161.party_kill with pc.getf("monkey_dungeon","level") == 1 begin
            cleartimer('failtimer')
            timer('successtimer', 30)
            party.setqf("clear", 1)
        end
        when 5162.party_kill with pc.getf("monkey_dungeon","level") == 2 begin
            cleartimer('failtimer')
            timer('successtimer', 30)
            party.setqf("clear", 1)
        end
        when 5163.party_kill with pc.getf("monkey_dungeon","level") == 3 begin
            cleartimer('failtimer')
            timer('successtimer', 30)
            party.setqf("clear", 1)
        end
        when failtimer.timer begin
            d.exit_all_to_start_position()
            d.purge()
        end
        when successtimer.timer begin
            d.exit_all()
            d.purge()
            q.done()
        end
        function spawn_goto_mobs(level)
            local t = {
            {
                {145,    315,    345,    361},
                {80,    308,    106,    547},
                {206,    109,    75,    368},
                {320,    238,    89,    746},
                {421,    272,    520,    352},
                {487,    279,    541,    45},
                {70,    368,    211,    109},
                {65,    434,    615,    49},
                {67,    498,    284,    705},
                {350,    361,    145,    310},
                {210,    495,    553,    285},
                {526,    352,    487,    274},
                {528,    415,    626,    291},
                {523,    480,    285,    569},
                {101,    547,    80,    303},
                {82,    746,    315,    238},
                {541,    40,    416,    272},
                {615,    44,    72,    498},
                {553,    291,    215,    495},
                {626,    296,    523,    415},
                {278,    705,    72,    498},
                {280,    569,    518,    480},
                {470,    560,    579,    390},
            },
            {
                {145,    315,    345,    361},
                {80,    308,    520,    352},
                {206,    109,    487,    274},
                {320,    238,    75,    368},
                {421,    272,    211,    109},
                {487,    279,    215,    495},
                {70,    368,    315,    238},
                {65,    434,    520,    352},
                {67,    498,    284,    705},
                {350,    361,    145,    310},
                {210,    495,    416,    272},
                {526,    352,    80,    303},
                {528,    415,    72,    498},
                {523,    480,    106,    547},
                {101,    547,    523,    415},
                {82,    746,    541,    45},
                {541,    40,    72,    121},
                {615,    44,    518,    480},
                {553,    291,    89,    746},
                {626,    296,    285,    569},
                {278,    705,    615,    49},
                {280,    569,    72,    498},
                {470,    560,    579,    390},
            },
            {
                {145,    315,    75,    368},
                {80,    308,    541,    45 },
                {206,    109,    615,    49 },
                {320,    238,    284,    705},
                {421,    272,    520,    352},
                {487,    279,    553,    285},
                {70,    368,    145,    310},
                {65,    434,    345,    361},
                {67,    498,    523,    415},
                {350,    361,    72,    498},
                {210,    495,    626,    291},
                {526,    352,    487,    274},
                {528,    415,    72,    498},
                {523,    480,    106,    547},
                {101,    547,    518,    480},
                {82,    746,    285,    569},
                {541,    40,    80,    303},
                {615,    44,    211,    109},
                {553,    291,    416,    272},
                {626,    296,    215,    495},
                {278,    705,    315,    238},
                {280,    569,    89,    746},
                {470,    560,    579,    390},
            }
            }
            if level >= 1 and level <= 3 then
                table.foreachi(t[level],
                    function(n, p)
                        d.spawn_goto_mob(p[1], p[2], p[3], p[4])
                    end)
                if level == 1 then
                    d.spawn_goto_mob(581, 395, 595, 565)
                end
            end
        end
    end
end
 

 

Link to comment
https://metin2.dev/topic/33471-help-monkey_dungeon-error/
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

3 hours ago, Torres said:

Hello developers!

My monkey cave dungeon, when I die or the time is up without killing the boss, I will be teleported back to the village and transformed into a monkey for 10 minutes, but it will be restored in 1 second after returning to the village. I don't know what's wrong, can you help me? Thank you

 

this my file:

quest monkey_dungeon begin
    state start begin
        when login begin
            pc.setqf("clear", 0)
            local i = pc.get_map_index()
            if i == 107 or i == 108 or i == 109 then
                local warp_to =
                {
                    [107] =
                        {
                            {  3,  979, 564 },
                            { 23,  575,  97 },
                            { 43,  535,  66 },
                        },
                    [108] =
                        {
                            { 63, 1016, 1352 },
                            { 63, 1016, 1352 },
                            { 63, 1016, 1352 },
                        },
                    [109] =
                        {
                            { 63,  831, 549 },
                            { 63,  831, 549 },
                            { 63,  831, 549 },
                        },
                }
                pc.setqf("fail", 0)
                pc.warp_local(warp_to[i][pc.empire][1], warp_to[i][pc.empire][2] * 100, warp_to[i][pc.empire][3] * 100)
                elseif pc.getqf("level") != 0 then
                if i >= 1070000 and i < 1100000 then
                    q.set_title(locale.monkey_dungeon.quest_title)
                    q.set_clock(locale.monkey_dungeon.quest_rest_time, 20*60)
                    q.start()
                    timer("failtimer", 20*60)
                    if pc.getqf("level") >= 2 then
                    timer("regen_middle_boss", 10*60)
                    end
                else
                    pc.setqf("level", 0)
                    q.done()
                    if pc.getqf("fail") != 0 then
                    pc.setqf("fail", 0)
                    pc.polymorph(5003, 10*60)
                    makequestbutton(locale.monkey_dungeon.curse_of_monkey_button)
                    setskin(NOWINDOW)
                    end
                end
            end
        end
        when button begin
            say(locale.monkey_dungeon.curse_of_monkey)
        end
        when logout with pc.get_map_index() >= 1070000 and pc.get_map_index() < 1100000 begin
            if pc.getqf("clear") == 0 then
                pc.setqf("fail", 1)
                local map_index, x, y = pc.get_start_location()
                pc.set_warp_location(map_index, x, y)
            end
            if pc.getqf("level") != 0 then
                d.exit_all()
                d.purge()
            end
        end
        function determine_level()
            if pc.get_map_index() == 63 then
                if pc.local_y < 800 then
                    return 3
                else
                    return 2
                end
            else
                return 1
            end
        end
        when 20350.chat.locale.monkey_dungeon.button begin
            local delay = 3600
            if is_test_server() then
                delay = 10
            end
            if get_global_time() - pc.getqf("time") < delay and pc.getqf("time") != 0 then
                say(locale.monkey_dungeon.cannot_enter_yet)
            else
                local s = monkey_dungeon.determine_level()
                local msgs = { locale.monkey_dungeon.low_entrance, locale.monkey_dungeon.middle_entrance, locale.monkey_dungeon.high_entrance }
                local maps = { 107, 108, 109 }
                say(msgs[s])
                say(locale.monkey_dungeon.notice)
                local r = select(locale.monkey_dungeon.enter, locale.monkey_dungeon.no_enter)
                if r == 1 then
                    pc.setqf("time", get_global_time())
                    d.join(maps[s])
                    -- if maps[s] == 107 then
                    -- pc.warp(819200, 51200)  --下仙洞
                    -- elseif maps[s] == 108 then
                    -- pc.warp(128000, 640000) --中仙洞
                    -- elseif maps[s] == 109 then
                    -- pc.warp(128000, 716800) --上仙洞
                    -- end
                    monkey_dungeon.spawn_goto_mobs(s)
                    d.regen_file("data/dungeon/monkey/monkey"..s..".txt")
                    pc.setqf("level", s);
                end
            end
        end
        when regen_middle_boss.timer begin
            if pc.getqf("level") == 2 then
                d.spawn_group(5017, 596, 332, 1, true, 1)
            elseif pc.getqf("level") == 3 then
                d.spawn_group(5028, 596, 332, 1, true, 1)
            end
        end
        when 5116.party_kill with pc.getf("monkey_dungeon","level") == 2 begin
            d.spawn_goto_mob(595, 335, 601, 560)
        end
        when 5127.party_kill with pc.getf("monkey_dungeon","level") == 3 begin
            d.spawn_goto_mob(595, 335, 601, 560)
        end
        when 5161.party_kill with pc.getf("monkey_dungeon","level") == 1 begin
            cleartimer('failtimer')
            timer('successtimer', 30)
            party.setqf("clear", 1)
        end
        when 5162.party_kill with pc.getf("monkey_dungeon","level") == 2 begin
            cleartimer('failtimer')
            timer('successtimer', 30)
            party.setqf("clear", 1)
        end
        when 5163.party_kill with pc.getf("monkey_dungeon","level") == 3 begin
            cleartimer('failtimer')
            timer('successtimer', 30)
            party.setqf("clear", 1)
        end
        when failtimer.timer begin
            d.exit_all_to_start_position()
            d.purge()
        end
        when successtimer.timer begin
            d.exit_all()
            d.purge()
            q.done()
        end
        function spawn_goto_mobs(level)
            local t = {
            {
                {145,    315,    345,    361},
                {80,    308,    106,    547},
                {206,    109,    75,    368},
                {320,    238,    89,    746},
                {421,    272,    520,    352},
                {487,    279,    541,    45},
                {70,    368,    211,    109},
                {65,    434,    615,    49},
                {67,    498,    284,    705},
                {350,    361,    145,    310},
                {210,    495,    553,    285},
                {526,    352,    487,    274},
                {528,    415,    626,    291},
                {523,    480,    285,    569},
                {101,    547,    80,    303},
                {82,    746,    315,    238},
                {541,    40,    416,    272},
                {615,    44,    72,    498},
                {553,    291,    215,    495},
                {626,    296,    523,    415},
                {278,    705,    72,    498},
                {280,    569,    518,    480},
                {470,    560,    579,    390},
            },
            {
                {145,    315,    345,    361},
                {80,    308,    520,    352},
                {206,    109,    487,    274},
                {320,    238,    75,    368},
                {421,    272,    211,    109},
                {487,    279,    215,    495},
                {70,    368,    315,    238},
                {65,    434,    520,    352},
                {67,    498,    284,    705},
                {350,    361,    145,    310},
                {210,    495,    416,    272},
                {526,    352,    80,    303},
                {528,    415,    72,    498},
                {523,    480,    106,    547},
                {101,    547,    523,    415},
                {82,    746,    541,    45},
                {541,    40,    72,    121},
                {615,    44,    518,    480},
                {553,    291,    89,    746},
                {626,    296,    285,    569},
                {278,    705,    615,    49},
                {280,    569,    72,    498},
                {470,    560,    579,    390},
            },
            {
                {145,    315,    75,    368},
                {80,    308,    541,    45 },
                {206,    109,    615,    49 },
                {320,    238,    284,    705},
                {421,    272,    520,    352},
                {487,    279,    553,    285},
                {70,    368,    145,    310},
                {65,    434,    345,    361},
                {67,    498,    523,    415},
                {350,    361,    72,    498},
                {210,    495,    626,    291},
                {526,    352,    487,    274},
                {528,    415,    72,    498},
                {523,    480,    106,    547},
                {101,    547,    518,    480},
                {82,    746,    285,    569},
                {541,    40,    80,    303},
                {615,    44,    211,    109},
                {553,    291,    416,    272},
                {626,    296,    215,    495},
                {278,    705,    315,    238},
                {280,    569,    89,    746},
                {470,    560,    579,    390},
            }
            }
            if level >= 1 and level <= 3 then
                table.foreachi(t[level],
                    function(n, p)
                        d.spawn_goto_mob(p[1], p[2], p[3], p[4])
                    end)
                if level == 1 then
                    d.spawn_goto_mob(581, 395, 595, 565)
                end
            end
        end
    end
end
 

 

If your server is in testing mode the delay is 10 seconds...

Take a look at this...

Link to comment
https://metin2.dev/topic/33471-help-monkey_dungeon-error/#findComment-169480
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.