예제 #1
0
        public static int GetModForAttribute(AosArmorAttribute attr)
        {
            if (attr == AosArmorAttribute.LowerStatReq)
            {
                return(GetModForAttribute(AosWeaponAttribute.LowerStatReq));
            }

            if (attr == AosArmorAttribute.DurabilityBonus)
            {
                return(GetModForAttribute(AosWeaponAttribute.DurabilityBonus));
            }

            foreach (KeyValuePair <int, ImbuingDefinition> kvp in m_Table)
            {
                int mod = kvp.Key;
                ImbuingDefinition def = kvp.Value;

                if (def.Attribute is AosArmorAttribute && (AosArmorAttribute)def.Attribute == attr)
                {
                    return(mod);
                }
            }

            return(-1);
        }
예제 #2
0
        public static int GetValue(Mobile m, AosArmorAttribute attribute)
        {
            if (!Core.AOS)
                return 0;

            ArrayList items = m.Items;
            int value = 0;

            for (int i = 0; i < items.Count; ++i)
            {
                object obj = items[i];

                if (obj is BaseArmor)
                {
                    AosArmorAttributes attrs = ((BaseArmor)obj).ArmorAttributes;

                    if (attrs != null)
                        value += attrs[attribute];
                }
                else if (obj is BaseClothing)
                {
                    AosArmorAttributes attrs = ((BaseClothing)obj).ClothingAttributes;

                    if (attrs != null)
                        value += attrs[attribute];
                }
            }

            return value;
        }
예제 #3
0
파일: AOS.cs 프로젝트: Pumpk1ns/RunZHA
        public static int GetValue(Mobile m, AosArmorAttribute attribute)
        {
            /*if( !Core.AOS )
             *      return 0;*/

            List <Item> items = m.Items;
            int         value = 0;

            for (int i = 0; i < items.Count; ++i)
            {
                Item obj = items[i];

                if (obj is BaseArmor)
                {
                    AosArmorAttributes attrs = ((BaseArmor)obj).ArmorAttributes;

                    if (attrs != null)
                    {
                        value += attrs[attribute];
                    }
                }
                else if (obj is BaseClothing)
                {
                    AosArmorAttributes attrs = ((BaseClothing)obj).ClothingAttributes;

                    if (attrs != null)
                    {
                        value += attrs[attribute];
                    }
                }
            }

            return(value);
        }
예제 #4
0
        public static void SetValue(Mobile m, AosArmorAttribute att, int value, string title)
        {
            if (!EnhancementList.ContainsKey(m))
            {
                AddMobile(m);
            }

            EnhancementAttributes match = EnhancementList[m].FirstOrDefault(attrs => attrs.Title == title);

            if (match != null)
            {
                match.ArmorAttributes[att] = value;
            }
            else
            {
                match = new EnhancementAttributes(title);
                match.ArmorAttributes[att] = value;

                EnhancementList[m].Add(match);
            }

            m.CheckStatTimers();
            m.UpdateResistances();
            m.Delta(MobileDelta.Stat | MobileDelta.WeaponDamage | MobileDelta.Hits | MobileDelta.Stam | MobileDelta.Mana);
        }
예제 #5
0
        public static int GetValue(Mobile m, AosArmorAttribute attribute)
        {
            if (!Core.AOS)
            {
                return(0);
            }

            ArrayList items = m.Items;
            int       value = 0;

            for (int i = 0; i < items.Count; ++i)
            {
                object obj = items[i];

                if (obj is BaseArmor)
                {                /*
                                  *     AosArmorAttributes attrs = ((BaseArmor)obj).ArmorAttributes;
                                  *
                                  *     if ( attrs != null )
                                  *             value += attrs[attribute];*/
                }
            }

            return(value);
        }
예제 #6
0
 public static int GetValue(Mobile m, AosArmorAttribute att)
 {
     if (EnhancementList.ContainsKey(m))
     {
         return(EnhancementList[m].ArmorAttributes[att]);
     }
     return(0);
 }
예제 #7
0
 public ArmorGiftAttributeInfo(AosArmorAttribute attribute, string name, GiftAttributeCategory category, int xp, int maxvalue)
 {
     m_Attribute = attribute;
     m_Name      = name;
     m_Category  = category;
     m_XP        = xp;
     m_MaxValue  = maxvalue;
 }
 public ArmorAttributeInfo(AosArmorAttribute 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;
 }
