summaryrefslogtreecommitdiff
path: root/tools/tmwcon/src/converter/WLKInterface.java
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2008-11-11 14:39:23 +0000
committerJared Adams <jaxad0127@gmail.com>2008-11-11 14:39:23 +0000
commit515f38e52100eac09275f0821e93e0eaf3e2cc3c (patch)
tree135d7d54c114e8a4e9c2c6882f72206819bf747e /tools/tmwcon/src/converter/WLKInterface.java
parentc38bbf027133f6e50947a7405b3a64dcbca3b0b9 (diff)
downloadserverdata-515f38e52100eac09275f0821e93e0eaf3e2cc3c.tar.gz
serverdata-515f38e52100eac09275f0821e93e0eaf3e2cc3c.tar.bz2
serverdata-515f38e52100eac09275f0821e93e0eaf3e2cc3c.tar.xz
serverdata-515f38e52100eac09275f0821e93e0eaf3e2cc3c.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 'tools/tmwcon/src/converter/WLKInterface.java')
-rw-r--r--tools/tmwcon/src/converter/WLKInterface.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/tmwcon/src/converter/WLKInterface.java b/tools/tmwcon/src/converter/WLKInterface.java
new file mode 100644
index 00000000..da60c688
--- /dev/null
+++ b/tools/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();
+ }
+ }
+}