Exemple #1
0
        private void GetBasic(IReadOnlyList <string> currentLine, IMappedDto monster)
        {
            for (int i = 0; i < 4; i++)
            {
                byte type = (byte)int.Parse(currentLine[5 * i + 2]);
                if (type == 0)
                {
                    continue;
                }

                int first = int.Parse(currentLine[5 * i + 5]);

                var monsterCard = new BCardDto
                {
                    RelationType   = BCardRelationType.NpcMonster,
                    RelationId     = monster.Id,
                    Type           = (BCardType)type,
                    SubType        = (byte)((int.Parse(currentLine[5 * i + 6]) + 1) * 10 + 1 + (first > 0 ? 0 : 1)),
                    FirstData      = (short)((first > 0 ? first : -first) / 4),
                    SecondData     = (short)(int.Parse(currentLine[5 * i + 4]) / 4),
                    ThirdData      = (short)(int.Parse(currentLine[5 * i + 3]) / 4),
                    CastType       = 1,
                    IsLevelScaled  = false,
                    IsLevelDivided = false
                };
                _monsterBcards.Add(monsterCard);
                _monsterBCardsCount++;
            }
        }
        private void GetBasic(IReadOnlyList <string> currentLine, IMappedDto skill)
        {
            byte type = (byte)int.Parse(currentLine[3]);

            if (type == 0 || type == 255)
            {
                return;
            }

            int first    = int.Parse(currentLine[5]);
            var itemCard = new BCardDto
            {
                RelationType   = BCardRelationType.Skill,
                RelationId     = skill.Id,
                Type           = (BCardType)type,
                SubType        = (byte)((int.Parse(currentLine[4]) + 1) * 10 + 1 + (first < 0 ? 1 : 0)),
                IsLevelScaled  = Convert.ToBoolean(first % 4),
                IsLevelDivided = (first % 4) == 2,
                FirstData      = (short)((first > 0 ? first : -first) / 4),
                SecondData     = (short)(int.Parse(currentLine[6]) / 4),
                ThirdData      = (short)(int.Parse(currentLine[7]) / 4)
            };

            _skillBCards.Add(itemCard);
            _skillBCardsCount++;
        }
Exemple #3
0
        private void GetSkill(IReadOnlyList <string> currentLine, IMappedDto monster)
        {
            for (int i = 2; i < currentLine.Count - 3; i += 3)
            {
                short vnum = short.Parse(currentLine[i]);
                if (vnum == -1 || vnum == 0)
                {
                    break;
                }

                if (!_skills.ContainsKey(vnum))
                {
                    continue;
                }

                _monsterSkills.Add(new NpcMonsterSkillDto
                {
                    SkillId      = vnum,
                    Rate         = Convert.ToInt16(currentLine[i + 1]),
                    NpcMonsterId = monster.Id
                });
                _monsterSkillsCount++;
            }
        }
Exemple #4
0
 private static void GetVnum(IReadOnlyList <string> currentLine, IMappedDto monster)
 {
     monster.Id = Convert.ToInt16(currentLine[2]);
 }