Example #1
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            int amounttocut = 0;

            if (!from.InRange(this.GetWorldLocation(), 1))
            {
                from.SendMessage(89, "You are too far from the machine, step closer."); return(false);
            }
            else
            {
                if (dropped is Log)
                {
                    Log yourlogs = (Log)dropped;
                    dropped.Delete();
                    amounttocut = yourlogs.Amount;
                    from.SendMessage(89, "You recieve {0} boards", amounttocut);
                    Effects.PlaySound(from.Location, from.Map, 0x218);
                    string s_resource = Convert.ToString(yourlogs.Resource);
                    Item   spawn;
                    switch (s_resource)
                    {
                    default: spawn = new Board(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map); break;

                    //case "Pine": spawn = new PineBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y-3, this.Z+3), this.Map); break;
                    case "AshWood": spawn = new AshBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map); break;

                    //case "Mahogany": spawn = new MahoganyBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y-3, this.Z+3), this.Map); break;
                    case "YewWood": spawn = new YewBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map); break;

                    case "OakWood": spawn = new OakBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map); break;

                    //case "Cedar": spawn = new CedarBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y-3, this.Z+3), this.Map); break;
                    //case "Cherry": spawn = new CherryBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y-3, this.Z+3), this.Map); break;
                    case "Heartwood": spawn = new HeartwoodBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map); break;

                    case "Frostwood": spawn = new FrostwoodBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map); break;

                    case "Bloodwood": spawn = new BloodwoodBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map); break;
                        //case "Eucalyptus": spawn = new EucalyptusBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y-3, this.Z+3), this.Map); //break;
                        //case "Willow": spawn = new WillowBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y-3, this.Z+3), this.Map); //break;
                        //case "Cherry": spawn = new CherryBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y-3, this.Z+3), this.Map); //break;
                        //case "Heartwood": spawn = new HeartwoodBoard(yourlogs.Amount); spawn.MoveToWorld(new Point3D(this.X, this.Y-3, this.Z+3), this.Map); //break;
                    }
                    return(true);
                }

                from.SendMessage(89, "This can only cut logs.");
                return(false);
            }
            return(false);
        }
Example #2
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            int amounttocut = 0;

            if (!from.InRange(this.GetWorldLocation(), 1))
            {
                from.SendMessage(89, "You are too far from the machine, step closer.");
                return(false);
            }
            else
            {
                if (dropped is Log) // Log is now BaseLog
                {
                    if (dropped is OakLog)
                    {
                        // It's an OAK log
                        OakLog yourlogs = (OakLog)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new OakBoard(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return(true);
                    }

                    else if (dropped is AshLog)
                    {
                        // It's an ASH log
                        AshLog yourlogs = (AshLog)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new AshBoard(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return(true);
                    }

                    else if (dropped is YewLog)
                    {
                        // It's a YEW log
                        YewLog yourlogs = (YewLog)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new YewBoard(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return(true);
                    }

                    else if (dropped is HeartwoodLog)
                    {
                        // It's a HEARTWOOD log
                        HeartwoodLog yourlogs = (HeartwoodLog)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new HeartwoodBoard(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return(true);
                    }

                    else if (dropped is BloodwoodLog)
                    {
                        // It's a BLOODWOOD log
                        BloodwoodLog yourlogs = (BloodwoodLog)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new BloodwoodBoard(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return(true);
                    }

                    else if (dropped is FrostwoodLog)
                    {
                        // It's a FROSTWOOD log
                        FrostwoodLog yourlogs = (FrostwoodLog)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new FrostwoodBoard(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return(true);
                    }

                    else if (dropped is Log)
                    {
                        // It's a NORMAL log
                        Log yourlogs = (Log)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new Board(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return(true);
                    }
                }

                from.SendMessage(89, "This can only cut logs.");
                return(false);
            }
            return(false);
        }
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            int amounttocut = 0;

            if (!from.InRange(this.GetWorldLocation(), 1))
            {
                from.SendMessage(89, "You are too far from the machine, step closer.");
                return false;
            }
            else
            {
                if (dropped is Log) // Log is now BaseLog
                {
                    if (dropped is OakLog)
                    {
                        // It's an OAK log
                        OakLog yourlogs = (OakLog)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new OakBoard(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return true;
                    }

                    else if (dropped is AshLog)
                    {
                        // It's an ASH log
                        AshLog yourlogs = (AshLog)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new AshBoard(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return true;
                    }

                    else if (dropped is YewLog)
                    {
                        // It's a YEW log
                        YewLog yourlogs = (YewLog)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new YewBoard(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return true;
                    }

                    else if (dropped is HeartwoodLog)
                    {
                        // It's a HEARTWOOD log
                        HeartwoodLog yourlogs = (HeartwoodLog)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new HeartwoodBoard(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return true;
                    }

                    else if (dropped is BloodwoodLog)
                    {
                        // It's a BLOODWOOD log
                        BloodwoodLog yourlogs = (BloodwoodLog)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new BloodwoodBoard(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return true;
                    }

                    else if (dropped is FrostwoodLog)
                    {
                        // It's a FROSTWOOD log
                        FrostwoodLog yourlogs = (FrostwoodLog)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new FrostwoodBoard(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return true;
                    }

                    else if (dropped is Log)
                    {
                        // It's a NORMAL log
                        Log yourlogs = (Log)dropped;
                        dropped.Delete();
                        amounttocut = yourlogs.Amount;
                        from.SendMessage(89, "You recieve {0} boards", amounttocut);
                        Effects.PlaySound(from.Location, from.Map, 0x218);  // Plays the saw sound
                        Item spawn = new Board(amounttocut);
                        spawn.MoveToWorld(new Point3D(this.X, this.Y - 3, this.Z + 3), this.Map);
                        return true;
                    }
                }

                from.SendMessage(89, "This can only cut logs.");
                return false;
            }
            return false;
        }