Ejemplo n.º 1
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile      m       = sender.Mobile;
            GrabOptions options = Grab.GetOptions(m);

            if (m == null || info.ButtonID <= 0 || info.ButtonID == 100)
            {
                return;
            }

            //store flags
            options.ResetFlags();

            if (info.Switches.Length > 0)
            {
                for (int i = 0; i < info.Switches.Length; i++)
                {
                    if (info.Switches[i] == 1)
                    {
                        options.SetFlag(GrabFlag.Everything, true);
                        break;
                    }

                    options.SetFlag(Grab.ParseInt32(info.Switches[i]), true);
                }
            }
            else
            {
                options.SetFlag(GrabFlag.Everything, true);
            }

            //handle buttons
            if (info.ButtonID == 105)              //OK
            {
                Grab.SaveOptions(m, options);
                m.SendMessage("You have updated your Grab options.");
            }
            else             //placement container selection
            {
                m.SendMessage("Select the container to place this type of loot in.");
                m.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, new TargetStateCallback(OnContainerSelect), info.ButtonID);
            }
        }