Skip to main content

Spell Structure

Spells are stored in dictionaries in a JSON file. When loaded into the game, this dictionary is stored twice. The first dictionary is called spell_base, and represents the base values of the spell. These values are only changed when the role of a specific class is changed (e.g. when changing from a healer to a tank, which can fundamentally change how the spell functions), but are not mutated by talents, buffs, debuffs, etc. The second dictionary is called spell_current, and represents the current state of the spell, which is affected by talents, buffs, debuffs, etc. This is separate from changes made to player stats.

The spell dictionaries store coefficients that are applied to the player stats, such that only the functionality of the spell itself is stored, along with effects that are applied to the spell specifically, For example, if all damage is increased by 10% via a talent or buff, this is done in the player stats, and not in the spell. However, if a very specific spell has its damage increased by 10% via a talent, this is represented in the spell dictionary.

The spell dictionary has the following keys
name: The name of the spell as displayed in the log and shown to players
resource_cost: The cost of the spell. This can be negative to allow for spells to build a resource
cooldown: The cooldown of a spell in seconds, independent of the global cooldown
on_gcd: Whether or not the spell is affected by the global cooldown, can be 0 (not affected) or 1 (affected)
spelltype: "damage", "heal" or "aura", depending on which type of event the spell triggers
effecttype: Whether the effect of the spell is physical or magic, dot, hot, buff, debuff or absorb
value_base: Which stat is used as a base. Usually primary stat, but allows for things such as max health scaling
value_modifier: The coefficient that is applied to the base value to generate the final spell value
avoidable: Whether or not the spell can be avoided, can be 0 (not avoidable) or 1 (avoidable)
can_crit: Whether or not the spell can critically strike, can be 0 (cannot crit) or 1 (can crit)
crit_chance_modifier: increases to critical strike chance for this spell
crit_magnitude_modifier: The coefficient by which the critical strike increases the spell value

If the spell is a damage or heal over time effect, then some more keys need to be specified, as follows
duration: The duration of the effect in seconds
tick: The tick rate of the effect in seconds

If the spell is a buff or debuff, other keys need to additionally be specified, as follows
modifies: The stats that are affected by the buff, as a list
modify_type: Whether the stat is multiplicatively or additively affected, as a list
modifiy_values: The values by which the stat is affected, a a list
duration: The duration of the buff or debuff in seconds
The indices of the list need to be consistent, in that the first index of each list describes how the first modified is affected, the second index specifies how the second modified stat is affected, etc,

If the spell is absorb, I'll think about it later :D