diff options
Diffstat (limited to 'hercules')
-rw-r--r-- | hercules/code/server/evol/main.py | 2 | ||||
-rw-r--r-- | hercules/code/server/evol/mobskilldb.py (renamed from hercules/code/server/mobskilldb.py) | 0 | ||||
-rw-r--r-- | hercules/code/server/tmw/main.py | 4 | ||||
-rw-r--r-- | hercules/code/server/tmw/mobskilldb.py | 50 |
4 files changed, 53 insertions, 3 deletions
diff --git a/hercules/code/server/evol/main.py b/hercules/code/server/evol/main.py index bdc891a..ca5ce84 100644 --- a/hercules/code/server/evol/main.py +++ b/hercules/code/server/evol/main.py @@ -7,7 +7,7 @@ from code.server.evol.consts import * from code.server.evol.itemdb import * from code.server.evol.mobdb import * -from code.server.mobskilldb import * +from code.server.evol.mobskilldb import * from code.server.evol.npcs import * from code.server.utils import * from code.server.questsdb import * diff --git a/hercules/code/server/mobskilldb.py b/hercules/code/server/evol/mobskilldb.py index 6f0bf12..6f0bf12 100644 --- a/hercules/code/server/mobskilldb.py +++ b/hercules/code/server/evol/mobskilldb.py diff --git a/hercules/code/server/tmw/main.py b/hercules/code/server/tmw/main.py index 096dae0..4822199 100644 --- a/hercules/code/server/tmw/main.py +++ b/hercules/code/server/tmw/main.py @@ -7,7 +7,7 @@ from code.server.tmw.consts import * from code.server.tmw.itemdb import * from code.server.tmw.mobdb import * -from code.server.mobskilldb import * +from code.server.tmw.mobskilldb import * from code.server.tmw.npcs import * from code.server.utils import * from code.server.questsdb import * @@ -21,4 +21,4 @@ def serverTmwMain(): convertMobDb() quests = dict() convertConsts(quests) - #convertMobSkillDb() + convertMobSkillDb() diff --git a/hercules/code/server/tmw/mobskilldb.py b/hercules/code/server/tmw/mobskilldb.py new file mode 100644 index 0000000..a6fd8aa --- /dev/null +++ b/hercules/code/server/tmw/mobskilldb.py @@ -0,0 +1,50 @@ +# -*- coding: utf8 -*- +# +# Copyright (C) 2014 Evol Online +# Author: Andrei Karas (4144) + +import re + +from code.fileutils import * +from code.stringutils import * + +def convertMobSkillDb(): + srcFile = "oldserverdata/db/mob_skill_db.txt" + dstFile = "newserverdata/db/re/mob_skill_db.txt" + fieldsSplit = re.compile(",") + with open(srcFile, "r") as r: + with open(dstFile, "w") as w: + tpl = readFile("templates/mob_skill_db.tpl") + w.write(tpl) + for line in r: + if len(line) < 2 or line[0:2] == "//": + w.write(line) + continue + rows = fieldsSplit.split(line) + if len(rows) < 10: + w.write(line) + continue + + for f in xrange(0, len(rows)): + rows[f] = rows[f].strip() + + w.write("{0},{1},{2},{3},{4},{5},{6}," + "{7},{8},{9},{10},{11},{12},{13}," + "{14},,,,,\n".format( + rows[0], + rows[1], + rows[2], + rows[3], + rows[4], + rows[5], + rows[6], + rows[7], + rows[8], + rows[9], + rows[10], + rows[11], + rows[12], + rows[13], + rows[14] + )) + |