34 lines
927 B
JavaScript
34 lines
927 B
JavaScript
const vomit = this.actor.itemTags.trait.find(t => t.name === "Vomissement");
|
|
const name = "Bileful rollTest";
|
|
|
|
if (!vomit) return;
|
|
|
|
const effect = vomit.effects.find(e => e.name === "Vomissement");
|
|
const scriptData = effect.system.scriptData;
|
|
|
|
// REMINDER
|
|
|
|
scriptData.push({
|
|
label: 'Rappel des règles du sort',
|
|
trigger: 'rollTest',
|
|
script: `
|
|
args.test.result.other.push("This rollTest attack follows the rules for the Lore of Nurgle spell @UUID[Compendium.wfrp4e-core.items.Item.XhyZ140R1iA1J7wZ].");
|
|
`
|
|
});
|
|
|
|
// /REMINDER
|
|
|
|
// update Effect's name
|
|
await effet.update({
|
|
name,
|
|
"system.scriptData": scriptData
|
|
});
|
|
|
|
|
|
// update Trait's name
|
|
await vomit.update({name});
|
|
|
|
// copy effect from Stream of Corruption spell
|
|
const effectData = (await fromUuid("Compendium.wfrp4e-core.items.Item.XhyZ140R1iA1J7wZ.ActiveEffect.KAXAHr5NdusLTz6k")).toObject();
|
|
|
|
await vomit.createEmbeddedDocuments("ActiveEffect", [effectData]); |