Jump to content
×
×
  • Create New...
  • 0

Metin2 quest func where you can detect location


blue

Question

Hey folks, I'm new to this and trying to experiment with metin2 quests. Does anyone know how to add the location detection function to a quest? For example, do you remember the horse/pony level-up (lv. 1-10) quest on the official servers? TIA!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
  • Distinguished Member
Quote

    state training_frame_purple_step5 begin
        when letter begin
            target.pos("__TARGET__", 490, 560, 62, "")
        end
        when letter begin
            setskin(NOWINDOW)
            makequestbutton(gameforge.pony_levelup._130_makequestbutton)
            q.set_title(gameforge.pony_levelup._130_makequestbutton)
            q.start()
        end
        when button or info begin
            say_title(gameforge.pony_levelup._130_makequestbutton)
            say(gameforge.pony_levelup._140_sayReward)
        end
        when 22000.use or 22010.use begin
            setstate(failure)
        end
        when __TARGET__.target.arrive begin
            target.delete("__TARGET__")

            say_title(gameforge.pony_levelup._130_makequestbutton)
                        say_reward(gameforge.pony_levelup._150_sayReward)
                        setstate(report)
        end
        when unmount begin
            setstate(failure)
        end
    end

 

I marked with red what you're looking for.

(local_x, local_y, mapindex when you set the target's location)

 

If you don't want to make a target (like treasure hunting or something) then you can use these quest function:

pc.get_local_x()
pc.get_local_y()
pc.get_map_index()

I just wrote an example quest for hidden treasure hunting:

quest lost_treasure begin
	state start begin
		when login with pc.get_map_index() == 255 and pc.getqf("treasure") == 0 begin
			loop_timer("hidden_treasure", 3)
			chat("Search the hidden spot!")
		end
		when hidden_treasure.timer with pc.getqf("treasure") == 0 begin
			if pc.get_local_x() >= 100 and if pc.get_local_x() <= 150 and pc.get_local_y() >= 50 and pc.get_local_y() <= 100 then
				chat("You found the area!")
				pc.change_gold(1000000)
				pc.setqf("treasure",1)
				cleartimer("hidden_treasure")
			end
		end
	end
end

So if the user go to the rectangle (x: 100,150; y: 50, 100) he'll get gold only once.

It uses loop_timer (3sec) but i suppose it is one time or event quest so it'll be good.

Edited by TMP4
  • Love 1
Link to comment
Share on other sites

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Metin2 Dev Github
  • Activity

    1. 6

      Owsap Productions

    2. 11

      BUG SAFEBOX disappear stacks ..

    3. 2

      Error no member named SetcCreateTime in Citem

    4. 2

      Need some help with effect slot on pickup system

    5. 1

      GF Pet system "x" level / percent

    6. 1

      disable quest esc

    7. 2

      Navicat Premium 16.1.3 x64

    8. 2

      Join the Metin2 Dev team

    9. 2

      Error no member named SetcCreateTime in Citem

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.