From d79f103525db39b3771b0ec6a0991975289bc89b Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 29 Jun 2021 13:29:27 +0800 Subject: [PATCH] Generate random mp count --- .../extract_r2_required/generate_sitem.py | 54 +++++++++++++++++-- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/ryzom/tools/extract_r2_required/generate_sitem.py b/ryzom/tools/extract_r2_required/generate_sitem.py index 603517051..e0eb82299 100644 --- a/ryzom/tools/extract_r2_required/generate_sitem.py +++ b/ryzom/tools/extract_r2_required/generate_sitem.py @@ -1,5 +1,5 @@ -import os +import os, zlib def loadTsv(filename): table = [] @@ -736,6 +736,50 @@ def generateSitems(): sbrickIndex = int(sbrickEntry[1]) else: exit("TODO: Find unused sbrick index for the family") + + minMat = 2 + randMat = 4 + if "one-handed" in tags: + minMat += 1 + randMat += 2 + if "two-handed" in tags: + minMat += 2 + randMat += 4 + if "medium" in tags: + minMat += 2 + randMat += 4 + if "heavy" in tags: + minMat += 4 + randMat += 8 + if "buckler" in tags: + minMat += 1 + randMat += 3 + if "large" in tags: + minMat += 2 + randMat += 6 + if "magic" in tags: + minMat += 3 + randMat += 6 + if "mq" in tags: + minMat += 1 + randMat += 2 + if "hq" in tags: + minMat += 2 + randMat += 4 + minMat *= 3 + randMat *= 3 + # rand0 = zlib.crc32(name + brickFamily + skill) & 0xffffffff + rand1 = zlib.crc32(name + skill + brickFamily) & 0xffffffff + rand2 = zlib.crc32(skill + name + brickFamily) & 0xffffffff + rand3 = zlib.crc32(skill + brickFamily + name) & 0xffffffff + rand4 = zlib.crc32(brickFamily + name + skill) & 0xffffffff + rand5 = zlib.crc32(brickFamily + skill + name) & 0xffffffff + mp1 = minMat + (rand1 % randMat) + mp2 = minMat + (rand2 % randMat) + mp3 = minMat + (rand3 % randMat) + mp4 = minMat + (rand4 % randMat) + mp5 = minMat + (rand5 % randMat) + if not os.path.isdir(sbrickFolder): os.makedirs(sbrickFolder) with open(sbrickFile, "w") as f: @@ -771,13 +815,13 @@ def generateSitems(): f.write(" \n") else: f.write(" \n") - f.write(" \n") # TODO: Calibrate + f.write(" \n") # TODO: Calibrate f.write(" \n") - f.write(" \n") # TODO: Calibrate + f.write(" \n") # TODO: Calibrate f.write(" \n") - f.write(" \n") # TODO: Calibrate + f.write(" \n") # TODO: Calibrate f.write(" \n") - f.write(" \n") # TODO: Calibrate + f.write(" \n") # TODO: Calibrate f.write(" \n") f.write(" \n") f.write(" \n")