Ejemplo n.º 1
0
        public ItemData(NormalInventoryItem inventoryItem, BaseItemType baseItemType)
        {
            InventoryItem = inventoryItem;
            var item = inventoryItem.Item;

            Path = item.Path;
            var baseComponent = item.GetComponent <Base>();

            isElder  = baseComponent.isElder;
            isShaper = baseComponent.isShaper;
            var mods = item.GetComponent <Mods>();

            Rarity      = mods?.ItemRarity ?? ItemRarity.Normal;
            BIdentified = mods?.Identified ?? true;
            ItemLevel   = mods?.ItemLevel ?? 0;
            isFractured = mods?.HaveFractured ?? false;

            var quality = item.GetComponent <Quality>();

            ItemQuality = quality?.ItemQuality ?? 0;
            ClassName   = baseItemType.ClassName;
            BaseName    = baseItemType.BaseName;
            MapTier     = item.HasComponent <Map>() ? item.GetComponent <Map>().Tier : 0;
            clientRect  = InventoryItem.GetClientRect().Center;

            var sockets = item.GetComponent <Sockets>();

            if (sockets != null)
            {
                NumberOfSockets = sockets.NumberOfSockets;
                LargestLinkSize = sockets.LargestLinkSize;
            }
        }
Ejemplo n.º 2
0
        public ItemData(NormalInventoryItem inventoryItem, BaseItemType baseItemType)
        {
            _inventoryItem = inventoryItem;
            var item = inventoryItem.Item;

            Path = item.Path;
            var baseComponent = item.GetComponent <Base>();

            isElder  = baseComponent.isElder;
            isShaper = baseComponent.isShaper;
            var mods = item.GetComponent <Mods>();

            Rarity      = mods?.ItemRarity ?? ItemRarity.Normal;
            BIdentified = mods?.Identified ?? true;
            ItemLevel   = mods?.ItemLevel ?? 0;
            isFractured = mods?.HaveFractured ?? false;
            ItemMods    = mods?.ItemMods;

            UniqueName = mods?.UniqueName;

            var quality = item.GetComponent <Quality>();

            ItemQuality = quality?.ItemQuality ?? 0;
            ClassName   = baseItemType.ClassName;
            BaseName    = baseItemType.BaseName;
            MapTier     = item.HasComponent <Map>() ? item.GetComponent <Map>().Tier : 0;
            clientRect  = _inventoryItem.GetClientRect().Center;
        }
Ejemplo n.º 3
0
        public Vector2 GetClickPos()
        {
            var paddingPixels = 3;
            var clientRect    = _inventoryItem.GetClientRect();
            var x             = MathHepler.Randomizer.Next((int)clientRect.TopLeft.X + paddingPixels, (int)clientRect.TopRight.X - paddingPixels);
            var y             = MathHepler.Randomizer.Next((int)clientRect.TopLeft.Y + paddingPixels, (int)clientRect.BottomLeft.Y - paddingPixels);

            return(new Vector2(x, y));
        }
Ejemplo n.º 4
0
        private void DrawBorder(NormalInventoryItem inventoryItem)
        {
            var rect = inventoryItem.GetClientRect();

            var borderColor = Settings.BorderColor.Value;

            var borderWidth = Settings.BorderWidth.Value;

            Graphics.DrawFrame(rect, borderColor, borderWidth);
        }
Ejemplo n.º 5
0
        public void ClickOnItemWShift(NormalInventoryItem item)
        {
            _clickWindowOffset = GameController.Window.GetWindowRectangle().TopLeft;
            var cellWOff = item.GetClientRect().Center + _clickWindowOffset;

            Keyboard.KeyDown(Keys.LControlKey);
            Thread.Sleep(INPUT_DELAY);
            Mouse.SetCursorPosAndLeftClick(cellWOff, Settings.ExtraDelay);
            Thread.Sleep(INPUT_DELAY);
            Keyboard.KeyUp(Keys.LControlKey);
        }
Ejemplo n.º 6
0
        private IEnumerator UseOrb(NormalInventoryItem orbItem)
        {
            var itemToCraft = GetItemToCraft();

            yield return(Input.SetCursorPositionSmooth(orbItem.GetClientRect().Center));

            yield return(_waitRandom);

            Input.Click(MouseButtons.Right);
            yield return(_waitRandom);

            yield return(Input.SetCursorPositionSmooth(itemToCraft.GetClientRect().Center));

            yield return(_waitRandom);

            Input.Click(MouseButtons.Left);
        }
