summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rwxr-xr-xclient/minimap-dyecmd.sh261
-rwxr-xr-xclient/weapons.py79
3 files changed, 54 insertions, 289 deletions
diff --git a/.gitignore b/.gitignore
index 76ff40f..47f0a09 100644
--- a/.gitignore
+++ b/.gitignore
@@ -89,3 +89,6 @@ localserver/beta.patch
localserver/beta.patch2
manaplus/*
+# Client
+client/minimap-dyecmd.sh
+
diff --git a/client/minimap-dyecmd.sh b/client/minimap-dyecmd.sh
deleted file mode 100755
index 4c3f1e0..0000000
--- a/client/minimap-dyecmd.sh
+++ /dev/null
@@ -1,261 +0,0 @@
-cd ../../client-data/graphics/minimaps
-dyecmd 000-1.png tmp ; mv tmp 000-1.png
-echo "Converted 000-1.png successfully."
-dyecmd 001-1.png tmp ; mv tmp 001-1.png
-echo "Converted 001-1.png successfully."
-dyecmd 001-2.png tmp ; mv tmp 001-2.png
-echo "Converted 001-2.png successfully."
-dyecmd 001-3.png tmp ; mv tmp 001-3.png
-echo "Converted 001-3.png successfully."
-dyecmd 002-1.png tmp ; mv tmp 002-1.png
-echo "Converted 002-1.png successfully."
-dyecmd 002-2.png tmp ; mv tmp 002-2.png
-echo "Converted 002-2.png successfully."
-dyecmd 002-3.png tmp ; mv tmp 002-3.png
-echo "Converted 002-3.png successfully."
-dyecmd 002-4.png tmp ; mv tmp 002-4.png
-echo "Converted 002-4.png successfully."
-dyecmd 002-5.png tmp ; mv tmp 002-5.png
-echo "Converted 002-5.png successfully."
-dyecmd 003-1.png tmp ; mv tmp 003-1.png
-echo "Converted 003-1.png successfully."
-dyecmd 003-4.png tmp ; mv tmp 003-4.png
-echo "Converted 003-4.png successfully."
-dyecmd 004-1.png tmp ; mv tmp 004-1.png
-echo "Converted 004-1.png successfully."
-dyecmd 004-3.png tmp ; mv tmp 004-3.png
-echo "Converted 004-3.png successfully."
-dyecmd 004-4.png tmp ; mv tmp 004-4.png
-echo "Converted 004-4.png successfully."
-dyecmd 004-5.png tmp ; mv tmp 004-5.png
-echo "Converted 004-5.png successfully."
-dyecmd 005-3.png tmp ; mv tmp 005-3.png
-echo "Converted 005-3.png successfully."
-dyecmd 006-1.png tmp ; mv tmp 006-1.png
-echo "Converted 006-1.png successfully."
-dyecmd 006-2.png tmp ; mv tmp 006-2.png
-echo "Converted 006-2.png successfully."
-dyecmd 006-3.png tmp ; mv tmp 006-3.png
-echo "Converted 006-3.png successfully."
-dyecmd 007-1.png tmp ; mv tmp 007-1.png
-echo "Converted 007-1.png successfully."
-dyecmd 007-2.png tmp ; mv tmp 007-2.png
-echo "Converted 007-2.png successfully."
-dyecmd 008-1.png tmp ; mv tmp 008-1.png
-echo "Converted 008-1.png successfully."
-dyecmd 009-1.png tmp ; mv tmp 009-1.png
-echo "Converted 009-1.png successfully."
-dyecmd 009-2.png tmp ; mv tmp 009-2.png
-echo "Converted 009-2.png successfully."
-dyecmd 009-3.png tmp ; mv tmp 009-3.png
-echo "Converted 009-3.png successfully."
-dyecmd 009-4.png tmp ; mv tmp 009-4.png
-echo "Converted 009-4.png successfully."
-dyecmd 009-5.png tmp ; mv tmp 009-5.png
-echo "Converted 009-5.png successfully."
-dyecmd 009-6.png tmp ; mv tmp 009-6.png
-echo "Converted 009-6.png successfully."
-dyecmd 009-7.png tmp ; mv tmp 009-7.png
-echo "Converted 009-7.png successfully."
-dyecmd 009-8.png tmp ; mv tmp 009-8.png
-echo "Converted 009-8.png successfully."
-dyecmd 010-1.png tmp ; mv tmp 010-1.png
-echo "Converted 010-1.png successfully."
-dyecmd 010-2.png tmp ; mv tmp 010-2.png
-echo "Converted 010-2.png successfully."
-dyecmd 011-1.png tmp ; mv tmp 011-1.png
-echo "Converted 011-1.png successfully."
-dyecmd 011-3.png tmp ; mv tmp 011-3.png
-echo "Converted 011-3.png successfully."
-dyecmd 011-4.png tmp ; mv tmp 011-4.png
-echo "Converted 011-4.png successfully."
-dyecmd 011-6.png tmp ; mv tmp 011-6.png
-echo "Converted 011-6.png successfully."
-dyecmd 012-1.png tmp ; mv tmp 012-1.png
-echo "Converted 012-1.png successfully."
-dyecmd 012-3.png tmp ; mv tmp 012-3.png
-echo "Converted 012-3.png successfully."
-dyecmd 012-4.png tmp ; mv tmp 012-4.png
-echo "Converted 012-4.png successfully."
-dyecmd 013-1.png tmp ; mv tmp 013-1.png
-echo "Converted 013-1.png successfully."
-dyecmd 013-2.png tmp ; mv tmp 013-2.png
-echo "Converted 013-2.png successfully."
-dyecmd 013-3.png tmp ; mv tmp 013-3.png
-echo "Converted 013-3.png successfully."
-dyecmd 014-1.png tmp ; mv tmp 014-1.png
-echo "Converted 014-1.png successfully."
-dyecmd 014-3.png tmp ; mv tmp 014-3.png
-echo "Converted 014-3.png successfully."
-dyecmd 015-1.png tmp ; mv tmp 015-1.png
-echo "Converted 015-1.png successfully."
-dyecmd 015-3.png tmp ; mv tmp 015-3.png
-echo "Converted 015-3.png successfully."
-dyecmd 016-1.png tmp ; mv tmp 016-1.png
-echo "Converted 016-1.png successfully."
-dyecmd 016-2.png tmp ; mv tmp 016-2.png
-echo "Converted 016-2.png successfully."
-dyecmd 017-1.png tmp ; mv tmp 017-1.png
-echo "Converted 017-1.png successfully."
-dyecmd 017-2.png tmp ; mv tmp 017-2.png
-echo "Converted 017-2.png successfully."
-dyecmd 017-3.png tmp ; mv tmp 017-3.png
-echo "Converted 017-3.png successfully."
-dyecmd 017-4.png tmp ; mv tmp 017-4.png
-echo "Converted 017-4.png successfully."
-dyecmd 017-9.png tmp ; mv tmp 017-9.png
-echo "Converted 017-9.png successfully."
-dyecmd 018-1.png tmp ; mv tmp 018-1.png
-echo "Converted 018-1.png successfully."
-dyecmd 018-2.png tmp ; mv tmp 018-2.png
-echo "Converted 018-2.png successfully."
-dyecmd 018-3.png tmp ; mv tmp 018-3.png
-echo "Converted 018-3.png successfully."
-dyecmd 019-1.png tmp ; mv tmp 019-1.png
-echo "Converted 019-1.png successfully."
-dyecmd 019-3.png tmp ; mv tmp 019-3.png
-echo "Converted 019-3.png successfully."
-dyecmd 019-4.png tmp ; mv tmp 019-4.png
-echo "Converted 019-4.png successfully."
-dyecmd 020-1.png tmp ; mv tmp 020-1.png
-echo "Converted 020-1.png successfully."
-dyecmd 020-2.png tmp ; mv tmp 020-2.png
-echo "Converted 020-2.png successfully."
-dyecmd 020-3.png tmp ; mv tmp 020-3.png
-echo "Converted 020-3.png successfully."
-dyecmd 021-3.png tmp ; mv tmp 021-3.png
-echo "Converted 021-3.png successfully."
-dyecmd 023-1.png tmp ; mv tmp 023-1.png
-echo "Converted 023-1.png successfully."
-dyecmd 023-2.png tmp ; mv tmp 023-2.png
-echo "Converted 023-2.png successfully."
-dyecmd 023-3.png tmp ; mv tmp 023-3.png
-echo "Converted 023-3.png successfully."
-dyecmd 025-1.png tmp ; mv tmp 025-1.png
-echo "Converted 025-1.png successfully."
-dyecmd 025-3.png tmp ; mv tmp 025-3.png
-echo "Converted 025-3.png successfully."
-dyecmd 025-4.png tmp ; mv tmp 025-4.png
-echo "Converted 025-4.png successfully."
-dyecmd 026-1.png tmp ; mv tmp 026-1.png
-echo "Converted 026-1.png successfully."
-dyecmd 026-2.png tmp ; mv tmp 026-2.png
-echo "Converted 026-2.png successfully."
-dyecmd 027-1.png tmp ; mv tmp 027-1.png
-echo "Converted 027-1.png successfully."
-dyecmd 027-2.png tmp ; mv tmp 027-2.png
-echo "Converted 027-2.png successfully."
-dyecmd 027-3.png tmp ; mv tmp 027-3.png
-echo "Converted 027-3.png successfully."
-dyecmd 027-4.png tmp ; mv tmp 027-4.png
-echo "Converted 027-4.png successfully."
-dyecmd 027-5.png tmp ; mv tmp 027-5.png
-echo "Converted 027-5.png successfully."
-dyecmd 027-6.png tmp ; mv tmp 027-6.png
-echo "Converted 027-6.png successfully."
-dyecmd 027-7.png tmp ; mv tmp 027-7.png
-echo "Converted 027-7.png successfully."
-dyecmd 027-8.png tmp ; mv tmp 027-8.png
-echo "Converted 027-8.png successfully."
-dyecmd 028-1.png tmp ; mv tmp 028-1.png
-echo "Converted 028-1.png successfully."
-dyecmd 028-3.png tmp ; mv tmp 028-3.png
-echo "Converted 028-3.png successfully."
-dyecmd 029-1.png tmp ; mv tmp 029-1.png
-echo "Converted 029-1.png successfully."
-dyecmd 029-2.png tmp ; mv tmp 029-2.png
-echo "Converted 029-2.png successfully."
-dyecmd 029-3.png tmp ; mv tmp 029-3.png
-echo "Converted 029-3.png successfully."
-dyecmd 029-4.png tmp ; mv tmp 029-4.png
-echo "Converted 029-4.png successfully."
-dyecmd 030-1.png tmp ; mv tmp 030-1.png
-echo "Converted 030-1.png successfully."
-dyecmd 030-2.png tmp ; mv tmp 030-2.png
-echo "Converted 030-2.png successfully."
-dyecmd 030-3.png tmp ; mv tmp 030-3.png
-echo "Converted 030-3.png successfully."
-dyecmd 030-4.png tmp ; mv tmp 030-4.png
-echo "Converted 030-4.png successfully."
-dyecmd 031-1.png tmp ; mv tmp 031-1.png
-echo "Converted 031-1.png successfully."
-dyecmd 031-2.png tmp ; mv tmp 031-2.png
-echo "Converted 031-2.png successfully."
-dyecmd 031-3.png tmp ; mv tmp 031-3.png
-echo "Converted 031-3.png successfully."
-dyecmd 031-4.png tmp ; mv tmp 031-4.png
-echo "Converted 031-4.png successfully."
-dyecmd 032-3.png tmp ; mv tmp 032-3.png
-echo "Converted 032-3.png successfully."
-dyecmd 033-1.png tmp ; mv tmp 033-1.png
-echo "Converted 033-1.png successfully."
-dyecmd 034-1.png tmp ; mv tmp 034-1.png
-echo "Converted 034-1.png successfully."
-dyecmd 034-2.png tmp ; mv tmp 034-2.png
-echo "Converted 034-2.png successfully."
-dyecmd 035-2.png tmp ; mv tmp 035-2.png
-echo "Converted 035-2.png successfully."
-dyecmd 036-2.png tmp ; mv tmp 036-2.png
-echo "Converted 036-2.png successfully."
-dyecmd 041-1.png tmp ; mv tmp 041-1.png
-echo "Converted 041-1.png successfully."
-dyecmd 042-1.png tmp ; mv tmp 042-1.png
-echo "Converted 042-1.png successfully."
-dyecmd 043-1.png tmp ; mv tmp 043-1.png
-echo "Converted 043-1.png successfully."
-dyecmd 043-3.png tmp ; mv tmp 043-3.png
-echo "Converted 043-3.png successfully."
-dyecmd 043-4.png tmp ; mv tmp 043-4.png
-echo "Converted 043-4.png successfully."
-dyecmd 045-1.png tmp ; mv tmp 045-1.png
-echo "Converted 045-1.png successfully."
-dyecmd 046-1.png tmp ; mv tmp 046-1.png
-echo "Converted 046-1.png successfully."
-dyecmd 046-3.png tmp ; mv tmp 046-3.png
-echo "Converted 046-3.png successfully."
-dyecmd 047-1.png tmp ; mv tmp 047-1.png
-echo "Converted 047-1.png successfully."
-dyecmd 047-3.png tmp ; mv tmp 047-3.png
-echo "Converted 047-3.png successfully."
-dyecmd 048-2.png tmp ; mv tmp 048-2.png
-echo "Converted 048-2.png successfully."
-dyecmd 051-1.png tmp ; mv tmp 051-1.png
-echo "Converted 051-1.png successfully."
-dyecmd 051-3.png tmp ; mv tmp 051-3.png
-echo "Converted 051-3.png successfully."
-dyecmd 052-1.png tmp ; mv tmp 052-1.png
-echo "Converted 052-1.png successfully."
-dyecmd 052-2.png tmp ; mv tmp 052-2.png
-echo "Converted 052-2.png successfully."
-dyecmd 055-1.png tmp ; mv tmp 055-1.png
-echo "Converted 055-1.png successfully."
-dyecmd 055-3.png tmp ; mv tmp 055-3.png
-echo "Converted 055-3.png successfully."
-dyecmd 056-2.png tmp ; mv tmp 056-2.png
-echo "Converted 056-2.png successfully."
-dyecmd 057-1.png tmp ; mv tmp 057-1.png
-echo "Converted 057-1.png successfully."
-dyecmd 069-2.png tmp ; mv tmp 069-2.png
-echo "Converted 069-2.png successfully."
-dyecmd 070-1.png tmp ; mv tmp 070-1.png
-echo "Converted 070-1.png successfully."
-dyecmd 070-3.png tmp ; mv tmp 070-3.png
-echo "Converted 070-3.png successfully."
-dyecmd 099-1.png tmp ; mv tmp 099-1.png
-echo "Converted 099-1.png successfully."
-dyecmd 099-2.png tmp ; mv tmp 099-2.png
-echo "Converted 099-2.png successfully."
-dyecmd 099-3.png tmp ; mv tmp 099-3.png
-echo "Converted 099-3.png successfully."
-dyecmd 099-4.png tmp ; mv tmp 099-4.png
-echo "Converted 099-4.png successfully."
-dyecmd 099-5.png tmp ; mv tmp 099-5.png
-echo "Converted 099-5.png successfully."
-dyecmd 099-6.png tmp ; mv tmp 099-6.png
-echo "Converted 099-6.png successfully."
-dyecmd 099-7.png tmp ; mv tmp 099-7.png
-echo "Converted 099-7.png successfully."
-dyecmd 099-8.png tmp ; mv tmp 099-8.png
-echo "Converted 099-8.png successfully."
-dyecmd botcheck.png tmp ; mv tmp botcheck.png
-echo "Converted botcheck.png successfully."
diff --git a/client/weapons.py b/client/weapons.py
index be2f60e..8b4d663 100755
--- a/client/weapons.py
+++ b/client/weapons.py
@@ -1,25 +1,26 @@
#!/usr/bin/python2.7
+import copy
+TYPE_NUL=0
+TYPE_WPN=1
+TYPE_BOW=2
+TYPE_SHD=3
class Item:
- def __init__(self, xid):
+ def __init__(self, xid, typ=TYPE_NUL):
self.id=xid
self.lvl=0
-
-a=open("../../client-data/items.xml", "r")
-
-swords=[]
-bows=[]
-shields=[]
-
-gid="0"
-rid=0
-ctx=Item(0)
-mem=[]
-
-for l in a:
+ self.type=typ
+
+def main(a, typ=TYPE_NUL):
+ global swords, bows, shields, gid, rid, tip, ctx, mem
+ gid="0"
+ rid=0
+ tip=TYPE_NUL
+ ctx=Item(0, typ)
+ for l in a:
if "<item id=" in l:
if ctx.id > 0:
- mem.append(ctx)
+ mem.append(copy.copy(ctx))
gid=l.replace('\t', '').replace(' ','').replace('<itemid=', '').replace('"', '').replace("'", "")
rid=0
@@ -32,29 +33,51 @@ for l in a:
print "[CRITICAL] Invalid item ID format: " + l
exit(1)
- ctx=Item(rid)
+ ctx=Item(rid, typ)
if "\tlevel=" in l or " level=" in l:
gid=l.replace('\t', '').replace(' ','').replace('level=', '').replace('"', '').replace("'", "")
try:
- rid=int(gid)
+ ctx.lvl=int(gid)
except:
print "[CRITICAL] Invalid item level format: " + l
- rid=0
+ ctx.lvl=0
+
+ if "\tattack-range=" in l or " attack-range=" in l:
+ tip=l.replace('\t', '').replace(' ','').replace('attack-range=', '').replace('"', '').replace("'", "").replace(">", "")
+ try:
+ if int(tip) > 2:
+ ctx.type=TYPE_BOW
+ else:
+ ctx.type=TYPE_WPN
+ except:
+ print "[CRITICAL] Invalid item range format: " + l
+ ctx.type=TYPE_NUL
+
ctx.lvl=0+rid
+ return
+
+swords=[]
+bows=[]
+shields=[]
+
+mem=[]
+
+f1=open("../../client-data/items/equip-1hand.xml", "r"); main(f1); f1.close()
+f2=open("../../client-data/items/equip-2hand.xml", "r"); main(f2); f2.close()
+f3=open("../../client-data/items/equip-shield.xml", "r"); main(f3, TYPE_SHD); f3.close()
mem=sorted(mem, key=lambda xcv: xcv.lvl, reverse=True)
for r in mem:
- rid=r.id
- if rid >= 2700 and rid <= 2899:
- shields.append(rid)
- elif rid >= 3500 and rid <= 3999:
- swords.append(rid)
- elif rid >= 6000 and rid <= 6499:
- bows.append(rid)
-
-a.close()
+ if r.type == TYPE_SHD:
+ shields.append(r.id)
+ elif r.type == TYPE_WPN:
+ swords.append(r.id)
+ elif r.type == TYPE_BOW:
+ bows.append(r.id)
+ else:
+ print("Wrong type for item %d" % r.id)
#shields=sorted(shields, reverse=True)
#bows=sorted(bows, reverse=True)
@@ -65,7 +88,7 @@ b=open("weapons.tmp", "w")
b.write('<?xml version="1.0" encoding="utf-8"?>\n\
<!-- Author: 4144, Jesusalva\n\
Copyright (C) 2015 Evol Online\n\
-Copyright (C) 2019-2020 The Mana World\n -->\n\
+Copyright (C) 2019-2021 The Mana World\n -->\n\
\n\
<weapons>\n')