Ejemplo n.º 1
0
        public static int GetAttributeCount(
            this Item item,
            bool normal  = true,
            bool armor   = true,
            bool weapon  = true,
            bool element = true,
            bool skills  = true,
            bool slayers = true)
        {
            int total = 0, value;

            if (normal)
            {
                total += AttributeMasks[0].Count(a => item.HasAttribute((AosAttribute)a, out value));
            }

            if (armor)
            {
                total += AttributeMasks[1].Count(a => item.HasAttribute((AosArmorAttribute)a, out value));
            }

            if (weapon)
            {
                total += AttributeMasks[2].Count(a => item.HasAttribute((AosWeaponAttribute)a, out value));
            }

            if (element)
            {
                total += AttributeMasks[3].Count(a => item.HasAttribute((AosElementAttribute)a, out value));
            }

            if (skills)
            {
                total += AttributeMasks[4].Count(a => item.HasSkillBonus((SkillName)a, out value));
            }

            if (slayers)
            {
                total += AttributeMasks[5].Count(a => item.HasSlayer((SlayerName)a));
                total += AttributeMasks[6].Count(a => item.HasSlayer((TalismanSlayerName)a));
            }

            return(total);
        }