Jump to content

Metin2 quest func where you can detect location


Recommended Posts

  • Contributor
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 4

      Feeding game source to LLM

    2. 0

      Quest 6/7 Problem

    3. 5

      Effect weapons

    4. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    5. 3

      Crystal Metinstone

    6. 4

      Feeding game source to LLM

    7. 113

      Ulthar SF V2 (TMP4 Base)

    8. 4

      Feeding game source to LLM

  • 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.