scripts/ was missing 621 of FR's 2114 effect scripts (referenced via game.wfrp4e.config.effectScripts by Foundry item id). Copied them all over so the registry is complete, then translated the 129 that still contained French user-facing text: skill/talent/trapping name arrays in NPC-statblock-building scripts, chat/notification messages, and dialog prompts. Skill/talent/trait names were cross-checked against the already-translated core compendium rather than translated ad hoc, since Foundry looks these up by exact document name. Also fixed real bugs found along the way (present in FR's originals too, just inherited via the copy): - Two "let x / let x" duplicate-declaration scripts (SyntaxError) - A "0rgs.actor" typo (ReferenceError) for "args.actor" - Two "effet.update(...)" typos for "effect.update(...)" - A corrupted ui.notifications.warn(...) template literal in 3 of the NPC-statblock scripts, mangled into stray leftover code text - 19 scripts across the whole scripts/ folder (not just the 621) using the wrong game.i18n.localize() key (NAME.Résistance/Démoniaque/ Mort-vivant instead of the actual English key names NAME.Endurance/ Daemonic/Undead), which silently failed to resolve in any language Rebuilt modules/loadScripts.js via `npm run build` (2114 scripts). Known follow-up (out of scope here, pre-existing in the scripts DE already had before this sync): 7 scripts elsewhere in scripts/ have unrelated syntax bugs, and one has a lingering French accent.
34 lines
920 B
JavaScript
34 lines
920 B
JavaScript
const vomit = this.actor.itemTags.trait.find(t => t.name === "Kotze");
|
|
const name = "Bileful rollTest";
|
|
|
|
if (!vomit) return;
|
|
|
|
const effect = vomit.effects.find(e => e.name === "Kotze");
|
|
const scriptData = effect.system.scriptData;
|
|
|
|
// REMINDER
|
|
|
|
scriptData.push({
|
|
label: 'Erinnerung an die Zauberregeln',
|
|
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 effect.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]); |