Jump to content
  • 0

Vanilla core Item remoover quest


nostradame37

Question

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

5 answers to this question

Recommended Posts

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

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


  • Activity

    1. 7

      Metin2 2003 Beta Client!!!!!

    2. 32

      Boss Effect Over Head

    3. 1

      Open Source API for Metin2 Server Management - Early Development

    4. 0

      Official Item Combination [18.4]

    5. 2

      Proper SIGNAL management for Windows

    6. 2

      Proper SIGNAL management for Windows

    7. 4

      syserr erorr ( not working OK button on client )

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