Ejemplo n.º 7
0
        public RarityContainer ConvertItemToContainer(NormalInventoryItem item)
        {
            var newContainer = new RarityContainer {
                Element = item.GetClientRect()
            };

            if (item.Item.HasComponent <Mods>())
            {
                newContainer.Color = RarityToColor(item.Item.GetComponent <Mods>().ItemRarity);
            }

            if (item.Item.HasComponent <Base>())
            {
                newContainer.Corrupted = item.Item.GetComponent <Base>().isCorrupted;
            }
            return(newContainer);
        }
Ejemplo n.º 8
0
        public ItemData(NormalInventoryItem inventoryItem, BaseItemType baseItemType)
        {
            InventoryItem = inventoryItem;
            var item = inventoryItem.Item;

            Path = item.Path;
            var baseComponent = item.GetComponent <Base>();

            isElder      = baseComponent.isElder;
            isShaper     = baseComponent.isShaper;
            isCorrupted  = baseComponent.isCorrupted;
            isCrusader   = baseComponent.isCrusader;
            isRedeemer   = baseComponent.isRedeemer;
            isWarlord    = baseComponent.isWarlord;
            isHunter     = baseComponent.isHunter;
            isInfluenced = isCrusader || isRedeemer || isWarlord || isHunter || isShaper || isElder;
            var mods = item.GetComponent <Mods>();

            Rarity             = mods?.ItemRarity ?? ItemRarity.Normal;
            BIdentified        = mods?.Identified ?? true;
            ItemLevel          = mods?.ItemLevel ?? 0;
            Veiled             = mods?.ItemMods.Where(m => m.DisplayName.Contains("Veil")).Count() ?? 0;
            Fractured          = mods?.CountFractured ?? 0;
            Synthesised        = mods?.Synthesised ?? false;
            isBlightMap        = mods?.ItemMods.Where(m => m.Name.Contains("InfectedMap")).Count() > 0;
            isElderGuardianMap = mods?.ItemMods.Where(m => m.Name.Contains("MapElderContainsBoss")).Count() > 0;


            NumberOfSockets = item.GetComponent <Sockets>()?.NumberOfSockets ?? 0;
            LargestLinkSize = item.GetComponent <Sockets>()?.LargestLinkSize ?? 0;

            ItemQuality = item.GetComponent <Quality>()?.ItemQuality ?? 0;
            ClassName   = baseItemType.ClassName;
            BaseName    = baseItemType.BaseName;

            /*
             * if (baseItemType.BaseName.Contains("Cluster"))
             * {
             *  ClusterJewelpassives = int.Parse(new string(mods?.HumanStats.ElementAt(0).
             *      SkipWhile(c => c < '0' || c > '9').TakeWhile(c => c >= '0' && c <= '9').ToArray()));
             *  ClusterJewelBase = mods?.HumanStats.ElementAt(1).ToString();
             * }
             * else
             * {
             *  ClusterJewelpassives = 0;
             *  ClusterJewelBase = "";
             * }*/

            Name        = "";
            Description = "";
            MapTier     = item.HasComponent <Map>() ? item.GetComponent <Map>().Tier : 0;
            clientRect  = InventoryItem.GetClientRect().Center;

            if (@baseComponent.Name == "Prophecy")
            {
                var @prophParse = item.GetComponent <Prophecy>();
                ProphecyName        = @prophParse.DatProphecy.Name.ToLower();
                ProphecyName        = ProphecyName.Replace(" ", "");
                ProphecyName        = ProphecyName.Replace(",", "");
                ProphecyName        = ProphecyName.Replace("'", "");
                ProphecyDescription = @prophParse.DatProphecy.PredictionText.ToLower();
                ProphecyDescription = ProphecyDescription.Replace(" ", "");
                ProphecyDescription = ProphecyDescription.Replace(",", "");
                ProphecyDescription = ProphecyDescription.Replace("'", "");
                Description         = ProphecyDescription;
                Name     = ProphecyName;
                BaseName = "Prophecy";
            }
        }
Ejemplo n.º 9
0
 public Vector2 GetClickPos()
 {
     return(_inventoryItem.GetClientRect().Center);
 }
