summaryrefslogtreecommitdiff
path: root/wiki/wikigen.py
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-06-25 19:03:54 -0300
committerJesusaves <cpntb1@ymail.com>2018-06-25 19:03:54 -0300
commit51db20ae8611c05ba06818d4044b968fcb1dff3a (patch)
treeb61ed6f6cb1149c8af5c8e0d5bfd8c581be7ebb6 /wiki/wikigen.py
parent978ee958d2c9d6e4c7ff4355c350336c07f8111b (diff)
downloadtools-51db20ae8611c05ba06818d4044b968fcb1dff3a.tar.gz
tools-51db20ae8611c05ba06818d4044b968fcb1dff3a.tar.bz2
tools-51db20ae8611c05ba06818d4044b968fcb1dff3a.tar.xz
tools-51db20ae8611c05ba06818d4044b968fcb1dff3a.zip
Update wikigen to sort correctly drops on monsters, and disregard invalid entries
Diffstat (limited to 'wiki/wikigen.py')
-rwxr-xr-xwiki/wikigen.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/wiki/wikigen.py b/wiki/wikigen.py
index c34172b..7c4ece2 100755
--- a/wiki/wikigen.py
+++ b/wiki/wikigen.py
@@ -103,11 +103,13 @@ def MobAlloc(ab):
Mobs4.append(ab)
elif maab <= 100:
Mobs5.append(ab)
- else:
+ elif maab != 9901:
MobsA.append(ab)
+ else:
+ print("WARNING, Disregarding \"%s\" (ID: %s) as invalid mob" % (ab.name, ab.id))
def testMobs():
- print("Generating Mob Wiki...")
+ print("\nGenerating Mob Wiki...")
src=open("../../server-data/db/re/mob_db.conf", "r")
wikib.write("# Monster Database\n")
start=False
@@ -246,7 +248,8 @@ def mb_rdrw(mb):
def mb_rddrop(mb):
buff=""
- for ax in mb.drops:
+ # sorted
+ for ax in sorted(mb.drops, key=lambda xcv: float(xcv[1]), reverse=True):
# Ignore disabled drops
if ax[0].startswith("//"):
continue
@@ -359,7 +362,7 @@ def ItAlloc(it):
raise Exception("Invalid Loc for ID %s: %s" % (it.id, it.loc))
def newItemDB():
- print("Generating Item Wiki...")
+ print("\nGenerating Item Wiki...")
src=open("../../server-data/db/re/item_db.conf", "r")
x=It()
@@ -655,7 +658,7 @@ def qnt2(string):
return string.replace('##B','**').replace('##b','**').replace('##0','*').replace('##1','*').replace('##2','*').replace('##3','*').replace('##','*')
def DoQuest():
- print("Generating Quest Wiki...")
+ print("\nGenerating Quest Wiki...")
src=open("../../client-data/quests.xml", "r")
qlog=[]