Esempio n. 1
0
        public AssetDescription GetMapModel(string mapid, string model)
        {
            var ret = new AssetDescription();

            if (Type == GameType.DarkSoulsPTDE || Type == GameType.Bloodborne || Type == GameType.DemonsSouls)
            {
                ret.AssetPath = GetAssetPath($@"map\{mapid}\{model}.flver");
            }
            else if (Type == GameType.DarkSoulsIISOTFS)
            {
                ret.AssetPath = GetAssetPath($@"model\map\{mapid}.mapbhd");
            }
            else
            {
                ret.AssetPath = GetAssetPath($@"map\{mapid}\{model}.mapbnd.dcx");
            }
            ret.AssetName = model;
            if (Type == GameType.DarkSoulsIISOTFS)
            {
                ret.AssetArchiveVirtualPath = $@"map/{mapid}/model";
                ret.AssetVirtualPath        = $@"map/{mapid}/model/{model}.flv.dcx";
            }
            else
            {
                if (Type != GameType.DarkSoulsPTDE && Type != GameType.Bloodborne && Type != GameType.DemonsSouls)
                {
                    ret.AssetArchiveVirtualPath = $@"map/{mapid}/model/{model}";
                }
                ret.AssetVirtualPath = $@"map/{mapid}/model/{model}/{model}.flver";
            }
            return(ret);
        }
Esempio n. 2
0
        public AssetDescription GetChrTextures(string chrid)
        {
            AssetDescription ad = new AssetDescription();

            ad.AssetArchiveVirtualPath = null;
            ad.AssetPath = null;
            if (Type == GameType.DarkSoulsIII || Type == GameType.Sekiro)
            {
                string path = GetOverridenFilePath($@"chr\{chrid}.texbnd.dcx");
                if (path != null)
                {
                    ad.AssetPath = path;
                    ad.AssetArchiveVirtualPath = $@"chr/{chrid}/tex";
                }
            }
            if (Type == GameType.Bloodborne)
            {
                string path = GetOverridenFilePath($@"chr\{chrid}_2.tpf.dcx");
                if (path != null)
                {
                    ad.AssetPath        = path;
                    ad.AssetVirtualPath = $@"chr/{chrid}/tex";
                }
            }

            return(ad);
        }
Esempio n. 3
0
        public AssetDescription GetMapMSB(string mapid, bool writemode = false)
        {
            AssetDescription ad = new AssetDescription();

            ad.AssetPath = null;
            if (mapid.Length != 12)
            {
                return(ad);
            }
            if (Type == GameType.DarkSoulsIISOTFS)
            {
                var path = $@"map\{mapid}\{mapid}";
                if (GameModDirectory != null && File.Exists($@"{GameModDirectory}\{path}.msb") || (writemode && GameModDirectory != null))
                {
                    ad.AssetPath = $@"{GameModDirectory}\{path}.msb";
                }
                else if (File.Exists($@"{GameRootDirectory}\{path}.msb"))
                {
                    ad.AssetPath = $@"{GameRootDirectory}\{path}.msb";
                }
            }
            // BB chalice maps
            else if (Type == GameType.Bloodborne && mapid.StartsWith("m29"))
            {
                var path = $@"\map\MapStudio\{mapid.Substring(0, 9)}_00\{mapid}";
                if (GameModDirectory != null && File.Exists($@"{GameModDirectory}\{path}.msb.dcx") || (writemode && GameModDirectory != null && Type != GameType.DarkSoulsPTDE))
                {
                    ad.AssetPath = $@"{GameModDirectory}\{path}.msb.dcx";
                }
                else if (File.Exists($@"{GameRootDirectory}\{path}.msb.dcx"))
                {
                    ad.AssetPath = $@"{GameRootDirectory}\{path}.msb.dcx";
                }
            }
            else
            {
                var path = $@"\map\MapStudio\{mapid}";
                if (GameModDirectory != null && File.Exists($@"{GameModDirectory}\{path}.msb.dcx") || (writemode && GameModDirectory != null && Type != GameType.DarkSoulsPTDE))
                {
                    ad.AssetPath = $@"{GameModDirectory}\{path}.msb.dcx";
                }
                else if (File.Exists($@"{GameRootDirectory}\{path}.msb.dcx"))
                {
                    ad.AssetPath = $@"{GameRootDirectory}\{path}.msb.dcx";
                }
                else if (GameModDirectory != null && File.Exists($@"{GameModDirectory}\{path}.msb") || (writemode && GameModDirectory != null))
                {
                    ad.AssetPath = $@"{GameModDirectory}\{path}.msb";
                }
                else if (File.Exists($@"{GameRootDirectory}\{path}.msb"))
                {
                    ad.AssetPath = $@"{GameRootDirectory}\{path}.msb";
                }
            }
            ad.AssetName = mapid;
            return(ad);
        }
