Exemplo n.º 1
0
        public override Task Load()
        {
            return(Task.Run(() =>
            {
                if (SkillsCount > 0)
                {
                    return;
                }

                string path = Path.Combine(FileManager.UoFolderPath, "skills.mul");
                string pathidx = Path.Combine(FileManager.UoFolderPath, "Skills.idx");

                FileSystemHelper.EnsureFileExists(path);
                FileSystemHelper.EnsureFileExists(pathidx);

                _file = new UOFileMul(path, pathidx, 0, 16);
                _file.FillEntries(ref Entries);

                for (int i = 0; i < Entries.Length; i++)
                {
                    GetSkill(i);
                }

                SkillNames = _skills.Select(o => o.Value.Name).ToArray();
            }));
        }
Exemplo n.º 2
0
        public override Task Load()
        {
            return(Task.Run(() => {
                string path = Path.Combine(FileManager.UoFolderPath, "light.mul");
                string pathidx = Path.Combine(FileManager.UoFolderPath, "lightidx.mul");

                FileSystemHelper.EnsureFileExists(path);
                FileSystemHelper.EnsureFileExists(pathidx);

                _file = new UOFileMul(path, pathidx, Constants.MAX_LIGHTS_DATA_INDEX_COUNT);
                _file.FillEntries(ref Entries);
            }));
        }
Exemplo n.º 3
0
        public override Task Load()
        {
            return(Task.Run
                   (
                       () =>
            {
                if (SkillsCount > 0)
                {
                    return;
                }

                string path = UOFileManager.GetUOFilePath("skills.mul");
                string pathidx = UOFileManager.GetUOFilePath("Skills.idx");

                FileSystemHelper.EnsureFileExists(path);
                FileSystemHelper.EnsureFileExists(pathidx);

                _file = new UOFileMul(path, pathidx, 0, 16);
                _file.FillEntries(ref Entries);

                for (int i = 0, count = 0; i < Entries.Length; i++)
                {
                    ref UOFileIndex entry = ref GetValidRefEntry(i);

                    if (entry.Length > 0)
                    {
                        _file.SetData(entry.Address, entry.FileSize);
                        _file.Seek(entry.Offset);
                        bool hasAction = _file.ReadBool();

                        string name = Encoding.UTF8.GetString(_file.ReadArray <byte>(entry.Length - 1)).TrimEnd('\0');

                        /*
                         * if(skillUseless.Contains(name))  // giga487, UoMars
                         * {
                         *  continue;  // se carico le skill che ho messo dentro il vettore string skillUseless vado avanti.
                         * }
                         */

                        SkillEntry skill = new SkillEntry(count++, name, hasAction);
                        Skills.Add(skill);
                    }
                }

                SortedSkills.AddRange(Skills);
                SortedSkills.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.InvariantCulture));
            }
Exemplo n.º 4
0
        public override Task Load()
        {
            return(Task.Run
                   (
                       () =>
            {
                string path = UOFileManager.GetUOFilePath("light.mul");
                string pathidx = UOFileManager.GetUOFilePath("lightidx.mul");

                FileSystemHelper.EnsureFileExists(path);
                FileSystemHelper.EnsureFileExists(pathidx);

                _file = new UOFileMul(path, pathidx, Constants.MAX_LIGHTS_DATA_INDEX_COUNT);
                _file.FillEntries(ref Entries);
                _spriteInfos = new SpriteInfo[Entries.Length];
            }
                   ));
        }
Exemplo n.º 5
0
        public override Task Load()
        {
            return(Task.Run
                   (
                       () =>
            {
                if (SkillsCount > 0)
                {
                    return;
                }

                string path = UOFileManager.GetUOFilePath("skills.mul");
                string pathidx = UOFileManager.GetUOFilePath("Skills.idx");

                FileSystemHelper.EnsureFileExists(path);
                FileSystemHelper.EnsureFileExists(pathidx);

                _file = new UOFileMul(path, pathidx, 0, 16);
                _file.FillEntries(ref Entries);

                for (int i = 0, count = 0; i < Entries.Length; i++)
                {
                    ref UOFileIndex entry = ref GetValidRefEntry(i);

                    if (entry.Length > 0)
                    {
                        _file.Seek(entry.Offset);
                        bool hasAction = _file.ReadBool();

                        string name = Encoding.UTF8.GetString
                                          (_file.ReadArray <byte>(entry.Length - 1))
                                      .TrimEnd('\0');

                        SkillEntry skill = new SkillEntry(count++, name, hasAction);

                        Skills.Add(skill);
                    }
                }

                SortedSkills.AddRange(Skills);
                SortedSkills.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.InvariantCulture));
            }
Exemplo n.º 6
0
        public override Task Load()
        {
            return(Task.Run(() =>
            {
                if (SkillsCount > 0)
                {
                    return;
                }

                string path = UOFileManager.GetUOFilePath("skills.mul");
                string pathidx = UOFileManager.GetUOFilePath("Skills.idx");

                FileSystemHelper.EnsureFileExists(path);
                FileSystemHelper.EnsureFileExists(pathidx);

                _file = new UOFileMul(path, pathidx, 0, 16);
                _file.FillEntries(ref Entries);

                for (int i = 0, count = 0; i < Entries.Length; i++)
                {
                    ref readonly var entry = ref GetValidRefEntry(i);