Latest version | 11.3.0 |
---|---|
Minimum Core | 11 |
Compatible Core | 11 |
Last updated | 1 year ago |
Created | 2 years ago |
Authors |
|
Languages |
Deutsch English Português (Brasil) 한국어 |
Systems |
Dnd5e |
Project source | Project URL |
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.
Concentration
component (for spells), and for other items a field has been supplied next to the Duration
for non-spell items that should require concentration.Additionally, when a scroll is made from a spell that requires concentration, that will also be tagged as requiring concentration.
The module supplies new fields (found under Special Traits). These fields work with Active Effects.
flags.dnd5e.concentrationAbility
: Change the ability that is used for the actor's concentration saves. For example, use Wisdom instead of Constitution by putting wis
in this field.flags.dnd5e.concentrationAdvantage
: Set the default of concentration saves to be rolled with advantage.flags.dnd5e.concentrationBonus
: Give an actor a bonus to Concentration saves, such as @abilities.int.mod
or 1d6
. Good for Wizard Bladesingers. This field respects roll data.flags.dnd5e.concentrationReliable
: Change concentration saves such that rolls on the d20s cannot go below 10.flags.dnd5e.concentrationUnfocused
: Prevent an actor from starting concentration. If the 'Ability Use Warnings' setting is enabled, the actor will also be given a warning in the AbilityUseDialog that their item cannot be concentrated on.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):
CN.isActorConcentrating(caster)
: returns the effect if the actor is concentrating on any item, otherwise false
.CN.isActorConcentratingOnItem(caster, item)
: returns the effect if the actor is concentrating on the given item, otherwise false
.CN.isEffectConcentration(effect)
: returns true
or false
if the effect is a concentration effect.CN.breakConcentration(caster, {message=true}={})
: ends all concentration effects on the actor. Returns the array of deleted effects. Set message
to false to suppress notifications.CN.waitForConcentrationStart(caster, {item, max_wait=10000}={})
: will wait for the actor to receive any concentration effect (or specific to the item, if provided). Useful for halting scripts in edge cases. The optional integer denotes the maximum number of ms to wait for. Returns the effect if one exists, otherwise false
.CN.redisplayCard(caster)
: displays the chat card of the item being concentrated on, at the level it was cast.CN.extendModule(status, require)
: (detailed below.)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:
flags.concentrationnotifier.data.itemData
, with all the details of the item being concentrated on.flags.concentrationnotifier.data.castData
, with the item's base level, the level at which it was cast, and its uuid.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.
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;
}));
To install this package, open your Foundry Setup screen and navigate to your Module tab and click the Install Module button.
From there, you can either search for the package unique name: concentrationnotifier or copy its manifest URL:
And paste it to the input box at the bottom of your window.
You can install this package directly to your Forge account.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Advertisement cookies are used to deliver visitors with customized advertisements based on the pages they visited before and analyze the effectiveness of the ad campaign.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.