Exemple #1
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                int entryID = info.ButtonID - 1;

                if (entryID < 0 || entryID >= m_Entries.Length)
                {
                    return;
                }

                int             mana  = m_Spell.ScaleMana(m_Spell.RequiredMana);
                AnimalFormEntry entry = AnimalForm.Entries[entryID];

                if (mana > m_Caster.Mana)
                {
                    m_Caster.SendLocalizedMessage(1060174, mana.ToString());                     // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                }
                else if (BaseFormTalisman.EntryEnabled(sender.Mobile, entry.Type))
                {
                    if (AnimalForm.Morph(m_Caster, entryID) == MorphResult.Fail)
                    {
                        m_Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632);                         // The spell fizzles.
                        m_Caster.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist);
                        m_Caster.PlaySound(0x5C);
                    }
                    else
                    {
                        m_Caster.Mana -= mana;
                    }
                }
            }
Exemple #2
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                int entryID = info.ButtonID - 1;

                if (entryID < 0 || entryID >= m_Entries.Length)
                {
                    return;
                }

                int             mana  = m_Spell.ScaleMana(m_Spell.RequiredMana);
                AnimalFormEntry entry = AnimalForm.Entries[entryID];

                if (mana > m_Caster.Mana)
                {
                    m_Caster.SendLocalizedMessage(1060174, mana.ToString());
                    // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                }
                else if (BaseFormTalisman.EntryEnabled(sender.Mobile, entry.Type))
                {
                    #region Dueling
                    if (m_Caster is PlayerMobile && ((PlayerMobile)m_Caster).DuelContext != null &&
                        !((PlayerMobile)m_Caster).DuelContext.AllowSpellCast(m_Caster, m_Spell))
                    {
                    }
                    #endregion

                    else if (Morph(m_Caster, entryID) == MorphResult.Fail)
                    {
                        m_Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632);                         // The spell fizzles.
                        m_Caster.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist);
                        m_Caster.PlaySound(0x5C);
                    }
                    else
                    {
                        m_Caster.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist);
                        m_Caster.Mana -= mana;

                        string typename = entry.Name;

                        BuffInfo.AddBuff(m_Caster, new BuffInfo(BuffIcon.AnimalForm, 1060612, 1075823, String.Format("{0}\t{1}", "aeiouy".IndexOf(typename.ToLower()[0]) >= 0 ? "an" : "a", typename)));
                    }
                }
            }
Exemple #3
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                int entryID = info.ButtonID - 1;

                if (entryID < 0 || entryID >= AnimalForm.Entries.Length)
                {
                    return;
                }

                int             mana  = m_Spell.ScaleMana(m_Spell.RequiredMana);
                AnimalFormEntry entry = AnimalForm.Entries[entryID];

                if (mana > m_Caster.Mana)
                {
                    m_Caster.SendLocalizedMessage(1060174,
                                                  mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                }
                else if (m_Caster is PlayerMobile mobile && mobile.MountBlockReason != BlockMountType.None)
                {
                    mobile.SendLocalizedMessage(1063108); // You cannot use this ability right now.
                }
Exemple #4
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                int entryID = info.ButtonID - 1;

                if (entryID < 0 || entryID >= AnimalForm.Entries.Length)
                {
                    return;
                }

                int             mana  = m_Spell.ScaleMana(m_Spell.RequiredMana);
                AnimalFormEntry entry = AnimalForm.Entries[entryID];

                if (mana > m_Caster.Mana)
                {
                    m_Caster.SendLocalizedMessage(1060174, mana.ToString());                     // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                }
                else if ((m_Caster is PlayerMobile) && (m_Caster as PlayerMobile).MountBlockReason != BlockMountType.None)
                {
                    m_Caster.SendLocalizedMessage(1063108);                     // You cannot use this ability right now.
                }
                else if (BaseFormTalisman.EntryEnabled(sender.Mobile, entry.Type))
                {
                    #region Dueling
                    if (m_Caster is PlayerMobile && ((PlayerMobile)m_Caster).DuelContext != null && !((PlayerMobile)m_Caster).DuelContext.AllowSpellCast(m_Caster, m_Spell))
                    {
                    }
                    #endregion
                    else if (AnimalForm.Morph(m_Caster, entryID) == MorphResult.Fail)
                    {
                        m_Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632);                         // The spell fizzles.
                        m_Caster.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist);
                        m_Caster.PlaySound(0x5C);
                    }
                    else
                    {
                        m_Caster.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist);
                        m_Caster.Mana -= mana;
                    }
                }
            }
