Esempio n. 1
0
        private void InitializeGump(Mobile from)
        {
            Closable   = false;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            int nDown  = -90;
            int nRight = 5;
            int nPos   = 1024;

            AddButton((nPos + 34) + nRight, 90 + nDown, 0x082D, 0x082D, 0, GumpButtonType.Reply, 0);

            CustomWeaponAbilities.SetAbilities(m_weapon, ref Primary, ref Secondary, ref Third, ref Fourth, ref Fifth);

            AddImage((nPos + 34) + nRight, 109 + nDown, 0x5DD0);
            AddButton((nPos + 34) + nRight, 109 + nDown, PrimaryIcon, PrimaryIcon, 1, GumpButtonType.Reply, 0);
            AddImage(nPos + nRight, 109 + nDown, PrimaryState);
            if (AbilityNamesWeapon.From(from))
            {
                AddLabel((nPos + 86) + nRight, 120 + nDown, 0x481, @"" + GetAbilName(Primary) + "");
            }

            if (Abilities >= 2)
            {
                AddImage((nPos + 34) + nRight, 150 + nDown, 0x5DD0);
                AddButton((nPos + 34) + nRight, 150 + nDown, SecondaryIcon, SecondaryIcon, 2, GumpButtonType.Reply, 0);
                AddImage(nPos + nRight, 150 + nDown, SecondaryState);
                if (AbilityNamesWeapon.From(from))
                {
                    AddLabel((nPos + 86) + nRight, 161 + nDown, 0x481, @"" + GetAbilName(Secondary) + "");
                }
            }
            if (Abilities >= 3)
            {
                AddImage((nPos + 34) + nRight, 191 + nDown, 0x5DD0);
                AddButton((nPos + 34) + nRight, 191 + nDown, ThirdIcon, ThirdIcon, 3, GumpButtonType.Reply, 0);
                AddImage(nPos + nRight, 191 + nDown, ThirdState);
                if (AbilityNamesWeapon.From(from))
                {
                    AddLabel((nPos + 86) + nRight, 202 + nDown, 0x481, @"" + GetAbilName(Third) + "");
                }
            }
            if (Abilities >= 4)
            {
                AddImage((nPos + 34) + nRight, 232 + nDown, 0x5DD0);
                AddButton((nPos + 34) + nRight, 232 + nDown, FourthIcon, FourthIcon, 4, GumpButtonType.Reply, 0);
                AddImage(nPos + nRight, 232 + nDown, FourthState);
                if (AbilityNamesWeapon.From(from))
                {
                    AddLabel((nPos + 86) + nRight, 243 + nDown, 0x481, @"" + GetAbilName(Fourth) + "");
                }
            }
            if (Abilities >= 5)
            {
                AddImage((nPos + 34) + nRight, 273 + nDown, 0x5DD0);
                AddButton((nPos + 34) + nRight, 273 + nDown, FifthIcon, FifthIcon, 5, GumpButtonType.Reply, 0);
                AddImage(nPos + nRight, 273 + nDown, FifthState);
                if (AbilityNamesWeapon.From(from))
                {
                    AddLabel((nPos + 86) + nRight, 284 + nDown, 0x481, @"" + GetAbilName(Fifth) + "");
                }
            }
        }
        private void InitializeGump(Mobile from)
        {
            Closable   = false;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);

            int nLeft      = 50;
            int nDown      = 45;
            int nButton    = 50;
            int nText      = 13 + nButton;
            int nClose     = 1 + nButton;
            int nActivated = 0x22;

            CustomWeaponAbilities.SetAbilities(m_weapon, ref Primary, ref Secondary, ref Third, ref Fourth, ref Fifth);

            AddImage(nLeft + 7, nButton - 24, 3609);

            AddImage(nLeft, nButton, 0x5DD0);
            AddButton(nLeft, nButton, PrimaryIcon, PrimaryIcon, 1, GumpButtonType.Reply, 0);
            if (PrimaryState != 9781)
            {
                AddImage(nLeft, nButton, PrimaryIcon, nActivated);
            }
            else if (Server.Misc.GetPlayerInfo.isJester(from))
            {
                AddImage(nLeft, nButton, PrimaryIcon, 32);
            }
            else if (Server.Misc.GetPlayerInfo.isSyth(from, false))
            {
                AddImage(nLeft, nButton, PrimaryIcon, 0x22);
            }
            else if (Server.Misc.GetPlayerInfo.isJedi(from, false))
            {
                AddImage(nLeft, nButton, PrimaryIcon, 2825);
            }
            if (AbilityNamesWeapon.From(from))
            {
                AddLabel(nLeft + 52, nText, 0x481, @"" + GetAbilName(Primary) + "");
            }

            nButton = nButton + nDown;
            nText   = nText + nDown;
            nClose  = nClose + nDown;

            if (Abilities > 1)
            {
                AddImage(nLeft, nButton, 0x5DD0);
                AddButton(nLeft, nButton, SecondaryIcon, SecondaryIcon, 2, GumpButtonType.Reply, 0);
                if (SecondaryState != 9781)
                {
                    AddImage(nLeft, nButton, SecondaryIcon, nActivated);
                }
                else if (Server.Misc.GetPlayerInfo.isJester(from))
                {
                    AddImage(nLeft, nButton, SecondaryIcon, 69);
                }
                else if (Server.Misc.GetPlayerInfo.isSyth(from, false))
                {
                    AddImage(nLeft, nButton, SecondaryIcon, 0x22);
                }
                else if (Server.Misc.GetPlayerInfo.isJedi(from, false))
                {
                    AddImage(nLeft, nButton, SecondaryIcon, 2825);
                }
                if (AbilityNamesWeapon.From(from))
                {
                    AddLabel(nLeft + 52, nText, 0x481, @"" + GetAbilName(Secondary) + "");
                }

                nButton = nButton + nDown;
                nText   = nText + nDown;
                nClose  = nClose + nDown;
            }
            if (Abilities > 2)
            {
                AddImage(nLeft, nButton, 0x5DD0);
                AddButton(nLeft, nButton, ThirdIcon, ThirdIcon, 3, GumpButtonType.Reply, 0);
                if (ThirdState != 9781)
                {
                    AddImage(nLeft, nButton, ThirdIcon, nActivated);
                }
                else if (Server.Misc.GetPlayerInfo.isJester(from))
                {
                    AddImage(nLeft, nButton, ThirdIcon, 93);
                }
                else if (Server.Misc.GetPlayerInfo.isSyth(from, false))
                {
                    AddImage(nLeft, nButton, ThirdIcon, 0x22);
                }
                else if (Server.Misc.GetPlayerInfo.isJedi(from, false))
                {
                    AddImage(nLeft, nButton, ThirdIcon, 2825);
                }
                if (AbilityNamesWeapon.From(from))
                {
                    AddLabel(nLeft + 52, nText, 0x481, @"" + GetAbilName(Third) + "");
                }

                nButton = nButton + nDown;
                nText   = nText + nDown;
                nClose  = nClose + nDown;
            }
            if (Abilities > 3)
            {
                AddImage(nLeft, nButton, 0x5DD0);
                AddButton(nLeft, nButton, FourthIcon, FourthIcon, 4, GumpButtonType.Reply, 0);
                if (FourthState != 9781)
                {
                    AddImage(nLeft, nButton, FourthIcon, nActivated);
                }
                else if (Server.Misc.GetPlayerInfo.isJester(from))
                {
                    AddImage(nLeft, nButton, FourthIcon, 114);
                }
                else if (Server.Misc.GetPlayerInfo.isSyth(from, false))
                {
                    AddImage(nLeft, nButton, FourthIcon, 0x22);
                }
                else if (Server.Misc.GetPlayerInfo.isJedi(from, false))
                {
                    AddImage(nLeft, nButton, FourthIcon, 2825);
                }
                if (AbilityNamesWeapon.From(from))
                {
                    AddLabel(nLeft + 52, nText, 0x481, @"" + GetAbilName(Fourth) + "");
                }

                nButton = nButton + nDown;
                nText   = nText + nDown;
                nClose  = nClose + nDown;
            }
            if (Abilities > 4)
            {
                AddImage(nLeft, nButton, 0x5DD0);
                AddButton(nLeft, nButton, FifthIcon, FifthIcon, 5, GumpButtonType.Reply, 0);
                if (FifthState != 9781)
                {
                    AddImage(nLeft, nButton, FifthIcon, nActivated);
                }
                else if (Server.Misc.GetPlayerInfo.isJester(from))
                {
                    AddImage(nLeft, nButton, FifthIcon, 253);
                }
                else if (Server.Misc.GetPlayerInfo.isSyth(from, false))
                {
                    AddImage(nLeft, nButton, FifthIcon, 0x22);
                }
                else if (Server.Misc.GetPlayerInfo.isJedi(from, false))
                {
                    AddImage(nLeft, nButton, FifthIcon, 2825);
                }
                if (AbilityNamesWeapon.From(from))
                {
                    AddLabel(nLeft + 52, nText, 0x481, @"" + GetAbilName(Fifth) + "");
                }

                nButton = nButton + nDown;
                nText   = nText + nDown;
                nClose  = nClose + nDown;
            }

            AddButton(nLeft + 7, nClose, 4017, 4017, 0, GumpButtonType.Reply, 0);
        }