summaryrefslogtreecommitdiff
path: root/hercules
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-19 13:54:41 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-19 13:54:41 +0300
commit74013ae165a5438aaa7983d4dad0e5d9217a1957 (patch)
treecf335ede54a72b826980754963f256acde04f465 /hercules
parent43989d89221a7fda3c6afed4c6621c5717b50fd4 (diff)
downloadevol-tools-74013ae165a5438aaa7983d4dad0e5d9217a1957.tar.gz
evol-tools-74013ae165a5438aaa7983d4dad0e5d9217a1957.tar.bz2
evol-tools-74013ae165a5438aaa7983d4dad0e5d9217a1957.tar.xz
evol-tools-74013ae165a5438aaa7983d4dad0e5d9217a1957.zip
hercules: fix quest constant values.
Diffstat (limited to 'hercules')
-rw-r--r--hercules/code/server/consts.py6
-rw-r--r--hercules/code/server/questsdb.py6
-rwxr-xr-xhercules/convert_server.py4
3 files changed, 12 insertions, 4 deletions
diff --git a/hercules/code/server/consts.py b/hercules/code/server/consts.py
index e132581..d2c5c9b 100644
--- a/hercules/code/server/consts.py
+++ b/hercules/code/server/consts.py
@@ -8,7 +8,7 @@ import re
from code.fileutils import *
from code.stringutils import *
-def convertConsts():
+def convertConsts(quests):
dstFile = "newserverdata/db/const.txt"
fieldsSplit = re.compile("\t+")
fields = dict()
@@ -29,6 +29,8 @@ def convertConsts():
w.write("{0}\t{1}".format(rows[0], rows[1]))
else:
w.write("{0}\t{1}\t{2}".format(rows[0], rows[1], rows[2]))
+ # build in parameters
+ w.write("ClientVersion\t10000\t1\n");
srcFile = "oldserverdata/db/const.txt"
w.write("// evol constants\n")
@@ -41,6 +43,8 @@ def convertConsts():
if len(rows) != 2:
continue
+ if rows[0] in quests:
+ rows[1] = str(quests[rows[0]]) + "\n"
if rows[0] in fields:
if fields[rows[0]] != rows[1][:-1]:
print "warning: different const values for {0} ({1}, {2})".format(rows[0], rows[1][:-1], fields[rows[0]])
diff --git a/hercules/code/server/questsdb.py b/hercules/code/server/questsdb.py
index 489acc7..c585b95 100644
--- a/hercules/code/server/questsdb.py
+++ b/hercules/code/server/questsdb.py
@@ -4,6 +4,7 @@
# Author: Andrei Karas (4144)
import re
+from sets import Set
from code.fileutils import *
from code.stringutils import *
@@ -12,6 +13,7 @@ def convertQuestsDb():
srcFile = "oldserverdata/db/questvars.txt"
dstFile = "newserverdata/db/quest_db.txt"
fieldsSplit = re.compile(",")
+ quests = dict()
with open(srcFile, "r") as r:
with open(dstFile, "w") as w:
tpl = readFile("templates/quest_db.tpl")
@@ -31,4 +33,6 @@ def convertQuestsDb():
line = line[:idx]
w.write("{0},0,0,0,0,0,0,0,\"{1}\"\n".format(cnt, line))
- cnt = cnt + 1 \ No newline at end of file
+ cnt = cnt + 1
+ quests[line] = cnt
+ return quests
diff --git a/hercules/convert_server.py b/hercules/convert_server.py
index 703870b..655e4ad 100755
--- a/hercules/convert_server.py
+++ b/hercules/convert_server.py
@@ -16,7 +16,7 @@ cleanServerData()
createMainScript()
convertNpcs()
convertMobDb()
-convertConsts()
+quests = convertQuestsDb()
+convertConsts(quests)
convertItemDb()
convertMobSkillDb()
-convertQuestsDb()