initial commit

This commit is contained in:
Grimsace
2026-01-23 12:57:29 -06:00
commit 9e8a483e7c
5 changed files with 62 additions and 0 deletions
Executable
+1
View File
@@ -0,0 +1 @@
packs/** binary
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Executable
+9
View File
@@ -0,0 +1,9 @@
{
"PF2E": {
"CurrencyAbbreviations": {
"sp": "cr"
},
"CurrencySP": "Credits"
}
}
Executable
+26
View File
@@ -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": "[email protected]",
"discord": "grimsace",
"flags": {}
}
],
"systems": ["pf2e"],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
}
],
"scripts": ["scripts/update-compendium.js"]
}
+26
View File
@@ -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.`);
});