private static int GetElementAttributeValue(BaseWeapon weapon, AosElementAttribute element)
        {
            int phys, fire, cold, pois, nrgy, chao;

            weapon.GetDamageTypes(null, out phys, out fire, out cold, out pois, out nrgy, out chao);

            switch (element)
            {
            case AosElementAttribute.Physical:
                return(phys);

            case AosElementAttribute.Fire:
                return(fire);

            case AosElementAttribute.Cold:
                return(cold);

            case AosElementAttribute.Poison:
                return(pois);

            case AosElementAttribute.Energy:
                return(nrgy);
            }

            return(-1);
        }
Пример #2
0
        private static int GetElementAttributeValue(BaseWeapon weapon, AosElementAttribute element)
        {
            weapon.GetDamageTypes(null, out int phys, out int fire, out int cold, out int pois, out int nrgy, out int chaos, out int direct);

            switch (element)
            {
            case AosElementAttribute.Physical:
                return(phys);

            case AosElementAttribute.Fire:
                return(fire);

            case AosElementAttribute.Cold:
                return(cold);

            case AosElementAttribute.Poison:
                return(pois);

            case AosElementAttribute.Energy:
                return(nrgy);

            case AosElementAttribute.Chaos:
                return(chaos);

            case AosElementAttribute.Direct:
                return(direct);
            }

            return(-1);
        }
Пример #3
0
        public EarringsOfProtection(AosElementAttribute element) : base(0x1087, Layer.Earrings)
        {
            Resistances[((AosElementAttribute)element)] = 50;

            m_Attribute = element;
            LootType    = LootType.Blessed;
        }
Пример #4
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
            m_Attribute = (AosElementAttribute)reader.ReadInt();
        }
Пример #5
0
        private static int AssignElementalDamage(BaseWeapon weapon, AosElementAttribute attr, int totalDamage)
        {
            if (totalDamage <= 0)
            {
                return(0);
            }

            int random = Utility.Random((int)(totalDamage / 10) + 1) * 10;

            // TODO: Refactor this
            // weapon.ElementDamages[attr] = random;

            switch (attr)
            {
            case AosElementAttribute.Cold:
                weapon.WeaponAttributes.DamageColdPercent = random;
                break;

            case AosElementAttribute.Energy:
                weapon.WeaponAttributes.DamageEnergyPercent = random;
                break;

            case AosElementAttribute.Fire:
                weapon.WeaponAttributes.DamageFirePercent = random;
                break;

            case AosElementAttribute.Poison:
                weapon.WeaponAttributes.DamagePoisonPercent = random;
                break;
            }

            return(totalDamage - random);
        }
Пример #6
0
        public static int[] GetPropRange(Item item, AosElementAttribute attr)
        {
            int index = GetArmorIndex(item);

            if (index < 0 || index > _MaxResistArmorTable.Length) // Default Value
            {
                return new int[] { 1, 15 }
            }
            ;

            int attrIndex;

            switch (attr)
            {
            default:
            case AosElementAttribute.Physical: attrIndex = 0; break;

            case AosElementAttribute.Fire: attrIndex = 1; break;

            case AosElementAttribute.Cold: attrIndex = 2; break;

            case AosElementAttribute.Poison: attrIndex = 3; break;

            case AosElementAttribute.Energy: attrIndex = 4; break;
            }

            return(new int[] { 1, _MaxResistArmorTable[index][attrIndex] });
        }
        public EarringsOfProtection(AosElementAttribute element)
            : base(0x4CFB, Layer.Earrings)
        {
            Resistances[((AosElementAttribute)element)] = 2;

            m_Attribute = element;
        }
 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;
 }
Пример #9
0
        public EarringsOfProtection(AosElementAttribute element)
            : base(0x1087, Layer.Earrings)
        {
            this.Resistances[((AosElementAttribute)element)] = 2;

            this.m_Attribute = element;
            this.LootType = LootType.Blessed;
        }
Пример #10
0
        public EarringsOfProtection( AosElementAttribute element )
            : base(0x1087, Layer.Earrings)
        {
            Resistances[ ( (AosElementAttribute)element ) ] = 2;

            m_Attribute = element;
            LootType = LootType.Regular;
        }
Пример #11
0
        public static int GetInc(this AosElementAttribute attr)
        {
            if (!ElementAttrFactors.ContainsKey(attr))
            {
                ElementAttrFactors.Add(attr, new AttributeFactors());
            }

            return(ElementAttrFactors[attr].Inc);
        }
