diff options
-rwxr-xr-x | wiki/wikigen.py | 95 |
1 files changed, 56 insertions, 39 deletions
diff --git a/wiki/wikigen.py b/wiki/wikigen.py index 681aa39..8c206ef 100755 --- a/wiki/wikigen.py +++ b/wiki/wikigen.py @@ -29,6 +29,7 @@ IT_ARMOR={ 'MISC': [], # FOR FAILURE 'EQP_SHOES': [], # FEET 'EQP_GARMENT': [], # GLOVES 'EQP_HEAD_LOW':[], # PANTS + '1024': [], # NECKLACES (should be EQP_COSTUME_HEAD_TOP instead of number) '2048': [], # RINGS (should be EQP_COSTUME_HEAD_MID instead of number) 'EQP_HEAD_TOP':[], # HATS/HELMETS 'EQP_HAND_L': [], # SHIELDS @@ -175,12 +176,13 @@ def ItAlloc(it): IT_PETEGG.append(it) elif "IT_WEAPON" in a: - if "HAND_L" or "EQP_ARMS" in it.loc: + if "HAND_L" in it.loc or "EQP_ARMS" in it.loc: IT_WEAPON["HAND_2"].append(it) elif "HAND_R" in it.loc: IT_WEAPON["HAND_1"].append(it) else: raise Exception("Invalid location for weapon: %s" % it.loc) + elif "IT_ARMOR" in a: if 'EQP_ACC_L' in it.loc: IT_ARMOR['EQP_ACC_L'].append(it) @@ -198,10 +200,12 @@ def ItAlloc(it): IT_ARMOR['EQP_HEAD_TOP'].append(it) elif 'EQP_HAND_L' in it.loc: IT_ARMOR['EQP_HAND_L'].append(it) + elif '1024' in it.loc: + IT_ARMOR['1024'].append(it) elif '2048' in it.loc: IT_ARMOR['2048'].append(it) else: - IT_ARMOR['MISC'].append(it) + raise Exception("Invalid Loc for ID %s: %s" % (it.id, it.loc)) def newItemDB(): print("Generating Item Wiki...") @@ -280,14 +284,14 @@ def writeItems(): + [Weapons](#weapons)\n\ + [1H Weapons](#1h-weapons)\n\ + [2H Weapons](#2h-weapons)\n\ -+ [Armor](#armor)\n\ - + [Error](#error)\n\ - + [Bonus L](#bonus-l)\n\ - + [Bonus R](#bonus-r)\n\ ++ [Armors](#armors)\n\ + + [Left Accessory](#left-accessory)\n\ + + [Right Accessory](#right-accessory)\n\ + [Headgear](#headgear)\n\ + [Chest](#chest)\n\ + [Pants](#pants)\n\ + [Shoes](#shoes)\n\ + + [Necklaces](#necklaces)\n\ + [Rings](#rings)\n\ + [Gloves](#gloves)\n\ + [Shields](#shields)\n\ @@ -381,34 +385,7 @@ def writeItems(): ) wikia.write("\n[↑ Return to top](#items)\n\n") - """ - IT_WEAPON={ 'HAND_1' 1h-weapons - 'HAND_2' 2h-weapons - IT_ARMOR={ 'MISC' error - 'EQP_ACC_L': bonus-l - 'EQP_ACC_R': bonus-r - 'EQP_HEAD_TOP': - 'EQP_HEAD_MID': - 'EQP_HEAD_LOW': - 'EQP_SHOES': - '2048': - 'EQP_GARMENT': - 'EQP_HAND_L': - 'EQP_HAND_R': - self.atk="0" - self.matk="0" - self.range="0" - self.defs="0" - - # Restrictions (EquipLv) - self.lvl="0" - self.drop=True - self.trade=True - self.sell=True - self.store=True - - """ - + #################################################################### wikia.write("# Weapons\n") # 1 Hand Items @@ -418,8 +395,8 @@ def writeItems(): for i in IT_WEAPON['HAND_1']: wikia.write( i.id +"|"+ - i.aegis +"|$ "+ - i.price +"|"+ + i.aegis +"|"+ + i.price +" GP|"+ i.weight +"g|Atk: "+ i.atk +"|"+ i.matk +"|Lv: "+ @@ -430,12 +407,12 @@ def writeItems(): # 2 Hand Items wikia.write("## 2H Weapons\n") wikia.write("Id|Aegis|Price|Weight|Atk|Matk|Lvl|Range|\n") - wikia.write("--|-----|-----|------|---|----|---|Range|\n") + wikia.write("--|-----|-----|------|---|----|---|-----|\n") for i in IT_WEAPON['HAND_2']: wikia.write( i.id +"|"+ - i.aegis +"|$ "+ - i.price +"|"+ + i.aegis +"|"+ + i.price +" GP|"+ i.weight +"g|Atk: "+ i.atk +"|"+ i.matk +"|Lv: "+ @@ -444,6 +421,46 @@ def writeItems(): ) wikia.write("\n[↑ Return to top](#items)\n\n") + + #################################################################### + wikia.write("# Armors\n") + + ArmorWrite("Left Accessory",'EQP_ACC_L') + ArmorWrite("Right Accessory",'EQP_ACC_R') + ArmorWrite("Headgear",'EQP_HEAD_TOP') + ArmorWrite("Chest",'EQP_HEAD_MID') + ArmorWrite("Pants",'EQP_HEAD_LOW') + ArmorWrite("Shoes",'EQP_SHOES') + ArmorWrite("Necklaces",'1024') + ArmorWrite("Rings",'2048') + ArmorWrite("Gloves",'EQP_GARMENT') + ArmorWrite("Shields",'EQP_HAND_L') + ArmorWrite("Right Hand",'EQP_HAND_R') + + # Still need restriction saving + """ + self.drop=True + self.trade=True + self.sell=True + self.store=True + """ + +def ArmorWrite(name,scope): + wikia.write("## "+name+"\n") + wikia.write("Id|Aegis|Price|Weight|Def|Lvl|Script|\n") + wikia.write("--|-----|-----|------|---|---|------|\n") + for i in IT_ARMOR[scope]: + wikia.write( + i.id +"|"+ + i.aegis +"|"+ + i.price +" GP|"+ + i.weight +"g|Def: "+ + i.defs +"|Lv: "+ + i.lvl +"|"+ + str(i.script) + "|\n" + ) + wikia.write("\n[↑ Return to top](#items)\n\n") + showHeader() testMobs() |