/// <summary> /// This function returns a fabled armor of a certain type with stats depending on the itemlevel. Adds 2 or 3 attributes to the item. /// </summary> /// <param name="_armorName">The name of the armor. NOTE: Set this to null if you want the item's name to be random</param> /// <param name="_armorType">The type of the armor. NOTE: Set this to EnumArmorType.Null if you want the armors type to be random</param> /// <param name="_itemlevel">The itemlevel of the armor</param> /// <param name="_armor">The base armor of the weapon</param> /// <returns>A fabled weapon</returns> public static Armor GenerateFabledArmor(string _armorName, EnumArmorType _armorType, int _itemlevel) { int _armor = 1; if (_itemlevel >= 0) _armor = (int)r.Next(1, _itemlevel); Armor returnedArmor = null; if (_armorType == EnumArmorType.Null) returnedArmor = new Armor(_armorName, EnumItemType.Armor, EnumItemQuality.Fabled, _itemlevel, GetRandomArmorType(), _armor); else returnedArmor = new Armor(_armorName, EnumItemType.Armor, EnumItemQuality.Fabled, _itemlevel, _armorType, _armor); if (_armorName == null) returnedArmor.ItemName = Function.ItemGeneration.GenerateArmorName(returnedArmor, true, true); //This code adds 2 or 3 attributes to the item. The _itemlevel+r.Next(48) is to ensure randomness. for (int i = 0; i < 5; i++) { returnedArmor.AddAttributeToItem(GetRandomAttribute(_itemlevel + r.Next(48), returnedArmor.ItemType), r.Next(_itemlevel / 4, _itemlevel)); } return returnedArmor; }
/// <summary> /// This function returns a normal armor of a certain type with stats depending on the itemlevel. /// </summary> /// <param name="_armorName">The name of the armor. NOTE: Set this to null if you want the items name to be random</param> /// <param name="_armorType">The type of the armor. NOTE: Set this to EnumArmorType.Null if you want the armors type to be random</param> /// <param name="_itemlevel">The itemlevel of the armor</param> /// <param name="_armor">The base armor of the armor</param> /// <returns>A normal armor</returns> public static Armor GenerateNormalArmor(string _armorName, EnumArmorType _armorType, int _itemlevel) { int _armor = 1; if(_itemlevel != 0) _armor = (int)r.Next(1, _itemlevel); Armor returnedArmor = null; if (_armorType == EnumArmorType.Null) returnedArmor = new Armor(_armorName, EnumItemType.Armor, EnumItemQuality.Normal, _itemlevel, GetRandomArmorType(), _armor); else returnedArmor = new Armor(_armorName, EnumItemType.Armor, EnumItemQuality.Normal, _itemlevel, _armorType, _armor); //A normal item has neither prefixes, nor suffixes if (_armorName == null) returnedArmor.ItemName = Function.ItemGeneration.GenerateArmorName(returnedArmor, false, false); return returnedArmor; }
public Armor(string _name, EnumItemType _itype, EnumItemQuality _iquality, int _itemLevel, EnumArmorType _atype, int _armor) : base(_name, _itype, _iquality, _itemLevel) { this.armorType = _atype; this.stats.Add(new UnitAttribute(EnumAttributeType.Armor, _armor)); }
/// <summary> /// This function returns a grand armor of a certain type with stats depending on the itemlevel. Adds 1 or 2 attributes to the item. /// </summary> /// <param name="_armorName">The name of the armor. NOTE: Set this to null if you want the item's name to be random</param> /// <param name="_armorType">The type of the armor. NOTE: Set this to EnumArmorType.Null if you want the armors type to be random</param> /// <param name="_itemlevel">The itemlevel of the armor</param> /// <param name="_armor">The base armor of the armor</param> /// <returns>A grand armor</returns> public static Armor GenerateGrandArmor(string _armorName, EnumArmorType _armorType, int _itemlevel) { int _armor = 1; if (_itemlevel != 0) _armor = (int)r.Next(1, _itemlevel); Armor returnedArmor = null; if (_armorType == EnumArmorType.Null) returnedArmor = new Armor(_armorName , EnumItemType.Armor, EnumItemQuality.Grand, _itemlevel, GetRandomArmorType(), _armor); else returnedArmor = new Armor(_armorName, EnumItemType.Armor, EnumItemQuality.Grand, _itemlevel, _armorType, _armor); // Grand items only have prefixes if (_armorName == null) returnedArmor.ItemName = Function.ItemGeneration.GenerateArmorName(returnedArmor, true, false); int upperLimit = r.Next(1, 4); for (int i = 0; i < upperLimit; i++) { returnedArmor.AddAttributeToItem(GetRandomAttribute(_itemlevel + r.Next(48), returnedArmor.ItemType), r.Next(_itemlevel / 4, _itemlevel)); } return returnedArmor; }