Ejemplo n.º 1
0
 private void AddContainer(List<string> l, WoWContainer c)
 {
     if (null == c || !c.IsValid) {
         l.Add("! container was null or invalid");
         return;
     }
     int bagIndex = c.BagIndex + 1;
     AddItem(l, bagIndex + ": " + c.Slots, c);
     AddItems(l, bagIndex, c);
 }
Ejemplo n.º 2
0
        public static uint BagRoomLeft(uint id)
        {
            int  storagetype = StorageType(id);
            uint freeSlots   = StyxWoW.Me.Inventory.Backpack.FreeSlots;

            for (uint i = 0; i < 4; i++)
            {
                WoWContainer bagAtIndex = StyxWoW.Me.GetBagAtIndex(i);
                if (bagAtIndex != null)
                {
                    int bagtype = StorageType(bagAtIndex.Entry);
                    if (bagtype == 0 || (bagtype & storagetype) > 0)
                    {
                        freeSlots += bagAtIndex.FreeSlots;
                    }
                }
            }
            return(freeSlots);
        }
Ejemplo n.º 3
0
        private void DoCheck()
        {
            if (AutoEquipSettings.ChosenWeightSet == null)
            {
                Log(true, "You have not yet selected a weight set!{0}Please open the form and select a weight set to use AutoEquip.", Environment.NewLine);
                return;
            }

            if (!_doCheckWait.IsFinished)
            {
                return;
            }

            _doCheckWait.Reset();

            RefreshEquippedItems();


            int tickCount = Environment.TickCount;

            HashSet <WoWItemQuality> equipQualities = AutoEquipSettings.EquipQualities;
            var items = new List <WoWItem>();

            items.AddRange(ObjectManager.Me.Inventory.Backpack.PhysicalItems);
            for (uint i = 0; i < 4; i++)
            {
                WoWContainer bag = ObjectManager.Me.GetBagAtIndex(i);
                if (bag != null)
                {
                    items.AddRange(bag.PhysicalItems);
                }
            }

            var equippableNewItems = new List <WoWItem>();

            foreach (WoWItem item in items)
            {
                ulong itemGuid = item.Guid;
                if (_ignoreItems.Contains(itemGuid))
                {
                    continue;
                }

                if (_equippedItems.ContainsValue(item) ||
                    AutoEquipSettings.IsItemIgnored(item) ||
                    AutoEquipSettings.IgnoreTypes.Contains(item.ItemInfo.InventoryType) ||
                    !equipQualities.Contains(item.ItemInfo.Quality) ||
                    !ObjectManager.Me.CanEquipItem(item))
                {
                    _ignoreItems.Add(itemGuid);
                    continue;
                }

                equippableNewItems.Add(item);
            }

            int took = Environment.TickCount - tickCount;

            if (equippableNewItems.Count == 0)
            {
                return;
            }

            if (AutoEquipSettings.AutoEquipItems)
            {
                tickCount = Environment.TickCount;


                CheckForItems(equippableNewItems);


                took = Environment.TickCount - tickCount;
            }
            if (AutoEquipSettings.AutoEquipBags)
            {
                tickCount = Environment.TickCount;


                CheckForBag(equippableNewItems);


                took = Environment.TickCount - tickCount;
            }
        }