Fix WoM effects for robes and enchanted staff

This commit is contained in:
2024-06-08 00:27:35 +02:00
parent 4ebaad012b
commit b7bb897a46
8 changed files with 22 additions and 18 deletions

View File

@ -1,14 +1,14 @@
// This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor
let mainEffect = this.item.effects.contents[0];
if (mainEffect.name.includes("(Savoir)"))
if (mainEffect.name.includes("(Lore)"))
{
let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, "Choisissez le Savoir");
if (choice.length)
{
mainEffect.update({name : mainEffect.name.replace("Savoir", choice[0].name)})
mainEffect.update({name : mainEffect.name.replace("Lore", choice[0].name)})
this.item.update({name : this.item.name += ` (${choice[0].name})`})
}
}
this.effect.delete();
this.effect.delete();