diff options
author | wushin <pasekei@gmail.com> | 2016-12-07 09:47:02 -0600 |
---|---|---|
committer | wushin <pasekei@gmail.com> | 2016-12-07 09:47:02 -0600 |
commit | 71daee9a428cda6e31e4b244114acbd12f71318e (patch) | |
tree | 7baa6637ab8c12e975daf5fb03bbc8c77ddf7001 /hercules/tmx_converter.py | |
parent | 5bcb34e711ee8ff7d5b6045ead02299aa0a7ea07 (diff) | |
download | evol-tools-71daee9a428cda6e31e4b244114acbd12f71318e.tar.gz evol-tools-71daee9a428cda6e31e4b244114acbd12f71318e.tar.bz2 evol-tools-71daee9a428cda6e31e4b244114acbd12f71318e.tar.xz evol-tools-71daee9a428cda6e31e4b244114acbd12f71318e.zip |
Add/Remove Maps to DB and Conf files
Diffstat (limited to 'hercules/tmx_converter.py')
-rwxr-xr-x | hercules/tmx_converter.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hercules/tmx_converter.py b/hercules/tmx_converter.py index 52c3c73..a6678af 100755 --- a/hercules/tmx_converter.py +++ b/hercules/tmx_converter.py @@ -54,6 +54,8 @@ CLIENT_MAPS = 'maps' SERVER_WLK = 'data' SERVER_NPCS = 'npc' MOB_DB_CONF = 'db/re/mob_db.conf' +MAP_CONF = 'conf/map/maps.conf' +MAP_DB_CONF = 'db/map_index.txt' NPC_MOBS = '_mobs.txt' NPC_SAVES = '_savepoints.txt' NPC_WARPS = '_warps.txt' @@ -385,6 +387,10 @@ def main(argv): npc_master = [] map_basenames = [] + map_conf = open(posixpath.join(server_data,MAP_CONF), 'w') + map_db = open(posixpath.join(server_data,MAP_DB_CONF), 'w') + map_conf.write("map_removed: (\n)\nmap_list: (\n") + map_count = 1 for arg in os.listdir(tmx_dir): base, ext = posixpath.splitext(arg) @@ -402,6 +408,11 @@ def main(argv): if os.path.isfile(posixpath.join(main.this_map_npc_dir, NPC_IMPORTS)): npc_master.append('@include "%s"\n' % posixpath.join(SERVER_NPCS, base, NPC_IMPORTS)) + + map_db.write('%s %d\n' % (arg.split('.')[0], map_count)) + map_conf.write(' "%s",\n' % (arg.split('.')[0])) + map_count += 1 + map_conf.write(")\n") with open(posixpath.join(npc_dir, NPC_MASTER_IMPORTS), 'w') as out: out.write('// %s\n\n' % MESSAGE) npc_master.sort() |