Beispiel #1
0
        private WoWItem FindMainHand()
        {
            WoWItem mainHand = _me.Inventory.Equipped.MainHand;

            if (mainHand == null || mainHand.ItemInfo.WeaponClass == WoWItemWeaponClass.FishingPole)
            {
                mainHand = _me.CarriedItems.OrderByDescending(u => u.ItemInfo.Level).
                           FirstOrDefault(i => i.IsSoulbound && (i.ItemInfo.InventoryType == InventoryType.WeaponMainHand ||
                                                                 i.ItemInfo.InventoryType == InventoryType.TwoHandWeapon) &&
                                          _me.CanEquipItem(i));
                if (mainHand != null)
                {
                    MySettings.MainHand = mainHand.Entry;
                }
                else
                {
                    Err("Unable to find a mainhand weapon to swap to when in combat");
                }
            }
            else
            {
                MySettings.MainHand = mainHand.Entry;
            }
            MySettings.Save();
            return(mainHand);
        }