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

                        switch (Utility.Random(14))
                        {
                        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;

                        case 9: ingots = new BlazeIngot(); break;

                        case 10: ingots = new IceIngot(); break;

                        case 11: ingots = new ToxicIngot(); break;

                        case 12: ingots = new ElectrumIngot(); break;

                        case 13: ingots = new PlatinumIngot(); break;
                        }

                        int amount = Math.Min(10, this.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
                        {
                            this.PublicOverheadMessage(MessageType.Regular, 0, 1094724, amount.ToString());     // Ore: ~1_COUNT~
                            this.m_Ore -= amount;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1094725);     // There are no more resources available at this time.
                    }
                    break;

                case MiningCartType.GemSouth:
                case MiningCartType.GemEast:
                    if (this.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, this.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
                        {
                            this.PublicOverheadMessage(MessageType.Regular, 0, 1094723, amount.ToString());     // Gems: ~1_COUNT~
                            this.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.
            }
        }
Beispiel #2
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.");
            }
        }
Beispiel #3
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.");
            }
        }