Import gk-greyknight-0.4.5-patch.zip do wg-greyknights (2025-08-21T22:05:46Z)

This commit is contained in:
2025-08-21 22:05:46 +00:00
parent 305edfa775
commit 5fcdc8d2f3
2 changed files with 27 additions and 14 deletions
@@ -0,0 +1,7 @@
{"name": "Aegis of Titan (Ability)", "type": "ability", "img": "icons/svg/aura.svg", "_id": "DaEMUDPe8wmrWz70", "effects": [{"_id": "WD4ApIMZ3pnaPDtl", "name": "Aegis of Titan — Innate Purity", "icon": "icons/svg/aura.svg", "origin": "", "disabled": false, "duration": {"startTime": null}, "changes": [{"key": "system.combat.resolve.bonus", "mode": 2, "value": 1, "priority": 20}], "transfer": true, "flags": {}}, {"_id": "OybEJ8Tl1hRkI5zJ", "name": "Aegis of Titan — Aegis Synergy", "icon": "icons/svg/upgrade.svg", "origin": "", "disabled": true, "duration": {"startTime": null}, "changes": [{"key": "system.combat.resolve.bonus", "mode": 2, "value": 1, "priority": 20}], "transfer": true, "flags": {}}], "flags": {"core": {}}, "folder": null, "system": {"description": "Innate purity (+1 vs Corruption). While equipped with Aegis armour, enable Synergy for an additional +1 vs Corruption.", "keywords": "IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS"}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}
{"name": "Grey Knight (Archetype)", "type": "archetype", "img": "icons/svg/book.svg", "effects": [{"_id": "uMkkBfS2rRXluXA6", "name": "Aegis of Titan — Innate Purity", "icon": "icons/svg/aura.svg", "origin": "", "disabled": false, "duration": {"startTime": null}, "changes": [{"key": "system.combat.resolve.bonus", "mode": 2, "value": 1, "priority": 20}], "transfer": true, "flags": {}}], "flags": {"wng-forsaken": {"initialization-folder": "Archetypes", "sort": 0}, "core": {}}, "system": {"tier": 4, "journal": "DMmW708Q5AQvQfuy", "species": {"name": "Adeptus Astartes", "id": "KpwHo0A92bR7iVMB"}, "faction": {"name": "Adeptus Astartes", "id": "CN5E9Z5GqfiR1MDn"}, "influence": 2, "cost": 359, "keywords": ["IMPERIUM", "ADEPTUS ASTARTES", "GREY KNIGHTS", "INQUISITION", "DAEMONHUNTERS", "ORDO MALLEUS"], "attributes": {"strength": 5, "toughness": 5, "agility": 5, "initiative": 5, "willpower": 6, "intellect": 3, "fellowship": null}, "skills": {"athletics": 3, "awareness": 3, "ballisticSkill": 5, "cunning": null, "deception": null, "insight": null, "intimidation": null, "investigation": null, "leadership": null, "medicae": null, "persuasion": null, "pilot": null, "psychicMastery": 4, "scholar": 2, "stealth": 3, "survival": 1, "tech": null, "weaponSkill": 5}, "ability": {"id": "DaEMUDPe8wmrWz70", "name": "Aegis of Titan"}, "wargear": {"structure": {"type": "and", "groupId": "root", "id": "root", "options": [{"type": "option", "index": 0, "groupId": "cj0fha0grf41pcv4", "id": "cj0fha0grf41pcv4"}, {"type": "option", "index": 1, "groupId": "a89wca5qifs6kga9", "id": "a89wca5qifs6kga9"}, {"type": "option", "index": 2, "groupId": "7za8qa72jedhuct9", "id": "7za8qa72jedhuct9"}, {"type": "option", "index": 3, "groupId": "q3jc5brs0mr50azx", "id": "q3jc5brs0mr50azx"}, {"type": "option", "index": 4, "groupId": "lz6z45ef5goceln6", "id": "lz6z45ef5goceln6"}, {"type": "option", "index": 5, "groupId": "xuev8a8qyfhywpzn", "id": "xuev8a8qyfhywpzn"}]}, "options": [{"name": "Mk VII Astartes Power Armour", "type": "item", "id": "cj0fha0grf41pcv4", "diff": {"name": "Mk VII Astartes Power Armour"}, "documentId": "7Bp1rDIfKEB2MB9N", "idType": "id", "filters": []}, {"name": "Psychic Hood", "type": "item", "id": "a89wca5qifs6kga9", "diff": {"name": "Psychic Hood"}, "documentId": "qKIlaAhu9RZ63l1N", "idType": "id", "filters": []}, {"name": "Bolt Pistol", "type": "item", "id": "7za8qa72jedhuct9", "diff": {"name": "Bolt Pistol"}, "documentId": "7b2xcPWBB7up65PM", "idType": "id", "filters": []}, {"name": "Force Stave", "type": "item", "id": "q3jc5brs0mr50azx", "diff": {"name": "Force Stave"}, "documentId": "9vfkaU0vc61t7hKO", "idType": "id", "filters": []}, {"name": "Frag Grenades", "type": "item", "id": "lz6z45ef5goceln6", "diff": {"name": "Frag Grenades", "data": {"quantity": 3}}, "documentId": "oDG9YpSKSiSUFLIY", "idType": "id", "filters": []}, {"name": "Krak Grenades", "type": "item", "id": "xuev8a8qyfhywpzn", "diff": {"name": "Krak Grenades", "data": {"quantity": 3}}, "documentId": "SJ8UaYHEMtF71W1M", "idType": "id", "filters": []}], "freeItems": [{"id": "", "name": "Nemesis Force Halberd"}, {"id": "", "name": "Aegis Power Armour"}, {"id": "", "name": "Grey Knight Armour Integrated Storm Bolter"}, {"id": "", "name": "Aegis of Titan (Ability)"}, {"id": "", "name": "Frag Grenade"}, {"id": "", "name": "Krak Grenade"}, {"id": "", "name": "Trinket (Chapter Relic Shard)"}]}, "suggested": {"attributes": {"strength": null, "toughness": null, "agility": null, "initiative": null, "willpower": null, "intellect": null, "fellowship": null}, "skills": {"athletics": null, "awareness": null, "ballisticSkill": null, "cunning": null, "deception": null, "insight": null, "intimidation": null, "investigation": null, "leadership": null, "medicae": null, "persuasion": null, "pilot": null, "psychicMastery": null, "scholar": null, "stealth": null, "survival": null, "tech": null, "weaponSkill": null}, "talents": {"list": []}}}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755771384639, "modifiedTime": 1755771384639, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.TCmE7YmUDUVQ3xoz", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "DEb55m6iVZ0NUOxA", "_id": "qSv5JzFRjTYdw1zI"}
{"name": "Nemesis Force Halberd", "type": "weapon", "img": "icons/svg/sword.svg", "effects": [], "flags": {"wng-core": {"initialization-folder": "Weapons", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "uncommon", "description": "Force Staves are laced with a complex psy-matrix that allows them to act as a psychic battery, storing psychic energy that can be released with brutal efficiency.<p><em>Nemesis:</em> vs DAEMON/PSYKER: +1 ED (homebrew). TwoHanded.</p>", "value": 2, "keywords": "IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS, MELEE, FORCE", "equipped": false, "attack": {"base": 0, "bonus": 0, "rank": "none"}, "damage": {"base": 4, "bonus": 0, "rank": 0, "ap": {"base": -1, "bonus": 0, "rank": 0}, "ed": {"base": 2, "bonus": 0, "rank": 0}, "enabled": false, "otherDamage": {"mortal": "0", "wounds": "0", "shock": "0"}}, "ed": {"base": 0, "bonus": 0, "rank": 0}, "ap": {"base": 0, "bonus": 0, "rank": 0}, "category": "melee", "range": {"short": 0, "medium": 0, "long": 0, "melee": 2, "thrown": null}, "ammo": {"id": ""}, "salvo": 0, "traits": {"list": [{"name": "brutal"}, {"name": "force"}, {"name": "twoHanded"}]}, "upgrades": [], "otherDamage": {}, "combi": {}, "twinned": false}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779931196, "modifiedTime": 1755779931196, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.9vfkaU0vc61t7hKO", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "85dkcvhBYli5TJrZ", "_id": "NX6bWADcIa03iGCK"}
{"name": "Grey Knight Armour Integrated Storm Bolter", "type": "weapon", "img": "icons/svg/dice-target.svg", "effects": [], "flags": {"wng-core": {"initialization-folder": "Weapons", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "rare", "description": "<p>Integrated forearm storm bolter. <b>Integrated:</b> does not occupy hands; may fire while wielding twohanded melee. Treat as Pistol for firing in melee.</p>", "value": 4, "keywords": "BOLT, INTEGRATED, IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS", "equipped": false, "attack": {"base": 0, "bonus": 0, "rank": "none"}, "damage": {"base": 10, "bonus": 0, "rank": 0, "ed": {"base": 2, "bonus": 0, "rank": 0}, "ap": {"base": 0, "bonus": 0, "rank": 0}, "enabled": false, "otherDamage": {"mortal": "0", "wounds": "0", "shock": "0"}}, "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}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779945407, "modifiedTime": 1755779945407, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.Seza6hxnXhHInk8m", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "85dkcvhBYli5TJrZ", "_id": "SDFwequVtp6WsCFj"}
{"name": "Aegis Power Armour", "type": "armour", "img": "icons/svg/shield.svg", "effects": [{"_id": "25aqxUBwyQtSAdxb", "name": "Aegis Wards (Constant)", "icon": "icons/svg/aura.svg", "origin": "", "disabled": false, "duration": {"startTime": 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": null, "transfer": true, "flags": {}}, {"_id": "LfRNsXknme6JLgSC", "name": "Aegis Warding Runes (Toggle)", "icon": "icons/svg/explosion.svg", "origin": "", "disabled": true, "duration": {"startTime": 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": null, "transfer": true, "flags": {}}], "flags": {"wng-core": {"initialization-folder": "Armour", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "veryRare", "description": "<p>Grey Knights sanctified power armour with hexagrammic wards and storm bolter forearm mount.</p><ul><li><b>AR 5</b>; <b>Powered (3)</b>.</li><li><b>Aegis (integrated):</b> Constant: +1 die to Deny the Witch and +1 die to resist Corruption.</li><li><b>Toggle (Action):</b> Aegis Warding Runes — runes glow; +1 Resilience, 1 Defence (vs ranged).</li></ul>", "value": 9, "keywords": "POWERED, IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS", "equipped": false, "rating": 5, "base": 0, "traits": {"list": [{"name": "powered", "rating": "3"}]}, "invulnerable": false}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779886550, "modifiedTime": 1755779886550, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.sTGTpOfbIveLcFul", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "K59Lb8PvaCmIrviu", "_id": "11NZTwYXPlHBlnXC"}
{"name": "Terminator Aegis (Grey Knights)", "type": "armour", "img": "icons/svg/tower.svg", "effects": [{"_id": "OvE7cPAtNLDdEj6j", "name": "Aegis Wards (Constant)", "icon": "icons/svg/aura.svg", "origin": "", "disabled": false, "duration": {"startTime": 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": null, "transfer": true, "flags": {}}, {"_id": "RXHERg7YjunnEQ8h", "name": "Aegis Warding Runes (Toggle)", "icon": "icons/svg/explosion.svg", "origin": "", "disabled": true, "duration": {"startTime": 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": null, "transfer": true, "flags": {}}], "flags": {"wng-core": {"initialization-folder": "Armour", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "artifact", "description": "<p>Grey Knights Tactical Dreadnought armour with Aegis wards and storm bolter hardmount.</p><ul><li><b>AR 7</b>; <b>Powered (4)</b>; <b>Cumbersome</b>; counts as Large while worn.</li><li><b>Aegis (integrated):</b> Constant: +1 die to Deny the Witch and +1 die to resist Corruption.</li><li><b>Toggle (Action):</b> Aegis Warding Runes — +1 Resilience, 1 Defence (vs ranged).</li></ul>", "value": 10, "keywords": "POWERED, IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS", "equipped": false, "rating": 7, "base": 0, "traits": {"list": [{"name": "cumbersome"}, {"name": "powered", "rating": "4"}]}, "invulnerable": false}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779886550, "modifiedTime": 1755779886550, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.sTGTpOfbIveLcFul", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "K59Lb8PvaCmIrviu", "_id": "9XTvCiJElW4LJij9"}
{"name": "Pilgrim Astartes Power Armor", "type": "armour", "img": "modules/wng-core/assets/icons/armour/terminator-armour.webp", "effects": [{"_id": "44rACWx99MiXXe4E", "name": "Pilgrim Disguise Penalties", "icon": "icons/svg/downgrade.svg", "origin": "", "disabled": false, "duration": {"startTime": null, "seconds": null, "turns": null, "startRound": null, "startTurn": null}, "changes": [{"key": "system.attributes.agility.bonus", "mode": 2, "value": -1, "priority": 20}, {"key": "system.skills.stealth.bonus", "mode": 2, "value": -1, "priority": 20}, {"key": "system.combat.speed", "mode": 2, "value": -1, "priority": 20}], "tint": null, "transfer": true, "flags": {}}], "flags": {"wng-core": {"initialization-folder": "Armour", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "rare", "description": "<p>Scavenged Black Templars plate, patched & lightened. Designed for incognito operations.</p><ul><li><b>AR 4</b>; <b>Powered (1)</b>; <b>Cumbersome</b>.</li><li><b>Penalty (Active Effect):</b> 1 die to Agility- and Stealth-based Tests while worn; 1 Speed (homebrew).</li><li>Appears as Templar armour at a glance; close inspection may reveal inconsistencies.</li></ul>", "value": 6, "keywords": "POWERED, IMPERIUM, ADEPTUS ASTARTES, BLACK TEMPLARS (DISGUISE)", "equipped": true, "rating": 4, "base": 0, "traits": {"list": [{"name": "cumbersome"}, {"name": "powered", "rating": "1"}]}, "invulnerable": false}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779886550, "modifiedTime": 1755779886550, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.sTGTpOfbIveLcFul", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "K59Lb8PvaCmIrviu", "_id": "2P2HioialQdFUCv6"}
@@ -0,0 +1,124 @@
// gk-greyknight — auto-attach loadout (deduped) v0.4.5
Hooks.once("ready", () => {
const PACK_KEY = "gk-greyknight.gk-items"; // moduleId.packName
const ITEMS = {
ability: "Aegis of Titan (Ability)",
nemesis: "Nemesis Force Halberd",
storm: "Grey Knight Armour Integrated Storm Bolter",
aegisPA: "Aegis Power Armour",
aegisTerm: "Terminator Aegis (Grey Knights)"
};
const FLAG_SCOPE = "gk-greyknight"; const FLAG_DONE = "autoLoadoutDone";
async function fetchFromCompendium(name) {
const pack = game.packs.get(PACK_KEY);
if (!pack) return null;
const index = await pack.getIndex();
const hit = index.find(e => e.name === name);
if (!hit) return null;
const doc = await pack.getDocument(hit._id);
return doc?.toObject();
}
async function ensureOnActor(actor, name, equip=false) {
let have = actor.items.getName(name);
if (have) {
if (typeof have.system?.equipped !== "undefined") await have.update({"system.equipped": !!equip});
return have;
}
let src = await fetchFromCompendium(name);
if (!src) { const world = game.items.getName(name); if (world) src = world.toObject(); }
if (!src) return null;
if (equip && src.system && typeof src.system.equipped !== "undefined") src.system.equipped = true;
const [created] = await actor.createEmbeddedDocuments("Item", [src]);
return created;
}
async function setEquipped(actor, name, on) {
const it = actor.items.getName(name);
if (it && typeof it.system?.equipped !== "undefined") await it.update({"system.equipped": !!on});
}
// De-register old hook if present to avoid double dialogs
if (window._gkAutoLoadoutHookId) {
Hooks.off("createItem", window._gkAutoLoadoutHookId);
window._gkAutoLoadoutHookId = null;
}
window._gkAutoLoadoutHookId = Hooks.on("createItem", async (item, opts, userId) => {
try {
if (item?.type !== "archetype") return;
if (item?.name !== "Grey Knight (Archetype)") return;
// Only the client that performed the creation
if (game.userId !== userId) return;
const actor = item.parent;
if (!actor) return;
// Avoid duplicate prompts per actor
if (actor.getFlag(FLAG_SCOPE, FLAG_DONE)) return;
await actor.setFlag(FLAG_SCOPE, FLAG_DONE, true);
const content = `
<style>
.gk-choices .opt{display:flex;gap:.6rem;align-items:flex-start;padding:.35rem .5rem;border:1px solid #6663;border-radius:6px;margin:.35rem 0}
.gk-choices .opt label{font-weight:600}
.gk-choices .hint{font-size:.9em;opacity:.85;margin-left:1.7rem}
</style>
<div class="gk-choices">
<div class="opt">
<input type="radio" name="mode" value="incog" id="gk-incog">
<label for="gk-incog">Incognito (bez Aegis)</label>
</div>
<div class="hint">Brak Aegis na starcie; dodam Ability i broń, ale nie będą <i>equipped</i>.</div>
<div class="opt">
<input type="radio" name="mode" value="war" id="gk-war" checked>
<label for="gk-war">WarPlate — Aegis Power Armour</label>
</div>
<div class="hint">Wyposaża: Aegis Power Armour + Nemesis + Integrated Storm Bolter. Włącza synergię Aegis.</div>
<div class="opt">
<input type="radio" name="mode" value="term" id="gk-term">
<label for="gk-term">Terminator — Terminator Aegis</label>
</div>
<div class="hint">Wyposaża: Terminator Aegis + Nemesis + Integrated Storm Bolter. Włącza synergię Aegis.</div>
</div>`;
const choice = await new Promise(resolve => {
new Dialog({
title: "Grey Knight — Wybierz Loadout",
content,
buttons: {
ok: {label: "Zastosuj", icon:"<i class='fas fa-check'></i>", callback: html => resolve(html.find('input[name=\"mode\"]:checked').val() || "war")},
cancel: {label:"Anuluj", callback: ()=>resolve(null)}
},
default: "ok"
}).render(true);
});
if (!choice) return;
await ensureOnActor(actor, ITEMS.ability, false);
await ensureOnActor(actor, ITEMS.nemesis, choice!=="incog");
await ensureOnActor(actor, ITEMS.storm, choice!=="incog");
// Clear both armours equipped
await setEquipped(actor, ITEMS.aegisPA, false);
await setEquipped(actor, ITEMS.aegisTerm, false);
if (choice === "war") {
await ensureOnActor(actor, ITEMS.aegisPA, true);
} else if (choice === "term") {
await ensureOnActor(actor, ITEMS.aegisTerm, true);
}
// Synergy toggle
const abil = actor.items.getName(ITEMS.ability);
const anyAegisOn = !!actor.items.find(i => ["armour","armor"].includes(i.type) && /Aegis/.test(i.name) && i.system?.equipped);
if (abil?.effects?.length) {
for (const ef of abil.effects) if (ef.name?.toLowerCase().includes("synergy")) await ef.update({disabled: !anyAegisOn});
}
ui.notifications.info(`GK loadout: ${choice.toUpperCase()} ustawiony.`);
} catch (e) { console.error("gk-greyknight auto-loadout error:", e); }
});
console.log("gk-greyknight: auto-loadout hook active (id=", window._gkAutoLoadoutHookId, ")");
});