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); }
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; }
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 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); }
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); }
public static int GetValue(Mobile m, AosArmorAttribute att) { if (EnhancementList.ContainsKey(m)) { return(EnhancementList[m].ArmorAttributes[att]); } return(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; }
public static int GetInc(this AosArmorAttribute attr) { if (!ArmorAttrFactors.ContainsKey(attr)) { ArmorAttrFactors.Add(attr, new AttributeFactors()); } return(ArmorAttrFactors[attr].Inc); }
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); }
public static double GetWeight(this AosArmorAttribute attr) { if (!ArmorAttrFactors.ContainsKey(attr)) { ArmorAttrFactors.Add(attr, new AttributeFactors()); } return(ArmorAttrFactors[attr].Weight); }
public int this[AosArmorAttribute attribute] { get { return(GetValue((int)attribute)); } set { SetValue((int)attribute, value); } }
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); } }
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); }
public static void ApplyAttribute(AosArmorAttributes attrs, AosArmorAttribute attr, int amount) { if (attr == AosArmorAttribute.MageArmor && attrs.MageArmor == 0) { attrs[attr] = 1; } else { attrs[attr] += amount; } }
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); }
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 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); }
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; } }
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; } }
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; } }
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; } }
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; } }
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); }
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); }
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; }
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) { }
public int this[AosArmorAttribute attribute] { get { return this.ExtendedGetValue((int)attribute); } set { this.SetValue((int)attribute, value); } }
public static int GetValue(Mobile m, AosArmorAttribute attribute) { return 0; }
public static string ToString(this AosArmorAttribute attr, double val, bool html = true) { return(GetPropertyString(val, html)); }
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; }
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; }
public int this[AosArmorAttribute attribute] { get { return GetValue( (int)attribute ); } set { SetValue( (int)attribute, value ); } }
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 ); }
private static void ApplyAttribute(AosArmorAttributes attrs, int min, int max, AosArmorAttribute attr, int low, int high) { attrs[attr] = Scale(min, max, low, high); }
public static int GetValue( Mobile m, AosArmorAttribute att ) { if ( EnhancementList.ContainsKey( m ) ) return EnhancementList[m].ArmorAttributes[att]; else return 0; }
private static void ApplyAttribute( AosArmorAttributes attrs, int min, int max, AosArmorAttribute attr, int low, int high ) { attrs[attr] = Scale( min, max, low, high ); }
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 ); }
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)); }
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 ); }
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; }
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; }
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)); }
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; }
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; }