2022-09-16 12:29:38 +00:00
|
|
|
// commented out filters
|
2021-01-26 09:17:11 +00:00
|
|
|
//"Name": "name",
|
|
|
|
//"Display Name": "displayName",
|
2022-08-19 00:15:17 +00:00
|
|
|
//"Tier": "tier",
|
2021-01-26 09:17:11 +00:00
|
|
|
//"Set": "set",
|
|
|
|
//"Type": "type",
|
2022-09-13 19:11:14 +00:00
|
|
|
//"Drop type": "drop", BROKEN
|
|
|
|
//"Quest requirement": "quest", BROKEN
|
|
|
|
//"Restriction": "restrict", BROKEN
|
2021-01-26 09:17:11 +00:00
|
|
|
//"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",
|
2022-09-16 12:29:38 +00:00
|
|
|
//"Class Requirement": "classReq",
|
|
|
|
// "Fixed IDs": "fixID", BROKEN
|
|
|
|
// "Custom Skin": "skin", BROKEN
|
|
|
|
//"Item Category": "category",
|
|
|
|
|
|
|
|
const translate_mappings = {
|
|
|
|
"Powder Slots": "slots",
|
2021-01-26 09:17:11 +00:00
|
|
|
"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",
|
|
|
|
"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",
|
2023-12-30 03:29:06 +00:00
|
|
|
"Spell Damage Raw": "sdRaw",
|
|
|
|
"Elem. Spell Damage Raw": "rSdRaw",
|
|
|
|
"Neut. Spell Damage Raw": "nSdRaw",
|
|
|
|
"Earth Spell Damage Raw": "eSdRaw",
|
|
|
|
"Thunder Spell Damage Raw": "tSdRaw",
|
|
|
|
"Water Spell Damage Raw": "wSdRaw",
|
|
|
|
"Fire Spell Damage Raw": "fSdRaw",
|
|
|
|
"Air Spell Damage Raw": "aSdRaw",
|
|
|
|
"Spell Damage %": "sdPct",
|
|
|
|
"Elem. Spell Damage %": "rSdPct",
|
|
|
|
"Neut. Spell Damage %": "nSdPct",
|
|
|
|
"Earth Spell Damage %": "eSdPct",
|
|
|
|
"Thunder Spell Damage %": "tSdPct",
|
|
|
|
"Water Spell Damage %": "wSdPct",
|
|
|
|
"Fire Spell Damage %": "fSdPct",
|
|
|
|
"Air Spell Damage %": "aSdPct",
|
|
|
|
"Melee Damage Raw": "mdRaw",
|
|
|
|
"Elem. Melee Damage Raw": "rMdRaw",
|
|
|
|
"Neut. Melee Damage Raw": "nMdRaw",
|
|
|
|
"Earth Melee Damage Raw": "eMdRaw",
|
|
|
|
"Thunder Melee Damage Raw": "tMdRaw",
|
|
|
|
"Water Melee Damage Raw": "wMdRaw",
|
|
|
|
"Fire Melee Damage Raw": "fMdRaw",
|
|
|
|
"Air Melee Damage Raw": "aMdRaw",
|
|
|
|
"Melee Damage %": "mdPct",
|
|
|
|
"Elem. Melee Damage %": "rMdPct",
|
|
|
|
"Neut. Melee Damage %": "nMdPct",
|
|
|
|
"Earth Melee Damage %": "eMdPct",
|
|
|
|
"Thunder Melee Damage %": "tMdPct",
|
|
|
|
"Water Melee Damage %": "wMdPct",
|
|
|
|
"Fire Melee Damage %": "fMdPct",
|
|
|
|
"Air Melee Damage %": "aMdPct",
|
|
|
|
"Damage Raw": "damRaw",
|
|
|
|
"Elemental Damage Raw": "rDamRaw",
|
|
|
|
"Neutral Damage Raw": "nDamRaw",
|
|
|
|
"Earth Damage Raw": "eDamRaw",
|
|
|
|
"Thunder Damage Raw": "tDamRaw",
|
|
|
|
"Water Damage Raw": "wDamRaw",
|
|
|
|
"Fire Damage Raw": "fDamRaw",
|
|
|
|
"Air Damage Raw": "aDamRaw",
|
|
|
|
"Damage %": "damPct",
|
|
|
|
"Elemental Damage %": "rDamPct",
|
|
|
|
"Neutral Damage %": "nDamPct",
|
|
|
|
"Earth Damage %": "eDamPct",
|
|
|
|
"Thunder Damage %": "tDamPct",
|
|
|
|
"Water Damage %": "wDamPct",
|
|
|
|
"Fire Damage %": "fDamPct",
|
|
|
|
"Air Damage %": "aDamPct",
|
2023-07-15 01:34:30 +00:00
|
|
|
|
2021-01-26 09:17:11 +00:00
|
|
|
"% Fire Defense": "fDefPct",
|
|
|
|
"% Water Defense": "wDefPct",
|
|
|
|
"% Air Defense": "aDefPct",
|
|
|
|
"% Thunder Defense": "tDefPct",
|
|
|
|
"% Earth Defense": "eDefPct",
|
2023-07-15 01:34:30 +00:00
|
|
|
"% Elemental Defense": "rDefPct",
|
|
|
|
|
2022-01-18 03:31:29 +00:00
|
|
|
"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",
|
2021-01-26 09:17:11 +00:00
|
|
|
"Sprint": "sprint",
|
|
|
|
"Sprint Regen": "sprintReg",
|
|
|
|
"Jump Height": "jh",
|
|
|
|
"Loot Quality": "lq",
|
|
|
|
"Gather XP Bonus": "gXp",
|
2023-07-15 01:34:30 +00:00
|
|
|
"Gather Speed Bonus": "gSpd",
|
|
|
|
"Healing Efficiency": "healPct",
|
|
|
|
"Knockback": "kb",
|
|
|
|
"Weaken Enemy": "weakenEnemy",
|
|
|
|
"Slow Enemy": "slowEnemy"
|
2021-01-26 09:17:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const special_mappings = {
|
2022-08-19 00:15:17 +00:00
|
|
|
"Sum (skill points)": "str+dex+int+def+agi",
|
|
|
|
"Sum (Mana Sustain)": "mr+ms",
|
|
|
|
"Sum (Life Sustain)": "hpr+ls",
|
2022-11-27 21:11:07 +00:00
|
|
|
"Sum (Health + Health Bonus)": "hp+hpBonus",
|
|
|
|
"Base DPS": "(nDam+fDam+wDam+aDam+tDam+eDam) * atkspdmod(atkspd)"
|
2021-01-26 09:17:11 +00:00
|
|
|
};
|
|
|
|
|
2022-08-03 07:28:54 +00:00
|
|
|
for (let x in translate_mappings) {
|
|
|
|
item_filters.push(x);
|
|
|
|
}
|
|
|
|
for (let x in special_mappings) {
|
|
|
|
item_filters.push(x);
|
2021-01-26 09:17:11 +00:00
|
|
|
}
|
|
|
|
|
2023-01-31 02:55:25 +00:00
|
|
|
types = {bow: false, spear: false, wand: false, dagger: false, relik: false, helmet: false, chestplate: false, leggings: false, boots: false, ring: false, bracelet: false, necklace: false};
|
|
|
|
search_tiers = {normal: true, unique: true, set: true, rare: true, legendary: true, fabled: true, mythic: true};
|
2021-01-26 09:17:11 +00:00
|
|
|
|
2023-01-31 02:55:25 +00:00
|
|
|
function display(items_copy) {
|
2022-08-03 07:28:54 +00:00
|
|
|
let items_parent = document.getElementById("search-results");
|
|
|
|
for (let i in items_copy) {
|
|
|
|
if (i > 200) {break;}
|
|
|
|
let item = items_copy[i].itemExp;
|
2023-01-31 02:55:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-03 08:00:39 +00:00
|
|
|
let box = make_elem('div', ['col-lg-3', 'col-sm-6', 'p-2'], {id: 'item'+i});
|
2022-08-03 07:28:54 +00:00
|
|
|
|
2022-08-03 08:00:39 +00:00
|
|
|
let bckgrdbox = make_elem("div", ["dark-7", "rounded", "px-2", "col-auto"], {id: 'item'+i+'b'});
|
|
|
|
box.append(bckgrdbox);
|
2021-01-24 03:58:53 +00:00
|
|
|
items_parent.appendChild(box);
|
2022-08-03 07:28:54 +00:00
|
|
|
item.set("powders", []);
|
|
|
|
if (item.get("category") == "weapon") {
|
|
|
|
apply_weapon_powders(item);
|
|
|
|
}
|
|
|
|
displayExpandedItem(item, bckgrdbox.id, true);
|
2021-01-24 03:58:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-31 02:55:25 +00:00
|
|
|
function filter_types_tiers(queries) {
|
2022-08-13 18:48:16 +00:00
|
|
|
// types
|
2022-09-13 18:26:46 +00:00
|
|
|
let allTypes = true, noTypes = true;
|
2022-08-13 18:48:16 +00:00
|
|
|
let typeQuery = "f:("
|
|
|
|
for (const type of Object.keys(types)) {
|
|
|
|
if (types[type]) {
|
|
|
|
typeQuery += "type=\"" + type + "\"|";
|
2022-09-13 18:26:46 +00:00
|
|
|
noTypes = false;
|
2022-08-13 18:48:16 +00:00
|
|
|
} else {
|
|
|
|
allTypes = false;
|
2021-01-26 09:17:11 +00:00
|
|
|
}
|
|
|
|
}
|
2022-09-13 18:26:46 +00:00
|
|
|
if (noTypes) {
|
2022-09-13 19:11:14 +00:00
|
|
|
document.getElementById("summary").innerHTML = "Error: Cannot search without at least 1 type selected";
|
2023-01-31 02:55:25 +00:00
|
|
|
return false;
|
2022-09-13 18:26:46 +00:00
|
|
|
} else if (!allTypes) {
|
2022-08-13 18:48:16 +00:00
|
|
|
queries.push(typeQuery.substring(0, typeQuery.length - 1) + ")");
|
|
|
|
}
|
2021-01-26 09:17:11 +00:00
|
|
|
|
2022-08-13 18:48:16 +00:00
|
|
|
// rarities
|
2022-09-13 18:26:46 +00:00
|
|
|
let allRarities = true, noRarities = true;
|
2022-08-13 18:48:16 +00:00
|
|
|
let rarityQuery = "f:("
|
2023-01-31 02:55:25 +00:00
|
|
|
for (const rarity of Object.keys(search_tiers)) {
|
|
|
|
if (search_tiers[rarity]) {
|
2022-08-13 18:48:16 +00:00
|
|
|
rarityQuery += "tiername=\"" + rarity + "\"|";
|
2022-09-13 18:26:46 +00:00
|
|
|
noRarities = false;
|
2022-08-13 18:48:16 +00:00
|
|
|
} else {
|
|
|
|
allRarities = false;
|
2021-01-26 09:17:11 +00:00
|
|
|
}
|
|
|
|
}
|
2022-09-13 18:26:46 +00:00
|
|
|
if (noRarities) {
|
2022-09-13 19:11:14 +00:00
|
|
|
document.getElementById("summary").innerHTML = "Error: Cannot search without at least 1 rarity selected";
|
2023-01-31 02:55:25 +00:00
|
|
|
return false;
|
2022-09-13 18:26:46 +00:00
|
|
|
} else if (!allRarities) {
|
2022-08-13 18:48:16 +00:00
|
|
|
queries.push(rarityQuery.substring(0, rarityQuery.length - 1) + ")");
|
|
|
|
}
|
2022-09-13 19:11:14 +00:00
|
|
|
|
2023-01-31 02:55:25 +00:00
|
|
|
return true;
|
2021-01-24 10:09:59 +00:00
|
|
|
}
|
|
|
|
|
2023-01-31 02:55:25 +00:00
|
|
|
function init_values() {
|
2022-08-03 07:54:40 +00:00
|
|
|
search_db = items.filter( i => ! i.remapID ).map( i => [i, expandItem(i, [])] );
|
2023-01-31 02:55:25 +00:00
|
|
|
expr_parser = new ExprParser(itemQueryProps, queryFuncs);
|
2022-08-03 07:39:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
(async function() {
|
2023-07-15 01:34:30 +00:00
|
|
|
await Promise.resolve(load_init(), load_major_id_data(wynn_version_names[WYNN_VERSION_LATEST]));
|
2023-01-31 02:55:25 +00:00
|
|
|
init_search();
|
2022-08-03 07:28:54 +00:00
|
|
|
})();
|