Пример #1
0
        public override void OnComponentUsed(AddonComponent c, Mobile from)
        {
            BaseHouse house = BaseHouse.FindHouseAt(this);

            /*
             * Unique problems have unique solutions.  OSI does not have a problem with 1000s of mining carts
             * due to the fact that they have only a miniscule fraction of the number of 10 year vets that a
             * typical RunUO shard will have (RunUO's scaled down account aging system makes this a unique problem),
             * and the "freeness" of free accounts. We also dont have mitigating factors like inactive (unpaid)
             * accounts not gaining veteran time.
             *
             * The lack of high end vets and vet rewards on OSI has made testing the *exact* ranging/stacking
             * behavior of these things all but impossible, so either way its just an estimation.
             *
             * If youd like your shard's carts/stumps to work the way they did before, simply replace the check
             * below with this line of code:
             *
             * if (!from.InRange(GetWorldLocation(), 2)
             *
             * However, I am sure these checks are more accurate to OSI than the former version was.
             *
             */

            if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this) || !((from.Z - Z) > -3 && (from.Z - Z) < 3))
            {
                from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
            }
            else if (house != null && house.HasSecureAccess(from, SecureLevel.Friends))
            {
                switch (m_CartType)
                {
                case MiningCartType.OreSouth:
                case MiningCartType.OreEast:
                    if (m_Ore > 0)
                    {
                        Item ingots = null;

                        switch (Utility.Random(9))
                        {
                        case 0:
                            ingots = new IronIngot();
                            break;

                        case 1:
                            ingots = new DullCopperIngot();
                            break;

                        case 2:
                            ingots = new ShadowIronIngot();
                            break;

                        case 3:
                            ingots = new CopperIngot();
                            break;

                        case 4:
                            ingots = new BronzeIngot();
                            break;

                        case 5:
                            ingots = new GoldIngot();
                            break;

                        case 6:
                            ingots = new AgapiteIngot();
                            break;

                        case 7:
                            ingots = new VeriteIngot();
                            break;

                        case 8:
                            ingots = new ValoriteIngot();
                            break;
                        }

                        int amount = Math.Min(10, m_Ore);
                        ingots.Amount = amount;

                        if (!from.PlaceInBackpack(ingots))
                        {
                            ingots.Delete();
                            from.SendLocalizedMessage(1078837);     // Your backpack is full! Please make room and try again.
                        }
                        else
                        {
                            PublicOverheadMessage(MessageType.Regular, 0, 1094724, amount.ToString());     // Ore: ~1_COUNT~
                            m_Ore -= amount;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1094725);     // There are no more resources available at this time.
                    }
                    break;

                case MiningCartType.GemSouth:
                case MiningCartType.GemEast:
                    if (m_Gems > 0)
                    {
                        Item gems = null;

                        switch (Utility.Random(15))
                        {
                        case 0:
                            gems = new Amber();
                            break;

                        case 1:
                            gems = new Amethyst();
                            break;

                        case 2:
                            gems = new Citrine();
                            break;

                        case 3:
                            gems = new Diamond();
                            break;

                        case 4:
                            gems = new Emerald();
                            break;

                        case 5:
                            gems = new Ruby();
                            break;

                        case 6:
                            gems = new Sapphire();
                            break;

                        case 7:
                            gems = new StarSapphire();
                            break;

                        case 8:
                            gems = new Tourmaline();
                            break;

                        // Mondain's Legacy gems
                        case 9:
                            gems = new PerfectEmerald();
                            break;

                        case 10:
                            gems = new DarkSapphire();
                            break;

                        case 11:
                            gems = new Turquoise();
                            break;

                        case 12:
                            gems = new EcruCitrine();
                            break;

                        case 13:
                            gems = new FireRuby();
                            break;

                        case 14:
                            gems = new BlueDiamond();
                            break;
                        }

                        int amount = Math.Min(5, m_Gems);
                        gems.Amount = amount;

                        if (!from.PlaceInBackpack(gems))
                        {
                            gems.Delete();
                            from.SendLocalizedMessage(1078837);     // Your backpack is full! Please make room and try again.
                        }
                        else
                        {
                            PublicOverheadMessage(MessageType.Regular, 0, 1094723, amount.ToString());     // Gems: ~1_COUNT~
                            m_Gems -= amount;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1094725);     // There are no more resources available at this time.
                    }
                    break;
                }
            }
            else
            {
                from.SendLocalizedMessage(1061637); // You are not allowed to access
            }
        }