Пример #12
0
        public static double GetWeight(this AosElementAttribute attr)
        {
            if (!ElementAttrFactors.ContainsKey(attr))
            {
                ElementAttrFactors.Add(attr, new AttributeFactors());
            }

            return(ElementAttrFactors[attr].Weight);
        }
Пример #13
0
        public EarringsOfProtection(AosElementAttribute element)
            : base(0x1087, Layer.Earrings)
        {
            Resistances[element] = 2;

            m_Attribute = element;
            LootType    = LootType.Blessed;

            Hue = GetItemData(m_Attribute, false);
        }
Пример #14
0
        public static void AssignElementalDamage(BaseWeapon weapon, AosElementAttribute attr)
        {
            int fire, phys, cold, nrgy, pois;

            weapon.GetDamageTypes(null, out phys, out fire, out cold, out pois, out nrgy);

            AssignElementalDamage(weapon, attr, phys);

            weapon.Hue = weapon.GetElementalDamageHue();
        }
Пример #15
0
        private static int AssignElementalDamage(BaseWeapon weapon, AosElementAttribute attr, int totalDamage)
        {
            if (totalDamage <= 0)
            {
                return(0);
            }

            int random = Utility.Random((int)(totalDamage / 10) + 1) * 10;

            return(totalDamage - random);
        }
Пример #16
0
 public int this[AosElementAttribute attribute]
 {
     get
     {
         return(GetValue((int)attribute));
     }
     set
     {
         SetValue((int)attribute, value);
     }
 }
Пример #17
0
        public static void GetElementalDamages(BaseWeapon weapon, bool randomizeOrder)
        {
            #region Mondain's Legacy
            int phys, fire, cold, pois, nrgy, chaos, direct;
            weapon.GetDamageTypes(null, out phys, out fire, out cold, out pois, out nrgy, out chaos, out direct);
            #endregion

            int totalDamage = phys;

            AosElementAttribute[] attrs = new AosElementAttribute[]
            {
                AosElementAttribute.Cold,
                AosElementAttribute.Energy,
                AosElementAttribute.Fire,
                AosElementAttribute.Poison
            };

            if (randomizeOrder)
            {
                for (int i = 0; i < attrs.Length; i++)
                {
                    int rand = Utility.Random(attrs.Length);
                    AosElementAttribute temp = attrs[i];

                    attrs[i]    = attrs[rand];
                    attrs[rand] = temp;
                }
            }


            /*
             * totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Cold,		totalDamage );
             * totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Energy,	totalDamage );
             * totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Fire,		totalDamage );
             * totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Poison,	totalDamage );
             *
             * weapon.AosElementDamages[AosElementAttribute.Physical] = 100 - totalDamage;
             * */

            for (int i = 0; i < attrs.Length; i++)
            {
                totalDamage = AssignElementalDamage(weapon, attrs[i], totalDamage);
            }


            //Order is Cold, Energy, Fire, Poison -> Physical left
            //Cannot be looped, AoselementAttribute is 'out of order'

            weapon.Hue = weapon.GetElementalDamageHue();
        }
Пример #18
0
 public static void SetMin(this AosElementAttribute attr, int min)
 {
     if (!ElementAttrFactors.ContainsKey(attr))
     {
         ElementAttrFactors.Add(
             attr,
             new AttributeFactors
         {
             Min = min
         });
     }
     else
     {
         ElementAttrFactors[attr].Min = min;
     }
 }
Пример #19
0
 public static void SetMax(this AosElementAttribute attr, int max)
 {
     if (!ElementAttrFactors.ContainsKey(attr))
     {
         ElementAttrFactors.Add(
             attr,
             new AttributeFactors
         {
             Max = max
         });
     }
     else
     {
         ElementAttrFactors[attr].Max = max;
     }
 }
Пример #20
0
 public static void SetInc(this AosElementAttribute attr, int inc)
 {
     if (!ElementAttrFactors.ContainsKey(attr))
     {
         ElementAttrFactors.Add(
             attr,
             new AttributeFactors
         {
             Inc = inc
         });
     }
     else
     {
         ElementAttrFactors[attr].Inc = inc;
     }
 }
