2024-05-16 17:57:51 +02:00
|
|
|
// 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];
|
2024-06-08 00:27:35 +02:00
|
|
|
if (mainEffect.name.includes("(Lore)"))
|
2024-05-16 17:57:51 +02:00
|
|
|
{
|
2024-05-17 12:46:44 +02:00
|
|
|
let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, "Choisissez le Savoir");
|
2024-05-16 17:57:51 +02:00
|
|
|
if (choice.length)
|
|
|
|
{
|
2024-06-08 00:27:35 +02:00
|
|
|
mainEffect.update({name : mainEffect.name.replace("Lore", choice[0].name)})
|
2024-05-16 17:57:51 +02:00
|
|
|
this.item.update({name : this.item.name += ` (${choice[0].name})`})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-08 00:27:35 +02:00
|
|
|
this.effect.delete();
|