summaryrefslogtreecommitdiff
path: root/hercules
diff options
context:
space:
mode:
authorwushin <pasekei@gmail.com>2016-12-07 09:47:02 -0600
committerwushin <pasekei@gmail.com>2016-12-07 09:47:02 -0600
commit71daee9a428cda6e31e4b244114acbd12f71318e (patch)
tree7baa6637ab8c12e975daf5fb03bbc8c77ddf7001 /hercules
parent5bcb34e711ee8ff7d5b6045ead02299aa0a7ea07 (diff)
downloadtools-71daee9a428cda6e31e4b244114acbd12f71318e.tar.gz
tools-71daee9a428cda6e31e4b244114acbd12f71318e.tar.bz2
tools-71daee9a428cda6e31e4b244114acbd12f71318e.tar.xz
tools-71daee9a428cda6e31e4b244114acbd12f71318e.zip
Add/Remove Maps to DB and Conf files
Diffstat (limited to 'hercules')
-rwxr-xr-xhercules/tmx_converter.py11
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()