Exemple #5
0
        public static MorphResult Morph(Mobile m, int entryID)
        {
            if (entryID < 0 || entryID >= m_Entries.Length)
            {
                return(MorphResult.Fail);
            }

            AnimalFormEntry entry = m_Entries[entryID];

            m_LastAnimalForms[m] = entryID;             //On OSI, it's the last /attempted/ one not the last succeeded one

            if (m.Skills.Ninjitsu.Value < entry.ReqSkill)
            {
                string args = String.Format("{0}\t{1}\t ", entry.ReqSkill.ToString("F1"), SkillName.Ninjitsu);
                m.SendLocalizedMessage(1063013, args);
                // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(MorphResult.NoSkill);
            }

            /*
             * if( !m.CheckSkill( SkillName.Ninjitsu, entry.ReqSkill, entry.ReqSkill + 37.5 ) )
             * return MorphResult.Fail;
             *
             * On OSI,it seems you can only gain starting at '0' using Animal form.
             */

            double ninjitsu = m.Skills.Ninjitsu.Value;

            if (ninjitsu < entry.ReqSkill + 37.5)
            {
                double chance = (ninjitsu - entry.ReqSkill) / 37.5;

                if (chance < Utility.RandomDouble())
                {
                    return(MorphResult.Fail);
                }
            }

            m.CheckSkill(SkillName.Ninjitsu, 0.0, 37.5);

            if (!BaseFormTalisman.EntryEnabled(m, entry.Type))
            {
                return(MorphResult.Success);                // Still consumes mana, just no effect
            }

            BaseMount.Dismount(m);

            int bodyMod = entry.BodyMod;
            int hueMod  = entry.HueMod;

            m.BodyMod = bodyMod;
            m.HueMod  = hueMod;

            if (entry.SpeedBoost)
            {
                m.Send(SpeedControl.MountSpeed);
            }

            SkillMod mod = null;

            if (entry.StealthBonus)
            {
                mod         = new DefaultSkillMod(SkillName.Stealth, true, 20.0);
                mod.ObeyCap = true;
                m.AddSkillMod(mod);
            }

            SkillMod stealingMod = null;

            if (entry.StealingBonus)
            {
                stealingMod         = new DefaultSkillMod(SkillName.Stealing, true, 10.0);
                stealingMod.ObeyCap = true;
                m.AddSkillMod(stealingMod);
            }

            Timer timer = new AnimalFormTimer(m, bodyMod, hueMod);

            timer.Start();

            AddContext(m, new AnimalFormContext(timer, mod, entry.SpeedBoost, entry.Type, stealingMod));
            return(MorphResult.Success);
        }
