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

            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 GoldIngot(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.
            }
        }
        public override bool OnDragDrop(Mobile from, Item item)
        {
            if (PackAnimal.CheckAccess(this, from))
            {
                if (item is BaseOre)
                {
                    BaseOre m_Ore = item as BaseOre;

                    int toConsume = m_Ore.Amount;

                    if (toConsume > 30000)
                    {
                        toConsume = 30000;
                    }
                    else if (m_Ore.Amount < 2)
                    {
                        from.SendLocalizedMessage(501989);                           // You burn away the impurities but are left with no useable metal.
                        m_Ore.Delete();
                        return(true);
                    }

                    BaseIngot ingot = m_Ore.GetIngot();
                    ingot.Amount = toConsume * 2;

                    m_Ore.Consume(toConsume);

                    from.PlaySound(0x57);

                    AddToBackpack(ingot);
                    return(true);
                }
            }

            return(base.OnDragDrop(from, item));
        }
Esempio n. 3
0
        public override void OnDoubleClick(Mobile from)
        {
            var backpack = from.Backpack;

            var item1 = (ShadowIronIngot)backpack.FindItemByType(typeof(ShadowIronIngot));

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

                var 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 AgapiteIngot(500));
                    Delete();
                }
                else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500))
                {
                    from.SendMessage("You can only convert 500 ShadowIron Ingots at a time.");
                }
            }
            else
            {
                from.SendMessage("There isn't ShadowIron Ingots in your Backpack.");
            }
        }
Esempio n. 4
0
        public bool AddResource(Mobile from, BaseIngot reagent, bool passive)
        {
            if (!m_StoredItems.ContainsKey(reagent.GetType()))
            {
                m_StoredItems.Add(reagent.GetType(), new ResourceStub()
                {
                    m_Type = reagent.GetType(), m_Count = 0
                });
            }
            var resource = m_StoredItems[reagent.GetType()];

            if (resource.m_Count >= MAX_STORAGE_AMOUNT)
            {
                if (!passive)
                {
                    from.SendMessage("This book cannot hold more of that ingot.");
                }
                return(false);
            }

            var newTotal = resource.m_Count + reagent.Amount;

            if (newTotal > MAX_STORAGE_AMOUNT)
            {
                //partial deposit
                var excess = newTotal - MAX_STORAGE_AMOUNT;
                var toAdd  = (uint)(reagent.Amount - (newTotal - MAX_STORAGE_AMOUNT));
                if (toAdd > reagent.Amount)
                {
                    return(false);
                }
                m_StoredItems[reagent.GetType()].m_Count += toAdd;
                reagent.Amount -= (int)toAdd;
                if (!passive)
                {
                    from.SendMessage("You were only able to add {0} of the ingots.", toAdd);
                }
                return(false);
            }
            else
            {
                m_StoredItems[reagent.GetType()].m_Count += (uint)reagent.Amount;
                reagent.Delete();
                if (!passive)
                {
                    from.SendMessage("You add all of the ingots into the book.");
                }
                return(true);
            }
            // InvalidateProperties();
        }
Esempio n. 5
0
        public override void OnDoubleClick(Mobile from)
        {
            var backpack = from.Backpack;

            var item1 = (IronIngot)backpack.FindItemByType(typeof(IronIngot));

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

                var toConsume = m_Ore1.Amount;

                if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501))
                {
                    m_Ore1.Delete();

                    switch (Utility.Random(4))
                    {
                    case 0:
                        from.AddToBackpack(new DullCopperIngot(500));
                        break;

                    case 2:
                        from.AddToBackpack(new ShadowIronIngot(500));
                        break;

                    case 1:
                        from.AddToBackpack(new CopperIngot(500));
                        break;

                    case 3:
                        from.AddToBackpack(new BronzeIngot(500));
                        break;
                    }

                    from.SendMessage("You've successfully converted the Metal.");
                    Delete();
                }
                else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500))
                {
                    from.SendMessage("You can only convert 500 Iron Ingots at a time.");
                }
            }
            else
            {
                from.SendMessage("There isn't Iron Ingots in your Backpack.");
            }
        }