Esempio n. 4
0
        public AssetDescription GetHavokNavmeshes(string mapid)
        {
            var ret = new AssetDescription();

            ret.AssetPath = GetAssetPath($@"map\{mapid}\{mapid}.nvmhktbnd.dcx");
            ret.AssetName = mapid;
            ret.AssetArchiveVirtualPath = $@"map/{mapid}/nav";
            return(ret);
        }
Esempio n. 5
0
        public AssetDescription GetNullAsset()
        {
            var ret = new AssetDescription();

            ret.AssetPath = "null";
            ret.AssetName = "null";
            ret.AssetArchiveVirtualPath = "null";
            ret.AssetVirtualPath        = "null";
            return(ret);
        }
Esempio n. 6
0
        public AssetDescription GetHavokNavmeshModel(string mapid, string model)
        {
            var ret = new AssetDescription();

            ret.AssetPath = GetAssetPath($@"map\{mapid}\{mapid}.nvmhktbnd.dcx");
            ret.AssetName = model;
            ret.AssetArchiveVirtualPath = $@"map/{mapid}/nav";
            ret.AssetVirtualPath        = $@"map/{mapid}/nav/{model}.hkx";

            return(ret);
        }
Esempio n. 7
0
        public AssetDescription GetMapCollisionModel(string mapid, string model, bool hi = true)
        {
            var ret = new AssetDescription();

            if (Type == GameType.DarkSoulsPTDE || Type == GameType.DemonsSouls)
            {
                if (hi)
                {
                    ret.AssetPath        = GetAssetPath($@"map\{mapid}\{model}.hkx");
                    ret.AssetName        = model;
                    ret.AssetVirtualPath = $@"map/{mapid}/hit/hi/{model}.hkx";
                }
                else
                {
                    ret.AssetPath        = GetAssetPath($@"map\{mapid}\l{model.Substring(1)}.hkx");
                    ret.AssetName        = model;
                    ret.AssetVirtualPath = $@"map/{mapid}/hit/lo/l{model.Substring(1)}.hkx";
                }
            }
            else if (Type == GameType.DarkSoulsIISOTFS)
            {
                ret.AssetPath               = GetAssetPath($@"model\map\h{mapid.Substring(1)}.hkxbhd");
                ret.AssetName               = model;
                ret.AssetVirtualPath        = $@"map/{mapid}/hit/hi/{model}.hkx.dcx";
                ret.AssetArchiveVirtualPath = $@"map/{mapid}/hit/hi";
            }
            else if (Type == GameType.DarkSoulsIII || Type == GameType.Bloodborne)
            {
                if (hi)
                {
                    ret.AssetPath               = GetAssetPath($@"map\{mapid}\h{mapid.Substring(1)}.hkxbhd");
                    ret.AssetName               = model;
                    ret.AssetVirtualPath        = $@"map/{mapid}/hit/hi/h{model.Substring(1)}.hkx.dcx";
                    ret.AssetArchiveVirtualPath = $@"map/{mapid}/hit/hi";
                }
                else
                {
                    ret.AssetPath               = GetAssetPath($@"map\{mapid}\l{mapid.Substring(1)}.hkxbhd");
                    ret.AssetName               = model;
                    ret.AssetVirtualPath        = $@"map/{mapid}/hit/lo/l{model.Substring(1)}.hkx.dcx";
                    ret.AssetArchiveVirtualPath = $@"map/{mapid}/hit/lo";
                }
            }
            else
            {
                return(GetNullAsset());
            }
            return(ret);
        }
Esempio n. 8
0
        public AssetDescription GetObjModel(string obj)
        {
            var ret = new AssetDescription();

            ret.AssetName = obj;
            ret.AssetArchiveVirtualPath = $@"obj/{obj}/model";
            if (Type == GameType.DarkSoulsIISOTFS)
            {
                ret.AssetVirtualPath = $@"obj/{obj}/model/{obj}.flv";
            }
            else
            {
                ret.AssetVirtualPath = $@"obj/{obj}/model/{obj}.flver";
            }
            return(ret);
        }
Esempio n. 9
0
        public AssetDescription GetChrModel(string chr)
        {
            var ret = new AssetDescription();

            ret.AssetName = chr;
            ret.AssetArchiveVirtualPath = $@"chr/{chr}/model";
            if (Type == GameType.DarkSoulsIISOTFS)
            {
                ret.AssetVirtualPath = $@"chr/{chr}/model/{chr}.flv";
            }
            else
            {
                ret.AssetVirtualPath = $@"chr/{chr}/model/{chr}.flver";
            }
            return(ret);
        }
