Buff Spell - TheComputerGeek2/MagicSpells GitHub Wiki
Description:
A spell that once activated stays active for a set duration. The options below extend from the Instant Spell.
Spell Effect Positions:
- Buff spells can play Spell Effects on some specific positions repeatedly with a configurable interval while the buff is active. When using EffectLib effects, the recommended position is 
buffeffectlib, otherwisebuff/activemay be used. - Once buff spells end, an effect is played on the 
disabledposition. 
Configuration:
- Since 4.0 Beta 13 some of these options support dynamic values through numeric or string expressions.
 - This spell supports Spell Filter options used with the option 
cancel-on-spell-cast. 
| Option | Description | Type | Default | Supports expressions | 
|---|---|---|---|---|
duration | 
Buff spell duration specified in seconds before the buff expires. Set to 0 to define an infinite duration. | Float | 0 | 
Since 4.0 Beta 17 | 
toggle | 
Defines whether the spell can be deactivated while still active. It will only apply cooldown when its duration fades. | Boolean | true | 
false | 
targeted | 
Defines if this spell should become a targeted spell. | Boolean | false | 
false | 
cancel-on-join | 
Defines whether the buff spell will cancel if the caster joins the game. | Boolean | false | 
false | 
cancel-on-move | 
Defines whether the buff spell will cancel if the caster moves. | Boolean | false | 
false | 
cancel-on-death | 
Defines whether the buff spell will cancel if the caster dies. | Boolean | false | 
false | 
cancel-on-logout | 
Defines whether the buff spell will cancel if the caster leaves the game. | Boolean | false | 
false | 
cancel-on-teleport | 
Defines whether the buff spell will cancel if the server emits a teleport event for the caster. | Boolean | false | 
false | 
cancel-on-spell-cast | 
Defines whether the buff spell will cancel if the caster casts a spell. Since 4.0 Beta 14 this cancels all spells if the Spell Filter is left undefined. | Boolean | false | 
false | 
cancel-on-take-damage | 
Defines whether the buff spell will cancel if the caster receives damage. | Boolean | false | 
false | 
cancel-on-give-damage | 
Defines whether the buff spell will cancel if the caster deals damage to another entity. | Boolean | false | 
false | 
cancel-on-change-world | 
Defines whether the buff spell will cancel if the caster switches worlds. | Boolean | false | 
false | 
cancel-affects-target | 
If the buff spell is targeted, cancelling logic will be affected by and to the target instead. | 
Boolean | false | 
false | 
real-time-duration | 
Since 4.0 Beta 17. When true, duration is tracked using real time, instead of ticks. As such, lag will not impact the duration of the buff spell. | 
Boolean | false | 
false | 
power-affects-duration | 
Defines whether Spell Power can affect the spell's duration. | Boolean | true | 
false | 
end-spell-from-target | 
Defines caster of the spell-on-end. If the spell isn't targeted, the "target" is technically the caster, so they cast the spell. | 
Boolean | true | 
false | 
str-fade | 
Message sent after the buff ends. | Rich Text | true | 
false | 
spell-on-end | 
Sub-spell that will be cast whenever the buff spell reaches the end of its duration. | String | false | 
Uses:
Most buff spells have special events that define when a buff Use happened. Some buffs, like DummySpell, don't. The below options can be used to configure how buff Uses behave. You can use Uses, for example, to make the buff last forever (duration: 0), but end after it depletes its uses.
| Option | Description | Type | Default | 
|---|---|---|---|
num-uses | 
Number of Uses before the buff spell expires. | Integer | 0 | 
use-cost-interval | 
Interval defines after how many Uses the spell can charge use-cost. | 
Integer | 0 | 
use-cost | 
A string list of reagents required for the buff to remain active. The cost will be charged only when the buff spell's Uses is incremented. | String List | |
spell-on-use-increment | 
Sub-spell that will be cast whenever the buff spell Uses has been incremented (depends on the buff spell type). This spell will be cast once even if num-uses is set to 0. | 
String | |
spell-on-cost | 
Sub-spell that will be cast whenever the buff spell tries to charge use cost. | String |