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

                if (m_Type == typeof(BaseRanged))
                {
                    item = Loot.RandomRangedWeapon(inTokuno);
                }
                else if (m_Type == typeof(BaseWeapon))
                {
                    item = Loot.RandomWeapon(inTokuno);
                }
                else if (m_Type == typeof(BaseArmor))
                {
                    item = Loot.RandomArmorOrHat(inTokuno);
                }
                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(BaseClothing))
                {
                    item = Loot.RandomClothing();
                }
                else if (m_Type == typeof(Food))
                {
                    item = Loot.RandomFood();
                }
                else if (m_Type == typeof(BaseBeverage))
                {
                    item = Loot.RandomDrink();
                }
                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, 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);
        }
Exemple #2
0
        public Item Construct()
        {
            try
            {
                Item item;

                if (m_Type == null)
                {
                    item = null;
                }
                else 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(1, 4);
                }
                else if (m_Type == typeof(ArchCureScroll))                     // med scroll
                {
                    item = RandomScroll(5, 6);
                }
                else if (m_Type == typeof(SummonAirElementalScroll))                     // high scroll
                {
                    item = RandomScroll(7, 8);
                }

                else if (m_Type == typeof(BaseBeverage))
                {
                    item = Loot.RandomDrink();
                }
                else if (m_Type == typeof(Food))
                {
                    item = Loot.RandomFood();
                }
                else
                {
                    item = Activator.CreateInstance(m_Type) as Item;
                }

                if (item != null && item is BaseClothing)
                {
                    item.Hue = Utility.RandomNondyedHue();
                }

                return(item);
            }
            catch
            {
            }

            return(null);
        }