summaryrefslogtreecommitdiff
path: root/hercules/code
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-12 03:14:35 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-12 03:14:35 +0300
commit460822ea6cef840e0f478918547a806b231c3dc6 (patch)
tree729118f0273a182b62628aae87ae8c9fe9b5f1c2 /hercules/code
parentd3648ee52a4860111afe9049713d788f60e5b588 (diff)
downloadevol-tools-460822ea6cef840e0f478918547a806b231c3dc6.tar.gz
evol-tools-460822ea6cef840e0f478918547a806b231c3dc6.tar.bz2
evol-tools-460822ea6cef840e0f478918547a806b231c3dc6.tar.xz
evol-tools-460822ea6cef840e0f478918547a806b231c3dc6.zip
Fix different issues in tools found by pyflakes.
Diffstat (limited to 'hercules/code')
-rw-r--r--hercules/code/clienttoserver/maps.py4
-rw-r--r--hercules/code/server/account.py4
-rw-r--r--hercules/code/server/accreg.py5
-rw-r--r--hercules/code/server/db/char.py4
-rw-r--r--hercules/code/server/db/charregnumdb.py3
-rw-r--r--hercules/code/server/db/inventory.py3
-rw-r--r--hercules/code/server/db/skill.py3
-rw-r--r--hercules/code/server/evol/athena.py9
-rw-r--r--hercules/code/server/evol/consts.py3
-rw-r--r--hercules/code/server/evol/itemdb.py5
-rw-r--r--hercules/code/server/evol/main.py33
-rw-r--r--hercules/code/server/evol/mobdb.py3
-rw-r--r--hercules/code/server/evol/mobskilldb.py3
-rw-r--r--hercules/code/server/evol/npcs.py5
-rw-r--r--hercules/code/server/maps.py4
-rw-r--r--hercules/code/server/party.py5
-rw-r--r--hercules/code/server/questsdb.py7
-rw-r--r--hercules/code/server/storage.py8
-rw-r--r--hercules/code/server/tmw/athena.py9
-rw-r--r--hercules/code/server/tmw/consts.py5
-rw-r--r--hercules/code/server/tmw/itemdb.py6
-rw-r--r--hercules/code/server/tmw/main.py34
-rw-r--r--hercules/code/server/tmw/mobdb.py9
-rw-r--r--hercules/code/server/tmw/mobskilldb.py3
-rw-r--r--hercules/code/server/tmw/npcs.py5
-rw-r--r--hercules/code/server/utils.py2
-rw-r--r--hercules/code/servertoclient/homunculuses.py2
-rw-r--r--hercules/code/servertoclient/items.py44
-rw-r--r--hercules/code/servertoclient/luas.py4
-rw-r--r--hercules/code/servertoclient/maps.py4
-rw-r--r--hercules/code/servertoclient/mercenaries.py2
-rw-r--r--hercules/code/servertoclient/monsters.py8
-rw-r--r--hercules/code/servertoclient/npcs.py11
-rw-r--r--hercules/code/servertoclient/pets.py2
-rw-r--r--hercules/code/servertoclient/quests.py4
-rw-r--r--hercules/code/servertoclient/skills.py2
-rw-r--r--hercules/code/servertoclient/sprites.py12
-rw-r--r--hercules/code/tileutils.py2
38 files changed, 124 insertions, 157 deletions
diff --git a/hercules/code/clienttoserver/maps.py b/hercules/code/clienttoserver/maps.py
index ee98ed1..b8ee14c 100644
--- a/hercules/code/clienttoserver/maps.py
+++ b/hercules/code/clienttoserver/maps.py
@@ -11,7 +11,7 @@ import struct
import StringIO
from xml.dom import minidom
-from code.fileutils import *
+from code.fileutils import makeDir, writeInt16, writeInt32, writeMapName, writeData
def getTmxFiles(srcDir):
names = []
@@ -150,7 +150,7 @@ def recreateMapCache():
print "map format not supported: " + fileName
continue
- comp = zlib.compressobj()
+ #comp = zlib.compressobj()
binData = struct.pack(str(len(tiles))+"B", *tiles)
binData = zlib.compress(binData)
idx = fileName.rfind("/") + 1
diff --git a/hercules/code/server/account.py b/hercules/code/server/account.py
index 28aafe4..7763766 100644
--- a/hercules/code/server/account.py
+++ b/hercules/code/server/account.py
@@ -5,8 +5,8 @@
import re
-from code.fileutils import *
-from code.stringutils import *
+from code.fileutils import readFile
+from code.stringutils import stripNewLine, escapeSqlStr
def convertSex(sex):
if sex == "M" or sex == "F" or sex == "S":
diff --git a/hercules/code/server/accreg.py b/hercules/code/server/accreg.py
index 98b0934..b69910f 100644
--- a/hercules/code/server/accreg.py
+++ b/hercules/code/server/accreg.py
@@ -5,9 +5,8 @@
import re
-from code.fileutils import *
-from code.stringutils import *
-from code.server.dbitem import *
+from code.fileutils import readFile
+from code.stringutils import stripNewLine
def convertAccReg():
srcFile = "olddb/accreg.txt"
diff --git a/hercules/code/server/db/char.py b/hercules/code/server/db/char.py
index c1bb4a8..cd8e0cc 100644
--- a/hercules/code/server/db/char.py
+++ b/hercules/code/server/db/char.py
@@ -3,8 +3,8 @@
# Copyright (C) 2015 Evol Online
# Author: Andrei Karas (4144)
-from code.fileutils import *
-from code.stringutils import *
+from code.fileutils import readFile
+from code.stringutils import escapeSqlStr
def saveCharTable(users):
dstFile = "newdb/char.sql"
diff --git a/hercules/code/server/db/charregnumdb.py b/hercules/code/server/db/charregnumdb.py
index 8837c9d..1617c13 100644
--- a/hercules/code/server/db/charregnumdb.py
+++ b/hercules/code/server/db/charregnumdb.py
@@ -3,8 +3,7 @@
# Copyright (C) 2015 Evol Online
# Author: Andrei Karas (4144)
-from code.fileutils import *
-from code.stringutils import *
+from code.fileutils import readFile
def saveCharRegNumDbTable(users):
dstFile = "newdb/char_reg_num_db.sql"
diff --git a/hercules/code/server/db/inventory.py b/hercules/code/server/db/inventory.py
index 52a2fd0..e5c1e6a 100644
--- a/hercules/code/server/db/inventory.py
+++ b/hercules/code/server/db/inventory.py
@@ -3,8 +3,7 @@
# Copyright (C) 2015 Evol Online
# Author: Andrei Karas (4144)
-from code.fileutils import *
-from code.stringutils import *
+from code.fileutils import readFile
def saveInventoryTable(users):
dstFile = "newdb/inventory.sql"
diff --git a/hercules/code/server/db/skill.py b/hercules/code/server/db/skill.py
index 2f45813..d21eb3d 100644
--- a/hercules/code/server/db/skill.py
+++ b/hercules/code/server/db/skill.py
@@ -3,8 +3,7 @@
# Copyright (C) 2015 Evol Online
# Author: Andrei Karas (4144)
-from code.fileutils import *
-from code.stringutils import *
+from code.fileutils import readFile
def saveSkillTable(users):
dstFile = "newdb/skill.sql"
diff --git a/hercules/code/server/evol/athena.py b/hercules/code/server/evol/athena.py
index 567db3b..59d8223 100644
--- a/hercules/code/server/evol/athena.py
+++ b/hercules/code/server/evol/athena.py
@@ -5,11 +5,10 @@
import re
-from code.fileutils import *
-from code.stringutils import *
-from code.server.dbitem import *
-from code.server.dbskill import *
-from code.server.dbuser import *
+from code.stringutils import stripNewLine, removeGat
+from code.server.dbitem import Item
+from code.server.dbskill import Skill, skills
+from code.server.dbuser import User
comaSplit = re.compile(",")
spaceSplit = re.compile(" ")
diff --git a/hercules/code/server/evol/consts.py b/hercules/code/server/evol/consts.py
index d2c5c9b..c63f559 100644
--- a/hercules/code/server/evol/consts.py
+++ b/hercules/code/server/evol/consts.py
@@ -5,9 +5,6 @@
import re
-from code.fileutils import *
-from code.stringutils import *
-
def convertConsts(quests):
dstFile = "newserverdata/db/const.txt"
fieldsSplit = re.compile("\t+")
diff --git a/hercules/code/server/evol/itemdb.py b/hercules/code/server/evol/itemdb.py
index b86b848..a60e57d 100644
--- a/hercules/code/server/evol/itemdb.py
+++ b/hercules/code/server/evol/itemdb.py
@@ -5,9 +5,8 @@
import re
-from code.configutils import *
-from code.fileutils import *
-from code.stringutils import *
+from code.configutils import writeIntField, writeStartBlock, writeEndBlock, writeStartScript, writeEndScript, writeStrField, writeSubField
+from code.fileutils import readFile
def convertItemDb():
srcFile = "oldserverdata/db/item_db.txt"
diff --git a/hercules/code/server/evol/main.py b/hercules/code/server/evol/main.py
index 308bc87..0483118 100644
--- a/hercules/code/server/evol/main.py
+++ b/hercules/code/server/evol/main.py
@@ -4,23 +4,22 @@
# Copyright (C) 2014 Evol Online
# Author: Andrei Karas (4144)
-from code.server.account import *
-from code.server.accreg import *
-from code.server.party import *
-from code.server.storage import *
-from code.server.db.char import *
-from code.server.db.charregnumdb import *
-from code.server.db.inventory import *
-from code.server.db.skill import *
-from code.server.evol.athena import *
-from code.server.evol.consts import *
-from code.server.evol.itemdb import *
-from code.server.evol.mobdb import *
-from code.server.evol.mobskilldb import *
-from code.server.evol.npcs import *
-from code.server.utils import *
-from code.server.questsdb import *
-from code.serverutils import *
+from code.server.account import convertAccount
+from code.server.accreg import convertAccReg
+from code.server.party import convertParty
+from code.server.storage import convertStorage
+from code.server.db.char import saveCharTable
+from code.server.db.charregnumdb import saveCharRegNumDbTable
+from code.server.db.inventory import saveInventoryTable
+from code.server.db.skill import saveSkillTable
+from code.server.evol.athena import readAthena
+from code.server.evol.consts import convertConsts
+from code.server.evol.itemdb import convertItemDb
+from code.server.evol.mobdb import convertMobDb
+from code.server.evol.mobskilldb import convertMobSkillDb
+from code.server.evol.npcs import createMainScript, convertNpcs
+from code.server.questsdb import convertQuestsDb
+from code.serverutils import cleanServerData
def serverEvolMain():
cleanServerData()
diff --git a/hercules/code/server/evol/mobdb.py b/hercules/code/server/evol/mobdb.py
index a09348b..74eda04 100644
--- a/hercules/code/server/evol/mobdb.py
+++ b/hercules/code/server/evol/mobdb.py
@@ -5,9 +5,6 @@
import re
-from code.fileutils import *
-from code.stringutils import *
-
def convertMobDb():
srcFile = "oldserverdata/db/mob_db.txt"
dstFile = "newserverdata/db/re/mob_db.txt"
diff --git a/hercules/code/server/evol/mobskilldb.py b/hercules/code/server/evol/mobskilldb.py
index 6f0bf12..a5a7d5f 100644
--- a/hercules/code/server/evol/mobskilldb.py
+++ b/hercules/code/server/evol/mobskilldb.py
@@ -5,8 +5,7 @@
import re
-from code.fileutils import *
-from code.stringutils import *
+from code.fileutils import readFile
def convertMobSkillDb():
srcFile = "oldserverdata/db/mob_skill_db.txt"
diff --git a/hercules/code/server/evol/npcs.py b/hercules/code/server/evol/npcs.py
index 2d198c1..6efe811 100644
--- a/hercules/code/server/evol/npcs.py
+++ b/hercules/code/server/evol/npcs.py
@@ -3,10 +3,11 @@
# Copyright (C) 2014 Evol Online
# Author: Andrei Karas (4144)
+import os
import re
-from code.fileutils import *
-from code.stringutils import *
+from code.fileutils import makeDir
+from code.stringutils import stripWindows, stripNewLine
mapsConfFile = "newserverdata/conf/maps.conf"
mapsIndexFile = "newserverdata/db/map_index.txt"
diff --git a/hercules/code/server/maps.py b/hercules/code/server/maps.py
index bdeb0f7..2ef0173 100644
--- a/hercules/code/server/maps.py
+++ b/hercules/code/server/maps.py
@@ -3,9 +3,11 @@
# Copyright (C) 2014 Evol Online
# Author: Andrei Karas (4144)
+import array
+import struct
import zlib
-from code.fileutils import *
+from code.fileutils import readMapName, readInt16, readInt32, readData, makeDir
def listMapCache(f, mapsCount):
print "Known maps:"
diff --git a/hercules/code/server/party.py b/hercules/code/server/party.py
index b71f66f..c75a541 100644
--- a/hercules/code/server/party.py
+++ b/hercules/code/server/party.py
@@ -5,9 +5,8 @@
import re
-from code.fileutils import *
-from code.stringutils import *
-from code.server.dbitem import *
+from code.fileutils import readFile
+from code.stringutils import stripNewLine, escapeSqlStr
def findLeaderId(name, users):
for userId in users:
diff --git a/hercules/code/server/questsdb.py b/hercules/code/server/questsdb.py
index 25b0303..880a7f9 100644
--- a/hercules/code/server/questsdb.py
+++ b/hercules/code/server/questsdb.py
@@ -3,16 +3,11 @@
# Copyright (C) 2014 Evol Online
# Author: Andrei Karas (4144)
-import re
-from sets import Set
-
-from code.fileutils import *
-from code.stringutils import *
+from code.fileutils import readFile
def convertQuestsDb():
srcFile = "oldserverdata/db/questvars.txt"
dstFile = "newserverdata/db/quest_db.txt"
- fieldsSplit = re.compile(",")
quests = dict()
with open(srcFile, "r") as r:
with open(dstFile, "w") as w:
diff --git a/hercules/code/server/storage.py b/hercules/code/server/storage.py
index a8d5802..6bddb52 100644
--- a/hercules/code/server/storage.py
+++ b/hercules/code/server/storage.py
@@ -5,9 +5,9 @@
import re
-from code.fileutils import *
-from code.stringutils import *
-from code.server.dbitem import *
+from code.fileutils import readFile
+from code.stringutils import stripNewLine
+from code.server.dbitem import Item
def convertStorage():
srcFile = "olddb/storage.txt"
@@ -33,7 +33,7 @@ def convertStorage():
tmp = comaSplit.split(rows[0])
accountId = tmp[0]
- storage_amount = tmp[1]
+# storage_amount = tmp[1]
data = spaceSplit.split(rows[1])
for itemStr in data:
diff --git a/hercules/code/server/tmw/athena.py b/hercules/code/server/tmw/athena.py
index 4c59ea1..6ad3e9c 100644
--- a/hercules/code/server/tmw/athena.py
+++ b/hercules/code/server/tmw/athena.py
@@ -5,11 +5,10 @@
import re
-from code.fileutils import *
-from code.stringutils import *
-from code.server.dbitem import *
-from code.server.dbskill import *
-from code.server.dbuser import *
+from code.stringutils import stripNewLine
+from code.server.dbitem import Item
+from code.server.dbskill import Skill, skills
+from code.server.dbuser import User
comaSplit = re.compile(",")
spaceSplit = re.compile(" ")
diff --git a/hercules/code/server/tmw/consts.py b/hercules/code/server/tmw/consts.py
index c3ca848..5b8403e 100644
--- a/hercules/code/server/tmw/consts.py
+++ b/hercules/code/server/tmw/consts.py
@@ -3,10 +3,11 @@
# Copyright (C) 2014 Evol Online
# Author: Andrei Karas (4144)
+import os
import re
-from code.fileutils import *
-from code.stringutils import *
+from code.fileutils import readFile
+from code.stringutils import stripNewLine
fieldsSplit = re.compile(":")
diff --git a/hercules/code/server/tmw/itemdb.py b/hercules/code/server/tmw/itemdb.py
index 0729fc3..beccd09 100644
--- a/hercules/code/server/tmw/itemdb.py
+++ b/hercules/code/server/tmw/itemdb.py
@@ -3,11 +3,11 @@
# Copyright (C) 2014 Evol Online
# Author: Andrei Karas (4144)
+import os
import re
-from code.configutils import *
-from code.fileutils import *
-from code.stringutils import *
+from code.configutils import writeStartScript, writeEndScript, writeIntField, writeStrField
+from code.fileutils import readFile
def getItemDbFile(srcDir):
files = os.listdir(srcDir)
diff --git a/hercules/code/server/tmw/main.py b/hercules/code/server/tmw/main.py
index 59363ac..f3dd10d 100644
--- a/hercules/code/server/tmw/main.py
+++ b/hercules/code/server/tmw/main.py
@@ -4,23 +4,23 @@
# Copyright (C) 2014 Evol Online
# Author: Andrei Karas (4144)
-from code.server.account import *
-from code.server.accreg import *
-from code.server.party import *
-from code.server.storage import *
-from code.server.db.char import *
-from code.server.db.charregnumdb import *
-from code.server.db.inventory import *
-from code.server.db.skill import *
-from code.server.tmw.athena import *
-from code.server.tmw.consts import *
-from code.server.tmw.itemdb import *
-from code.server.tmw.mobdb import *
-from code.server.tmw.mobskilldb import *
-from code.server.tmw.npcs import *
-from code.server.utils import *
-from code.server.questsdb import *
-from code.serverutils import *
+from sets import Set
+
+from code.server.account import convertAccount
+from code.server.accreg import convertAccReg
+from code.server.party import convertParty
+from code.server.storage import convertStorage
+from code.server.db.char import saveCharTableCustom
+from code.server.db.charregnumdb import saveCharRegNumDbTable
+from code.server.db.inventory import saveInventoryTable
+from code.server.db.skill import saveSkillTable
+from code.server.tmw.athena import readAthena
+from code.server.tmw.consts import convertConsts
+from code.server.tmw.itemdb import convertItemDb
+from code.server.tmw.mobdb import convertMobDb
+from code.server.tmw.mobskilldb import convertMobSkillDb
+from code.server.tmw.npcs import createMainScript, convertNpcs
+from code.serverutils import cleanServerData
def serverTmwMain(isNew):
try:
diff --git a/hercules/code/server/tmw/mobdb.py b/hercules/code/server/tmw/mobdb.py
index 652a203..04d1fce 100644
--- a/hercules/code/server/tmw/mobdb.py
+++ b/hercules/code/server/tmw/mobdb.py
@@ -3,11 +3,12 @@
# Copyright (C) 2014 Evol Online
# Author: Andrei Karas (4144)
-import re, math
+import math
+import os
+import re
-from code.configutils import *
-from code.fileutils import *
-from code.stringutils import *
+from code.configutils import isHaveData, writeCondField2, writeStartBlock, writeEndBlock, writeIntField, writeStrField, writeFieldArr, writeIntField2, writeFieldList, writeSubField
+from code.fileutils import readFile
def getMobDbFile(srcDir):
files = os.listdir(srcDir)
diff --git a/hercules/code/server/tmw/mobskilldb.py b/hercules/code/server/tmw/mobskilldb.py
index cba7d70..7188824 100644
--- a/hercules/code/server/tmw/mobskilldb.py
+++ b/hercules/code/server/tmw/mobskilldb.py
@@ -5,8 +5,7 @@
import re
-from code.fileutils import *
-from code.stringutils import *
+from code.fileutils import readFile
def convertMobSkillDb():
srcFile = "oldserverdata/world/map/db/mob_skill_db.txt"
diff --git a/hercules/code/server/tmw/npcs.py b/hercules/code/server/tmw/npcs.py
index dc73d75..c51da78 100644
--- a/hercules/code/server/tmw/npcs.py
+++ b/hercules/code/server/tmw/npcs.py
@@ -3,10 +3,11 @@
# Copyright (C) 2014 Evol Online
# Author: Andrei Karas (4144)
+import os
import re
-from code.fileutils import *
-from code.stringutils import *
+from code.fileutils import makeDir
+from code.stringutils import stripWindows, stripNewLine
mapsConfFile = "newserverdata/conf/maps.conf"
if os.path.isfile(mapsConfFile):
diff --git a/hercules/code/server/utils.py b/hercules/code/server/utils.py
index 0f164ca..ebbddf3 100644
--- a/hercules/code/server/utils.py
+++ b/hercules/code/server/utils.py
@@ -3,7 +3,7 @@
# Copyright (C) 2014 Evol Online
# Author: Andrei Karas (4144)
-from code.fileutils import *
+from code.fileutils import removeAllFiles, makeDir
def cleanServerData():
removeAllFiles("newserverdata")
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
diff --git a/hercules/code/tileutils.py b/hercules/code/tileutils.py
index c5457e7..42e7a84 100644
--- a/hercules/code/tileutils.py
+++ b/hercules/code/tileutils.py
@@ -14,7 +14,7 @@ def getTileData(mapData, x, y, sx):
def getTile(data):
normal = 0
- collison = 0
+ collision = 0
if data == 0: # 000 normal walkable
normal = 1
collision = 5