예제 #1
0
        public override bool OnDragDrop(Mobile from, Item item)
        {
            TeiravonMobile m_player = (TeiravonMobile)from;

            if (item is BaseGranite)
            {
                BaseGranite m_granite = (BaseGranite)item;
                switch (m_granite.Resource)
                {
                case CraftResource.Iron:
                    iron_amt += item.Amount; break;

                case CraftResource.DullCopper:
                    dull_amt += item.Amount; break;

                case CraftResource.ShadowIron:
                    shadow_amt += item.Amount; break;

                case CraftResource.Copper:
                    copper_amt += item.Amount; break;

                case CraftResource.Bronze:
                    bronze_amt += item.Amount; break;

                case CraftResource.Gold:
                    gold_amt += item.Amount; break;

                case CraftResource.Agapite:
                    agapite_amt += item.Amount; break;

                case CraftResource.Verite:
                    verite_amt += item.Amount; break;

                case CraftResource.Valorite:
                    valorite_amt += item.Amount; break;

                case CraftResource.Mithril:
                    mithril_amt += item.Amount; break;
                }

                m_player.SendMessage("You put the granite into the box");
                m_player.CloseGump(typeof(GraniteGump));
                m_player.SendGump(new GraniteGump(m_player, this, this.IronAmt, this.DullAmt, this.ShadowAmt, this.CopperAmt, this.BronzeAmt, this.GoldAmt, this.AgapiteAmt, this.VeriteAmt, this.ValoriteAmt, this.MithrilAmt));
                m_granite.Delete();
                return(true);
            }

            from.SendMessage("That box is for granite only.");
            return(false);
        }
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (!from.InRange(this.GetWorldLocation(), 1))
            {
                from.SendMessage(89, "You are too far from the crate, step closer.");
                return(false);
            }
            else
            {
                if (dropped is BaseGranite)
                {
                    if (dropped is Granite)
                    {
                        // NORMAL GRANITE
                        Granite yourgranite = (Granite)dropped;
                        dropped.Delete();
                        from.SendMessage(89, "The machine processes your granite.");
                        Effects.PlaySound(from.Location, from.Map, 0x2F3);  // Plays the earthquake sound
                        Item spawn = new Sand();
                        spawn.MoveToWorld(new Point3D(this.X + 2, this.Y - 2, this.Z + 2), this.Map);
                        return(true);
                    }
                    else
                    {
                        // Wrong Granite Type (Not Normal)
                        if (dropped is BaseGranite)
                        {
                            BaseGranite yourgranite = (BaseGranite)dropped;
                            dropped.Delete();
                            from.SendMessage(89, "The machine tries to processes the granite but fail's.");
                            Effects.PlaySound(from.Location, from.Map, 0x208);  // Plays the sound
                            from.SendMessage(89, "You loose your piece of granite!!!");
                            return(true);
                        }

                        return(false);
                    }
                }
                from.SendMessage(89, "This machine can only process normal granite.");
                return(false);
            }
            return(false);
        }