diff --git a/src/item/item.ts b/src/item/item.ts index d3041604..7a279bcd 100644 --- a/src/item/item.ts +++ b/src/item/item.ts @@ -11,6 +11,13 @@ declare global { interface DocumentClassConfig { Item: typeof DS4Item; } + + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Hooks { + interface StaticCallbacks { + "ds4.rollItem": (item: DS4Item) => void; + } + } } /** diff --git a/src/item/spell/spell.ts b/src/item/spell/spell.ts index efcf8f1a..cf1fea29 100644 --- a/src/item/spell/spell.ts +++ b/src/item/spell/spell.ts @@ -55,6 +55,8 @@ export class DS4Spell extends DS4Item { flavorData: { actor: speaker.alias ?? this.actor.name, spell: this.name }, speaker, }); + + Hooks.callAll("ds4.rollItem", this); } } diff --git a/src/item/weapon/weapon.ts b/src/item/weapon/weapon.ts index dabea48f..8d3bc2df 100644 --- a/src/item/weapon/weapon.ts +++ b/src/item/weapon/weapon.ts @@ -47,6 +47,8 @@ export class DS4Weapon extends DS4Item { flavorData: { actor: speaker.alias ?? this.actor.name, weapon: this.name }, speaker, }); + + Hooks.callAll("ds4.rollItem", this); } private async getCombatValueKeyForAttackType(attackType: AttackType): Promise<"meleeAttack" | "rangedAttack"> {