// Returns A Primary Enchant public static Primary_Stats_Enchants GetPrimaryEnchant(Enchant e, int c = -1, Item.ItemQualityModifiers quality = Item.ItemQualityModifiers.Basic) { float qMod = 1f; if ((int)quality > 1) { qMod = ((int)quality / 1.75f) + 1f; } int i = 0; if (c == -1) { i = Random.Range(0, 7); } else { i = c; } int j = Random.Range(1, 4); if (i == 0) { e.SetEnchantName("Strength"); if (j == 1) { e.SetEnchantDesc("You feel stronger when this is equipped."); } else if (j == 2) { e.SetEnchantDesc("Your criticals will do more damage."); } else if (j == 3) { e.SetEnchantDesc("Your physical attacks will do more damage."); } e.strength = Random.Range(((int)qMod * ((int)(e.level / 4.5f + 1))), (3 * ((int)(e.level / 5f + 1)))); e.power = e.strength; e.SetBonusStatText(e.strength.ToString() + " Strength"); e.enchantValue = 1.75f; return(Primary_Stats_Enchants.Strength); } else if (i == 1) { e.SetEnchantName("Dexterity"); if (j == 1) { e.SetEnchantDesc("Enchanted with dexterity."); } else if (j == 2) { e.SetEnchantDesc("Your criticals will be more likely."); } else if (j == 3) { e.SetEnchantDesc("Your criticals will do more damage."); } e.dexterity = Random.Range(((int)qMod * ((int)(e.level / 4.5f + 1))), (3 * ((int)(e.level / 5f + 1)))); e.SetBonusStatText(e.dexterity.ToString() + " Dexterity"); e.power = e.dexterity; e.enchantValue = 1.75f; return(Primary_Stats_Enchants.Dexterity); } else if (i == 2) { e.SetEnchantName("Intellect"); if (j == 1) { e.SetEnchantDesc("Your magical attacks will do more damage."); } else if (j == 2) { e.SetEnchantDesc("You will resist magical damage more."); } else if (j == 3) { e.SetEnchantDesc("Enchanted with intellegence."); } e.intellect = Random.Range(((int)qMod * ((int)(e.level / 4.5f + 1))), (3 * ((int)(e.level / 5f + 1)))); e.SetBonusStatText(e.intellect.ToString() + " Intellect"); e.power = e.intellect; e.enchantValue = 1.75f; return(Primary_Stats_Enchants.Intellect); } else if (i == 3) { e.SetEnchantName("Endurance"); if (j == 1) { e.SetEnchantDesc("You will be able to do more things than usual."); } else if (j == 2) { e.SetEnchantDesc("You can handle physical attacks more."); } else if (j == 3) { e.SetEnchantDesc("Enchanted with endurance."); } e.endurance = Random.Range(((int)qMod * ((int)(e.level / 4.5f + 1))), (3 * ((int)(e.level / 5f + 1)))); e.power = e.endurance; e.SetBonusStatText(e.endurance.ToString() + " Endurance"); e.enchantValue = 1.75f; return(Primary_Stats_Enchants.Endurance); } else if (i == 4) { e.SetEnchantName("Vitality"); if (j == 1) { e.SetEnchantDesc("You will have more life force."); } else if (j == 2) { e.SetEnchantDesc("You will regenerate health faster."); } else if (j == 3) { e.SetEnchantDesc("Enchanted with vitality."); } e.vitality = Random.Range(((int)qMod * ((int)(e.level / 4.5f + 1))), (3 * ((int)(e.level / 5f + 1)))); e.power = e.vitality; e.SetBonusStatText(e.vitality.ToString() + " Vitality"); e.enchantValue = 1.75f; return(Primary_Stats_Enchants.Vitality); } else if (i == 5) { e.SetEnchantName("Agility"); if (j == 1) { e.SetEnchantDesc("You will move faster."); } else if (j == 2) { e.SetEnchantDesc("You will have the chance to evade attacks."); } else if (j == 3) { e.SetEnchantDesc("Enchanted with agility."); } e.agility = Random.Range(((int)qMod * ((int)(e.level / 4.5f + 1))), (3 * ((int)(e.level / 5f + 1)))); e.power = e.agility; e.SetBonusStatText(e.agility.ToString() + " Agility"); e.enchantValue = 1.75f; return(Primary_Stats_Enchants.Agility); } else if (i == 6) { e.SetEnchantName("Luck"); if (j == 1) { e.SetEnchantDesc("You will have more fortune."); } else if (j == 2) { e.SetEnchantDesc("You will have better chances at getting rare items."); } else if (j == 3) { e.SetEnchantDesc("Enchanted with Luck."); } e.luck = Random.Range(((int)qMod * ((int)(e.level / 4.5f + 1))), (3 * ((int)(e.level / 5f + 1)))); e.power = e.luck; e.SetBonusStatText(e.luck.ToString() + " Luck"); e.enchantValue = 1.75f; return(Primary_Stats_Enchants.Luck); } else { e.SetEnchantName("Luck"); if (j == 1) { e.SetEnchantDesc("You will have more fortune."); } else if (j == 2) { e.SetEnchantDesc("You will have better chances at getting rare items."); } else if (j == 3) { e.SetEnchantDesc("Enchanted with Luck."); } e.luck = Random.Range(((int)qMod * ((int)(e.level / 4.5f + 1))), (3 * ((int)(e.level / 5f + 1)))); e.power = e.luck; e.SetBonusStatText(e.luck.ToString() + " Luck"); e.enchantValue = 1.75f; return(Primary_Stats_Enchants.Luck); } }