wynnbuilder-idk/js/items.js

223 lines
7 KiB
JavaScript
Raw Normal View History

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",
//"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",
parent 3e725eded882cb6d353ca9b37931cb959dcdf9dc author hppeng <hppeng> 1699417872 -0800 committer hppeng <hppeng> 1720354753 -0700 parent 3e725eded882cb6d353ca9b37931cb959dcdf9dc author hppeng <hppeng> 1699417872 -0800 committer hppeng <hppeng> 1720354749 -0700 parent 3e725eded882cb6d353ca9b37931cb959dcdf9dc author hppeng <hppeng> 1699417872 -0800 committer hppeng <hppeng> 1720354744 -0700 parent 3e725eded882cb6d353ca9b37931cb959dcdf9dc author hppeng <hppeng> 1699417872 -0800 committer hppeng <hppeng> 1720354739 -0700 parent 3e725eded882cb6d353ca9b37931cb959dcdf9dc author hppeng <hppeng> 1699417872 -0800 committer hppeng <hppeng> 1720354735 -0700 parent 3e725eded882cb6d353ca9b37931cb959dcdf9dc author hppeng <hppeng> 1699417872 -0800 committer hppeng <hppeng> 1720354730 -0700 parent 3e725eded882cb6d353ca9b37931cb959dcdf9dc author hppeng <hppeng> 1699417872 -0800 committer hppeng <hppeng> 1720354688 -0700 Update recipes.json (#265) Change ratio of gems to oil as it has been updated in 2.0.4 > Updated the Jeweling Recipe Changes (Bracelet- 2:1 gems:oil, Necklaces- 3:1 gems:oil) https://forums.wynncraft.com/threads/2-0-4-full-changelog-new-bank-lootruns-more.310535/ Finish updating recipes.json why are there 4 versions of this file active at any given time Fix damage calculation for rainbow raw wow this bug has been here for a LONG time also bump version for ing db Bunch of bugfixes - new major ID - divine honor: reduce earth damage - radiance: don't boost tomes, xp/loot bonuses atree: - parry: minor typo - death magnet: marked dep - nightcloak knife: 15s desc Api v3 (#267) * Tweak ordering to be consistent internally * v3 items (#266) * item_wrapper script for updating item data with v3 endpoint * metadata from v3 * v3 item format For the purpose of wynnbuilder, additional mapping might be needed. * v3 item format additional mapping might be needed for wb * v3 compressed item json * clean item json v3 format * Update translate map to api v3 partially... we will need to redo scripts to flatmap all the items * Fix items for 2.0.4.3 finally * New ingredients (and parse script update) just realized I forgot to commit the parse script this whole time * Forgot to commit data files, and bump ing db version * Sketchily reverse translate major ids internalname and separate lookup table lol * Forgot to update data files todo: script should update all files at once * Bump wynn version number already outdated... * Forgot to update 2.0.4.3 major ids --------- Co-authored-by: hppeng <hppeng> Co-authored-by: RawFish69 <108964215+RawFish69@users.noreply.github.com> Add missing fields to ingreds missing ids and consumableIDs tags in some ingreds Fix missing properties in item search setup these should be unified maybe to avoid duplicated code Fix sacshrine dependency on fluid healing also: fix ": " in item searcher I managed to mess up all major ids note: major ids min file is generated along with atree. it uses numeric ids, not just json compress 2.0.4.4 update (#269) * 2.0.4.4 update Fix v3 item api debug script Implement hellfire (discombob disallow not happening yet) * Fix boiling blood implementation slightly more intuitive also, janky first pass implementation for hellfire * Atree default update Allow sliders to specify a default value, for puppet and boiling blood for now * Fix rainbow def display on items and build stats Calculate into raw def correctly * Atree backend improvements Allow major ids to have dependencies Implement cherry bomb new ver. (wooo replace_spell just works out of the box!) Add comments to atree.js * Fix name of normal items don't you love it when wynn api makes breaking changes for no reason * Misc bugfix Reckless abandon req Tempest new damage ID in search * Fix major id search and temblor desc * Fix blockers on mage * Fix flaming uppercut implementation * Force base dps display to display less digits * Tomes finally pulling from the API but still with alias feature enabled! * Lootrun tomes (finally?) cool? maybe? * Fix beachside set set bonus --------- Co-authored-by: hppeng <hppeng> Fix rainbow def display on items and build stats Calculate into raw def correctly Fix major id search and temblor desc Force base dps display to display less digits Fix beachside set set bonus Fix build decode error reading only 7 tome fields no matter what Give NONE tomes correct ids in load_tome i hate this system so much Allow searching for max/min of ranges Fix crafted item damage display in the process, also update powder calculation logic! Should be fully correct now... TL;DR: Weapon damage is floating point; item display is wrong; ingame displays (damage floaters and compass) are floored. Fluid healing now multiplicative with heal efficiency ID NOTE: this breaks backwards compatibility with older atree jsons. Do we care about this? Realizing how much of a nightmare it will be (and already is) to keep atree fully backwards compatible. Maybe that will be something left to `git clone` instead. fix (#274)
2023-11-08 04:31:12 +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",
2.0.3 update (#260) * Mage atree changes * Bump version to 2.0.3.1 just tree for now * Warrior tree :pray: * Shaman tree WIP some things are too jank to stay * Fixes to bamboozle behavior also echo was -60% instead of -65% in the file??? wtf * Shurikens damage boost by echo meme * Fix description text in echo, update old version atree file * Fix shaman tree thanks spegg! * Spegg atree changes assassin tree fixed many of my shaman mistakes and other changes we missed over the months somehow? * Updated archer ability tree Thanks @mr_me! All credit to them. * Fixes to spegg's fixes implement beast lore * Change how Chant of the Lunatic is calculated coursing restraints ingame is 15% damage bonus * Updated ingredients manually thanks @watermelon (snownlite)! * Forgor to bump ing db version * Fix ingredient display jank * 2.0.3 items (#259) * API update also add new IDs to a bunch of places... tech debt whyyy * Forgot to update ingreds... * Change heal power ID name to stack with tree abils, fix multi totem effect on totemic shatter and req for mana traps * Forgot to bump item db version * Implement major IDs not implemented: Gentle Glow, and Forest's Blessing damage increase (since I don't know the exact numbers) and radiance boost is not implemented (radiance is currently handled way too jank) might wait for buffs rework to handle radiance. * patch item searcher TODO: make this not disgusting... build_encode_decode file has gotten too big --------- Co-authored-by: hppeng <hppeng> Co-authored-by: RawFish69 <108964215+RawFish69@users.noreply.github.com>
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",
2.0.3 update (#260) * Mage atree changes * Bump version to 2.0.3.1 just tree for now * Warrior tree :pray: * Shaman tree WIP some things are too jank to stay * Fixes to bamboozle behavior also echo was -60% instead of -65% in the file??? wtf * Shurikens damage boost by echo meme * Fix description text in echo, update old version atree file * Fix shaman tree thanks spegg! * Spegg atree changes assassin tree fixed many of my shaman mistakes and other changes we missed over the months somehow? * Updated archer ability tree Thanks @mr_me! All credit to them. * Fixes to spegg's fixes implement beast lore * Change how Chant of the Lunatic is calculated coursing restraints ingame is 15% damage bonus * Updated ingredients manually thanks @watermelon (snownlite)! * Forgor to bump ing db version * Fix ingredient display jank * 2.0.3 items (#259) * API update also add new IDs to a bunch of places... tech debt whyyy * Forgot to update ingreds... * Change heal power ID name to stack with tree abils, fix multi totem effect on totemic shatter and req for mana traps * Forgot to bump item db version * Implement major IDs not implemented: Gentle Glow, and Forest's Blessing damage increase (since I don't know the exact numbers) and radiance boost is not implemented (radiance is currently handled way too jank) might wait for buffs rework to handle radiance. * patch item searcher TODO: make this not disgusting... build_encode_decode file has gotten too big --------- Co-authored-by: hppeng <hppeng> Co-authored-by: RawFish69 <108964215+RawFish69@users.noreply.github.com>
2023-07-15 01:34:30 +00:00
"% Elemental Defense": "rDefPct",
"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",
2.0.3 update (#260) * Mage atree changes * Bump version to 2.0.3.1 just tree for now * Warrior tree :pray: * Shaman tree WIP some things are too jank to stay * Fixes to bamboozle behavior also echo was -60% instead of -65% in the file??? wtf * Shurikens damage boost by echo meme * Fix description text in echo, update old version atree file * Fix shaman tree thanks spegg! * Spegg atree changes assassin tree fixed many of my shaman mistakes and other changes we missed over the months somehow? * Updated archer ability tree Thanks @mr_me! All credit to them. * Fixes to spegg's fixes implement beast lore * Change how Chant of the Lunatic is calculated coursing restraints ingame is 15% damage bonus * Updated ingredients manually thanks @watermelon (snownlite)! * Forgor to bump ing db version * Fix ingredient display jank * 2.0.3 items (#259) * API update also add new IDs to a bunch of places... tech debt whyyy * Forgot to update ingreds... * Change heal power ID name to stack with tree abils, fix multi totem effect on totemic shatter and req for mana traps * Forgot to bump item db version * Implement major IDs not implemented: Gentle Glow, and Forest's Blessing damage increase (since I don't know the exact numbers) and radiance boost is not implemented (radiance is currently handled way too jank) might wait for buffs rework to handle radiance. * patch item searcher TODO: make this not disgusting... build_encode_decode file has gotten too big --------- Co-authored-by: hppeng <hppeng> Co-authored-by: RawFish69 <108964215+RawFish69@users.noreply.github.com>
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
};
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
}
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
function display(items_copy) {
let items_parent = document.getElementById("search-results");
for (let i in items_copy) {
if (i > 200) {break;}
let item = items_copy[i].itemExp;
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 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);
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
}
}
function filter_types_tiers(queries) {
// types
let allTypes = true, noTypes = true;
let typeQuery = "f:("
for (const type of Object.keys(types)) {
if (types[type]) {
typeQuery += "type=\"" + type + "\"|";
noTypes = false;
} else {
allTypes = false;
2021-01-26 09:17:11 +00:00
}
}
if (noTypes) {
document.getElementById("summary").innerHTML = "Error: Cannot search without at least 1 type selected";
return false;
} else if (!allTypes) {
queries.push(typeQuery.substring(0, typeQuery.length - 1) + ")");
}
2021-01-26 09:17:11 +00:00
// rarities
let allRarities = true, noRarities = true;
let rarityQuery = "f:("
for (const rarity of Object.keys(search_tiers)) {
if (search_tiers[rarity]) {
rarityQuery += "tiername=\"" + rarity + "\"|";
noRarities = false;
} else {
allRarities = false;
2021-01-26 09:17:11 +00:00
}
}
if (noRarities) {
document.getElementById("summary").innerHTML = "Error: Cannot search without at least 1 rarity selected";
return false;
} else if (!allRarities) {
queries.push(rarityQuery.substring(0, rarityQuery.length - 1) + ")");
}
return true;
2021-01-24 10:09:59 +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, [])] );
expr_parser = new ExprParser(itemQueryProps, queryFuncs);
}
(async function() {
2.0.3 update (#260) * Mage atree changes * Bump version to 2.0.3.1 just tree for now * Warrior tree :pray: * Shaman tree WIP some things are too jank to stay * Fixes to bamboozle behavior also echo was -60% instead of -65% in the file??? wtf * Shurikens damage boost by echo meme * Fix description text in echo, update old version atree file * Fix shaman tree thanks spegg! * Spegg atree changes assassin tree fixed many of my shaman mistakes and other changes we missed over the months somehow? * Updated archer ability tree Thanks @mr_me! All credit to them. * Fixes to spegg's fixes implement beast lore * Change how Chant of the Lunatic is calculated coursing restraints ingame is 15% damage bonus * Updated ingredients manually thanks @watermelon (snownlite)! * Forgor to bump ing db version * Fix ingredient display jank * 2.0.3 items (#259) * API update also add new IDs to a bunch of places... tech debt whyyy * Forgot to update ingreds... * Change heal power ID name to stack with tree abils, fix multi totem effect on totemic shatter and req for mana traps * Forgot to bump item db version * Implement major IDs not implemented: Gentle Glow, and Forest's Blessing damage increase (since I don't know the exact numbers) and radiance boost is not implemented (radiance is currently handled way too jank) might wait for buffs rework to handle radiance. * patch item searcher TODO: make this not disgusting... build_encode_decode file has gotten too big --------- Co-authored-by: hppeng <hppeng> Co-authored-by: RawFish69 <108964215+RawFish69@users.noreply.github.com>
2023-07-15 01:34:30 +00:00
await Promise.resolve(load_init(), load_major_id_data(wynn_version_names[WYNN_VERSION_LATEST]));
init_search();
})();