Ejemplo n.º 1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_ranchstone = (RanchStone)reader.ReadItem();
        }
Ejemplo n.º 2
0
            protected override void OnTarget(Mobile from, object targ)
            {
                if (targ is BaseFence)
                {
                    BaseFence fg = (BaseFence)targ;

                    if (fg.Movable == true)
                    {
                        from.SendMessage("You set the fence into the ground.");
                        from.PlaySound(0x136);
                        fg.Movable    = false;
                        fg.ranchstone = t_fh.ranchstone;
                    }
                    else
                    {
                        from.SendMessage("You knock it free from the ground.");
                        from.PlaySound(0x13F);
                        fg.Movable    = true;
                        fg.ranchstone = null;
                    }
                    return;
                }
                else if (targ is FenceGate)
                {
                    FenceGate fg = (FenceGate)targ;

                    if (fg.Movable == true)
                    {
                        from.SendMessage("You set the fence into the ground.");
                        from.PlaySound(0x136);
                        fg.Movable    = false;
                        fg.ranchstone = t_fh.ranchstone;
                    }
                    else
                    {
                        from.SendMessage("You knock it free from the ground.");
                        from.PlaySound(0x13F);
                        fg.Movable    = true;
                        fg.ranchstone = null;
                    }
                    return;
                }
                else if (targ is RanchStone)
                {
                    RanchStone rs = (RanchStone)targ;
                    if (rs.Owner == from)
                    {
                        from.SendMessage("Enter new ranch name.");
                        from.Prompt = new RenamePrompt(rs);
                    }
                    else
                    {
                        from.SendMessage("You don't own that!");
                    }
                }
                else
                {
                    from.SendMessage("You can't do that.");
                }
            }
Ejemplo n.º 3
0
 protected override void OnTarget(Mobile from, object targ)
 {
     if (targ is RanchStone)
     {
         RanchStone rs = (RanchStone)targ;
         if (from.InRange(rs.GetWorldLocation(), 2))
         {
             if (rs.Owner == from)
             {
                 if ((rs.Size + 5) < 50)
                 {
                     t_re.Delete();
                     rs.Size += 5;
                     rs.InvalidateProperties();
                     from.SendMessage("Your ranch has been enlarged.");
                 }
                 else
                 {
                     from.SendMessage("Your ranch is already at maximum size!");
                 }
             }
             else
             {
                 from.SendMessage("You don't own that ranchstone!");
             }
         }
         else
         {
             from.SendMessage("That's too far away!");
         }
     }
 }
Ejemplo n.º 4
0
 public RenamePrompt(RanchStone RS)
 {
     m_RS = RS;
 }
Ejemplo n.º 5
0
        public override void OnDoubleClick(Mobile from)
        {
            if (this.IsChildOf(from.Backpack))
            {
                bool canplace = true;

                foreach (Item item in this.GetItemsInRange(11))
                {
                    if ((item is BaseHouse) || (item is RanchStone))
                    {
                        canplace = false;
                    }
                }

                if ((NotForbiddenRegions(from) && canplace) || (from.AccessLevel >= AccessLevel.GameMaster))
                {
                    Point3D rd = new Point3D(0, 0, 0);
                    if (from.Direction == Direction.North)
                    {
                        rd = new Point3D(from.X, from.Y - 1, from.Z);
                    }
                    else if (from.Direction == Direction.South)
                    {
                        rd = new Point3D(from.X, from.Y + 1, from.Z);
                    }
                    else if (from.Direction == Direction.West)
                    {
                        rd = new Point3D(from.X - 1, from.Y, from.Z);
                    }
                    else if (from.Direction == Direction.East)
                    {
                        rd = new Point3D(from.X + 1, from.Y, from.Z);
                    }

                    else if (from.Direction == Direction.Up)
                    {
                        rd = new Point3D(from.X - 1, from.Y - 1, from.Z);
                    }
                    else if (from.Direction == Direction.Down)
                    {
                        rd = new Point3D(from.X + 1, from.Y + 1, from.Z);
                    }
                    else if (from.Direction == Direction.Left)
                    {
                        rd = new Point3D(from.X - 1, from.Y + 1, from.Z);
                    }
                    else
                    {
                        rd = new Point3D(from.X + 1, from.Y - 1, from.Z);
                    }

                    RanchStone rs = new RanchStone();
                    rs.Owner   = from;
                    rs.Ranch   = from.Name + "'s Ranch";
                    rs.Movable = false;
                    rs.MoveToWorld(rd, from.Map);
                    this.Delete();
                }
                else
                {
                    from.SendMessage("That can't be placed here");
                }
            }
            else
            {
                from.SendMessage("That must be in your backpack to use");
            }
        }