Esempio n. 6
0
        public override void OnDoubleClick(Mobile from)
        {
            Container backpack = from.Backpack;
            IronIngot item1    = (IronIngot)backpack.FindItemByType(typeof(IronIngot));

            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();

                    switch (Utility.Random(4))
                    {
                    case 0:
                        from.AddToBackpack(new DullCopperIngot(500));
                        break;

                    case 2:
                        from.AddToBackpack(new ShadowIronIngot(500));
                        break;

                    case 1:
                        from.AddToBackpack(new CopperIngot(500));
                        break;

                    case 3:
                        from.AddToBackpack(new BronzeIngot(500));
                        break;
                    }

                    from.SendLocalizedMessage(1113048); // You've successfully converted the metal.
                    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.
            }
        }
Esempio n. 7
0
        public void SendCopperIngot(Mobile from)
        {
            Container backpack = this.Backpack;

            from = this.ControlMaster;
            BankBox     bank1 = from.BankBox;
            CopperIngot copp  = (CopperIngot)backpack.FindItemByType(typeof(CopperIngot));

            if (copp is BaseIngot)
            {
                BaseIngot m_Ore4 = copp as BaseIngot;

                if (m_Ore4.Amount > 1000)
                {
                    PlaceItemIn(bank1, 18, 169, copp);
                }
            }
        }
Esempio n. 8
0
        public void SendShadowIronIngot(Mobile from)
        {
            Container backpack = this.Backpack;

            from = this.ControlMaster;
            BankBox     bank1 = from.BankBox;
            ShadowIngot shad  = (ShadowIngot)backpack.FindItemByType(typeof(ShadowIngot));

            if (shad is BaseIngot)
            {
                BaseIngot m_Ore3 = shad as BaseIngot;

                if (m_Ore3.Amount > 1000)
                {
                    PlaceItemIn(bank1, 18, 169, shad);
                }
            }
        }
Esempio n. 9
0
        public void SendDullCopperIngot(Mobile from)
        {
            Container backpack = this.Backpack;

            from = this.ControlMaster;
            BankBox         bank1 = from.BankBox;
            DullcopperIngot dull  = (DullcopperIngot)backpack.FindItemByType(typeof(DullcopperIngot));

            if (dull is BaseIngot)
            {
                BaseIngot m_Ore2 = dull as BaseIngot;

                if (m_Ore2.Amount > 1000)
                {
                    PlaceItemIn(bank1, 18, 169, dull);
                }
            }
        }
Esempio n. 10
0
        public void SendBronzeIngot(Mobile from)
        {
            Container backpack = this.Backpack;

            from = this.ControlMaster;
            BankBox     bank1 = from.BankBox;
            BronzeIngot bron  = (BronzeIngot)backpack.FindItemByType(typeof(BronzeIngot));

            if (bron is BaseIngot)
            {
                BaseIngot m_Ore6 = bron as BaseIngot;

                if (m_Ore6.Amount > 1000)
                {
                    PlaceItemIn(bank1, 18, 169, bron);
                }
            }
        }
Esempio n. 11
0
        public void SendAgapiteIngot(Mobile from)
        {
            Container backpack = this.Backpack;

            from = this.ControlMaster;
            BankBox      bank1 = from.BankBox;
            AgapiteIngot agap  = (AgapiteIngot)backpack.FindItemByType(typeof(AgapiteIngot));

            if (agap is BaseIngot)
            {
                BaseIngot m_Ore7 = agap as BaseIngot;

                if (m_Ore7.Amount > 1000)
                {
                    PlaceItemIn(bank1, 18, 169, agap);
                }
            }
        }
Esempio n. 12
0
        public void SendVeriteIngot(Mobile from)
        {
            Container backpack = this.Backpack;

            from = this.ControlMaster;
            BankBox     bank1 = from.BankBox;
            VeriteIngot veri  = (VeriteIngot)backpack.FindItemByType(typeof(VeriteIngot));

            if (veri is BaseIngot)
            {
                BaseIngot m_Ore8 = veri as BaseIngot;

                if (m_Ore8.Amount > 1000)
                {
                    PlaceItemIn(bank1, 18, 169, veri);
                }
            }
        }