Пример #2
0
        public override void OnComponentUsed(AddonComponent c, Mobile from)
        {
            BaseHouse house = BaseHouse.FindHouseAt(this);

            if (house != null && house.HasSecureAccess(from, SecureLevel.Friends))
            {
                switch (m_CartType)
                {
                case MiningCartType.OreSouth:
                case MiningCartType.OreEast:
                    if (m_Ore > 0)
                    {
                        Item ingots = null;

                        switch (Utility.Random(9))
                        {
                        case 0: ingots = new IronIngot(); break;

                        case 1: ingots = new DullCopperIngot(); break;

                        case 2: ingots = new ShadowIronIngot(); break;

                        case 3: ingots = new CopperIngot(); break;

                        case 4: ingots = new BronzeIngot(); break;

                        case 5: ingots = new GoldIngot(); break;

                        case 6: ingots = new AgapiteIngot(); break;

                        case 7: ingots = new VeriteIngot(); break;

                        case 8: ingots = new ValoriteIngot(); break;
                        }

                        int amount = Math.Min(10, m_Ore);
                        ingots.Amount = amount;

                        if (!from.PlaceInBackpack(ingots))
                        {
                            ingots.Delete();
                            from.SendLocalizedMessage(1078837);                                       // Your backpack is full! Please make room and try again.
                        }
                        else
                        {
                            PublicOverheadMessage(MessageType.Regular, 0, 1094724, amount.ToString());                                      // Ore: ~1_COUNT~
                            m_Ore -= amount;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1094725);                                   // There are no more resources available at this time.
                    }
                    break;

                case MiningCartType.GemSouth:
                case MiningCartType.GemEast:
                    if (m_Gems > 0)
                    {
                        Item gems = null;

                        switch (Utility.Random(17))
                        {
                        case 0: gems = new Amber(); break;

                        case 1: gems = new Amethyst(); break;

                        case 2: gems = new Citrine(); break;

                        case 3: gems = new Diamond(); break;

                        case 4: gems = new Emerald(); break;

                        case 5: gems = new Ruby(); break;

                        case 6: gems = new Sapphire(); break;

                        case 7: gems = new StarSapphire(); break;

                        case 8: gems = new Tourmaline(); break;

                        // Mondain's Legacy gems
                        case 9: gems = new PerfectEmerald(); break;

                        case 10: gems = new DarkSapphire(); break;

                        case 11: gems = new Turquoise(); break;

                        case 12: gems = new EcruCitrine(); break;

                        case 13: gems = new WhitePearl(); break;

                        case 14: gems = new FireRuby(); break;

                        case 15: gems = new BlueDiamond(); break;

                        case 16: gems = new BrilliantAmber(); break;
                        }

                        int amount = Math.Min(5, m_Gems);
                        gems.Amount = amount;

                        if (!from.PlaceInBackpack(gems))
                        {
                            gems.Delete();
                            from.SendLocalizedMessage(1078837);                                       // Your backpack is full! Please make room and try again.
                        }
                        else
                        {
                            PublicOverheadMessage(MessageType.Regular, 0, 1094723, amount.ToString());                                       // Gems: ~1_COUNT~
                            m_Gems -= amount;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1094725);                                   // There are no more resources available at this time.
                    }
                    break;
                }
            }
            else
            {
                from.SendLocalizedMessage(1061637);                   // You are not allowed to access this.
            }
        }
