This commit is contained in:
ferricles 2021-05-05 20:12:27 -07:00
commit f9e3d0a018
37 changed files with 115052 additions and 274674 deletions

View file

@ -158,6 +158,7 @@ class Build{
this.craftedItems.push(chestplate); this.craftedItems.push(chestplate);
} }
} catch (Error) { } catch (Error) {
console.log(Error);
const chestplate = itemMap.get("No Chestplate"); const chestplate = itemMap.get("No Chestplate");
this.powders[1] = this.powders[1].slice(0,chestplate.slots); this.powders[1] = this.powders[1].slice(0,chestplate.slots);
this.chestplate = expandItem(chestplate, this.powders[1]); this.chestplate = expandItem(chestplate, this.powders[1]);

View file

@ -3,9 +3,7 @@ const url_tag = location.hash.slice(1);
// console.log(url_tag); // console.log(url_tag);
const BUILD_VERSION = "7.0.3"; const BUILD_VERSION = "7.0.5";
function setTitle() { function setTitle() {
let text; let text;
@ -423,8 +421,13 @@ function calculateBuild(save_skp, skp){
*/ */
let equipment = [ null, null, null, null, null, null, null, null, null ]; let equipment = [ null, null, null, null, null, null, null, null, null ];
for (let i in equipment) { for (let i in equipment) {
let equip = getValue(equipmentInputs[i]); let equip = getValue(equipmentInputs[i]).trim();
if (equip === "") { equip = "No " + equipment_names[i] } if (equip === "") {
equip = "No " + equipment_names[i]
}
else {
setValue(equipmentInputs[i], equip);
}
equipment[i] = equip; equipment[i] = equip;
} }
let powderings = []; let powderings = [];
@ -432,7 +435,7 @@ function calculateBuild(save_skp, skp){
for (const i in powderInputs) { for (const i in powderInputs) {
// read in two characters at a time. // read in two characters at a time.
// TODO: make this more robust. // TODO: make this more robust.
let input = getValue(powderInputs[i]); let input = getValue(powderInputs[i]).trim();
let powdering = []; let powdering = [];
let errorederrors = []; let errorederrors = [];
while (input) { while (input) {
@ -925,4 +928,8 @@ function toggleID() {
} }
} }
load_init(init); // TODO: Learn and use await
function init2() {
load_ing_init(init);
}
load_init(init2);

109801
clean.json

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -1,5 +0,0 @@
import sys
import json
infile = sys.argv[1]
outfile = sys.argv[2]
json.dump(json.load(open(infile)), open(outfile, "w"))

View file

@ -1,4 +1,24 @@
let recipeTypes = ["HELMET","CHESTPLATE","LEGGINGS","BOOTS","RELIK","WAND","SPEAR","DAGGER","BOW","RING","NECKLACE","BRACELET","SCROLL","FOOD","POTION"];
let levelTypes = ["1-3","3-5","5-7","7-9","10-13","13-15","15-17","17-19","20-23","23-25","25-27","27-29","30-33","33-35","35-37","37-39","40-43","43-45","45-47","47-49","50-53","53-55","55-57","57-59","60-63","63-65","65-67","67-69","70-73","73-75","75-77","77-79","80-83","83-85","85-87","87-89","90-93","93-95","95-97","97-99","100-103","103-105",]
let ingFields = ["fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct", "hprPct", "mr", "sdPct", "mdPct", "ls", "ms", "xpb", "lb", "lq", "ref", "str", "dex", "int", "agi", "def", "thorns", "expd", "spd", "atkTier", "poison", "hpBonus", "spRegen", "eSteal", "hprRaw", "sdRaw", "mdRaw", "fDamPct", "wDamPct", "aDamPct", "tDamPct", "eDamPct", "spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4", "jh", "sprint", "sprintReg", "gXp", "gSpd"];
function encodeCraft(craft) {
if (craft) {
let atkSpds = ["SLOW","NORMAL","FAST"];
let craft_string = "1" +
Base64.fromIntN(craft.ingreds[0].get("id"), 2) +
Base64.fromIntN(craft.ingreds[1].get("id"), 2) +
Base64.fromIntN(craft.ingreds[2].get("id"), 2) +
Base64.fromIntN(craft.ingreds[3].get("id"), 2) +
Base64.fromIntN(craft.ingreds[4].get("id"), 2) +
Base64.fromIntN(craft.ingreds[5].get("id"), 2) +
Base64.fromIntN(craft.recipe.get("id"),2) +
Base64.fromIntN(craft.mat_tiers[0] + (craft.mat_tiers[1]-1)*3, 1) + //this maps tiers [a,b] to a+3b.
Base64.fromIntN(atkSpds.indexOf(craft["atkSpd"]),1);
return craft_string;
}
return "";
}
//constructs a craft from a hash 'CR-qwoefsabaoe' or 'qwoefsaboe' //constructs a craft from a hash 'CR-qwoefsabaoe' or 'qwoefsaboe'
function getCraftFromHash(hash) { function getCraftFromHash(hash) {
@ -28,6 +48,7 @@ function getCraftFromHash(hash) {
return new Craft(recipe,mat_tiers,ingreds,attackSpeed,"1"+name); return new Craft(recipe,mat_tiers,ingreds,attackSpeed,"1"+name);
} }
} catch (error) { } catch (error) {
console.log(error);
return undefined; return undefined;
} }

View file

@ -20,9 +20,6 @@ const ING_BUILD_VERSION = "7.0.1";
Double powders Double powders
Integrate to normal builder Integrate to normal builder
*/ */
let recipeTypes = ["HELMET","CHESTPLATE","LEGGINGS","BOOTS","RELIK","WAND","SPEAR","DAGGER","BOW","RING","NECKLACE","BRACELET","SCROLL","FOOD","POTION"];
let levelTypes = ["1-3","3-5","5-7","7-9","10-13","13-15","15-17","17-19","20-23","23-25","25-27","27-29","30-33","33-35","35-37","37-39","40-43","43-45","45-47","47-49","50-53","53-55","55-57","57-59","60-63","63-65","65-67","67-69","70-73","73-75","75-77","77-79","80-83","83-85","85-87","87-89","90-93","93-95","95-97","97-99","100-103","103-105",]
let ingFields = ["fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct", "hprPct", "mr", "sdPct", "mdPct", "ls", "ms", "xpb", "lb", "lq", "ref", "str", "dex", "int", "agi", "def", "thorns", "expd", "spd", "atkTier", "poison", "hpBonus", "spRegen", "eSteal", "hprRaw", "sdRaw", "mdRaw", "fDamPct", "wDamPct", "aDamPct", "tDamPct", "eDamPct", "spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4", "jh", "sprint", "sprintReg", "gXp", "gSpd"];
let player_craft; let player_craft;
function setTitle() { function setTitle() {
@ -171,24 +168,6 @@ function calculateCraft() {
} }
function encodeCraft(craft) {
if (craft) {
let atkSpds = ["SLOW","NORMAL","FAST"];
let craft_string = "1" +
Base64.fromIntN(craft.ingreds[0].get("id"), 2) +
Base64.fromIntN(craft.ingreds[1].get("id"), 2) +
Base64.fromIntN(craft.ingreds[2].get("id"), 2) +
Base64.fromIntN(craft.ingreds[3].get("id"), 2) +
Base64.fromIntN(craft.ingreds[4].get("id"), 2) +
Base64.fromIntN(craft.ingreds[5].get("id"), 2) +
Base64.fromIntN(craft.recipe.get("id"),2) +
Base64.fromIntN(craft.mat_tiers[0] + (craft.mat_tiers[1]-1)*3, 1) + //this maps tiers [a,b] to a+3b.
Base64.fromIntN(atkSpds.indexOf(craft["atkSpd"]),1);
return craft_string;
}
return "";
}
function decodeCraft(ing_url_tag) { function decodeCraft(ing_url_tag) {
if (ing_url_tag) { if (ing_url_tag) {
if (ing_url_tag.slice(0,3) === "CR-") { if (ing_url_tag.slice(0,3) === "CR-") {

View file

@ -1,13 +1,84 @@
const ci_save_order = ["name", "lore", "tier", "set", "slots", "type", "material", "drop", "quest", "nDam", "fDam", "wDam", "aDam", "tDam", "eDam", "atkSpd", "hp", "fDef", "wDef", "aDef", "tDef", "eDef", "lvl", "classReq", "strReq", "dexReq", "intReq", "defReq", "agiReq","str", "dex", "int", "agi", "def", "id", "skillpoints", "reqs", "majorIds", "hprPct", "mr", "sdPct", "mdPct", "ls", "ms", "xpb", "lb", "ref", "thorns", "expd", "spd", "atkTier", "poison", "hpBonus", "spRegen", "eSteal", "hprRaw", "sdRaw", "mdRaw", "fDamPct", "wDamPct", "aDamPct", "tDamPct", "eDamPct", "fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct", "spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4", "rainbowRaw", "sprint", "sprintReg", "jh", "lq", "gXp", "gSpd","durability","duration","charges"]; const ci_save_order = ["name", "lore", "tier", "set", "slots", "type", "material", "drop", "quest", "nDam", "fDam", "wDam", "aDam", "tDam", "eDam", "atkSpd", "hp", "fDef", "wDef", "aDef", "tDef", "eDef", "lvl", "classReq", "strReq", "dexReq", "intReq", "defReq", "agiReq","str", "dex", "int", "agi", "def", "id", "skillpoints", "reqs", "nDam_", "fDam_", "wDam_", "aDam_", "tDam_", "eDam_", "majorIds", "hprPct", "mr", "sdPct", "mdPct", "ls", "ms", "xpb", "lb", "ref", "thorns", "expd", "spd", "atkTier", "poison", "hpBonus", "spRegen", "eSteal", "hprRaw", "sdRaw", "mdRaw", "fDamPct", "wDamPct", "aDamPct", "tDamPct", "eDamPct", "fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct", "spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4", "rainbowRaw", "sprint", "sprintReg", "jh", "lq", "gXp", "gSpd","durability","duration","charges"];
const nonRolled_strings = ["name","lore", "tier","set","type","material","drop","quest","majorIds","classReq","atkSpd","displayName", "nDam", "fDam", "wDam", "aDam", "tDam", "eDam", "durability", "duration"]; const nonRolled_strings = ["name","lore", "tier","set","type","material","drop","quest","majorIds","classReq","atkSpd","displayName", "nDam", "fDam", "wDam", "aDam", "tDam", "eDam", "nDam_", "fDam_", "wDam_", "aDam_", "tDam_", "eDam_", "durability", "duration"];
//omitted restrict - it's always "Custom Item" //omitted restrict - it's always "Custom Item"
//omitted displayName - either it's the same as name (repetitive) or it's "Custom Item" //omitted displayName - either it's the same as name (repetitive) or it's "Custom Item"
//omitted category - can always get this from type //omitted category - can always get this from type
//omitted fixId - we will denote this early in the string. //omitted fixId - we will denote this early in the string.
//omitted "nDam_", "fDam_", "wDam_", "aDam_", "tDam_", "eDam_" - will be calculated on display //omitted "nDam_", "fDam_", "wDam_", "aDam_", "tDam_", "eDam_" - will be calculated on display
/**
* @param {Map} custom - the statMap of the CI
* @param {boolean} verbose - if we want lore and majorIds to display
*/
function encodeCustom(custom, verbose) {
if (custom) {
if (custom.statMap) {
custom = custom.statMap;
}
let hash = "1";
//version 1
if (custom.has("fixID") && custom.get("fixID")) {
hash += "1";
} else {
hash += "0";
}
for (const i in ci_save_order) {
let id = ci_save_order[i];
if (rolledIDs.includes(id)) {
let val_min = custom.get("minRolls").has(id) ? custom.get("minRolls").get(id) : 0;
let val_max = custom.get("maxRolls").has(id) ? custom.get("maxRolls").get(id) : 0;
let sign = (Boolean(val_min / Math.abs(val_min) < 0) | 0) + 2*(Boolean(val_max / Math.abs(val_max) < 0) | 0) // 0 - both pos 1 - min neg max pos 2 - min pos max neg (how?) 3 - min neg max neg
//console.log(id + ": " + sign);
let min_len = Math.max(1,Math.ceil(log(64,Math.abs(val_min)+1)));
let max_len = Math.max(1,Math.ceil(log(64,Math.abs(val_max)+1)));
let len = Math.max(min_len,max_len);
val_min = Math.abs(val_min);
val_max = Math.abs(val_max);
if ( val_min != 0 || val_max != 0 ) {
//hash += Base64.fromIntN(i,2) + Base64.fromIntN(val_min,Math.max(1,Math.ceil(log(64,Math.abs(val_min))))) + ":" + Base64.fromIntN(val_max,Math.max(1,Math.ceil(log(64,Math.abs(val_min))))) + "_";
if (custom.get("fixID")) {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(len,2) + sign + Base64.fromIntN(val_min, len);
} else {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(len,2) + sign + Base64.fromIntN(val_min, len) + Base64.fromIntN(val_max,len);
}
}
} else {
let damages = ["nDam", "eDam", "tDam", "wDam", "fDam", "aDam"]; //"nDam_", "eDam_", "tDam_", "wDam_", "fDam_", "aDam_"
let val = custom.get(id);
if (typeof(val) === "string" && val !== "") {
if ((damages.includes(id) && val === "0-0") || (!verbose && ["lore","majorIds","quest","materials","drop","set"].includes(id))) { continue; }
if (id === "type") {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(types.indexOf(val.substring(0,1).toUpperCase()+val.slice(1)),1);
} else if (id === "tier") {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(tiers.indexOf(val),1);
} else if (id === "atkSpd") {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(attackSpeeds.indexOf(val),1);
} else if (id === "classReq") {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(classes.indexOf(val),1);
} else {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(val.replaceAll(" ", "%20").length,2) + val.replaceAll(" ", "%20"); //values cannot go above 4096 chars!!!! Is this ok?
}
} else if (typeof(val) === "number" && val != 0) {
let len = Math.max(1,Math.ceil(log(64,Math.abs(val))));
let sign = Boolean(val / Math.abs(val) < 0) | 0;
//console.log(sign);
//hash += Base64.fromIntN(i,2) + Base64.fromIntN(val,Math.max(1,Math.ceil(log(64,Math.abs(val))))) + "_";
hash += Base64.fromIntN(i,2) + Base64.fromIntN(len,2) + sign + Base64.fromIntN(Math.abs(val),len);
}
}
}
return hash;
}
return "";
}
function getCustomFromHash(hash) { function getCustomFromHash(hash) {
let name = hash.slice(); let name = hash.slice();
let statMap; let statMap;
@ -30,8 +101,10 @@ function getCustomFromHash(hash) {
if (fixID) { if (fixID) {
statMap.set("fixID", true); statMap.set("fixID", true);
} }
console.log(",,");
while (tag !== "") { while (tag !== "") {
let id = ci_save_order[Base64.toInt(tag.slice(0,2))]; let id = ci_save_order[Base64.toInt(tag.slice(0,2))];
console.log(tag.slice(0, 2) + ": " + id);
let len = Base64.toInt(tag.slice(2,4)); let len = Base64.toInt(tag.slice(2,4));
if (rolledIDs.includes(id)) { if (rolledIDs.includes(id)) {
let sign = parseInt(tag.slice(4,5),10); let sign = parseInt(tag.slice(4,5),10);

View file

@ -211,76 +211,6 @@ function calculateCustom() {
} }
/**
* @param {Map} custom - the statMap of the CI
* @param {boolean} verbose - if we want lore and majorIds to display
*/
function encodeCustom(custom, verbose) {
if (custom) {
if (custom.statMap) {
custom = custom.statMap;
}
let hash = "1";
//version 1
if (custom.has("fixID") && custom.get("fixID")) {
hash += "1";
} else {
hash += "0";
}
for (const i in ci_save_order) {
let id = ci_save_order[i];
if (rolledIDs.includes(id)) {
let val_min = custom.get("minRolls").has(id) ? custom.get("minRolls").get(id) : 0;
let val_max = custom.get("maxRolls").has(id) ? custom.get("maxRolls").get(id) : 0;
let sign = (Boolean(val_min / Math.abs(val_min) < 0) | 0) + 2*(Boolean(val_max / Math.abs(val_max) < 0) | 0) // 0 - both pos 1 - min neg max pos 2 - min pos max neg (how?) 3 - min neg max neg
//console.log(id + ": " + sign);
let min_len = Math.max(1,Math.ceil(log(64,Math.abs(val_min)+1)));
let max_len = Math.max(1,Math.ceil(log(64,Math.abs(val_max)+1)));
let len = Math.max(min_len,max_len);
val_min = Math.abs(val_min);
val_max = Math.abs(val_max);
if ( val_min != 0 || val_max != 0 ) {
//hash += Base64.fromIntN(i,2) + Base64.fromIntN(val_min,Math.max(1,Math.ceil(log(64,Math.abs(val_min))))) + ":" + Base64.fromIntN(val_max,Math.max(1,Math.ceil(log(64,Math.abs(val_min))))) + "_";
if (custom.get("fixID")) {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(len,2) + sign + Base64.fromIntN(val_min, len);
} else {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(len,2) + sign + Base64.fromIntN(val_min, len) + Base64.fromIntN(val_max,len);
}
}
} else {
let damages = ["nDam", "eDam", "tDam", "wDam", "fDam", "aDam"]; //"nDam_", "eDam_", "tDam_", "wDam_", "fDam_", "aDam_"
let val = custom.get(id);
if (typeof(val) === "string" && val !== "") {
if ((damages.includes(id) && val === "0-0") || (!verbose && ["lore","majorIds","quest","materials","drop","set"].includes(id))) { continue; }
if (id === "type") {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(types.indexOf(val.substring(0,1).toUpperCase()+val.slice(1)),1);
} else if (id === "tier") {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(tiers.indexOf(val),1);
} else if (id === "atkSpd") {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(attackSpeeds.indexOf(val),1);
} else if (id === "classReq") {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(classes.indexOf(val),1);
} else {
hash += Base64.fromIntN(i,2) + Base64.fromIntN(val.replaceAll(" ", "%20").length,2) + val.replaceAll(" ", "%20"); //values cannot go above 4096 chars!!!! Is this ok?
}
} else if (typeof(val) === "number" && val != 0) {
let len = Math.max(1,Math.ceil(log(64,Math.abs(val))));
let sign = Boolean(val / Math.abs(val) < 0) | 0;
//console.log(sign);
//hash += Base64.fromIntN(i,2) + Base64.fromIntN(val,Math.max(1,Math.ceil(log(64,Math.abs(val))))) + "_";
hash += Base64.fromIntN(i,2) + Base64.fromIntN(len,2) + sign + Base64.fromIntN(Math.abs(val),len);
}
}
}
return hash;
}
return "";
}
function decodeCustom(custom_url_tag) { function decodeCustom(custom_url_tag) {
if (custom_url_tag) { if (custom_url_tag) {
if (custom_url_tag.slice(0,3) === "CI-") { if (custom_url_tag.slice(0,3) === "CI-") {
@ -304,6 +234,7 @@ function decodeCustom(custom_url_tag) {
} }
while (tag !== "") { while (tag !== "") {
let id = ci_save_order[Base64.toInt(tag.slice(0,2))]; let id = ci_save_order[Base64.toInt(tag.slice(0,2))];
console.log(tag.slice(0, 2) + ": " + id);
let len = Base64.toInt(tag.slice(2,4)); let len = Base64.toInt(tag.slice(2,4));
if (rolledIDs.includes(id)) { if (rolledIDs.includes(id)) {
let sign = parseInt(tag.slice(4,5),10); let sign = parseInt(tag.slice(4,5),10);
@ -697,7 +628,9 @@ function saveAsJSON() {
let CI = {}; let CI = {};
for (const [id, val] of player_custom_item.statMap) { for (const [id, val] of player_custom_item.statMap) {
console.log(id); console.log(id);
let skipIds = ["minRolls", "maxRolls", "skillpoints", "reqs", "custom", "crafted", "restrict", "hash", "nDam_", "tDam_", "eDam_", "wDam_", "fDam_", "aDam_"] let skipIds = ["minRolls", "maxRolls", "skillpoints", "reqs", "custom", "crafted", "restrict", "hash",
"nDam_", "tDam_", "eDam_", "wDam_", "fDam_", "aDam_",
"powders", "durability", "duration" ]
if (skipIds.includes(id)) { if (skipIds.includes(id)) {
continue; continue;
} else { } else {

View file

@ -992,9 +992,9 @@
<script type="text/javascript" src="load.js"></script> <script type="text/javascript" src="load.js"></script>
<script type="text/javascript" src="load_ing.js"></script> <script type="text/javascript" src="load_ing.js"></script>
<script type="text/javascript" src="custom.js"></script> <script type="text/javascript" src="custom.js"></script>
<script type="text/javascript" src="customizer.js"></script> <!--script type="text/javascript" src="customizer.js"></script-->
<script type="text/javascript" src="craft.js"></script> <script type="text/javascript" src="craft.js"></script>
<script type="text/javascript" src="crafter.js"></script> <!--script type="text/javascript" src="crafter.js"></script-->
<script type="text/javascript" src="build.js"></script> <script type="text/javascript" src="build.js"></script>
<script type="text/javascript" src="builder.js"></script> <script type="text/javascript" src="builder.js"></script>
</body> </body>

View file

@ -139,7 +139,7 @@ let items_expanded;
function doItemSearch() { function doItemSearch() {
window.scrollTo(0, 0); window.scrollTo(0, 0);
let queries = []; let queries = [];
queries.push(new NameQuery(document.getElementById("name-choice").value)); queries.push(new NameQuery(document.getElementById("name-choice").value.trim()));
let categoryOrType = document.getElementById("category-choice").value; let categoryOrType = document.getElementById("category-choice").value;
if (itemTypes.includes(categoryOrType)) { if (itemTypes.includes(categoryOrType)) {

View file

@ -1,4 +1,4 @@
const DB_VERSION = 38; const DB_VERSION = 40;
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.jsA // @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.jsA
let db; let db;

View file

@ -0,0 +1,8 @@
import sys
import json
infile = sys.argv[1]
outfile = sys.argv[2]
if len(sys.argv) > 3 and sys.argv[3] == "decompress":
json.dump(json.load(open(infile)), open(outfile, "w"), indent=4)
else:
json.dump(json.load(open(infile)), open(outfile, "w"))

14
py_script/grab_sets.sh Normal file
View file

@ -0,0 +1,14 @@
#!/bin/bash
#while read line; do
# curl "https://www.wynndata.tk/sets/${line}" > "sets/${line}"
#done < sets_list.txt
#
#ls sets/ | while read line; do
# grep "Set Items:" "sets/${line}" > "sets/_${line}"
#done
rm sets/*.json
ls sets/ | grep "_" | while read line; do
python3 parse_set_individual.py "sets/${line}"
done

36
py_script/image_get.py Normal file
View file

@ -0,0 +1,36 @@
import os
import json
weapon_types = ["wand", "bow", "spear", "dagger", "relik"]
element_types = ["generic", "fire", "water", "air", "thunder", "earth"] # default1 default2
armor_types = ["helmet", "chestplate", "leggings", "boots"]
armor_tiers = ["leather", "golden", "chain", "iron", "diamond"]
_base_url = "https://www.wynndata.tk/assets/images/items/v4/"
root_loc = "textures/items/"
def grab_texture(base_url, file_name, target_loc):
os.system("curl "+base_url+file_name+" > "+target_loc+"/"+file_name)
#os.system("mv "+target_loc+file_name+" "+target_loc+"/"+file_name)
for wep in weapon_types:
base_url = _base_url+"/"+wep+"/"
target_loc = root_loc+wep
os.system("mkdir "+target_loc)
for elem in element_types:
for i in range(1,4):
file_name = wep+"--"+elem+str(i)+".png"
grab_texture(base_url, file_name, target_loc)
for i in ["default1", "default2"]:
file_name = wep+"--"+i+".png"
grab_texture(base_url, file_name, target_loc)
for armor in armor_types:
base_url = _base_url+armor+"/"
target_loc = root_loc+armor
os.system("mkdir "+target_loc)
for tier in armor_tiers:
file_name = armor+"--"+tier+".png"
grab_texture(base_url, file_name, target_loc)

51
py_script/json_diff.py Normal file
View file

@ -0,0 +1,51 @@
import sys
import json
f1 = sys.argv[1]
f2 = sys.argv[2]
json1 = json.load(open(f1))
json2 = json.load(open(f2))
def shorten(v):
if len(v) > 100:
return v[:100] + "..."
return v
def is_basic(t):
return t is int or t is str or t is float or t is bool or t is list
def object_diff(obj1, obj2, path):
for (k, v) in obj1.items():
if k in obj2:
obj = obj2[k]
type1 = type(v)
type2 = type(obj)
if type1 != type2:
print(f"{path}.{k}: Type difference [{str(type1)} != {str(type2)}]")
elif type1 is list and type2 is list and not is_basic(type(v[0])):
print(f"Encountered object list {path}.{k}, enter match key: ", end="", file=sys.stderr)
key = input()
if (key == ""):
if v != obj:
print(f"{path}.{k}: Value difference")
print(f" Left: {shorten(str(v))}")
print(f" Right: {shorten(str(obj))}")
else:
left = {x[key]: x for x in obj1[k]}
right = {x[key]: x for x in obj2[k]}
object_diff(left, right, path+"."+k)
elif (type1 is list and is_basic(type(v[0]))) or is_basic(type1) or v is None or obj2 is None:
if v != obj:
print(f"{path}.{k}: Value difference")
print(f" Left: {shorten(str(v))}")
print(f" Right: {shorten(str(obj))}")
else:
object_diff(v, obj, path+"."+k)
else:
print(f"{path}.{k}: Contained in left but not right")
print(f" Value: {shorten(str(v))}")
for (k, v) in obj2.items():
if k not in obj1:
print(f"{path}.{k}: Contained in right but not left")
print(f" Value: {shorten(str(v))}")
object_diff(json1, json2, "$")

17
py_script/json_to_yaml.py Normal file
View file

@ -0,0 +1,17 @@
"""
README:
Python 3 required.
pyyaml required (pip3 install pyyaml, or pip install pyyaml)
USAGE:
python3 json_to_yaml.py <infile> <outfile>
"""
import sys
import json
import yaml
yaml.dump(json.load(open(sys.argv[1])), open(sys.argv[2], "w"), default_flow_style=False)

View file

@ -0,0 +1,95 @@
import sys
set_infile = sys.argv[1]
print("-------------------------------")
print(set_infile)
print("-------------------------------")
id_reverse_map = {
"% Health Regen": "hprPct",
"/4s Mana Regen": "mr",
"% Spell Damage": "sdPct",
"% Main Attack Damage": "mdPct",
"/4s Life Steal": "ls",
"/4s Mana Steal": "ms",
"% XP Bonus": "xpb",
"% Loot Bonus": "lb",
"% Reflection": "ref",
"Strength": "str",
"Dexterity": "dex",
"Intelligence": "int",
"Agility": "agi",
"Defense": "def",
"% Thorns": "thorns",
"% Exploding": "expd",
"% Walk Speed": "spd",
"tier Attack Speed": "atkTier",
"/3s Poison": "poison",
"Health": "hpBonus",
"% Soul Point Regen": "spRegen",
"% Stealing": "eSteal",
"Health Regen": "hprRaw",
"Spell Damage": "sdRaw",
"Main Attack Damage": "mdRaw",
"% Fire Damage": "fDamPct",
"% Water Damage": "wDamPct",
"% Air Damage": "aDamPct",
"% Thunder Damage": "tDamPct",
"% Earth Damage": "eDamPct",
"% Fire Defense": "fDefPct",
"% Water Defense": "wDefPct",
"% Air Defense": "aDefPct",
"% Thunder Defense": "tDefPct",
"% Earth Defense": "eDefPct",
"% 1st Spell Cost": "spPct1",
"1st Spell Cost": "spRaw1",
"% 2nd Spell Cost": "spPct2",
"2nd Spell Cost": "spRaw2",
"% 3rd Spell Cost": "spPct3",
"3rd Spell Cost": "spRaw3",
"% 4th Spell Cost": "spPct4",
"4th Spell Cost": "spRaw4",
"rainbowSpellDamageRaw": "rainbowRaw",
"% Sprint": "sprint",
"% Sprint Regen": "sprintReg",
"Jump Height": "jh",
"lootQuality": "lq",
"gatherXpBonus": "gXp",
"gatherSpeed": "gSpd",
}
with open(set_infile, "r") as setFile:
set_data = setFile.read()
set_items, set_bonus = set_data.split("Set Bonuses:")
items = [x.split("<",1)[0].strip() for x in set_items.split("name Set'>")[1:]]
print(items)
set_increment = set_bonus.split("div class='set-box'>")[1:]
set_bonuses = []
import re
number_regex = re.compile(r"([+-]\d+)(.*)")
for set_bonus in set_increment:
print(len(set_bonuses)+1, "items:")
bonuses = dict()
if "Set Bonus" in set_bonus:
bonus_string = set_bonus.split("Set Bonus:</i></p>")[1]
for bonus in bonus_string.split("</p><p>")[:-1]:
val_bunch, label = bonus.split("</span> ")
if "i class" in label:
_, two, three = label.split(">")
label = two.split("<")[0][2:] + three
value = val_bunch.split(">")[-1]
print(value, label);
value_combine = value+" "+label
result = re.match(number_regex, value_combine)
number = result.group(1)
key = result.group(2).strip()
bonuses[id_reverse_map[key]] = int(number)
set_bonuses.append(bonuses)
import json
with open(set_infile+".json", "w") as outFile:
json.dump({"items": items, "bonuses": set_bonuses}, outFile, indent=2)

4
py_script/parse_sets.py Normal file
View file

@ -0,0 +1,4 @@
with open("sets.txt", "r") as setsFile:
sets_split = (x.split("'", 2)[1][2:] for x in setsFile.read().split("a href=")[1:])
with open("sets_list.txt", "w") as outFile:
outFile.write("\n".join(sets_split))

8
py_script/tmp.py Normal file
View file

@ -0,0 +1,8 @@
#for i in range(0, 360, 5):
# print(f"tp @s ~ ~ ~ {i} 0\n"+
#"""execute at @s run summon armor_stand ^ ^ ^0.8 {Tags:["aura_vector"],Invisible:1b}
#execute as @e[tag=aura_vector,limit=1,sort=nearest] at @s run tp @s ~ ~ ~ facing entity @e[tag=aura_execute,limit=1,sort=nearest]""")
for i in range(2, 21):
print("execute as @s[scores={"+f"auraTimer={i}"+"}] run execute as @e[tag=aura_vector] at @s run tp @s ^ ^ ^"+f"-{'{0:3.1f}'.format(0.8*(i-1))}")

View file

@ -159,13 +159,25 @@ max_id = 0
known_item_names = set() known_item_names = set()
for item in items:
known_item_names.add(item["name"])
old_items_map = dict()
remap_items = []
for item in old_items:
if "remapID" in item:
remap_items.append(item)
elif item["name"] not in known_item_names:
print(f'Unknown old item: {item["name"]}!!!')
old_items_map[item["name"]] = item
for item in items: for item in items:
for key in delete_keys: for key in delete_keys:
if key in item: if key in item:
del item[key] del item[key]
for k in list(item.keys()): for k in list(item.keys()):
if item[k] == 0 and not k in must_mappings: if (item[k] == 0 or item[k] is None) and not k in must_mappings:
del item[k] del item[k]
for k, v in translate_mappings.items(): for k, v in translate_mappings.items():
@ -181,17 +193,19 @@ for item in items:
print(f'New item: {item["name"]} (id: {max_id})') print(f'New item: {item["name"]} (id: {max_id})')
item["id"] = id_map[item["name"]] item["id"] = id_map[item["name"]]
known_item_names.add(item["name"])
item["type"] = item["type"].lower() item["type"] = item["type"].lower()
if item["name"] in item_set_map: if "displayName" in item:
item["set"] = item_set_map[item["name"]] item_name = item["displayName"]
else:
item_name = item["name"]
if item_name in item_set_map:
item["set"] = item_set_map[item_name]
if item["name"] in old_items_map:
old_item = old_items_map[item["name"]]
if "hideSet" in old_item:
item["hideSet"] = old_item["hideSet"]
for item in old_items: items.extend(remap_items)
if "remapID" in item:
items.append(item)
elif item["name"] not in known_item_names:
print(f'Unknown old item: {item["name"]}!!!')
with open("clean.json", "w") as outfile: with open("clean.json", "w") as outfile:
json.dump(data, outfile, indent=2) json.dump(data, outfile, indent=2)

17
py_script/yaml_to_json.py Normal file
View file

@ -0,0 +1,17 @@
"""
README:
Python 3 required.
pyyaml required (pip3 install pyyaml, or pip install pyyaml)
USAGE:
python3 yaml_to_json.py <infile> <outfile>
"""
import sys
import json
import yaml
json.dump(yaml.load(open(sys.argv[1])), open(sys.argv[2], "w"), indent=2)

View file

@ -1,6 +1,7 @@
Version 0: http://localhost:8000/#0_0K30oY09X2SJ2SK2SL2SM2SN0QQ Version 0: http://localhost:8000/#0_0K30oY09X2SJ2SK2SL2SM2SN0QQ
Version 1: http://localhost:8000/#1_0690px0CE0QR0050050K40BR0Qk00001004fI Version 1: http://localhost:8000/#1_0690px0CE0QR0050050K40BR0Qk00001004fI
Version 2: http://localhost:8000/#2_2SG2SH2SI2SJ2SK0K22SM2SN05n000t210t0000000 Version 2: http://localhost:8000/#2_2SG2SH2SI2SJ2SK0K22SM2SN05n000t210t0000000
Version 3: https://localhost:8000/#3_0250px0uX0K50K20OK0OJ00A0Qe1z+m21001M1g0000100nZ6 Version 3: http://localhost:8000/#3_0250px0uX0K50K20OK0OJ00A0Qe1z+m21001M1g0000100nZ6
Version 3: https://localhost:8000/#3_0K60iv0CE0Qt0BK0BK0K40Jc0uG160V050o1L1g00001003C6 Version 3: http://localhost:8000/#3_0K60iv0CE0Qt0BK0BK0K40Jc0uG160V050o1L1g00001003C6
Version 4: https://localhost:8000/#4_-1+W+W+W+W+W+W9g91-1+W+W+W+W+W+W9d91-1+W+W+W+W+W+W9i9--1+W+W+W+W+W+W9a91-1+W+W+W+W+W+W9m91-1+W+W+W+W+W+W9m91-1+W+W+W+W+W+W9c91-1+W+W+W+W+W+W9n91-1+W+W+W+W+W+W9q9100000000001g000010036C Version 4: http://localhost:8000/#4_-1+W+W+W+W+W+W9g91-1+W+W+W+W+W+W9d91-1+W+W+W+W+W+W9i9--1+W+W+W+W+W+W9a91-1+W+W+W+W+W+W9m91-1+W+W+W+W+W+W9m91-1+W+W+W+W+W+W9c91-1+W+W+W+W+W+W9n91-1+W+W+W+W+W+W9q9100000000001g000010036C
Version 5 (CI): http://localhost:8000/index.html#5_0lS0JX0u50tv00nCI-10000MFlipped%20Lapis%20Ring0200540M01010V010m0K20OL0og00-CI-110230401030570A07287-3530F40M0201d0c07287-3530w023zu100202e-Y0i211q-Y1g00000

279389
updated.json

File diff suppressed because it is too large Load diff

View file

@ -248,19 +248,15 @@ function copyTextToClipboard(text) {
}); });
} }
/** Generates a random color using the #(R)(G)(B) format. Not written by wynnbuilder devs. /**
* * Generates a random color using the #(R)(G)(B) format.
*/ */
function randomColor() { function randomColor() {
var letters = '0123456789abcdef'; return '#' + Math.round(Math.random() * 0xFFFFFF).toString(16);
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
} }
/** Generates a random color, but lightning must be relatively high (>0.5). /**
* Generates a random color, but lightning must be relatively high (>0.5).
* *
* @returns a random color in RGB 6-bit form. * @returns a random color in RGB 6-bit form.
*/ */