Пример #1
0
 public ComboTimer(Mobile from, XmlCustomAttacks a, TimeSpan delay)
     : base(delay)
 {
     this.Priority     = TimerPriority.OneSecond;
     this.m_attachment = a;
     this.m_from       = from;
 }
Пример #2
0
        public static void AddAttack(object target, SpecialAttacks attack)
        {
            // is there an existing custom attacks attachment to add to?
            XmlCustomAttacks a = (XmlCustomAttacks)XmlAttach.FindAttachment(target, typeof(XmlCustomAttacks));

            if (a == null)
            {
                // add a new custom attacks attachment
                XmlAttach.AttachTo(target, new XmlCustomAttacks(attack));
            }
            else
            {
                // add the new attack to existing attack list
                a.AddSpecial(attack);
            }
        }
Пример #3
0
            public CustomAttacksInfoGump(Mobile from, XmlCustomAttacks a, SpecialAttack s)
                : base(0, 0)
            {
                this.m_attachment = a;
                this.m_special    = s;

                // prepare the page
                this.AddPage(0);

                this.AddBackground(0, 0, 400, 300, 5054);
                this.AddAlphaRegion(0, 0, 400, 300);
                this.AddLabel(20, 2, 55, String.Format("{0}", s.Name));

                StringBuilder text = new StringBuilder();

                text.AppendFormat("\n{0}", s.Description);

                text.AppendFormat("\n\nMinimum Stats/Skills:");
                if (s.StrReq > 0)
                {
                    text.AppendFormat("\n     {0} Str", s.StrReq);
                }
                if (s.DexReq > 0)
                {
                    text.AppendFormat("\n     {0} Dex", s.DexReq);
                }
                if (s.IntReq > 0)
                {
                    text.AppendFormat("\n     {0} Int", s.IntReq);
                }

                if (s.Skills != null)
                {
                    for (int i = 0; i < s.Skills.Length; i++)
                    {
                        if (i < s.MinSkillLevel.Length)
                        {
                            text.AppendFormat("\n     {1} {0}", s.Skills[i].ToString(), s.MinSkillLevel[i]);
                        }
                        else
                        {
                            text.AppendFormat("\n     {1} {0}", s.Skills[i].ToString(), "???");
                        }
                    }
                }

                text.AppendFormat("\n\nConsumes:");

                // generate the text requirements
                if (s.ManaReq > 0)
                {
                    text.AppendFormat("\n     {0} Mana", s.ManaReq);
                }
                if (s.StamReq > 0)
                {
                    text.AppendFormat("\n     {0} Stamina", s.StamReq);
                }
                if (s.HitsReq > 0)
                {
                    text.AppendFormat("\n     {0} Hits", s.HitsReq);
                }
                if (s.KarmaReq > 0)
                {
                    text.AppendFormat("\n     {0} Karma", s.KarmaReq);
                }

                if (s.Reagents != null)
                {
                    for (int i = 0; i < s.Reagents.Length; i++)
                    {
                        if (i < s.Quantity.Length)
                        {
                            text.AppendFormat("\n     {1} {0}", s.Reagents[i].Name, s.Quantity[i]);
                        }
                        else
                        {
                            text.AppendFormat("\n     {1} {0}", s.Reagents[i].Name, "???");
                        }
                    }
                }

                this.AddHtml(20, 20, 360, 260, text.ToString(), true, true);
            }
