Example #1
0
        public IncreaseSkillsGump100(PlayerMobile mobile, SkillBall100 ball, double[] values, int page)
            : this(mobile, ball, false, page)
        {
            int zz = Core.SA ? 58 : Core.ML ? 55 : Core.SE ? 54 : Core.AOS ? 52 : 49;

            for (int x = 0; x < zz; x++)
            {
                m_StartValue[x] = values[x];
            }
        }
Example #2
0
        public IncreaseSkillsGump100(PlayerMobile mobile, SkillBall100 ball, bool first, int page)
            : base(50, 50)
        {
            m_Page   = page;
            m_Ball   = ball;
            m_Points = m_Ball.Points;
            m_Mobile = mobile;

            if (first)
            {
                int zz = Core.SA ? 58 : Core.ML ? 55 : Core.SE ? 54 : Core.AOS ? 52 : 49;
                m_StartValue = new double[zz];
                m_Page       = 0;
                for (int x = 0; x < zz; x++)
                {
                    m_StartValue[x] = m_Mobile.Skills[x].Base;
                }
            }

            int maxPage = Core.AOS ? 5 : 4;

            m_Mobile.CloseGump(typeof(IncreaseSkillsGump100));

            AddPage(0);

            AddBackground(0, 0, 476, 440, 0x13BE);

            AddLabel(10, 7, 2100, "Choose Skills");

            if (m_Page > 0)
            {
                AddButton(275, 7, 250, 251, 2, GumpButtonType.Reply, 0); // Prev Page
            }

            if (m_Page < maxPage)
            {
                AddButton(275, 395, 252, 253, 3, GumpButtonType.Reply, 0); // Next Page
            }

            AddLabel(160, 7, 2100, "Points Left: " + m_Points.ToString());

            //			We only need this "if" condition if we want to make them use it all up right now.
            //			if ( m_Points == 0 )
            //			{
            AddButton(305, 335, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0); // OK button
            //			}

            AddImage(170, -10, 0x58A);

            m_StartPos = m_Page * 10;
            int z = 0;
            int max;

            if (m_Page == maxPage)
            {
                max = Core.SA ? 8 : Core.ML ? 5 : Core.SE ? 4 : Core.AOS ? 2 : 9;
            }
            else
            {
                max = 10;
            }

            for (int i = m_StartPos; i < m_StartPos + max; i++)
            {
                int y = 20 + (30 * (++z));

                m_Skill = m_Mobile.Skills[i];

                AddLabel(10, y, 2124, m_Skill.Name.ToString());

                AddLabel(170, y, 2100, m_Skill.Base.ToString());

                if (CanLowerSkill(m_Skill, i, 1))
                {
                    AddButton(220, y, 0x1519, 0x1519, 1000 + i, GumpButtonType.Reply, 0); // Decrease
                }
                if (CanRaiseSkill(m_Skill, i, 1))
                {
                    AddButton(240, y, 0x151A, 0x151A, 2000 + i, GumpButtonType.Reply, 0); // Increase
                }
                if (CanLowerSkill(m_Skill, i, 5))
                {
                    AddButton(200, y - 2, 2229, 2229, 3000 + i, GumpButtonType.Reply, 0); // Decrease by 5
                }
                if (CanRaiseSkill(m_Skill, i, 5))
                {
                    AddButton(256, y - 2, 2229, 2229, 4000 + i, GumpButtonType.Reply, 0); // Increase by 5
                }
            }
        }