Exemple #6
0
			public AnimalFormGump(Mobile caster, AnimalFormEntry[] entries, AnimalForm spell)
				: base(50, 50)
			{
				m_Caster = caster;
				m_Spell = spell;
				m_Talisman = caster.Talisman;

				AddPage(0);

				AddBackground(0, 0, 520, 404, 0x13BE);
				AddImageTiled(10, 10, 500, 20, 0xA40);
				AddImageTiled(10, 40, 500, 324, 0xA40);
				AddImageTiled(10, 374, 500, 20, 0xA40);
				AddAlphaRegion(10, 10, 500, 384);

				AddHtmlLocalized(14, 12, 500, 20, 1063394, 0x7FFF, false, false); // <center>Polymorph Selection Menu</center>

				AddButton(10, 374, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
				AddHtmlLocalized(45, 376, 450, 20, 1011012, 0x7FFF, false, false); // CANCEL

				double ninjitsu = caster.Skills.Ninjitsu.Value;

				int current = 0;

				for (int i = 0; i < entries.Length; ++i)
				{
					bool enabled = (ninjitsu >= entries[i].ReqSkill && BaseFormTalisman.EntryEnabled(caster, entries[i].Type));

					int page = current / 10 + 1;
					int pos = current % 10;

					if (pos == 0)
					{
						if (page > 1)
						{
							AddButton(400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, page);
							AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF, false, false); // Next
						}

						AddPage(page);

						if (page > 1)
						{
							AddButton(300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
							AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF, false, false); // Back
						}
					}

					if (enabled)
					{
						int x = (pos % 2 == 0) ? 14 : 264;
						int y = (pos / 2) * 64 + 44;

						Rectangle2D b = ItemBounds.Table[entries[i].ItemID];

                        AddImageTiledButton(x, y, 0x918, 0x919, i + 1, GumpButtonType.Reply, 0, entries[i].ItemID, entries[i].Hue, 40 - b.Width / 2 - b.X, 30 - b.Height / 2 - b.Y, entries[i].Tooltip);
                        AddHtmlLocalized(x + 84, y, 250, 60, entries[i].Name, 0x7FFF, false, false);

						current++;
					}
				}
			}
