Ejemplo n.º 1
0
        public ShipUpgradeGump(PlayerMobile player, ShipUpgradeGumpObject shipUpgradeGumpObject) : base(325, 150)
        {
            m_Player = player;
            m_ShipUpgradeGumpObject = shipUpgradeGumpObject;

            if (m_Player == null)
            {
                return;
            }
            if (m_Player.Deleted)
            {
                return;
            }
            if (m_ShipUpgradeGumpObject == null)
            {
                return;
            }

            BaseShip     ship     = m_ShipUpgradeGumpObject.m_Ship;
            BaseShipDeed shipDeed = m_ShipUpgradeGumpObject.m_ShipDeed;

            ShipStatsProfile shipStatsProfile = ShipUniqueness.GetShipStatsProfile(shipDeed, ship, true, true);

            int startX = 0;
            int startY = 0;

            #region Background

            AddImage(275, 9, 103);
            AddImage(275, 106, 103);
            AddImage(275, 149, 103);
            AddImage(145, 9, 103);
            AddImage(145, 106, 103);
            AddImage(146, 149, 103);
            AddImage(10, 148, 103);
            AddImage(10, 9, 103);
            AddImage(10, 106, 103);

            AddImage(20, 108, 3604, 2052);
            AddImage(145, 109, 3604, 2052);
            AddImage(20, 19, 3604, 2052);
            AddImage(140, 19, 3604, 2052);
            AddImage(236, 18, 3604, 2052);
            AddImage(280, 18, 3604, 2052);
            AddImage(236, 109, 3604, 2052);
            AddImage(280, 109, 3604, 2052);

            AddImage(33, 68, 2328);
            AddItem(82, 173, 2539);

            #endregion

            ShipUpgradeDetail upgradeDetail = null;

            bool replaceExistingUpgrade = false;

            #region Upgrade Type

            switch (m_ShipUpgradeGumpObject.m_UpgradeType)
            {
            case ShipUpgrades.UpgradeType.Theme:
                if (ship != null)
                {
                    if (ship.m_ThemeUpgrade != ShipUpgrades.ThemeType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                if (shipDeed != null)
                {
                    if (shipDeed.m_ThemeUpgrade != ShipUpgrades.ThemeType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                upgradeDetail = ShipUpgrades.GetThemeDetail(m_ShipUpgradeGumpObject.m_Theme);
                break;

            case ShipUpgrades.UpgradeType.Paint:
                if (ship != null)
                {
                    if (ship.m_PaintUpgrade != ShipUpgrades.PaintType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                if (shipDeed != null)
                {
                    if (shipDeed.m_PaintUpgrade != ShipUpgrades.PaintType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                upgradeDetail = ShipUpgrades.GetPaintDetail(m_ShipUpgradeGumpObject.m_Paint);
                break;

            case ShipUpgrades.UpgradeType.CannonMetal:
                if (ship != null)
                {
                    if (ship.m_CannonMetalUpgrade != ShipUpgrades.CannonMetalType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                if (shipDeed != null)
                {
                    if (shipDeed.m_CannonMetalUpgrade != ShipUpgrades.CannonMetalType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                upgradeDetail = ShipUpgrades.GetCannonMetalDetail(m_ShipUpgradeGumpObject.m_CannonMetal);
                break;

            case ShipUpgrades.UpgradeType.Outfitting:
                if (ship != null)
                {
                    if (ship.m_OutfittingUpgrade != ShipUpgrades.OutfittingType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                if (shipDeed != null)
                {
                    if (shipDeed.m_OutfittingUpgrade != ShipUpgrades.OutfittingType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                upgradeDetail = ShipUpgrades.GetOutfittingDetail(m_ShipUpgradeGumpObject.m_Outfitting);
                break;

            case ShipUpgrades.UpgradeType.Banner:
                if (ship != null)
                {
                    if (ship.m_BannerUpgrade != ShipUpgrades.BannerType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                if (shipDeed != null)
                {
                    if (shipDeed.m_BannerUpgrade != ShipUpgrades.BannerType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                upgradeDetail = ShipUpgrades.GetBannerDetail(m_ShipUpgradeGumpObject.m_Banner);
                break;

            case ShipUpgrades.UpgradeType.Charm:
                if (ship != null)
                {
                    if (ship.m_CharmUpgrade != ShipUpgrades.CharmType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                if (shipDeed != null)
                {
                    if (shipDeed.m_CharmUpgrade != ShipUpgrades.CharmType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                upgradeDetail = ShipUpgrades.GetCharmDetail(m_ShipUpgradeGumpObject.m_Charm);
                break;

            case ShipUpgrades.UpgradeType.MinorAbility:
                if (ship != null)
                {
                    if (ship.m_MinorAbilityUpgrade != ShipUpgrades.MinorAbilityType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                if (shipDeed != null)
                {
                    if (shipDeed.m_MinorAbilityUpgrade != ShipUpgrades.MinorAbilityType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                upgradeDetail = ShipUpgrades.GetMinorAbilityDetail(m_ShipUpgradeGumpObject.m_MinorAbility);
                break;

            case ShipUpgrades.UpgradeType.MajorAbility:
                if (ship != null)
                {
                    if (ship.m_MajorAbilityUpgrade != ShipUpgrades.MajorAbilityType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                if (shipDeed != null)
                {
                    if (shipDeed.m_MajorAbilityUpgrade != ShipUpgrades.MajorAbilityType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                upgradeDetail = ShipUpgrades.GetMajorAbilityDetail(m_ShipUpgradeGumpObject.m_MajorAbility);
                break;

            case ShipUpgrades.UpgradeType.EpicAbility:
                if (ship != null)
                {
                    if (ship.m_EpicAbilityUpgrade != ShipUpgrades.EpicAbilityType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                if (shipDeed != null)
                {
                    if (shipDeed.m_EpicAbilityUpgrade != ShipUpgrades.EpicAbilityType.None)
                    {
                        replaceExistingUpgrade = true;
                    }
                }

                upgradeDetail = ShipUpgrades.GetEpicAbilityDetail(m_ShipUpgradeGumpObject.m_EpicAbility);
                break;
            }

            #endregion

            if (upgradeDetail == null)
            {
                return;
            }

            int doubloonBaseCost = ShipUniqueness.GetShipUpgradeBaseDoubloonCost(upgradeDetail.m_UpgradeType);

            AddLabel(143, 20, 149, "Ship Outfitting Upgrade");
            AddLabel(Utility.CenteredTextOffset(210, upgradeDetail.m_UpgradeName), 40, WhiteTextHue, upgradeDetail.m_UpgradeName);

            AddLabel(26, 170, 149, "Base Cost:");
            AddLabel(114, 170, WhiteTextHue, doubloonBaseCost.ToString());

            double doubloonMultiplier = shipStatsProfile.UpgradeDoubloonMultiplier;

            if (m_ShipUpgradeGumpObject.m_UpgradeDisplayMode == UpgradeDisplayMode.DeedAttemptInstall || m_ShipUpgradeGumpObject.m_UpgradeDisplayMode == UpgradeDisplayMode.InstalledOnShip)
            {
                if (replaceExistingUpgrade && m_ShipUpgradeGumpObject.m_UpgradeDisplayMode == UpgradeDisplayMode.DeedAttemptInstall)
                {
                    AddLabel(26, 190, 149, "Will Replace Existing Upgrade");
                    AddLabel(213, 190, 2550, "(at no cost)");
                }

                else
                {
                    AddLabel(26, 190, 149, "Ship Type Multiplier:");
                    AddLabel(151, 190, WhiteTextHue, Utility.CreateDecimalString(doubloonMultiplier, 1) + "x");
                }

                int doubloonAdjustedCost = (int)(Math.Round((double)doubloonBaseCost * (double)doubloonMultiplier));

                if (replaceExistingUpgrade && m_ShipUpgradeGumpObject.m_UpgradeDisplayMode == UpgradeDisplayMode.DeedAttemptInstall)
                {
                    doubloonAdjustedCost = 0;
                }

                AddLabel(26, 210, 149, "Adjusted Cost:");
                AddItem(112, 213, 2539);
                AddLabel(143, 210, 63, doubloonAdjustedCost.ToString());
            }

            startY = 65;
            int rowSpacing = 20;

            for (int a = 0; a < upgradeDetail.m_SpecialEffects.Count; a++)
            {
                KeyValuePair <string, ShipUpgradeDetail.UpgradeEffectType> descriptionLine = upgradeDetail.m_SpecialEffects[a];

                AddLabel(125, startY, upgradeDetail.GetHue(descriptionLine.Value), descriptionLine.Key);
                startY += rowSpacing;
            }

            int offsetX = -32;
            int offsetY = -22;

            AddGumpCollection(GumpCollections.GetGumpCollection(upgradeDetail.GumpCollectionId, -1), offsetX + 33, offsetY + 68);

            //Guide
            AddButton(6, 7, 2094, 2095, 0, GumpButtonType.Reply, 0);
            AddLabel(1, -2, 149, "Guide");

            switch (m_ShipUpgradeGumpObject.m_UpgradeDisplayMode)
            {
            case UpgradeDisplayMode.DeedUse:
                AddLabel(250, 209, 63, "Select Target Ship");
                AddButton(372, 206, 2151, 2151, 2, GumpButtonType.Reply, 0);
                break;

            case UpgradeDisplayMode.DeedAttemptInstall:
                AddLabel(211, 209, 63, "Confirm Ship Installation");
                AddButton(372, 206, 2151, 2151, 2, GumpButtonType.Reply, 0);
                break;

            case UpgradeDisplayMode.InstalledOnShip:
                break;
            }
        }
        public EnhancementsGump(PlayerMobile player, EnhancementsGumpObject enhancementsGumpObject) : base(10, 10)
        {
            m_Player = player;
            m_EnhancementsGumpObject = enhancementsGumpObject;

            if (m_Player == null)
            {
                return;
            }
            if (m_EnhancementsGumpObject == null)
            {
                return;
            }

            EnhancementsPersistance.CheckAndCreateEnhancementsAccountEntry(m_Player);

            List <Enhancements.CustomizationEntry> m_Customizations = m_Player.m_EnhancementsAccountEntry.m_Customizations;
            List <Enhancements.SpellHueEntry>      m_SpellHues      = m_Player.m_EnhancementsAccountEntry.m_SpellHues;
            List <Enhancements.EmoteEntry>         m_Emotes         = m_Player.m_EnhancementsAccountEntry.m_Emotes;

            #region Background

            AddImage(148, 110, 103);
            AddImage(149, 153, 103);
            AddImage(149, 239, 103);
            AddImage(149, 329, 103);
            AddImage(151, 415, 103, 2401);
            AddImage(14, 415, 103, 2401);
            AddImage(14, 238, 103, 2401);
            AddImage(148, 13, 103, 2401);
            AddImage(13, 152, 103, 2401);
            AddImage(14, 12, 103, 2401);
            AddImage(14, 109, 103, 2401);
            AddImage(23, 112, 3604, 2052);
            AddImage(149, 112, 3604, 2052);
            AddImage(23, 23, 3604, 2052);
            AddImage(149, 23, 3604, 2052);
            AddImage(14, 328, 103, 2401);
            AddImage(23, 199, 3604, 2052);
            AddImage(149, 199, 3604, 2052);
            AddImage(23, 291, 3604, 2052);
            AddImage(149, 291, 3604, 2052);
            AddImage(23, 377, 3604, 2052);
            AddImage(149, 377, 3604, 2052);
            AddImage(280, 110, 103);
            AddImage(281, 153, 103);
            AddImage(281, 239, 103);
            AddImage(281, 329, 103);
            AddImage(282, 415, 103, 2401);
            AddImage(280, 13, 103, 2401);
            AddImage(412, 110, 103, 2401);
            AddImage(413, 153, 103, 2401);
            AddImage(413, 239, 103, 2401);
            AddImage(413, 329, 103, 2401);
            AddImage(414, 415, 103, 2401);
            AddImage(412, 13, 103, 2401);
            AddImage(273, 112, 3604, 2052);
            AddImage(273, 23, 3604, 2052);
            AddImage(273, 199, 3604, 2052);
            AddImage(273, 291, 3604, 2052);
            AddImage(273, 376, 3604, 2052);
            AddImage(381, 112, 3604, 2052);
            AddImage(381, 23, 3604, 2052);
            AddImage(381, 199, 3604, 2052);
            AddImage(381, 291, 3604, 2052);
            AddImage(381, 376, 3604, 2052);
            AddImage(415, 112, 3604, 2052);
            AddImage(415, 23, 3604, 2052);
            AddImage(415, 199, 3604, 2052);
            AddImage(415, 291, 3604, 2052);
            AddImage(415, 377, 3604, 2052);

            #endregion

            //Header
            AddImage(150, 3, 1143, 2499);
            AddLabel(239, 5, 2590, "Enhancements");

            //Guide
            AddButton(13, 9, 2094, 2095, 1, GumpButtonType.Reply, 0);
            AddLabel(7, -1, 149, "Guide");

            #region Footers

            #region Images

            AddImage(23, 457, 96, 2401);
            AddImage(178, 457, 96, 2401);
            AddImage(245, 457, 96, 2401);
            AddImage(23, 456, 96, 2401);
            AddImage(178, 456, 96, 2401);
            AddImage(245, 456, 96, 2401);
            AddImage(296, 457, 96, 2401);
            AddImage(364, 457, 96, 2401);
            AddImage(296, 456, 96, 2401);
            AddImage(364, 456, 96, 2401);
            AddItem(411, 465, 4810, 2500);
            AddItem(210, 371, 14094, 2963);
            AddItem(26, 458, 8312, 2500);

            #endregion

            if (m_EnhancementsGumpObject.m_PageType == PageType.Customizations)
            {
                AddButton(64, 468, 9724, 9721, 2, GumpButtonType.Reply, 0);
            }
            else
            {
                AddButton(64, 468, 9721, 9724, 2, GumpButtonType.Reply, 0);
            }
            AddLabel(98, 476, 2603, "Customizations");

            if (m_EnhancementsGumpObject.m_PageType == PageType.SpellHues)
            {
                AddButton(270, 470, 9724, 9721, 3, GumpButtonType.Reply, 0);
            }
            else
            {
                AddButton(270, 470, 9721, 9724, 3, GumpButtonType.Reply, 0);
            }
            AddLabel(304, 473, 2606, "Spell Hues");

            if (m_EnhancementsGumpObject.m_PageType == PageType.Emotes)
            {
                AddButton(444, 470, 9724, 9721, 4, GumpButtonType.Reply, 0);
            }
            else
            {
                AddButton(444, 470, 9721, 9724, 4, GumpButtonType.Reply, 0);
            }
            AddLabel(480, 473, 2599, "Emotes");

            #endregion

            switch (m_EnhancementsGumpObject.m_PageType)
            {
                #region Customizations

            case PageType.Customizations:
                int customizationStartIndex = m_EnhancementsGumpObject.m_Page * EntriesPerCustomizationPage;
                int customizationCount      = Enum.GetNames(typeof(Enhancements.CustomizationType)).Length;

                int totalCustomizationPages = (int)(Math.Ceiling((double)customizationCount / (double)EntriesPerCustomizationPage));

                if (m_EnhancementsGumpObject.m_Page < 0)
                {
                    m_EnhancementsGumpObject.m_Page = 0;
                }

                if (m_EnhancementsGumpObject.m_Page >= totalCustomizationPages)
                {
                    m_EnhancementsGumpObject.m_Page = totalCustomizationPages - 1;
                }

                int leftStartX = 35;
                int leftStartY = 35;

                int rightStartX = 300;
                int rightStartY = 35;

                int rowSpacing = 130;

                for (int a = 0; a < EntriesPerCustomizationPage; a++)
                {
                    int customizationIndex = customizationStartIndex + a;

                    if (customizationIndex >= customizationCount)
                    {
                        continue;
                    }

                    Enhancements.CustomizationType   customizationType   = (Enhancements.CustomizationType)customizationIndex;
                    Enhancements.CustomizationEntry  customizationEntry  = Enhancements.GetCustomizationEntry(m_Player, customizationType);
                    Enhancements.CustomizationDetail customizationDetail = Enhancements.GetCustomizationDetail(customizationType);

                    if (customizationEntry == null)
                    {
                        customizationEntry = new Enhancements.CustomizationEntry(customizationType, false, false);
                    }

                    List <Enhancements.SpellHueType> m_AvailableHues = new List <Enhancements.SpellHueType>();

                    m_AvailableHues.Add(Enhancements.SpellHueType.Standard);

                    //Left Side
                    if (a < (EntriesPerCustomizationPage / 2))
                    {
                        if (customizationEntry.m_Unlocked)
                        {
                            if (customizationEntry.m_Active)
                            {
                                AddLabel(leftStartX + 129, leftStartY + 16, 63, customizationDetail.m_CustomizationName);
                                AddLabel(leftStartX + 156, leftStartY + 74, 63, "Active");

                                AddButton(leftStartX + 121, leftStartY + 71, 2154, 2151, 10 + a, GumpButtonType.Reply, 0);
                            }

                            else
                            {
                                AddLabel(leftStartX + 129, leftStartY + 16, 149, customizationDetail.m_CustomizationName);
                                AddLabel(leftStartX + 156, leftStartY + 74, 149, "Inactive");

                                AddButton(leftStartX + 121, leftStartY + 71, 2151, 2154, 10 + a, GumpButtonType.Reply, 0);
                            }
                        }

                        else
                        {
                            AddLabel(leftStartX + 129, leftStartY + 16, 149, customizationDetail.m_CustomizationName);
                            AddLabel(leftStartX + 156, leftStartY + 74, 2401, "Not Acquired");

                            AddButton(leftStartX + 121, leftStartY + 71, 9721, 9721, 10 + a, GumpButtonType.Reply, 0);
                        }

                        AddBackground(leftStartX + 0, leftStartY + 0, 122, 122, 9270);
                        AddImageTiled(leftStartX + 12, leftStartY + 12, 100, 100, 2624);
                        AddLabel(leftStartX + 156, leftStartY + 41, 2550, "Info");
                        AddButton(leftStartX + 129, leftStartY + 44, 2117, 2118, 20 + a, GumpButtonType.Reply, 0);

                        AddGumpCollection(GumpCollections.GetGumpCollection(customizationDetail.GumpCollectionId, -1), leftStartX, leftStartY);

                        leftStartY += rowSpacing;
                    }

                    //Right Side
                    else
                    {
                        if (customizationEntry.m_Unlocked)
                        {
                            if (customizationEntry.m_Active)
                            {
                                AddLabel(rightStartX + 129, rightStartY + 16, 63, customizationDetail.m_CustomizationName);
                                AddLabel(rightStartX + 156, rightStartY + 74, 63, "Active");

                                AddButton(rightStartX + 121, rightStartY + 71, 2154, 2151, 10 + a, GumpButtonType.Reply, 0);
                            }

                            else
                            {
                                AddLabel(rightStartX + 129, rightStartY + 16, 149, customizationDetail.m_CustomizationName);
                                AddLabel(rightStartX + 156, rightStartY + 74, 149, "Inactive");

                                AddButton(rightStartX + 121, rightStartY + 71, 2151, 2154, 10 + a, GumpButtonType.Reply, 0);
                            }
                        }

                        else
                        {
                            AddLabel(rightStartX + 129, rightStartY + 16, 149, customizationDetail.m_CustomizationName);
                            AddLabel(rightStartX + 156, rightStartY + 74, 2401, "Not Acquired");

                            AddButton(rightStartX + 121, rightStartY + 71, 9721, 9721, 10 + a, GumpButtonType.Reply, 0);
                        }

                        AddBackground(rightStartX + 0, rightStartY + 0, 122, 122, 9270);
                        AddImageTiled(rightStartX + 12, rightStartY + 12, 100, 100, 2624);
                        AddLabel(rightStartX + 156, rightStartY + 41, 2550, "Info");
                        AddButton(rightStartX + 129, rightStartY + 44, 2117, 2118, 20 + a, GumpButtonType.Reply, 0);

                        AddGumpCollection(GumpCollections.GetGumpCollection(customizationDetail.GumpCollectionId, -1), rightStartX, rightStartY);

                        rightStartY += rowSpacing;
                    }
                }

                if (m_EnhancementsGumpObject.m_Page > 0)
                {
                    AddButton(37, 428, 4014, 4016, 5, GumpButtonType.Reply, 0);
                    AddLabel(71, 429, WhiteTextHue, "Previous Page");
                }

                if (m_EnhancementsGumpObject.m_Page < totalCustomizationPages - 1)
                {
                    AddButton(497, 428, 4005, 4007, 6, GumpButtonType.Reply, 0);
                    AddLabel(427, 429, WhiteTextHue, "Next Page");
                }

                break;

                #endregion

                #region Spell Hues

            case PageType.SpellHues:
                int spellHuesStartIndex = m_EnhancementsGumpObject.m_Page * EntriesPerSpellHuePage;
                int spellHuesCount      = Enum.GetNames(typeof(Enhancements.SpellType)).Length;

                int totalSpellHuesPages = (int)(Math.Ceiling((double)spellHuesCount / (double)EntriesPerSpellHuePage));

                if (m_EnhancementsGumpObject.m_Page < 0)
                {
                    m_EnhancementsGumpObject.m_Page = 0;
                }

                if (m_EnhancementsGumpObject.m_Page >= totalSpellHuesPages)
                {
                    m_EnhancementsGumpObject.m_Page = totalSpellHuesPages - 1;
                }

                leftStartX = 65;
                leftStartY = 65;

                rightStartX = 325;
                rightStartY = 65;

                rowSpacing = 130;

                for (int a = 0; a < EntriesPerSpellHuePage; a++)
                {
                    int spellHueIndex = spellHuesStartIndex + a;

                    if (spellHueIndex >= spellHuesCount)
                    {
                        continue;
                    }

                    Enhancements.SpellType       spellType      = (Enhancements.SpellType)spellHueIndex;
                    Enhancements.SpellHueEntry   spellHueEntry  = Enhancements.GetSpellHueEntry(m_Player, spellType);
                    Enhancements.SpellTypeDetail spellHueDetail = Enhancements.GetSpellTypeDetail(spellType);

                    if (spellHueEntry == null)
                    {
                        spellHueEntry = new Enhancements.SpellHueEntry(spellType);
                    }

                    Enhancements.SpellHueTypeDetail spellHueTypeDetail = Enhancements.GetSpellHueTypeDetail(spellHueEntry.m_SelectedHue);

                    List <Enhancements.SpellHueType> m_AvailableSpellHues = new List <Enhancements.SpellHueType>();

                    m_AvailableSpellHues.Add(Enhancements.SpellHueType.Standard);

                    for (int b = 0; b < spellHueEntry.m_UnlockedHues.Count; b++)
                    {
                        if (spellHueEntry.m_UnlockedHues[b] == null)
                        {
                            continue;
                        }

                        m_AvailableSpellHues.Add(spellHueEntry.m_UnlockedHues[b]);
                    }

                    int spellHueTypeIndex = -1;

                    spellHueTypeIndex = m_AvailableSpellHues.IndexOf(spellHueEntry.m_SelectedHue);

                    //Left Side
                    if (a < (EntriesPerSpellHuePage / 2))
                    {
                        if (m_AvailableSpellHues.Count > 1)
                        {
                            if (spellHueTypeIndex > 0)
                            {
                                AddButton(leftStartX + 5, leftStartY + 66, 9909, 9909, 10 + a, GumpButtonType.Reply, 0);
                            }

                            if (spellHueTypeIndex < m_AvailableSpellHues.Count - 1)
                            {
                                AddButton(leftStartX + 40, leftStartY + 65, 9903, 9903, 20 + a, GumpButtonType.Reply, 0);
                            }
                        }

                        AddBackground(leftStartX + 0, leftStartY + 0, 64, 61, 9270);
                        AddItem(leftStartX + 10, leftStartY + 9, spellHueDetail.m_ItemID, spellHueTypeDetail.m_IconHue);

                        AddLabel(leftStartX + 66, leftStartY + -1, 149, spellHueDetail.m_SpellName);
                        AddLabel(leftStartX + 66, leftStartY + 19, spellHueTypeDetail.m_TextHue, spellHueTypeDetail.m_SpellHueTypeName);
                        AddLabel(leftStartX + 66, leftStartY + 39, WhiteTextHue, "Hue: ");
                        AddLabel(leftStartX + 96, leftStartY + 39, spellHueTypeDetail.m_TextHue, spellHueTypeDetail.m_SpellHue.ToString());

                        if (m_AvailableSpellHues.Count > 1)
                        {
                            AddLabel(leftStartX + 66, leftStartY + 66, WhiteTextHue, "Selected: " + (spellHueTypeIndex + 1).ToString() + " / " + m_AvailableSpellHues.Count.ToString());
                        }

                        leftStartY += rowSpacing;
                    }

                    //Right Side
                    else
                    {
                        if (m_AvailableSpellHues.Count > 1)
                        {
                            if (spellHueTypeIndex > 0)
                            {
                                AddButton(rightStartX + 5, rightStartY + 66, 9909, 9909, 10 + a, GumpButtonType.Reply, 0);
                            }

                            if (spellHueTypeIndex < m_AvailableSpellHues.Count - 1)
                            {
                                AddButton(rightStartX + 40, rightStartY + 65, 9903, 9903, 20 + a, GumpButtonType.Reply, 0);
                            }
                        }

                        AddBackground(rightStartX + 0, rightStartY + 0, 64, 61, 9270);
                        AddItem(rightStartX + 10, rightStartY + 9, spellHueDetail.m_ItemID, spellHueTypeDetail.m_IconHue);

                        AddLabel(rightStartX + 66, rightStartY + -1, 149, spellHueDetail.m_SpellName);
                        AddLabel(rightStartX + 66, rightStartY + 19, spellHueTypeDetail.m_TextHue, spellHueTypeDetail.m_SpellHueTypeName);
                        AddLabel(rightStartX + 66, rightStartY + 39, WhiteTextHue, "Hue: ");
                        AddLabel(rightStartX + 96, rightStartY + 39, spellHueTypeDetail.m_TextHue, spellHueTypeDetail.m_SpellHue.ToString());

                        if (m_AvailableSpellHues.Count > 1)
                        {
                            AddLabel(rightStartX + 66, rightStartY + 66, WhiteTextHue, "Selected: " + (spellHueTypeIndex + 1).ToString() + " / " + m_AvailableSpellHues.Count.ToString());
                        }

                        rightStartY += rowSpacing;
                    }
                }

                if (m_EnhancementsGumpObject.m_Page > 0)
                {
                    AddButton(37, 428, 4014, 4016, 5, GumpButtonType.Reply, 0);
                    AddLabel(71, 429, WhiteTextHue, "Previous Page");
                }

                if (m_EnhancementsGumpObject.m_Page < totalSpellHuesPages - 1)
                {
                    AddButton(497, 428, 4005, 4007, 6, GumpButtonType.Reply, 0);
                    AddLabel(427, 429, WhiteTextHue, "Next Page");
                }
                break;

                #endregion

                #region Emotes

            case PageType.Emotes:
                int emoteStartIndex = m_EnhancementsGumpObject.m_Page * EntriesPerEmotePage;
                int emoteCount      = Enum.GetNames(typeof(Enhancements.EmoteType)).Length;

                int totalEmotesPages = (int)(Math.Ceiling((double)emoteCount / (double)EntriesPerEmotePage));

                if (m_EnhancementsGumpObject.m_Page < 0)
                {
                    m_EnhancementsGumpObject.m_Page = 0;
                }

                if (m_EnhancementsGumpObject.m_Page >= totalEmotesPages)
                {
                    m_EnhancementsGumpObject.m_Page = totalEmotesPages - 1;
                }

                leftStartX = 75;
                leftStartY = 35;

                rightStartX = 320;
                rightStartY = 35;

                rowSpacing = 100;

                for (int a = 0; a < EntriesPerEmotePage; a++)
                {
                    int emoteIndex = emoteStartIndex + a;

                    if (emoteIndex >= emoteCount)
                    {
                        continue;
                    }

                    Enhancements.EmoteType   emoteType   = (Enhancements.EmoteType)emoteIndex;
                    Enhancements.EmoteEntry  emoteEntry  = Enhancements.GetEmoteEntry(m_Player, emoteType);
                    Enhancements.EmoteDetail emoteDetail = Enhancements.GetEmoteDetail(emoteType);

                    if (emoteEntry == null)
                    {
                        emoteEntry = new Enhancements.EmoteEntry(emoteType, false);
                    }

                    //Left Side
                    if (a < (EntriesPerEmotePage / 2))
                    {
                        AddLabel(leftStartX + 89, leftStartY + 17, emoteDetail.m_Hue, emoteDetail.m_EmoteName);

                        if (emoteEntry.m_Unlocked)
                        {
                            AddImage(leftStartX + 0, leftStartY + 0, 1417, 63);
                            AddLabel(leftStartX + 89, leftStartY + 37, 63, "Unlocked");
                        }

                        else
                        {
                            AddImage(leftStartX + 0, leftStartY + 0, 1417, 0);
                            AddLabel(leftStartX + 89, leftStartY + 37, 2401, "Not Acquired");
                        }

                        AddImage(leftStartX + 10, leftStartY + 9, 5576, emoteDetail.m_Hue);

                        leftStartY += rowSpacing;
                    }

                    //Right Side
                    else
                    {
                        AddLabel(rightStartX + 89, rightStartY + 17, emoteDetail.m_Hue, emoteDetail.m_EmoteName);

                        if (emoteEntry.m_Unlocked)
                        {
                            AddImage(rightStartX + 0, rightStartY + 0, 1417, 63);
                            AddLabel(rightStartX + 89, rightStartY + 37, 63, "Unlocked");
                        }

                        else
                        {
                            AddImage(rightStartX + 0, rightStartY + 0, 1417, 0);
                            AddLabel(rightStartX + 89, rightStartY + 37, 2401, "Not Acquired");
                        }

                        AddImage(rightStartX + 10, rightStartY + 9, 5576, emoteDetail.m_Hue);

                        rightStartY += rowSpacing;
                    }
                }

                if (m_EnhancementsGumpObject.m_Page > 0)
                {
                    AddButton(37, 428, 4014, 4016, 5, GumpButtonType.Reply, 0);
                    AddLabel(71, 429, WhiteTextHue, "Previous Page");
                }

                if (m_EnhancementsGumpObject.m_Page < totalEmotesPages - 1)
                {
                    AddButton(497, 428, 4005, 4007, 6, GumpButtonType.Reply, 0);
                    AddLabel(427, 429, WhiteTextHue, "Next Page");
                }
                break;

                #endregion
            }
        }
        public AchievementsGump(Mobile from, PageType selectedPageType, int mainPage, AchievementCategory achievementCategory, int achievementListPage, int achievementSelectedIndex) : base(10, 10)
        {
            m_Player = from as PlayerMobile;

            if (m_Player == null)
            {
                return;
            }

            AchievementsPersistance.CheckAndCreateAchievementAccountEntry(m_Player);

            m_SelectedPageType         = selectedPageType;
            m_MainPage                 = mainPage;
            m_AchievementCategory      = achievementCategory;
            m_AchievementListPage      = achievementListPage;
            m_AchievementSelectedIndex = achievementSelectedIndex;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            int WhiteTextHue  = 2655;
            int GreenTextHue  = 63;
            int YellowTextHue = 2550;
            int GreyTextHue   = 1102;

            int startX = 0;
            int startY = 0;

            AddPage(0);

            int totalPages;

            #region Background

            AddImage(409, 8, 103, 2401);
            AddImage(142, 105, 103);
            AddImage(143, 148, 103);
            AddImage(143, 234, 103);
            AddImage(143, 324, 103);
            AddImage(145, 410, 103, 2401);
            AddImage(8, 410, 103, 2401);
            AddImage(8, 233, 103, 2401);
            AddImage(142, 8, 103, 2401);
            AddImage(7, 147, 103, 2401);
            AddImage(8, 7, 103, 2401);
            AddImage(8, 104, 103, 2401);
            AddImage(17, 107, 3604, 2052);
            AddImage(143, 107, 3604, 2052);
            AddImage(17, 18, 3604, 2052);
            AddImage(143, 18, 3604, 2052);
            AddImage(8, 323, 103, 2401);
            AddImage(17, 194, 3604, 2052);
            AddImage(143, 194, 3604, 2052);
            AddImage(17, 286, 3604, 2052);
            AddImage(143, 286, 3604, 2052);
            AddImage(17, 370, 3604, 2052);
            AddImage(143, 370, 3604, 2052);
            AddImage(274, 105, 103);
            AddImage(275, 148, 103);
            AddImage(275, 234, 103);
            AddImage(275, 324, 103);
            AddImage(276, 410, 103, 2401);
            AddImage(274, 8, 103, 2401);
            AddImage(409, 91, 103, 2401);
            AddImage(409, 182, 103, 2401);
            AddImage(409, 261, 103, 2401);
            AddImage(409, 354, 103, 2401);
            AddImage(409, 410, 103, 2401);
            AddImage(267, 107, 3604, 2052);
            AddImage(267, 18, 3604, 2052);
            AddImage(267, 194, 3604, 2052);
            AddImage(267, 286, 3604, 2052);
            AddImage(267, 370, 3604, 2052);
            AddImage(375, 107, 3604, 2052);
            AddImage(375, 18, 3604, 2052);
            AddImage(375, 194, 3604, 2052);
            AddImage(375, 286, 3604, 2052);
            AddImage(375, 370, 3604, 2052);
            AddImage(411, 107, 3604, 2052);
            AddImage(411, 18, 3604, 2052);
            AddImage(411, 194, 3604, 2052);
            AddImage(411, 286, 3604, 2052);
            AddImage(412, 370, 3604, 2052);

            #endregion

            //Header
            AddImage(144, -2, 1143, 2499);
            AddLabel(235, 0, 2606, "Achievements");

            //Guide
            AddButton(7, 8, 2094, 2095, 1, GumpButtonType.Reply, 0);
            AddLabel(3, -2, 149, "Guide");

            switch (m_SelectedPageType)
            {
                #region Main

            case PageType.Main:
                int categoriesPerPage  = categoryRows * categoryColumns;
                int totalCategories    = Enum.GetNames(typeof(AchievementCategory)).Length;
                int totalCategoryPages = (int)(Math.Ceiling((double)totalCategories / (double)categoriesPerPage));

                if (m_MainPage >= totalCategoryPages)
                {
                    m_MainPage = 0;
                }

                if (m_MainPage < 0)
                {
                    m_MainPage = 0;
                }

                int categoryStartIndex = m_MainPage * categoriesPerPage;
                int categoryEndIndex   = (m_MainPage * categoriesPerPage) + (categoriesPerPage - 1);

                if (categoryEndIndex >= totalCategories)
                {
                    categoryEndIndex = totalCategories - 1;
                }

                int totalCompletedAchievements = Achievements.GetCompletedAchievementCount(m_Player);
                int totalAchievementsAvailable = Achievements.GetTotalAchievementsCount();

                //Previous
                if (m_MainPage > 0)
                {
                    AddLabel(57, 472, WhiteTextHue, "Previous Page");
                    AddButton(23, 471, 4014, 4016, 2, GumpButtonType.Reply, 0);
                }

                //Next
                if (m_MainPage < totalCategoryPages - 1)
                {
                    AddButton(502, 471, 4005, 4007, 3, GumpButtonType.Reply, 0);
                    AddLabel(432, 472, WhiteTextHue, "Next Page");
                }

                //Settings
                AddButton(243, 471, 4029, 4031, 4, GumpButtonType.Reply, 0);
                AddLabel(277, 472, 63, "Settings");

                int textHue = GreyTextHue;

                if (totalCompletedAchievements > 0)
                {
                    textHue = YellowTextHue;
                }

                if (totalCompletedAchievements == totalAchievementsAvailable)
                {
                    textHue = GreenTextHue;
                }

                AddLabel(175, 447, 149, "Total");
                AddLabel(332, 447, textHue, totalCompletedAchievements.ToString() + "/" + totalAchievementsAvailable.ToString());

                double totalAchievementProgress = (double)totalCompletedAchievements / (double)totalAchievementsAvailable;

                AddImage(216, 452, Achievements.GetProgressBarBackground(totalAchievementProgress));
                AddImageTiled(216 + Utility.ProgressBarX(totalAchievementProgress), 455, Utility.ProgressBarWidth(totalAchievementProgress), 7, 2488);

                int iBaseX = 25;
                int iBaseY = 30;

                startX = iBaseX;
                startY = iBaseY;

                int columnIndex = 0;
                int rowIndex    = 0;

                int rowSpacing    = 140;
                int columnSpacing = 125;

                int categoryDisplayCount = categoryEndIndex - categoryStartIndex;

                for (int a = 0; a < categoryDisplayCount + 1; a++)
                {
                    int categoryIndex = categoryStartIndex + a;
                    int buttonIndex   = 10 + categoryIndex;

                    if (categoryStartIndex >= totalCategories)
                    {
                        continue;
                    }

                    AchievementCategory       category = (AchievementCategory)categoryIndex;
                    AchievementCategoryDetail achievementCategoryDetail = Achievements.GetCategoryDetail(category);

                    AddGumpCollection(GumpCollections.GetGumpCollection(achievementCategoryDetail.GumpCollectionGroupId, achievementCategoryDetail.GumpCollectionItemId), startX - 40, startY + 8);

                    AddLabel(Utility.CenteredTextOffset(startX + 65, achievementCategoryDetail.m_CategoryName), startY + 5, achievementCategoryDetail.m_TextHue, achievementCategoryDetail.m_CategoryName);
                    AddImage(startX + 60, startY + 32, 10550, achievementCategoryDetail.m_IconHue);
                    AddImage(startX + 88, startY + 32, 10552, achievementCategoryDetail.m_IconHue);
                    AddButton(startX + 74, startY + 46, 9721, 9721, buttonIndex, GumpButtonType.Reply, 0);

                    //Category Progress
                    int completedAchievementsInCategory = Achievements.GetCompletedCategoryAchievements(m_Player, category);
                    int achievementsInCategory          = Achievements.GetCategoryAchievements(category).Count;

                    textHue = GreyTextHue;

                    if (completedAchievementsInCategory > 0)
                    {
                        textHue = YellowTextHue;
                    }

                    if (completedAchievementsInCategory == achievementsInCategory)
                    {
                        textHue = GreenTextHue;
                    }

                    double categoryAchievementProgress = (double)completedAchievementsInCategory / (double)achievementsInCategory;

                    string progressText = completedAchievementsInCategory.ToString() + "/" + achievementsInCategory.ToString();

                    AddImage(startX + 10, startY + 99, Achievements.GetProgressBarBackground(totalAchievementProgress));
                    AddImageTiled(startX + 10 + Utility.ProgressBarX(totalAchievementProgress), startY + 102, Utility.ProgressBarWidth(totalAchievementProgress), 7, 2488);
                    AddLabel(Utility.CenteredTextOffset(startX + 60, progressText), startY + 113, textHue, progressText);

                    startX += columnSpacing;
                    columnIndex++;

                    if (columnIndex >= categoryColumns)
                    {
                        columnIndex = 0;
                        rowIndex++;

                        startX  = iBaseX;
                        startY += rowSpacing;
                    }
                }
                break;

                #endregion

                #region Category

            case PageType.Category:
                List <Achievement> m_AchievementsInCategory = Achievements.GetCategoryAchievements(m_AchievementCategory);

                AchievementCategoryDetail categoryDetail = Achievements.GetCategoryDetail(m_AchievementCategory);

                if (m_AchievementsInCategory.Count == 0)
                {
                    return;
                }

                if (m_AchievementSelectedIndex >= m_AchievementsInCategory.Count)
                {
                    m_AchievementSelectedIndex = 0;
                }

                Achievement achievementSelected = m_AchievementsInCategory[m_AchievementSelectedIndex];

                int achievementsPerPage   = 12;
                int totalAchievements     = m_AchievementsInCategory.Count;
                int totalAchievementPages = (int)(Math.Ceiling((double)totalAchievements / (double)achievementsPerPage));

                if (m_AchievementListPage >= totalAchievementPages)
                {
                    m_AchievementListPage = 0;
                }

                if (m_AchievementListPage < 0)
                {
                    m_AchievementListPage = 0;
                }

                int achievementStartIndex = m_AchievementListPage * achievementsPerPage;
                int achievementEndIndex   = (m_AchievementListPage * achievementsPerPage) + (achievementsPerPage - 1);

                if (achievementEndIndex >= totalAchievements)
                {
                    achievementEndIndex = totalAchievements - 1;
                }

                int achievementCount = achievementEndIndex - achievementStartIndex;

                //Return to Categories
                AddButton(23, 471, 4014, 4016, 5, GumpButtonType.Reply, 0);
                AddLabel(57, 472, 149, "Categories");

                //Previous List Page
                if (m_AchievementListPage > 0)
                {
                    AddButton(172, 471, 9909, 9909, 3, GumpButtonType.Reply, 0);
                }

                if (m_AchievementListPage > 0 || m_AchievementListPage < totalAchievementPages - 1)
                {
                    AddLabel(201, 472, 149, "More");
                }

                //Next List Page
                if (m_AchievementListPage < totalAchievementPages - 1)
                {
                    AddButton(239, 471, 9903, 9903, 4, GumpButtonType.Reply, 0);
                }

                //Category
                startX = 25;
                startY = 30;

                int playerCompletedAchievementsInCategory = Achievements.GetCompletedCategoryAchievements(m_Player, m_AchievementCategory);
                int totalAchievementsInCategory           = m_AchievementsInCategory.Count;

                textHue = GreyTextHue;

                if (playerCompletedAchievementsInCategory > 0)
                {
                    textHue = YellowTextHue;
                }

                if (playerCompletedAchievementsInCategory == m_AchievementsInCategory.Count)
                {
                    textHue = GreenTextHue;
                }

                double playerCategoryAchievementProgress = (double)playerCompletedAchievementsInCategory / (double)totalAchievementsInCategory;

                string categoryProgressText = playerCompletedAchievementsInCategory.ToString() + "/" + totalAchievementsInCategory.ToString();

                startX = 25;
                startY = 30;

                //Category Image
                AddGumpCollection(GumpCollections.GetGumpCollection(categoryDetail.GumpCollectionGroupId, categoryDetail.GumpCollectionItemId), startX - 40, startY + 8);

                AddLabel(Utility.CenteredTextOffset(startX + 65, categoryDetail.m_CategoryName), startY + 5, categoryDetail.m_TextHue, categoryDetail.m_CategoryName);
                AddImage(startX + 60, startY + 32, 10550, categoryDetail.m_IconHue);
                AddImage(startX + 88, startY + 32, 10552, categoryDetail.m_IconHue);

                //Category Progress
                AddImage(startX + 10, startY + 99, Achievements.GetProgressBarBackground(playerCategoryAchievementProgress));
                AddImageTiled(startX + 10 + Utility.ProgressBarX(playerCategoryAchievementProgress), startY + 102, Utility.ProgressBarWidth(playerCategoryAchievementProgress), 7, 2488);
                AddLabel(Utility.CenteredTextOffset(startX + 60, categoryProgressText), startY + 113, textHue, categoryProgressText);

                startX = 3;
                startY = 165;

                int achievementSpacing = 25;

                for (int a = 0; a < achievementCount + 1; a++)
                {
                    int achievementIndex = achievementStartIndex + a;
                    int buttonIndex      = 10 + achievementIndex;

                    if (achievementStartIndex >= totalAchievements)
                    {
                        continue;
                    }

                    Achievement achievement = m_AchievementsInCategory[achievementIndex];

                    AchievementDetail achievementDetail = Achievements.GetAchievementDetail(achievement);
                    AchievementEntry  achievementEntry  = Achievements.GetAchievementEntry(m_Player, achievement);

                    if (achievementDetail != null && achievementEntry != null)
                    {
                        textHue = WhiteTextHue;
                        string completionPercentageText = "0%";

                        if (achievementEntry.m_Completed)
                        {
                            textHue = GreenTextHue;

                            if (!achievementEntry.m_Claimed)
                            {
                                AddItem(startX, startY + 5, 572);     //Green Orb
                            }
                            completionPercentageText = "100%";
                        }

                        else
                        {
                            double completionPercentage = (double)achievementEntry.m_Progress / (double)achievementDetail.m_ProgressNeeded;

                            completionPercentageText = Utility.CreateDecimalPercentageString(completionPercentage, 0);

                            if (completionPercentage > 0 && completionPercentage < .01)
                            {
                                completionPercentageText = "1%";
                            }

                            if (completionPercentage >= .99 && completionPercentage < 1.0)
                            {
                                completionPercentageText = "99%";
                            }

                            if (completionPercentage > 0)
                            {
                                textHue = YellowTextHue;
                            }
                        }

                        if (!achievementEntry.m_Unlocked)
                        {
                            textHue = GreyTextHue;
                            //AddItem(startX, startY + 5, 573); //Orange Orb
                        }

                        if (achievementSelected == achievement)
                        {
                            AddButton(startX + 33, startY, 4030, 4030, buttonIndex, GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddButton(startX + 33, startY, 4029, 4031, buttonIndex, GumpButtonType.Reply, 0);
                        }

                        AddLabel(startX + 68, startY + 1, textHue, completionPercentageText);
                        AddLabel(startX + 110, startY + 1, textHue, achievementDetail.m_DisplayName);
                    }

                    startY += achievementSpacing;
                }

                #region Achievement Window

                AddImage(408, 233, 103, 2401);
                AddImage(408, 150, 103, 2401);
                AddImage(408, 60, 103, 2401);
                AddImage(306, 150, 103);
                AddImage(303, 234, 103, 2401);
                AddImage(303, 150, 103, 2401);
                AddImage(303, 60, 103, 2401);
                AddImage(316, 72, 3604, 2052);
                AddImage(316, 195, 3604, 2052);
                AddImage(410, 72, 3604, 2052);
                AddImage(411, 195, 3604, 2052);
                AddImage(408, 322, 103, 2401);
                AddImage(303, 323, 103, 2401);
                AddImage(316, 284, 3604, 2052);
                AddImage(411, 284, 3604, 2052);
                AddImage(408, 362, 103, 2401);
                AddImage(303, 363, 103, 2401);
                AddImage(316, 324, 3604, 2052);
                AddImage(411, 324, 3604, 2052);
                AddImage(516, 49, 10441, 2401);

                #endregion

                AchievementDetail selectedAchievementDetail = Achievements.GetAchievementDetail(achievementSelected);
                AchievementEntry  selectedAchievementEntry  = Achievements.GetAchievementEntry(m_Player, achievementSelected);

                int centerTextX = 440;
                int textY       = 80;

                rowSpacing = 20;

                AddImage(349, 54, 2440, 1102);
                AddLabel(Utility.CenteredTextOffset(centerTextX, selectedAchievementDetail.m_DisplayName), 55, categoryDetail.m_TextHue, selectedAchievementDetail.m_DisplayName);

                if (selectedAchievementDetail != null && selectedAchievementEntry != null)
                {
                    if (!selectedAchievementEntry.m_Unlocked)
                    {
                        string unlockedText = "Stage " + selectedAchievementDetail.m_Stage.ToString() + " (Not Yet Unlocked)";

                        AddLabel(Utility.CenteredTextOffset(centerTextX, unlockedText), textY, GreyTextHue, unlockedText);

                        textY += rowSpacing;
                    }

                    for (int a = 0; a < selectedAchievementDetail.m_Description.Length; a++)
                    {
                        AddLabel(Utility.CenteredTextOffset(centerTextX, selectedAchievementDetail.m_Description[a]), textY, WhiteTextHue, selectedAchievementDetail.m_Description[a]);

                        textY += rowSpacing;
                    }

                    AddLabel(409, 184, 2599, "Progress");

                    double selectedAchievementProgress = (double)selectedAchievementEntry.m_Progress / (double)selectedAchievementDetail.m_ProgressNeeded;

                    textHue = GreyTextHue;

                    if (selectedAchievementEntry.m_Progress > 0)
                    {
                        textHue = YellowTextHue;
                    }

                    if (selectedAchievementEntry.m_Progress == selectedAchievementDetail.m_ProgressNeeded)
                    {
                        textHue = GreenTextHue;
                    }

                    AddImage(382, 205, Achievements.GetProgressBarBackground(selectedAchievementProgress));
                    AddImageTiled(382 + Utility.ProgressBarX(selectedAchievementProgress), 208, Utility.ProgressBarWidth(selectedAchievementProgress), 7, 2488);

                    string progressText = selectedAchievementEntry.m_Progress.ToString() + "/" + selectedAchievementDetail.m_ProgressNeeded.ToString();

                    AddLabel(Utility.CenteredTextOffset(centerTextX - 5, progressText), 220, textHue, progressText);

                    AddLabel(415, 250, 63, "Reward");

                    textY = 270;

                    for (int a = 0; a < selectedAchievementDetail.m_RewardDescription.Length; a++)
                    {
                        AddLabel(Utility.CenteredTextOffset(centerTextX, selectedAchievementDetail.m_RewardDescription[a]), textY, WhiteTextHue, selectedAchievementDetail.m_RewardDescription[a]);

                        textY += rowSpacing;
                    }

                    if (selectedAchievementDetail.m_RewardItemID != 0)
                    {
                        AddItem(360 + selectedAchievementDetail.m_RewardItemOffsetX, textY + 20 + selectedAchievementDetail.m_RewardItemOffsetY, selectedAchievementDetail.m_RewardItemID, selectedAchievementDetail.m_RewardItemHue);
                    }

                    else
                    {
                        AddGumpCollection(GumpCollections.GetGumpCollection(selectedAchievementDetail.GumpCollectionGroupId, selectedAchievementDetail.GumpCollectionItemId), 355, 350);
                    }

                    if (selectedAchievementEntry.m_Completed)
                    {
                        if (selectedAchievementEntry.m_Claimed)
                        {
                            AddLabel(426, 472, 63, "Claim");
                            AddButton(426, 442, 2151, 2154, 6, GumpButtonType.Reply, 0);
                        }

                        else
                        {
                            AddLabel(393, 462, 149, "Already Claimed");
                        }
                    }
                }
                break;

                #endregion

            case PageType.Settings:
                break;
            }
        }