Esempio n. 13
0
        public void SendValoriteIngot(Mobile from)
        {
            Container backpack = this.Backpack;

            from = this.ControlMaster;
            BankBox       bank1 = from.BankBox;
            ValoriteIngot valo  = (ValoriteIngot)backpack.FindItemByType(typeof(ValoriteIngot));

            if (valo is BaseIngot)
            {
                BaseIngot m_Ore9 = valo as BaseIngot;

                if (m_Ore9.Amount > 1000)
                {
                    PlaceItemIn(bank1, 18, 169, valo);
                }
            }
        }
Esempio n. 14
0
        public void SendGoldIngot(Mobile from)
        {
            Container backpack = this.Backpack;

            from = this.ControlMaster;
            BankBox   bank1 = from.BankBox;
            GoldIngot gold  = (GoldIngot)backpack.FindItemByType(typeof(GoldIngot));

            if (gold is BaseIngot)
            {
                BaseIngot m_Ore5 = gold as BaseIngot;

                if (m_Ore5.Amount > 1000)
                {
                    PlaceItemIn(bank1, 18, 169, gold);
                }
            }
        }
Esempio n. 15
0
        public void SendIronIngot(Mobile from)
        {
            Container backpack = this.Backpack;

            from = this.ControlMaster;
            BankBox   bank1 = from.BankBox;
            IronIngot iron  = (IronIngot)backpack.FindItemByType(typeof(IronIngot));

            if (iron is BaseIngot)
            {
                BaseIngot m_Ore1 = iron as BaseIngot;

                if (m_Ore1.Amount > 1000)
                {
                    PlaceItemIn(bank1, 18, 169, iron);
                }
            }
        }
Esempio n. 16
0
        public void Smelt(Item ore)
        {
            int toConsume = ore.Amount;


            if (toConsume >= 1)
            {
                if (toConsume > 30000)
                {
                    toConsume = 30000;
                }

                int ingotAmount;

                if (ore.ItemID == 0x19B7)
                {
                    ingotAmount = toConsume / 2;

                    if (toConsume % 2 != 0)
                    {
                        --toConsume;
                    }
                }
                else if (ore.ItemID == 0x19B9)
                {
                    ingotAmount = toConsume * 2;
                }
                else
                {
                    ingotAmount = toConsume;
                }

                BaseOre baseOre = (BaseOre)ore;

                BaseIngot ingot = baseOre.GetIngot();
                ingot.Amount = ingotAmount;

                baseOre.Consume(toConsume);
                this.AddToBackpack(ingot);
                //from.PlaySound( 0x57 );
            }
        }
Esempio n. 17
0
        public static string ComputeName(BaseIngot ba)
        {
            if (!string.IsNullOrEmpty(ba.Name))
            {
                return(ba.Name);
            }
            string name = "ingot";

            if (ba.Amount > 1)
            {
                name = name + "s";
            }
            var resource = string.Empty;

            if (ba.Resource != CraftResource.None)
            {
                resource = CraftResources.GetName(ba.Resource);
                name     = string.Format("{0} {1} {2}", ba.Amount, resource, name.ToLower());
            }

            return(name);
        }
Esempio n. 18
0
        public static int SellResource(Type type)
        {
            object item = Activator.CreateInstance(type);

            if (item is BaseIngot)
            {
                BaseIngot ing = item as BaseIngot;

                switch (ing.Resource)
                {
                case CraftResource.Fer: return(1);

                case CraftResource.Cuivre: return(2);

                case CraftResource.Bronze: return(3);

                case CraftResource.Acier: return(5);

                case CraftResource.Argent: return(7);
                }
            }

            if (item is BaseBone)
            {
                BaseBone bone = item as BaseBone;

                switch (bone.Resource)
                {
                case CraftResource.RegularBones: return(1);

                case CraftResource.GobelinBones: return(2);

                case CraftResource.NordiqueBones: return(3);

                case CraftResource.ReptilienBones: return(5);

                case CraftResource.DesertiqueBones: return(7);
                }
            }

            if (item is BaseLeather)
            {
                BaseLeather leath = item as BaseLeather;

                switch (leath.Resource)
                {
                case CraftResource.RegularLeather: return(1);

                case CraftResource.LupusLeather: return(2);

                case CraftResource.NordiqueLeather: return(3);

                case CraftResource.ReptilienLeather: return(5);

                case CraftResource.DesertiqueLeather: return(7);
                }
            }

            if (item is BaseLog)
            {
                BaseLog board = item as BaseLog;

                switch (board.Resource)
                {
                case CraftResource.RegularWood: return(1);

                case CraftResource.PinWood: return(2);

                case CraftResource.CypresWood: return(5);
                }
            }

            if (item is BaseGem)
            {
                if (item is Coquillage)
                {
                    return(1);
                }
                if (item is Amber)
                {
                    return(2);
                }
                if (item is Citrine)
                {
                    return(3);
                }
                if (item is Tourmaline)
                {
                    return(5);
                }
                if (item is Amethyst)
                {
                    return(7);
                }
            }

            return(-1);
        }
