Jump to content

Recommended Posts

Hi everyone. Could someone help me? I have a quest called the "orc run quest". I would like this to be a group run. I was able to write the solo run, and it works fine. However, I don't know how to code the part where the code checks if everyone has an entry ticket, and if someone doesn't have one, it doesn't let anyone in and indicates that someone is missing an entry ticket. Could someone help me with this? I would be very grateful.

This is what the code looks like now, thank you for your help, I've been struggling with it for a long time.

quest ork_run begin
    state start begin
        when 20354.chat."Orkrun" begin
            say_title("Orkrun")
            say("")
            say("Would you like to fight the Cursed Orcs?")
            say("")
            say_reward("You will need 1 Orkrun entry ticket and be level 40-60.")
            say_item_vnum(200000)
            pc.delqf("orkbelepes")
            wait()
            if not party.is_party() then
                if pc.count_item(200000) >= 1 and pc.get_level() >= 40 and pc.get_level() <= 60 then
                    say_title("Orkrun")
                    say("")
                    say("Okay, I think you have the ticket.")
                    say("")
                    say_reward("Do you want to enter?")
                    local s = select("Yes!", "No!")
                    if s == 1 then
                        pc.remove_item(200000,1)
                        say_title("Orkrun")
                        say("")
                        say("Teleporting you now!")
                        wait()
                        pc.setqf("orkbelepes", 1)
                        d.new_jump(207, 7237 * 100, 8237 * 100)
                        notice_all(""..pc.get_name().." entered the Cursed Orc's Lair!")
                        d.set_regen_file( "data/run/Orkrun/orkrunmobok.txt" )
                    end
                    if s == 2 then
                        return
                    end
                end
                if pc.count_item("200000") <= 1 then
                    say_title("Orkrun")
                    say("")
                    say("Required: Orkrun entry ticket, level 40-60")
                    say_item_vnum(200000)
                end
            else
                say_title("Orkrun")
                say("")
                if party.is_party() then
                    say_reward("You cannot enter in a party!")
                end
            end
        end
        
        when login begin
            if pc.getqf("orkbelepes") == 1 then
                pc.delqf("orkbelepes")
                timer("orkkezdes", 1*10)
                d.notice( "The run starts in 10 seconds!" )
            end
        end
        
        when orkkezdes.timer begin
            d.notice("You have 3 tasks in the run!")
            d.notice("Your current task is to kill the Ghost Orc Chief.")
            d.regen_file("data/run/Orkrun/szellemork.txt");
        end
        
        when 693.kill with pc.get_map_index() >= 207*10000 and pc.get_map_index() < (207+1)*10000 begin
            local count = d.getf("orkbelepes_1") + 1
            if count <= 1 then
                d.setf("orkbelepes_1", count)
                if count == 1 then
                    d.notice("You defeated the Ghost Orc Chief!")
                    d.notice("Your next task is to crush the Metin stones!")
                    d.regen_file("data/run/Orkrun/orkrun.txt");
                end
            end
        end
        
        when 8008.kill with pc.get_map_index() >= 207*10000 and pc.get_map_index() < (207+1)*10000 begin
            local count = d.getf("orkbelepes_2") + 1
            if count <= 9 then
                d.setf("orkbelepes_2", count)
                if count == 9 then
                    d.notice("You crushed the stones!")
                    d.notice("Fight the Cursed Orc!")
                    d.regen_file("data/run/Orkrun/atkozottork.txt");
                end
            end
        end
        
        when 4094.kill with pc.get_map_index() >= 207*10000 and pc.get_map_index() < (207+1)*10000 begin
            notice_all(""..pc.get_name().." defeated the Cursed Orc!")
            d.notice("You defeated the Cursed Orc. Good job!")
            d.notice("You will be teleported back to the town in 10 seconds!")
            loop_timer("orkbelepes_3", 10)
        end
    
        when logout or disconnect with pc.get_map_index() >= 207*10000 and pc.get_map_index() < (207+1)*10000 begin
            pc.setqf("orkbelepes", 0)
            warp_to_village()
        end
        
        when orkbelepes_3.timer begin
            cleartimer("orkbelepes_3")
            pc.setqf("orkbelepes", 0)
            warp_to_village()
        end

    end
end

Link to comment
https://metin2.dev/topic/32971-group-entry-for-quests/
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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.