public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info == null || state == null || state.Mobile == null || this.Rewards == null)
            {
                return;
            }

            Mobile from = state.Mobile;

            switch (info.ButtonID)
            {
            case 12:
                // page up
                int nitems = 0;
                if (this.Rewards != null)
                {
                    nitems = this.Rewards.Count;
                }

                int page = this.viewpage + 1;
                if (page > (int)(nitems / this.maxItemsPerPage))
                {
                    page = (int)(nitems / this.maxItemsPerPage);
                }
                state.Mobile.SendGump(new QuestRewardGump(state.Mobile, page));
                break;

            case 13:
                // page down
                page = this.viewpage - 1;
                if (page < 0)
                {
                    page = 0;
                }
                state.Mobile.SendGump(new QuestRewardGump(state.Mobile, page));
                break;

            default:
            {
                if (info.ButtonID >= 1000)
                {
                    int selection = info.ButtonID - 1000;
                    if (selection < this.Rewards.Count)
                    {
                        XmlQuestPointsRewards r = this.Rewards[selection] as XmlQuestPointsRewards;

                        // check the price
                        if (XmlQuestPoints.HasCredits(from, r.Cost))
                        {
                            // create an instance of the reward type
                            object o = null;

                            try
                            {
                                o = Activator.CreateInstance(r.RewardType, r.RewardArgs);
                            }
                            catch
                            {
                            }

                            bool received = true;

                            if (o is Item)
                            {
                                // and give them the item
                                from.AddToBackpack((Item)o);
                            }
                            else if (o is Mobile)
                            {
                                // if it is controllable then set the buyer as master.  Note this does not check for control slot limits.
                                if (o is BaseCreature)
                                {
                                    BaseCreature b = o as BaseCreature;
                                    b.Controlled    = true;
                                    b.ControlMaster = from;
                                }

                                ((Mobile)o).MoveToWorld(from.Location, from.Map);
                            }
                            else if (o is XmlAttachment)
                            {
                                XmlAttachment a = o as XmlAttachment;

                                XmlAttach.AttachTo(from, a);
                            }
                            else
                            {
                                from.SendMessage(33, "unable to create {0}.", r.RewardType.Name);
                                received = false;
                            }

                            // complete the transaction
                            if (received)
                            {
                                // charge them
                                XmlQuestPoints.TakeCredits(from, r.Cost);
                                from.SendMessage("You have purchased {0} for {1} credits.", r.Name, r.Cost);
                            }
                        }
                        else
                        {
                            from.SendMessage("Insufficient Credits for {0}.", r.Name);
                        }
                        from.SendGump(new QuestRewardGump(from, this.viewpage));
                    }
                }
                break;
            }
            }
        }