Пример #21
0
 public static void SetWeight(this AosElementAttribute attr, double weight)
 {
     if (!ElementAttrFactors.ContainsKey(attr))
     {
         ElementAttrFactors.Add(
             attr,
             new AttributeFactors
         {
             Weight = weight
         });
     }
     else
     {
         ElementAttrFactors[attr].Weight = weight;
     }
 }
Пример #22
0
        public static int GetModForAttribute(AosElementAttribute type)
        {
            switch (type)
            {
            case AosElementAttribute.Physical: return(51);

            case AosElementAttribute.Fire: return(52);

            case AosElementAttribute.Cold: return(53);

            case AosElementAttribute.Poison: return(54);

            case AosElementAttribute.Energy: return(55);
            }

            return(-1);
        }
        public static int GetItemData(AosElementAttribute element, bool label)
        {
            switch (element)
            {
            case AosElementAttribute.Physical: return((label) ? 1071091 : 0);                              // Earring of Protection (Physical)  1071091

            case AosElementAttribute.Fire:     return((label) ? 1071092 : 0x4ec);                          // Earring of Protection (Fire)      1071092

            case AosElementAttribute.Cold:     return((label) ? 1071093 : 0x4f2);                          // Earring of Protection (Cold)      1071093

            case AosElementAttribute.Poison:   return((label) ? 1071094 : 0x4f8);                          // Earring of Protection (Poison)    1071094

            case AosElementAttribute.Energy:   return((label) ? 1071095 : 0x4fe);                          // Earring of Protection (Energy)    1071095

            default: return(-1);
            }
        }
Пример #24
0
        public static Item ConstructEarrings(Mobile m, StoreEntry entry)
        {
            AosElementAttribute ele = AosElementAttribute.Physical;

            switch (entry.Name[0].Number)
            {
            case 1071092: ele = AosElementAttribute.Fire; break;

            case 1071093: ele = AosElementAttribute.Cold; break;

            case 1071094: ele = AosElementAttribute.Poison; break;

            case 1071095: ele = AosElementAttribute.Energy; break;
            }

            return(new EarringsOfProtection(ele));
        }
 public BonusAttribute( AosElementAttribute attr, int amount )
     : this((object)attr, amount)
 {
 }
Пример #26
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;
 }
Пример #27
0
 public static void ApplyResistance(Item item, int value, AosElementAttribute attribute)
 {
     if(item is BaseJewel)
         ((BaseJewel)item).Resistances[attribute] = value;
     else if (item is BaseClothing)
         ((BaseClothing)item).Resistances[attribute] = value;
     else
     {
         switch (attribute)
         {
             default:
             case AosElementAttribute.Physical:
                 if (item is BaseArmor) ((BaseArmor)item).PhysicalBonus = value;
                 else if (item is BaseWeapon) ((BaseWeapon)item).WeaponAttributes.ResistPhysicalBonus = value;
                 break;
             case AosElementAttribute.Fire:
                 if (item is BaseArmor) ((BaseArmor)item).FireBonus = value;
                 else if (item is BaseWeapon) ((BaseWeapon)item).WeaponAttributes.ResistFireBonus = value;
                 break;
             case AosElementAttribute.Cold:
                 if (item is BaseArmor) ((BaseArmor)item).ColdBonus = value;
                 else if (item is BaseWeapon) ((BaseWeapon)item).WeaponAttributes.ResistColdBonus = value; 
                 break;
             case AosElementAttribute.Poison:
                 if (item is BaseArmor) ((BaseArmor)item).PoisonBonus = value;
                 else if (item is BaseWeapon) ((BaseWeapon)item).WeaponAttributes.ResistPoisonBonus = value; 
                 break;
             case AosElementAttribute.Energy:
                 if (item is BaseArmor) ((BaseArmor)item).EnergyBonus = value;
                 else if (item is BaseWeapon) ((BaseWeapon)item).WeaponAttributes.ResistEnergyBonus = value; 
                 break;
         }
     }
 }
Пример #28
0
 private static void ApplyAttribute(AosElementAttributes attrs, int min, int max, AosElementAttribute attr, int low, int high, int scale)
 {
     attrs[attr] = Scale(min, max, low / scale, high / scale) * scale;
 }
