public Item Construct(bool inTokuno, bool isMondain, bool isStygian) { try { Item item; if (Type == typeof(BaseRanged)) { item = Loot.RandomRangedWeapon(inTokuno, isMondain, isStygian); } else if (Type == typeof(BaseWeapon)) { item = Loot.RandomWeapon(inTokuno, isMondain, isStygian); } else if (Type == typeof(BaseArmor)) { if (0.80 > Utility.RandomDouble()) { item = Loot.RandomArmor(inTokuno, isMondain, isStygian); } else { item = Loot.RandomHat(inTokuno); } } else if (Type == typeof(BaseShield)) { item = Loot.RandomShield(isStygian); } else if (Type == typeof(BaseJewel)) { item = Loot.RandomJewelry(isStygian); } else if (Type == typeof(BaseInstrument)) { item = Loot.RandomInstrument(); } else if (Type == typeof(Amber)) // gem { item = Loot.RandomGem(); } else if (Type == typeof(BlueDiamond)) // rare gem { item = Loot.RandomRareGem(); } else { item = Activator.CreateInstance(Type) as Item; } return(item); } catch (Exception e) { Diagnostics.ExceptionLogging.LogException(e); } return(null); }
public Item Construct( bool inTokuno, bool inMLDungeon, bool inSADungeon ) { try { Item item; if ( m_Type == typeof( BaseRanged ) ) item = Loot.RandomRangedWeapon( inTokuno, inMLDungeon, inSADungeon ); else if ( m_Type == typeof( BaseWeapon ) ) item = Loot.RandomWeapon( inTokuno, inMLDungeon, inSADungeon ); else if ( m_Type == typeof( BaseArmor ) ) item = Loot.RandomArmorOrHat( inTokuno, inMLDungeon, inSADungeon ); else if ( m_Type == typeof( BaseShield ) ) item = Loot.RandomShield( inSADungeon ); else if ( m_Type == typeof( BaseJewel ) ) item = Loot.RandomJewelry( inSADungeon ); else if ( m_Type == typeof( BaseInstrument ) ) item = Loot.RandomInstrument(); else if ( m_Type == typeof( Amber ) ) // gem item = Loot.RandomGem(); else if ( m_Type == typeof( BlueDiamond ) ) // rare gem item = Loot.RandomRareGem(); 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, 7 ); else if ( m_Type == typeof( SummonAirElementalScroll ) ) // high scroll item = RandomScroll( 2, 8, 8 ); else item = Activator.CreateInstance( m_Type ) as Item; return item; } catch { } return null; }