Beispiel #1
0
        public SpellHueEntry(HueableSpell hueableSpell, SpellHueType activeHue)
        {
            m_HueableSpell = hueableSpell;
            m_ActiveHue    = activeHue;

            m_UnlockedHues.Add(SpellHueType.Basic);
        }
Beispiel #2
0
        public SpellHueDeed(HueableSpell hueableSpell, SpellHueType spellHueType) : this()
        {
            Name   = "a spell hue deed:";
            Weight = 0.1;

            Hue = 2620;

            m_HueableSpell = hueableSpell;
            m_HueType      = spellHueType;
        }
Beispiel #3
0
        public SpellHueDeed(HueableSpell hueableSpell) : this()
        {
            Name   = "a spell hue deed";
            Weight = 0.1;

            Hue = 2620;

            m_HueableSpell = hueableSpell;
            m_HueType      = SpellHue.GetRandomSpellHue();
        }
Beispiel #4
0
        public SpellHueDeed(SpellHueType spellHueType) : this()
        {
            Name   = "a spell hue deed";
            Weight = 0.1;

            Hue = 2620;

            m_HueableSpell = SpellHue.GetRandomHueableSpell();
            m_HueType      = spellHueType;
        }
Beispiel #5
0
        public SpellHueDeed() : base(0x14F0)
        {
            Name   = "a spell hue deed";
            Weight = 0.1;

            Hue = 2620;

            m_HueableSpell = SpellHue.GetRandomHueableSpell();
            m_HueType      = SpellHue.GetRandomSpellHue();
        }
Beispiel #6
0
        public static SpellHueTypeDetail GetSpellHueTypeDetail(SpellHueType spellHueType)
        {
            SpellHueTypeDetail detail = new SpellHueTypeDetail();

            detail.m_SpellHueType = spellHueType;

            #region Spell Hue Type Details

            switch (spellHueType)
            {
            case SpellHueType.Standard:
                detail.m_SpellHueTypeName = "Standard";

                detail.m_IconHue  = 0;
                detail.m_TextHue  = 2499;
                detail.m_SpellHue = 0;
                break;

            case SpellHueType.Charcoal:
                detail.m_SpellHueTypeName = "Fire";

                detail.m_IconHue  = 2117;
                detail.m_TextHue  = 2117;
                detail.m_SpellHue = 2117;
                break;

            case SpellHueType.Earthen:
                detail.m_SpellHueTypeName = "Earthen";

                detail.m_IconHue  = 2550;
                detail.m_TextHue  = 2550;
                detail.m_SpellHue = 2550;
                break;

            case SpellHueType.Rose:
                detail.m_SpellHueTypeName = "Rose";

                detail.m_IconHue  = 2660;
                detail.m_TextHue  = 2660;
                detail.m_SpellHue = 2660;
                break;

            case SpellHueType.Otherworldly:
                detail.m_SpellHueTypeName = "Otherworldly";

                detail.m_IconHue  = 2962;
                detail.m_TextHue  = 2962;
                detail.m_SpellHue = 2962;
                break;
            }

            #endregion

            return(detail);
        }
Beispiel #7
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            if (version >= 0)
            {
                m_HueableSpell = (HueableSpell)reader.ReadInt();
                m_HueType      = (SpellHueType)reader.ReadInt();
            }
        }
Beispiel #8
0
        public static SpellHueTypeDetail GetSpellHueTypeDetail(SpellHueType spellHueType)
        {
            SpellHueTypeDetail spellHueTypeDetail = new SpellHueTypeDetail();

            switch (spellHueType)
            {
            case SpellHueType.Basic:
                spellHueTypeDetail.m_Name         = "Basic";
                spellHueTypeDetail.m_AnimationHue = 0;
                spellHueTypeDetail.m_DisplayHue   = 0;
                break;

            case SpellHueType.Fiery:
                spellHueTypeDetail.m_Name         = "Fiery";
                spellHueTypeDetail.m_AnimationHue = 2116;
                spellHueTypeDetail.m_DisplayHue   = 2117;
                break;

            case SpellHueType.Icy:
                spellHueTypeDetail.m_Name         = "Icy";
                spellHueTypeDetail.m_AnimationHue = 2578;
                spellHueTypeDetail.m_DisplayHue   = 2579;
                break;

            case SpellHueType.Earthy:
                spellHueTypeDetail.m_Name         = "Earthy";
                spellHueTypeDetail.m_AnimationHue = 2552;
                spellHueTypeDetail.m_DisplayHue   = 2553;
                break;

            case SpellHueType.Mystical:
                spellHueTypeDetail.m_Name         = "Mystical";
                spellHueTypeDetail.m_AnimationHue = 2641;
                spellHueTypeDetail.m_DisplayHue   = 2642;
                break;

            case SpellHueType.Ghostly:
                spellHueTypeDetail.m_Name         = "Ghostly";
                spellHueTypeDetail.m_AnimationHue = 2598;
                spellHueTypeDetail.m_DisplayHue   = 2599;
                break;
            }

            return(spellHueTypeDetail);
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_CustomizationEntries = new List <PlayerCustomizationEntry>();
            m_SpellHueEntries      = new List <SpellHueEntry>();

            if (version >= 0)
            {
                m_AccountUsername = reader.ReadString();

                int customizationEntries = reader.ReadInt();
                for (int a = 0; a < customizationEntries; a++)
                {
                    CustomizationType customizationType = (CustomizationType)reader.ReadInt();

                    bool unlocked = reader.ReadBool();
                    bool active   = reader.ReadBool();

                    m_CustomizationEntries.Add(new PlayerCustomizationEntry(customizationType, unlocked, active, true));
                }

                int spellHueEntries = reader.ReadInt();
                for (int a = 0; a < spellHueEntries; a++)
                {
                    HueableSpell spellHueType = (HueableSpell)reader.ReadInt();
                    SpellHueType activeType   = (SpellHueType)reader.ReadInt();

                    SpellHueEntry spellHueEntry = new SpellHueEntry(spellHueType, activeType);

                    int unlockedHueCount = reader.ReadInt();
                    for (int b = 0; b < unlockedHueCount; b++)
                    {
                        SpellHueType unlockedHue = (SpellHueType)reader.ReadInt();
                        spellHueEntry.m_UnlockedHues.Add(unlockedHue);
                    }

                    m_SpellHueEntries.Add(spellHueEntry);
                }
            }
        }
