Пример #1
0
 public LevelInfoEntry(Mobile from, Item item, AttributeCategory cat)
     : base(98, 3)
 {
     this.m_From = from;
     this.m_Item = item;
     this.m_Cat = cat;
 }
Пример #2
0
        private ItemExperienceGump(Mobile from, Item item, AttributeCategory cat, GumpPage page)
            : base(40, 40)
        {
            this.m_From = from;
            this.m_Item = item;
            this.m_Cat = cat;
            this.m_Page = page;

            from.CloseGump(typeof(ItemExperienceGump));

            this.Closable = true;
            this.Disposable = true;
            this.Dragable = true;
            this.Resizable = false;

            this.AddPage(0);
            this.AddBackground(50, 35, 540, 382, 9270);
            this.AddAlphaRegion(66, 91, 219, 170);
            this.AddAlphaRegion(66, 49, 508, 34);
            this.AddAlphaRegion(292, 91, 283, 279);
            this.AddAlphaRegion(66, 269, 219, 101);

            this.AddLabel(262, 56, TitleHue, @"Item Experience");

            this.AddLabel(136, 93, TitleHue, @"Categories");
            this.AddButton(75, 116, 4005, 4007, GetButtonID(1, 0), GumpButtonType.Reply, 0);
            this.AddLabel(112, 117, LabelHue, @"Melee Attributes");
            this.AddButton(75, 138, 4005, 4007, GetButtonID(1, 1), GumpButtonType.Reply, 0);
            this.AddLabel(112, 139, LabelHue, @"Magic Attributes");
            this.AddButton(75, 160, 4005, 4007, GetButtonID(1, 2), GumpButtonType.Reply, 0);
            this.AddLabel(112, 161, LabelHue, @"Character Stats");
            this.AddButton(75, 182, 4005, 4007, GetButtonID(1, 3), GumpButtonType.Reply, 0);
            this.AddLabel(112, 183, LabelHue, @"Resistances");
            if (this.m_Item is BaseWeapon)
                this.AddButton(75, 204, 4005, 4007, GetButtonID(1, 4), GumpButtonType.Reply, 0);
            this.AddLabel(112, 205, LabelHue, @"Weapon Hits");
            this.AddButton(75, 226, 4005, 4007, GetButtonID(1, 5), GumpButtonType.Reply, 0);
            this.AddLabel(112, 227, LabelHue, @"Misc. Attributes");

            this.AddLabel(394, 93, TitleHue, @"Attributes");

            this.AddImage(0, 4, 10440);
            this.AddImage(554, 4, 10441);

            this.CreateItemExpList();

            this.AddButton(280, 379, 241, 243, 0, GumpButtonType.Reply, 0); //Cancel

            if (page == GumpPage.AttributeList)
                this.CreateAttributeList(cat);
        }
Пример #3
0
        public void SetAttributeForEntityCategory(EntityCategory entityCategory, AttributeCategory attributeCategory)
        {
            if (!m_entityCategoryAttributeDict.ContainsKey(entityCategory))
            {
                m_entityCategoryAttributeDict[entityCategory] = new HashSet <AttributeCategory>();
            }

            var attributeCategories = m_entityCategoryAttributeDict[entityCategory];

            if (!attributeCategories.Contains(attributeCategory))
            {
                attributeCategories.Add(attributeCategory);
            }
        }
Пример #4
0
        public void SetAttributeForEntityType(int entityType, AttributeCategory attributeCategory)
        {
            if (!m_entityTypeAttributeDict.ContainsKey(entityType))
            {
                m_entityTypeAttributeDict[entityType] = new HashSet <AttributeCategory>();
            }

            var attributeCategories = m_entityTypeAttributeDict[entityType];

            if (!attributeCategories.Contains(attributeCategory))
            {
                attributeCategories.Add(attributeCategory);
            }
        }
