Exemplo n.º 1
0
        public override void OnDoubleClick(Mobile from)
        {
            Container   backpack = from.Backpack;
            CopperIngot item1    = (CopperIngot)backpack.FindItemByType(typeof(CopperIngot));

            if (item1 != null)
            {
                BaseIngot m_Ore1 = item1 as BaseIngot;

                int toConsume = m_Ore1.Amount;

                if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501))
                {
                    m_Ore1.Delete();
                    from.SendLocalizedMessage(1113048); // You've successfully converted the metal.
                    from.AddToBackpack(new VeriteIngot(500));
                    Delete();
                }
                else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500))
                {
                    from.SendLocalizedMessage(1113046); // You can only convert five hundred ingots at a time.
                }
            }
            else
            {
                from.SendLocalizedMessage(1078618); // The item must be in your backpack to be exchanged.
            }
        }
Exemplo n.º 2
0
        public override void OnDoubleClick(Mobile from)
        {
            Container backpack = from.Backpack;

            CopperIngot item1 = (CopperIngot)backpack.FindItemByType(typeof(CopperIngot));

            if (item1 != null)
            {
                BaseIngot m_Ore1 = item1 as BaseIngot;

                int toConsume = m_Ore1.Amount;

                if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501))
                {
                    m_Ore1.Delete();
                    from.SendMessage("You've successfully converted the Metal.");
                    from.AddToBackpack(new VeriteIngot(500));
                    this.Delete();
                }
                else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500))
                {
                    from.SendMessage("You can only convert 500 Copper Ingots at a time.");
                }
            }
            else
            {
                from.SendMessage("There isn't Copper Ingots in your Backpack.");
            }
        }
Exemplo n.º 3
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
            }
        }
Exemplo n.º 4
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.
            }
        }
Exemplo n.º 5
0
        public override void OnDoubleClick(Mobile from)
        {
            bool anvil, forge;

            Server.Engines.Craft.DefBlacksmithy.CheckAnvilAndForge(from, 2, out anvil, out forge);

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1060640);                   // The item must be in your backpack to use it.
            }
            else if (!forge)
            {
                from.SendMessage("You need to be near a forge to smelt that.");
            }
            else if (from.Skills[SkillName.Blacksmith].Value >= 50)
            {
                if (this.Name == "onyx stones")
                {
                    Item ingot = new OnyxIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "quartz stones")
                {
                    Item ingot = new QuartzIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "ruby stones")
                {
                    Item ingot = new RubyIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "sapphire stones")
                {
                    Item ingot = new SapphireIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "spinel stones")
                {
                    Item ingot = new SpinelIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "topaz stones")
                {
                    Item ingot = new TopazIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "amethyst stones")
                {
                    Item ingot = new AmethystIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "emerald stones")
                {
                    Item ingot = new EmeraldIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "garnet stones")
                {
                    Item ingot = new GarnetIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "star ruby stones")
                {
                    Item ingot = new StarRubyIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "gargish marble stones")
                {
                    Item ingot = new MarbleIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "jade stones")
                {
                    Item ingot = new JadeIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "mystical ice stones")
                {
                    Item ingot = new IceIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "silver stones")
                {
                    Item ingot = new ShinySilverIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "copper stones")
                {
                    Item ingot = new CopperIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "verite stones")
                {
                    Item ingot = new VeriteIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "valorite stones")
                {
                    Item ingot = new ValoriteIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "agapite stones")
                {
                    Item ingot = new AgapiteIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "bronze stones")
                {
                    Item ingot = new BronzeIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "dull copper stones")
                {
                    Item ingot = new DullCopperIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "gold stones")
                {
                    Item ingot = new GoldIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "shadow iron stones")
                {
                    Item ingot = new ShadowIronIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "mithril stones")
                {
                    Item ingot = new MithrilIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "xormite stones")
                {
                    Item ingot = new XormiteIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "obsidian stones")
                {
                    Item ingot = new ObsidianIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "nepturite stones")
                {
                    Item ingot = new NepturiteIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }

                from.PlaySound(0x208);
                from.SendMessage("You smelt the stones and put the ingots in your backpack.");
                this.Delete();
            }
            else
            {
                from.SendMessage("Only an apprentice blacksmith can smelt that.");
            }
        }
Exemplo n.º 6
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.
		}
