Example #1
0
        public ScrObjWeaponBase GetScriptableObkect(EnumWeaponType enumWeaponType)
        {
            if (enumWeaponType == EnumWeaponType.Pistol)
            {
                return(_facadeHuman.WeaponModule.ScrObjWeaponPistol);
            }
            if (enumWeaponType == EnumWeaponType.Fists)
            {
                return(_facadeHuman.WeaponModule.ScrObjWeaponFist);
            }

            return(null);
        }
Example #2
0
        /// <summary>
        /// This function returns a normal weapon of a certain type with stats depending on the itemlevel.
        /// </summary>
        /// <param name="_weaponName">The name of the weapon. NOTE: Set this to null if you want the items name to be random</param>
        /// <param name="_weaponType">The type of the weapon. NOTE: Set this to EnumWeaponType.Null if you want the weapons type to be random</param>
        /// <param name="_itemlevel">The itemlevel of the weapon</param>
        /// <param name="_damage">The base damage the weapon should deal</param>
        /// <returns>A normal weapon</returns>
        public static Weapon GenerateNormalWeapon(string _weaponName, EnumWeaponType _weaponType, int _itemlevel)
        {
            int _damage = 1;
            if (_itemlevel != 0)
                _damage = (int)r.Next(1, _itemlevel);
            Weapon returnedWeapon;

            if (_weaponType == EnumWeaponType.Null)
                returnedWeapon = new Weapon(_weaponName, EnumItemType.Weapon, EnumItemQuality.Normal, _itemlevel, GetRandomWeaponType(), _damage);
            else
                returnedWeapon = new Weapon(_weaponName, EnumItemType.Weapon, EnumItemQuality.Normal, _itemlevel, _weaponType, _damage);

            //A normal item has neither prefixes, nor suffixes
            if (_weaponName == null)
                returnedWeapon.ItemName = Function.ItemGeneration.GenerateWeaponName(returnedWeapon, false, false);

            return returnedWeapon;
        }
Example #3
0
        /// <summary>
        /// This function returns a grand weapon of a certain type with stats depending on the itemlevel. Adds 1 or 2 attributes to the item.
        /// </summary>
        /// <param name="_weaponName">The name of the weapon. NOTE: Set this to null if you want the item's name to be random</param>
        /// <param name="_weaponType">The type of the weapon. NOTE: Set this to EnumWeaponType.Null if you want the weapons type to be random</param>
        /// <param name="_itemlevel">The itemlevel of the weapon</param>
        /// <param name="_damage">The base damage the weapon should deal</param>
        /// <returns>A grand weapon</returns>
        public static Weapon GenerateGrandWeapon(string _weaponName, EnumWeaponType _weaponType, int _itemlevel)
        {
            int _damage = 1;
            if (_itemlevel != 0)
                _damage = (int)r.Next(1, _itemlevel);
            Weapon returnedWeapon = null;

            if (_weaponType == EnumWeaponType.Null)
                returnedWeapon = new Weapon(_weaponName, EnumItemType.Weapon, EnumItemQuality.Grand, _itemlevel, GetRandomWeaponType(), _damage);
            else
                returnedWeapon = new Weapon(_weaponName, EnumItemType.Weapon, EnumItemQuality.Grand, _itemlevel, _weaponType, _damage);

            // Grand items only have prefixes
            if (_weaponName == null)
                returnedWeapon.ItemName = Function.ItemGeneration.GenerateWeaponName(returnedWeapon, true, false);

            int upperLimit = r.Next(1, 4);
            for (int i = 0; i < upperLimit; i++)
            {
                returnedWeapon.AddAttributeToItem(GetRandomAttribute(_itemlevel + r.Next(48), returnedWeapon.ItemType), r.Next(_itemlevel / 4, _itemlevel));
            }

            return returnedWeapon;
        }
Example #4
0
        /// <summary>
        /// This function returns a fabled weapon of a certain type with stats depending on the itemlevel. Adds 2 or 3 attributes to the item.
        /// </summary>
        /// <param name="_weaponName">The name of the weapon. NOTE: Set this to null if you want the item's name to be random</param>
        /// <param name="_weaponType">The type of the weapon. NOTE: Set this to EnumWeaponType.Null if you want the weapons type to be random</param>
        /// <param name="_itemlevel">The itemlevel of the weapon</param>
        /// <param name="_damage">The base damage the weapon should deal</param>
        /// <returns>A fabled weapon</returns>
        public static Weapon GenerateFabledWeapon(string _weaponName, EnumWeaponType _weaponType, int _itemlevel)
        {
            int _damage = 1;
            if (_itemlevel >= 0)
                _damage = (int)r.Next(1, _itemlevel);
            Weapon returnedWeapon = null;

            if(_weaponType == EnumWeaponType.Null)
                returnedWeapon = new Weapon(_weaponName, EnumItemType.Weapon, EnumItemQuality.Fabled, _itemlevel, GetRandomWeaponType(), _damage);
            else
                returnedWeapon = new Weapon(_weaponName, EnumItemType.Weapon, EnumItemQuality.Fabled, _itemlevel, _weaponType, _damage);

            if (_weaponName == null)
                returnedWeapon.ItemName = Function.ItemGeneration.GenerateWeaponName(returnedWeapon, 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++)
            {
                returnedWeapon.AddAttributeToItem(GetRandomAttribute(_itemlevel + r.Next(48), returnedWeapon.ItemType), r.Next(_itemlevel / 4, _itemlevel));
            }

            return returnedWeapon;
        }
Example #5
0
 /// <summary>
 /// The main contructor to create a new weapon
 /// </summary>
 /// <param name="_name">The name of the Weapon</param>
 /// <param name="_itype">The Item type of the weapon. NOTE: This will always be EnumItemType.Weapon</param>
 /// <param name="_iquality">The quality of the weapon.</param>
 /// <param name="_itemLevel">The Itemlevel of the Weapon. NOTE: This will also be the base damage of the weapon</param>
 public Weapon(string _name, EnumItemType _itype, EnumItemQuality _iquality, int _itemLevel, EnumWeaponType _wtype, int _damage)
     : base(_name, _itype, _iquality, _itemLevel)
 {
     this.weaponType = _wtype;
     this.stats.Add(new UnitAttribute(EnumAttributeType.Attackdamage, _damage));
 }
Example #6
0
 /// <summary>
 /// The main contructor to create a new weapon
 /// </summary>
 /// <param name="_name">The name of the Weapon</param>
 /// <param name="_itype">The Item type of the weapon. NOTE: This will always be EnumItemType.Weapon</param>
 /// <param name="_iquality">The quality of the weapon.</param>
 /// <param name="_itemLevel">The Itemlevel of the Weapon. NOTE: This will also be the base damage of the weapon</param>
 public Weapon(string _name, EnumItemType _itype, EnumItemQuality _iquality, int _itemLevel, EnumWeaponType _wtype, int _damage)
     : base(_name, _itype, _iquality, _itemLevel)
 {
     this.weaponType = _wtype;
     this.stats.Add(new UnitAttribute(EnumAttributeType.Attackdamage, _damage));
 }