Exemplo n.º 1
0
        /// <summary>
        /// returns true if we have a weapon imbued
        /// </summary>
        /// <param name="slot">Inventory slot to check</param>
        /// <param name="imbueName">The name of the enchant</param>
        /// <param name="imbueId">The ID of the weapon imbue </param>
        /// <returns>true if the weapon has the enchant</returns>
        public static bool HasWeaponImbue(WoWInventorySlot slot, string imbueName, int imbueId)
        {
            // GTFO if we have a fishing pole equiped
            if (StyxWoW.Me.Inventory.Equipped.MainHand.ItemInfo.WeaponClass == WoWItemWeaponClass.FishingPole)
            {
                return(true);
            }

            //SysLog.DiagnosticLog( "Checking Weapon Imbue on " + slot + " for " + imbueName);
            var item = StyxWoW.Me.Inventory.Equipped.GetEquippedItem(slot);

            if (item == null)
            {
                CLULogger.TroubleshootLog("We have no " + slot + " equipped!");
                return(true);
            }

            var enchant = item.TemporaryEnchantment;

            if (enchant != null)
            {
                //SysLog.DiagnosticLog( "Enchantment Name: " + enchant.Name);
                //SysLog.DiagnosticLog("Enchantment ID: " + enchant.Id);
                //SysLog.DiagnosticLog("ImbueName: " + imbueName);
                //SysLog.DiagnosticLog("Enchant: " + enchant.Name + " - " + (enchant.Name == imbueName));
            }

            return(enchant != null && (imbueId == enchant.Id));  //enchant.Name == imbueName ||
        }
Exemplo n.º 2
0
        /// <summary>
        ///  Returns true if we meet the requirements of the weapon
        /// </summary>
        /// <param name="slot">Inventory slot to check</param>
        /// <returns>true if the weapon is suitable</returns>
        public static bool HasSuitableWeapon(WoWInventorySlot slot)
        {
            switch (slot)
            {
            case WoWInventorySlot.OffHand:
            {
                var suitableOffhand = Me.Inventory.Equipped.OffHand != null &&
                                      Me.Inventory.Equipped.OffHand.ItemInfo.ItemClass == WoWItemClass.Weapon &&
                                      Me.Inventory.Equipped.MainHand != null &&
                                      StyxWoW.Me.Inventory.Equipped.MainHand.TemporaryEnchantment != null;

                if (!suitableOffhand)
                {
                    CLULogger.Log("Please Ensure your weapons are correct for the TalentSpec you are using");
                }

                return(suitableOffhand);
            }

            case WoWInventorySlot.MainHand:
            {
                var suitableMainhand = Me.Inventory.Equipped.MainHand.ItemInfo.ItemClass == WoWItemClass.Weapon &&
                                       Me.Inventory.Equipped.MainHand != null;

                if (!suitableMainhand)
                {
                    CLULogger.Log("Please Ensure your weapons are correct for the TalentSpec you are using");
                }

                return(suitableMainhand);
            }
            }

            return(false);
        }
Exemplo n.º 3
0
        internal static bool EquipItem(WoWItem item, WoWInventorySlot slot)
        {
            if (item == null || !item.IsValid)
            {
                return(false);
            }

            AutoAnglerBot.Log("Equipping {0}", item.SafeName);
            Lua.DoString("ClearCursor()");
            item.PickUp();
            Lua.DoString(string.Format("PickupInventoryItem({0})", (int)slot + 1));
            return(true);
        }