Пример #5
0
        private void GetBlocksWithAttribute(AttributeCategory attributeCategory, List <Block> blocks)
        {
            var mapXLength = m_map.GetLength(0);
            var mapYLength = m_map.GetLength(1);

            for (var i = 0; i < mapXLength; i++)
            {
                for (var j = 0; j < mapYLength; j++)
                {
                    foreach (var block in m_map[i, j])
                    {
                        if (m_attributeHandler.HasAttribute(block, attributeCategory))
                        {
                            blocks.Add(block);
                        }
                    }
                }
            }
        }
    public static string AttributeCategoryToString(AttributeCategory category)
    {
        switch (category)
        {
        case AttributeCategory.CombatStat:
            return("combat_stat");

        case AttributeCategory.Modifier:
            return("modifier");

        case AttributeCategory.Discount:
            return("upgrade_discount");

        case AttributeCategory.Resistance:
            return("resistance");

        default:
            return("");
        }
    }
        private static double computeSubRating(Attr sub, Attr[] subs, AttributeCategory subt)
        {
            double r = 0;

            foreach (var sub2 in subs)
            {
                if (sub == sub2 || sub2 <= Attr.Null)
                {
                    continue;
                }

                if ((subt == AttributeCategory.Offensive && attackSubs.Contains(sub2)) ||
                    (subt == AttributeCategory.Defensive && defenseSubs.Contains(sub2)) ||
                    (subt == AttributeCategory.Support && supportSubs.Contains(sub2)))
                {
                    r += 1;
                }
            }
            return(r);
        }
		public ItemExperienceGump( Mobile from, Item item, AttributeCategory cat ) : this( from, item, cat, GumpPage.None )
		{
		}
Пример #9
0
 public ItemExperienceGump(Mobile from, Item item, AttributeCategory cat)
     : this(from, item, cat, GumpPage.None)
 {
 }
Пример #10
0
 public LevelInfoEntry(Mobile from, Item item, AttributeCategory cat) : base(132, 3)
 {
     m_From = from;
     m_Item = item;
     m_Cat  = cat;
 }
Пример #11
0
 public ElementAttributeInfo(AosElementAttribute attribute, string name, AttributeCategory category, int xp, int maxvalue)
 {
     this.m_Attribute = attribute;
     this.m_Name = name;
     this.m_Category = category;
     this.m_XP = xp;
     this.m_MaxValue = maxvalue;
 }
Пример #12
0
 public SingleAttribute(AttributeCategory attributeCategory)
     : base(0, attributeCategory)
 {
 }
Пример #13
0
 public PairedAttribute(AttributeCategory attributeCategory)
     : base(0, attributeCategory)
 {
     PreservePercentage = true;
 }
 protected virtual IEnumerable <IAttribute> Get(AttributeCategory category)
 {
     return(Attributes.Where(a => a.Category == category));
 }
Пример #15
0
 public EntityTypeIsAttributeRule(LogicGameManager logicGameManager, int entityType, AttributeCategory attributeCategory)
 {
     m_logicGameManager  = logicGameManager;
     m_entityType        = entityType;
     m_attributeCategory = attributeCategory;
 }
Пример #16
0
 public ResistanceTypeInfo(ResistanceType attribute, string name, AttributeCategory category, int xp, int maxvalue)
 {
     this.m_Attribute = attribute;
     this.m_Name = name;
     this.m_Category = category;
     this.m_XP = xp;
     this.m_MaxValue = maxvalue;
 }
