diff --git a/scripts/PeZYj8b0vedyJj00.js b/scripts/PeZYj8b0vedyJj00.js index 915929d35..51a0a4431 100644 --- a/scripts/PeZYj8b0vedyJj00.js +++ b/scripts/PeZYj8b0vedyJj00.js @@ -3,20 +3,11 @@ let mainEffect = this.item.effects.contents[0]; if (mainEffect.name.includes("(Lore)")) { - let choice = await ItemDialog.create(ItemDialog.objectToArray({ - beasts : game.wfrp4e.config.magicLores["beasts"], - death : game.wfrp4e.config.magicLores["death"], - fire : game.wfrp4e.config.magicLores["fire"], - heavens : game.wfrp4e.config.magicLores["heavens"], - metal : game.wfrp4e.config.magicLores["metal"], - life : game.wfrp4e.config.magicLores["life"], - light : game.wfrp4e.config.magicLores["light"], - shadow : game.wfrp4e.config.magicLores["shadow"] - }, this.item.img), 1, "Choose Lore"); + let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, "Choose Lore"); if (choice.length) { - mainEffect.updateSource({name : mainEffect.name.replace("Lore", choice[0].name)}) - this.item.updateSource({name : this.item.name += ` (${choice[0].name})`}) + mainEffect.update({name : mainEffect.name.replace("Lore", choice[0].name)}) + this.item.update({name : this.item.name += ` (${choice[0].name})`}) } } diff --git a/scripts/UsuwsmU1TUQLQVM2.js b/scripts/UsuwsmU1TUQLQVM2.js index 43e0ad09d..47d19c6f9 100644 --- a/scripts/UsuwsmU1TUQLQVM2.js +++ b/scripts/UsuwsmU1TUQLQVM2.js @@ -1 +1,2 @@ -return !args.spell \ No newline at end of file +let lore = this.effect.name.split("(")[1].split(")")[0].toLowerCase(); +return !args.spell || (args.type == "cast" && ["petty", lore].includes(args.spell.system.lore.value)); \ No newline at end of file diff --git a/scripts/sB4KB9bT3nQhAoqG.js b/scripts/sB4KB9bT3nQhAoqG.js index a39c08082..4401b71a3 100644 --- a/scripts/sB4KB9bT3nQhAoqG.js +++ b/scripts/sB4KB9bT3nQhAoqG.js @@ -3,20 +3,11 @@ let mainEffect = this.item.effects.contents[0]; if (mainEffect.name.includes("")) { - let choice = await ItemDialog.create(ItemDialog.objectToArray({ - beasts : game.wfrp4e.config.magicLores["beasts"], - death : game.wfrp4e.config.magicLores["death"], - fire : game.wfrp4e.config.magicLores["fire"], - heavens : game.wfrp4e.config.magicLores["heavens"], - metal : game.wfrp4e.config.magicLores["metal"], - life : game.wfrp4e.config.magicLores["life"], - light : game.wfrp4e.config.magicLores["light"], - shadow : game.wfrp4e.config.magicLores["shadow"] - }, this.item.img), 1, "Choose Lore"); + let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, "Choose Lore"); if (choice.length) { - mainEffect.updateSource({name : mainEffect.name.replace("", choice[0].name)}) - this.item.updateSource({name : this.item.name += ` (${choice[0].name})`}) + mainEffect.update({name : mainEffect.name.replace("", choice[0].name)}) + this.item.update({name : this.item.name += ` (${choice[0].name})`}) } }