diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-24 12:02:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-24 12:02:45 +0300 |
commit | d69559cd34637ef2d88a57d53314c795a7d74d3a (patch) | |
tree | 133282d2964b2398c4e0f2e4feb8057e93cff6fd /hercules/maptool.py | |
parent | a8151acf92fba0e0c8b09e7f04dbb7a4bc89834a (diff) | |
download | tools-d69559cd34637ef2d88a57d53314c795a7d74d3a.tar.gz tools-d69559cd34637ef2d88a57d53314c795a7d74d3a.tar.bz2 tools-d69559cd34637ef2d88a57d53314c795a7d74d3a.tar.xz tools-d69559cd34637ef2d88a57d53314c795a7d74d3a.zip |
hercules: in items.xml dont add attributes with value 0.
Diffstat (limited to 'hercules/maptool.py')
-rwxr-xr-x | hercules/maptool.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/hercules/maptool.py b/hercules/maptool.py index 26e5848..7b70403 100755 --- a/hercules/maptool.py +++ b/hercules/maptool.py @@ -229,6 +229,11 @@ def covertQuests(): data = data + tpl.format(questId, name, text + ": " + str(questId)) saveFile(destDir + "quests.xml", quests.format(data)) +def prepStat(val, text): + if val != "0" and val != "": + return " {0}=\"{1}\"\n".format(text, val) + return "" + def convertItems(): destDir = "clientdata/" templatesDir = "templates/" @@ -286,6 +291,12 @@ def convertItems(): name = name.replace("\\'", "'") image = "" + statStr = prepStat(atk, "attack") + statStr = statStr + prepStat(matk, "mattack") + statStr = statStr + prepStat(defence, "defence") + statStr = statStr + prepStat(weight, "weight") + statStr = statStr + prepStat(attackRange, "range") + statStr = statStr + prepStat(delay, "speed") # print itemId + "," + equipLocations # typeStr = "other" typeStr = "equip-legs" @@ -337,12 +348,12 @@ def convertItems(): if itemId not in ids: ids.add(itemId) - data = data + tpl.format(itemId, name, weight, - atk, matk, defence, attackRange, delay, image, typeStr, spriteStr) + data = data + tpl.format(itemId, name, 0, + statStr, 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) + data = data + tpl.format(view, name, 0, + statStr, image, typeStr, spriteStr) saveFile(destDir + "items.xml", items.format(data)) |