Пример #1
0
        public MpqTerrainManager(TileIdentifier tileId)
        {
            var wowRootDir = DBCTool.FindWowDir();

            MpqManager = new MpqManager(wowRootDir);
            TileId     = tileId;

            var     entries = GetMapEntries();
            MapInfo entry   = null;

            foreach (var item in entries)
            {
                if (item.Id != tileId.MapId)
                {
                    continue;
                }

                entry = item;
                break;
            }

            WDTParser.MpqManager = MpqManager;
            _wdt = WDTParser.Process(entry);

            _adtManager              = new ADTManager(this);
            _wmoManager              = new WMOManager();
            _m2Manager               = new M2Manager();
            _meshManager             = new NavMeshManager();
            _selectedTriangleManager = new SelectedTriangleManager(_adtManager);
        }
Пример #2
0
            public override void Process(CmdTrigger <ToolCmdArgs> trigger)
            {
                var mod = trigger.Text.NextModifiers();

                if (mod == "e")
                {
                    WCellEnumWriter.WriteAllEnums();
                }
                else if (!mod.Contains("f") && VersionUpdater.WoWFile.Version <= WCellInfo.RequiredVersion)
                {
                    trigger.Reply("WCell does already have the same or higher version as the given client: " +
                                  WCellInfo.RequiredVersion);
                    trigger.Reply("Use the -f switch (force) to update again.");
                }
                else
                {
                    var dumpDBCs = !trigger.Text.HasNext || trigger.Text.NextBool();
                    trigger.Reply("Updating changes for client: {0} ...", VersionUpdater.WoWFile);
                    if (dumpDBCs)
                    {
                        trigger.Reply("Dumping DBC files...");
                        DBCTool.Dump(ToolConfig.WoWDir, true, false);
                    }
                    VersionUpdater.DoUpdate();
                    trigger.Reply("Done.");
                }
            }
Пример #3
0
            public override void Process(CmdTrigger <ToolCmdArgs> trigger)
            {
                var    mod = trigger.Text.NextModifiers();
                string dir;

                if (mod == "a")
                {
                    dir = DBCTool.FindWowDir(null);
                }
                else
                {
                    dir = Path.GetFullPath(trigger.Text.Remainder);
                    if (trigger.Text.Remainder.EndsWith(".exe"))
                    {
                        dir = Path.GetDirectoryName(dir);
                    }
                }

                if (!Directory.Exists(dir))
                {
                    trigger.Reply("Directory does not exist: " + dir);
                }
                else
                {
                    ToolConfig.WoWDir = dir;
                    ToolConfig.Instance.Save();
                    VersionUpdater.SetWowDir(ToolConfig.WoWFileLocation);
                    trigger.Reply("Selected client: {0}", VersionUpdater.WoWFile);
                }
            }
Пример #4
0
        public static List <DBCMapEntry> GetMapEntries()
        {
            var wowRootDir = DBCTool.FindWowDir(null);

            if (!Directory.Exists(wowRootDir))
            {
                log.Error("Could not find WoW-directory: \"{0}\"", wowRootDir);
                return(null);
            }

            var DBCMapEntryReader = new DBCReader <DBCMapEntry, DBCMapConverter>(
                RealmServerConfiguration.GetDBCFile("Map.dbc"));

            return(DBCMapEntryReader.EntryList);
        }
Пример #5
0
        /// <summary>
        /// Starts processing all WDT and ADT files
        /// </summary>
        public static void ProcessAll()
        {
            if (Parsed == null)
            {
                throw new Exception("WDTExtractor.Parsed must be set before calling WDTExtractor.Process");
            }

            var wowRootDir = DBCTool.FindWowDir();

            MpqManager = new MpqManager(wowRootDir);
            var entryList = GetMapEntries();

            WDTParser.MpqManager = MpqManager;
            foreach (var mapEntry in entryList)
            {
                //if (mapEntry.Id != MapId.EasternKingdoms) continue;
                var wdt = WDTParser.Process(mapEntry);
                if (wdt == null)
                {
                    continue;
                }

                var path = Path.Combine(TerrainDisplayConfig.MapDir, wdt.Entry.Id.ToString());
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }

                var filePath = Path.Combine(path, string.Format("{0}{1}", wdt.Entry.Id, Extension));
                using (var file = File.Create(filePath))
                {
                    WriteWdt(file, wdt);
                    file.Close();
                }
                Parsed(wdt);
            }
        }
Пример #6
0
 public override void Process(CmdTrigger <ToolCmdArgs> trigger)
 {
     trigger.Reply("Dumping DBC files...");
     DBCTool.Dump(ToolConfig.WoWDir, true, false);
 }
Пример #7
0
 public static void DumpDBCs()
 {
     DBCTool.Dump(Path.GetDirectoryName(_wowFile.FileName), true, false);
 }
Пример #8
0
 public static void DumpDBCs()
 {
     DBCTool.DumpToDir(DBCFolder);
 }
Пример #9
0
        public static ZoneTileSet[] GetZoneTileSets()
        {
            var wowRootDir = DBCTool.FindWowDir(null);

            manager = new MpqManager(wowRootDir);

            var entryList = GetMapEntries();

            if (entryList == null)
            {
                Console.WriteLine("Error retrieving Map Entries.");
                return(null);
            }

            var tiles = new ZoneTileSet[(int)MapId.End];
            var count = 0;

            foreach (var dbcMapEntry in entryList)
            {
                var dir     = dbcMapEntry.MapDirName;
                var wdtDir  = Path.Combine(baseDir, dir);
                var wdtName = dir;

                var wdt = RegionBoundaries.Process(manager, wdtDir, wdtName + ".wdt");
                if (wdt == null)
                {
                    continue;
                }

                if ((wdt.Header.Header1 & WDTFlags.GlobalWMO) == 0)
                {
                    var tileSet = new ZoneTileSet();

                    // Read in the Tiles
                    for (var y = 0; y < 64; y++)
                    {
                        for (var x = 0; x < 64; x++)
                        {
                            if (!wdt.TileProfile[x, y])
                            {
                                continue;
                            }
                            ++count;
                            var adtName = string.Format("{0}_{1:00}_{2:00}", wdtName, x, y);
                            var adt     = Process(manager, wdtDir, adtName);
                            if (adt == null)
                            {
                                continue;
                            }

                            // Read in the TileChunks
                            for (var j = 0; j < 16; j++)
                            {
                                for (var i = 0; i < 16; i++)
                                {
                                    var areaId = adt.MapChunks[i, j].AreaId;
                                    tileSet.ZoneGrids[x, y].ZoneIds[i, j] = (ZoneId)areaId;
                                }
                            }
                        }
                    }

                    tiles[dbcMapEntry.Id] = tileSet;
                }
                else
                {
                    log.Info("Could not read Zones from WMO: " + (MapId)dbcMapEntry.Id);
                }
            }

            log.Info("Exported {0} ZoneTileSets.", count);

            return(tiles);
        }
Пример #10
0
 public string GetWoWDir()
 {
     return(wowDir ?? (wowDir = DBCTool.FindWowDir()));
 }
Пример #11
0
 public override void Process(CmdTrigger <ToolCmdArgs> trigger)
 {
     DBCTool.DumpToDir(RealmServerConfiguration.Instance.DBCFolder);
 }