示例#1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1152244); // What would you like to arrest?
                from.BeginTarget(10, false, TargetFlags.None, (m, targeted) =>
                {
                    if (targeted is Raider)
                    {
                        Raider raider = targeted as Raider;

                        if (raider.InRange(m.Location, 1))
                        {
                            if (raider.TryArrest(from))
                            {
                                Delete();
                            }
                        }
                        else
                        {
                            m.SendLocalizedMessage(1152242);     // You cannot reach that.
                        }
                    }
                    else
                    {
                        m.SendLocalizedMessage(1152243);     // You cannot arrest that.
                    }
                });
            }
            else
            {
                from.SendLocalizedMessage(1116249); // That must be in your backpack for you to use it.
            }
        }