summaryrefslogtreecommitdiff
path: root/hercules
diff options
context:
space:
mode:
Diffstat (limited to 'hercules')
-rwxr-xr-xhercules/maptool.py19
-rw-r--r--hercules/templates/item.tpl12
2 files changed, 18 insertions, 13 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))
diff --git a/hercules/templates/item.tpl b/hercules/templates/item.tpl
index e7ee095..a7f28a9 100644
--- a/hercules/templates/item.tpl
+++ b/hercules/templates/item.tpl
@@ -1,13 +1,7 @@
<item id="{0}"
name="{1}"
description="{1}"
- weight="{2}"
- attack="{3}"
- mattack="{4}"
- defense="{5}"
- range="{6}"
- speed="{7}"
- image="{8}"
- type="{9}">
- <sprite>{10}</sprite>
+{3} image="{4}"
+ type="{5}">
+ <sprite>{6}</sprite>
</item>