Jump to content

Real time item counting quest function


Go to solution Solved by caanmasu,

Recommended Posts

Could someone help me to write a quest function which is counts the amount of an item in the inventory (in real time) and if u earn for example 10pcs from that item then its removes them and gives another item instead of them?

 

Edited by ToroRosso
Link to comment
https://metin2.dev/topic/30236-real-time-item-counting-quest-function/
Share on other sites

  • Solution
define SOURCE_VNUM_ITEM 30006
define SOURCE_COUNT_ITEM 10
define TARGET_VNUM_ITEM 30007

quest pick_item begin
	state start begin
		when SOURCE_ITEM.pick with pc.count_item(SOURCE_ITEM) >= SOURCE_COUNT_ITEM begin
			pc.remove_item(SOURCE_VNUM_ITEM, SOURCE_COUNT_ITEM)
			pc.give_item2(TARGET_VNUM_ITEM)
		end
	end
end
  • Love 1
1 minute ago, caanmasu said:
define SOURCE_VNUM_ITEM 30006
define SOURCE_COUNT_ITEM 10
define TARGET_VNUM_ITEM 30007

quest pick_item begin
	state start begin
		when SOURCE_ITEM.pick with pc.count_item(SOURCE_ITEM) >= SOURCE_COUNT_ITEM begin
			pc.remove_item(SOURCE_VNUM_ITEM, SOURCE_COUNT_ITEM)
			pc.give_item2(TARGET_VNUM_ITEM)
		end
	end
end

 

Yeah, thanks, i just realised an hour ago, the pick function is already exist. ?

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.