Пример #29
0
		public static void GetElementalDamages( BaseWeapon weapon, bool randomizeOrder )
		{
			int fire, phys, cold, nrgy, pois;

			weapon.GetDamageTypes( null, out phys, out fire, out cold, out pois, out nrgy );

			int totalDamage = phys;

			AosElementAttribute[] attrs = new AosElementAttribute[]
			{
				AosElementAttribute.Cold,
				AosElementAttribute.Energy,
				AosElementAttribute.Fire,
				AosElementAttribute.Poison
			};

			if( randomizeOrder )
			{
				for( int i = 0; i < attrs.Length; i++ )
				{
					int rand = Utility.Random( attrs.Length );
					AosElementAttribute temp = attrs[i];

					attrs[i] = attrs[rand];
					attrs[rand] = temp;
				}
			}


			/*
			totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Cold,		totalDamage );
			totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Energy,	totalDamage );
			totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Fire,		totalDamage );
			totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Poison,	totalDamage );

			weapon.AosElementDamages[AosElementAttribute.Physical] = 100 - totalDamage;
			 * */

			for( int i = 0; i < attrs.Length; i++ )
				totalDamage = AssignElementalDamage( weapon, attrs[i], totalDamage );


			//Order is Cold, Energy, Fire, Poison -> Physical left
			//Cannot be looped, AoselementAttribute is 'out of order'

			weapon.Hue = weapon.GetElementalDamageHue();
		}
Пример #30
0
 public static string ToString(this AosElementAttribute attr, double val, bool html = true)
 {
     return(GetPropertyString(val, html));
 }
Пример #31
0
		private static void ApplyAttribute( AosElementAttributes attrs, int min, int max, AosElementAttribute attr, int low, int high )
		{
			attrs[attr] = Scale( min, max, low, high );
		}