예제 #9
0
        public static int GetInc(this AosArmorAttribute attr)
        {
            if (!ArmorAttrFactors.ContainsKey(attr))
            {
                ArmorAttrFactors.Add(attr, new AttributeFactors());
            }

            return(ArmorAttrFactors[attr].Inc);
        }
예제 #10
0
        public static int GetValue(Mobile m, AosArmorAttribute attribute)
        {
            if (!Core.AOS)
            {
                return(0);
            }

            List <Item> items = m.Items;
            int         value = 0;

            for (int i = 0; i < items.Count; ++i)
            {
                Item obj = items[i];

                if (obj is BaseArmor)
                {
                    AosArmorAttributes attrs = ((BaseArmor)obj).ArmorAttributes;

                    if (attrs != null)
                    {
                        value += attrs[attribute];
                    }
                }
                else if (obj is BaseClothing)
                {
                    AosArmorAttributes attrs = ((BaseClothing)obj).ClothingAttributes;

                    if (attrs != null)
                    {
                        value += attrs[attribute];
                    }
                }

                #region GeNova: Mondain's Legacy
                if (obj is BaseArmor)
                {
                    AosArmorAttributes attrs = ((BaseArmor)obj).SetArmorAttributes;

                    if (attrs != null && ((BaseArmor)obj).SetEquipped)
                    {
                        value += attrs[attribute];
                    }
                }
                else if (obj is BaseClothing)
                {
                    AosArmorAttributes attrs = ((BaseArmor)obj).SetArmorAttributes;

                    if (attrs != null && ((BaseArmor)obj).SetEquipped)
                    {
                        value += attrs[attribute];
                    }
                }
                #endregion
            }

            return(value);
        }
예제 #11
0
        public static double GetWeight(this AosArmorAttribute attr)
        {
            if (!ArmorAttrFactors.ContainsKey(attr))
            {
                ArmorAttrFactors.Add(attr, new AttributeFactors());
            }

            return(ArmorAttrFactors[attr].Weight);
        }
예제 #12
0
 public int this[AosArmorAttribute attribute]
 {
     get
     {
         return(GetValue((int)attribute));
     }
     set
     {
         SetValue((int)attribute, value);
     }
 }
예제 #13
0
 public static void RemoveAttribute(AosArmorAttributes attrs, AosArmorAttribute attr, int amount)
 {
     if (attr == AosArmorAttribute.MageArmor && attrs.MageArmor > 0)
     {
         attrs[attr] = 0;
     }
     else
     {
         attrs[attr] = Math.Max(attrs[attr] - amount, 0);
     }
 }
예제 #14
0
        public static int GetValue(Mobile m, AosArmorAttribute att)
        {
            if (EnhancementList.ContainsKey(m))
            {
                int value = 0;
                EnhancementList[m].ForEach(attrs => value += attrs.ArmorAttributes[att]);
                return(value);
            }

            return(0);
        }
예제 #15
0
 public static void ApplyAttribute(AosArmorAttributes attrs, AosArmorAttribute attr, int amount)
 {
     if (attr == AosArmorAttribute.MageArmor && attrs.MageArmor == 0)
     {
         attrs[attr] = 1;
     }
     else
     {
         attrs[attr] += amount;
     }
 }
예제 #16
0
        private static int ScaleAttribute(object o)
        {
            if (o is AosAttribute)
            {
                AosAttribute attr = (AosAttribute)o;

                if (attr == AosAttribute.Luck)
                {
                    return(10);
                }

                if (attr == AosAttribute.WeaponSpeed)
                {
                    return(5);
                }
            }
            else if (o is AosArmorAttribute)
            {
                AosArmorAttribute attr = (AosArmorAttribute)o;

                if (attr == AosArmorAttribute.LowerStatReq)
                {
                    return(10);
                }

                if (attr == AosArmorAttribute.DurabilityBonus)
                {
                    return(10);
                }
            }
            else if (o is AosWeaponAttribute)
            {
                AosWeaponAttribute attr = (AosWeaponAttribute)o;

                if (attr == AosWeaponAttribute.LowerStatReq)
                {
                    return(10);
                }

                if (attr == AosWeaponAttribute.DurabilityBonus)
                {
                    return(10);
                }
            }
            else if (o is SkillName)
            {
                return(5);
            }

            return(1);
        }