Пример #4
0
            public CustomAttacksGump(Mobile from, XmlCustomAttacks a)
                : base(0, 0)
            {
                if (a == null)
                {
                    return;
                }
                if (from != null)
                {
                    from.CloseGump(typeof(CustomAttacksGump));
                }

                this.m_attachment = a;

                int specialcount = a.Specials.Count;

                // prepare the page
                this.AddPage(0);

                this.AddBackground(0, 0, 70, 75 + specialcount * vertspacing, 5054);
                this.AddLabel(15, 2, 55, "Attack");
                // if combos are still active then give it the green light
                if (this.m_attachment != null && this.m_attachment.HasActiveCombos)
                {
                    // green button
                    //AddImage( 20, 10, 0x2a4e );
                    this.AddImage(15, 25, 0x0a53);
                }
                else
                {
                    // red button
                    //AddImage( 20, 10, 0x2a62 );
                    this.AddImage(15, 25, 0x0a52);
                }
                // go through the list of enabled moves and add buttons for them
                int y = 70;

                for (int i = 0; i < specialcount; i++)
                {
                    SpecialAttack s = (SpecialAttack)this.m_attachment.Specials[i];

                    // flag the attack as being selected
                    // this puts a white background behind the selected attack.  Doesnt look as nice, but works in both the
                    // 2D and 3D client.  I prefer to leave this commented out for best appearance in the 2D client but
                    // feel free to uncomment it for best client compatibility.

                    /*
                     * if(m_attachment != null && m_attachment.m_SelectedAttack != null && m_attachment.m_SelectedAttack == s)
                     * {
                     * AddImageTiled( 2, y-2, 66, vertspacing+2, 0xBBC );
                     * }
                     */

                    // add the attack button

                    if (s.IconType == IconTypes.ItemID)
                    {
                        this.AddButton(5, y, 0x5207, 0x5207, (int)s.AttackID + 1000, GumpButtonType.Reply, 0);
                        this.AddImageTiled(5, y, 44, 44, 0x283E);
                        this.AddItem(5, y, s.Icon);
                    }
                    else
                    {
                        this.AddButton(5, y, s.Icon, s.Icon, (int)s.AttackID + 1000, GumpButtonType.Reply, 0);
                    }

                    // flag the attack as being selected
                    // colors the attack icon red.  Looks better that the white background highlighting, but only supported by the 2D client.
                    if (this.m_attachment != null && this.m_attachment.m_SelectedAttack != null && this.m_attachment.m_SelectedAttack == s)
                    {
                        if (s.IconType == IconTypes.ItemID)
                        {
                            this.AddItem(5, y, s.Icon, 33);
                        }
                        else
                        {
                            this.AddImage(5, y, s.Icon, 33);
                        }
                    }

                    // add the info button
                    this.AddButton(52, y + 13, 0x4b9, 0x4b9, 2000 + (int)s.AttackID, GumpButtonType.Reply, 0);

                    y += vertspacing;
                }
            }
Пример #5
0
            public CustomAttacksGump( Mobile from, XmlCustomAttacks a)
                : base(0,0)
            {
                if(a == null)
                {
                    return;
                }
                if(from != null)
                    from.CloseGump(typeof( CustomAttacksGump));

                m_attachment = a;

                int specialcount = a.Specials.Count;

                // prepare the page
                AddPage( 0 );

                AddBackground( 0, 0, 70, 75 + specialcount*vertspacing, 5054 );
                AddLabel( 10, 2, 55, "Attack" );
                // if combos are still active then give it the green light
                if(m_attachment != null && m_attachment.HasActiveCombos)
                {
                    // green button
                    //AddImage( 20, 10, 0x2a4e );
                    AddImage( 15, 25, 0x0a53 );
                } else
                {
                    // red button
                    //AddImage( 20, 10, 0x2a62 );
                    AddImage( 15, 25, 0x0a52 );
                }
                // go through the list of enabled moves and add buttons for them
                int y = 70;
                for(int i = 0;i<specialcount;i++)
                {
                    SpecialAttack s = (SpecialAttack)m_attachment.Specials[i];

                    // flag the attack as being selected
                    // this puts a white background behind the selected attack.  Doesnt look as nice, but works in both the
                    // 2D and 3D client.  I prefer to leave this commented out for best appearance in the 2D client but
                    // feel free to uncomment it for best client compatibility.
                    /*
                    if(m_attachment != null && m_attachment.m_SelectedAttack != null && m_attachment.m_SelectedAttack == s)
                    {
                        AddImageTiled( 2, y-2, 66, vertspacing+2, 0xBBC );
                    }
                    */

                    // add the attack button

                    if(s.IconType == IconTypes.ItemID)
                    {
                        AddButton( 5, y, 0x5207, 0x5207, (int)s.AttackID + 1000, GumpButtonType.Reply, 0 );
                        AddImageTiled( 5, y, 44, 44, 0x283E );
                        AddItem(5, y, s.Icon);
                    } else
                    {
                        AddButton( 5, y, s.Icon, s.Icon, (int)s.AttackID + 1000, GumpButtonType.Reply, 0 );
                    }

                    // flag the attack as being selected
                    // colors the attack icon red.  Looks better that the white background highlighting, but only supported by the 2D client.
                    if(m_attachment != null && m_attachment.m_SelectedAttack != null && m_attachment.m_SelectedAttack == s)
                    {
                        if(s.IconType == IconTypes.ItemID)
                        {
                            AddItem( 5, y, s.Icon, 33 );
                        } else
                        {
                            AddImage( 5, y, s.Icon, 33 );
                        }
                    }

                    // add the info button
                    AddButton( 52, y+13, 0x4b9, 0x4b9, 2000+(int)s.AttackID, GumpButtonType.Reply, 0 );

                    y += vertspacing;
                }
            }
