summaryrefslogtreecommitdiff
path: root/hercules/code/server/tmw/consts.py
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-02 15:19:50 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-02 15:19:50 +0300
commita6b6a2e85f9f8aa7ddade816d0f328c3b2ce0a8b (patch)
treeb4c178cc1efb610458ae45b5f4c887bd6e5cc645 /hercules/code/server/tmw/consts.py
parent12a366099b803264ccb2066d056ac17bd52d55d6 (diff)
downloadtools-a6b6a2e85f9f8aa7ddade816d0f328c3b2ce0a8b.tar.gz
tools-a6b6a2e85f9f8aa7ddade816d0f328c3b2ce0a8b.tar.bz2
tools-a6b6a2e85f9f8aa7ddade816d0f328c3b2ce0a8b.tar.xz
tools-a6b6a2e85f9f8aa7ddade816d0f328c3b2ce0a8b.zip
hercules: convert npc id to constants.
Diffstat (limited to 'hercules/code/server/tmw/consts.py')
-rw-r--r--hercules/code/server/tmw/consts.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/hercules/code/server/tmw/consts.py b/hercules/code/server/tmw/consts.py
index 2712cdc..64e2f64 100644
--- a/hercules/code/server/tmw/consts.py
+++ b/hercules/code/server/tmw/consts.py
@@ -52,7 +52,7 @@ def writeConst(w, const):
else:
w.write("\t{0}:{1}\n".format(const[0], const[1]))
-def convertConsts(quests):
+def convertConsts(quests, npcIds):
dstFile = "newserverdata/db/constants.conf"
fields = dict()
vals = [("MF_NOTELEPORT", "mf_noteleport"),
@@ -120,4 +120,11 @@ def convertConsts(quests):
print "warning: different const values for {0} ({1}, {2})".format(rows[0], rows[1][:-1], fields[rows[0]])
else:
writeConst(w, (rows[0], stripNewLine(rows[1]), 0))
+ w.write("// tmw npcs\n")
+ for npc in npcIds:
+ if npc == -1:
+ key = "MINUS1"
+ else:
+ key = str(npc)
+ writeConst(w, ("NPC" + key, npc, 0))
w.write("}")