예제 #17
0
파일: Imbuing.cs 프로젝트: Jascen/VeritasUO
        public static int[] GetPropRange(AosArmorAttribute attr)
        {
            switch (attr)
            {
            case AosArmorAttribute.LowerStatReq:
            case AosArmorAttribute.DurabilityBonus: return(new int[] { 10, 100 });

            case AosArmorAttribute.SoulCharge: return(new int[] { 1, 10 });

            default:
            case AosArmorAttribute.ReactiveParalyze:
            case AosArmorAttribute.SelfRepair:
            case AosArmorAttribute.MageArmor: return(new int[] { 1, 1 });
            }
        }
예제 #18
0
        public static int GetChance(AosArmorAttribute attr, AosArmorAttributes itemAttrs)
        {
            int chance;

            switch (attr)
            {
            case AosArmorAttribute.DurabilityBonus:                 chance = itemAttrs[attr] / 40; break;

            case AosArmorAttribute.LowerStatReq:                    chance = itemAttrs[attr] / 4; break;

            default:
                chance = itemAttrs[attr] / 2; break;
            }

            return(chance);
        }
예제 #19
0
 public static void SetMax(this AosArmorAttribute attr, int max)
 {
     if (!ArmorAttrFactors.ContainsKey(attr))
     {
         ArmorAttrFactors.Add(
             attr,
             new AttributeFactors
         {
             Max = max
         });
     }
     else
     {
         ArmorAttrFactors[attr].Max = max;
     }
 }
예제 #20
0
        public static void SetValue(Mobile m, AosArmorAttribute att, int value, string title)
        {
            if (!EnhancementList.ContainsKey(m))
            {
                AddMobile(m, title);
            }

            if (title != EnhancementList[m].Title)
            {
                EnhancementList[m].ArmorAttributes[att] = value;
            }
            else
            {
                EnhancementList[m].ArmorAttributes[att] += value;
            }
        }
예제 #21
0
 public static void SetInc(this AosArmorAttribute attr, int inc)
 {
     if (!ArmorAttrFactors.ContainsKey(attr))
     {
         ArmorAttrFactors.Add(
             attr,
             new AttributeFactors
         {
             Inc = inc
         });
     }
     else
     {
         ArmorAttrFactors[attr].Inc = inc;
     }
 }
예제 #22
0
 public static void SetWeight(this AosArmorAttribute attr, double weight)
 {
     if (!ArmorAttrFactors.ContainsKey(attr))
     {
         ArmorAttrFactors.Add(
             attr,
             new AttributeFactors
         {
             Weight = weight
         });
     }
     else
     {
         ArmorAttrFactors[attr].Weight = weight;
     }
 }
예제 #23
0
 public static void SetMin(this AosArmorAttribute attr, int min)
 {
     if (!ArmorAttrFactors.ContainsKey(attr))
     {
         ArmorAttrFactors.Add(
             attr,
             new AttributeFactors
         {
             Min = min
         });
     }
     else
     {
         ArmorAttrFactors[attr].Min = min;
     }
 }
예제 #24
0
        public static int GetValue(Mobile m, AosArmorAttribute att)
        {
            if (m == null)
            {
                return(0);
            }

            if (EnhancementList.ContainsKey(m))
            {
                int value = 0;

                for (var index = 0; index < EnhancementList[m].Count; index++)
                {
                    var attrs = EnhancementList[m][index];

                    value += attrs.ArmorAttributes[att];
                }

                return(value);
            }

            return(0);
        }
예제 #25
0
        public static void SetValue(Mobile m, AosArmorAttribute att, int value, string title)
        {
            if (!EnhancementList.ContainsKey(m))
            {
                AddMobile(m);
            }

            EnhancementAttributes match = null;

            for (var index = 0; index < EnhancementList[m].Count; index++)
            {
                var attrs = EnhancementList[m][index];

                if (attrs.Title == title)
                {
                    match = attrs;
                    break;
                }
            }

            if (match != null)
            {
                match.ArmorAttributes[att] = value;
            }
            else
            {
                match = new EnhancementAttributes(title);
                match.ArmorAttributes[att] = value;

                EnhancementList[m].Add(match);
            }

            m.CheckStatTimers();
            m.UpdateResistances();
            m.Delta(MobileDelta.Stat | MobileDelta.WeaponDamage | MobileDelta.Hits | MobileDelta.Stam | MobileDelta.Mana);
        }
