public void SetProfession(ProfessionInfo info)
        {
            for (int i = 0; i < _skillsCount; i++)
            {
                int skillIndex = info.SkillDefVal[i, 0];

                if (skillIndex >= _character.Skills.Length)
                {
                    continue;
                }

                if (!CUOEnviroment.IsOutlands && (World.ClientFeatures.Flags & CharacterListFlags.CLF_SAMURAI_NINJA) == 0 && (skillIndex == 52 || skillIndex == 53))
                {
                    // reset skills if needed
                    for (int k = 0; k < i; k++)
                    {
                        Skill skill = _character.Skills[info.SkillDefVal[k, 0]];
                        skill.ValueFixed = 0;
                        skill.BaseFixed  = 0;
                        skill.CapFixed   = 0;
                        skill.Lock       = Lock.Locked;
                    }

                    MessageBoxGump messageBox = new MessageBoxGump
                                                (
                        400,
                        300,
                        ClilocLoader.Instance.GetString(1063016),
                        null,
                        true
                                                )
                    {
                        X       = 470 / 2 - 400 / 2 + 100,
                        Y       = 372 / 2 - 300 / 2 + 20,
                        CanMove = false
                    };

                    UIManager.Add(messageBox);

                    return;
                }

                Skill skill2 = _character.Skills[skillIndex];
                skill2.ValueFixed = (ushort)info.SkillDefVal[i, 1];
                skill2.BaseFixed  = 0;
                skill2.CapFixed   = 0;
                skill2.Lock       = Lock.Locked;
            }

            _selectedProfession     = info;
            _character.Strength     = (ushort)_selectedProfession.StatsVal[0];
            _character.Intelligence = (ushort)_selectedProfession.StatsVal[1];
            _character.Dexterity    = (ushort)_selectedProfession.StatsVal[2];

            SetAttributes();

            SetStep(_selectedProfession.DescriptionIndex > 0 ? CharCreationStep.ChooseCity : CharCreationStep.ChooseTrade);
        }
Beispiel #2
0
        public static bool Remove(SkillsGroup g)
        {
            if (Groups[0] == g)
            {
                MessageBoxGump messageBox = new MessageBoxGump(200, 125, "Cannot delete this group.", null)
                {
                    X = ProfileManager.Current.GameWindowPosition.X + ProfileManager.Current.GameWindowSize.X / 2 - 100,
                    Y = ProfileManager.Current.GameWindowPosition.Y + ProfileManager.Current.GameWindowSize.Y / 2 - 62,
                };
                UIManager.Add(messageBox);
                return(false);
            }

            Groups.Remove(g);
            g.TransferTo(Groups[0]);

            return(true);
        }
Beispiel #3
0
        private void BoxOnHotkeyChanged(object sender, EventArgs e)
        {
            HotkeyBox b = (HotkeyBox)sender;

            bool shift = (b.Mod & SDL.SDL_Keymod.KMOD_SHIFT) != SDL.SDL_Keymod.KMOD_NONE;
            bool alt   = (b.Mod & SDL.SDL_Keymod.KMOD_ALT) != SDL.SDL_Keymod.KMOD_NONE;
            bool ctrl  = (b.Mod & SDL.SDL_Keymod.KMOD_CTRL) != SDL.SDL_Keymod.KMOD_NONE;

            if (b.Key != SDL.SDL_Keycode.SDLK_UNKNOWN && CUOEnviroment.Client.GetScene <GameScene>().Macros.FindMacro(b.Key, alt, ctrl, shift) != null)
            {
                MessageBoxGump gump = new MessageBoxGump(250, 250, "This key combination\nalready exists.", s => { b.SetKey(SDL.SDL_Keycode.SDLK_UNKNOWN, SDL.SDL_Keymod.KMOD_NONE); });
                UIManager.Add(gump);
            }
            else
            {
                Macro m = _collection.Macro;
                m.Key   = b.Key;
                m.Shift = shift;
                m.Alt   = alt;
                m.Ctrl  = ctrl;
            }
        }