Ejemplo n.º 10
0
        public ItemData(NormalInventoryItem inventoryItem, BaseItemType baseItemType)
        {
            InventoryItem = inventoryItem;
            InventoryID   = inventoryItem.Item.InventoryId;
            var item = inventoryItem.Item;

            Path = item?.Path ?? "";
            var baseComponent = item.GetComponent <Base>();

            if (baseComponent == null)
            {
                return;
            }
            isElder      = baseComponent.isElder;
            isShaper     = baseComponent.isShaper;
            isCorrupted  = baseComponent.isCorrupted;
            isCrusader   = baseComponent.isCrusader;
            isRedeemer   = baseComponent.isRedeemer;
            isWarlord    = baseComponent.isWarlord;
            isHunter     = baseComponent.isHunter;
            isInfluenced = isCrusader || isRedeemer || isWarlord || isHunter || isShaper || isElder;
            ScourgeTier  = baseComponent.ScourgedTier;

            var mods = item.GetComponent <Mods>();

            Rarity        = mods?.ItemRarity ?? ItemRarity.Normal;
            BIdentified   = mods?.Identified ?? true;
            ItemLevel     = mods?.ItemLevel ?? 0;
            Veiled        = mods?.ItemMods.Where(m => m.DisplayName.Contains("Veil")).Count() ?? 0;
            Fractured     = mods?.CountFractured ?? 0;
            SkillGemLevel = item.GetComponent <SkillGem>()?.Level ?? 0;
            //SkillGemQualityType = (int)item.GetComponent<SkillGem>()?.QualityType;
            Synthesised        = mods?.Synthesised ?? false;
            isBlightMap        = mods?.ItemMods.Where(m => m.Name.Contains("InfectedMap")).Count() > 0;
            isElderGuardianMap = mods?.ItemMods.Where(m => m.Name.Contains("MapElderContainsBoss")).Count() > 0;
            Enchanted          = mods?.ItemMods.Where(m => m.Name.Contains("Enchantment")).Count() > 0;
            DeliriumStacks     = mods?.ItemMods.Where(m => m.Name.Contains("AfflictionMapReward")).Count() ?? 0;


            NumberOfSockets = item.GetComponent <Sockets>()?.NumberOfSockets ?? 0;
            LargestLinkSize = item.GetComponent <Sockets>()?.LargestLinkSize ?? 0;

            ItemQuality = item.GetComponent <Quality>()?.ItemQuality ?? 0;
            ClassName   = baseItemType?.ClassName ?? "";
            BaseName    = baseItemType?.BaseName ?? "";

            Name        = baseComponent?.Name ?? "";
            Description = "";
            MapTier     = item.GetComponent <Map>()?.Tier ?? 0;
            clientRect  = InventoryItem.GetClientRect().Center;

            if (Name == "Prophecy")
            {
                BaseName = "Prophecy";
                var prophecyComponent = item.HasComponent <Prophecy>()? item.GetComponent <Prophecy>() : null;
                if (prophecyComponent == null)
                {
                    return;
                }
                Name        = prophecyComponent.DatProphecy?.Name?.ToLower() ?? "";
                Name        = Regex.Replace(Name, @"[ ,']", "");
                Description = prophecyComponent.DatProphecy?.PredictionText?.ToLower() ?? "";
                Description = Regex.Replace(Description, @"[ ,']", "");
            }
            else
            {
                Name = mods?.UniqueName ?? "";
            }

            //if (BaseName.StartsWith("Metamorph"))
            //{
            //    var stats = mods?.HumanStats;
            //    if (stats != null)
            //    {
            //        MetamorphSampleRewardsAmount = stats.Count();
            //
            //        //var _stats = stats.Select(str => str.ToLower()).ToList();
            //        //_stats = _stats.Select(str => str.Replace(" ", "")).ToList();
            //        //_stats = _stats.Select(x => x.Substring(5)).ToList();
            //
            //        //MetamorphSampleGoodRewardsAmount = stats.Count(x => goodRewardsHS.Contains(x));
            //
            //        //MetamorphSampleGoodRewardsAmount = _stats.Where(stat => goodRewards.Any(rewards => rewards.Equals(stat))).Count();
            //        //MetamorphSampleBadRewardsAmount = _stats.Where(stat => badRewards.Any(rewards => rewards.Equals(stat))).Count();
            //    }else
            //    {
            //        MetamorphSampleRewardsAmount = -1;
            //    }
            //}
        }
Ejemplo n.º 11
0
        public static Composite IdentifyUniquesInPlayerInventory()
        {
            // Until_x_  return success . Watch out in priorityselectors

            return(new Inverter(new UntilFailure(
                                    new Sequence(
                                        OpenStash(),
                                        new Action(delegate
            {
                var ret = TryGetDataForUnidUniqueInInventory();
                if (ret.Item1 == false)
                {
                    WillBot.LogMessageCombo("Unable to find more unique items to identify");
                    return RunStatus.Failure;
                }
                tempUniqueItemInInventory = ret.Item3;
                return RunStatus.Success;
            }),
                                        MapPrepBehavior.ApplyCurrencyItemToItem(() => ItemStrings.ScrollOfWisdom, () => tempUniqueItemInInventory.GetClientRect()),
                                        new Action(delegate
            {
                Thread.Sleep(300);
                return RunStatus.Success;
            })
                                        )

                                    )));
        }
