RandomShield() public static method

public static RandomShield ( ) : BaseShield
return Server.Items.BaseShield
示例#1
0
        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);
        }
示例#2
0
        public Item Construct(bool inTokuno, bool isMondain)
        {
            try
            {
                Item item;

                if (m_Type == typeof(BaseRanged))
                {
                    item = Loot.RandomRangedWeapon(inTokuno, isMondain);
                }
                else if (m_Type == typeof(BaseWeapon))
                {
                    item = Loot.RandomWeapon(inTokuno, isMondain);
                }
                else if (m_Type == typeof(BaseArmor))
                {
                    item = Loot.RandomArmorOrHat(inTokuno, isMondain);
                }
                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(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);
        }
示例#3
0
        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);
        }
示例#4
0
        public Item Construct()
        {
            try
            {
                Item item;

                if (m_Type == typeof(BaseRanged))
                {
                    item = Loot.RandomRangedWeapon();
                }
                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(BaseJewel))
                {
                    item = Core.AOS ? Loot.RandomJewelry() : Loot.RandomArmorOrShieldOrWeapon();
                }
                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 (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); }

            return(null);
        }
示例#5
0
        public Item Construct( )
        {
            try
            {
                Item item;

                if (m_Type == typeof(BaseRanged))
                {
                    item = Loot.RandomRangedWeapon();
                }
                else if (m_Type == typeof(BaseWeapon))
                {
                    item = Loot.RandomWeapon();
                }
                else if (m_Type == typeof(BaseArmor))
                {
                    item = Loot.RandomArmorOrHat();
                }
                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(BaseInstrument))
                {
                    item = Loot.RandomInstrument();
                }
                else if (m_Type == typeof(Amber))                     // gem
                {
                    item = Loot.RandomGem();
                }
                else
                {
                    item = Activator.CreateInstance(m_Type) as Item;
                }

                return(item);
            }
            catch (Exception e)
            {
                Misc.ExceptionLogging.WriteLine(e);
            }

            return(null);
        }
示例#6
0
		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;
		}
示例#7
0
        public Item Construct(bool inTokuno, bool isMondain, Expansion e)
        {
            try
            {
                Item item;

                if (m_Type == typeof(BaseRanged))
                {
                    item = Loot.RandomRangedWeapon();
                }
                else if (m_Type == typeof(BaseWeapon))
                {
                    item = Loot.RandomWeapon();
                }
                else if (m_Type == typeof(BaseArmor))
                {
                    item = Loot.RandomArmorOrHat();
                }
                else if (m_Type == typeof(BaseShield))
                {
                    item = Loot.RandomShield();
                }
                else if (m_Type == typeof(BaseJewel))
                {
                    item = e >= Expansion.AOS ? Loot.RandomJewelry() : Loot.RandomArmorOrShieldOrWeapon();
                }
                else if (m_Type == typeof(BaseInstrument))
                {
                    item = Loot.RandomInstrument(e >= Expansion.SE);
                }
                else if (m_Type == typeof(BaseWand))
                {
                    item = Loot.RandomWand();
                }
                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 if (m_Type == typeof(Ribs))                 //meats
                {
                    item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.Meat));
                }
                else if (m_Type == typeof(Apple))                 //fruits/vegies
                {
                    item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.FruitsAndVeggies));
                }
                else if (m_Type == typeof(SheafOfHay))                 //Hay
                {
                    item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.GrainsAndHay));
                }
                else if (m_Type == typeof(RawFishSteak))                 //Fish
                {
                    item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.Fish));
                }
                else if (m_Type == typeof(Eggs))                 //Eggs
                {
                    item = Loot.Construct(BaseCreature.FoodTypeFromPreference(FoodType.Eggs));
                }
                else if (m_Type == typeof(Food))                 //Food items
                {
                    item = Loot.RandomFood();
                }
                else if (m_Type == typeof(Candle))                 //Provisions
                {
                    item = Loot.RandomProvision();
                }
                else
                {
                    item = m_Type.CreateInstance <Item>();
                }

                return(item);
            }
            catch
            { }

            return(null);
        }
示例#8
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);
        }