From 38fcd221d8fe03208abdafe0f01a6e54a601b71a Mon Sep 17 00:00:00 2001 From: jak1 Date: Sun, 19 Jun 2022 09:34:16 +0200 Subject: updated all leftover scripts to py3 --- hercules/code/server/evol/npcs.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'hercules/code/server/evol/npcs.py') diff --git a/hercules/code/server/evol/npcs.py b/hercules/code/server/evol/npcs.py index 6efe811..dd2c7be 100644 --- a/hercules/code/server/evol/npcs.py +++ b/hercules/code/server/evol/npcs.py @@ -31,7 +31,7 @@ monsterRe = re.compile("^(?P[^/](.+))[.]gat,([ ]*)(?P[\d]+),([ ]*)(?P "(?Pmonster)[\t](?P[\w#' ]+)[\t]" "(?P[\d]+),(?P[\d]+),(?P[\d-]+),(?P[\d]+),(?P[\d]+)$") -setRe = re.compile("^(?P[ ]+)set[ ](?P[^,]+),([ ]*)(?P[^;]+);$"); +setRe = re.compile("^(?P[ ]+)set[ ](?P[^,]+),([ ]*)(?P[^;]+);$") class ScriptTracker: pass @@ -115,7 +115,7 @@ def processScriptMapLine(line): def writeScript(w, m): if m.group("gender") != None: - w.write("// Gender = {0}\n".format(m.group("gender"))); + w.write("// Gender = {0}\n".format(m.group("gender"))) if m.group("x") == 0 and m.group("y") == 0: # float npc w.write("-") @@ -128,7 +128,7 @@ def writeScript(w, m): class_ = int(class_) if class_ > 125 and class_ <= 400: class_ = class_ + 100 - w.write("\t{0}\t{1}\t{2}".format(m.group("tag"), m.group("name"), class_)); + w.write("\t{0}\t{1}\t{2}".format(m.group("tag"), m.group("name"), class_)) def processScript(tracker): line = tracker.line @@ -139,7 +139,7 @@ def processScript(tracker): m = scriptRe.search(line) if m == None: - print "error in parsing: " + line + print("error in parsing: " + line) w.write("!!!error parsing line") w.write(line) return @@ -149,11 +149,11 @@ def processScript(tracker): # m.group("tag"), m.group("name"), m.group("class"), m.group("xs"), m.group("ys"), m.group("size")) if m.group("size") != None: - w.write("// Size = {0}\n".format(m.group("size"))); + w.write("// Size = {0}\n".format(m.group("size"))) writeScript(w, m) if m.group("xs") != None: - w.write(",{0},{1}".format(m.group("xs"), m.group("ys"))); - w.write(",{\n"); + w.write(",{0},{1}".format(m.group("xs"), m.group("ys"))) + w.write(",{\n") def itemsToShop(tracker, itemsStr): @@ -175,7 +175,7 @@ def processShop(tracker): m = shopRe.search(line) if m == None: - print "error in parsing: " + line + print("error in parsing: " + line) w.write("!!!error parsing line") w.write(line) return @@ -193,7 +193,7 @@ def processMapFlag(tracker): m = mapFlagRe.search(line) if m == None: - print "error in parsing: " + line + print("error in parsing: " + line) w.write("!!!error parsing line") w.write(line) return @@ -212,7 +212,7 @@ def processWarp(tracker): w = tracker.w m = warpRe.search(line) if m == None: - print "error in parsing: " + line + print("error in parsing: " + line) w.write("!!!error parsing line") w.write(line) return @@ -237,7 +237,7 @@ def processMonster(tracker): w = tracker.w m = monsterRe.search(line) if m == None: - print "error in parsing: " + line + print("error in parsing: " + line) w.write("!!!error parsing line") w.write(line) return @@ -273,7 +273,7 @@ def processStrReplace(tracker): line = line.replace("getmapmobs(", "mobcount(") - m = setRe.search(line); + m = setRe.search(line) if m != None: line = "{0}{1} = {2};\n".format(m.group("space"), m.group("var"), m.group("val")) -- cgit v1.2.3-60-g2f50