public Armor(BaseArmor Item, uint ContainerID) { Item.UpdateLocalizedProperties(); Item.UpdateTextProperties(); //General ID = Item.Serial.Value; this.ContainerID = ContainerID; ItemName = Item.Tooltip.Split('|')[0].Replace("'", ""); CastingFocus = (sbyte)Item.Attributes.CastingFocus; DI = (sbyte)Item.Attributes.WeaponDamage; SSI = (sbyte)Item.Attributes.WeaponSpeed; FC = (sbyte)Item.Attributes.CastSpeed; FCR = (sbyte)Item.Attributes.CastRecovery; SDI = (sbyte)Item.Attributes.SpellDamage; RPD = (sbyte)Item.Attributes.ReflectPhysical; DCI = (sbyte)Item.Attributes.DefendChance; HCI = (sbyte)Item.Attributes.AttackChance; STR = (sbyte)Item.Attributes.BonusStr; DEX = (sbyte)Item.Attributes.BonusDex; INTEL = (sbyte)Item.Attributes.BonusInt; HP = (sbyte)Item.Attributes.BonusHits; Stam = (sbyte)Item.Attributes.BonusStam; Mana = (sbyte)Item.Attributes.BonusMana; HPRegen = (sbyte)Item.Attributes.RegenHits; StamRegen = (sbyte)Item.Attributes.RegenStam; ManaRegen = (sbyte)Item.Attributes.RegenMana; LMC = (sbyte)Item.Attributes.LowerManaCost; LRC = (sbyte)Item.Attributes.LowerRegCost; EnhancePotions = (sbyte)Item.Attributes.EnhancePotions; Luck = (short)Item.Attributes.Luck; PhysicalResist = (sbyte)Item.Resistances.Physical; FireResist = (sbyte)Item.Resistances.Fire; ColdResist = (sbyte)Item.Resistances.Cold; PoisonResist = (sbyte)Item.Resistances.Poison; EnergyResist = (sbyte)Item.Resistances.Energy; DamageEater = (sbyte)Item.AbsorptionAttributes.DamageEater; KineticEater = (sbyte)Item.AbsorptionAttributes.KineticEater; FireEater = (sbyte)Item.AbsorptionAttributes.FireEater; ColdEater = (sbyte)Item.AbsorptionAttributes.ColdEater; PoisonEater = (sbyte)Item.AbsorptionAttributes.PoisonEater; EnergyEater = (sbyte)Item.AbsorptionAttributes.EnergyEater; TotalStat = STR + INTEL + DEX + HP + Mana + Stam; TotalResist = PhysicalResist + FireResist + ColdResist + PoisonResist + EnergyResist; Added = DateTime.Now; //Skill Bonuses SkillBonuses = "none"; ItemSkillName _skill1 = (ItemSkillName)Item.SkillBonuses.Skill_1_Name; ItemSkillName _skill2 = (ItemSkillName)Item.SkillBonuses.Skill_2_Name; ItemSkillName _skill3 = (ItemSkillName)Item.SkillBonuses.Skill_3_Name; ItemSkillName _skill4 = (ItemSkillName)Item.SkillBonuses.Skill_4_Name; ItemSkillName _skill5 = (ItemSkillName)Item.SkillBonuses.Skill_5_Name; string[][] _skillBonusesString = new string[][] { new string[] { Item.SkillBonuses.Skill_1_Value.ToString(), _skill1.ToString() }, new string[] { Item.SkillBonuses.Skill_2_Value.ToString(), _skill2.ToString() }, new string[] { Item.SkillBonuses.Skill_3_Value.ToString(), _skill3.ToString() }, new string[] { Item.SkillBonuses.Skill_4_Value.ToString(), _skill4.ToString() }, new string[] { Item.SkillBonuses.Skill_5_Value.ToString(), _skill5.ToString() }, }; foreach (string[] _s in _skillBonusesString) { if (_s[1].Equals("Invalid")) { continue; } else { SkillBonuses = SkillBonuses + _s[0] + ' ' + _s[1]; } } SkillBonuses = SkillBonuses.Replace('_', ' '); }
public Armor(BaseArmor Item, uint ContainerID) { Item.UpdateLocalizedProperties(); Item.UpdateTextProperties(); //General Rating = 0; ID = Item.Serial.Value; this.ContainerID = ContainerID; ItemName = Item.Tooltip.Split('|')[0].Replace("'", ""); CastingFocus = (sbyte)Item.Attributes.CastingFocus; DI = (sbyte)Item.Attributes.WeaponDamage; SSI = (sbyte)Item.Attributes.WeaponSpeed; FC = (sbyte)Item.Attributes.CastSpeed; FCR = (sbyte)Item.Attributes.CastRecovery; SDI = (sbyte)Item.Attributes.SpellDamage; RPD = (sbyte)Item.Attributes.ReflectPhysical; DCI = (sbyte)Item.Attributes.DefendChance; HCI = (sbyte)Item.Attributes.AttackChance; STR = (sbyte)Item.Attributes.BonusStr; DEX = (sbyte)Item.Attributes.BonusDex; INTEL = (sbyte)Item.Attributes.BonusInt; HP = (sbyte)Item.Attributes.BonusHits; Stam = (sbyte)Item.Attributes.BonusStam; Mana = (sbyte)Item.Attributes.BonusMana; HPRegen = (sbyte)Item.Attributes.RegenHits; StamRegen = (sbyte)Item.Attributes.RegenStam; ManaRegen = (sbyte)Item.Attributes.RegenMana; LMC = (sbyte)Item.Attributes.LowerManaCost; LRC = (sbyte)Item.Attributes.LowerRegCost; EnhancePotions = (sbyte)Item.Attributes.EnhancePotions; Luck = (short)Item.Attributes.Luck; PhysicalResist = (sbyte)Item.Resistances.Physical; FireResist = (sbyte)Item.Resistances.Fire; ColdResist = (sbyte)Item.Resistances.Cold; PoisonResist = (sbyte)Item.Resistances.Poison; EnergyResist = (sbyte)Item.Resistances.Energy; DamageEater = (sbyte)Item.AbsorptionAttributes.DamageEater; KineticEater = (sbyte)Item.AbsorptionAttributes.KineticEater; FireEater = (sbyte)Item.AbsorptionAttributes.FireEater; ColdEater = (sbyte)Item.AbsorptionAttributes.ColdEater; PoisonEater = (sbyte)Item.AbsorptionAttributes.PoisonEater; EnergyEater = (sbyte)Item.AbsorptionAttributes.EnergyEater; TotalStat = STR + INTEL + DEX + HP + Mana + Stam; TotalResist = PhysicalResist + FireResist + ColdResist + PoisonResist + EnergyResist; Added = DateTime.Now; //Skill Bonuses SkillBonuses = ""; ItemSkillName _skill1 = (ItemSkillName)Item.SkillBonuses.Skill_1_Name; ItemSkillName _skill2 = (ItemSkillName)Item.SkillBonuses.Skill_2_Name; ItemSkillName _skill3 = (ItemSkillName)Item.SkillBonuses.Skill_3_Name; ItemSkillName _skill4 = (ItemSkillName)Item.SkillBonuses.Skill_4_Name; ItemSkillName _skill5 = (ItemSkillName)Item.SkillBonuses.Skill_5_Name; string[][] _skillBonusesString = new string[][] { new string[] { Item.SkillBonuses.Skill_1_Value.ToString(), _skill1.ToString() }, new string[] { Item.SkillBonuses.Skill_2_Value.ToString(), _skill2.ToString() }, new string[] { Item.SkillBonuses.Skill_3_Value.ToString(), _skill3.ToString() }, new string[] { Item.SkillBonuses.Skill_4_Value.ToString(), _skill4.ToString() }, new string[] { Item.SkillBonuses.Skill_5_Value.ToString(), _skill5.ToString() }, }; int _totalSkill = 0; foreach (string[] _s in _skillBonusesString) { if (_s[1].Equals("Invalid")) { continue; } else { SkillBonuses = SkillBonuses + _s[0] + ' ' + _s[1]; _totalSkill += Int32.Parse(_s[0]); } } SkillBonuses = SkillBonuses.Replace('_', ' '); //item rating Rating = (TotalResist / 4) + (TotalResist / 10); if (RPD > 0) { Rating += (RPD / 5); } if (DI >= 0) { Rating += (DI / 5) + (DI / 10); } if (HCI > 0) { Rating += (HCI / 2) + (HCI / 3); } if (DCI > 0) { Rating += (DCI / 2) + (DCI / 3); } if (HPRegen > 0) { Rating += (HPRegen * 4); } if (ManaRegen > 0) { Rating += (ManaRegen * 4); } if (StamRegen > 0) { Rating += (StamRegen * 3); } if (LRC > 0) { Rating += (LRC / 2) + (LRC / 3); } if (LMC > 0) { Rating += (LMC / 2) + (LMC / 3); } if (INTEL > 0) { Rating += (INTEL / 2) + (INTEL / 3); } if (DEX > 0) { Rating += (DEX / 2) + (DEX / 3); } if (STR > 0) { Rating += (STR / 2) + (STR / 3); } if (HP > 0) { Rating += (HP / 2) + (HP / 3); } if (Stam > 0) { Rating += (Stam / 2) + (Stam / 3); } if (Mana > 0) { Rating += (Mana / 2) + (Mana / 3); } int _totalEater = DamageEater + KineticEater + FireEater + ColdEater + PoisonEater + EnergyEater; if (_totalEater > 0) { Rating += (_totalEater / 2) + (_totalEater / 5); } if (_totalSkill > 0) { Rating += (_totalSkill / 2); } if (FC > 0) { Rating += (FC * 6); } if (FCR > 0) { Rating += (FCR * 6); } if (CastingFocus > 0) { Rating += (CastingFocus / 3) + (CastingFocus / 10); } if (SSI > 0) { Rating += (SSI / 3) + (SSI / 10); } if (SDI > 0) { Rating += (SDI / 2); } if (Luck > 0) { Rating += (Luck / 11) + (Luck / 15); } if (EnhancePotions > 0) { Rating += (EnhancePotions / 6); } }