Spell Dictionary
Spells are the combat skills that players, NPCs and interactables use to affect players and NPCs. They can be divided into damage, heal, dot, hot, buff, debuff, and aura spells. All spell data are contained in the data/db_spells.json file.
The spell data are stored in two separate dictionaries. The first is spell_base, which contains the base values as found in the data/db_spells.json file. This dictionary does not change. The second in spell_current, which is based on spell_base, but can be modified by talents or other effects. For example, if a spell gains a 10% increase to critical hit chance from a talent, this is applied to spell_current. Only effects that are applied to individual spells are handled in this way. Changes to player stats are handled in the stats_current dictionary in the player script.
Basic data/db_spells.json keys
All spells have some common keys that are required in the data dictionary, or are common optional keys for all types of spell. These are:
Required
name: The name of the spell, as it appears in the combat log.
targetgroup: The group (player, npc, hostile, etc.) that can be targeted by this spell.
Optional
icon: The icon used for a spell
role: The player role (i.e., tank, heal, melee, ranged) that uses this variant of the spell. Needed for player spells that are available to more than one role.
resource_cost: The cost of the main resource to trigger the spell. Can be negative to gain resource.
max_range: The maximum range of the spell.
cooldown: The cooldown period of the spell in seconds.
on_gcd: Whether the spell is affected by and triggers the global cooldown.
Damage Spell Keys
Damage spells require some further keys to function. These are:
spelltype: Must be set to "damage".
effecttype: Must be set to "physical" or "magic", and will use the corresponding modifiers.
value_base: The stat (e.g., max health, current health, primary, etc.) that is used as a base to calculate the effective damage.
value_modifier: The multiplicative modifier that is applied to the base value to calculate the effective damage.
avoidable: Whether or not the spell can be avoided. Set to 1 for avoidable, or 0 for not avoidable.
can_crit: Whether or not the spell can critically hit. Set to 1 for critical hits, and 0 for no critical hits.
crit_chance_modifier: Additive constant to the critical hit chance of the spell. Applied to the base critical hit chance of the source.
crit_magnitude_modifier: Multiplicative modifier to the effective damage when a hit is critical.
Healing Spell Keys
Healing spells require some further keys to function. These are:
spelltype: Must be set to "heal".
effecttype: Must be set to "physical" or "magic", and will use the corresponding modifiers.
value_base: The (e.g., max health, current health, primary, etc.) that is used as a base to calculate the effective healing.
value_modifier: The multiplicative modifier that is applied to the base value to calculate the effective healing.
can_crit: Whether or not the spell can critically hit. Set to 1 for critical hits, and 0 for no critical hits.
crit_chance_modifier: Additive constant to the critical hit chance of the spell. Applied to the base critical hit chance of the source.
crit_magnitude_modifier: Multiplicative modifier to the effective healing when a hit is critical.
DoT Spell Keys
DoT effects use the same keys as damage spells for the damage events that they trigger. However, they require a few additional keys:
ticks: The number of ticks that a DoT effect has.
tickrate: The time between two ticks, in seconds.
unique: Whether a DoT effect can only be present on a unit once in total (value 1), or once per source (value 0).
HoT Spell Keys
HoT effects use the same keys as healing spells for the healing events that they trigger. However, they require a few additional keys:
ticks: The number of ticks that a HoT effect has.
tickrate: The time between two ticks, in seconds.
unique: Whether a HoT effect can only be present on a unit once in total (value 1), or once per source (value 0).
Buff Spell Keys
Buffs do not cause damage or healing events, and therefore require a few different keys to function:
auratype: Must be set to "buff".
modifies: An array of stats that is to be modified. Can contain the same stat multiple times.
modify_type: An array of the same length as "modifies", containing either "mult" or "add" for each element, which determines whether a stat is affected additively, or multiplicatively.
modify_value: An array of the same length as "modifies", containing the additive or multiplicative modifier applied to each stat.
duration: The total duration of the buff effect.
unique: Whether a buff effect can only be present on a unit once in total (value 1), or one per source (value 0).
Debuff Spell Keys
Debuffs do not cause damage or healing events, and therefore require a few different keys to function:
auratype: Must be set to "debuff".
modifies: An array of stats that is to be modified. Can contain the same stat multiple times.
modify_type: An array of the same length as "modifies", containing either "mult" or "add" for each element, which determines whether a stat is affected additively, or multiplicatively.
modify_value: An array of the same length as "modifies", containing the additive or multiplicative modifier applied to each stat.
duration: The total duration of the debuff effect.
unique: Whether a debuff effect can only be present on a unit once in total (value 1), or one per source (value 0).
Absorb Spell Keys
Absorb effects are essentially a combination of healing and buff effects. The keys they require are:
auratype: Must be set to "absorb".
value_base: The value that is used as a base to calculate the total absorb amount.
value_modifier: The multiplicative modifier that is applied to the base value to calculate the total absorb amount.
can_crit: Whether or not the spell can critically hit. Set to 1 for critical hits, and 0 for no critical hits.
crit_chance_modifier: Additive constant to the critical hit chance of the spell. Applied to the base critical hit chance of the source.
crit_magnitude_modifier: Multiplicative modifier to the total absorb amount when a hit is critical.
duration: The total duration of the absorb effect.
unique: Whether an absorb effect can only be present on a unit once in total (value 1), or one per source (value 0).
No Comments