Files
wfrp-4e-de/scripts/UQtXuQmUlTyDKqhe.js
alzer a7f30267fd Sync 621 missing item-effect scripts from FR and translate to German
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.
2026-07-20 23:43:47 +02:00

144 lines
4.0 KiB
JavaScript

let characteristics = {
"ws" : 10,
"bs" : 20,
"s" : 0,
"t" : 10,
"i" : 15,
"ag" : 0,
"dex" : 0,
"int" : 40,
"wp" : 45,
"fel" : 10
}
let skills = ["Kanalisieren", "Besonnenheit", "Einschüchtern", "Sprache (Magick)", "Sprache (Nehekharan)", "Wissen (Magick)", "Wahrnehmung"]
let skillAdvancements = [10, 20, 15, 15, 10, 10, 10]
let talents = ["Arkane Magie (Domäne)", "Robustheit", "Bedrohlich", "Niedere Magie", "Lesen & Schreiben", "Zweites Gesicht"]
let trappings = ["Waffe"]
let specialItems = [
{name: "Mouldering Robes", type: "trapping", trappingType: "clothingAccessories" },
{name: "Pouches containing ritual components", type: "trapping", trappingType: "clothingAccessories" },
{name: "Staff", type: "weapon", damage: "SB+2"},
{name: "Dunkle Magie (Nekromantie)", type: "talent"},
]
let items = [];
let updateObj = this.actor.toObject();
for (let ch in characteristics)
{
updateObj.system.characteristics[ch].modifier += characteristics[ch];
}
for (let item of specialItems) {
let newItem
if (item.type == "weapon") {
newItem = new ItemWfrp4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })
} else if (item.type == "trapping") {
newItem = new ItemWfrp4e({ img: "systems/wfrp4e/icons/blank.png", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )
} else {
newItem = new ItemWfrp4e({ img: "systems/wfrp4e/icons/blank.png", name: item.name, type: item.type })
}
items.push(newItem.toObject())
}
for (let index = 0; index < skills.length; index++)
{
let skill = skills[index]
let skillItem;
skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill")
if (skillItem)
skillItem.system.advances.value += skillAdvancements[index]
else
{
skillItem = await game.wfrp4e.utility.findSkill(skill)
skillItem = skillItem.toObject();
skillItem.system.advances.value = skillAdvancements[index];
items.push(skillItem);
}
}
for (let talent of talents)
{
let talentItem = await game.wfrp4e.utility.findTalent(talent)
if (talentItem)
{
items.push(talentItem.toObject());
}
else
{
ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})
}
}
for (let trapping of trappings)
{
let trappingItem = await game.wfrp4e.utility.findItem(trapping)
if (trappingItem)
{
trappingItem = trappingItem.toObject()
trappingItem.system.equipped.value = true;
items.push(trappingItem);
}
else
{
ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})
}
}
let filters = [
{
property : "type",
value : "spell"
},
{
property : "system.lore.value",
value : "petty"
}
]
let petty = (await ItemDialog.createFromFilters(filters, 3, {text: "Wähle 3 Zaubertricks der Niederen Magie"})).map(i => i.toObject());
filters = [
{
property : "type",
value : "spell"
},
{
property : "system.lore.value",
value : ""
}
]
let arcane = (await ItemDialog.createFromFilters(filters, 2, {text : "Wähle 2 Arkane Zauber"})).map(i => i.toObject());
filters = [
{
property : "type",
value : "spell"
},
{
property : "name",
value: /^((?!\().)*$/gm, // Remove tout spells with parentheses (tout arcane spells spells)
regex: true
},
{
property : "system.lore.value",
value : "necromancy"
}
]
let necromancy = (await ItemDialog.createFromFilters(filters, 1, {text : "Wähle 1 Zauber der Nekromantie"})).map(i => i.toObject());
arcane.forEach(i => {
i.img = "modules/wfrp4e-core/icons/spells/necromancy.png";
i.system.lore.value = "necromancy";
})
let spells = [...petty, ...necromancy, ...arcane];
updateObj.name = updateObj.name += " " + this.effect.name
await this.actor.update(updateObj)
this.actor.createEmbeddedDocuments("Item", items.concat(spells));