Пример #1
0
        private enmCommandResult DoChooseClass(object[] param)
        {
            byte classId = 0;

            try
            {
                classId = byte.Parse(param[0].ToString());
            }
            catch (Exception)
            {
                return(enmCommandResult.FAILED);
            }

            mCreatingHero.ResetAllClassLevel();
            mCreatingHero.SetClassLevel(classId, 1);

            //Roll();
            return(enmCommandResult.SUCCESS);
        }
Пример #2
0
        public static HeroInfo CreateRandomHero(byte hType, int crLevel)
        {
            HeroInfo info = new HeroInfo();

            if (hType == 2)
            {
                info.SetRace((byte)Dice(1, SingletonFactory <RaceConfig> .Instance.GetMaxId(hType), 100));
            }
            else
            {
                info.SetRace((byte)Dice(1, SingletonFactory <RaceConfig> .Instance.GetMaxId(hType)));
            }
            info.SetClassLevel((byte)Dice(1, SingletonFactory <ClassConfig> .Instance.GetMaxId()), 1);

            int diceNum, dice;

            switch (crLevel)
            {
            case 1:
                diceNum = 1;
                dice    = 4;
                break;

            default:
                diceNum = 3;
                dice    = 6;
                break;
            }

            Dictionary <enmPropType, int> basePoints = new Dictionary <enmPropType, int>();

            for (enmPropType type = enmPropType.BP_MIN + 1; type < enmPropType.BP_MAX; type++)
            {
                basePoints[type] = Dice(diceNum, dice);
            }
            info.InitBasePoints(basePoints);

            return(info);
        }