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); }
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); }
public EarringsOfProtection(AosElementAttribute element) : base(0x1087, Layer.Earrings) { Resistances[((AosElementAttribute)element)] = 50; m_Attribute = element; LootType = LootType.Blessed; }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_Attribute = (AosElementAttribute)reader.ReadInt(); }
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); }
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; }
public EarringsOfProtection(AosElementAttribute element) : base(0x1087, Layer.Earrings) { this.Resistances[((AosElementAttribute)element)] = 2; this.m_Attribute = element; this.LootType = LootType.Blessed; }
public EarringsOfProtection( AosElementAttribute element ) : base(0x1087, Layer.Earrings) { Resistances[ ( (AosElementAttribute)element ) ] = 2; m_Attribute = element; LootType = LootType.Regular; }
public static int GetInc(this AosElementAttribute attr) { if (!ElementAttrFactors.ContainsKey(attr)) { ElementAttrFactors.Add(attr, new AttributeFactors()); } return(ElementAttrFactors[attr].Inc); }
public static double GetWeight(this AosElementAttribute attr) { if (!ElementAttrFactors.ContainsKey(attr)) { ElementAttrFactors.Add(attr, new AttributeFactors()); } return(ElementAttrFactors[attr].Weight); }
public EarringsOfProtection(AosElementAttribute element) : base(0x1087, Layer.Earrings) { Resistances[element] = 2; m_Attribute = element; LootType = LootType.Blessed; Hue = GetItemData(m_Attribute, false); }
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(); }
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); }
public int this[AosElementAttribute attribute] { get { return(GetValue((int)attribute)); } set { SetValue((int)attribute, value); } }
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(); }
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; } }
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; } }
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; } }
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; } }
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); } }
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) { }
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; } } }
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; }
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(); }
public static string ToString(this AosElementAttribute attr, double val, bool html = true) { return(GetPropertyString(val, html)); }
private static void ApplyAttribute( AosElementAttributes attrs, int min, int max, AosElementAttribute attr, int low, int high ) { attrs[attr] = Scale( min, max, low, high ); }
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); }
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)*/); }
public static void ApplyAttribute(AosElementAttributes attrs, AosElementAttribute attr, int amount) { attrs[attr] += amount; }
public static void RemoveAttribute(AosElementAttributes attrs, AosElementAttribute attr, int amount) { attrs[attr] = Math.Max(attrs[attr] - amount, 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; }
public int this[AosElementAttribute attribute] { get { return GetValue( (int)attribute ); } set { SetValue( (int)attribute, value ); } }
public int this[AosElementAttribute attribute] { get { return this.ExtendedGetValue((int)attribute); } set { this.SetValue((int)attribute, value); } }
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; }
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; } }
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); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); m_Attribute = (AosElementAttribute)reader.ReadInt(); }
private static void ApplyAttribute(AosElementAttributes attrs, int min, int max, AosElementAttribute attr, int low, int high) { attrs[attr] = Scale(min, max, low, high); }
public static int[] GetPropRange(AosElementAttribute attr) { return new int[] { 1, 15 }; }
public static void ApplyAttribute( AosElementAttributes attrs, AosElementAttribute attr, int amount ) { attrs[attr] += amount; }
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 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 ); }
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)*/); }