Beispiel #10
0
        public static SpellHueType GetRandomSpellHue()
        {
            SpellHueType spellHue = SpellHueType.Basic;

            int randomSpellHue = Utility.RandomMinMax(1, 5);

            switch (randomSpellHue)
            {
            case 1: spellHue = SpellHueType.Icy; break;

            case 2: spellHue = SpellHueType.Fiery; break;

            case 3: spellHue = SpellHueType.Earthy; break;

            case 4: spellHue = SpellHueType.Mystical; break;

            case 5: spellHue = SpellHueType.Ghostly; break;
            }

            return(spellHue);
        }
Beispiel #11
0
 public static int GetSpellHue(SpellHueType spellHueType)
 {
     return(GetSpellHueTypeDetail(spellHueType).m_AnimationHue);
 }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            PlayerMobile player = sender.Mobile as PlayerMobile;

            if (player == null)
            {
                return;
            }
            if (player.Deleted)
            {
                return;
            }

            //Previous
            if (info.ButtonID == 1)
            {
                if (m_PageNumber > 1)
                {
                    m_PageNumber--;

                    player.SendSound(0x055);

                    player.CloseGump(typeof(PlayerSpellHuesGump));
                    player.SendGump(new PlayerSpellHuesGump(player, m_PageNumber));

                    return;
                }
            }

            //Next
            if (info.ButtonID == 2)
            {
                if (m_PageNumber < m_TotalPages)
                {
                    m_PageNumber++;

                    player.SendSound(0x055);

                    player.CloseGump(typeof(PlayerSpellHuesGump));
                    player.SendGump(new PlayerSpellHuesGump(player, m_PageNumber));

                    return;
                }
            }

            //Entries
            if (info.ButtonID > 2)
            {
                if (m_SpellsOnPage.Count == 0)
                {
                    return;
                }

                int totalHues = Enum.GetNames(typeof(SpellHueType)).Length;

                int baseIndex    = info.ButtonID - 3;
                int spellIndex   = (int)(Math.Floor((double)baseIndex / (double)totalHues));
                int hueTypeIndex = baseIndex - (spellIndex * totalHues);

                if (spellIndex > m_SpellsOnPage.Count || spellIndex < 0)
                {
                    player.SendMessage("Invalid selection.");
                    return;
                }

                if (spellIndex >= m_SpellsOnPage.Count)
                {
                    return;
                }

                HueableSpell hueableSpell = m_SpellsOnPage[spellIndex];

                if (hueTypeIndex >= totalHues || hueableSpell == null)
                {
                    return;
                }

                SpellHueType       spellHueType = (SpellHueType)hueTypeIndex;
                HueableSpellDetail spellDetail  = SpellHue.GetHueableSpellDetail(hueableSpell);
                SpellHueEntry      spellEntry   = PlayerEnhancementPersistance.GetSpellHueEntry(player, hueableSpell);

                if (spellDetail == null || spellEntry == null)
                {
                    return;
                }

                bool unlocked = false;
                bool active   = false;

                if (spellEntry.m_UnlockedHues.Contains(spellHueType))
                {
                    unlocked = true;
                }

                if (spellEntry.m_ActiveHue == spellHueType)
                {
                    active = true;
                }

                if (unlocked)
                {
                    if (active)
                    {
                        if (spellHueType == SpellHueType.Basic)
                        {
                            player.SendMessage("The standard hue for a spell cannot be deactivated.");
                        }

                        else
                        {
                            player.SendMessage("You disable the custom spell hue and activate the basic hue.");
                            spellEntry.m_ActiveHue = SpellHueType.Basic;

                            player.SendSound(0x1EC);
                        }
                    }

                    else
                    {
                        player.SendMessage("You activate the custom spell hue.");
                        spellEntry.m_ActiveHue = spellHueType;

                        player.SendSound(0x1EC);
                    }

                    player.CloseGump(typeof(PlayerSpellHuesGump));
                    player.SendGump(new PlayerSpellHuesGump(player, m_PageNumber));

                    return;
                }

                else
                {
                    player.SendMessage("You have not unlocked that hue for that spell. Spell Hue Deeds may be obtained from the Donation Shop or may be discovered out in the world.");

                    player.CloseGump(typeof(PlayerSpellHuesGump));
                    player.SendGump(new PlayerSpellHuesGump(player, m_PageNumber));

                    return;
                }
            }

            player.CloseGump(typeof(PlayerSpellHuesGump));
            player.SendGump(new PlayerEnhancementGump(player));

            return;
        }
        public PlayerSpellHuesGump(Mobile from, int pageNumber) : base(10, 10)
        {
            PlayerMobile player = from as PlayerMobile;

            if (player == null)
            {
                return;
            }

            m_Player     = player;
            m_PageNumber = pageNumber;

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

            AddImage(0, 44, 202);
            AddImage(44, 0, 201);
            AddImage(0, 0, 206);
            AddImage(0, 468, 204);
            AddImage(590, 1, 207);
            AddImage(590, 468, 205);
            AddImage(44, 468, 233);
            AddImage(590, 45, 203);
            AddImageTiled(44, 44, 546, 424, 200);
            AddImage(0, 152, 202);
            AddImage(163, 0, 201);
            AddImage(166, 468, 233);
            AddImage(590, 152, 203);

            //-------------
            int textHue = 2036;
            int boldHue = 149;

            int totalSpells = Enum.GetNames(typeof(HueableSpell)).Length;
            int totalHues   = Enum.GetNames(typeof(SpellHueType)).Length;

            int spellsPerPage = 3;

            m_TotalPages = (int)(Math.Ceiling((double)totalSpells / (double)spellsPerPage));

            int indexStart = (m_PageNumber - 1) * spellsPerPage;
            int indexEnd;

            if (indexStart + spellsPerPage <= totalSpells)
            {
                indexEnd = indexStart + spellsPerPage;
            }
            else
            {
                indexEnd = totalSpells;
            }

            var iStartY   = 50;
            var iSpacingY = 135;

            AddLabel(292, 20, 2606, "Spell Hues");

            int iRow = 0;

            //Entry
            for (int a = indexStart; a < indexEnd; a++)
            {
                HueableSpell       hueableSpell = (HueableSpell)a;
                HueableSpellDetail spellDetail  = SpellHue.GetHueableSpellDetail(hueableSpell);
                SpellHueEntry      spellEntry   = PlayerEnhancementPersistance.GetSpellHueEntry(player, hueableSpell);

                if (hueableSpell == null || spellDetail == null || spellEntry == null)
                {
                    return;
                }

                m_SpellsOnPage.Add(hueableSpell);

                AddLabel(320 - (spellDetail.m_SpellName.Length * 3), iStartY, boldHue, spellDetail.m_SpellName);

                for (int b = 0; b < totalHues; b++)
                {
                    SpellHueType       spellHueType       = (SpellHueType)b;
                    SpellHueTypeDetail spellHueTypeDetail = SpellHue.GetSpellHueTypeDetail(spellHueType);

                    AddItem((100 + (75 * b)), iStartY + 25, spellDetail.m_IconItemId, spellHueTypeDetail.m_DisplayHue);
                    AddLabel((120 + (75 * b)) - (spellHueTypeDetail.m_Name.Length * 3), iStartY + 75, textHue, spellHueTypeDetail.m_Name);

                    bool unlocked = false;
                    bool active   = false;

                    if (spellEntry.m_UnlockedHues.Contains(spellHueType))
                    {
                        unlocked = true;
                    }

                    if (spellEntry.m_ActiveHue == spellHueType)
                    {
                        active = true;
                    }

                    int buttonIndex = 3 + (iRow * totalHues) + b;

                    if (unlocked)
                    {
                        if (active)
                        {
                            AddButton(105 + (75 * b), iStartY + 100, 2154, 2151, buttonIndex, GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddButton(105 + (75 * b), iStartY + 100, 2151, 2154, buttonIndex, GumpButtonType.Reply, 0);
                        }
                    }

                    else
                    {
                        AddButton(105 + (75 * b), iStartY + 100, 9727, 9727, buttonIndex, GumpButtonType.Reply, 0);
                    }
                }

                iStartY += iSpacingY;
                iRow++;
            }

            //Navigation
            if (m_PageNumber > 1)
            {
                AddButton(50, 465, 4014, 4016, 1, GumpButtonType.Reply, 0);
                AddLabel(85, 465, textHue, @"Previous Page");
            }

            if (m_PageNumber < m_TotalPages)
            {
                AddButton(485, 465, 4005, 4007, 2, GumpButtonType.Reply, 0);
                AddLabel(520, 465, textHue, @"Next Page");
            }
        }