Пример #17
0
    public PairedAttribute(float initialValue, float initialMaxValue, bool preservePercentage, AttributeCategory attributeCategory)
        : base(initialMaxValue, attributeCategory)
    {
        PreservePercentage = preservePercentage;

        if (initialValue > initialMaxValue)
        {
            currentValue = initialMaxValue;
        }
        else
        {
            currentValue = initialValue;
        }
    }
        private static double computeSubTypeRating(AttributeCategory type, Attr sub, out AttributeCategory subt)
        {
            subt = AttributeCategory.Neutral;
            if (attackSubs.Contains(sub))
            {
                subt = AttributeCategory.Offensive;
            }
            else if (defenseSubs.Contains(sub))
            {
                subt = AttributeCategory.Defensive;
            }
            else if (supportSubs.Contains(sub))
            {
                subt = AttributeCategory.Support;
            }

            double r = 0;

            switch (type)
            {
            case AttributeCategory.Offensive:
                switch (subt)
                {
                case AttributeCategory.Offensive:
                    return(1);

                default:
                    return(0.25);
                }

            case AttributeCategory.Defensive:
                switch (subt)
                {
                case AttributeCategory.Offensive:
                    return(0.25);

                case AttributeCategory.Defensive:
                    return(1);

                default:
                    return(0.5);
                }

            case AttributeCategory.Support:
                switch (subt)
                {
                case AttributeCategory.Defensive:
                    return(0.5);

                case AttributeCategory.Support:
                    return(1);

                default:
                    return(0.25);
                }

            case AttributeCategory.Neutral:
                switch (subt)
                {
                case AttributeCategory.Offensive:
                case AttributeCategory.Defensive:
                    return(0.5);

                default:
                    return(0.25);
                }

            default:
                break;
            }

            return(r);
        }
Пример #19
0
 public SingleAttribute(float initialValue, AttributeCategory attributeCategory)
     : base(initialValue, attributeCategory)
 {
 }
Пример #20
0
 public EntityCategoryIsAttributeRule(LogicGameManager logicGameManager, EntityCategory entityCategory, AttributeCategory attributeCategory)
 {
     m_logicGameManager  = logicGameManager;
     m_entityCategory    = entityCategory;
     m_attributeCategory = attributeCategory;
 }
Пример #21
0
        public async Task <AttributeCategoryView> GetAttributeCategoryById(int attrCategoryId)
        {
            AttributeCategory attributeCategory = await _context.AttributeCategories.Include(a => a.AttributeNames).FirstOrDefaultAsync(a => a.AttributeCategoryId == attrCategoryId);

            return(_mapper.Map <AttributeCategory, AttributeCategoryView>(attributeCategory));
        }
