diff options
author | jak1 <jak1@themanaworld.org> | 2022-06-19 09:34:16 +0200 |
---|---|---|
committer | jak1 <jak1@themanaworld.org> | 2022-06-19 09:34:16 +0200 |
commit | 38fcd221d8fe03208abdafe0f01a6e54a601b71a (patch) | |
tree | 6a1ba5a5943b9dc0617e0046b39b82ba2284d53e /hercules/code/servertoclient | |
parent | 9a351fb1abd5694bbbb7e38fcb64bb30b3fa74bb (diff) | |
download | messworld-tools-master.tar.gz messworld-tools-master.tar.bz2 messworld-tools-master.tar.xz messworld-tools-master.zip |
Diffstat (limited to 'hercules/code/servertoclient')
-rw-r--r-- | hercules/code/servertoclient/groups.py | 14 | ||||
-rw-r--r-- | hercules/code/servertoclient/homunculuses.py | 2 | ||||
-rw-r--r-- | hercules/code/servertoclient/items.py | 22 | ||||
-rw-r--r-- | hercules/code/servertoclient/maps.py | 6 | ||||
-rw-r--r-- | hercules/code/servertoclient/mercenaries.py | 2 | ||||
-rw-r--r-- | hercules/code/servertoclient/monsters.py | 2 | ||||
-rw-r--r-- | hercules/code/servertoclient/pets.py | 2 | ||||
-rw-r--r-- | hercules/code/servertoclient/quests.py | 2 | ||||
-rw-r--r-- | hercules/code/servertoclient/sprites.py | 18 |
9 files changed, 35 insertions, 35 deletions
diff --git a/hercules/code/servertoclient/groups.py b/hercules/code/servertoclient/groups.py index 99424e5..6372c31 100644 --- a/hercules/code/servertoclient/groups.py +++ b/hercules/code/servertoclient/groups.py @@ -49,7 +49,7 @@ def readCommands(f): value = value[idx1 + 1: idx2 - idx1] parts = comaSplit.split(value) commands[name] = (parts[0].strip(), parts[1].strip()) - print "command: {0}, {1}".format(name, commands[name]) + print("command: {0}, {1}".format(name, commands[name])) return commands def readPermissions(f): @@ -63,7 +63,7 @@ def readPermissions(f): name = parts[0].strip() value = parts[1].strip() permissions[name] = value - print "permission: {0}, {1}".format(name, value) + print("permission: {0}, {1}".format(name, value)) return permissions def readInherit(data): @@ -98,26 +98,26 @@ def readGroup(groups, f): continue name = parts[0].strip() value = parts[1].strip() - print "line: {0}, {1}".format(name, value) + print("line: {0}, {1}".format(name, value)) if name == "id": fields["id"] = value elif name == "name": fields["name"] = value elif name == "commands": commands = readCommands(f) - print "Commands: {0}".format(commands) + print("Commands: {0}".format(commands)) elif name == "permissions": permissions = readPermissions(f) - print "Permissions: {0}".format(permissions) + print("Permissions: {0}".format(permissions)) elif name == "inherit": inherit = readInherit(value) - print "Inherit: {0}".format(inherit) + print("Inherit: {0}".format(inherit)) def getCommandType(data): if data[0] == "false" and data[1] == "false": return "false" elif data[0] == "false" and data[1] == "true": - return "other"; + return "other" elif data[0] == "true" and data[1] == "false": return "self" elif data[0] == "true" and data[1] == "true": diff --git a/hercules/code/servertoclient/homunculuses.py b/hercules/code/servertoclient/homunculuses.py index 678a96c..e95d9a1 100644 --- a/hercules/code/servertoclient/homunculuses.py +++ b/hercules/code/servertoclient/homunculuses.py @@ -16,7 +16,7 @@ def convertHomunculuses(): tpl = readFile(templatesDir + "homunculus.tpl") homunculuses = readFile(templatesDir + "homunculuses.xml") data = "" - homunculusSprite = "<sprite>monsters/tortuga.xml</sprite>"; + homunculusSprite = "<sprite>monsters/tortuga.xml</sprite>" with open(homunculusesDbFile, "r") as f: for line in f: if line == "" or line[0:2] == "//": diff --git a/hercules/code/servertoclient/items.py b/hercules/code/servertoclient/items.py index 3fdb531..fa408a9 100644 --- a/hercules/code/servertoclient/items.py +++ b/hercules/code/servertoclient/items.py @@ -85,46 +85,46 @@ def convertItems(): if itemType == 0 or itemType == 2 or itemType == 18: # usable image = "usable/bread.png" typeStr = "usable" - spriteStr = ""; + spriteStr = "" elif equipLocations == "0": image = "usable/bread.png" typeStr = "usable" - spriteStr = ""; + spriteStr = "" elif equipLocations == "1": image = "equipment/legs/shorts.png|S:#4d4d4d,514d47,686868,706662,919191,99917b,b6b6b6,c0b698,dfdfdf,e4dfca" typeStr = "equip-legs" - spriteStr = "equipment/legs/shorts-male.xml|#4d4d4d,514d47,686868,706662,919191,99917b,b6b6b6,c0b698,dfdfdf,e0d5bf"; + spriteStr = "equipment/legs/shorts-male.xml|#4d4d4d,514d47,686868,706662,919191,99917b,b6b6b6,c0b698,dfdfdf,e0d5bf" elif equipLocations == "2": image = "equipment/weapons/knife.png" typeStr = "equip-1hand" - spriteStr = "equipment/weapons/knife.xml"; + spriteStr = "equipment/weapons/knife.xml" elif equipLocations == "4": image = "equipment/hands/armbands.png" typeStr = "equip-arms" - spriteStr = "equipment/hands/armbands-male.xml"; + spriteStr = "equipment/hands/armbands-male.xml" elif equipLocations == "16": image = "equipment/chest/cottonshirt.png|S:#3c3c3c,3e3c38,4d4d4d,514d47,686868,706662,919191,99917b,b6b6b6,c0b698,dfdfdf,e4dfca" typeStr = "equip-torso" - spriteStr = "equipment/chest/cottonshirt-male.xml|#43413d,59544f,7a706c,8a8176,a69e88,d1c7a7,e0d5bf"; + spriteStr = "equipment/chest/cottonshirt-male.xml|#43413d,59544f,7a706c,8a8176,a69e88,d1c7a7,e0d5bf" elif equipLocations == "64": image = "equipment/feet/boots.png|S:#3c3c3c,40332d,4d4d4d,5e4a3d,686868,705740,919191,a1825d,b6b6b6,b59767,dfdfdf,dbbf88" typeStr = "equip-feet" - spriteStr = "equipment/feet/boots-male.xml|#40332d,5e4a3d,705740,a1825d,b59767,dbbf88"; + spriteStr = "equipment/feet/boots-male.xml|#40332d,5e4a3d,705740,a1825d,b59767,dbbf88" elif equipLocations == "136": image = "equipment/chest/cottonshirt.png|S:#3c3c3c,3e3c38,4d4d4d,514d47,686868,706662,919191,99917b,b6b6b6,c0b698,dfdfdf,e4dfca" typeStr = "equip-torso" - spriteStr = "equipment/chest/cottonshirt-male.xml|#43413d,59544f,7a706c,8a8176,a69e88,d1c7a7,e0d5bf"; + spriteStr = "equipment/chest/cottonshirt-male.xml|#43413d,59544f,7a706c,8a8176,a69e88,d1c7a7,e0d5bf" elif equipLocations == "256": image = "equipment/head/bandana.png" typeStr = "equip-head" - spriteStr = "equipment/head/bandana-male.xml"; + spriteStr = "equipment/head/bandana-male.xml" elif equipLocations == "512": # no sprites in evol image = "equipment/chest/sailorshirt.png" typeStr = "equip-torso" - spriteStr = "equipment/chest/shirt-male.xml|#131913,1b231d,233129,35433e,4e6059,6c8279;#72571e,836737,a5854d,b18f45"; + spriteStr = "equipment/chest/shirt-male.xml|#131913,1b231d,233129,35433e,4e6059,6c8279;#72571e,836737,a5854d,b18f45" - name = strToXml(name); + name = strToXml(name) if itemId not in ids: ids.add(itemId) diff --git a/hercules/code/servertoclient/maps.py b/hercules/code/servertoclient/maps.py index 0f1ca5b..7ac7e4f 100644 --- a/hercules/code/servertoclient/maps.py +++ b/hercules/code/servertoclient/maps.py @@ -20,7 +20,7 @@ def covertToTmx(f, mapsCount): tmx = readFile("templates/template.tmx") for i in xrange(0, mapsCount): name = readMapName(f) - print "converting map [{0:4}/{1:4}]: {2}".format(i, mapsCount + 1, name) + print("converting map [{0:4}/{1:4}]: {2}".format(i, mapsCount + 1, name)) sx = readInt16(f) sy = readInt16(f) sz = readInt32(f) @@ -37,11 +37,11 @@ def covertToTmx(f, mapsCount): if x + 1 == sx and y + 1 == sy: ground = ground + tile[0] collision = collision + tile[1] - fringe = fringe + "0"; + fringe = fringe + "0" else: ground = ground + tile[0] + "," collision = collision + tile[1] + "," - fringe = fringe + "0,"; + fringe = fringe + "0," ground = ground + "\n" collision = collision + "\n" fringe = fringe + "\n" diff --git a/hercules/code/servertoclient/mercenaries.py b/hercules/code/servertoclient/mercenaries.py index 481f66c..610e7d4 100644 --- a/hercules/code/servertoclient/mercenaries.py +++ b/hercules/code/servertoclient/mercenaries.py @@ -16,7 +16,7 @@ def convertMercenaries(): tpl = readFile(templatesDir + "mercenary.tpl") mercenaries = readFile(templatesDir + "mercenaries.xml") data = "" - mercenarySprite = "<sprite>monsters/croc.xml</sprite>"; + mercenarySprite = "<sprite>monsters/croc.xml</sprite>" with open(mercenariesDbFile, "r") as f: for line in f: if line == "" or line[0:2] == "//": diff --git a/hercules/code/servertoclient/monsters.py b/hercules/code/servertoclient/monsters.py index 969795d..0c8e3f7 100644 --- a/hercules/code/servertoclient/monsters.py +++ b/hercules/code/servertoclient/monsters.py @@ -35,7 +35,7 @@ def convertMonsters(isNonFree = False, idtofile = None): monsterSprite = "<sprite>sprites/{0}.xml</sprite>".format(idtofile[monsterId]) else: monsterSprite = """<sprite>monsters/blub.xml</sprite> - <sprite>accessories/blub-tentacle.xml|#3e4164,3a3968,544a82,64437a,7d6db4,a26392,8f99c4,d294ab,b3cdcd,e7b8b8,d9ecd1,f0e8c5</sprite>"""; + <sprite>accessories/blub-tentacle.xml|#3e4164,3a3968,544a82,64437a,7d6db4,a26392,8f99c4,d294ab,b3cdcd,e7b8b8,d9ecd1,f0e8c5</sprite>""" name = strToXml(stripQuotes(rows[2])) data = data + tpl.format(monsterId, name, monsterSprite) diff --git a/hercules/code/servertoclient/pets.py b/hercules/code/servertoclient/pets.py index bc6deef..6694ca7 100644 --- a/hercules/code/servertoclient/pets.py +++ b/hercules/code/servertoclient/pets.py @@ -16,7 +16,7 @@ def convertPets(): tpl = readFile(templatesDir + "pet.tpl") pets = readFile(templatesDir + "pets.xml") data = "" - petSprite = "<sprite>monsters/tortuga.xml</sprite>"; + petSprite = "<sprite>monsters/tortuga.xml</sprite>" with open(petsDbFile, "r") as f: for line in f: if line == "" or line[0:2] == "//": diff --git a/hercules/code/servertoclient/quests.py b/hercules/code/servertoclient/quests.py index df47fd5..b8874e1 100644 --- a/hercules/code/servertoclient/quests.py +++ b/hercules/code/servertoclient/quests.py @@ -9,7 +9,7 @@ from code.fileutils import makeDir, readFile, saveFile from code.stringutils import strToXml, stripQuotes def convertQuests(): - print "quests disabled for now" + print("quests disabled for now") return destDir = "clientdata/" templatesDir = "templates/" diff --git a/hercules/code/servertoclient/sprites.py b/hercules/code/servertoclient/sprites.py index 5dad9d1..4b683bc 100644 --- a/hercules/code/servertoclient/sprites.py +++ b/hercules/code/servertoclient/sprites.py @@ -55,7 +55,7 @@ def readIndexedRLEImage(f, spr): while readCnt < compressSize: c = readInt8(f) readCnt = readCnt + 1 - data[idx] = c; + data[idx] = c #print "{0:4}: {1}".format(idx, c) idx = idx + 1 if c == 0: @@ -132,7 +132,7 @@ def decodeSprite(spr): # png.save("test{0}.png".format(imageN)) if alpha: - print "detected alpha" + print("detected alpha") for imageN in range(0, spr.rgbaSpritesCount): image = spr.images[imageN + spr.indexedSpritesCount] @@ -206,7 +206,7 @@ def saveSpriteImage(act, spr, spriteDir, spriteName): continue if frame.frameIndex not in spr.images: - print "wrong frame index: {0}".format(frame.frameIndex) + print("wrong frame index: {0}".format(frame.frameIndex)) continue image = spr.images[frame.frameIndex] png = Image.new('RGBA', (image.width, image.height)) @@ -326,7 +326,7 @@ def readAct(actFile): act.minorVersion = readInt8(f) act.majorVersion = readInt8(f) act.nanimations = readInt16(f) - print "{0}, {1}.{2}, {3}".format(actFile, act.majorVersion, act.minorVersion, act.nanimations) + print("{0}, {1}.{2}, {3}".format(actFile, act.majorVersion, act.minorVersion, act.nanimations)) #print " animations: " + str(act.nanimations) act.animations = dict() skipData(f, 10) @@ -391,7 +391,7 @@ def readAct(actFile): act.events = dict() for eventN in range(0, act.nevents): event = ActEventClass() - act.events[eventN] = event; + act.events[eventN] = event event.name = readData(f, 40) if act.majorVersion > 2 or (act.majorVersion == 2 and act.minorVersion >= 2): for animN in range(0, act.nanimations): @@ -413,7 +413,7 @@ def readSpr(sprFile): spr.rgbaSpritesCount = readInt16(f) else: spr.rgbaSpritesCount = 0 - print "{0}, {1}.{2}, {3}, {4}".format(sprFile, spr.majorVersion, spr.minorVersion, spr.indexedSpritesCount, spr.rgbaSpritesCount) + print("{0}, {1}.{2}, {3}, {4}".format(sprFile, spr.majorVersion, spr.minorVersion, spr.indexedSpritesCount, spr.rgbaSpritesCount)) spr.frames = spr.indexedSpritesCount + spr.rgbaSpritesCount if spr.majorVersion > 2 or (spr.majorVersion == 2 and spr.minorVersion >= 1): @@ -455,13 +455,13 @@ def convertSpritesNonFree(idtofile): for spriteid in idtofile: spriteName = idtofile[spriteid] if spriteName in processed: - print "skipping " + spriteName + print("skipping " + spriteName) continue path = findSpritePath(spriteName) if path is None: - print "not found " + spriteName + print("not found " + spriteName) continue - print spriteName + print(spriteName) convertSprite(path, spriteName) processed.append(spriteName) |