Exemple #1
0
        private ItemUsefulProperties EvaluateItem(ExileBot.Entity item)
        {
            ItemUsefulProperties ip = new ItemUsefulProperties();

            Mods mods = item.GetComponent<Mods>();
            Sockets socks = item.GetComponent<Sockets>();
            Map map = item.HasComponent<Map>() ? item.GetComponent<Map>() : null;
            SkillGem sk = item.HasComponent<SkillGem>() ? item.GetComponent<SkillGem>() : null;
            Quality q = item.HasComponent<Quality>() ? item.GetComponent<Quality>() : null;

            ip.Name = this.poe.Files.BaseItemTypes.Translate(item.Path);
            ip.ItemLevel = mods.ItemLevel;
            ip.NumLinks = socks.LargestLinkSize;
            ip.NumSockets = socks.NumberOfSockets;
            ip.Rarity = mods.ItemRarity;
            ip.MapLevel = map == null ? 0 : 1;
            ip.IsCurrency = item.Path.Contains("Currency");
            ip.IsSkillGem = sk != null;
            ip.Quality = q == null ? 0 : q.ItemQuality;
            ip.WorthChrome = socks != null && socks.IsRGB;

            CraftingBase craftingBase;
            if (craftingBases.TryGetValue(ip.Name, out craftingBase) && Settings.GetBool("ItemAlert.Crafting"))
                ip.IsCraftingBase = ip.ItemLevel >= craftingBase.MinItemLevel && ip.Quality >= craftingBase.MinQuality;

            return ip;
        }
Exemple #2
0
        private void EntityList_OnEntityAdded(ExileBot.Entity entity)
        {
            if (!Settings.GetBool("ItemAlert") || this.currentAlerts.ContainsKey(entity))
            {
                return;
            }
            if (entity.HasComponent<WorldItem>())
            {
                ExileBot.Entity item = new ExileBot.Entity(this.poe, entity.GetComponent<WorldItem>().ItemEntity);
                ItemUsefulProperties props = this.EvaluateItem(item);

                if (props.IsWorthAlertingPlayer(currencyNames))
                {
                    this.DoAlert(entity, props);
                }
            }
        }