Пример #22
0
        public void CreateAttributeList(AttributeCategory cat)
        {
            int index = 0;
            int pageindex;
            int attrvalue;

            for (int i = 0; i < LevelAttributes.m_Attributes.Length; ++i)
            {
                if (LevelAttributes.m_Attributes[i].m_Category == cat)
                {
                    pageindex = index % 10;

                    if (pageindex == 0)
                    {
                        if (index > 0)
                        {
                            this.AddButton(536, 343, 4005, 4007, 0, GumpButtonType.Page, (index / 10) + 1);
                            this.AddLabel(497, 344, LabelHue, @"Next");
                        }

                        this.AddPage((index / 10) + 1);

                        if (index > 0)
                        {
                            this.AddButton(301, 343, 4014, 4016, 0, GumpButtonType.Page, index / 10);
                            this.AddLabel(337, 344, LabelHue, @"Previous");
                        }
                    }

                    if (this.m_Item is BaseWeapon)
                    {
                        attrvalue = ((BaseWeapon)this.m_Item).Attributes[LevelAttributes.m_Attributes[i].m_Attribute];
                    }
                    else if (this.m_Item is BaseArmor)
                    {
                        attrvalue = ((BaseArmor)this.m_Item).Attributes[LevelAttributes.m_Attributes[i].m_Attribute];
                    }
                    else if (this.m_Item is BaseJewel)
                    {
                        attrvalue = ((BaseJewel)this.m_Item).Attributes[LevelAttributes.m_Attributes[i].m_Attribute];
                    }
                    else if (this.m_Item is BaseClothing)
                    {
                        attrvalue = ((BaseClothing)this.m_Item).Attributes[LevelAttributes.m_Attributes[i].m_Attribute];
                    }
                    else
                    {
                        return;
                    }

                    if (attrvalue < LevelAttributes.m_Attributes[i].m_MaxValue)
                    {
                        this.AddButton(301, 116 + (pageindex * 20), 4005, 4007, GetButtonID(2, i), GumpButtonType.Reply, 0);
                    }
                    this.AddLabel(337, 117 + (pageindex * 20), LabelHue, LevelAttributes.m_Attributes[i].m_Name + " (" + GetPointCost(this.m_Item, LevelAttributes.m_Attributes[i].m_XP) + "sp)");
                    this.AddLabel(540, 117 + (pageindex * 20), LabelHue, attrvalue.ToString());

                    ++index;
                }
            }

            if (this.m_Item is BaseWeapon)
            {
                for (int i = 0; i < LevelAttributes.m_WeaponAttributes.Length; ++i)
                {
                    if (LevelAttributes.m_WeaponAttributes[i].m_Category == cat)
                    {
                        pageindex = index % 10;

                        if (pageindex == 0)
                        {
                            if (index > 0)
                            {
                                this.AddButton(536, 343, 4005, 4007, 0, GumpButtonType.Page, (index / 10) + 1);
                                this.AddLabel(497, 344, LabelHue, @"Next");
                            }

                            this.AddPage((index / 10) + 1);

                            if (index > 0)
                            {
                                this.AddButton(301, 343, 4014, 4016, 0, GumpButtonType.Page, index / 10);
                                this.AddLabel(337, 344, LabelHue, @"Previous");
                            }
                        }

                        if (LevelAttributes.m_WeaponAttributes[i].m_Attribute == AosWeaponAttribute.DurabilityBonus)
                        {
                            attrvalue = ((BaseWeapon)this.m_Item).MaxHitPoints;
                        }
                        else
                        {
                            attrvalue = ((BaseWeapon)this.m_Item).WeaponAttributes[LevelAttributes.m_WeaponAttributes[i].m_Attribute];
                        }
                        if (attrvalue < LevelAttributes.m_WeaponAttributes[i].m_MaxValue)
                        {
                            this.AddButton(301, 116 + (pageindex * 20), 4005, 4007, GetButtonID(3, i), GumpButtonType.Reply, 0);
                        }

                        this.AddLabel(337, 117 + (pageindex * 20), LabelHue, LevelAttributes.m_WeaponAttributes[i].m_Name + " (" + GetPointCost(this.m_Item, LevelAttributes.m_WeaponAttributes[i].m_XP) + "sp)");
                        this.AddLabel(540, 117 + (pageindex * 20), LabelHue, attrvalue.ToString());

                        ++index;
                    }
                }
            }
            else if (this.m_Item is BaseArmor)
            {
                if (cat == AttributeCategory.Resists)
                {
                    for (int i = 0; i < LevelAttributes.m_ResistanceTypes.Length; ++i)
                    {
                        pageindex = index % 10;

                        if (pageindex == 0)
                        {
                            if (index > 0)
                            {
                                this.AddButton(536, 343, 4005, 4007, 0, GumpButtonType.Page, (index / 10) + 1);
                                this.AddLabel(497, 344, LabelHue, @"Next");
                            }

                            this.AddPage((index / 10) + 1);

                            if (index > 0)
                            {
                                this.AddButton(301, 343, 4014, 4016, 0, GumpButtonType.Page, index / 10);
                                this.AddLabel(337, 344, LabelHue, @"Previous");
                            }
                        }

                        if (LevelAttributes.m_ResistanceTypes[i].m_Attribute == ResistanceType.Physical)
                        {
                            attrvalue = ((BaseArmor)this.m_Item).PhysicalBonus;
                        }
                        else if (LevelAttributes.m_ResistanceTypes[i].m_Attribute == ResistanceType.Fire)
                        {
                            attrvalue = ((BaseArmor)this.m_Item).FireBonus;
                        }
                        else if (LevelAttributes.m_ResistanceTypes[i].m_Attribute == ResistanceType.Cold)
                        {
                            attrvalue = ((BaseArmor)this.m_Item).ColdBonus;
                        }
                        else if (LevelAttributes.m_ResistanceTypes[i].m_Attribute == ResistanceType.Poison)
                        {
                            attrvalue = ((BaseArmor)this.m_Item).PoisonBonus;
                        }
                        else if (LevelAttributes.m_ResistanceTypes[i].m_Attribute == ResistanceType.Energy)
                        {
                            attrvalue = ((BaseArmor)this.m_Item).EnergyBonus;
                        }
                        else
                        {
                            attrvalue = 0;
                        }

                        if (attrvalue < LevelAttributes.m_ResistanceTypes[i].m_MaxValue)
                        {
                            this.AddButton(301, 116 + (pageindex * 20), 4005, 4007, GetButtonID(5, i), GumpButtonType.Reply, 0);
                        }
                        this.AddLabel(337, 117 + (pageindex * 20), LabelHue, LevelAttributes.m_ResistanceTypes[i].m_Name + " (" + GetPointCost(this.m_Item, LevelAttributes.m_ResistanceTypes[i].m_XP) + "sp)");
                        this.AddLabel(540, 117 + (pageindex * 20), LabelHue, attrvalue.ToString());

                        ++index;
                    }
                }
                else
                {
                    for (int i = 0; i < LevelAttributes.m_ArmorAttributes.Length; ++i)
                    {
                        if (LevelAttributes.m_ArmorAttributes[i].m_Category == cat)
                        {
                            pageindex = index % 10;

                            if (pageindex == 0)
                            {
                                if (index > 0)
                                {
                                    this.AddButton(536, 343, 4005, 4007, 0, GumpButtonType.Page, (index / 10) + 1);
                                    this.AddLabel(497, 344, LabelHue, @"Next");
                                }

                                this.AddPage((index / 10) + 1);

                                if (index > 0)
                                {
                                    this.AddButton(301, 343, 4014, 4016, 0, GumpButtonType.Page, index / 10);
                                    this.AddLabel(337, 344, LabelHue, @"Previous");
                                }
                            }

                            if (LevelAttributes.m_ArmorAttributes[i].m_Attribute == AosArmorAttribute.DurabilityBonus)
                            {
                                attrvalue = ((BaseArmor)this.m_Item).MaxHitPoints;
                            }
                            else
                            {
                                attrvalue = ((BaseArmor)this.m_Item).ArmorAttributes[LevelAttributes.m_ArmorAttributes[i].m_Attribute];
                            }
                            if (attrvalue < LevelAttributes.m_ArmorAttributes[i].m_MaxValue)
                            {
                                this.AddButton(301, 116 + (pageindex * 20), 4005, 4007, GetButtonID(4, i), GumpButtonType.Reply, 0);
                            }

                            this.AddLabel(337, 117 + (pageindex * 20), LabelHue, LevelAttributes.m_ArmorAttributes[i].m_Name + " (" + GetPointCost(this.m_Item, LevelAttributes.m_ArmorAttributes[i].m_XP) + "sp)");
                            this.AddLabel(540, 117 + (pageindex * 20), LabelHue, attrvalue.ToString());

                            ++index;
                        }
                    }
                }
            }
            else if (this.m_Item is BaseJewel || this.m_Item is BaseClothing)
            {
                if (cat == AttributeCategory.Resists)
                {
                    for (int i = 0; i < LevelAttributes.m_ElementAttributes.Length; ++i)
                    {
                        pageindex = index % 10;

                        if (pageindex == 0)
                        {
                            if (index > 0)
                            {
                                this.AddButton(536, 343, 4005, 4007, 0, GumpButtonType.Page, (index / 10) + 1);
                                this.AddLabel(497, 344, LabelHue, @"Next");
                            }

                            this.AddPage((index / 10) + 1);

                            if (index > 0)
                            {
                                this.AddButton(301, 343, 4014, 4016, 0, GumpButtonType.Page, index / 10);
                                this.AddLabel(337, 344, LabelHue, @"Previous");
                            }
                        }

                        if (this.m_Item is BaseJewel)
                        {
                            attrvalue = ((BaseJewel)this.m_Item).Resistances[LevelAttributes.m_ElementAttributes[i].m_Attribute];
                        }
                        else
                        {
                            attrvalue = ((BaseClothing)this.m_Item).Resistances[LevelAttributes.m_ElementAttributes[i].m_Attribute];
                        }

                        if (attrvalue < LevelAttributes.m_ElementAttributes[i].m_MaxValue)
                        {
                            this.AddButton(301, 116 + (pageindex * 20), 4005, 4007, GetButtonID(6, i), GumpButtonType.Reply, 0);
                        }
                        this.AddLabel(337, 117 + (pageindex * 20), LabelHue, LevelAttributes.m_ElementAttributes[i].m_Name + " (" + GetPointCost(this.m_Item, LevelAttributes.m_ElementAttributes[i].m_XP) + "sp)");
                        this.AddLabel(540, 117 + (pageindex * 20), LabelHue, attrvalue.ToString());

                        ++index;
                    }
                }
            }
            else
            {
                return;
            }
        }
