2024-05-16 17:57:51 +02:00
|
|
|
if (!args.test.context.phantasmal &&
|
|
|
|
(this.actor.isOpposing || args.test.context.defending) &&
|
|
|
|
args.test.result.roll % 11 == 0 &&
|
|
|
|
args.test.succeeded &&
|
2024-05-17 12:46:44 +02:00
|
|
|
["Langue (Magick)", "Esquive"].includes(args.test.item?.name))
|
2024-05-16 17:57:51 +02:00
|
|
|
{
|
|
|
|
args.test.context.phantasmal = true; // Flag so items aren't readded if test is edited
|
2024-05-17 12:46:44 +02:00
|
|
|
let text = `<strong>${this.effect.name}</strong>: Ajout de Instable et Protection`
|
2024-05-16 17:57:51 +02:00
|
|
|
args.test.result.other.push(text)
|
|
|
|
this.script.scriptNotification(text);
|
|
|
|
|
|
|
|
let ward = await fromUuid("Compendium.wfrp4e-core.items.Bvd2aZ0gQUXHfCTh")
|
|
|
|
let wardData = ward.toObject();
|
|
|
|
wardData.system.specification.value = 9;
|
|
|
|
|
|
|
|
let unstable = await fromUuid("Compendium.wfrp4e-core.items.D0ImWEIMSDgElsnl")
|
|
|
|
let unstableData = unstable.toObject();
|
|
|
|
this.actor.createEmbeddedDocuments("Item", [wardData, unstableData], {fromEffect: this.effect.id})
|
|
|
|
}
|