Jump to content

Item Remover


Recommended Posts

M2 Download Center

Hidden Content

    Give reaction to this post to see the hidden content.
( Internal )

Hi guys i will share mini quest with your :D

 

I hope you are like it.

define drunk 20004

quest removeItem begin
	state start begin
		when drunk.chat."Hey there" begin
			say_title(string.format("%s:",mob_name(npc.get_race())))
			say("")
			---
			say("My plight has deceived many people.")
			say("But they don't know what is richer than.. ")
			say("Anyway, back to our topic.")
			say("Do you have unnecessary items on?")
			say("")
			if(select(locale.yes,locale.no) == 2) then
				return
			end
			say_title(string.format("%s:",mob_name(npc.get_race())))
			say("")
			---
			local unnecessary = {
				39030,
				71094,
				39008,
				71001,				
			}
			local unnecessary_name = {}
			for i = 1,table.getn(unnecessary),1 do
				if(pc.count_item(unnecessary[i]) > 0) then
					table.insert(unnecessary_name,item.get_name(unnecessary[i]))
				end	
				table.insert(unnecessary_name,"Close")
			end
			local s = select_table(unnecessary_name)
			if(s >= table.getn(unnecessary_name)) then
				return
			end
			say_title(string.format("%s:",mob_name(npc.get_race())))
			say("")
			---
			say("I'm getting stuff from you.")
			say("See you later.")
			pc.remove_item(unnecessary[s],pc.count_item(unnecessary[s]))
		end
	end
end

Kind Regards

HaveBeen

Plain logic saves lives.

Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

The select will look like this: Item, Close, Item, Close, Item, Close...

You should insert the "Close" after the for loop.

And why do you define a variable for a single use? :D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

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.