Exemplo n.º 7
0
        public void DropResource(int x, int y, int z, Map map)
        {
            Item Gold = new Gold(100, 200);
            Gold.MoveToWorld(new Point3D(x + Utility.RandomMinMax(-1, 1), y + Utility.RandomMinMax(-1, 1), z), map);

            Item item;

            switch (m_ResType)
            {
                case ResType.Iron:
                    {
                        item = new IronIngot();
                        item.MoveToWorld(new Point3D(x + Utility.RandomMinMax(-1, 1), y + Utility.RandomMinMax(-1, 1), z), map);
                        item.Amount = 100; break;
                    };
                case ResType.Copper:
                    {
                        item = new CopperIngot();
                        item.MoveToWorld(new Point3D(x + Utility.RandomMinMax(-1, 1), y + Utility.RandomMinMax(-1, 1), z), map);
                        item.Amount = 100; break;
                    };
            }
        }
		public override void GiveRewards()
		{
			//Random gold amount to add
			BankCheck gold = new BankCheck( Utility.RandomMinMax( 500, 600 ) );
			if( !Owner.AddToBackpack( gold ) )
			{
				gold.MoveToWorld(Owner.Location,Owner.Map);
			}

			//Adding Quest Reward Token(s)
			for(int x = 0; x < 1; x++)
			{
				RandomTalisman talisman = new RandomTalisman();
				if(!Owner.AddToBackpack( talisman ) )
				{
					talisman.MoveToWorld(Owner.Location,Owner.Map);
				}
			}
			Item bonusitem;
			bonusitem = new DullCopperIngot( 20 );
			//Adding Bonus Item #1
			if(!Owner.AddToBackpack( bonusitem ) )
			{
				bonusitem.MoveToWorld(Owner.Location,Owner.Map);
			}

			bonusitem = new ShadowIronIngot( 20 );
			//Adding Bonus Item #2
			if(!Owner.AddToBackpack( bonusitem ) )
			{
				bonusitem.MoveToWorld(Owner.Location,Owner.Map);
			}

			bonusitem = new CopperIngot( 20 );
			//Adding Bonus Item #3
			if(!Owner.AddToBackpack( bonusitem ) )
			{
				bonusitem.MoveToWorld(Owner.Location,Owner.Map);
			}

			bonusitem = new BronzeIngot( 20 );
			//Adding Bonus Item #4
			if(!Owner.AddToBackpack( bonusitem ) )
			{
				bonusitem.MoveToWorld(Owner.Location,Owner.Map);
			}

			bonusitem = new GoldIngot( 20 );
			//Adding Bonus Item #5
			if(!Owner.AddToBackpack( bonusitem ) )
			{
				bonusitem.MoveToWorld(Owner.Location,Owner.Map);
			}

			bonusitem = new AgapiteIngot( 20 );
			//Adding Bonus Item #6
			if(!Owner.AddToBackpack( bonusitem ) )
			{
				bonusitem.MoveToWorld(Owner.Location,Owner.Map);
			}

			bonusitem = new VeriteIngot( 20 );
			//Adding Bonus Item #7
			if(!Owner.AddToBackpack( bonusitem ) )
			{
				bonusitem.MoveToWorld(Owner.Location,Owner.Map);
			}

			bonusitem = new ValoriteIngot( 20 );
			//Adding Bonus Item #8
			if(!Owner.AddToBackpack( bonusitem ) )
			{
				bonusitem.MoveToWorld(Owner.Location,Owner.Map);
			}

			base.GiveRewards();
		}
Exemplo n.º 9
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.
        }
Exemplo n.º 10
0
        public override void OnDoubleClick(Mobile from)
        {
            bool anvil, forge;

            Server.Engines.Craft.DefBlacksmithy.CheckAnvilAndForge(from, 2, out anvil, out forge);

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1060640);                   // The item must be in your backpack to use it.
            }
            else if (!forge)
            {
                from.SendMessage("You need to be near a forge to smelt that.");
            }
            else if (from.Skills[SkillName.Blacksmith].Value >= 50)
            {
                if (this.Name == "crystalline dull copper")
                {
                    Item ingot = new DullCopperIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline shadow iron")
                {
                    Item ingot = new ShadowIronIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline copper")
                {
                    Item ingot = new CopperIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline bronze")
                {
                    Item ingot = new BronzeIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline gold")
                {
                    Item ingot = new GoldIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline agapite")
                {
                    Item ingot = new AgapiteIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline verite")
                {
                    Item ingot = new VeriteIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline valorite")
                {
                    Item ingot = new ValoriteIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline caddellite")
                {
                    Item ingot = new CaddelliteIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline onyx")
                {
                    Item ingot = new OnyxIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline quartz")
                {
                    Item ingot = new QuartzIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline ruby")
                {
                    Item ingot = new RubyIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline sapphire")
                {
                    Item ingot = new SapphireIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline spinel")
                {
                    Item ingot = new SpinelIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline topaz")
                {
                    Item ingot = new TopazIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline amethyst")
                {
                    Item ingot = new AmethystIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline emerald")
                {
                    Item ingot = new EmeraldIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (this.Name == "crystalline garnet")
                {
                    Item ingot = new GarnetIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "crystalline silver")
                {
                    Item ingot = new ShinySilverIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "crystalline star ruby")
                {
                    Item ingot = new StarRubyIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "crystalline marble")
                {
                    Item ingot = new MarbleIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "crystalline jade")
                {
                    Item ingot = new JadeIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "crystalline ice")
                {
                    Item ingot = new IceIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "crystalline obsidian")
                {
                    Item ingot = new ObsidianIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "crystalline nepturite")
                {
                    Item ingot = new NepturiteIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "crystalline steel")
                {
                    Item ingot = new SteelIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "crystalline brass")
                {
                    Item ingot = new BrassIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "crystalline mithril")
                {
                    Item ingot = new MithrilIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else if (Name == "crystalline xormite")
                {
                    Item ingot = new XormiteIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }
                else
                {
                    Item ingot = new IronIngot();
                    ingot.Amount = this.Amount;
                    from.AddToBackpack(ingot);
                }

                from.PlaySound(0x208);
                from.SendMessage("You smelt the crystalline metal the and put the ingots in your backpack.");
                this.Delete();
            }
            else
            {
                from.SendMessage("Only an apprentice blacksmith can smelt that.");
            }
        }