Пример #6
0
 public ComboTimer( Mobile from, XmlCustomAttacks a, TimeSpan delay )
     : base(delay)
 {
     Priority = TimerPriority.OneSecond;
     m_attachment = a;
     m_from = from;
 }
Пример #7
0
            public CustomAttacksInfoGump( Mobile from, XmlCustomAttacks a, SpecialAttack s)
                : base(0,0)
            {
                m_attachment = a;
                m_special = s;

                // prepare the page
                AddPage( 0 );

                AddBackground( 0, 0, 400, 300, 5054 );
                AddAlphaRegion( 0, 0, 400, 300 );
                AddLabel( 20, 2, 55, String.Format("{0}",s.Name) );

                StringBuilder text = new StringBuilder();

                text.AppendFormat("\n{0}", s.Description );

                text.AppendFormat("\n\nMinimum Stats/Skills:" );
                if(s.StrReq > 0)
                {
                    text.AppendFormat("\n     {0} Str", s.StrReq );
                }
                if(s.DexReq > 0)
                {
                    text.AppendFormat("\n     {0} Dex", s.DexReq );
                }
                if(s.IntReq > 0)
                {
                    text.AppendFormat("\n     {0} Int", s.IntReq );
                }

                if(s.Skills != null)
                for(int i = 0;i < s.Skills.Length;i++)
                {
                    if(i < s.MinSkillLevel.Length)
                    {
                        text.AppendFormat("\n     {1} {0}", s.Skills[i].ToString(), s.MinSkillLevel[i]  );
                    } else
                    {
                        text.AppendFormat("\n     {1} {0}", s.Skills[i].ToString(), "???"  );
                    }
                }

                text.AppendFormat("\n\nConsumes:" );

                // generate the text requirements
                if(s.ManaReq > 0)
                {
                    text.AppendFormat("\n     {0} Mana", s.ManaReq );
                }
                if(s.StamReq > 0)
                {
                    text.AppendFormat("\n     {0} Stamina", s.StamReq );
                }
                if(s.HitsReq > 0)
                {
                    text.AppendFormat("\n     {0} Hits", s.HitsReq );
                }
                if(s.KarmaReq > 0)
                {
                    text.AppendFormat("\n     {0} Karma", s.KarmaReq );
                }

                if(s.Reagents != null)
                for(int i = 0;i < s.Reagents.Length;i++)
                {
                    if(i < s.Quantity.Length)
                    {
                        text.AppendFormat("\n     {1} {0}", s.Reagents[i].Name, s.Quantity[i]  );
                    } else
                    {
                        text.AppendFormat("\n     {1} {0}", s.Reagents[i].Name, "???"  );
                    }
                }

                AddHtml( 20,20, 360, 260, text.ToString(), true , true );
            }