Esempio n. 19
0
        public void ConvertOretoIngot(Mobile from)
        {
            this.Skills.Mining.Cap = 120;
            Container backpack = this.Backpack;
            BankBox   bank     = from.BankBox;
            IronOre   item     = (IronOre)backpack.FindItemByType(typeof(IronOre));

            if (item is BaseOre)
            {
                BaseOre m_Ore = item as BaseOre;

                int toConsume = m_Ore.Amount;

                if (toConsume > 30000)
                {
                    toConsume = 30000;
                }
                else if (m_Ore.Amount < 2)
                {
                    m_Ore.Delete();
                }

                BaseIngot ingot = m_Ore.GetIngot();
                ingot.Amount = toConsume * 2;

                m_Ore.Consume(toConsume);

                this.PlaySound(0x57);

                this.AddToBackpack(item);
                this.AddToBackpack(ingot);
            }

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

            if (item1 is BaseOre)
            {
                BaseOre m_Ore = item1 as BaseOre;

                int toConsume = m_Ore.Amount;

                if (toConsume > 30000)
                {
                    toConsume = 30000;
                }
                else if (m_Ore.Amount < 2)
                {
                    m_Ore.Delete();
                }

                BaseIngot ingot = m_Ore.GetIngot();
                ingot.Amount = toConsume * 2;

                m_Ore.Consume(toConsume);

                this.PlaySound(0x57);

                this.AddToBackpack(item);
                this.AddToBackpack(ingot);
            }

            BronzeOre item2 = (BronzeOre)backpack.FindItemByType(typeof(BronzeOre));

            if (item2 is BaseOre)
            {
                BaseOre m_Ore = item2 as BaseOre;

                int toConsume = m_Ore.Amount;

                if (toConsume > 30000)
                {
                    toConsume = 30000;
                }
                else if (m_Ore.Amount < 2)
                {
                    m_Ore.Delete();
                }

                BaseIngot ingot = m_Ore.GetIngot();
                ingot.Amount = toConsume * 2;

                m_Ore.Consume(toConsume);

                this.PlaySound(0x57);

                this.AddToBackpack(item);
                this.AddToBackpack(ingot);
            }

            CopperOre item3 = (CopperOre)backpack.FindItemByType(typeof(CopperOre));

            if (item3 is BaseOre)
            {
                BaseOre m_Ore = item3 as BaseOre;

                int toConsume = m_Ore.Amount;

                if (toConsume > 30000)
                {
                    toConsume = 30000;
                }
                else if (m_Ore.Amount < 2)
                {
                    m_Ore.Delete();
                }

                BaseIngot ingot = m_Ore.GetIngot();
                ingot.Amount = toConsume * 2;

                m_Ore.Consume(toConsume);

                this.PlaySound(0x57);

                this.AddToBackpack(item);
                this.AddToBackpack(ingot);
            }

            GoldOre item4 = (GoldOre)backpack.FindItemByType(typeof(GoldOre));

            if (item4 is BaseOre)
            {
                BaseOre m_Ore = item4 as BaseOre;

                int toConsume = m_Ore.Amount;

                if (toConsume > 30000)
                {
                    toConsume = 30000;
                }
                else if (m_Ore.Amount < 2)
                {
                    m_Ore.Delete();
                }

                BaseIngot ingot = m_Ore.GetIngot();
                ingot.Amount = toConsume * 2;

                m_Ore.Consume(toConsume);

                this.PlaySound(0x57);

                this.AddToBackpack(item);
                this.AddToBackpack(ingot);
            }

            DullcopperOre item5 = (DullcopperOre)backpack.FindItemByType(typeof(DullcopperOre));

            if (item5 is BaseOre)
            {
                BaseOre m_Ore = item5 as BaseOre;

                int toConsume = m_Ore.Amount;

                if (toConsume > 30000)
                {
                    toConsume = 30000;
                }
                else if (m_Ore.Amount < 2)
                {
                    m_Ore.Delete();
                }

                BaseIngot ingot = m_Ore.GetIngot();
                ingot.Amount = toConsume * 2;

                m_Ore.Consume(toConsume);

                this.PlaySound(0x57);

                this.AddToBackpack(item);
                this.AddToBackpack(ingot);
            }

            AgapiteOre item6 = (AgapiteOre)backpack.FindItemByType(typeof(AgapiteOre));

            if (item6 is BaseOre)
            {
                BaseOre m_Ore = item6 as BaseOre;

                int toConsume = m_Ore.Amount;

                if (toConsume > 30000)
                {
                    toConsume = 30000;
                }
                else if (m_Ore.Amount < 2)
                {
                    m_Ore.Delete();
                }

                BaseIngot ingot = m_Ore.GetIngot();
                ingot.Amount = toConsume * 2;

                m_Ore.Consume(toConsume);

                this.PlaySound(0x57);

                this.AddToBackpack(item);
                this.AddToBackpack(ingot);
            }

            VeriteOre item7 = (VeriteOre)backpack.FindItemByType(typeof(VeriteOre));

            if (item7 is BaseOre)
            {
                BaseOre m_Ore = item7 as BaseOre;

                int toConsume = m_Ore.Amount;

                if (toConsume > 30000)
                {
                    toConsume = 30000;
                }
                else if (m_Ore.Amount < 2)
                {
                    m_Ore.Delete();
                }

                BaseIngot ingot = m_Ore.GetIngot();
                ingot.Amount = toConsume * 2;

                m_Ore.Consume(toConsume);

                this.PlaySound(0x57);

                this.AddToBackpack(item);
                this.AddToBackpack(ingot);
            }

            ValoriteOre item8 = (ValoriteOre)backpack.FindItemByType(typeof(ValoriteOre));

            if (item8 is BaseOre)
            {
                BaseOre m_Ore = item8 as BaseOre;

                int toConsume = m_Ore.Amount;

                if (toConsume > 30000)
                {
                    toConsume = 30000;
                }
                else if (m_Ore.Amount < 2)
                {
                    m_Ore.Delete();
                }

                BaseIngot ingot = m_Ore.GetIngot();
                ingot.Amount = toConsume * 2;

                m_Ore.Consume(toConsume);

                this.PlaySound(0x57);

                this.AddToBackpack(item);
                this.AddToBackpack(ingot);
            }
        }
        protected override void OnTarget(Mobile from, object targ)
        {
            if (!(targ is BaseOre))
            {
                from.SendMessage("This can only be used on ore.");
            }
            else if (targ is TAVOre)
            {
                m_Ore = targ as TAVOre;

                if (!from.InRange(m_Ore.GetWorldLocation(), 2))
                {
                    from.SendLocalizedMessage(501976); // The ore is too far away.
                    return;
                }

                int    toConsume = m_Ore.Amount;
                int    Volume    = 0;
                int    count     = 0;
                double Success   = 2;
                //from.Say("success value : {0}%", Success* 100);   -- Debug Text for Smelting

                for (int i = 0; i < TAVOre.GetLength(m_Ore); ++i)
                {
                    Volume = (int)(toConsume * Success * TAVOre.GetCon(i, m_Ore));
                    if (Volume > 0)
                    {
                        Item ingot = TAVOre.GetMetals(i, m_Ore);
                        ingot.Amount = Volume;
                        from.AddToBackpack(ingot);

                        count++;
                    }
                }

                m_Ore.Consume(toConsume);
                opot.TargetDrink = true;
                opot.Drink(from);
            }
            else
            {
                ore = (BaseOre)targ;

                if (!from.InRange(ore.GetWorldLocation(), 2))
                {
                    from.SendLocalizedMessage(501976);                       // The ore is too far away.
                    return;
                }

                int toConsume = ore.Amount;

                if (toConsume > 50)
                {
                    toConsume = 50;
                }

                BaseIngot ingot = ore.GetIngot();
                ingot.Amount = toConsume * 2;

                ore.Consume(toConsume);
                from.AddToBackpack(ingot);
                opot.TargetDrink = true;
                opot.Drink(from);
            }
        }
