public DefiledShrineGump(Mobile from) : base(50, 50)
        {
            m_From = from;

            int x, y;

            AddPage(0);
            AddBackground(0, 0, 585, 393, 5054);
            AddBackground(195, 36, 387, 275, 3000);
            AddHtml(0, 0, 510, 18, "<center>Defiled Shrine</center>", false, false);
            AddHtmlLocalized(60, 355, 150, 18, 1011036, false, false);               // OKAY
            AddButton(25, 355, 4005, 4007, 1, GumpButtonType.Reply, 1);
            AddHtmlLocalized(320, 355, 150, 18, 1011012, false, false);              // CANCEL
            AddButton(285, 355, 4005, 4007, 0, GumpButtonType.Reply, 2);

            y = 35;
            for (int i = 0; i < Categories.Length; i++)
            {
                DefiledRewardCategory cat = (DefiledRewardCategory)Categories[i];
                AddHtml(5, y, 150, 25, cat.Label, true, false);
                AddButton(155, y, 4005, 4007, 0, GumpButtonType.Page, i + 1);
                y += 25;
            }
            y += 5;
            AddHtml(5, y, 150, 25, "Balance: " + ((PlayerMobile)from).EvilPoints, true, false);
            y += 30;
            int points = 30 - ((PlayerMobile)from).InjuryPoints;

            AddHtml(5, y, 150, 25, "Favour: " + points + "/30", true, false);
            y += 25;
            AddHtml(5, y, 150, 25, "Worship", true, false);
            AddButton(155, y, 4005, 4007, 2, GumpButtonType.Reply, 3);

            for (int i = 0; i < Categories.Length; i++)
            {
                DefiledRewardCategory cat = (DefiledRewardCategory)Categories[i];
                AddPage(i + 1);

                for (int c = 0; c < cat.Entries.Length; c++)
                {
                    DefiledRewardEntry entry = (DefiledRewardEntry)cat.Entries[c];
                    x = 198 + (c % 3) * 129;
                    y = 38 + (c / 3) * 67;

                    AddHtml(x, y, 128, 18, entry.Label + " [" + entry.Cost + "]", false, false);
                    AddItem(x + 20, y + 25, entry.ArtID);
                    AddRadio(x, y + 20, 210, 211, false, (c << 8) + i);
                }
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            PlayerMobile pm = (PlayerMobile)m_From;

            if (info.ButtonID == 1 && info.Switches.Length > 0)               // Okay
            {
                int cnum = info.Switches[0];
                int cat  = cnum % 256;
                int ent  = cnum >> 8;

                if (cat >= 0 && cat < Categories.Length)
                {
                    if (ent >= 0 && ent < Categories[cat].Entries.Length)
                    {
                        DefiledRewardEntry entry = Categories[cat].Entries[ent];

                        if (pm.EvilPoints >= entry.Cost)
                        {
                            DefiledRewards.GiveReward(entry, pm);
                        }
                        else
                        {
                            pm.SendMessage("You must earn more of the guardian's favour.");
                        }
                    }
                }
            }
            else if (info.ButtonID == 2)               // Worshio
            {
                if (pm.InjuryPoints == 0)
                {
                    pm.SendMessage("You worship the Guardian.");
                }
                else if (pm.EvilPoints < 10)
                {
                    pm.SendMessage("You worship the Guardian, but he cares little for you.");
                }
                else
                {
                    pm.SendMessage("You beseech The Guardian for the power to continue.");
                    while (pm.EvilPoints >= 10 && pm.InjuryPoints > 0)
                    {
                        pm.EvilPoints   -= 10;
                        pm.InjuryPoints -= 1;
                    }
                }
            }
        }