Пример #32
0
        public int Upgrade(Item itemToEnhance, bool reportCurrentValueOnly)
        {
            int value = (reportCurrentValueOnly ? 0 : IncrementValue);

            switch (Type)
            {
            case EnhanceType.None:
            {
                return(-1);
            }

            case EnhanceType.AosAttribute:
            {
                int          val  = 0;
                AosAttribute attr = (AosAttribute)Enum.Parse(typeof(AosAttribute), Name);

                if (itemToEnhance is BaseShield)
                {
                    val = ((BaseShield)itemToEnhance).Attributes.GetValue((int)attr) + value;

                    if (val > MaxValue)
                    {
                        val = MaxValue;
                    }

                    ((BaseShield)itemToEnhance).Attributes.SetValue((int)attr, val);
                }
                else if (itemToEnhance is BaseArmor)
                {
                    val = ((BaseArmor)itemToEnhance).Attributes.GetValue((int)attr) + value;

                    if (val > MaxValue)
                    {
                        val = MaxValue;
                    }

                    ((BaseArmor)itemToEnhance).Attributes.SetValue((int)attr, val);
                }
                else if (itemToEnhance is BaseWeapon)
                {
                    val = ((BaseWeapon)itemToEnhance).Attributes.GetValue((int)attr) + value;

                    if (val > MaxValue)
                    {
                        val = MaxValue;
                    }

                    ((BaseWeapon)itemToEnhance).Attributes.SetValue((int)attr, val);
                }
                else if (itemToEnhance is BaseJewel)
                {
                    val = ((BaseJewel)itemToEnhance).Attributes.GetValue((int)attr) + value;

                    if (val > MaxValue)
                    {
                        val = MaxValue;
                    }

                    ((BaseJewel)itemToEnhance).Attributes.SetValue((int)attr, val);
                }
                else if (itemToEnhance is BaseClothing)
                {
                    val = ((BaseClothing)itemToEnhance).Attributes.GetValue((int)attr) + value;

                    if (val > MaxValue)
                    {
                        val = MaxValue;
                    }

                    ((BaseClothing)itemToEnhance).Attributes.SetValue((int)attr, val);
                }
                else if (itemToEnhance is Spellbook)
                {
                    val = ((Spellbook)itemToEnhance).Attributes.GetValue((int)attr) + value;

                    if (val > MaxValue)
                    {
                        val = MaxValue;
                    }

                    ((Spellbook)itemToEnhance).Attributes.SetValue((int)attr, val);
                }

                return(val);
            }

            case EnhanceType.AosArmorAttribute:
            {
                int val = 0;
                AosArmorAttribute attr = (AosArmorAttribute)Enum.Parse(typeof(AosArmorAttribute), Name);

                if (itemToEnhance is BaseShield)
                {
                    val = ((BaseShield)itemToEnhance).ArmorAttributes.GetValue((int)attr) + value;

                    if (val > MaxValue)
                    {
                        val = MaxValue;
                    }

                    ((BaseShield)itemToEnhance).ArmorAttributes.SetValue((int)attr, val);
                }
                else if (itemToEnhance is BaseArmor)
                {
                    val = ((BaseArmor)itemToEnhance).ArmorAttributes.GetValue((int)attr) + value;

                    if (val > MaxValue)
                    {
                        val = MaxValue;
                    }

                    ((BaseArmor)itemToEnhance).ArmorAttributes.SetValue((int)attr, val);
                }

                return(val);
            }

            case EnhanceType.AosElementAttribute:
            {
                int val = 0;
                AosElementAttribute attr = (AosElementAttribute)Enum.Parse(typeof(AosElementAttribute), Name);

                if (itemToEnhance is BaseJewel)
                {
                    val = ((BaseJewel)itemToEnhance).Resistances.GetValue((int)attr) + value;

                    if (val > MaxValue)
                    {
                        val = MaxValue;
                    }

                    ((BaseJewel)itemToEnhance).Resistances.SetValue((int)attr, val);
                }
                else if (itemToEnhance is BaseClothing)
                {
                    val = ((BaseClothing)itemToEnhance).Resistances.GetValue((int)attr) + value;

                    if (val > MaxValue)
                    {
                        val = MaxValue;
                    }

                    ((BaseClothing)itemToEnhance).Resistances.SetValue((int)attr, val);
                }

                return(val);
            }

            case EnhanceType.AosWeaponAttribute:
            {
                int val = 0;
                AosWeaponAttribute attr = (AosWeaponAttribute)Enum.Parse(typeof(AosWeaponAttribute), Name);

                if (itemToEnhance is BaseWeapon)
                {
                    val = ((BaseWeapon)itemToEnhance).WeaponAttributes.GetValue((int)attr) + value;

                    if (val > MaxValue)
                    {
                        val = MaxValue;
                    }

                    ((BaseWeapon)itemToEnhance).WeaponAttributes.SetValue((int)attr, val);
                }

                return(val);
            }

            case EnhanceType.Property:
            {
                int val = 0;

                if (itemToEnhance is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)itemToEnhance;

                    switch (Name)
                    {
                    case "PhysicalBonus":
                        val = armor.PhysicalBonus + value;

                        if (val > MaxValue)
                        {
                            val = MaxValue;
                        }

                        armor.PhysicalBonus = val;
                        break;

                    case "FireBonus":
                        val = armor.FireBonus + value;

                        if (val > MaxValue)
                        {
                            val = MaxValue;
                        }

                        armor.FireBonus = val;
                        break;

                    case "ColdBonus":
                        val = armor.ColdBonus + value;

                        if (val > MaxValue)
                        {
                            val = MaxValue;
                        }

                        armor.ColdBonus = val;
                        break;

                    case "PoisonBonus":
                        val = armor.PoisonBonus + value;

                        if (val > MaxValue)
                        {
                            val = MaxValue;
                        }

                        armor.PoisonBonus = val;
                        break;

                    case "EnergyBonus":
                        val = armor.EnergyBonus + value;

                        if (val > MaxValue)
                        {
                            val = MaxValue;
                        }

                        armor.EnergyBonus = val;
                        break;
                    }
                }

                return(val);
            }
            }

            return(0);
        }
Пример #33
0
		public static bool HasAttribute(this Item item, AosElementAttribute attr, out int value)
		{
			return (HasAttribute(item, "Resistances", (ulong)attr, out value) /*||
					HasAttribute(item, "AosElementDamages", (ulong)attr, out value)*/);
		}
Пример #34
0
 public static void ApplyAttribute(AosElementAttributes attrs, AosElementAttribute attr, int amount)
 {
     attrs[attr] += amount;
 }
Пример #35
0
 public static void RemoveAttribute(AosElementAttributes attrs, AosElementAttribute attr, int amount)
 {
     attrs[attr] = Math.Max(attrs[attr] - amount, 0);
 }
