Register

Concentration Notifier

An Add-on Module for Foundry Virtual Tabletop

Author: Zhell Project Source: Project URL Versions 11 - 11 (Verified 11) Last Updated 4 months, 1 week ago

Concentration Notifier

This is a module for dnd5e helping Dungeon Masters and players track concentration. At its core, a chat message will notify all active clients when an actor starts concentrating on an item or loses concentration on an item.

Additionally, when a scroll is made from a spell that requires concentration, that will also be tagged as requiring concentration.

Character Flags

The module supplies new fields (found under Special Traits). These fields work with Active Effects.

Helper Functions

The Actor document is supplied with the new function Actor#rollConcentrationSave, which accepts the usual arguments (same as rollAbilitySave) but makes use of the above flags automatically.

Additionally, these functions are found in the global namespace CN (here caster refers to a token placeable, token document, or an actor document):

Effect Flags

The effect placed on an actor to denote concentration contains some useful data, intended to make script writing easier for persistently active spells such as call lightning or moonbeam:

Using a macro to set the flag unbreakable within castData to true will prevent automatically prompting the caster for saving throws to maintain concentration when they take damage. Useful in rare instances where a feature lets you have unbreakable concentration on a particular spell.

Extending the Module

If you want to support other 'groupings' of concentration, this is quite simple to do. For example, if you want to support concentration on Hex for the Witch class from Valda's Spire of Secrets, which are tracked separately from spells, you would run this script in a module or world script.

Hooks.once("setup", () => CN.extendModule("hex-concentration", function itemRequiresConcentration(item) {
  if (item.type !== "feat") return false;
  const type = item.system.type;
  const units = item.system.duration?.units in CONFIG.DND5E.scalarTimePeriods;
  const flags = !!item.flags.concentrationnotifier?.data.requiresConcentration;
  return units && flags && (type.value === "class") && (type.subtype === "witchHex");
}));

This assumes the existence of 'witchHex' added as a custom class feature type.

The extendModule function takes the new status (a string, which must be different from 'concentration' or 'concentrating') and a synchronous function that is run to determine whether an item being used is requiring this type of concentration. In the above example, a hex requires concentration if it has a duration, is set by this module to require concentration, and is a class feature with the 'witchHex' subtype.

Here is another example, which causes the module to track concentration separately for all spells that are cast at 9th level or higher.

Hooks.once("setup", () => CN.extendModule("nine-concentration", function itemRequiresConcentration(item) {
  return (item.type === "spell") && (item.system.level >= 9) && item.system.components.concentration;
}));

Supported Game Systems

  1. Dungeons & Dragons Fifth Edition

    Latest Version: Version 3.1.1 Last Updated 1 month, 1 week ago

Categories

Available Versions

  1. Version 11.3.0

    1 month, 2 weeks ago
    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  2. Version 11.2.4

    1 month, 3 weeks ago
    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  3. Version 11.2.3

    1 month, 4 weeks ago
    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  4. Version 11.2.2

    2 months, 1 week ago
    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  5. Version 11.2.1

    4 months, 1 week ago
    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  6. Version 11.2.0

    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  7. Version 11.1.1

    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  8. Version 11.1.0

    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  9. Version 11.0.8

    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  10. Version 11.0.7

    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  11. Version 11.0.6

    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  12. Version 11.0.5

    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  13. Version 11.0.4

    Foundry Version 10 - 11 (Verified 11) Manifest URL Read Notes
  14. Version 11.0.3

    Foundry Version 10 - 11 (Verified 11) Manifest URL Read Notes
  15. Version 11.0.2

    Foundry Version 10 - 11 (Verified 11) Manifest URL Read Notes
  16. Version 11.0.1

    Foundry Version 10 - 11 (Verified 11) Manifest URL Read Notes
  17. Version 11.0.0

    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  18. Version 10.2.0

    Foundry Version 10 - 10 (Verified 10.291) Manifest URL Read Notes
  19. Version 1.1.2

    Foundry Version 9 - 9 (Verified 9) Manifest URL Read Notes