Esempio n. 1
0
 public BasicGameEntityFactory(
     ICharacterService characterService, ICharacterSkillService characterSkillService,
     ICharacterQuickListService characterQuicklist, ICharacterMateService characterMate,
     INpcMonsterService npcMonsterService, IMapMonsterService monsterService)
 {
     _characterService   = characterService;
     _characterSkill     = characterSkillService;
     _characterQuicklist = characterQuicklist;
     _characterMate      = characterMate;
     _npcMonsterService  = npcMonsterService;
     _monsterService     = monsterService;
 }
Esempio n. 2
0
        private void ExtractFiles()
        {
            _monsterDb = ChickenContainer.Instance.Resolve <INpcMonsterService>();
            _bcardDb   = ChickenContainer.Instance.Resolve <IBCardService>();
            _skillsDb  = ChickenContainer.Instance.Resolve <INpcMonsterSkillService>();
            _dropsDb   = ChickenContainer.Instance.Resolve <IDropService>();

            _monsterDb.Save(_monsters);
            _bcardDb.Save(_monsterBcards);
            _dropsDb.Save(_monsterDrops);
            _skillsDb.Save(_monsterSkills);
        }
Esempio n. 3
0
 public GameStartPacketHandler(IPlayerManager playerManager, IMapManager mapManager, IAlgorithmService algorithmService, ICharacterService characterService,
                               ICharacterSkillService characterSkillService, ICharacterQuickListService characterQuicklistService, ICharacterMateService characterMateService, INpcMonsterService npcMonsterService)
 {
     _playerManager             = playerManager;
     _mapManager                = mapManager;
     _algorithmService          = algorithmService;
     _characterService          = characterService;
     _characterSkillService     = characterSkillService;
     _characterQuicklistService = characterQuicklistService;
     _characterMateService      = characterMateService;
     _npcMonsterService         = npcMonsterService;
 }
Esempio n. 4
0
        public void Fill(string filePath)
        {
            _npcMonsterService = ChickenContainer.Instance.Resolve <INpcMonsterService>();
            string tmp = File.ReadAllText(filePath, Encoding.GetEncoding(1252));

            string[] lines = tmp.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);

            foreach (string line in lines.Where(s => s.StartsWith("e_info 10")))
            {
                string[] currentPacket = line.Split(new[] { ' ', '\t' }, StringSplitOptions.None);

                if (currentPacket.Length <= 25)
                {
                    continue;
                }

                NpcMonsterDto npcMonster = _npcMonsterService.GetById(short.Parse(currentPacket[2]));
                if (npcMonster == null)
                {
                    continue;
                }

                npcMonster.AttackClass          = byte.Parse(currentPacket[5]);
                npcMonster.AttackUpgrade        = byte.Parse(currentPacket[7]);
                npcMonster.DamageMinimum        = short.Parse(currentPacket[8]);
                npcMonster.DamageMaximum        = short.Parse(currentPacket[9]);
                npcMonster.Concentrate          = short.Parse(currentPacket[10]);
                npcMonster.CriticalChance       = byte.Parse(currentPacket[11]);
                npcMonster.CriticalRate         = short.Parse(currentPacket[12]);
                npcMonster.DefenceUpgrade       = byte.Parse(currentPacket[13]);
                npcMonster.CloseDefence         = short.Parse(currentPacket[14]);
                npcMonster.DefenceDodge         = short.Parse(currentPacket[15]);
                npcMonster.DistanceDefence      = short.Parse(currentPacket[16]);
                npcMonster.DistanceDefenceDodge = short.Parse(currentPacket[17]);
                npcMonster.MagicDefence         = short.Parse(currentPacket[18]);
                npcMonster.FireResistance       = sbyte.Parse(currentPacket[19]);
                npcMonster.WaterResistance      = sbyte.Parse(currentPacket[20]);
                npcMonster.LightResistance      = sbyte.Parse(currentPacket[21]);
                npcMonster.DarkResistance       = sbyte.Parse(currentPacket[22]);
                if (_npcMonsters.Any(s => s.Id == npcMonster.Id))
                {
                    continue;
                }

                _npcMonsters.Add(npcMonster);
            }

            _npcMonsterService.Save(_npcMonsters);
        }
Esempio n. 5
0
 public ReqInfoEventHandler(IPlayerManager playerManager, INpcMonsterService npcMonsterService)
 {
     _playerManager     = playerManager;
     _npcMonsterService = npcMonsterService;
 }
Esempio n. 6
0
 public PetEventHandler(INpcMonsterService npcMonsterService, IGameEntityFactory entityFactory)
 {
     _npcMonsterService = npcMonsterService;
     _entityFactory     = entityFactory;
 }