mirror of
https://github.com/migatu/vtt_work.git
synced 2026-07-14 21:38:39 +00:00
Import wrath-and-glory-gk-0.2.0.zip do wg-greyknights (2025-08-21T20:12:55Z)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// Auto loadout on archetype creation (hook Actor creation)
|
||||
Hooks.on("createActor", async (actor, options, userId) => {
|
||||
try {
|
||||
const arch = actor.items.find(i => i.type === "archetype" && i.name?.includes("Grey Knight"));
|
||||
if (!arch) return;
|
||||
const names = ["Nemesis Force Halberd","Aegis Power Armour","Grey Knight Armour Integrated Storm Bolter","Aegis of Titan"];
|
||||
const toAdd = [];
|
||||
for (const n of names) {
|
||||
const packItem = game.items.getName?.(n);
|
||||
if (packItem) toAdd.push(packItem.toObject());
|
||||
else {
|
||||
// fallback: create minimal items
|
||||
toAdd.push({name:n, type: n.includes("Armour") ? "armor" : (n.includes("Bolter") ? "weapon" : "ability"), img:"icons/svg/placeholder.svg", system:{}});
|
||||
}
|
||||
}
|
||||
await actor.createEmbeddedDocuments("Item", toAdd);
|
||||
} catch(e) {
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user