13440130
Member
Add a limit to equipment.
Because the system of coloredequipmentnamesv0.57.2, I have this idea
In coloredequipmentnamesv0.57.2, the system will automatically calculate the attributes of magic equipment, define different custom values through different attributes, and then give different colors to the name through the sum
Then, I wonder if I can use the value of the sum to define the conditions required for players to equip, such as level.
I think I want to make a little change compared to the traditional way of determining the equipment condition through strength value
I think this way, values / 10 is the level that the player needs when equipping.
For example, if values = 600, players need level 60 to equip, otherwise they cannot
Then, how do I modify the script?


Because the system of coloredequipmentnamesv0.57.2, I have this idea
In coloredequipmentnamesv0.57.2, the system will automatically calculate the attributes of magic equipment, define different custom values through different attributes, and then give different colors to the name through the sum
Then, I wonder if I can use the value of the sum to define the conditions required for players to equip, such as level.
I think I want to make a little change compared to the traditional way of determining the equipment condition through strength value
C#:
public static string GetArmorItemValue(Item item)
{
bool useartifactrarity = true;
BaseArmor ba = item as BaseArmor;
int values = CheckArmor(ba);
int rarityvalues = CheckArtifactArmor(ba);
if (useartifactrarity && rarityvalues >= 1)
{
if (rarityvalues >= 5)
return "<BASEFONT COLOR=#FF0000>[☆☆☆☆☆]";
else if (rarityvalues >= 4)
return "<BASEFONT COLOR=#FFFF00>[☆☆☆☆]";
else if (rarityvalues >= 3)
return "<BASEFONT COLOR=#00FFFF>[☆☆☆]";
else if (rarityvalues >= 2)
return "<BASEFONT COLOR=#00FF00>[☆☆]";
else if (rarityvalues >= 1)
return "<BASEFONT COLOR=#FFFFFF>[☆]";
return "<BASEFONT COLOR=#D6D6D6>[-]";
}
if (values >= 600)
return "<BASEFONT COLOR=#FF0000>[★★★★★★★★★]";
else if (values >= 525)
return "<BASEFONT COLOR=#FF0000>[★★★★★★★★]";
else if (values >= 450)
return "<BASEFONT COLOR=#FF0000>[★★★★★★★]";
else if (values >= 375)
return "<BASEFONT COLOR=#FF0000>[★★★★★★]";
else if (values >= 300)
return "<BASEFONT COLOR=#FF0000>[★★★★★]";
else if (values >= 225)
return "<BASEFONT COLOR=#FF8000>[★★★★]";
else if (values >= 150)
return "<BASEFONT COLOR=#A335EE>[★★★]";
else if (values >= 75)
return "<BASEFONT COLOR=#0070FF>[★★]";
else if (values >= 25)
return "<BASEFONT COLOR=#1EFF00>[★]";
return "<BASEFONT COLOR=#D6D6D6>[-]";
}
public static int CheckArtifactArmor(BaseArmor item)
{
int rarityvalue = 0;
if (item.ArtifactRarity <= 30)
rarityvalue = 4;
if (item.ArtifactRarity <= 20)
rarityvalue = 3;
if (item.ArtifactRarity <= 10)
rarityvalue = 2;
if (item.ArtifactRarity <= 1)
rarityvalue = 1;
if (item.ArtifactRarity < 1)
rarityvalue = 0;
return rarityvalue;
}
public static int CheckArmor(BaseArmor item)
{
int value = 0;
foreach (int i in Enum.GetValues(typeof(AosAttribute)))
{
if (item != null && item.Attributes[(AosAttribute)i] > 0)
value += 2;
}
foreach (int i in Enum.GetValues(typeof(AosArmorAttribute)))
{
if (item.ArmorAttributes[(AosArmorAttribute)i] > 0)
value += 2;
}
if (item.SkillBonuses.Skill_1_Value > 0)
{
value += (int)item.SkillBonuses.Skill_1_Value * 2;
value += 2;
}
if (item.SkillBonuses.Skill_2_Value > 0)
{
value += (int)item.SkillBonuses.Skill_2_Value * 2;
value += 2;
}
if (item.SkillBonuses.Skill_3_Value > 0)
{
value += (int)item.SkillBonuses.Skill_3_Value * 2;
value += 2;
}
if (item.SkillBonuses.Skill_4_Value > 0)
{
value += (int)item.SkillBonuses.Skill_4_Value * 2;
value += 2;
}
if (item.SkillBonuses.Skill_5_Value > 0)
{
value += (int)item.SkillBonuses.Skill_5_Value * 2;
value += 2;
}
//Start armor attributes
if (item.ArmorAttributes.DurabilityBonus > 0)
value += item.ArmorAttributes.DurabilityBonus / 4;
if (item.ArmorAttributes.LowerStatReq > 0)
value += item.ArmorAttributes.LowerStatReq / 4;
if (item.ArmorAttributes.MageArmor > 0)
value += 10;
if (item.ArmorAttributes.SelfRepair > 0)
value += item.ArmorAttributes.SelfRepair * 2;
//Start standard attributes
if (item.Attributes.AttackChance > 0)
value += item.Attributes.AttackChance * 4;
if (item.Attributes.BonusDex > 0)
value += item.Attributes.BonusDex * 6;
if (item.Attributes.BonusHits > 0)
value += item.Attributes.BonusHits * 4;
if (item.Attributes.BonusInt > 0)
value += item.Attributes.BonusInt * 6;
if (item.Attributes.BonusMana > 0)
value += item.Attributes.BonusMana * 4;
if (item.Attributes.BonusStam > 0)
value += item.Attributes.BonusStam * 4;
if (item.Attributes.BonusStr > 0)
value += item.Attributes.BonusStr * 6;
if (item.Attributes.CastRecovery > 0)
value += item.Attributes.CastRecovery * 10;
if (item.Attributes.CastSpeed > 0)
value += item.Attributes.CastSpeed * 10;
if (item.Attributes.DefendChance > 0)
value += item.Attributes.DefendChance * 4;
if (item.Attributes.EnhancePotions > 0)
value += item.Attributes.EnhancePotions;
if (item.Attributes.LowerManaCost > 0)
value += item.Attributes.LowerManaCost * 4;
if (item.Attributes.LowerRegCost > 0)
value += item.Attributes.LowerRegCost * 2;
if (item.Attributes.Luck > 0)
value += item.Attributes.Luck / 2;
if (item.Attributes.NightSight > 0)
value += 10;
if (item.Attributes.ReflectPhysical > 0)
value += item.Attributes.ReflectPhysical * 2;
if (item.Attributes.RegenHits > 0)
value += item.Attributes.RegenHits * 5;
if (item.Attributes.RegenMana > 0)
value += item.Attributes.RegenMana * 5;
if (item.Attributes.RegenStam > 0)
value += item.Attributes.RegenStam * 5;
if (item.Attributes.SpellChanneling > 0)
value += 40;
if (item.Attributes.SpellDamage > 0)
value += item.Attributes.SpellDamage * 4;
if (item.Attributes.WeaponDamage > 0)
value += item.Attributes.WeaponDamage * 3;
if (item.Attributes.WeaponSpeed > 0)
value += item.Attributes.WeaponSpeed * 6;
//Start Absorption Attributes
if (item.AbsorptionAttributes.CastingFocus > 0)
value += item.AbsorptionAttributes.CastingFocus;
if (item.AbsorptionAttributes.EaterCold > 0)
value += item.AbsorptionAttributes.EaterCold;
if (item.AbsorptionAttributes.EaterDamage > 0)
value += item.AbsorptionAttributes.EaterDamage;
if (item.AbsorptionAttributes.EaterEnergy > 0)
value += item.AbsorptionAttributes.EaterEnergy;
if (item.AbsorptionAttributes.EaterFire > 0)
value += item.AbsorptionAttributes.EaterFire;
if (item.AbsorptionAttributes.EaterKinetic > 0)
value += item.AbsorptionAttributes.EaterKinetic;
if (item.AbsorptionAttributes.EaterPoison > 0)
value += item.AbsorptionAttributes.EaterPoison;
if (item.AbsorptionAttributes.ResonanceCold > 0)
value += item.AbsorptionAttributes.ResonanceCold;
if (item.AbsorptionAttributes.ResonanceEnergy > 0)
value += item.AbsorptionAttributes.ResonanceEnergy;
if (item.AbsorptionAttributes.ResonanceFire > 0)
value += item.AbsorptionAttributes.ResonanceFire;
if (item.AbsorptionAttributes.ResonanceKinetic > 0)
value += item.AbsorptionAttributes.ResonanceKinetic;
if (item.AbsorptionAttributes.ResonancePoison > 0)
value += item.AbsorptionAttributes.ResonancePoison;
if (item.AbsorptionAttributes.SoulChargeCold > 0)
value += item.AbsorptionAttributes.SoulChargeCold;
if (item.AbsorptionAttributes.SoulChargeEnergy > 0)
value += item.AbsorptionAttributes.SoulChargeEnergy;
if (item.AbsorptionAttributes.SoulChargeFire > 0)
value += item.AbsorptionAttributes.SoulChargeFire;
if (item.AbsorptionAttributes.SoulChargeKinetic > 0)
value += item.AbsorptionAttributes.SoulChargeKinetic;
if (item.AbsorptionAttributes.SoulChargePoison > 0)
value += item.AbsorptionAttributes.SoulChargePoison;
//Start Resist Bonus
if (item.ColdBonus > 0)
{
value += item.ColdBonus * 2;
value += 2;
}
if (item.EnergyBonus > 0)
{
value += item.EnergyBonus * 2;
value += 2;
}
if (item.FireBonus > 0)
{
value += item.FireBonus * 2;
value += 2;
}
if (item.PhysicalBonus > 0)
{
value += item.PhysicalBonus * 2;
value += 2;
}
if (item.PoisonBonus > 0)
{
value += item.PoisonBonus * 2;
value += 2;
}
return value;
}
I think this way, values / 10 is the level that the player needs when equipping.
For example, if values = 600, players need level 60 to equip, otherwise they cannot
Then, how do I modify the script?