Exemplo n.º 1
0
 public static bool SetSkill(this Player p, ushort skillId, ushort curValue, ushort maxValue)
 {
     if (p.Skills.ContainsKey(skillId))
     {
         MirrorSkillInfo skill = p.Skills[skillId];
         skill.m_skillRank    = curValue;
         skill.m_skillMaxRank = maxValue;
         p.Skills[skillId]    = skill;
         return(true);
     }
     else
     {
         return(p.AddSkill(skillId));
     }
 }
Exemplo n.º 2
0
        private static ushort GetMaxRank(Player p, MirrorSkillInfo skill)
        {
            //TODO secondary prof spell check

            SkillLine cbi = DBC.SkillLine[skill.m_skillLineID];

            switch (cbi.m_skillType)
            {
            case 0:     //Weapon, Defense, Spell
                return((ushort)(p.Level * 5));

            case 4:     //Language, Riding, Secondary Profs
                if (cbi.m_categoryID == 1)
                {
                    return((ushort)cbi.m_maxRank);    //Language, Riding
                }
                else
                {
                    return((ushort)((p.Level * 5) + 25));    //Secondary Profs
                }
            }

            return(0);
        }