From 85a55b6b3e185e8d6d22642aba64738300036fec Mon Sep 17 00:00:00 2001 From: Shaun Date: Sat, 17 Feb 2024 09:02:12 +0200 Subject: [PATCH] bug: Added autofixes for tridents and bites --- src/server/fixes/fixes.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/server/fixes/fixes.js b/src/server/fixes/fixes.js index 1b2357be..171eaab1 100644 --- a/src/server/fixes/fixes.js +++ b/src/server/fixes/fixes.js @@ -1,5 +1,8 @@ /* eslint-disable max-lines-per-function */ +const itemTypes = require('../items/config/types'); +const spellGenerator = require('../items/generators/spellbook'); + module.exports = { fixDb: async function () { await io.deleteAsync({ @@ -179,6 +182,36 @@ module.exports = { effect.rolls.castSpell.type = 'smokeBomb'; }); + items + .filter(i => i.name === 'Princess Morgawsa\'s Trident' && i.type !== 'Trident') + .forEach(i => { + i.type = 'Trident'; + i.requires[0].stat = 'int'; + + delete i.implicitStats; + + const typeConfig = itemTypes.types[i.slot][i.type]; + spellGenerator.generate(i, { + ...typeConfig, + spellQuality: i.spell.quality + }); + }); + + items + .filter(i => i.name === 'Steelclaw\'s Bite' && i.type !== 'Curved Dagger') + .forEach(i => { + i.type = 'Curved Dagger'; + i.requires[0].stat = 'dex'; + + delete i.implicitStats; + + const typeConfig = itemTypes.types[i.slot][i.type]; + spellGenerator.generate(i, { + ...typeConfig, + spellQuality: i.spell.quality + }); + }); + items .filter(f => f.effects?.[0]?.factionId === 'akarei' && !f.effects[0].properties) .forEach(function (i) {