commit 9e8a483e7cf101ae3288ab63d8b8ef0265b22572 Author: Grimsace Date: Fri Jan 23 12:57:29 2026 -0600 initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100755 index 0000000..4ee706a --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +packs/** binary diff --git a/icons/equipment/treasure/currency/credits.webp b/icons/equipment/treasure/currency/credits.webp new file mode 100755 index 0000000..1920b92 Binary files /dev/null and b/icons/equipment/treasure/currency/credits.webp differ diff --git a/lang/en.json b/lang/en.json new file mode 100755 index 0000000..63fe79f --- /dev/null +++ b/lang/en.json @@ -0,0 +1,9 @@ +{ + "PF2E": { + "CurrencyAbbreviations": { + "sp": "cr" + }, + "CurrencySP": "Credits" + } +} + \ No newline at end of file diff --git a/module.json b/module.json new file mode 100755 index 0000000..e3ad50c --- /dev/null +++ b/module.json @@ -0,0 +1,26 @@ +{ + "id": "sf2e-silver-to-credits", + "title": "SF2e Silver to Credits", + "version": "0.0.1", + "compatibility": { + "minimum": "12", + "verified": "13" + }, + "authors": [ + { + "name": "Grimsace", + "email": "acegrimreaper@gmail.com", + "discord": "grimsace", + "flags": {} + } + ], + "systems": ["pf2e"], + "languages": [ + { + "lang": "en", + "name": "English", + "path": "lang/en.json" + } + ], + "scripts": ["scripts/update-compendium.js"] +} diff --git a/scripts/update-compendium.js b/scripts/update-compendium.js new file mode 100755 index 0000000..bcc21d0 --- /dev/null +++ b/scripts/update-compendium.js @@ -0,0 +1,26 @@ +Hooks.on("createItem", async (item) => { + // Specify the source ID of the item you want to update + const targetSourceId = "Compendium.pf2e.equipment-srd.Item.5Ew82vBF9YfaiY9f"; // Replace with the actual source ID of the item + + // Check if the created item's sourceId matches the target sourceId + if (item.sourceId !== targetSourceId) return; + + // Define the updated data + const updatedData = { + system: { + description: { + value: + "This is a credit, a digital currency originaly created by the mysterious Grenth Moro. Starting as a decentrilized cryptographic currency, it eventually grew to be used by every world in the outer rim systems.", + }, + bulk: { + value: 0, + }, + }, + name: "Credits", + img: "modules/sf2e-silver-to-credits/icons/equipment/treasure/currency/credits.webp", + }; + + // Update the item + await item.update(updatedData); + console.log(`Updated item with sourceId "${item.sourceId}" upon creation.`); +});