Exemplo n.º 4
0
        public async static Task <bool> EquipItem(WoWItem item, WoWInventorySlot slot)
        {
            if (!Utility.EquipItem(item, slot))
            {
                return(false);
            }
            await CommonCoroutines.SleepForLagDuration();

            if (!await Coroutine.Wait(4000, () => !item.IsDisabled))
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 5
0
        public static bool HasWeaponImbue(WoWInventorySlot slot, string imbueName, int imbueId)
        {
            Logger.Write("Checking Weapon Imbue on " + slot + " for " + imbueName);
            var item = StyxWoW.Me.Inventory.Equipped.GetEquippedItem(slot);

            if (item == null)
            {
                Logger.Write("We have no " + slot + " equipped!");
                return(true);
            }

            var enchant = item.TemporaryEnchantment;

            return(enchant != null && (enchant.Name == imbueName || imbueId == enchant.Id));
        }
Exemplo n.º 6
0
        public static bool HasWeaponImbue(WoWInventorySlot slot, string imbueName)
        {
            //Logger.Write("Checking Weapon Imbue on " + slot + " for " + imbueName);
            var item = StyxWoW.Me.Inventory.Equipped.GetEquippedItem(slot);
            if (item == null)
            {
                //Logger.Write("We have no " + slot + " equipped!");
                return true;
            }

            var enchant = item.TemporaryEnchantment;
            //if (enchant != null)
            //    Logger.Write("Enchant: " + enchant.Name + " - " + (enchant.Name == imbueName));
            return enchant != null && enchant.Name == imbueName;
        }
Exemplo n.º 7
0
        public static WoWItem GetEquippedItem(WoWInventorySlot inventorySlot, uint resultNb = 1)
        {
            if (!Usefuls.InGame || Usefuls.IsLoading)
            {
                return(new WoWItem(0));
            }
            uint nb = 1;

            try
            {
                List <WoWItem> itemsTemps = GetEquippedItems();

                foreach (WoWItem itemsTemp in itemsTemps)
                {
                    var item     = itemsTemp;
                    var itemInfo = item.GetItemInfo;
                    try
                    {
                        WoWInventorySlot invSlot = (WoWInventorySlot)Enum.Parse(typeof(WoWInventorySlot), itemInfo.ItemEquipLoc);
                        if (Enum.IsDefined(typeof(WoWInventorySlot), invSlot) | invSlot.ToString().Contains(","))
                        {
                            if (invSlot == inventorySlot && nb == resultNb)
                            {
                                return(itemsTemp);
                            }
                            if (invSlot == inventorySlot)
                            {
                                nb++;
                            }
                        }
                    }
                    catch (ArgumentException)
                    {
                        Logging.WriteError(string.Format("'{0}' is not a member of the WoWInventorySlot enumeration.", itemInfo.ItemEquipLoc));
                    }
                }
            }
            catch
            (Exception exception)
            {
                Logging.WriteError("GetEquippedItem(WoWInventorySlot inventorySlot): " + exception);
            }
            return(new WoWItem(0));
        }
Exemplo n.º 8
0
        public static bool HasWeaponImbue(WoWInventorySlot slot, string imbueName, int imbueId)
        {
            Logger.Write("Checking Weapon Imbue on " + slot + " for " + imbueName);
            var item = StyxWoW.Me.Inventory.Equipped.GetEquippedItem(slot);
            if (item == null)
            {
                Logger.Write("We have no " + slot + " equipped!");
                return true;
            }

            var enchant = item.TemporaryEnchantment;

            return enchant != null && (enchant.Name == imbueName || imbueId == enchant.Id);
        }
Exemplo n.º 9
0
        /// <summary>
        /// returns true if we have a weapon imbued
        /// </summary>
        /// <param name="slot">Inventory slot to check</param>
        /// <param name="imbueName">The name of the enchant</param>
        /// <param name="imbueId">The ID of the weapon imbue </param>
        /// <returns>true if the weapon has the enchant</returns>
        public static bool HasWeaponImbue(WoWInventorySlot slot, string imbueName, int imbueId)
        {
            // GTFO if we have a fishing pole equiped
            if (StyxWoW.Me.Inventory.Equipped.MainHand.ItemInfo.WeaponClass == WoWItemWeaponClass.FishingPole) return true;

            //SysLog.DiagnosticLog( "Checking Weapon Imbue on " + slot + " for " + imbueName);
            var item = StyxWoW.Me.Inventory.Equipped.GetEquippedItem(slot);
            if (item == null) {
                CLULogger.TroubleshootLog( "We have no " + slot + " equipped!");
                return true;
            }

            var enchant = item.TemporaryEnchantment;
            if (enchant != null) {
                //SysLog.DiagnosticLog( "Enchantment Name: " + enchant.Name);
                //SysLog.DiagnosticLog("Enchantment ID: " + enchant.Id);
                //SysLog.DiagnosticLog("ImbueName: " + imbueName);
                //SysLog.DiagnosticLog("Enchant: " + enchant.Name + " - " + (enchant.Name == imbueName));
            }

            return enchant != null && (imbueId == enchant.Id);  //enchant.Name == imbueName ||
        }
Exemplo n.º 10
0
        /// <summary>
        ///  Returns true if we meet the requirements of the weapon
        /// </summary>
        /// <param name="slot">Inventory slot to check</param>
        /// <returns>true if the weapon is suitable</returns>
        public static bool HasSuitableWeapon(WoWInventorySlot slot)
        {
            switch (slot) {
            case WoWInventorySlot.OffHand: {
                var suitableOffhand = Me.Inventory.Equipped.OffHand != null
                                      && Me.Inventory.Equipped.OffHand.ItemInfo.ItemClass == WoWItemClass.Weapon
                                      && Me.Inventory.Equipped.MainHand != null
                                      && StyxWoW.Me.Inventory.Equipped.MainHand.TemporaryEnchantment != null;

                if (!suitableOffhand)
                    CLULogger.Log("Please Ensure your weapons are correct for the TalentSpec you are using");

                return suitableOffhand;
            }

            case WoWInventorySlot.MainHand: {
                var suitableMainhand = Me.Inventory.Equipped.MainHand.ItemInfo.ItemClass == WoWItemClass.Weapon
                                       && Me.Inventory.Equipped.MainHand != null;

                if (!suitableMainhand)
                    CLULogger.Log("Please Ensure your weapons are correct for the TalentSpec you are using");

                return suitableMainhand;
            }
            }

            return false;
        }