What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Remove specific number of one item from inventory

wownerds

New Member
Joined
Feb 15, 2011
Messages
1,385
Reaction score
30
Hi there,

I'm currently working on a plugin which should be able to delete items if a certain quantity of this item is reached.

For example: I gather 60 peaceblooms, but only need 54. This plugin should than delete all peaceblooms exceeding those 54.

Is there a way to do this?

Thanks in advance,

wownerds
 
Hi there,

I'm currently working on a plugin which should be able to delete items if a certain quantity of this item is reached.

For example: I gather 60 peaceblooms, but only need 54. This plugin should than delete all peaceblooms exceeding those 54.

Is there a way to do this?

Thanks in advance,

wownerds
heres what i have so far as far as a method is concerned

it goes in and tosses all the items by item name into a list, then from there i attemped to go and count up the total of each "Thing" to get a total count, from there if the total count is greater then Max then from there <code>SplitContainerItem(container,</code> <code>slot,</code> <code>amount)</code>

SplitContainerItem - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons

then Delete cursor item. you should be able to find the code in Mr.ItemRemover for removing an item, but the splitcontaineritem is the most importaint thing in this case.

Code:
        public void RemoveNumberItems(string ItemName, int Max)
        {
            List<WoWItem> TypeItems = new List<WoWItem>();
            foreach (WoWItem Item in Me.BagItems)
            {
                if (Item.Name == ItemName && Item.StackCount > 0)
                {
                    TypeItems.Add(Item);
                }
            }
            if (TypeItems.Count > 0)
            {
                uint total;
                foreach (WoWItem LookItems in TypeItems)
                {
                    total + LookItems.StackCount;
                    if (total > Max)
                    {
                        
                    }
                }
            }
        }
 
Back
Top