diff options
Diffstat (limited to 'hercules/code/servertoclient')
-rw-r--r-- | hercules/code/servertoclient/homunculuses.py | 2 | ||||
-rw-r--r-- | hercules/code/servertoclient/items.py | 44 | ||||
-rw-r--r-- | hercules/code/servertoclient/luas.py | 4 | ||||
-rw-r--r-- | hercules/code/servertoclient/maps.py | 4 | ||||
-rw-r--r-- | hercules/code/servertoclient/mercenaries.py | 2 | ||||
-rw-r--r-- | hercules/code/servertoclient/monsters.py | 8 | ||||
-rw-r--r-- | hercules/code/servertoclient/npcs.py | 11 | ||||
-rw-r--r-- | hercules/code/servertoclient/pets.py | 2 | ||||
-rw-r--r-- | hercules/code/servertoclient/quests.py | 4 | ||||
-rw-r--r-- | hercules/code/servertoclient/skills.py | 2 | ||||
-rw-r--r-- | hercules/code/servertoclient/sprites.py | 12 |
11 files changed, 39 insertions, 56 deletions
diff --git a/hercules/code/servertoclient/homunculuses.py b/hercules/code/servertoclient/homunculuses.py index f2683d3..678a96c 100644 --- a/hercules/code/servertoclient/homunculuses.py +++ b/hercules/code/servertoclient/homunculuses.py @@ -5,7 +5,7 @@ import re -from code.fileutils import * +from code.fileutils import makeDir, readFile, saveFile def convertHomunculuses(): destDir = "clientdata/" diff --git a/hercules/code/servertoclient/items.py b/hercules/code/servertoclient/items.py index 89a9b96..3fdb531 100644 --- a/hercules/code/servertoclient/items.py +++ b/hercules/code/servertoclient/items.py @@ -6,8 +6,8 @@ import re from sets import Set -from code.fileutils import * -from code.stringutils import * +from code.fileutils import makeDir, readFile, saveFile +from code.stringutils import stripQuotes2, strToXml def prepStat(val, text): if val != "0" and val != "": @@ -38,35 +38,35 @@ def convertItems(): rows = stripQuotes2(rows) itemId = rows[0] name = rows[1] - name2 = rows[2] +# name2 = rows[2] itemType = rows[3] - priceBuy = rows[4] - priceSell = rows[5] +# priceBuy = rows[4] +# priceSell = rows[5] weight = rows[6] atk = rows[7] matk = rows[8] defense = rows[9] attackRange = rows[10] - slots = rows[11] - equipJobs = rows[12] - equipUpper = rows[12] - equipGender = rows[14] +# slots = rows[11] +# equipJobs = rows[12] +# equipUpper = rows[12] +# equipGender = rows[14] equipLocations = rows[15] - weaponLevel = rows[16] - equipLevelMin = rows[17] - equipLevelMax = rows[18] - refinable = rows[19] +# weaponLevel = rows[16] +# equipLevelMin = rows[17] +# equipLevelMax = rows[18] +# refinable = rows[19] view = rows[20] - bindOnEquip = rows[21] - buyInStore = rows[22] +# bindOnEquip = rows[21] +# buyInStore = rows[22] delay = rows[23] - tradeFlag = rows[24] - tradeGroup = rows[25] - nouseFlag = rows[26] - nouseGroup = rows[27] - stackAmount = rows[28] - stackFlag = rows[29] - sprite = rows[30] +# tradeFlag = rows[24] +# tradeGroup = rows[25] +# nouseFlag = rows[26] +# nouseGroup = rows[27] +# stackAmount = rows[28] +# stackFlag = rows[29] +# sprite = rows[30] name = name.replace("\\'", "'") image = "" diff --git a/hercules/code/servertoclient/luas.py b/hercules/code/servertoclient/luas.py index 6399da6..8b401b7 100644 --- a/hercules/code/servertoclient/luas.py +++ b/hercules/code/servertoclient/luas.py @@ -4,10 +4,6 @@ # Author: Andrei Karas (4144) import re -from sets import Set - -from code.fileutils import * -from code.stringutils import * comaSplit = re.compile(",") equalSplit = re.compile("=") diff --git a/hercules/code/servertoclient/maps.py b/hercules/code/servertoclient/maps.py index e0a7641..0f1ca5b 100644 --- a/hercules/code/servertoclient/maps.py +++ b/hercules/code/servertoclient/maps.py @@ -5,8 +5,8 @@ import zlib -from code.fileutils import * -from code.tileutils import * +from code.fileutils import readInt16, readInt32, makeDir, copyFile, readFile, readMapName, saveFile, readData +from code.tileutils import getTileData, getTile def covertToTmx(f, mapsCount): destDir = "clientdata/" diff --git a/hercules/code/servertoclient/mercenaries.py b/hercules/code/servertoclient/mercenaries.py index 9e4245d..481f66c 100644 --- a/hercules/code/servertoclient/mercenaries.py +++ b/hercules/code/servertoclient/mercenaries.py @@ -5,7 +5,7 @@ import re -from code.fileutils import * +from code.fileutils import makeDir, readFile, saveFile def convertMercenaries(): destDir = "clientdata/" diff --git a/hercules/code/servertoclient/monsters.py b/hercules/code/servertoclient/monsters.py index 10f20ec..969795d 100644 --- a/hercules/code/servertoclient/monsters.py +++ b/hercules/code/servertoclient/monsters.py @@ -4,12 +4,9 @@ # Author: Andrei Karas (4144) import re -from sets import Set -from code.fileutils import * -from code.stringutils import * - -from code.servertoclient.sprites import * +from code.fileutils import makeDir, readFile, saveFile +from code.stringutils import strToXml, stripQuotes def convertMonsters(isNonFree = False, idtofile = None): destDir = "clientdata/" @@ -21,7 +18,6 @@ def convertMonsters(isNonFree = False, idtofile = None): tpl = readFile(templatesDir + "monster.tpl") monsters = readFile(templatesDir + "monsters.xml") data = "" - ids = Set() with open(monstersDbFile, "r") as f: for line in f: diff --git a/hercules/code/servertoclient/npcs.py b/hercules/code/servertoclient/npcs.py index be5cb46..5e49ffd 100644 --- a/hercules/code/servertoclient/npcs.py +++ b/hercules/code/servertoclient/npcs.py @@ -3,13 +3,8 @@ # Copyright (C) 2015 Evol Online # Author: Andrei Karas (4144) -import re -from sets import Set +from code.fileutils import makeDir, readFile, saveFile -from code.fileutils import * -from code.stringutils import * - -from code.servertoclient.sprites import * def getNpcIds(idtofile): for key1 in idtofile: @@ -17,12 +12,10 @@ def getNpcIds(idtofile): if 45 <= key <= 125 or 400 < key < 1000 or 10001 <= key < 10100: yield key1 + def convertNpcsNonFree(idtofile): destDir = "clientdata/" templatesDir = "templates/" - monstersDbFile = "serverdata/sql-files/mob_db_re.sql" - fieldsSplit = re.compile(",") - bracketsSplit = re.compile("[(]|[)]") makeDir(destDir) tpl = readFile(templatesDir + "npc.tpl") npcs = readFile(templatesDir + "npcs.xml") diff --git a/hercules/code/servertoclient/pets.py b/hercules/code/servertoclient/pets.py index c064af7..bc6deef 100644 --- a/hercules/code/servertoclient/pets.py +++ b/hercules/code/servertoclient/pets.py @@ -5,7 +5,7 @@ import re -from code.fileutils import * +from code.fileutils import makeDir, readFile, saveFile def convertPets(): destDir = "clientdata/" diff --git a/hercules/code/servertoclient/quests.py b/hercules/code/servertoclient/quests.py index 848f07b..df47fd5 100644 --- a/hercules/code/servertoclient/quests.py +++ b/hercules/code/servertoclient/quests.py @@ -5,8 +5,8 @@ import re -from code.fileutils import * -from code.stringutils import * +from code.fileutils import makeDir, readFile, saveFile +from code.stringutils import strToXml, stripQuotes def convertQuests(): print "quests disabled for now" diff --git a/hercules/code/servertoclient/skills.py b/hercules/code/servertoclient/skills.py index 022e874..6affb72 100644 --- a/hercules/code/servertoclient/skills.py +++ b/hercules/code/servertoclient/skills.py @@ -5,7 +5,7 @@ import re -from code.fileutils import * +from code.fileutils import makeDir, readFile, saveFile def convertSkillsToXml(): destDir = "clientdata/" diff --git a/hercules/code/servertoclient/sprites.py b/hercules/code/servertoclient/sprites.py index 9873d40..5dad9d1 100644 --- a/hercules/code/servertoclient/sprites.py +++ b/hercules/code/servertoclient/sprites.py @@ -3,13 +3,11 @@ # Copyright (C) 2015 Evol Online # Author: Andrei Karas (4144) +import array import os from PIL import Image -from PIL import ImageDraw -from sets import Set -from code.fileutils import * -from code.stringutils import * +from code.fileutils import readInt8, readInt16, readInt32, makeDir, readFile, saveFile, skipData, readData, findFileIn class ActClass: pass @@ -48,7 +46,7 @@ def readIndexedRLEImage(f, spr): image.data = data compressSize = readInt16(f) - uncompressedSize = image.width * image.height + #uncompressedSize = image.width * image.height #print "uncompressed size=" + str(uncompressedSize) #print "compressed size=" + str(compressSize) @@ -160,7 +158,7 @@ def saveSpriteImage(act, spr, spriteDir, spriteName): anim = act.animations[animN] for spriteN in range(0, anim.nsprites): sprite = anim.sprites[spriteN] - key = [] +# key = [] # for frameN in range(0, sprite.nframes): # frame = sprite.frames[frameN] # idf = frame.frameIndex @@ -254,7 +252,7 @@ def extractSpriteAnimData(act, spr, actIndex, direction): anim = act.animations[actIndex] for spriteN in range(0, anim.nsprites): - sprite = anim.sprites[spriteN] + #sprite = anim.sprites[spriteN] #for frameN in range(0, sprite.nframes): #frame = sprite.frames[frameN] #frm = frame.frameIndex |