protected override void OnTarget(Mobile from, object targ)
 {
     if (targ is RanchStone)
     {
         RanchStone stone = (RanchStone)targ;
         if (stone.Owner == from)
         {
             if (t_rs.Map == stone.Map)
             {
                 int ranchrange = (int)(from.GetDistanceToSqrt(t_rs.Location));
                 int ranchto    = (int)(stone.Size / 2);
                 int ranchfrom  = (int)(t_rs.Size / 2);
                 if ((ranchfrom >= (ranchrange - (ranchto + ranchfrom))) && t_rs.Size > stone.Size)
                 {
                     foreach (Item item in stone.GetItemsInRange(stone.Size + 1))
                     {
                         if (item is FenceGate)
                         {
                             FenceGate fg = (FenceGate)item;
                             if (fg.ranchstone == stone)
                             {
                                 fg.ranchstone = t_rs;
                                 fg.InvalidateProperties();
                             }
                         }
                         else if (item is BaseFence)
                         {
                             BaseFence f = (BaseFence)item;
                             if (f.ranchstone == stone)
                             {
                                 f.ranchstone = t_rs;
                                 f.InvalidateProperties();
                             }
                         }
                     }
                     RanchDeed rd = new RanchDeed();
                     from.AddToBackpack(rd);
                     from.SendMessage("You absorb the ranch.");
                     stone.Delete();
                 }
                 else
                 {
                     from.SendMessage("Your ranch isn't big enough to absorb target ranch!");
                 }
             }
             else
             {
                 from.SendMessage("That ranch is on a different facet!");
             }
         }
         else
         {
             from.SendMessage("That's not your ranch!");
         }
     }
     else
     {
         from.SendMessage("You can't absorb that!");
     }
     from.SendGump(new RanchStoneGump(t_rs));
 }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (info.ButtonID == (int)Buttons.BrandingIron)
            {
                Container pack      = from.Backpack;
                ArrayList bagitems  = new ArrayList(pack.Items);
                int       ironTotal = 0;
                foreach (Item item in bagitems)
                {
                    if (item is BrandingIron)
                    {
                        BrandingIron iron = (BrandingIron)item;
                        if (iron.ranchstone == m_rs)
                        {
                            iron.Delete();
                            ironTotal++;
                        }
                    }
                }

                if (ironTotal > 0)
                {
                    from.SendMessage("You return the branding iron.");
                }
                else
                {
                    from.SendMessage("Added a branding iron to your pack.");
                    BrandingIron bi = new BrandingIron();
                    bi.ranchstone = m_rs;
                    bi.Hot        = true;
                    from.AddToBackpack(bi);
                }
                from.SendGump(new RanchStoneGump(m_rs));
            }
            else if (info.ButtonID == (int)Buttons.FencingHammer)
            {
                Container pack       = from.Backpack;
                ArrayList equipitems = new ArrayList(from.Items);
                ArrayList bagitems   = new ArrayList(pack.Items);

                int hammerTotal = 0;

                foreach (Item item in equipitems)
                {
                    if (item is FencingHammer)
                    {
                        FencingHammer hammer = (FencingHammer)item;
                        if (hammer.ranchstone == m_rs)
                        {
                            hammer.Delete();
                            hammerTotal++;
                        }
                    }
                }
                foreach (Item item in bagitems)
                {
                    if (item is FencingHammer)
                    {
                        FencingHammer hammer = (FencingHammer)item;
                        if (hammer.ranchstone == m_rs)
                        {
                            hammer.Delete();
                            hammerTotal++;
                        }
                    }
                }

                if (hammerTotal > 0)
                {
                    from.SendMessage("You return the fencing hammer.");
                }
                else
                {
                    from.SendMessage("Added a fencing hammer to your pack.");
                    FencingHammer fh = new FencingHammer();
                    fh.Identified = true;
                    fh.ranchstone = m_rs;
                    from.AddToBackpack(fh);
                }
                from.SendGump(new RanchStoneGump(m_rs));
            }
            else if (info.ButtonID == (int)Buttons.UnlockFences)
            {
                foreach (Item item in m_rs.GetItemsInRange(m_rs.Size + 1))
                {
                    if (item is FenceGate)
                    {
                        FenceGate fg = (FenceGate)item;
                        if (fg.ranchstone == m_rs)
                        {
                            fg.ranchstone = null;
                            fg.Movable    = true;
                        }
                    }
                    else if (item is BaseFence)
                    {
                        BaseFence f = (BaseFence)item;
                        if (f.ranchstone == m_rs)
                        {
                            f.ranchstone = null;
                            f.Movable    = true;
                        }
                    }
                }
                from.SendGump(new RanchStoneGump(m_rs));
            }
            else if (info.ButtonID == (int)Buttons.RanchName)
            {
                from.SendMessage("Enter new ranch name.");
                from.Prompt = new RenamePrompt(m_rs);
            }
            else if (info.ButtonID == (int)Buttons.Redeed)
            {
                RanchDeed rd = new RanchDeed();
                from.AddToBackpack(rd);
                from.SendMessage("Your ranch has been redeeded.");
                if (m_rs.Size > 10)
                {
                    for (int i = 0; i < ((m_rs.Size - 10) / 5); ++i)
                    {
                        from.AddToBackpack(new RanchExtensionDeed());
                    }
                }
                m_rs.Delete();
            }
            else if (info.ButtonID == (int)Buttons.TransferOwnership)
            {
                from.SendMessage("Target the person to transfer ownership to.");
                from.Target = new OwnershipTarget(m_rs);
            }
            else if (info.ButtonID == (int)Buttons.ReclaimAnimal)
            {
                from.SendMessage("Target the animal you wish to claim.");
                from.Target = new ClaimTarget(m_rs);
            }
            else if (info.ButtonID == (int)Buttons.TransferAnimal)
            {
                from.SendMessage("Target the animal you wish to transfer.");
                from.Target = new TransferTarget(m_rs);
            }
            else if (info.ButtonID == (int)Buttons.AbsorbRanch)
            {
                from.SendMessage("Target the ranch you wish to absorb.");
                from.Target = new AbsorbTarget(m_rs);
            }
        }