Пример #36
0
 public BonusAttribute(AosElementAttribute attr, int amount) : this((object)attr, amount)
 {
 }
 public static void RemoveAttribute( AosElementAttributes attrs, AosElementAttribute attr, int amount )
 {
     attrs[attr] = Math.Max( attrs[attr] - amount, 0 );
 }
        private static int GetElementAttributeValue(BaseWeapon weapon, AosElementAttribute element)
        {
            int phys, fire, cold, pois, nrgy, chao, direct;
            weapon.GetDamageTypes(null, out phys, out fire, out cold, out pois, out nrgy, out chao, out direct);

            switch (element)
            {
                case AosElementAttribute.Physical:
                    return phys;
                case AosElementAttribute.Fire:
                    return fire;
                case AosElementAttribute.Cold:
                    return cold;
                case AosElementAttribute.Poison:
                    return pois;
                case AosElementAttribute.Energy:
                    return nrgy;
                case AosElementAttribute.Direct:
                    return direct;
            }
            return -1;
        }
Пример #39
0
		public int this[AosElementAttribute attribute]
		{
			get { return GetValue( (int)attribute ); }
			set { SetValue( (int)attribute, value ); }
		}
Пример #40
0
 public int this[AosElementAttribute attribute]
 {
     get
     {
         return this.ExtendedGetValue((int)attribute);
     }
     set
     {
         this.SetValue((int)attribute, value);
     }
 }
Пример #41
0
		private static void ApplyAttribute( AosElementAttributes attrs, int min, int max, AosElementAttribute attr, int low, int high, int scale )
		{
			attrs[attr] = Scale( min, max, low / scale, high / scale ) * scale;
		}
Пример #42
0
        public static int GetItemData( AosElementAttribute element, bool label )
        {
            switch( element )
            {
                case AosElementAttribute.Physical: return ( label ) ? 1071091 : 0;         // Earring of Protection (Physical)  1071091
                case AosElementAttribute.Fire:     return ( label ) ? 1071092 : 0x4ec;     // Earring of Protection (Fire)      1071092
                case AosElementAttribute.Cold:     return ( label ) ? 1071093 : 0x4f2;     // Earring of Protection (Cold)      1071093
                case AosElementAttribute.Poison:   return ( label ) ? 1071094 : 0x4f8;     // Earring of Protection (Poison)    1071094
                case AosElementAttribute.Energy:   return ( label ) ? 1071095 : 0x4fe;     // Earring of Protection (Energy)    1071095

                default: return -1;
            }
        }
Пример #43
0
		private static int AssignElementalDamage( BaseWeapon weapon, AosElementAttribute attr, int totalDamage )
		{
			if( totalDamage <= 0 )
				return 0;

			int random = Utility.Random( (int)(totalDamage/10) + 1 ) * 10;
			weapon.AosElementDamages[attr] = random;

			return (totalDamage - random);
		}
Пример #44
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
            m_Attribute = (AosElementAttribute)reader.ReadInt();
        }
Пример #45
0
 private static void ApplyAttribute(AosElementAttributes attrs, int min, int max, AosElementAttribute attr, int low, int high)
 {
     attrs[attr] = Scale(min, max, low, high);
 }
Пример #46
0
 public static int[] GetPropRange(AosElementAttribute attr)
 {
     return new int[] { 1, 15 };
 }
 public static void ApplyAttribute( AosElementAttributes attrs, AosElementAttribute attr, int amount )
 {
     attrs[attr] += amount;
 }
Пример #48
0
        public static int GetModForAttribute(AosElementAttribute type)
        {
            switch (type)
            {
                case AosElementAttribute.Physical: return 51;
                case AosElementAttribute.Fire: return 52;
                case AosElementAttribute.Cold: return 53;
                case AosElementAttribute.Poison: return 54;
                case AosElementAttribute.Energy: return 55;
            }

            return -1;
        }
Пример #49
0
 public static void ApplyAttribute( Mobile from, BookOfSpellCrafts book, int craftId, BaseJewel jewel, AosElementAttribute attribute, int minimum, int maximum )
 {
     CheckItem( from, jewel, ( jewel.Resistances[ attribute ] == 0 ) );
     UseMagicJewels( from, book, jewel, SpellCraftConfig.MagicJewelRequirements[craftId] );
     int scalar = ComputeSkillScalar( from );
     ApplyAttribute( jewel.Resistances, SpellCraftConfig.MinimumIntensity * scalar, SpellCraftConfig.MaximumIntensity * scalar, attribute, minimum, maximum );
 }
Пример #50
0
 public static bool HasAttribute(this Item item, AosElementAttribute attr, out int value)
 {
     return(HasAttribute(item, "Resistances", (ulong)attr, out value) /*||
                                                                       * HasAttribute(item, "AosElementDamages", (ulong)attr, out value)*/);
 }