Esempio n. 10
0
        public AssetDescription GetDS2EventLocationParam(string mapid, bool writemode = false)
        {
            AssetDescription ad = new AssetDescription();
            var path            = $@"Param\eventlocation_{mapid}";

            if (GameModDirectory != null && File.Exists($@"{GameModDirectory}\{path}.param") || (writemode && GameModDirectory != null))
            {
                ad.AssetPath = $@"{GameModDirectory}\{path}.param";
            }
            else if (File.Exists($@"{GameRootDirectory}\{path}.param"))
            {
                ad.AssetPath = $@"{GameRootDirectory}\{path}.param";
            }
            ad.AssetName = mapid + "_event_locations";
            return(ad);
        }
Esempio n. 11
0
        public AssetDescription GetDS2GeneratorRegistParam(string mapid, bool writemode = false)
        {
            AssetDescription ad = new AssetDescription();
            var path            = $@"Param\generatorregistparam_{mapid}";

            if (GameModDirectory != null && File.Exists($@"{GameModDirectory}\{path}.param") || (writemode && GameModDirectory != null))
            {
                ad.AssetPath = $@"{GameModDirectory}\{path}.param";
            }
            else if (File.Exists($@"{GameRootDirectory}\{path}.param"))
            {
                ad.AssetPath = $@"{GameRootDirectory}\{path}.param";
            }
            ad.AssetName = mapid + "_generator_registrations";
            return(ad);
        }
Esempio n. 12
0
        public AssetDescription GetDS2ObjInstanceParam(string mapid, bool writemode = false)
        {
            AssetDescription ad = new AssetDescription();
            var path            = $@"Param\mapobjectinstanceparam_{mapid}";

            if (GameModDirectory != null && File.Exists($@"{GameModDirectory}\{path}.param") || (writemode && GameModDirectory != null))
            {
                ad.AssetPath = $@"{GameModDirectory}\{path}.param";
            }
            else if (File.Exists($@"{GameRootDirectory}\{path}.param"))
            {
                ad.AssetPath = $@"{GameRootDirectory}\{path}.param";
            }
            ad.AssetName = mapid + "_object_instance_params";
            return(ad);
        }
Esempio n. 13
0
        public AssetDescription GetMapNVMModel(string mapid, string model)
        {
            var ret = new AssetDescription();

            if (Type == GameType.DarkSoulsPTDE || Type == GameType.DemonsSouls)
            {
                ret.AssetPath = GetAssetPath($@"map\{mapid}\{model}.nvm");
                ret.AssetName = model;
                ret.AssetArchiveVirtualPath = $@"map/{mapid}/nav";
                ret.AssetVirtualPath        = $@"map/{mapid}/nav/{model}.nvm";
            }
            else
            {
                return(GetNullAsset());
            }
            return(ret);
        }
Esempio n. 14
0
        public AssetDescription GetEnglishItemMsgbnd(bool writemode = false)
        {
            string path = $@"msg\engus\item.msgbnd.dcx";

            if (Type == GameType.DemonsSouls)
            {
                path = $@"msg\na_english\item.msgbnd.dcx";
            }
            else if (Type == GameType.DarkSoulsPTDE)
            {
                path = $@"msg\ENGLISH\item.msgbnd";
            }
            else if (Type == GameType.DarkSoulsRemastered)
            {
                path = $@"msg\ENGLISH\item.msgbnd.dcx";
            }
            else if (Type == GameType.DarkSoulsIISOTFS)
            {
                // DS2 does not have an msgbnd but loose fmg files instead
                path = $@"menu\text\english";
                AssetDescription ad2 = new AssetDescription();
                ad2.AssetPath = writemode ? path : $@"{GameRootDirectory}\{path}";
                return(ad2);
            }
            else if (Type == GameType.DarkSoulsIII)
            {
                path = $@"msg\engus\item_dlc2.msgbnd.dcx";
            }
            AssetDescription ad = new AssetDescription();

            if (writemode)
            {
                ad.AssetPath = path;
                return(ad);
            }
            if (GameModDirectory != null && File.Exists($@"{GameModDirectory}\{path}") || (writemode && GameModDirectory != null))
            {
                ad.AssetPath = $@"{GameModDirectory}\{path}";
            }
            else if (File.Exists($@"{GameRootDirectory}\{path}"))
            {
                ad.AssetPath = $@"{GameRootDirectory}\{path}";
            }
            return(ad);
        }
