summaryrefslogtreecommitdiff
path: root/hercules/code
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-31 19:35:12 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-31 19:35:12 +0300
commit832fae0992d7aa1cea19abd332fb3502f49578bf (patch)
tree0a044fc61dce910e821273c2da42d3188dddd492 /hercules/code
parent44abbdb0e49822f1954db3819184b13152ce78ff (diff)
downloadtools-832fae0992d7aa1cea19abd332fb3502f49578bf.tar.gz
tools-832fae0992d7aa1cea19abd332fb3502f49578bf.tar.bz2
tools-832fae0992d7aa1cea19abd332fb3502f49578bf.tar.xz
tools-832fae0992d7aa1cea19abd332fb3502f49578bf.zip
hercules: tmw: fix constants case issue.
Diffstat (limited to 'hercules/code')
-rw-r--r--hercules/code/server/tmw/consts.py23
-rw-r--r--hercules/code/server/tmw/npcs.py2
2 files changed, 24 insertions, 1 deletions
diff --git a/hercules/code/server/tmw/consts.py b/hercules/code/server/tmw/consts.py
index dfbf8e5..8f1cfcf 100644
--- a/hercules/code/server/tmw/consts.py
+++ b/hercules/code/server/tmw/consts.py
@@ -18,6 +18,24 @@ def convertConsts(quests):
dstFile = "newserverdata/db/const.txt"
fieldsSplit = re.compile("\t+")
fields = dict()
+ vals = [("MF_NOTELEPORT", "mf_noteleport"),
+ ("MF_NORETURN", "mf_noreturn"),
+ ("MF_MONSTER_NOTELEPORT", "mf_monster_noteleport"),
+ ("MF_NOSAVE", "mf_nosave"),
+ ("MF_NOPENALTY", "mf_nopenalty"),
+ ("MF_PVP", "mf_pvp"),
+ ("MF_PVP_NOPARTY", "mf_pvp_noparty"),
+ ("MF_PVP_NOCALCRANK", "mf_pvp_nocalcrank"),
+ ("MF_NOWARP", "mf_nowarp"),
+ ("MF_NOWARPTO", "mf_nowarpto"),
+ ("MF_SNOW", "mf_snow"),
+ ("MF_FOG", "mf_fog"),
+ ("MF_SAKURA", "mf_sakura"),
+ ("MF_LEAVES", "mf_leaves"),
+ ("MF_TOWN", "mf_town"),
+ ("sc_poison", "SC_POISON"),
+ ("sc_slowpoison", "SC_SLOWPOISON")
+ ]
with open(dstFile, "w") as w:
srcFile = "serverdata/db/const.txt"
with open(srcFile, "r") as r:
@@ -39,7 +57,7 @@ def convertConsts(quests):
w.write("ClientVersion\t10000\t1\n");
srcDir = "oldserverdata/db/"
- w.write("// evol constants\n")
+ w.write("// tmw constants\n")
for srcFile in getConstsFile(srcDir):
with open(srcFile, "r") as r:
for line in r:
@@ -50,6 +68,9 @@ def convertConsts(quests):
if len(rows) != 2:
continue
+ for val in vals:
+ if rows[0] == val[0]:
+ rows[0] = val[1]
if rows[0] in quests:
rows[1] = str(quests[rows[0]]) + "\n"
if rows[0] in fields:
diff --git a/hercules/code/server/tmw/npcs.py b/hercules/code/server/tmw/npcs.py
index f4b3ef6..fa8a825 100644
--- a/hercules/code/server/tmw/npcs.py
+++ b/hercules/code/server/tmw/npcs.py
@@ -277,6 +277,8 @@ def processStrReplace(tracker):
return
line = line.replace("setskill ", "addtoskill ")
line = line.replace("zeny", "Zeny")
+ line = line.replace("sc_poison", "SC_POISON")
+ line = line.replace("sc_slowpoison", "SC_SLOWPOISON")
line = line.replace("countitem(", "countitemcolor(")
line = re.sub("([^@^$])@([^@])", "\\1.@\\2", line)
line = line.replace(".@menu", "@menu")