Пример #3
0
        public override void OnComponentUsed( AddonComponent c, Mobile from )
        {
            BaseHouse house = BaseHouse.FindHouseAt( this );

            if ( !from.InRange( GetWorldLocation(), 2 ) )
            {
                from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
            }
            else if ( house != null && house.HasSecureAccess( from, SecureLevel.Friends ) )
            {
                switch ( m_CartType )
                {
                    case MiningCartType.OreSouth:
                    case MiningCartType.OreEast:
                        if ( m_Ore > 0 )
                        {
                            Item ingots = null;

                            switch ( Utility.Random( 9 ) )
                            {
                                case 0: ingots = new IronIngot(); break;
                                case 1: ingots = new DullCopperIngot(); break;
                                case 2: ingots = new ShadowIronIngot(); break;
                                case 3: ingots = new CopperIngot(); break;
                                case 4: ingots = new BronzeIngot(); break;
                                case 5: ingots = new GoldIngot(); break;
                                case 6: ingots = new AgapiteIngot(); break;
                                case 7: ingots = new VeriteIngot(); break;
                                case 8: ingots = new ValoriteIngot(); break;
                            }

                            int amount = Math.Min( 10, m_Ore );
                            ingots.Amount = amount;

                            if ( !from.PlaceInBackpack( ingots ) )
                            {
                                ingots.Delete();
                                from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again.
                            }
                            else
                            {
                                PublicOverheadMessage(MessageType.Regular, 0, 1094724, amount.ToString() ); // Ore: ~1_COUNT~
                                m_Ore -= amount;
                            }
                        }
                        else
                            from.SendLocalizedMessage( 1094725 ); // There are no more resources available at this time.

                        break;
                    case MiningCartType.GemSouth:
                    case MiningCartType.GemEast:
                        if ( m_Gems > 0 )
                        {
                            Item gems = null;

                            switch ( Utility.Random( 15 ) )
                            {
                                case 0: gems = new Amber(); break;
                                case 1: gems = new Amethyst(); break;
                                case 2: gems = new Citrine(); break;
                                case 3: gems = new Diamond(); break;
                                case 4: gems = new Emerald(); break;
                                case 5: gems = new Ruby(); break;
                                case 6: gems = new Sapphire(); break;
                                case 7: gems = new StarSapphire(); break;
                                case 8: gems = new Tourmaline(); break;

                                // Mondain's Legacy gems
                                case 9: gems = new PerfectEmerald(); break;
                                case 10: gems = new DarkSapphire(); break;
                                case 11: gems = new Turquoise(); break;
                                case 12: gems = new EcruCitrine(); break;
                                case 13: gems = new FireRuby(); break;
                                case 14: gems = new BlueDiamond(); break;
                            }

                            int amount = Math.Min( 5, m_Gems );
                            gems.Amount = amount;

                            if ( !from.PlaceInBackpack( gems ) )
                            {
                                gems.Delete();
                                from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again.
                            }
                            else
                            {
                                PublicOverheadMessage( MessageType.Regular, 0, 1094723, amount.ToString() ); // Gems: ~1_COUNT~
                                m_Gems -= amount;
                            }
                        }
                        else
                            from.SendLocalizedMessage( 1094725 ); // There are no more resources available at this time.

                        break;
                }
            }
            else
                from.SendLocalizedMessage( 1061637 ); // You are not allowed to access this.
        }
