Jump to content

Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

 

quest clean_inventory begin
	state start begin
		when 9005.chat."Empty your inventory" begin
		say_title(mob_name(npc.get_race()))
		say("Inventory which you choose will be empty.")
		say("Pay attention when you make your choice.")
		say_reward("Choose the inventory which you want to empty.")
		local s = select("Inventory - I","Inventory - II","Remove all items","Cancel")
			if s == 1 then
			say("Do you really want to empty Inventory I?")
				if select("Yes","No") == 2 then
				return
				end
			clean_inventory.empty(0,44)
			elseif s == 2 then
			say("Do you really want to empty Inventory II?")
				if select("Yes","No") == 2 then
				return
				end
			clean_inventory.empty(45,89)
			elseif s == 3 then
			say("Do you really want to remove all items except")
			say("equipments?")
				if select("Yes","No") == 2 then
				return
				end
			clean_inventory.empty(0,89)
			else
			return
			end
		end

		function empty(a,b)
			for i=a, b do
			item.select_cell(i)
			item.remove()
			end
		end
	end
end

 

  • Metin2 Dev 10
  • kekw 1
  • Good 6
  • Love 15
Link to comment
https://metin2.dev/topic/9152-empty-your-inventory/
Share on other sites

  • 2 weeks later...
  • 8 years later...
quest clean_inventory begin
	state start begin
		when 9005.chat."Empty your inventory" begin
			say_title(mob_name(npc.get_race()))
			say("Inventory which you choose will be empty.")
			say("Pay attention when you make your choice.")
			say_reward("Choose the inventory which you want to empty.")
			local s = select("Inventory - I","Inventory - II","Inventory - III","Inventory - IV","Remove all items","Cancel")
			local value = {
							[1] = {0, 44, "Inventory I"},
							[2] = {45, 89, "Inventory II"},
							[3] = {90, 134, "Inventory III"},
							[4] = {135, 179, "Inventory IV"},
							[5] = {0, 179, "All Inventory"}
						}
			if s <= 5 then
				say("Do you really want to empty "..value[s][3].." ? ")
				local choice = select("Yes","No")
				if choice == 1 then
					clean_inventory.EMPTY(value[s][1], value[s][2])
				else
					return
				end
				
			else
				return
			end
			return
		end
		function EMPTY(a, b)
			for i=a, b do
				item.select_cell(i)
				item.remove()	
			end
			say("Done ! ")
			return
		end
	end
end

J'ai apporté quelques modification, cela évite les répétitons de morceaux de code 😃

Edited by Samesaoul
j'ai fait une légère erreur de mon code , j'ai donc édit celui-ci
Link to comment
https://metin2.dev/topic/9152-empty-your-inventory/#findComment-166685
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.