Ejemplo n.º 12
0
        public ItemData(NormalInventoryItem inventoryItem, BaseItemType baseItemType)
        {
            InventoryItem = inventoryItem;
            var item = inventoryItem.Item;

            Path = item.Path;
            var baseComponent = item.GetComponent <Base>();

            if (baseComponent != null)
            {
                isElder     = baseComponent.isElder;
                isShaper    = baseComponent.isShaper;
                isCorrupted = baseComponent.isCorrupted;
                isCrusader  = baseComponent.isCrusader;
                isRedeemer  = baseComponent.isRedeemer;
                isWarlord   = baseComponent.isWarlord;
                isHunter    = baseComponent.isHunter;
            }

            isInfluenced = isCrusader || isRedeemer || isWarlord || isHunter || isShaper || isElder;
            var mods = item.GetComponent <Mods>();

            Rarity             = mods?.ItemRarity ?? ItemRarity.Normal;
            BIdentified        = mods?.Identified ?? true;
            ItemLevel          = mods?.ItemLevel ?? 0;
            Veiled             = mods?.ItemMods.Where(m => m.DisplayName.Contains("Veil")).Count() ?? 0;
            Fractured          = mods?.CountFractured ?? 0;
            Synthesised        = mods?.Synthesised ?? false;
            isBlightMap        = mods?.ItemMods.Where(m => m.Name.Contains("InfectedMap")).Count() > 0;
            isElderGuardianMap = mods?.ItemMods.Where(m => m.Name.Contains("MapElderContainsBoss")).Count() > 0;

            var sockets = item.GetComponent <Sockets>();

            NumberOfSockets = sockets?.NumberOfSockets ?? 0;
            LargestLinkSize = sockets?.LargestLinkSize ?? 0;

            var quality = item.GetComponent <Quality>();

            ItemQuality = quality?.ItemQuality ?? 0;
            ClassName   = baseItemType.ClassName;
            BaseName    = baseItemType.BaseName;
            Name        = "";
            Description = "";
            MapTier     = item.HasComponent <Map>() ? item.GetComponent <Map>().Tier : 0;
            clientRect  = InventoryItem.GetClientRect().Center;

            if (baseComponent != null && @baseComponent.Name == "Prophecy")
            {
                var @prophParse = item.GetComponent <Prophecy>();
                ProphecyName        = @prophParse.DatProphecy.Name.ToLower();
                ProphecyName        = ProphecyName.Replace(" ", "");
                ProphecyName        = ProphecyName.Replace(",", "");
                ProphecyName        = ProphecyName.Replace("'", "");
                ProphecyDescription = @prophParse.DatProphecy.PredictionText.ToLower();
                ProphecyDescription = ProphecyDescription.Replace(" ", "");
                ProphecyDescription = ProphecyDescription.Replace(",", "");
                ProphecyDescription = ProphecyDescription.Replace("'", "");
                Description         = ProphecyDescription;
                Name     = ProphecyName;
                BaseName = "Prophecy";
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Given the number of wanted sockets, links and/or socket colors, is it possible to craft them onto the item?
        /// If it is then do it.
        /// </summary>
        /// <param name="craftingItem"></param>
        /// <returns></returns>
        private bool Craftable(NormalInventoryItem craftingItem)
        {
            var item = craftingItem.Item;
            var rec  = craftingItem.GetClientRect();

            // if the item is corrupted we can't craft upon it.
            if (IsCorrupted(item))
            {
                LogMessage("Item is non-craftable (corrupted).", 5);
                return(false);
            }

            if (!item.GetComponent <Mods>().Identified)
            {
                LogMessage("Item is non-craftable (unidentified).", 5);
                return(false);
            }

            // If we want to socket the item.
            if (Settings.SocketItem.Value)
            {
                var sockets = item.GetComponent <Sockets>();

                if (sockets.NumberOfSockets < Settings.SocketsWanted.Value)
                {
                    if (CanItemHaveNumberOfSockets(Settings.SocketsWanted.Value, item) &&
                        DoWeHaveCurrency("Jeweller's Orb"))
                    {
                        CraftIt("Jeweller's Orb", rec);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }

            // If we want to link the item.
            if (Settings.LinkItem.Value)
            {
                var sockets = item.GetComponent <Sockets>();

                if (sockets.LargestLinkSize < Settings.LinksWanted.Value)
                {
                    if (Settings.LinksWanted.Value <= sockets.NumberOfSockets &&
                        DoWeHaveCurrency("Orb of Fusing"))
                    {
                        CraftIt("Orb of Fusing", rec);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }

            // If we want to recolor the item using Chromatic Orbs
            if (Settings.ChromaticItem.Value)
            {
                // if requirements are not met
                LogMessage("Coloring is not supporoted yet.", Constants.WHILE_DELAY);
                return(false);
            }


            return(true);
        }