Пример #23
0
 bool IEveRepository.TryGetAttributeCategoryById(AttributeCategoryId id, out AttributeCategory value)
 {
     throw new NotImplementedException();
 }
Пример #24
0
 public static void ApplyUpdate(this AttributeCategory dataItem, Contracts.AttributeCategory.UpdateAttributeCategory update)
 {
     dataItem.Name        = update.Name;
     dataItem.Description = update.Description;
     dataItem.UpdatedOn   = DateTime.Now;
 }
Пример #25
0
 public ArmorAttributeInfo(AosArmorAttribute attribute, string name, AttributeCategory category, int xp, int maxvalue)
 {
     m_Attribute = attribute;
     m_Name = name;
     m_Category = category;
     m_XP = xp;
     m_MaxValue = maxvalue;
 }
Пример #26
0
 public Attribute(string name, byte value, AttributeCategory category)
 {
     Name     = name;
     Value    = value;
     Category = category;
 }
		public void CreateAttributeList( AttributeCategory cat )
		{
			int index = 0;
			int pageindex;
			int attrvalue;

			for ( int i = 0; i < LevelAttributes.m_Attributes.Length; ++i )
			{
				if (LevelAttributes.m_Attributes[i].m_Category == cat)
				{
					pageindex = index % 10;

					if ( pageindex == 0 )
					{
						if ( index > 0 )
						{
							AddButton(536, 343, 4005, 4007, 0, GumpButtonType.Page, (index / 10) + 1);
                            AddLabel(497, 344, LabelHue, @"Next");
						}

						AddPage( (index / 10) + 1 );

						if ( index > 0 )
						{
							AddButton(301, 343, 4014, 4016, 0, GumpButtonType.Page, index / 10);
                            AddLabel(337, 344, LabelHue, @"Previous");
						}
					}

                    if (m_Item is BaseWeapon)
                        attrvalue = ((BaseWeapon)m_Item).Attributes[LevelAttributes.m_Attributes[i].m_Attribute];
                    else if (m_Item is BaseArmor)
                        attrvalue = ((BaseArmor)m_Item).Attributes[LevelAttributes.m_Attributes[i].m_Attribute];
                    else if (m_Item is BaseJewel)
                        attrvalue = ((BaseJewel)m_Item).Attributes[LevelAttributes.m_Attributes[i].m_Attribute];
                    else if (m_Item is BaseClothing)
                        attrvalue = ((BaseClothing)m_Item).Attributes[LevelAttributes.m_Attributes[i].m_Attribute];
                    else
                        return;

                    if (attrvalue < LevelAttributes.m_Attributes[i].m_MaxValue)
					    AddButton(301, 116 + (pageindex * 20), 4005, 4007, GetButtonID( 2, i ), GumpButtonType.Reply, 0);
                    AddLabel(337, 117 + (pageindex * 20), LabelHue, LevelAttributes.m_Attributes[i].m_Name+" ("+GetPointCost(m_Item, LevelAttributes.m_Attributes[i].m_XP)+"sp)");
                    AddLabel(540, 117 + (pageindex * 20), LabelHue, attrvalue.ToString());

					++index;
				}
			}

            if (m_Item is BaseWeapon)
            {
                for (int i = 0; i < LevelAttributes.m_WeaponAttributes.Length; ++i)
                {
                    if (LevelAttributes.m_WeaponAttributes[i].m_Category == cat)
                    {
                        pageindex = index % 10;

                        if (pageindex == 0)
                        {
                            if (index > 0)
                            {
                                AddButton(536, 343, 4005, 4007, 0, GumpButtonType.Page, (index / 10) + 1);
                                AddLabel(497, 344, LabelHue, @"Next");
                            }

                            AddPage((index / 10) + 1);

                            if (index > 0)
                            {
                                AddButton(301, 343, 4014, 4016, 0, GumpButtonType.Page, index / 10);
                                AddLabel(337, 344, LabelHue, @"Previous");
                            }
                        }

						if (LevelAttributes.m_WeaponAttributes[i].m_Attribute == AosWeaponAttribute.DurabilityBonus)
						{
							attrvalue = ((BaseWeapon)m_Item).MaxHitPoints;
						}
						else
						{
                        	attrvalue = ((BaseWeapon)m_Item).WeaponAttributes[LevelAttributes.m_WeaponAttributes[i].m_Attribute];
						}
                        if (attrvalue < LevelAttributes.m_WeaponAttributes[i].m_MaxValue)
                            AddButton(301, 116 + (pageindex * 20), 4005, 4007, GetButtonID(3, i), GumpButtonType.Reply, 0);

                        AddLabel(337, 117 + (pageindex * 20), LabelHue, LevelAttributes.m_WeaponAttributes[i].m_Name+" ("+GetPointCost(m_Item, LevelAttributes.m_WeaponAttributes[i].m_XP)+"sp)");
                        AddLabel(540, 117 + (pageindex * 20), LabelHue, attrvalue.ToString());

                        ++index;
                    }
                }
            }
            else if (m_Item is BaseArmor)
            {
                if (cat == AttributeCategory.Resists)
                {
					for (int i = 0; i < LevelAttributes.m_ResistanceTypes.Length; ++i)
					{
						pageindex = index % 10;

						if (pageindex == 0)
						{
							if (index > 0)
							{
								AddButton(536, 343, 4005, 4007, 0, GumpButtonType.Page, (index / 10) + 1);
								AddLabel(497, 344, LabelHue, @"Next");
							}

							AddPage((index / 10) + 1);

							if (index > 0)
							{
								AddButton(301, 343, 4014, 4016, 0, GumpButtonType.Page, index / 10);
								AddLabel(337, 344, LabelHue, @"Previous");
							}
						}

						if (LevelAttributes.m_ResistanceTypes[i].m_Attribute == ResistanceType.Physical)
							attrvalue = ((BaseArmor)m_Item).PhysicalBonus;
						else if (LevelAttributes.m_ResistanceTypes[i].m_Attribute == ResistanceType.Fire)
							attrvalue = ((BaseArmor)m_Item).FireBonus;
						else if (LevelAttributes.m_ResistanceTypes[i].m_Attribute == ResistanceType.Cold)
							attrvalue = ((BaseArmor)m_Item).ColdBonus;
						else if (LevelAttributes.m_ResistanceTypes[i].m_Attribute == ResistanceType.Poison)
							attrvalue = ((BaseArmor)m_Item).PoisonBonus;
						else if (LevelAttributes.m_ResistanceTypes[i].m_Attribute == ResistanceType.Energy)
							attrvalue = ((BaseArmor)m_Item).EnergyBonus;
						else
							attrvalue = 0;

						if (attrvalue < LevelAttributes.m_ResistanceTypes[i].m_MaxValue)
							AddButton(301, 116 + (pageindex * 20), 4005, 4007, GetButtonID(5, i), GumpButtonType.Reply, 0);
						AddLabel(337, 117 + (pageindex * 20), LabelHue, LevelAttributes.m_ResistanceTypes[i].m_Name+" ("+GetPointCost(m_Item, LevelAttributes.m_ResistanceTypes[i].m_XP)+"sp)");
						AddLabel(540, 117 + (pageindex * 20), LabelHue, attrvalue.ToString());

						++index;
					}

                }
                else
                {
					for (int i = 0; i < LevelAttributes.m_ArmorAttributes.Length; ++i)
					{
						if (LevelAttributes.m_ArmorAttributes[i].m_Category == cat)
						{
							pageindex = index % 10;

							if (pageindex == 0)
							{
								if (index > 0)
								{
									AddButton(536, 343, 4005, 4007, 0, GumpButtonType.Page, (index / 10) + 1);
									AddLabel(497, 344, LabelHue, @"Next");
								}

								AddPage((index / 10) + 1);

								if (index > 0)
								{
									AddButton(301, 343, 4014, 4016, 0, GumpButtonType.Page, index / 10);
									AddLabel(337, 344, LabelHue, @"Previous");
								}
							}

							if (LevelAttributes.m_ArmorAttributes[i].m_Attribute == AosArmorAttribute.DurabilityBonus)
							{
								attrvalue = ((BaseArmor)m_Item).MaxHitPoints;
							}
							else
							{
								attrvalue = ((BaseArmor)m_Item).ArmorAttributes[LevelAttributes.m_ArmorAttributes[i].m_Attribute];
							}
							if (attrvalue < LevelAttributes.m_ArmorAttributes[i].m_MaxValue)
								AddButton(301, 116 + (pageindex * 20), 4005, 4007, GetButtonID(4, i), GumpButtonType.Reply, 0);

							AddLabel(337, 117 + (pageindex * 20), LabelHue, LevelAttributes.m_ArmorAttributes[i].m_Name+" ("+GetPointCost(m_Item, LevelAttributes.m_ArmorAttributes[i].m_XP)+"sp)");
							AddLabel(540, 117 + (pageindex * 20), LabelHue, attrvalue.ToString());

							++index;
						}
					}
				}
			}
            else if (m_Item is BaseJewel || m_Item is BaseClothing)
			{
                if (cat == AttributeCategory.Resists)
                {
					for (int i = 0; i < LevelAttributes.m_ElementAttributes.Length; ++i)
					{
						pageindex = index % 10;

						if (pageindex == 0)
						{
							if (index > 0)
							{
								AddButton(536, 343, 4005, 4007, 0, GumpButtonType.Page, (index / 10) + 1);
								AddLabel(497, 344, LabelHue, @"Next");
							}

							AddPage((index / 10) + 1);

							if (index > 0)
							{
								AddButton(301, 343, 4014, 4016, 0, GumpButtonType.Page, index / 10);
								AddLabel(337, 344, LabelHue, @"Previous");
							}
						}

						if (m_Item is BaseJewel)
							attrvalue = ((BaseJewel)m_Item).Resistances[LevelAttributes.m_ElementAttributes[i].m_Attribute];
						else
							attrvalue = ((BaseClothing)m_Item).Resistances[LevelAttributes.m_ElementAttributes[i].m_Attribute];

						if (attrvalue < LevelAttributes.m_ElementAttributes[i].m_MaxValue)
							AddButton(301, 116 + (pageindex * 20), 4005, 4007, GetButtonID(6, i), GumpButtonType.Reply, 0);
						AddLabel(337, 117 + (pageindex * 20), LabelHue, LevelAttributes.m_ElementAttributes[i].m_Name+" ("+GetPointCost(m_Item, LevelAttributes.m_ElementAttributes[i].m_XP)+"sp)");
						AddLabel(540, 117 + (pageindex * 20), LabelHue, attrvalue.ToString());

						++index;
					}
				}
            }
            else
            {
				return;
			}
		}