2021-01-06 06:10:27 +00:00
|
|
|
import json
|
|
|
|
|
|
|
|
with open("dump.json", "r") as infile:
|
|
|
|
data = json.loads(infile.read())
|
|
|
|
|
|
|
|
items = data["items"]
|
2021-01-06 12:48:41 +00:00
|
|
|
del data["request"]
|
2021-01-06 06:10:27 +00:00
|
|
|
|
|
|
|
translate_mappings = {
|
2021-01-06 12:48:41 +00:00
|
|
|
#"name": "name",
|
|
|
|
#"displayName": "displayName",
|
|
|
|
#"tier": "tier",
|
|
|
|
#"set": "set",
|
2021-01-06 06:10:27 +00:00
|
|
|
"sockets": "slots",
|
2021-01-06 12:48:41 +00:00
|
|
|
#"type": "type",
|
2021-01-06 22:51:02 +00:00
|
|
|
#"armorType": "armorType",
|
2021-01-06 12:48:41 +00:00
|
|
|
"armorColor": "color",
|
2021-01-06 06:10:27 +00:00
|
|
|
"addedLore": "lore",
|
2021-01-06 12:48:41 +00:00
|
|
|
#"material": "material",
|
|
|
|
"dropType": "drop",
|
|
|
|
#"quest": "quest",
|
|
|
|
"restrictions": "restrict",
|
2021-01-06 06:10:27 +00:00
|
|
|
"damage": "nDam",
|
|
|
|
"fireDamage": "fDam",
|
|
|
|
"waterDamage": "wDam",
|
|
|
|
"airDamage": "aDam",
|
|
|
|
"thunderDamage": "tDam",
|
|
|
|
"earthDamage": "eDam",
|
|
|
|
"attackSpeed": "atkSpd",
|
|
|
|
"health": "hp",
|
|
|
|
"fireDefense": "fDef",
|
|
|
|
"waterDefense": "wDef",
|
|
|
|
"airDefense": "aDef",
|
|
|
|
"thunderDefense": "tDef",
|
|
|
|
"earthDefense": "eDef",
|
|
|
|
"level": "lvl",
|
|
|
|
"classRequirement": "classReq",
|
|
|
|
"strength": "strReq",
|
|
|
|
"dexterity": "dexReq",
|
|
|
|
"intelligence": "intReq",
|
|
|
|
"agility": "agiReq",
|
|
|
|
"defense": "defReq",
|
|
|
|
"healthRegen": "hprPct",
|
|
|
|
"manaRegen": "mr",
|
2021-01-06 12:48:41 +00:00
|
|
|
"spellDamage": "sdPct",
|
|
|
|
"damageBonus": "mdPct",
|
2021-01-06 06:10:27 +00:00
|
|
|
"lifeSteal": "ls",
|
|
|
|
"manaSteal": "ms",
|
|
|
|
"xpBonus": "xpb",
|
|
|
|
"lootBonus": "lb",
|
|
|
|
"reflection": "ref",
|
|
|
|
"strengthPoints": "str",
|
|
|
|
"dexterityPoints": "dex",
|
|
|
|
"intelligencePoints": "int",
|
|
|
|
"agilityPoints": "agi",
|
|
|
|
"defensePoints": "def",
|
|
|
|
#"thorns": "thorns",
|
|
|
|
#"exploding": "expoding",
|
|
|
|
"speed": "spd",
|
2021-01-06 12:48:41 +00:00
|
|
|
"attackSpeedBonus": "atkTier",
|
2021-01-06 06:10:27 +00:00
|
|
|
#"poison": "poison",
|
|
|
|
"healthBonus": "hpBonus",
|
|
|
|
"soulPoints": "spRegen",
|
2021-01-06 12:48:41 +00:00
|
|
|
"emeraldStealing": "eSteal",
|
2021-01-06 06:10:27 +00:00
|
|
|
"healthRegenRaw": "hprRaw",
|
2021-01-06 12:48:41 +00:00
|
|
|
"spellDamageRaw": "sdRaw",
|
|
|
|
"damageBonusRaw": "mdRaw",
|
2021-01-06 06:10:27 +00:00
|
|
|
"bonusFireDamage": "fDamPct",
|
|
|
|
"bonusWaterDamage": "wDamPct",
|
|
|
|
"bonusAirDamage": "aDamPct",
|
|
|
|
"bonusThunderDamage": "tDamPct",
|
|
|
|
"bonusEarthDamage": "eDamPct",
|
|
|
|
"bonusFireDefense": "fDefPct",
|
|
|
|
"bonusWaterDefense": "wDefPct",
|
|
|
|
"bonusAirDefense": "aDefPct",
|
|
|
|
"bonusThunderDefense": "tDefPct",
|
|
|
|
"bonusEarthDefense": "eDefPct",
|
2021-01-06 12:48:41 +00:00
|
|
|
"accessoryType": "type",
|
2021-01-06 06:10:27 +00:00
|
|
|
"identified": "fixID",
|
2021-01-06 12:48:41 +00:00
|
|
|
#"skin": "skin",
|
|
|
|
#"category": "category",
|
2021-01-06 06:10:27 +00:00
|
|
|
|
2021-01-06 12:48:41 +00:00
|
|
|
"spellCostPct1": "spPct1",
|
|
|
|
"spellCostRaw1": "spRaw1",
|
|
|
|
"spellCostPct2": "spPct2",
|
|
|
|
"spellCostRaw2": "spRaw2",
|
|
|
|
"spellCostPct3": "spPct3",
|
|
|
|
"spellCostRaw3": "spRaw3",
|
|
|
|
"spellCostPct4": "spPct4",
|
|
|
|
"spellCostRaw4": "spRaw4",
|
2021-01-06 06:10:27 +00:00
|
|
|
|
2021-01-06 12:48:41 +00:00
|
|
|
"rainbowSpellDamageRaw": "rainbowRaw",
|
2021-01-06 06:10:27 +00:00
|
|
|
"sprint": "sprint",
|
|
|
|
"sprintRegen": "sprintReg",
|
|
|
|
"jumpHeight": "jh",
|
|
|
|
"lootQuality": "lq",
|
2021-01-06 12:48:41 +00:00
|
|
|
|
|
|
|
"gatherXpBonus": "gXp",
|
|
|
|
"gatherSpeed": "gSpd",
|
2021-01-06 06:10:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
delete_keys = [
|
|
|
|
"addedLore",
|
|
|
|
"skin",
|
|
|
|
"armorType",
|
|
|
|
"armorColor"
|
|
|
|
]
|
|
|
|
|
|
|
|
for item in items:
|
|
|
|
for key in delete_keys:
|
|
|
|
if key in item:
|
|
|
|
del item[key]
|
|
|
|
|
|
|
|
for k, v in translate_mappings.items():
|
|
|
|
if k in item:
|
|
|
|
item[v] = item[k]
|
|
|
|
del item[k]
|
|
|
|
|
2021-01-06 12:48:41 +00:00
|
|
|
item["type"] = item["type"].lower()
|
|
|
|
|
2021-01-06 06:10:27 +00:00
|
|
|
with open("clean.json", "w") as outfile:
|
|
|
|
outfile.write(json.dumps(data, indent=2))
|
|
|
|
with open("compress.json", "w") as outfile:
|
|
|
|
outfile.write(json.dumps(data))
|