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

Construct() public static méthode

public static Construct ( Type types, int index ) : Item
types System.Type
index int
Résultat Item
		public static Item Construct( Type[] types, int index )
		{
			if ( index >= 0 && index < types.Length )
				return Construct( types[index] );

			return null;
		}

Same methods

Loot::Construct ( ) : Item
Loot::Construct ( Type type ) : Item

Usage Example

Exemple #1
0
        public static void CheckRecipeDrop(CreatureDeathEventArgs e)
        {
            BaseCreature bc     = e.Creature as BaseCreature;
            Container    c      = e.Corpse;
            Mobile       killer = e.Killer;

            if (SpellHelper.IsEodon(c.Map, c.Location))
            {
                double chance = (double)bc.Fame / 1000000;
                int    luck   = 0;

                if (killer != null)
                {
                    luck = Math.Min(1800, killer is PlayerMobile ? ((PlayerMobile)killer).RealLuck : killer.Luck);
                }

                if (luck > 0)
                {
                    chance += (double)luck / 152000;
                }

                if (chance > Utility.RandomDouble())
                {
                    if (0.33 > Utility.RandomDouble())
                    {
                        Item item = Loot.Construct(_ArmorDropTypes[Utility.Random(_ArmorDropTypes.Length)]);

                        if (item != null)
                        {
                            c.DropItem(item);
                        }
                    }
                    else
                    {
                        Item scroll = new RecipeScroll(_RecipeTypes[Utility.Random(_RecipeTypes.Length)]);

                        if (scroll != null)
                        {
                            c.DropItem(scroll);
                        }
                    }
                }
            }
        }
All Usage Examples Of Server.Loot::Construct