Esempio n. 15
0
        public List <AssetDescription> GetMapModels(string mapid)
        {
            var ret = new List <AssetDescription>();

            if (Type == GameType.DarkSoulsIII || Type == GameType.Sekiro)
            {
                var mapfiles = Directory.GetFileSystemEntries(GameRootDirectory + $@"\map\{mapid}\", @"*.mapbnd.dcx").ToList();
                foreach (var f in mapfiles)
                {
                    var ad = new AssetDescription();
                    ad.AssetPath = f;
                    var name = Path.GetFileNameWithoutExtension(Path.GetFileNameWithoutExtension(f));
                    ad.AssetName = name;
                    ad.AssetArchiveVirtualPath = $@"map/{mapid}/model/{name}";
                    ad.AssetVirtualPath        = $@"map/{mapid}/model/{name}/{name}.flver";
                    ret.Add(ad);
                }
            }
            else if (Type == GameType.DarkSoulsIISOTFS)
            {
                var ad   = new AssetDescription();
                var name = mapid;
                ad.AssetName = name;
                ad.AssetArchiveVirtualPath = $@"map/{mapid}/model";
                ret.Add(ad);
            }
            else
            {
                var ext      = Type == GameType.DarkSoulsPTDE ? @"*.flver" : @"*.flver.dcx";
                var mapfiles = Directory.GetFileSystemEntries(GameRootDirectory + $@"\map\{mapid}\", ext).ToList();
                foreach (var f in mapfiles)
                {
                    var ad = new AssetDescription();
                    ad.AssetPath = f;
                    var name = Path.GetFileNameWithoutExtension(Path.GetFileNameWithoutExtension(f));
                    ad.AssetName = name;
                    //ad.AssetArchiveVirtualPath = $@"map/{mapid}/model/{name}";
                    ad.AssetVirtualPath = $@"map/{mapid}/model/{name}/{name}.flver";
                    ret.Add(ad);
                }
            }
            return(ret);
        }
Esempio n. 16
0
        public List <AssetDescription> GetMapTextures(string mapid)
        {
            List <AssetDescription> ads = new List <AssetDescription>();

            if (Type == GameType.DarkSoulsIISOTFS)
            {
                var t = new AssetDescription();
                t.AssetPath = GetAssetPath($@"model\map\t{mapid.Substring(1)}.tpfbhd");
                t.AssetArchiveVirtualPath = $@"map/tex/{mapid}/tex";
                ads.Add(t);
            }
            else if (Type == GameType.DarkSoulsPTDE)
            {
                //TODO
            }
            else if (Type == GameType.DemonsSouls)
            {
                var mid   = mapid.Substring(0, 3);
                var paths = Directory.GetFileSystemEntries($@"{GameRootDirectory}\map\{mid}\", "*.tpf.dcx");
                foreach (var path in paths)
                {
                    var ad = new AssetDescription();
                    ad.AssetPath = path;
                    var tid = Path.GetFileNameWithoutExtension(path).Substring(4, 4);
                    ad.AssetVirtualPath = $@"map/tex/{mid}/{tid}";
                    ads.Add(ad);
                }
            }
            else
            {
                var mid = mapid.Substring(0, 3);

                var t0000 = new AssetDescription();
                t0000.AssetPath = GetAssetPath($@"map\{mid}\{mid}_0000.tpfbhd");
                t0000.AssetArchiveVirtualPath = $@"map/tex/{mid}/0000";
                ads.Add(t0000);

                var t0001 = new AssetDescription();
                t0001.AssetPath = GetAssetPath($@"map\{mid}\{mid}_0001.tpfbhd");
                t0001.AssetArchiveVirtualPath = $@"map/tex/{mid}/0001";
                ads.Add(t0001);

                var t0002 = new AssetDescription();
                t0002.AssetPath = GetAssetPath($@"map\{mid}\{mid}_0002.tpfbhd");
                t0002.AssetArchiveVirtualPath = $@"map/tex/{mid}/0002";
                ads.Add(t0002);

                var t0003 = new AssetDescription();
                t0003.AssetPath = GetAssetPath($@"map\{mid}\{mid}_0003.tpfbhd");
                t0003.AssetArchiveVirtualPath = $@"map/tex/{mid}/0003";
                ads.Add(t0003);

                if (Type != GameType.Sekiro)
                {
                    var env = new AssetDescription();
                    env.AssetPath        = GetAssetPath($@"map\{mid}\{mid}_envmap.tpf.dcx");
                    env.AssetVirtualPath = $@"map/tex/{mid}/env";
                    ads.Add(env);
                }
            }

            return(ads);
        }