From 2823a6f2c95d2194e4c8dd0fbb2a63828b746639 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 25 Jun 2016 22:31:10 +0300 Subject: hercules: fix different issues in item_db with wrong item types and other. --- hercules/code/server/tmw/itemdb.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hercules/code/server/tmw/itemdb.py b/hercules/code/server/tmw/itemdb.py index f45d4ee..851f36d 100644 --- a/hercules/code/server/tmw/itemdb.py +++ b/hercules/code/server/tmw/itemdb.py @@ -187,9 +187,11 @@ def convertItemDb(isNew): offset = 0 writeStrField(w, "Name", rows[offset + 2]) if rows[offset + 3] == "0": - writeIntField(w, "Type", "2") + itemType = "2" else: - writeIntField(w, "Type", rows[offset + 3]) + itemType = rows[offset + 3] + writeIntField(w, "Type", itemType) + writeIntField(w, "Buy", rows[offset + 4]) if int(rows[offset + 4])*.75 <= int(rows[offset + 5])*1.24: writeIntField(w, "Sell", str(int(rows[offset + 4])*.75)) @@ -218,6 +220,8 @@ def convertItemDb(isNew): writeIntField(w, "View", "11") elif rows[offset + 13] == "32768": writeIntField(w, "View", "1") + elif itemType == "4": # weapon + writeIntField(w, "View", "1") else: writeIntField(w, "View", rows[0]) writeIntField(w, "BindOnEquip", "false") @@ -226,7 +230,11 @@ def convertItemDb(isNew): writeIntField(w, "Sprite", "0") scripts = "" - for f in xrange(17, len(rows)): + if isNew == True: + offset = -1 + else: + offset = 0 + for f in xrange(offset + 17, len(rows)): scripts = scripts + ", " + rows[f] rows = scriptsSplit.split(scripts) # Needs .split(';') and \n each -- cgit v1.2.3-70-g09d2