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")