Exemple #7
0
            public AnimalFormGump(Mobile caster, AnimalFormEntry[] entries, AnimalForm spell)
                : base(60, 36)
            {
                m_Caster = caster;
                m_Spell  = spell;

                AddPage(0);

                AddBackground(0, 0, 520, 404, 0x13BE);
                AddImageTiled(10, 10, 500, 20, 0xA40);
                AddImageTiled(10, 40, 500, 324, 0xA40);
                AddImageTiled(10, 374, 500, 20, 0xA40);
                AddAlphaRegion(10, 10, 500, 384);
                AddButton(10, 374, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(45, 376, 450, 20, 1060051, 0x7FFF, false, false);                  // CANCEL
                AddHtmlLocalized(14, 12, 500, 20, 1063394, 0x7FFF, false, false);                   // <center>Animal Form Selection Menu</center>

                AddPage(1);

                int idx = 0;

                for (int i = 0; i < entries.Length; i++)
                {
                    if ((i >= 12 && i <= entries.Length) && (m_Caster.Talisman == null || m_Caster.Talisman.GetType() != entries[i].Type))
                    {
                    }
                    else
                    {
                        AnimalFormEntry entry = entries[i];

                        if (entry.Type == typeof(Rat) || entry.Type == typeof(Rabbit) || entry.ReqSkill < m_Caster.Skills[SkillName.Ninjitsu].Value)
                        {
                            idx++;

                            if (idx == 11)
                            {
                                AddButton(400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2);
                                AddHtmlLocalized(440, 376, 60, 20, 1043353, 0x7FFF, false, false);                                   // Next

                                AddPage(2);

                                AddButton(300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
                                AddHtmlLocalized(340, 376, 60, 20, 1011393, 0x7FFF, false, false);                                   // Back

                                idx = 1;
                            }

                            if ((idx % 2) != 0)
                            {
                                AddButtonTileArt(14, 44 + (64 * (idx - 1) / 2), 0x918, 0x919, GumpButtonType.Reply, 0x64 + i, 100 + i, entry.ItemID, entry.Hue, entry.TileArtWidth, entry.TileArtHeight);
                                AddTooltip(entry.Tooltip);
                                AddHtmlLocalized(98, 44 + (64 * (idx - 1) / 2), 250, 60, entry.Name, 0x7FFF, false, false);
                            }
                            else
                            {
                                AddButtonTileArt(264, 44 + (64 * (idx - 2) / 2), 0x918, 0x919, GumpButtonType.Reply, 0x64 + i, 100 + i, entry.ItemID, entry.Hue, entry.TileArtWidth, entry.TileArtHeight);
                                AddTooltip(entry.Tooltip);
                                AddHtmlLocalized(348, 44 + (64 * (idx - 2) / 2), 250, 60, entry.Name, 0x7FFF, false, false);
                            }
                        }
                    }
                }
            }
Exemple #8
0
        public static MorphResult Morph(Mobile m, int entryID)
        {
            if (entryID < 0 || entryID >= m_Entries.Length)
            {
                return(MorphResult.Fail);
            }

            AnimalFormEntry entry = m_Entries[entryID];

            m_LastAnimalForms[m] = entryID;             // On OSI, it's the last /attempted/ one not the last succeeded one

            if (m.Skills.Ninjitsu.Value < entry.ReqSkill)
            {
                string args = String.Format("{0}\t{1}\t ", entry.ReqSkill.ToString("F1"), SkillName.Ninjitsu);
                m.SendLocalizedMessage(1063013, args);                   // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(MorphResult.NoSkill);
            }

            double minSkill = entry.ReqSkill - 12.5;
            double maxSkill = entry.ReqSkill + 37.5;

            if (!m.CheckSkill(SkillName.Ninjitsu, minSkill, maxSkill))
            {
                return(MorphResult.Fail);
            }

            BaseMount.Dismount(m);

            m.BodyMod = entry.BodyMod;

            if (entry.HueMod >= 0)
            {
                m.HueMod = entry.HueMod;
            }

            if (entry.SpeedBoost)
            {
                m.ForcedRun = true;
            }

            SkillMod mod = null;

            if (entry.StealthBonus)
            {
                mod         = new DefaultSkillMod(SkillName.Stealth, true, 20.0);
                mod.ObeyCap = true;
                m.AddSkillMod(mod);
            }

            #region Heritage Items

            /*
             * else if ( entry.StealingBonus )
             * {
             *      mod = new DefaultSkillMod( SkillName.Stealing, true, 10.0 );
             *      mod.ObeyCap = true;
             *      m.AddSkillMod( mod );
             * }
             */
            #endregion

            Timer timer = new AnimalFormTimer(m, entry.BodyMod, m.HueMod);
            timer.Start();

            AddContext(m, new AnimalFormContext(timer, mod, entry.SpeedBoost, entry.Type));

            Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x7F3);

            BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.AnimalForm, 1075822, 1075823, String.Format("{0}\t{1}", entry.ArticleCliloc, entry.FormCliloc)));

            m.Target = null;

            return(MorphResult.Success);
        }
			public AnimalFormGump( Mobile caster, AnimalFormEntry[] entries, AnimalForm spell ) : base( 50, 50 )
			{
				m_Caster = caster;
				m_Spell = spell;

				#region Heritage Items
				AddPage( 0 );

				AddBackground( 0, 0, 520, 404, 0x13BE );
				AddImageTiled( 10, 10, 500, 20, 0xA40 );
				AddImageTiled( 10, 40, 500, 324, 0xA40 );
				AddImageTiled( 10, 374, 500, 20, 0xA40 );
				AddAlphaRegion( 10, 10, 500, 384 );
				AddButton( 10, 374, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 );
				AddHtmlLocalized( 45, 376, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL
				AddHtmlLocalized( 14, 12, 500, 20, 1063394, 0x7FFF, false, false ); // <center>Animal Form Selection Menu</center>
				
				double ninjitsu = caster.Skills.Ninjitsu.Value;
				int count = 0;
				int y = 44;

				for ( int i = 0; i < entries.Length; i++ )
				{
					bool enabled = ( ninjitsu >= entries[ i ].ReqSkill );

					if ( i >= 12 && i <= 15 && ( caster.Talisman == null || caster.Talisman.GetType() != entries[ i ].Type ) )
						enabled = false;

					if ( enabled )
					{
						if ( count % 10 == 0 )
						{
							AddPage( count / 10 + 1 );

							y = 44;
						}
						else if ( count > 10 && count % 10 == 1 )
						{
							AddButton( 300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, count / 10 );
							AddHtmlLocalized( 340, 376, 60, 20, 1011393, 0x7FFF, false, false ); // Back
						}
						else if ( count % 10 == 9 )
						{
							AddButton( 400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, count / 10 + 2 );
							AddHtmlLocalized( 440, 376, 60, 20, 1043353, 0x7FFF, false, false ); // Next
						}

						int x = count % 2 == 0 ? 14 : 264;

						AddImageTiledButton( x, y, 0x918, 0x919, 0x64 + i, GumpButtonType.Reply, 0, entries[ i ].ItemID, 0x0, entries[ i ].X, entries[ i ].Y );
						
						if ( entries[ i ].Tooltip > 0 )
							AddTooltip( entries[ i ].Tooltip );
						
						TextDefinition.AddHtmlText( this, x + 84, y, 250, 60, entries[ i ].Name, false, false, 0x7FFF, 0x7FFF );
						
						if ( count % 2 == 1 )
							y += 64;

						count += 1;
					}
				}
				#endregion
			}
Exemple #10
0
            public AnimalFormGump( Mobile caster, AnimalFormEntry[] entries, AnimalForm spell )
                : base(50, 50)
            {
                m_Caster = caster;
                m_Spell = spell;

                AddPage( 0 );

                AddBackground( 0, 0, 408, 298, 0x13BE );
                AddBackground( 4, 28, 400, 240, 0xBB8 );

                AddHtmlLocalized( 4, 4, 400, 20, 1063394, 0x0, false, false ); // <center>Animal Form Selection Menu</center>

                AddButton( 25, 272, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
                AddHtmlLocalized( 60, 274, 150, 20, 1011036, 0x0, false, false ); // OKAY

                AddButton( 285, 272, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0 );
                AddHtmlLocalized( 320, 274, 150, 20, 1011012, 0x0, false, false ); // CANCEL

                double ninjitsu = caster.Skills.Ninjitsu.Value;

                for ( int i = 0; i < entries.Length; ++i )
                {
                    bool enabled = ( ninjitsu >= entries[i].ReqSkill );

                    int x = 100 * ( i % 4 );
                    int y = 80 * ( i / 4 );

                    TextDefinition.AddHtmlText( this, 10 + x, 30 + y, 100, 18, entries[i].Name, false, false );

                    if ( enabled )
                    {
                        AddRadio( 10 + x, 50 + y, 0xD2, 0xD3, false, 100 + i );
                        AddItem( 30 + x, 50 + y, entries[i].ItemID, entries[i].Hue );
                    }
                    else
                        AddItem( 10 + x, 50 + y, entries[i].ItemID, 0x3E3 );

                    AddTooltip( enabled ? entries[i].Tooltip : 1070708 );
                }
            }
Exemple #11
0
        public static MorphResult Morph(Mobile m, int entryID)
        {
            if (entryID < 0 || entryID >= m_Entries.Length)
            {
                return(MorphResult.Fail);
            }

            AnimalFormEntry entry = m_Entries[entryID];

            m_LastAnimalForms[m] = entryID;             //On OSI, it's the last /attempted/ one not the last succeeded one

            if (m.Skills.Ninjitsu.Value < entry.ReqSkill)
            {
                string args = String.Format("{0}\t{1}\t ", entry.ReqSkill.ToString("F1"), SkillName.Ninjitsu);
                m.SendLocalizedMessage(1063013, args);                   // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(MorphResult.NoSkill);
            }

            double ninjitsu = m.Skills.Ninjitsu.Value;

            if (ninjitsu < entry.ReqSkill + 37.5)
            {
                double chance = (ninjitsu - entry.ReqSkill) / 37.5;

                if (chance < Utility.RandomDouble())
                {
                    return(MorphResult.Fail);
                }
            }

            m.CheckSkill(SkillName.Ninjitsu, 0.0, 37.5);

            BaseMount.Dismount(m);

            m.BodyMod = entry.BodyMod;

            if (entry.HueMod > 0)
            {
                m.HueMod = entry.HueMod;
            }

            if (entry.SpeedBoost)
            {
                m.Send(SpeedBoost.Instantiate(true));
            }

            SkillMod mod = null;

            if (entry.StealthBonus)
            {
                mod         = new DefaultSkillMod(SkillName.Stealth, true, 20.0);
                mod.ObeyCap = true;
                m.AddSkillMod(mod);
            }

            Timer timer = new AnimalFormTimer(m, entry.BodyMod, entry.HueMod);

            timer.Start();

            AddContext(m, new AnimalFormContext(timer, mod, entry.SpeedBoost, entry.Type));
            return(MorphResult.Success);
        }
Exemple #12
0
            public AnimalFormGump( Mobile caster, AnimalFormEntry[] entries, AnimalForm spell )
                : base(60, 36)
            {
                m_Caster = caster;
                m_Spell = spell;

                AddPage( 0 );

                AddBackground( 0, 0, 520, 404, 0x13BE );
                AddImageTiled( 10, 10, 500, 20, 0xA40 );
                AddImageTiled( 10, 40, 500, 324, 0xA40 );
                AddImageTiled( 10, 374, 500, 20, 0xA40 );
                AddAlphaRegion( 10, 10, 500, 384 );
                AddButton( 10, 374, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 );
                AddHtmlLocalized( 45, 376, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL
                AddHtmlLocalized( 14, 12, 500, 20, 1063394, 0x7FFF, false, false ); // <center>Animal Form Selection Menu</center>

                AddPage( 1 );

                int idx = 0;

                for ( int i = 0; i < entries.Length; i++ )
                {
                    if ( ( i >= 12 && i <= entries.Length ) && ( m_Caster.Talisman == null || m_Caster.Talisman.GetType() != entries[i].Type ) )
                    {

                    }
                    else
                    {
                        AnimalFormEntry entry = entries[i];

                        if ( entry.Type == typeof( Rat ) || entry.Type == typeof( Rabbit ) || entry.ReqSkill < m_Caster.Skills[SkillName.Ninjitsu].Value )
                        {
                            idx++;

                            if ( idx == 11 )
                            {
                                AddButton( 400, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2 );
                                AddHtmlLocalized( 440, 376, 60, 20, 1043353, 0x7FFF, false, false ); // Next

                                AddPage( 2 );

                                AddButton( 300, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1 );
                                AddHtmlLocalized( 340, 376, 60, 20, 1011393, 0x7FFF, false, false ); // Back

                                idx = 1;
                            }

                            if ( ( idx % 2 ) != 0 )
                            {
                                AddButtonTileArt( 14, 44 + ( 64 * ( idx - 1 ) / 2 ), 0x918, 0x919, GumpButtonType.Reply, 0x64 + i, 100 + i, entry.ItemID, entry.Hue, entry.TileArtWidth, entry.TileArtHeight );
                                AddTooltip( entry.Tooltip );
                                AddHtmlLocalized( 98, 44 + ( 64 * ( idx - 1 ) / 2 ), 250, 60, entry.Name, 0x7FFF, false, false );
                            }
                            else
                            {
                                AddButtonTileArt( 264, 44 + ( 64 * ( idx - 2 ) / 2 ), 0x918, 0x919, GumpButtonType.Reply, 0x64 + i, 100 + i, entry.ItemID, entry.Hue, entry.TileArtWidth, entry.TileArtHeight );
                                AddTooltip( entry.Tooltip );
                                AddHtmlLocalized( 348, 44 + ( 64 * ( idx - 2 ) / 2 ), 250, 60, entry.Name, 0x7FFF, false, false );
                            }
                        }
                    }
                }
            }
			public AnimalFormGump( Mobile caster, AnimalFormEntry[] entries, AnimalForm spell ) : base( 50, 50 )
			{
				m_Caster = caster;
				m_Spell = spell;

				#region Mondain's Legacy
				AddPage( 0 );

				AddBackground( 0, 0, 520, 84 + EntriesPerPage * EntryHeight / 2, 0x13BE );
				AddImageTiled( 10, 10, 500, 20, 0xA40 );
				AddImageTiled( 10, 40, 500, 4 + EntriesPerPage * EntryHeight / 2, 0xA40 );
				AddImageTiled( 10, 54 + EntriesPerPage * EntryHeight / 2, 500, 20, 0xA40 );
				AddAlphaRegion( 10, 10, 500, 64 + EntriesPerPage * EntryHeight / 2 );
				AddButton( 10, 54 + EntriesPerPage * EntryHeight / 2, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 );
				AddHtmlLocalized( 45, 56 + EntriesPerPage * EntryHeight / 2, 450, 20, 1060051, 0x7FFF, false, false ); // CANCEL
				AddHtmlLocalized( 14, 12, 500, 20, 1063394, 0x7FFF, false, false ); // <center>Animal Form Selection Menu</center>

				double ninjitsu = caster.Skills.Ninjitsu.Value;

				Dictionary<int, AnimalFormEntry> list = new Dictionary<int, AnimalFormEntry>();

				for ( int i = 0; i < entries.Length; i++ )
				{
					bool enabled = ( ninjitsu >= entries[ i ].ReqSkill );

					if ( entries[ i ].Talisman != null && ( caster.Talisman == null || caster.Talisman.GetType() != entries[ i ].Talisman ) )
						enabled = false;

					if ( enabled )
						list.Add( i, entries[ i ] );
				}

				AnimalFormEntry entry;
				int pages = list.Count / EntriesPerPage + 1;
				int relative, page;
				int idx = 0, x = 0, y = 44;

				foreach ( KeyValuePair<int, AnimalFormEntry> kvp in list )
				{
					entry = kvp.Value;
					relative = idx % EntriesPerPage;
					x = idx % 2 == 0 ? 14 : 264;

					if ( relative == 0 )
					{
						page = idx / EntriesPerPage + 1;
						y = 44;
						AddPage( page );

						if ( idx > 0 )
						{
							AddButton( 300, 54 + EntriesPerPage * EntryHeight / 2, 0xFAE, 0xFB0, 0, GumpButtonType.Page, page - 1 );
							AddHtmlLocalized( 340, 56 + EntriesPerPage * EntryHeight / 2, 60, 20, 1011393, 0x7FFF, false, false ); // Back
						}

						if ( page < pages )
						{
							AddButton( 400, 54 + EntriesPerPage * EntryHeight / 2, 0xFA5, 0xFA7, 0, GumpButtonType.Page, page + 1 );
							AddHtmlLocalized( 440, 56 + EntriesPerPage * EntryHeight / 2, 60, 20, 1043353, 0x7FFF, false, false ); // Next
						}
					}

					AddImageTiledButton( x, y, 0x918, 0x919, 0x64 + kvp.Key, GumpButtonType.Reply, 0, entry.ItemID, 0x0, entry.Width, entry.Height );

					if ( entry.Tooltip > 0 )
						AddTooltip( entry.Tooltip );

					TextDefinition.AddHtmlText( this, x + 84, y, 250, 60, entry.Name, false, false, 0x7FFF, 0x7FFF );

					if ( idx % 2 == 1 )
						y += EntryHeight;

					idx++;
				}
				#endregion
			}