diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-05 21:51:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-05 21:51:46 +0300 |
commit | 954550635ebf6c61131ad8feb9695571b8337ff8 (patch) | |
tree | 67bb4bc422eaa476fb04a129140f157b79da1545 | |
parent | bbf8c98560d37e6bc3fe3182391aedecaa6ab9f2 (diff) | |
download | evol-tools-954550635ebf6c61131ad8feb9695571b8337ff8.tar.gz evol-tools-954550635ebf6c61131ad8feb9695571b8337ff8.tar.bz2 evol-tools-954550635ebf6c61131ad8feb9695571b8337ff8.tar.xz evol-tools-954550635ebf6c61131ad8feb9695571b8337ff8.zip |
hercules: add also items with view to items.xml
-rwxr-xr-x | hercules/maptool.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/hercules/maptool.py b/hercules/maptool.py index efdfb76..10f528a 100755 --- a/hercules/maptool.py +++ b/hercules/maptool.py @@ -18,6 +18,7 @@ import sys import zlib import struct import shutil +from sets import Set def detectCommand(): if sys.argv[0][-12:] == "/listmaps.py": @@ -217,6 +218,7 @@ def convertItems(): tpl = readFile(templatesDir + "item.tpl") items = readFile(templatesDir + "items.xml") data = "" + ids = Set() with open(itemsDbFile, "r") as f: for line in f: if len(line) < 10 or line[0:2] == "//" or line[0:12] != "REPLACE INTO": @@ -302,8 +304,16 @@ def convertItems(): image = "generic/box-fish.png" name = strToXml(name); - data = data + tpl.format(itemId, name, weight, - atk, matk, defence, attackRange, delay, image, typeStr, spriteStr) + + if itemId not in ids: + ids.add(itemId) + data = data + tpl.format(itemId, name, weight, + atk, matk, defence, attackRange, delay, image, typeStr, spriteStr) + if view != "0" and view not in ids: + ids.add(view) + data = data + tpl.format(view, name, weight, + atk, matk, defence, attackRange, delay, image, typeStr, spriteStr) + saveFile(destDir + "items.xml", items.format(data)) def readMapCache(path, cmd): |