Пример #4
0
		public override void OnComponentUsed( AddonComponent c, Mobile from )
		{
			BaseHouse house = BaseHouse.FindHouseAt( this );

			/*
			 * Unique problems have unique solutions.  OSI does not have a problem with 1000s of mining carts
			 * due to the fact that they have only a miniscule fraction of the number of 10 year vets that a
			 * typical RunUO shard will have (RunUO's scaled down account aging system makes this a unique problem),
			 * and the "freeness" of free accounts. We also dont have mitigating factors like inactive (unpaid)
			 * accounts not gaining veteran time.
			 *
			 * The lack of high end vets and vet rewards on OSI has made testing the *exact* ranging/stacking
			 * behavior of these things all but impossible, so either way its just an estimation.
			 *
			 * If youd like your shard's carts/stumps to work the way they did before, simply replace the check
			 * below with this line of code:
			 *
			 * if (!from.InRange(GetWorldLocation(), 2)
			 *
			 * However, I am sure these checks are more accurate to OSI than the former version was.
			 *
			 */

			if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this) || !((from.Z - Z) > -3 && (from.Z - Z) < 3))
			{
				from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
			}
			else if ( house != null && house.HasSecureAccess( from, SecureLevel.Friends ) )
			{
				switch ( m_CartType )
				{
					case MiningCartType.OreSouth:
					case MiningCartType.OreEast:
						if ( m_Ore > 0 )
						{
							Item ingots = null;

							switch ( Utility.Random( 9 ) )
							{
								case 0: ingots = new IronIngot(); break;
								case 1: ingots = new DullcopperIngot(); break;
								case 2: ingots = new ShadowIngot(); break;
								case 3: ingots = new CopperIngot(); break;
								case 4: ingots = new BronzeIngot(); break;
								case 5: ingots = new GoldIngot(); break;
								case 6: ingots = new AgapiteIngot(); break;
								case 7: ingots = new VeriteIngot(); break;
								case 8: ingots = new ValoriteIngot(); break;
							}

							int amount = Math.Min( 10, m_Ore );
							ingots.Amount = amount;

							if ( !from.PlaceInBackpack( ingots ) )
							{
								ingots.Delete();
								from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again.
							}
							else
							{
								PublicOverheadMessage(MessageType.Regular, 0, 1094724, amount.ToString() ); // Ore: ~1_COUNT~
								m_Ore -= amount;
							}
						}
						else
							from.SendLocalizedMessage( 1094725 ); // There are no more resources available at this time.

						break;
					case MiningCartType.GemSouth:
					case MiningCartType.GemEast:
						if ( m_Gems > 0 )
						{
							Item gems = null;

							switch ( Utility.Random( 15 ) )
							{
								case 0: gems = new Amber(); break;
								case 1: gems = new Amethyst(); break;
								case 2: gems = new Citrine(); break;
								case 3: gems = new Diamond(); break;
								case 4: gems = new Emerald(); break;
								case 5: gems = new Ruby(); break;
								case 6: gems = new Sapphire(); break;
								case 7: gems = new StarSapphire(); break;
								case 8: gems = new Tourmaline(); break;

								// Mondain's Legacy gems
								case 9: gems = new PerfectEmerald(); break;
								case 10: gems = new DarkSapphire(); break;
								case 11: gems = new Turquoise(); break;
								case 12: gems = new EcruCitrine(); break;
								case 13: gems = new FireRuby(); break;
								case 14: gems = new BlueDiamond(); break;
							}

							int amount = Math.Min( 5, m_Gems );
							gems.Amount = amount;

							if ( !from.PlaceInBackpack( gems ) )
							{
								gems.Delete();
								from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again.
							}
							else
							{
								PublicOverheadMessage( MessageType.Regular, 0, 1094723, amount.ToString() ); // Gems: ~1_COUNT~
								m_Gems -= amount;
							}
						}
						else
							from.SendLocalizedMessage( 1094725 ); // There are no more resources available at this time.

						break;
				}
			}
			else
				from.SendLocalizedMessage( 1061637 ); // You are not allowed to access this.
		}
Пример #5
0
		public override bool Give( Mobile m, Item item, bool placeAtFeet )
		{
			if ( m.Skills.Mining.Value >= 100 )
			{				
				double chance = 0.005;
				
				if ( m_OreAndStone.RaceBonus && m.Race == Race.Elf )
					chance += chance * 0.5; // 50% bonus for elves?
			
				if ( Utility.RandomDouble() < chance )
				{					
					Item sitem = null;
					int message = 0;
					
					switch ( Utility.Random( 6 ) )
					{
						case 0: 
							sitem = new PerfectEmerald();
							message = 1072566; // You have found a perfect emerald!
							break;
						case 1:
							sitem = new DarkSapphire();
							message = 1072567; // You have found a dark sapphire!
							break;
						case 2:
							sitem = new Turquoise();
							message = 1072568; // You have found a turquoise!
							break;
						case 3:
							sitem = new EcruCitrine();
							message = 1072570; // You have found an Ecru Citrine!
							break;
						case 4:
							sitem = new FireRuby();
							message = 1072564; // You have found a fire ruby!
							break;
						case 5:
							sitem = new BlueDiamond();
							message = 1072562; // You have found a flawless diamond!
							break;
						
					}
					
					if ( sitem != null && !m.PlaceInBackpack( sitem ) && placeAtFeet )
					{						
						List<Item> atFeet = new List<Item>();
	
						foreach ( Item obj in m.GetItemsInRange( 0 ) )
							atFeet.Add( obj );
			
						for ( int i = 0; i < atFeet.Count; ++i )
						{
							Item check = atFeet[i];
			
							if ( check.StackWith( m, sitem, false ) )
								return base.Give( m, item, placeAtFeet );
						}
			
						sitem.MoveToWorld( m.Location, m.Map );
					}
						
					m.SendLocalizedMessage( message );
				}				
			}			
			
			return base.Give( m, item, placeAtFeet );
		}