예제 #26
0
		public static int GetValue( Mobile m, AosArmorAttribute attribute )
		{
			int value = 0;

			foreach ( var item in m.GetEquippedItems() )
			{
				if ( item is IArmor )
				{
					AosArmorAttributes attrs = ( (IArmor) item ).ArmorAttributes;

					if ( attrs != null )
						value += attrs[attribute];
				}
				else if ( item is ICloth )
				{
					AosArmorAttributes attrs = ( (ICloth) item ).ClothingAttributes;

					if ( attrs != null )
						value += attrs[attribute];
				}
			}

			return value;
		}
예제 #27
0
		public static int GetValue( Mobile m, AosArmorAttribute attribute )
		{
			if( !Core.AOS )
				return 0;

			List<Item> items = m.Items;
			int value = 0;

			for( int i = 0; i < items.Count; ++i )
			{
				Item obj = items[i];

				if( obj is BaseArmor )
				{
					AosArmorAttributes attrs = ((BaseArmor)obj).ArmorAttributes;

					if( attrs != null )
						value += attrs[attribute];
				}
				else if( obj is BaseClothing )
				{
					AosArmorAttributes attrs = ((BaseClothing)obj).ClothingAttributes;

					if( attrs != null )
						value += attrs[attribute];
				}
			}

			return value;
		}
 public static void ApplyAttribute( AosArmorAttributes attrs, AosArmorAttribute attr, int amount )
 {
     if ( attr == AosArmorAttribute.MageArmor && attrs.MageArmor == 0 )
         attrs[attr] = 1;
     else
         attrs[attr] += amount;
 }
 public BonusAttribute( AosArmorAttribute attr, int amount )
     : this((object)attr, amount)
 {
 }
예제 #30
0
파일: AOS.cs 프로젝트: jasegiffin/JustUO
 public int this[AosArmorAttribute attribute]
 {
     get
     {
         return this.ExtendedGetValue((int)attribute);
     }
     set
     {
         this.SetValue((int)attribute, value);
     }
 }
예제 #31
0
		public static int GetValue(Mobile m, AosArmorAttribute attribute)
		{
			return 0;
		}
예제 #32
0
 public static string ToString(this AosArmorAttribute attr, double val, bool html = true)
 {
     return(GetPropertyString(val, html));
 }
예제 #33
0
 public ArmorAttributeInfo(AosArmorAttribute 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;
 }
예제 #34
0
		public static int GetValue( Mobile m, AosArmorAttribute attribute )
		{
			if ( !Core.AOS )
				return 0;

			ArrayList items = m.Items;
			int value = 0;

			for ( int i = 0; i < items.Count; ++i )
			{
				object obj = items[i];

				if ( obj is BaseArmor )
				{/*
					AosArmorAttributes attrs = ((BaseArmor)obj).ArmorAttributes;

					if ( attrs != null )
						value += attrs[attribute];*/
				}
			}

			return value;
		}
예제 #35
0
		private static void ApplyAttribute( AosArmorAttributes attrs, int min, int max, AosArmorAttribute attr, int low, int high, int scale )
		{
			attrs[attr] = Scale( min, max, low / scale, high / scale ) * scale;
		}
예제 #36
0
		public int this[AosArmorAttribute attribute]
		{
			get { return GetValue( (int)attribute ); }
			set { SetValue( (int)attribute, value ); }
		}
예제 #37
0
 public static void ApplyAttribute( Mobile from, BookOfSpellCrafts book, int craftId, BaseArmor armor, AosArmorAttribute attribute, int minimum, int maximum )
 {
     CheckItem( from, armor, ( armor.ArmorAttributes[ attribute ] == 0 ) );
     UseMagicJewels( from, book, armor, SpellCraftConfig.MagicJewelRequirements[craftId] );
     int scalar = ComputeSkillScalar( from );
     SpellCraft.ApplyAttribute( armor.ArmorAttributes, SpellCraftConfig.MinimumIntensity * scalar, SpellCraftConfig.MaximumIntensity * scalar, attribute, minimum, maximum );
     MarkArmor( from, armor );
 }
예제 #38
0
 private static void ApplyAttribute(AosArmorAttributes attrs, int min, int max, AosArmorAttribute attr, int low, int high)
 {
     attrs[attr] = Scale(min, max, low, high);
 }
예제 #39
0
		public static int GetValue( Mobile m, AosArmorAttribute att )
		{
			if ( EnhancementList.ContainsKey( m ) )
				return EnhancementList[m].ArmorAttributes[att];
			else
				return 0;
		}
