diff options
author | Jared Adams <jaxad0127@gmail.com> | 2008-11-11 14:39:23 +0000 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2008-11-11 14:39:23 +0000 |
commit | 4c665aa491a1b1669f8f6368d4f9609a75c13fde (patch) | |
tree | 72376d77d8437ff9df8b601e28109270884364da /tmwcon/src/converter/WLKInterface.java | |
parent | 14c1eacf60be23d28bb084743c4952714d7f99a0 (diff) | |
download | tools-4c665aa491a1b1669f8f6368d4f9609a75c13fde.tar.gz tools-4c665aa491a1b1669f8f6368d4f9609a75c13fde.tar.bz2 tools-4c665aa491a1b1669f8f6368d4f9609a75c13fde.tar.xz tools-4c665aa491a1b1669f8f6368d4f9609a75c13fde.zip |
Add a tool to convert from TMWServ format
This tool will convert warps and monster spawns from TMWServ format (tmx
files) into eAthena format. It will also generate the wlk files needed
by eAthena.
Diffstat (limited to 'tmwcon/src/converter/WLKInterface.java')
-rw-r--r-- | tmwcon/src/converter/WLKInterface.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tmwcon/src/converter/WLKInterface.java b/tmwcon/src/converter/WLKInterface.java new file mode 100644 index 0000000..da60c68 --- /dev/null +++ b/tmwcon/src/converter/WLKInterface.java @@ -0,0 +1,31 @@ +// + +package converter; + +import java.io.*; + +import tiled.core.*; +import tiled.plugins.tmw.*; + +public class WLKInterface { + private File folder; + public WLKInterface(File folder) { + WLKWriter.class.getName(); + this.folder = folder; + File f = new File("server-data/data"); + f.mkdirs(); + } + + public void write(String name, Map map) { + File wlk = new File(folder, name + ".wlk"); + + try { + wlk.createNewFile(); + WLKWriter.writeMap(map, new FileOutputStream(wlk)); + System.out.println("WLK written"); + } catch (Exception e) { + System.out.println("Prolem writing WLK file:"); + e.printStackTrace(); + } + } +} |