summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWushin <pasekei@gmail.com>2016-12-07 16:50:30 +0000
committerWushin <pasekei@gmail.com>2016-12-07 16:50:30 +0000
commit4cef62da36c6e5f434107211b92f810940a6945f (patch)
tree7baa6637ab8c12e975daf5fb03bbc8c77ddf7001
parent5bcb34e711ee8ff7d5b6045ead02299aa0a7ea07 (diff)
parent71daee9a428cda6e31e4b244114acbd12f71318e (diff)
downloadevol-tools-4cef62da36c6e5f434107211b92f810940a6945f.tar.gz
evol-tools-4cef62da36c6e5f434107211b92f810940a6945f.tar.bz2
evol-tools-4cef62da36c6e5f434107211b92f810940a6945f.tar.xz
evol-tools-4cef62da36c6e5f434107211b92f810940a6945f.zip
Merge branch 'add-maps-to-db-conf' into 'master'
Add/Remove Maps to DB and Conf files See merge request !14
-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()