context: using System;
  using System.Collections.Generic;
  using Server.ContextMenus;
  using Server.Engines.Craft;
  using Server.Factions;
  using Server.Network;
  using Server.Mobiles;
  
  namespace Server.Items
  {
      public enum ClothingQuality
      {
          Low,
          Regular,
          Exceptional
      }
  
      public interface IArcaneEquip
      {
          bool IsArcane { get; }
          int CurArcaneCharges { get; set; }
          int MaxArcaneCharges { get; set; }
      }
  
      public abstract class BaseClothing : Item, IDyable, IScissorable, IFactionItem, ICraftable, IWearableDurability, ISetItem
      {
          #region Factions
          private FactionItem m_FactionState;
  
          public FactionItem FactionItemState
          {
              get
              {
                  return this.m_FactionState;
              }
              set
              {
                  this.m_FactionState = value;
  
                  if (this.m_FactionState == null)
                      this.Hue = 0;
  
                  this.LootType = (this.m_FactionState == null ? LootType.Regular : LootType.Blessed);
              }
          }
          #endregion
  
          public virtual bool CanFortify { get { return !IsImbued && NegativeAttributes.Antique < 3; } }
          public virtual bool CanRepair { get { return m_NegativeAttributes.NoRepair == 0; } }
  
          private int m_MaxHitPoints;
          private int m_HitPoints;
          private Mobile m_Crafter;
          private ClothingQuality m_Quality;
          private bool m_PlayerConstructed;
          protected CraftResource m_Resource;
          private int m_StrReq = -1;
  
          private AosAttributes m_AosAttributes;
          private AosArmorAttributes m_AosClothingAttributes;
          private AosSkillBonuses m_AosSkillBonuses;
          private AosElementAttributes m_AosResistances;
          private SAAbsorptionAttributes m_SAAbsorptionAttributes;
          private NegativeAttributes m_NegativeAttributes;
  
          #region Stygian Abyss
          private int m_TimesImbued;
          private bool m_IsImbued;
          private int m_GorgonLenseCharges;
          private LenseType m_GorgonLenseType;
  
          private int m_PhysImbuing;
          private int m_FireImbuing;
          private int m_ColdImbuing;
          private int m_PoisonImbuing;
          private int m_EnergyImbuing;
          #endregion
  
          #region Runic Reforging
          private bool m_BlockRepair;
          private ItemPower m_ItemPower;
          private ReforgedPrefix m_ReforgedPrefix;
          private ReforgedSuffix m_ReforgedSuffix;
          #endregion
  
          [CommandProperty(AccessLevel.GameMaster)]
          public int MaxHitPoints
          {
              get
              {
                  return this.m_MaxHitPoints;
              }
              set
              {
                  this.m_MaxHitPoints = value;
                  this.InvalidateProperties();
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public int HitPoints
          {
              get 
              {
                  return this.m_HitPoints;
              }
              set 
              {
                  if (value != this.m_HitPoints && this.MaxHitPoints > 0)
                  {
                      this.m_HitPoints = value;
  
                      if (this.m_HitPoints < 0)
                          this.Delete();
                      else if (this.m_HitPoints > this.MaxHitPoints)
                          this.m_HitPoints = this.MaxHitPoints;
  
                      this.InvalidateProperties();
                  }
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public Mobile Crafter
          {
              get
              {
                  return this.m_Crafter;
              }
              set
              {
                  this.m_Crafter = value;
                  this.InvalidateProperties();
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public int StrRequirement
          {
              get
              {
                  return (int)((double)(m_StrReq == -1 ? (Core.AOS ? AosStrReq : OldStrReq) : m_StrReq) * (m_NegativeAttributes.Massive > 0 ? 1.5 : 1));
              }
              set
              {
                  this.m_StrReq = value;
                  this.InvalidateProperties();
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public ClothingQuality Quality
          {
              get
              {
                  return this.m_Quality;
              }
              set
              {
                  this.m_Quality = value;
                  this.InvalidateProperties();
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public bool PlayerConstructed
          {
              get
              {
                  return this.m_PlayerConstructed;
              }
              set
              {
                  this.m_PlayerConstructed = value;
              }
          }
  
          #region Stygian Abyss
          [CommandProperty(AccessLevel.GameMaster)]
          public int TimesImbued
          {
              get { return m_TimesImbued; }
              set { m_TimesImbued = value; InvalidateProperties(); }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public bool IsImbued
          {
              get
              {
                  if (this.TimesImbued >= 1 && !m_IsImbued)
                      m_IsImbued = true;
  
                  return m_IsImbued;
              }
              set
              {
                  if (this.TimesImbued >= 1)
                      m_IsImbued = true;
                  else
                      m_IsImbued = value; InvalidateProperties();
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public int GorgonLenseCharges
          {
              get { return m_GorgonLenseCharges; }
              set { m_GorgonLenseCharges = value; if (value == 0) m_GorgonLenseType = LenseType.None; InvalidateProperties(); }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public LenseType GorgonLenseType
          {
              get { return m_GorgonLenseType; }
              set { m_GorgonLenseType = value; InvalidateProperties(); }
          }
  
          public int PhysImbuing
          {
              get { return m_PhysImbuing; }
              set { m_PhysImbuing = value; }
          }
  
          public int FireImbuing
          {
              get { return m_FireImbuing; }
              set { m_FireImbuing = value; }
          }
  
          public int ColdImbuing
          {
              get { return m_ColdImbuing; }
              set { m_ColdImbuing = value; }
          }
  
          public int PoisonImbuing
          {
              get { return m_PoisonImbuing; }
              set { m_PoisonImbuing = value; }
          }
  
          public int EnergyImbuing
          {
              get { return m_EnergyImbuing; }
              set { m_EnergyImbuing = value; }
          }
          #endregion
  
          #region Runic Reforging
          [CommandProperty(AccessLevel.GameMaster)]
          public ReforgedPrefix ReforgedPrefix
          {
              get { return m_ReforgedPrefix; }
              set { m_ReforgedPrefix = value; InvalidateProperties(); }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public ReforgedSuffix ReforgedSuffix
          {
              get { return m_ReforgedSuffix; }
              set { m_ReforgedSuffix = value; InvalidateProperties(); }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public bool BlockRepair
          {
              get { return m_BlockRepair; }
              set { m_BlockRepair = value; InvalidateProperties(); }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public ItemPower ItemPower
          {
              get { return m_ItemPower; }
              set { m_ItemPower = value; InvalidateProperties(); }
          }
          #endregion
  
          #region Personal Bless Deed
          private Mobile m_BlessedBy;
  
          [CommandProperty(AccessLevel.GameMaster)]
          public Mobile BlessedBy
          {
              get
              {
                  return this.m_BlessedBy;
              }
              set
              {
                  this.m_BlessedBy = value;
                  this.InvalidateProperties();
              }
          }
  
          public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
          {
              base.GetContextMenuEntries(from, list);
  
              if (this.BlessedFor == from && this.BlessedBy == from && this.RootParent == from)
              {
                  list.Add(new UnBlessEntry(from, this));
              }
          }
  
          private class UnBlessEntry : ContextMenuEntry
          {
              private readonly Mobile m_From;
              private readonly BaseClothing m_Item;
  
              public UnBlessEntry(Mobile from, BaseClothing item)
                  : base(6208, -1)
              {
                  this.m_From = from;
                  this.m_Item = item; // BaseArmor, BaseWeapon or BaseClothing
              }
  
              public override void OnClick()
              {
                  this.m_Item.BlessedFor = null;
                  this.m_Item.BlessedBy = null;
  
                  Container pack = this.m_From.Backpack;
  
                  if (pack != null)
                  {
                      pack.DropItem(new PersonalBlessDeed(this.m_From));
                      this.m_From.SendLocalizedMessage(1062200); // A personal bless deed has been placed in your backpack.
                  }
              }
          }
          #endregion
  
          public virtual CraftResource DefaultResource
          {
              get
              {
                  return CraftResource.None;
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public CraftResource Resource
          {
              get
              {
                  return this.m_Resource;
              }
              set
              {
                  this.m_Resource = value;
                  this.Hue = CraftResources.GetHue(this.m_Resource);
                  this.InvalidateProperties();
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public AosAttributes Attributes
          {
              get
              {
                  return this.m_AosAttributes;
              }
              set
              {
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public AosArmorAttributes ClothingAttributes
          {
              get
              {
                  return this.m_AosClothingAttributes;
              }
              set
              {
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public AosSkillBonuses SkillBonuses
          {
              get
              {
                  return this.m_AosSkillBonuses;
              }
              set
              {
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public AosElementAttributes Resistances
          {
              get
              {
                  return this.m_AosResistances;
              }
              set
              {
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public SAAbsorptionAttributes SAAbsorptionAttributes
          {
              get
              {
                  return this.m_SAAbsorptionAttributes;
              }
              set
              {
              }
          }
  
          [CommandProperty(AccessLevel.GameMaster)]
          public NegativeAttributes NegativeAttributes
          {
              get 
              { 
                  return m_NegativeAttributes;
              }
              set 
              {
              }
          }
  
          public virtual int BasePhysicalResistance
          {
              get
              {
                  return 0;
              }
          }
          public virtual int BaseFireResistance
          {
              get
              {
                  return 0;
              }
          }
          public virtual int BaseColdResistance
          {
              get
              {
                  return 0;
              }
          }
          public virtual int BasePoisonResistance
          {
              get
              {
                  return 0;
              }
          }
          public virtual int BaseEnergyResistance
          {
              get
              {
                  return 0;
              }
          }
          
          #region Mondain's Legacy Sets
          public override int PhysicalResistance
          {
              get
              {
                  return this.BasePhysicalResistance + this.m_AosResistances.Physical + (this.m_SetEquipped ? this.m_SetPhysicalBonus : 0);
              }
          }
          public override int FireResistance
          {
              get
              {
                  return this.BaseFireResistance + this.m_AosResistances.Fire + (this.m_SetEquipped ? this.m_SetFireBonus : 0);
              }
          }
          public override int ColdResistance
          {
              get
              {
                  return this.BaseColdResistance + this.m_AosResistances.Cold + (this.m_SetEquipped ? this.m_SetColdBonus : 0);
              }
          }
          public override int PoisonResistance
          {
              get
              {
                  return this.BasePoisonResistance + this.m_AosResistances.Poison + (this.m_SetEquipped ? this.m_SetPoisonBonus : 0);
              }
          }
          public override int EnergyResistance
          {
              get
              {
                  return this.BaseEnergyResistance + this.m_AosResistances.Energy + (this.m_SetEquipped ? this.m_SetEnergyBonus : 0);
              }
          }
          #endregion
  
          public virtual int ArtifactRarity
          {
              get
              {
                  return 0;
              }
          }
  
          public virtual int BaseStrBonus
          {
              get
              {
                  return 0;
              }
          }
          public virtual int BaseDexBonus
          {
              get
              {
                  return 0;
              }
          }
          public virtual int BaseIntBonus
          {
              get
              {
                  return 0;
              }
          }
  
          public override double DefaultWeight
          {
              get
              {
                  if (NegativeAttributes == null || NegativeAttributes.Unwieldly == 0)
                      return base.DefaultWeight;
  
                  return base.DefaultWeight * 3;
              }
          }
  
          public override bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted)
          {
              if (!Ethics.Ethic.CheckTrade(from, to, newOwner, this))
                  return false;
  
              return base.AllowSecureTrade(from, to, newOwner, accepted);
          }
  
          public virtual Race RequiredRace
          {
              get
              {
                  return null;
              }
          }
  
          #region Stygian Abyss
          public virtual bool CanBeWornByGargoyles
          {
              get
              {
                  return false;
              }
          }
          #endregion
  
          public override bool CanEquip(Mobile from)
          {
              if (!Ethics.Ethic.CheckEquip(from, this))
                  return false;
  
              if (from.IsPlayer())
              {
                  #region Stygian Abyss
                  if (from.Race == Race.Gargoyle && !this.CanBeWornByGargoyles)
                  {
                      from.SendLocalizedMessage(1111708); // Gargoyles can't wear this.
                      return false;
                  }
                  #endregion
                  else if (this.RequiredRace != null && from.Race != this.RequiredRace)
                  {
                      if (this.RequiredRace == Race.Elf)
                          from.SendLocalizedMessage(1072203); // Only Elves may use this.
                      else if (this.RequiredRace == Race.Gargoyle)
                          from.SendLocalizedMessage(1111707); // Only gargoyles can wear this.
                      else
                          from.SendMessage("Only {0} may use this.", this.RequiredRace.PluralName);
  
                      return false;
                  }
                  else if (!this.AllowMaleWearer && !from.Female)
                  {
                      if (this.AllowFemaleWearer)
                          from.SendLocalizedMessage(1010388); // Only females can wear this.
                      else
                          from.SendMessage("You may not wear this.");
  
                      return false;
                  }
                  else if (!this.AllowFemaleWearer && from.Female)
                  {
                      if (this.AllowMaleWearer)
                          from.SendLocalizedMessage(1063343); // Only males can wear this.
                      else
                          from.SendMessage("You may not wear this.");
  
                      return false;
                  }
                  #region Personal Bless Deed
                  else if (this.BlessedBy != null && this.BlessedBy != from)
                  {
                      from.SendLocalizedMessage(1075277); // That item is blessed by another player.
  
                      return false;
                  }
                  #endregion
                  else
                  {
                      int strBonus = this.ComputeStatBonus(StatType.Str);
                      int strReq = this.ComputeStatReq(StatType.Str);
  
                      if (from.Str < strReq || (from.Str + strBonus) < 1)
                      {
                          from.SendLocalizedMessage(500213); // You are not strong enough to equip that.
                          return false;
                      }
                  }
              }
  
              return base.CanEquip(from);
          }
  
          public virtual int AosStrReq
          {
              get
              {
                  return 10;
              }
          }
          public virtual int OldStrReq
          {
              get
              {
                  return 0;
              }
          }
  
          public virtual int InitMinHits
          {
              get
              {
                  return 0;
              }
          }
          public virtual int InitMaxHits
          {
              get
              {
                  return 0;
              }
          }
  
          public virtual bool AllowMaleWearer
          {
              get
              {
                  return true;
              }
          }
          public virtual bool AllowFemaleWearer
          {
              get
              {
                  return true;
              }
          }
          public virtual bool CanBeBlessed
          {
              get
              {
                  return true;
              }
          }
  
          public int ComputeStatReq(StatType type)
          {
              return AOS.Scale(this.StrRequirement, 100 - this.GetLowerStatReq());
          }
  
          public int ComputeStatBonus(StatType type)
          {
              if (type == StatType.Str)
                  return this.BaseStrBonus + this.Attributes.BonusStr;
              else if (type == StatType.Dex)
                  return this.BaseDexBonus + this.Attributes.BonusDex;
              else
                  return this.BaseIntBonus + this.Attributes.BonusInt;
          }
  
          public virtual void AddStatBonuses(Mobile parent)
          {
              if (parent == null)
                  return;
  
              int strBonus = this.ComputeStatBonus(StatType.Str);
              int dexBonus = this.ComputeStatBonus(StatType.Dex);
              int intBonus = this.ComputeStatBonus(StatType.Int);
  
              if (strBonus == 0 && dexBonus == 0 && intBonus == 0)
                  return;
  
              string modName = this.Serial.ToString();
  
              if (strBonus != 0)
                  parent.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
  
              if (dexBonus != 0)
                  parent.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
  
              if (intBonus != 0)
                  parent.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
          }
  
          public static void ValidateMobile(Mobile m)
          {
              for (int i = m.Items.Count - 1; i >= 0; --i)
              {
                  if (i >= m.Items.Count)
                      continue;
  
                  Item item = m.Items[i];
  
                  if (item is BaseClothing)
                  {
                      BaseClothing clothing = (BaseClothing)item;
  
                      #region Stygian Abyss
                      if (m.Race == Race.Gargoyle && !clothing.CanBeWornByGargoyles)
                      {
                          m.SendLocalizedMessage(1111708); // Gargoyles can't wear this.
                          m.AddToBackpack(clothing);
                      }
                      #endregion
  
                      if (clothing.RequiredRace != null && m.Race != clothing.RequiredRace)
                      {
                          if (clothing.RequiredRace == Race.Elf)
                              m.SendLocalizedMessage(1072203); // Only Elves may use this.
                          #region Stygian Abyss
                          else if (clothing.RequiredRace == Race.Gargoyle)
                              m.SendLocalizedMessage(1111707); // Only gargoyles can wear this.
                          #endregion
                          else
                              m.SendMessage("Only {0} may use this.", clothing.RequiredRace.PluralName);
  
                          m.AddToBackpack(clothing);
                      }
                      else if (!clothing.AllowMaleWearer && !m.Female && m.AccessLevel < AccessLevel.GameMaster)
                      {
                          if (clothing.AllowFemaleWearer)
                              m.SendLocalizedMessage(1010388); // Only females can wear this.
                          else
                              m.SendMessage("You may not wear this.");
  
                          m.AddToBackpack(clothing);
                      }
                      else if (!clothing.AllowFemaleWearer && m.Female && m.AccessLevel < AccessLevel.GameMaster)
                      {
                          if (clothing.AllowMaleWearer)
                              m.SendLocalizedMessage(1063343); // Only males can wear this.
                          else
                              m.SendMessage("You may not wear this.");
  
                          m.AddToBackpack(clothing);
                      }
                  }
              }
          }
  
          public int GetLowerStatReq()
          {
              if (!Core.AOS)
                  return 0;
  
              return this.m_AosClothingAttributes.LowerStatReq;
          }
  
          public override void OnAdded(object parent)
          {
              Mobile mob = parent as Mobile;
  
              if (mob != null)
              {
                  if (Core.AOS)
                      this.m_AosSkillBonuses.AddTo(mob);
  
                  #region Mondain's Legacy Sets
                  if (this.IsSetItem)
                  {
                      this.m_SetEquipped = SetHelper.FullSetEquipped(mob, this.SetID, this.Pieces);
  
                      if (this.m_SetEquipped)
                      {
                          this.m_LastEquipped = true;
                          SetHelper.AddSetBonus(mob, this.SetID);
                      }
                  }
                  #endregion
  
                  this.AddStatBonuses(mob);
                  mob.CheckStatTimers();
              }
  
              base.OnAdded(parent);
          }
  
          public override void OnRemoved(object parent)
          {
              Mobile mob = parent as Mobile;
  
              if (mob != null)
              {
                  if (Core.AOS)
                      this.m_AosSkillBonuses.Remove();
  
                  #region Mondain's Legacy Sets
                  if (this.IsSetItem && this.m_SetEquipped)
                      SetHelper.RemoveSetBonus(mob, this.SetID, this);
                  #endregion
  
                  string modName = this.Serial.ToString();
  
                  mob.RemoveStatMod(modName + "Str");
                  mob.RemoveStatMod(modName + "Dex");
                  mob.RemoveStatMod(modName + "Int");
  
                  mob.CheckStatTimers();
              }
  
              base.OnRemoved(parent);
          }
  
          public virtual int OnHit(BaseWeapon weapon, int damageTaken)
          {
              if (m_MaxHitPoints == 0)
                  return damageTaken;
  
              int Absorbed = Utility.RandomMinMax(1, 4);
  
              damageTaken -= Absorbed;
  
              if (damageTaken < 0) 
                  damageTaken = 0;
  
              if (25 > Utility.Random(100)) // 25% chance to lower durability
              {
                  if (Core.AOS && this.m_AosClothingAttributes.SelfRepair + (this.IsSetItem && this.m_SetEquipped ? this.m_SetSelfRepair : 0) > Utility.Random(10))
                  {
                      this.HitPoints += 2;
                  }
                  else
                  {
                      int wear;
  
                      if (weapon.Type == WeaponType.Bashing)
                          wear = Absorbed / 2;
                      else
                          wear = Utility.Random(2);
  
                      if (NegativeAttributes.Antique > 0)
                          wear *= 2;
  
                      if (wear > 0 && this.m_MaxHitPoints > 0)
                      {
                          if (this.m_HitPoints >= wear)
                          {
                              this.HitPoints -= wear;
                              wear = 0;
                          }
                          else
                          {
                              wear -= this.HitPoints;
                              this.HitPoints = 0;
                          }
  
                          if (wear > 0)
                          {
                              if (this.m_MaxHitPoints > wear)
                              {
                                  this.MaxHitPoints -= wear;
  
                                  if (this.Parent is Mobile)
                                      ((Mobile)this.Parent).LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061121); // Your equipment is severely damaged.
                              }
                              else
                              {
                                  this.Delete();
                              }
                          }
                      }
                  }
              }
  
              return damageTaken;
          }
  
          public BaseClothing(int itemID, Layer layer)
              : this(itemID, layer, 0)
          {
          }
  
          public BaseClothing(int itemID, Layer layer, int hue)
              : base(itemID)
          {
              this.Layer = layer;
              this.Hue = hue;
  
              this.m_Resource = this.DefaultResource;
              this.m_Quality = ClothingQuality.Regular;
  
              this.m_HitPoints = this.m_MaxHitPoints = Utility.RandomMinMax(this.InitMinHits, this.InitMaxHits);
  
              this.m_AosAttributes = new AosAttributes(this);
              this.m_AosClothingAttributes = new AosArmorAttributes(this);
              this.m_AosSkillBonuses = new AosSkillBonuses(this);
              this.m_AosResistances = new AosElementAttributes(this);
              this.m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this);
              m_NegativeAttributes = new NegativeAttributes(this);
  
              #region Mondain's Legacy Sets
              this.m_SetAttributes = new AosAttributes(this);
              this.m_SetSkillBonuses = new AosSkillBonuses(this);
              #endregion
          }
  
          public override void OnAfterDuped(Item newItem)
          {
              BaseClothing clothing = newItem as BaseClothing;
  
              if (clothing == null)
                  return;
  
              clothing.m_AosAttributes = new AosAttributes(newItem, this.m_AosAttributes);
              clothing.m_AosResistances = new AosElementAttributes(newItem, this.m_AosResistances);
              clothing.m_AosSkillBonuses = new AosSkillBonuses(newItem, this.m_AosSkillBonuses);
              clothing.m_AosClothingAttributes = new AosArmorAttributes(newItem, this.m_AosClothingAttributes);
              clothing.m_SAAbsorptionAttributes = new SAAbsorptionAttributes(newItem, this.m_SAAbsorptionAttributes);
              clothing.m_NegativeAttributes = new NegativeAttributes(newItem, m_NegativeAttributes);
  
              #region Mondain's Legacy
              clothing.m_SetAttributes = new AosAttributes(newItem, this.m_SetAttributes);
              clothing.m_SetSkillBonuses = new AosSkillBonuses(newItem, this.m_SetSkillBonuses);
              #endregion
          }
  
          public BaseClothing(Serial serial)
              : base(serial)
          {
          }
  
          public override bool AllowEquipedCast(Mobile from)
          {
              if (base.AllowEquipedCast(from))
                  return true;
  
              return (this.m_AosAttributes.SpellChanneling != 0);
          }
  
          public void UnscaleDurability()
          {
              int scale = 100 + this.m_AosClothingAttributes.DurabilityBonus;
  
              this.m_HitPoints = ((this.m_HitPoints * 100) + (scale - 1)) / scale;
              this.m_MaxHitPoints = ((this.m_MaxHitPoints * 100) + (scale - 1)) / scale;
  
              this.InvalidateProperties();
          }
  
          public void ScaleDurability()
          {
              int scale = 100 + this.m_AosClothingAttributes.DurabilityBonus;
  
              this.m_HitPoints = ((this.m_HitPoints * scale) + 99) / 100;
              this.m_MaxHitPoints = ((this.m_MaxHitPoints * scale) + 99) / 100;
  
              this.InvalidateProperties();
          }
  
          public override bool CheckPropertyConfliction(Mobile m)
          {
              if (base.CheckPropertyConfliction(m))
                  return true;
  
              if (this.Layer == Layer.Pants)
                  return (m.FindItemOnLayer(Layer.InnerLegs) != null);
  
              if (this.Layer == Layer.Shirt)
                  return (m.FindItemOnLayer(Layer.InnerTorso) != null);
  
              return false;
          }
  
          private string GetNameString()
          {
              string name = this.Name;
  
              if (name == null)
                  name = String.Format("#{0}", this.LabelNumber);
  
              return name;
          }
  
          public override void AddNameProperty(ObjectPropertyList list)
          {
              int oreType;
  
              switch ( this.m_Resource )
              {
                  case CraftResource.DullCopper:
                      oreType = 1053108;
                      break; // dull copper
                  case CraftResource.ShadowIron:
                      oreType = 1053107;
                      break; // shadow iron
                  case CraftResource.Copper:
                      oreType = 1053106;
                      break; // copper
                  case CraftResource.Bronze:
                      oreType = 1053105;
                      break; // bronze
                  case CraftResource.Gold:
                      oreType = 1053104;
                      break; // golden
                  case CraftResource.Agapite:
                      oreType = 1053103;
                      break; // agapite
                  case CraftResource.Verite:
                      oreType = 1053102;
                      break; // verite
                  case CraftResource.Valorite:
                      oreType = 1053101;
                      break; // valorite
                  case CraftResource.SpinedLeather:
                      oreType = 1061118;
                      break; // spined
                  case CraftResource.HornedLeather:
                      oreType = 1061117;
                      break; // horned
                  case CraftResource.BarbedLeather:
                      oreType = 1061116;
                      break; // barbed
                  case CraftResource.RedScales:
                      oreType = 1060814;
  
gt:                     break; // red