public Item Construct()
{
try
{
Item item;
if (m_Type == typeof(BaseWeapon))
{
item = Loot.RandomWeapon();
}
else if (m_Type == typeof(BaseArmor))
{
item = Loot.RandomArmor();
}
else if (m_Type == typeof(BaseShield))
{
item = Loot.RandomShield();
}
else if (m_Type == typeof(BaseInstrument))
{
item = Loot.RandomInstrument();
}
else if (m_Type == typeof(Amber)) // gem
{
item = Loot.RandomGem();
}
else if (m_Type == typeof(ClumsyScroll)) // low scroll
{
item = RandomScroll(0, 1, 3);
}
else if (m_Type == typeof(ArchCureScroll)) // med scroll
{
item = RandomScroll(1, 4, 6);
}
else if (m_Type == typeof(SummonAirElementalScroll)) // master scroll
{
item = RandomMasterScroll();
}
else if (m_Type == typeof(EnhancedSpellbook)) // enhanced spellbook
{
item = RandomEnhancedSpellbook();
}
else if (m_Type == typeof(MaskDye))
{
item = MaskDye.RandomDye();
}
else
{
item = Activator.CreateInstance(m_Type) as Item;
}
return(item);
}
catch
{
}
return(null);
}