2021-01-23 16:38:13 +00:00
|
|
|
|
2021-01-26 09:17:11 +00:00
|
|
|
const translate_mappings = {
|
|
|
|
//"Name": "name",
|
|
|
|
//"Display Name": "displayName",
|
|
|
|
//"tier"Tier": ",
|
|
|
|
//"Set": "set",
|
|
|
|
"Powder Slots": "slots",
|
|
|
|
//"Type": "type",
|
|
|
|
//"armorType", (deleted)
|
|
|
|
//"color", (deleted)
|
|
|
|
//"lore", (deleted)
|
|
|
|
//"material", (deleted)
|
|
|
|
"Drop type": "drop",
|
|
|
|
"Quest requirement": "quest",
|
|
|
|
"Restriction": "restrict",
|
|
|
|
//"Base Neutral Damage": "nDam",
|
|
|
|
//"Base Fire Damage": "fDam",
|
|
|
|
//"Base Water Damage": "wDam",
|
|
|
|
//"Base Air Damage": "aDam",
|
|
|
|
//"Base Thunder Damage": "tDam",
|
|
|
|
//"Base Earth Damage": "eDam",
|
|
|
|
//"Base Attack Speed": "atkSpd",
|
|
|
|
"Health": "hp",
|
|
|
|
"Raw Fire Defense": "fDef",
|
|
|
|
"Raw Water Defense": "wDef",
|
|
|
|
"Raw Air Defense": "aDef",
|
|
|
|
"Raw Thunder Defense": "tDef",
|
|
|
|
"Raw Earth Defense": "eDef",
|
|
|
|
"Combat Level": "lvl",
|
|
|
|
//"Class Requirement": "classReq",
|
|
|
|
"Req Strength": "strReq",
|
|
|
|
"Req Dexterity": "dexReq",
|
|
|
|
"Req Intelligence": "intReq",
|
|
|
|
"Req Agility": "agiReq",
|
|
|
|
"Req Defense": "defReq",
|
|
|
|
"% Health Regen": "hprPct",
|
|
|
|
"Mana Regen": "mr",
|
|
|
|
"% Spell Damage": "sdPct",
|
|
|
|
"% Melee Damage": "mdPct",
|
|
|
|
"Life Steal": "ls",
|
|
|
|
"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",
|
|
|
|
"Attack Speed Bonus": "atkTier",
|
|
|
|
"Poison": "poison",
|
|
|
|
"Health Bonus": "hpBonus",
|
|
|
|
"Soul Point Regen": "spRegen",
|
|
|
|
"Stealing": "eSteal",
|
|
|
|
"Raw Health Regen": "hprRaw",
|
|
|
|
"Raw Spell": "sdRaw",
|
|
|
|
"Raw Melee": "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",
|
|
|
|
"Fixed IDs": "fixID",
|
|
|
|
"Custom Skin": "skin",
|
|
|
|
//"Item Category": "category",
|
|
|
|
|
|
|
|
"1st Spell Cost %": "spPct1",
|
|
|
|
"1st Spell Cost Raw": "spRaw1",
|
|
|
|
"2nd Spell Cost %": "spPct2",
|
|
|
|
"2nd Spell Cost Raw": "spRaw2",
|
|
|
|
"3rd Spell Cost %": "spPct3",
|
|
|
|
"3rd Spell Cost Raw": "spRaw3",
|
|
|
|
"4th Spell Cost %": "spPct4",
|
|
|
|
"4th Spell Cost Raw": "spRaw4",
|
|
|
|
|
|
|
|
"Rainbow Spell Damage": "rainbowRaw",
|
|
|
|
"Sprint": "sprint",
|
|
|
|
"Sprint Regen": "sprintReg",
|
|
|
|
"Jump Height": "jh",
|
|
|
|
"Loot Quality": "lq",
|
|
|
|
|
|
|
|
"Gather XP Bonus": "gXp",
|
|
|
|
"Gather Speed Bonus": "gSpd",
|
|
|
|
};
|
|
|
|
|
|
|
|
const special_mappings = {
|
|
|
|
"Sum (skill points)": new SumQuery(["str", "dex", "int", "def", "agi"]),
|
|
|
|
"Sum (Mana Sustain)": new SumQuery(["mr", "ms"]),
|
|
|
|
"Sum (Life Sustain)": new SumQuery(["hpr", "ls"]),
|
|
|
|
"Sum (Health + Health Bonus)": new SumQuery(["hp", "hpBonus"]),
|
2021-01-29 02:48:26 +00:00
|
|
|
"No Strength Req": new NegateQuery("strReq"),
|
|
|
|
"No Dexterity Req": new NegateQuery("dexReq"),
|
|
|
|
"No Intelligence Req": new NegateQuery("intReq"),
|
|
|
|
"No Agility Req": new NegateQuery("agiReq"),
|
|
|
|
"No Defense Req": new NegateQuery("defReq"),
|
2021-01-26 09:17:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
let itemFilters = document.getElementById("filter-items");
|
|
|
|
for (let x in translate_mappings) {
|
|
|
|
let el = document.createElement("option");
|
|
|
|
el.value = x;
|
|
|
|
itemFilters.appendChild(el);
|
|
|
|
}
|
|
|
|
for (let x in special_mappings) {
|
|
|
|
let el = document.createElement("option");
|
|
|
|
el.value = x;
|
|
|
|
itemFilters.appendChild(el);
|
|
|
|
}
|
|
|
|
|
|
|
|
let itemTypes = [ "helmet", "chestplate", "leggings", "boots", "ring", "bracelet", "necklace", "wand", "spear", "bow", "dagger", "relik" ];
|
|
|
|
let itemCategories = [ "armor", "accessory", "weapon" ];
|
|
|
|
|
2021-01-24 03:58:53 +00:00
|
|
|
function applyQuery(items, query) {
|
|
|
|
return items.filter(query.filter, query).sort(query.compare);
|
|
|
|
}
|
|
|
|
|
|
|
|
function displayItems(items_copy) {
|
|
|
|
let items_parent = document.getElementById("main");
|
|
|
|
for (let i in items_copy) {
|
|
|
|
let item = items_copy[i];
|
|
|
|
let box = document.createElement("div");
|
|
|
|
box.classList.add("box");
|
|
|
|
box.id = "item"+i;
|
|
|
|
items_parent.appendChild(box);
|
|
|
|
displayExpandedItem(expandItem(item, []), box.id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-24 10:09:59 +00:00
|
|
|
function doItemSearch() {
|
|
|
|
window.scrollTo(0, 0);
|
2021-01-26 09:17:11 +00:00
|
|
|
let queries = [];
|
|
|
|
queries.push(new NameQuery(document.getElementById("name-choice").value));
|
|
|
|
|
|
|
|
let categoryOrType = document.getElementById("category-choice").value;
|
|
|
|
if (itemTypes.includes(categoryOrType)) {
|
|
|
|
queries.push(new IdMatchQuery("type", categoryOrType));
|
|
|
|
}
|
|
|
|
else if (itemCategories.includes(categoryOrType)) {
|
|
|
|
queries.push(new IdMatchQuery("category", categoryOrType));
|
|
|
|
}
|
|
|
|
|
|
|
|
let rarity = document.getElementById("rarity-choice").value;
|
|
|
|
if (rarity) {
|
|
|
|
if (rarity === "ANY") {
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
queries.push(new IdMatchQuery("tier", rarity));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let level_dat = document.getElementById("level-choice").value.split("-");
|
|
|
|
queries.push(new LevelRangeQuery(parseInt(level_dat[0]), parseInt(level_dat[1])));
|
|
|
|
|
|
|
|
for (let i = 1; i <= 4; ++i) {
|
|
|
|
let raw_dat = document.getElementById("filter"+i+"-choice").value;
|
|
|
|
let filter_dat = translate_mappings[raw_dat];
|
|
|
|
if (filter_dat !== undefined) {
|
|
|
|
queries.push(new IdQuery(filter_dat));
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
filter_dat = special_mappings[raw_dat];
|
|
|
|
if (filter_dat !== undefined) {
|
|
|
|
queries.push(filter_dat);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-24 10:09:59 +00:00
|
|
|
let items_copy = items.slice();
|
|
|
|
document.getElementById("main").textContent = "";
|
2021-01-26 09:17:11 +00:00
|
|
|
for (const query of queries) {
|
2021-01-24 10:09:59 +00:00
|
|
|
items_copy = applyQuery(items_copy, query);
|
|
|
|
}
|
|
|
|
document.getElementById("summary").textContent = items_copy.length + " results."
|
|
|
|
displayItems(items_copy);
|
|
|
|
}
|
|
|
|
|
2021-01-23 16:38:13 +00:00
|
|
|
function init() {
|
2021-01-24 10:09:59 +00:00
|
|
|
return;
|
2021-01-23 16:38:13 +00:00
|
|
|
let items_copy = items.slice();
|
2021-01-24 03:58:53 +00:00
|
|
|
//let query = new NameQuery("Bob's");
|
2021-01-24 10:09:59 +00:00
|
|
|
let query1 = new IdQuery("sdRaw");
|
2021-01-24 03:58:53 +00:00
|
|
|
items_copy = applyQuery(items_copy, query1);
|
|
|
|
|
2021-01-24 10:09:59 +00:00
|
|
|
let query2 = new TypeQuery("helmet");
|
2021-01-24 03:58:53 +00:00
|
|
|
items_copy = applyQuery(items_copy, query2);
|
|
|
|
|
|
|
|
displayItems(items_copy);
|
2021-01-23 16:38:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_init(init);
|