예제 #40
0
		private static void ApplyAttribute( AosArmorAttributes attrs, int min, int max, AosArmorAttribute attr, int low, int high )
		{
			attrs[attr] = Scale( min, max, low, high );
		}
예제 #41
0
 public static int[] GetPropRange(AosArmorAttribute attr)
 {
     switch (attr)
     {
         case AosArmorAttribute.LowerStatReq:
         case AosArmorAttribute.DurabilityBonus: return new int[] { 10, 100 };
         case AosArmorAttribute.SoulCharge: return new int[] { 1, 10 };
         default:
         case AosArmorAttribute.ReactiveParalyze:
         case AosArmorAttribute.SelfRepair:
         case AosArmorAttribute.MageArmor: return new int[] { 1, 1 };
     }
 }
 public static void RemoveAttribute( AosArmorAttributes attrs, AosArmorAttribute attr, int amount )
 {
     if ( attr == AosArmorAttribute.MageArmor && attrs.MageArmor > 0 )
         attrs[attr] = 0;
     else
         attrs[attr] = Math.Max( attrs[attr] - amount, 0 );
 }
예제 #43
0
		public static bool HasAttribute(this Item item, AosArmorAttribute attr, out int value)
		{
			return (HasAttribute(item, "ArmorAttributes", (ulong)attr, out value) ||
					HasAttribute(item, "ClothingAttributes", (ulong)attr, out value) ||
					HasAttribute(item, "JewelAttributes", (ulong)attr, out value));
		}
예제 #44
0
 public static void ApplyAttribute( Mobile from, BookOfSpellCrafts book, int craftId, BaseHat hat, AosArmorAttribute attribute, int minimum, int maximum, int scale )
 {
     CheckItem( from, hat, ( hat.ClothingAttributes[ attribute ] == 0 ) );
     UseMagicJewels( from, book, hat, SpellCraftConfig.MagicJewelRequirements[craftId] );
     int scalar = ComputeSkillScalar( from );
     ApplyAttribute( hat.ClothingAttributes, SpellCraftConfig.MinimumIntensity * scalar, SpellCraftConfig.MaximumIntensity * scalar, attribute, minimum, maximum, scale );
     MarkHat( from, hat );
 }
예제 #45
0
        public static int GetModForAttribute(AosArmorAttribute attr)
        {
            if (attr == AosArmorAttribute.LowerStatReq)
                return GetModForAttribute(AosWeaponAttribute.LowerStatReq);

            if (attr == AosArmorAttribute.DurabilityBonus)
                return GetModForAttribute(AosWeaponAttribute.DurabilityBonus);

            foreach (KeyValuePair<int, ImbuingDefinition> kvp in m_Table)
            {
                int mod = kvp.Key;
                ImbuingDefinition def = kvp.Value;

                if (def.Attribute is AosArmorAttribute && (AosArmorAttribute)def.Attribute == attr)
                    return mod;
            }

            return -1;
        }
예제 #46
0
		public static void SetValue( Mobile m, AosArmorAttribute att, int value, string title )
		{
			if ( !EnhancementList.ContainsKey( m ) )
				AddMobile( m, title );

			if ( title != EnhancementList[m].Title )
				EnhancementList[m].ArmorAttributes[att] = value;
			else
				EnhancementList[m].ArmorAttributes[att] += value;
		}
예제 #47
0
 public static bool HasAttribute(this Item item, AosArmorAttribute attr, out int value)
 {
     return(HasAttribute(item, "ArmorAttributes", (ulong)attr, out value) ||
            HasAttribute(item, "ClothingAttributes", (ulong)attr, out value));
 }
예제 #48
0
 private static void ApplyAttribute(AosArmorAttributes attrs, int min, int max, AosArmorAttribute attr, int low, int high, int scale)
 {
     attrs[attr] = Scale(min, max, low / scale, high / scale) * scale;
 }
예제 #49
0
        public static int GetChance( AosArmorAttribute attr, AosArmorAttributes itemAttrs )
        {
            int chance;

            switch ( attr )
            {
                case AosArmorAttribute.DurabilityBonus: 		chance = itemAttrs[attr] / 50; break;
                case AosArmorAttribute.LowerStatReq: 			chance = itemAttrs[attr] / 6; break;
                default:
                    chance = itemAttrs[attr] / 2; break;
            }

            return chance;
        }