Esempio n. 21
0
        public override bool OnDragDrop(Mobile from, Item item1)
        {
            if (item1 is PotionKeg)
            {
                PotionKeg m_Pot1 = item1 as PotionKeg;

                if (m_Pot1.Type == PotionEffect.RefreshTotal)
                {
                    from.SendMessage("OHHHH YESSS !!!");

                    int toConsume = m_Pot1.Amount;

                    if ((m_Pot1.Amount < 2) && (m_Pot1.Amount > 0))
                    {
                        from.SendMessage("You have converted 1 Keg of Total Refreshment Potion in a Inspected Keg of Total Refreshment");
                        m_Pot1.Delete();
                        from.AddToBackpack(new InspectedKegofTotalRefreshment());

                        return(true);
                    }
                    else
                    {
                        from.SendMessage("You can only convert 1 Keg of Total Refreshment Potion at a time !");
                    }
                }
                else if (m_Pot1.Type == PotionEffect.PoisonGreater)
                {
                    from.SendMessage("OHHHH YESSS !!!");

                    int toConsume = m_Pot1.Amount;

                    if ((m_Pot1.Amount < 2) && (m_Pot1.Amount > 0))
                    {
                        from.SendMessage("You have converted 1 Keg of Greater Poison Potion in a Inspected Keg of Greater Poison");
                        m_Pot1.Delete();
                        from.AddToBackpack(new InspectedKegofGreaterPoison());

                        return(true);
                    }
                    else
                    {
                        from.SendMessage("You can only convert 1 Keg of Greater Poison Potion at a time !");
                    }
                }
            }

            if (item1 is GoldIngot)
            {
                BaseIngot m_Ing1 = item1 as BaseIngot;

                int toConsume = m_Ing1.Amount;

                if ((m_Ing1.Amount > 19) && (m_Ing1.Amount < 21))
                {
                    from.SendMessage("You have converted 20 Gold Ingot in a Pile of Inspected Gold Ingots");
                    m_Ing1.Delete();
                    from.AddToBackpack(new PileofInspectedGoldIngots());

                    return(true);
                }
                else
                {
                    from.SendMessage("You can only convert 20 Gold Ingot at a time !");
                }
            }

            if (item1 is DullCopperIngot)
            {
                BaseIngot m_Ing2 = item1 as BaseIngot;

                int toConsume = m_Ing2.Amount;

                if ((m_Ing2.Amount > 19) && (m_Ing2.Amount < 21))
                {
                    from.SendMessage("You have converted 20 DullCopper Ingot in a Pile of Inspected DullCopper Ingots");
                    m_Ing2.Delete();
                    from.AddToBackpack(new PileofInspectedDullCopperIngots());

                    return(true);
                }
                else
                {
                    from.SendMessage("You can only convert 20 DullCopper Ingot at a time !");
                }
            }

            if (item1 is ShadowIronIngot)
            {
                BaseIngot m_Ing3 = item1 as BaseIngot;

                int toConsume = m_Ing3.Amount;

                if ((m_Ing3.Amount > 19) && (m_Ing3.Amount < 21))
                {
                    from.SendMessage("You have converted 20 ShadowIron Ingot in a Pile of Inspected ShadowIron Ingots");
                    m_Ing3.Delete();
                    from.AddToBackpack(new PileofInspectedShadowIronIngots());

                    return(true);
                }
                else
                {
                    from.SendMessage("You can only convert 20 ShadowIron Ingot at a time !");
                }
            }

            if (item1 is CopperIngot)
            {
                BaseIngot m_Ing4 = item1 as BaseIngot;

                int toConsume = m_Ing4.Amount;

                if ((m_Ing4.Amount > 19) && (m_Ing4.Amount < 21))
                {
                    from.SendMessage("You have converted 20 Copper Ingot in a Pile of Inspected Copper Ingots");
                    m_Ing4.Delete();
                    from.AddToBackpack(new PileofInspectedCopperIngots());

                    return(true);
                }
                else
                {
                    from.SendMessage("You can only convert 20 Copper Ingot at a time !");
                }
            }

            if (item1 is BronzeIngot)
            {
                BaseIngot m_Ing5 = item1 as BaseIngot;

                int toConsume = m_Ing5.Amount;

                if ((m_Ing5.Amount > 19) && (m_Ing5.Amount < 21))
                {
                    from.SendMessage("You have converted 20 Bronze Ingot in a Pile of Inspected Bronze Ingots");
                    m_Ing5.Delete();
                    from.AddToBackpack(new PileofInspectedBronzeIngots());

                    return(true);
                }
                else
                {
                    from.SendMessage("You can only convert 20 Bronze Ingot at a time !");
                }
            }

            if (item1 is AgapiteIngot)
            {
                BaseIngot m_Ing6 = item1 as BaseIngot;

                int toConsume = m_Ing6.Amount;

                if ((m_Ing6.Amount > 19) && (m_Ing6.Amount < 21))
                {
                    from.SendMessage("You have converted 20 Agapite Ingot in a Pile of Inspected Bronze Ingots");
                    m_Ing6.Delete();
                    from.AddToBackpack(new PileofInspectedAgapiteIngots());

                    return(true);
                }
                else
                {
                    from.SendMessage("You can only convert 20 Agapite Ingot at a time !");
                }
            }

            if (item1 is VeriteIngot)
            {
                BaseIngot m_Ing7 = item1 as BaseIngot;

                int toConsume = m_Ing7.Amount;

                if ((m_Ing7.Amount > 19) && (m_Ing7.Amount < 21))
                {
                    from.SendMessage("You have converted 20 Verite Ingot in a Pile of Inspected Verite Ingots");
                    m_Ing7.Delete();
                    from.AddToBackpack(new PileofInspectedVeriteIngots());

                    return(true);
                }
                else
                {
                    from.SendMessage("You can only convert 20 Verite Ingot at a time !");
                }
            }

            if (item1 is ValoriteIngot)
            {
                BaseIngot m_Ing8 = item1 as BaseIngot;

                int toConsume = m_Ing8.Amount;

                if ((m_Ing8.Amount > 19) && (m_Ing8.Amount < 21))
                {
                    from.SendMessage("You have converted 20 Valorite Ingot in a Pile of Inspected Valorite Ingots");
                    m_Ing8.Delete();
                    from.AddToBackpack(new PileofInspectedValoriteIngots());

                    return(true);
                }
                else
                {
                    from.SendMessage("You can only convert 20 Verite Ingot at a time !");
                }
            }

            return(base.OnDragDrop(from, item1));
        }
