bool validateSkills() { CreateCharSkillsGump gump = CurrentGump as CreateCharSkillsGump; // we need to make sure that the stats add up to 80, skills add up to 100, and 3 unique skills are selected. // if not, pop up an appropriate error message. if (gump.Strength + gump.Dexterity + gump.Intelligence != 80) { MsgBoxGump.Show("Error: your stat values did not add up to 80. Please logout and try to make another character.", MsgBoxTypes.OkOnly); return(false); } if (gump.SkillPoints0 + gump.SkillPoints1 + gump.SkillPoints2 != 100) { MsgBoxGump.Show("Error: your skill values did not add up to 100. Please logout and try to make another character.", MsgBoxTypes.OkOnly); return(false); } if (gump.SkillIndex0 == -1 || gump.SkillIndex1 == -1 || gump.SkillIndex2 == -1 || (gump.SkillIndex0 == gump.SkillIndex1) || (gump.SkillIndex1 == gump.SkillIndex2) || (gump.SkillIndex0 == gump.SkillIndex2)) { MsgBoxGump.Show("You must have three unique skills chosen!", MsgBoxTypes.OkOnly); return(false); } (CurrentGump as CreateCharSkillsGump).SaveData(m_Data); return(true); }
void openSkillsGump() { m_CreateSkillsGump = (CreateCharSkillsGump)m_UserInterface.AddControl(new CreateCharSkillsGump(), 0, 0); m_CreateSkillsGump.OnForward += OnForward; m_CreateSkillsGump.OnBackward += OnBackward; m_Status = CreateCharacterSceneStates.ChooseSkills; // restore values if (m_skillsSet) { m_CreateSkillsGump.Strength = m_attributes[0]; m_CreateSkillsGump.Dexterity = m_attributes[1]; m_CreateSkillsGump.Intelligence = m_attributes[2]; m_CreateSkillsGump.SkillIndex0 = m_skillIndexes[0]; m_CreateSkillsGump.SkillIndex1 = m_skillIndexes[1]; m_CreateSkillsGump.SkillIndex2 = m_skillIndexes[2]; m_CreateSkillsGump.SkillPoints0 = m_skillValues[0]; m_CreateSkillsGump.SkillPoints1 = m_skillValues[1]; m_CreateSkillsGump.SkillPoints2 = m_skillValues[2]; } }