Server.Loot.RandomGem C# (CSharp) Méthode

RandomGem() public static méthode

public static RandomGem ( ) : Item
Résultat Item
		public static Item RandomGem()
		{
			return Construct( m_GemTypes );
		}

Usage Example

Exemple #1
0
        public Item Construct( )
        {
            try
            {
                Item item;

                if (m_Type == typeof(BaseRanged))
                {
                    item = Loot.RandomRangedWeapon();
                }
                else if (m_Type == typeof(BaseWeapon))
                {
                    item = Loot.RandomWeapon();
                }
                else if (m_Type == typeof(BaseArmor))
                {
                    item = Loot.RandomArmorOrHat();
                }
                else if (m_Type == typeof(BaseShield))
                {
                    item = Loot.RandomShield();
                }
                else if (m_Type == typeof(BaseJewel))
                {
                    item = Core.AOS ? Loot.RandomJewelry() : Loot.RandomArmorOrShieldOrWeapon();
                }
                else if (m_Type == typeof(BaseInstrument))
                {
                    item = Loot.RandomInstrument();
                }
                else if (m_Type == typeof(Amber))                     // gem
                {
                    item = Loot.RandomGem();
                }
                else
                {
                    item = Activator.CreateInstance(m_Type) as Item;
                }

                return(item);
            }
            catch (Exception e)
            {
                Misc.ExceptionLogging.WriteLine(e);
            }

            return(null);
        }
All Usage Examples Of Server.Loot::RandomGem