dnd5e-item-activate
Activate an item with full Foundry automation — triggers Midi-QOL and other automation module hooks. Use for combat actions: melee/ranged attacks, spell casting, abilities. Pass targetTokenIds for attacks — Midi-QOL will auto-roll attack, check AC, roll damage, apply HP loss. For AoE spells pass templatePosition. Circle AoE (Fireball): x,y = center of effect (avg target positions). Cone/Line AoE (Cone of Cold, Lightning Bolt): x,y = caster token position, direction = angle toward targets (direction = atan2(targetY - casterY, targetX - casterX) * 180 / PI, add 360 if negative). Pixel coords: pixel = gridCoord * gridSize + gridSize / 2. Unlike dnd5e-item-use, this does NOT suppress hooks or dialogs, so automation modules work fully. Use scene-get to find target token IDs and grid info, item-list to find item IDs. Prefer this over dnd5e-item-use when targets, templates or automation matter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| itemId | Yes | Item ID to activate (from item-list) | |
| actorId | Yes | Actor ID performing the action | |
| activityId | No | Specific activity ID if item has multiple | |
| spellLevel | No | Spell slot level for casting. Enables upcasting (e.g. Fireball at 5th level = 10d6). Skips slot selection dialog. If omitted, uses spell base level. | |
| activityType | No | Activity type: "attack", "damage", "save", "heal", "check", "utility" | |
| targetTokenIds | No | Token IDs of targets on the scene. Required for attacks — Midi-QOL needs targets to auto-resolve hits and damage | |
| templatePosition | No | AoE template placement. Circle spells: x,y = center of effect. Cone/line spells: x,y = caster position, direction = angle toward targets. |