Jump to content

Vanilla core Item remoover quest


Recommended Posts

Hello i have this problem in this quest 

1 item remove its ok 

but if i have 2 items with same code this quest wil remove one of them randomly!

quest item_remover begin
    state start begin
        when 20092.take with item.get_id() begin
            code = item.get_vnum()
            say_title("Item Remover")
            say("Do you want to delete this item ?")
            say_item_vnum(code)
            say("Ok, I will remove "..item.get_name().." for you.")
            local s = select("Yes","Delete All","No")
            if s == 1 then
            item.remove(code)
            elseif s == 2 then
            item.remove(code, pc.count_item(code))
            end
            end
            when 20092.chat."How can i delete a item?" begin
            say_title("Item Remover")
            say("Hello !")
            say("If you delete a item you can")
            say("take it on me !")
        end    
    end
end
Link to comment
Share on other sites

quest item_remover begin
	state start begin
		when 20092.take begin
			local code = item.get_vnum()
			say_title("Item Remover")
			say("Do you want to delete this item ?")
			say_item_vnum(code)
			say("Ok, I will remove "..item.get_name().." for you.")
			local s = select("Delete 1x","Delete the whole stack","No")
			if s == 1 then
				pc.remove_item(code,1)
			elseif s == 2 then
				item.remove()
			end
		end
		when 20092.chat."How can i delete a item?" begin
			say_title("Item Remover")
			say("Hello !")
			say("If you delete a item you can")
			say("take it on me !")
        end   
    end
end

Some tips:

  • item.remove() is used to remove the item stack. It doesn't take any arguments, so you can't use item.remove(vnum,quantity)
  • If you want to delete just one item from the stack use pc.remove_item(vnum,quantity)
  • Love 3
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



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