public virtual Item Construct()
{
Item item = Loot.Construct( m_Types );
if( item is Key )
( (Key)item ).ItemID = Utility.RandomList( (int)KeyType.Copper, (int)KeyType.Gold, (int)KeyType.Iron, (int)KeyType.Rusty );
else if( item is Arrow || item is Bolt )
item.Amount = Utility.RandomMinMax( 2, 6 );
else if( item is Bandage || item is Lockpick )
item.Amount = Utility.RandomMinMax( 1, 3 );
return item;
}
}
public virtual Item Construct() { int index = Utility.Random(m_Weight); for (int i = 0; i < m_Entries.Length; ++i) { FillableEntry entry = m_Entries[i]; if (index < entry.Weight) { return(entry.Construct()); } index -= entry.Weight; } return(null); }