Esempio n. 1
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                #region Mondain's Legacy
                if (info.ButtonID >= 100)
                {
                    int entryID = info.ButtonID - 100;

                    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);
                    }
                }
                #endregion
            }
Esempio n. 2
0
        protected override void OnTick()
        {
            if (m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Body != m_Body || m_Mobile.Hue != m_Hue)
            {
                AnimalForm.RemoveContext(m_Mobile, true);
                Stop();
            }
            else
            {
                if (m_Body == 0x115) // Cu Sidhe
                {
                    if (m_Counter++ >= 8)
                    {
                        if (m_Mobile.Hits < m_Mobile.HitsMax && m_Mobile.Backpack != null && m_Mobile.Backpack.FindItemByType(typeof(Bandage)) is Bandage b)
                        {
                            m_Mobile.Hits += Utility.RandomMinMax(20, 50);
                            b.Consume();
                        }

                        m_Counter = 0;
                    }
                }
                else if (m_Body == 0x114) // Reptalon
                {
                    if (m_Mobile.Combatant is Mobile mobile && m_Mobile.Combatant != m_LastTarget)
                    {
                        m_Counter    = 1;
                        m_LastTarget = mobile;
                    }

                    if (m_Mobile.Warmode && m_LastTarget != null && m_LastTarget.Alive && !m_LastTarget.Deleted && m_Counter-- <= 0)
                    {
                        if (m_Mobile.CanBeHarmful(m_LastTarget) && m_LastTarget.Map == m_Mobile.Map &&
                            m_LastTarget.InRange(m_Mobile.Location, BaseCreature.DefaultRangePerception) && m_Mobile.InLOS(m_LastTarget))
                        {
                            m_Mobile.Direction = m_Mobile.GetDirectionTo(m_LastTarget);
                            m_Mobile.Freeze(TimeSpan.FromSeconds(1));
                            m_Mobile.PlaySound(0x16A);

                            DelayCall(TimeSpan.FromSeconds(1.3), BreathEffect_Callback, m_LastTarget);
                        }

                        m_Counter = Math.Min((int)m_Mobile.GetDistanceToSqrt(m_LastTarget), 10);
                    }
                }
            }
        }
Esempio n. 3
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);
                }
            }
Esempio n. 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;
                    }
                }
            }
Esempio n. 5
0
            public override void OnResponse(GameClient sender, RelayInfo info)
            {
                if (!m_Spell.CheckCast())
                {
                    return;
                }

                if (info.ButtonID >= 100)
                {
                    int entryID = info.ButtonID - 100;

                    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_Spell.ConsumeMana();
                    }
                }
            }
Esempio n. 6
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);
                            }
                        }
                    }
                }
            }
Esempio n. 7
0
            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
            }
Esempio n. 8
0
            public AnimalFormGump(Mobile caster, AnimalFormEntry[] entries, AnimalForm spell)
                : base(50, 50)
            {
                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);

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

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

                var ninjitsu = caster.Skills.Ninjitsu.Value;

                var current = 0;

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

                    var page = current / 10 + 1;
                    var 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); // Next
                        }

                        AddPage(page);

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

                    if (!enabled)
                    {
                        continue;
                    }

                    var x = pos % 2 == 0 ? 14 : 264;
                    var y = pos / 2 * 64 + 44;

                    var 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);

                    current++;
                }
            }
Esempio n. 9
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 );
                }
            }
Esempio n. 10
0
			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
			}
Esempio n. 11
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 );
                            }
                        }
                    }
                }
            }
Esempio n. 12
0
			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
			}
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 1 && info.Switches.Length > 0)
            {
                int cnum = info.Switches[0];

                switch (cnum)
                {
                case 101:
                {
                    AnimalForm.Morph(from, 0x84);                                       // kirin
                    break;
                }

                case 102:
                {
                    AnimalForm.Morph(from, 0x7A);                                       // unikorn
                    break;
                }

                case 103:
                {
                    AnimalForm.Morph(from, 0xF6);                                       // bake kitsune
                    break;
                }

                case 104:
                {
                    AnimalForm.Morph(from, 0x19);                                       // wolf
                    break;
                }

                case 105:
                {
                    AnimalForm.Morph(from, 0xDC);                                       // llama
                    break;
                }

                case 106:
                {
                    AnimalForm.Morph(from, 0xDA);                                       // ostard
                    break;
                }

                case 107:
                {
                    AnimalForm.Morph(from, 0x51);                                       // bullfrog
                    break;
                }

                case 108:
                {
                    AnimalForm.Morph(from, 0x15);                                       // giant serpent
                    break;
                }

                case 109:                         // dog
                {
                    AnimalForm.Morph(from, 0xD9);
                    break;
                }

                case 110:
                {
                    AnimalForm.Morph(from, 0xC9);                                       // cat
                    break;
                }

                case 111:
                {
                    AnimalForm.Morph(from, 0xEE);                                       // rat
                    break;
                }

                case 112:
                {
                    AnimalForm.Morph(from, 0xCD);                                       // rabbit
                    break;
                }
                }
            }
        }
Esempio n. 14
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++;
					}
				}
			}
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (!SamuraiSpell.CheckExpansion(Caster))
            {
                Caster.SendLocalizedMessage(1063456);                   // You must upgrade to Samurai Empire in order to use that ability.

                return(false);
            }

            if (Caster.Skills[SkillName.Ninjitsu].Value < RequiredSkill)
            {
                string args = String.Format("{0}\t{1}\t ", RequiredSkill.ToString("F1"), CastSkill.ToString());
                Caster.SendLocalizedMessage(1063013, args);                   // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(false);
            }
            else if (Caster.Mana < ScaleMana(RequiredMana))
            {
                Caster.SendLocalizedMessage(1060174, RequiredMana.ToString());                   // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                return(false);
            }

            if (FocusAttack.UnderEffect(Caster) || DeathStrike.UnderEffect(Caster) || SurpriseAttack.UnderEffect(Caster) || Backstab.UnderEffect(Caster) || KiAttack.UnderEffect(Caster))
            {
                return(true);
            }

            if (AnimalForm.UnderEffect(Caster))
            {
                if (this is FocusAttack || this is DeathStrike || this is KiAttack || this is SurpriseAttack || this is Backstab)
                {
                    Caster.SendLocalizedMessage(1063024);                       // You cannot perform this special move right now.

                    return(false);
                }
            }

            WeaponAbility ability = WeaponAbility.GetCurrentAbility(Caster);

            if (ability != null)
            {
                WeaponAbility.ClearCurrentAbility(Caster);
            }

            if (HonorableExecution.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0x91, 0));

                HonorableExecution.m_Table.Remove(Caster);
            }

            if (LightningStrike.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0x95, 0));

                LightningStrike.m_Table.Remove(Caster);
            }

            if (MomentumStrike.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0x96, 0));

                MomentumStrike.m_Table.Remove(Caster);
            }

            return(true);
        }
Esempio n. 16
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);
                        AddHtml(x + 84, y, 250, 60, Color(String.Format(entries[i].Name), 0xFFFFFF), false, false);

                        current++;
                    }
                }
            }
Esempio n. 17
0
            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
            }