Esempio n. 22
0
        public override void OnThink()
        {
            if (this.Alive && this.m_Mine && this.m_NextUse <= DateTime.Now)
            {
                Container backpack = this.Backpack;

                if (backpack == null)
                {
                    m_NextUse = DateTime.Now + TimeSpan.FromSeconds(2.5); base.OnThink(); return;
                }
                if (backpack.TotalWeight > (backpack.MaxWeight - 100))
                {
                    this.Say("I'm full !! I'm AutoConverting Ore in Ingot !"); m_Mine = true; this.Hue = 0; ControlOrder = OrderType.Stay; ConvertOretoIngot(this);  base.OnThink(); return;
                }

                Shovel   shovel1 = (Shovel)backpack.FindItemByType(typeof(Shovel));
                Pickaxe  shovel2 = (Pickaxe)backpack.FindItemByType(typeof(Pickaxe));
                IBShovel shovel3 = (IBShovel)backpack.FindItemByType(typeof(IBShovel));


                if (shovel1 != null)
                {
                    if (this.DoDisposeOre(this.X, this.Y, this.Z, this.Map, this))
                    {
                        shovel1.UsesRemaining -= 1;
                        if (shovel1 != null && !shovel1.Deleted && shovel1.UsesRemaining <= 0)
                        {
                            shovel1.Delete();
                        }
                    }
                }

                if (shovel2 != null)
                {
                    if (this.DoDisposeOre(this.X, this.Y, this.Z, this.Map, this))
                    {
                        shovel2.UsesRemaining -= 1;
                        if (shovel2 != null && !shovel2.Deleted && shovel2.UsesRemaining <= 0)
                        {
                            shovel2.Delete();
                        }
                    }
                }

                if (shovel3 != null)
                {
                    if (this.DoDisposeOre(this.X, this.Y, this.Z, this.Map, this))
                    {
                        shovel3.UsesRemaining -= 1;
                        if (shovel3 != null && !shovel3.Deleted && shovel3.UsesRemaining <= 0)
                        {
                            shovel3.Delete();
                        }
                    }
                }

                m_NextUse = DateTime.Now + TimeSpan.FromSeconds(2.5);

                if ((shovel1 == null) && (shovel2 == null) && (shovel3 == null))
                {
                    this.Say("I require a tool to dig");
                    m_Mine       = false;
                    this.Hue     = 0;
                    ControlOrder = OrderType.Follow;
                }

                IronIngot iron1 = (IronIngot)backpack.FindItemByType(typeof(IronIngot));
                if (iron1 is BaseIngot)
                {
                    BaseIngot m_Ore1 = iron1 as BaseIngot;

                    if (m_Ore1.Amount > 1000)
                    {
                        SendIronIngot(this);
                    }
                }

                DullcopperIngot dull1 = (DullcopperIngot)backpack.FindItemByType(typeof(DullcopperIngot));
                if (dull1 is BaseIngot)
                {
                    BaseIngot m_Ore2 = dull1 as BaseIngot;

                    if (m_Ore2.Amount > 1000)
                    {
                        SendDullCopperIngot(this);
                    }
                }

                ShadowIngot shad1 = (ShadowIngot)backpack.FindItemByType(typeof(ShadowIngot));
                if (shad1 is BaseIngot)
                {
                    BaseIngot m_Ore3 = shad1 as BaseIngot;

                    if (m_Ore3.Amount > 1000)
                    {
                        SendShadowIronIngot(this);
                    }
                }

                BronzeIngot bron1 = (BronzeIngot)backpack.FindItemByType(typeof(BronzeIngot));
                if (bron1 is BaseIngot)
                {
                    BaseIngot m_Ore4 = bron1 as BaseIngot;

                    if (m_Ore4.Amount > 1000)
                    {
                        SendBronzeIngot(this);
                    }
                }

                GoldIngot gold1 = (GoldIngot)backpack.FindItemByType(typeof(GoldIngot));
                if (gold1 is BaseIngot)
                {
                    BaseIngot m_Ore5 = gold1 as BaseIngot;

                    if (m_Ore5.Amount > 1000)
                    {
                        SendGoldIngot(this);
                    }
                }

                CopperIngot copp1 = (CopperIngot)backpack.FindItemByType(typeof(CopperIngot));
                if (copp1 is BaseIngot)
                {
                    BaseIngot m_Ore6 = copp1 as BaseIngot;

                    if (m_Ore6.Amount > 1000)
                    {
                        SendCopperIngot(this);
                    }
                }

                AgapiteIngot agap1 = (AgapiteIngot)backpack.FindItemByType(typeof(AgapiteIngot));
                if (agap1 is BaseIngot)
                {
                    BaseIngot m_Ore7 = agap1 as BaseIngot;

                    if (m_Ore7.Amount > 1000)
                    {
                        SendAgapiteIngot(this);
                    }
                }

                VeriteIngot veri1 = (VeriteIngot)backpack.FindItemByType(typeof(VeriteIngot));
                if (veri1 is BaseIngot)
                {
                    BaseIngot m_Ore8 = veri1 as BaseIngot;

                    if (m_Ore8.Amount > 1000)
                    {
                        SendVeriteIngot(this);
                    }
                }

                ValoriteIngot valo1 = (ValoriteIngot)backpack.FindItemByType(typeof(ValoriteIngot));
                if (valo1 is BaseIngot)
                {
                    BaseIngot m_Ore9 = valo1 as BaseIngot;

                    if (m_Ore9.Amount > 1000)
                    {
                        SendValoriteIngot(this);
                    }
                }
            }
            base.OnThink();
        }