diff --git a/wg-greyknights/module.json b/wg-greyknights/module.json index e5b1ecc..6ac3fd3 100644 --- a/wg-greyknights/module.json +++ b/wg-greyknights/module.json @@ -1,14 +1,14 @@ { - "id": "gk-greyknight", - "title": "Grey Knights — Compendium (Wrath & Glory)", - "version": "0.6.3", + "id": "wng-daemonhunters", + "title": "Wrath & Glory: Daemonhunters (Grey Knights)", + "version": "0.6.4.1", "compatibility": { "minimum": "11", "verified": "13" }, "authors": [ { - "name": "User & Assistant" + "name": "Grey Knights Add-on" } ], "systems": [ @@ -16,16 +16,15 @@ ], "packs": [ { - "name": "gk-items", - "label": "Grey Knights — Items", - "path": "packs/gk-items", + "name": "daemonhunters", + "label": "Daemonhunters (Grey Knights)", + "path": "packs/daemonhunters.db", "type": "Item", "system": "wrath-and-glory", "private": false } ], "esmodules": [ - "scripts/auto-loadout.js" - ], - "readme": "README.txt" + "scripts/auto-gk-archetype.js" + ] } \ No newline at end of file diff --git a/wg-greyknights/packs/daemonhunters.db b/wg-greyknights/packs/daemonhunters.db new file mode 100644 index 0000000..466ced2 --- /dev/null +++ b/wg-greyknights/packs/daemonhunters.db @@ -0,0 +1,14 @@ +{"name": "Aegis Power Armour", "type": "armour", "img": "modules/wng-core/assets/icons/armour/aquila-mk-vii.webp", "effects": [{"_id": "25aqxUBwyQtSAdxb", "name": "Aegis Wards (Constant)", "origin": null, "disabled": false, "duration": {"startTime": null, "combat": null}, "changes": [{"key": "system.skills.psychicMastery.bonus", "mode": 2, "value": "1", "priority": 20}, {"key": "system.combat.resolve.bonus", "mode": 2, "value": "1", "priority": 20}], "tint": "#ffffff", "transfer": true, "flags": {}, "system": {"transferData": {"equipTransfer": true, "type": "document", "originalType": "document", "documentType": "Actor", "avoidTest": {"value": "none", "opposed": false, "prevention": true, "reversed": false}, "testIndependent": false, "selfOnly": false, "prompt": false, "area": {"templateData": {"borderColor": null, "fillColor": null, "texture": null}, "keep": false, "aura": {"transferred": false, "render": false}, "duration": "sustained"}, "zone": {"type": "zone", "transferred": false, "traits": {}, "skipImmediateOnPlacement": false, "keep": false}}, "itemTargetData": {"ids": [], "allItems": false}, "scriptData": [], "zone": {"type": "zone", "traits": {}, "skipImmediateOnPlacement": false}, "sourceData": {"test": {}}}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "lastModifiedBy": null}, "img": "icons/svg/aura.svg", "type": "base", "description": "", "statuses": [], "sort": 0}, {"_id": "LfRNsXknme6JLgSC", "name": "Aegis Warding Runes (Toggle)", "origin": null, "disabled": true, "duration": {"startTime": null, "combat": null}, "changes": [{"key": "system.combat.resilience.bonus", "mode": 2, "value": "1", "priority": 20}, {"key": "system.combat.defence.bonus", "mode": 2, "value": "-1", "priority": 20}], "tint": "#ffffff", "transfer": true, "flags": {}, "system": {"transferData": {"equipTransfer": true, "type": "document", "originalType": "document", "documentType": "Actor", "avoidTest": {"value": "none", "opposed": false, "prevention": true, "reversed": false}, "testIndependent": false, "selfOnly": false, "prompt": false, "area": {"templateData": {"borderColor": null, "fillColor": null, "texture": null}, "keep": false, "aura": {"transferred": false, "render": false}, "duration": "sustained"}, "zone": {"type": "zone", "transferred": false, "traits": {}, "skipImmediateOnPlacement": false, "keep": false}}, "itemTargetData": {"ids": [], "allItems": false}, "scriptData": [], "zone": {"type": "zone", "traits": {}, "skipImmediateOnPlacement": false}, "sourceData": {"test": {}}}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "lastModifiedBy": null}, "img": "icons/svg/explosion.svg", "type": "base", "description": "", "statuses": [], "sort": 0}], "flags": {"wng-core": {"initialization-folder": "Armour", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "", "description": "
Grey Knights sanctified power armour with hexagrammic wards and storm bolter forearm mount.
Integrated forearm storm bolter. Integrated: does not occupy hands; may fire while wielding two‑handed melee. Treat as Pistol for firing in melee.
", "value": 4, "keywords": "BOLT, INTEGRATED, IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS", "equipped": false, "attack": {"base": 0, "bonus": 0, "rank": "none"}, "damage": {"base": 10, "bonus": 0, "rank": 0, "ed": {"base": 2, "bonus": 0, "rank": 0, "dice": ""}, "ap": {"base": 0, "bonus": 0, "rank": 0, "dice": ""}, "enabled": false, "otherDamage": {"mortal": "0", "wounds": "0", "shock": "0"}, "dice": ""}, "ed": {"base": 0, "bonus": 0, "rank": 0}, "ap": {"base": 0, "bonus": 0, "rank": 0}, "category": "ranged", "range": {"short": 12, "medium": 24, "long": 36, "melee": 1, "thrown": null}, "ammo": {"id": ""}, "salvo": 1, "traits": {"list": [{"name": "brutal"}, {"name": "pistol"}, {"name": "rapidFire", "rating": "2"}]}, "upgrades": [], "otherDamage": {}, "combi": {}, "twinned": false}, "folder": "85dkcvhBYli5TJrZ", "_id": "SDFwequVtp6WsCFj"} +{"name": "Terminator Aegis (Grey Knights)", "type": "armour", "img": "modules/wng-core/assets/icons/armour/terminator-armour.webp", "effects": [{"_id": "OvE7cPAtNLDdEj6j", "name": "Aegis Wards (Constant)", "origin": null, "disabled": false, "duration": {"startTime": null, "combat": null}, "changes": [{"key": "system.skills.psychicMastery.bonus", "mode": 2, "value": "1", "priority": 20}, {"key": "system.combat.resolve.bonus", "mode": 2, "value": "1", "priority": 20}], "tint": "#ffffff", "transfer": true, "flags": {}, "system": {"transferData": {"equipTransfer": true, "type": "document", "originalType": "document", "documentType": "Actor", "avoidTest": {"value": "none", "opposed": false, "prevention": true, "reversed": false}, "testIndependent": false, "selfOnly": false, "prompt": false, "area": {"templateData": {"borderColor": null, "fillColor": null, "texture": null}, "keep": false, "aura": {"transferred": false, "render": false}, "duration": "sustained"}, "zone": {"type": "zone", "transferred": false, "traits": {}, "skipImmediateOnPlacement": false, "keep": false}}, "itemTargetData": {"ids": [], "allItems": false}, "scriptData": [], "zone": {"type": "zone", "traits": {}, "skipImmediateOnPlacement": false}, "sourceData": {"test": {}}}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "lastModifiedBy": null}, "img": "icons/svg/aura.svg", "type": "base", "description": "", "statuses": [], "sort": 0}, {"_id": "RXHERg7YjunnEQ8h", "name": "Aegis Warding Runes (Toggle)", "origin": null, "disabled": true, "duration": {"startTime": null, "combat": null}, "changes": [{"key": "system.combat.resilience.bonus", "mode": 2, "value": "1", "priority": 20}, {"key": "system.combat.defence.bonus", "mode": 2, "value": "-1", "priority": 20}], "tint": "#ffffff", "transfer": true, "flags": {}, "system": {"transferData": {"equipTransfer": true, "type": "document", "originalType": "document", "documentType": "Actor", "avoidTest": {"value": "none", "opposed": false, "prevention": true, "reversed": false}, "testIndependent": false, "selfOnly": false, "prompt": false, "area": {"templateData": {"borderColor": null, "fillColor": null, "texture": null}, "keep": false, "aura": {"transferred": false, "render": false}, "duration": "sustained"}, "zone": {"type": "zone", "transferred": false, "traits": {}, "skipImmediateOnPlacement": false, "keep": false}}, "itemTargetData": {"ids": [], "allItems": false}, "scriptData": [], "zone": {"type": "zone", "traits": {}, "skipImmediateOnPlacement": false}, "sourceData": {"test": {}}}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "lastModifiedBy": null}, "img": "icons/svg/explosion.svg", "type": "base", "description": "", "statuses": [], "sort": 0}], "flags": {"wng-core": {"initialization-folder": "Armour", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "", "description": "Grey Knights Tactical Dreadnought armour with Aegis wards and storm bolter hard‑mount.
Scavenged Black Templars plate, patched & lightened. Designed for incognito operations.
Innate sanctity of a Grey Knight. +1 bonus die to Deny the Witch; +1 to resist Corruption. If equipped with Aegis armour, gain an additional +1 to resist Corruption.
", "cost": 0, "requirements": "GREY KNIGHTS"}, "_id": "4fbdc9cbbdce43b6"} +{"name": "Brotherhood of Psykers", "type": "ability", "img": "modules/wng-core/assets/icons/abilities/adeptus-astartes.webp", "effects": [], "system": {"description": "You gain the PSYKER Keyword and know Universal Psyker Abilities and Smite. When you gain this Ability, choose one Discipline: Librarius or Sanctic. Learn one power from the chosen Discipline.
", "cost": 0, "requirements": "GREY KNIGHTS"}, "_id": "8e147a2e47594051"} +{"name": "Hammerhand (Sanctic)", "type": "psychicPower", "img": "modules/wng-core/assets/icons/powers/power.webp", "effects": [], "system": {"dn": "7", "cost": 10, "activation": "action", "duration": "Sustained", "range": "Self", "keywords": "PSYCHIC, SANCTIC", "description": "Melee attacks gain +1ED until the start of your next Turn (persists while Sustained). Optionally spend 3 Shock on activation to gain +1 DN to resist Disarm/Shove.
"}, "_id": "62d8b2491f1b408d"} +{"name": "Sanctuary (Sanctic)", "type": "psychicPower", "img": "modules/wng-core/assets/icons/powers/power.webp", "effects": [], "system": {"dn": "7", "cost": 15, "activation": "action", "duration": "Sustained", "range": "Aura 5 m", "keywords": "PSYCHIC, SANCTIC", "description": "Allies in the aura gain +1 to Resolve vs Fear/Corruption; their attacks count as Sanctified vs DAEMON for overcoming Resistances (GM adjudication). Ends if you are Incapacitated.
"}, "_id": "604ee438dd144a72"} +{"name": "The Shrouding (Sanctic)", "type": "psychicPower", "img": "modules/wng-core/assets/icons/powers/power.webp", "effects": [], "system": {"dn": "7", "cost": 10, "activation": "action", "duration": "Sustained", "range": "Self or Ally within 15 m", "keywords": "PSYCHIC, SANCTIC", "description": "Attacks against the target suffer +1 DN (ranged) while Sustained; moving more than normal Speed ends the effect at end of Turn. Potency (table): also +1 DN melee.
"}, "_id": "3326bd6d147441ae"} +{"name": "Might of Titan (Sanctic)", "type": "psychicPower", "img": "modules/wng-core/assets/icons/powers/power.webp", "effects": [], "system": {"dn": "7", "cost": 15, "activation": "action", "duration": "Sustained", "range": "15 m", "keywords": "PSYCHIC, SANCTIC", "description": "Target ally gains +1 to Strength-based Tests and +1ED on melee attacks; while Sustained, the bonuses persist. Potency (table): also +1 to Toughness Tests.
"}, "_id": "169a9cb337844a44"} diff --git a/wg-greyknights/scripts/auto-gk-archetype.js b/wg-greyknights/scripts/auto-gk-archetype.js new file mode 100644 index 0000000..15cda79 --- /dev/null +++ b/wg-greyknights/scripts/auto-gk-archetype.js @@ -0,0 +1,75 @@ +// WNG-Daemonhunters 0.6.4.1 — single dialog GK autoload (no clashes) +Hooks.once('ready', () => console.log("WNG-Daemonhunters | Auto-loadout ready")); + +async function addFromPackByName(actor, packKey, name, equip=false) { + const pack = game.packs.get(packKey); + if (!pack) return ui.notifications?.warn(`Pack not found: ${packKey}`); + const index = await pack.getIndex(); + const entry = index.find(e => e.name === name); + if (!entry) return ui.notifications?.warn(`Item not in pack: ${name}`); + const doc = await pack.getDocument(entry._id); + const data = doc.toObject(); delete data._id; + if (equip && data.system && ('equipped' in data.system)) data.system.equipped = true; + const [created] = await actor.createEmbeddedDocuments('Item', [data]); + return created; +} +async function addFromUuid(actor, uuid, equip=false) { + const doc = await fromUuid(uuid); + if (!doc) return ui.notifications?.warn(`Missing UUID: ${uuid}`); + const data = doc.toObject(); delete data._id; + if (equip && data.system && ('equipped' in data.system)) data.system.equipped = true; + const [created] = await actor.createEmbeddedDocuments('Item', [data]); + return created; +} + +Hooks.on('createItem', async (item, options, userId) => { + try { + const actor = item.parent; + if (!actor || item.type !== 'archetype' || item.name !== 'Grey Knight') return; + if (game.userId !== userId) return; + if (actor.getFlag('wng-daemonhunters','gkLoaded')) return; // prevent double-run + + const content = `Select initial loadout for Grey Knight:
+