pregame.lua for any modifiers. Follow the steps below to add a new ability from scratch.
Create the Lua file
Add a new If your ability uses a Lua-defined modifier, declare it with For event-driven abilities (spells with
.lua file in src/game/scripts/vscripts/abilities/. Name it after the ability using snake_case, matching the ability’s internal name.LinkLuaModifier at the top of the file. This registers the modifier class so the engine can find it at runtime.Here is an example from basic_stat_bonus.lua, which defines an intrinsic passive modifier:abilities/basic_stat_bonus.lua
OnSpellStart, kill events, etc.), you define plain functions without a class structure. See arcane_mastery.lua for a minimal example:abilities/arcane_mastery.lua
Register the ability in npc_abilities_custom.txt
Define the ability’s KV data in the custom abilities file. This is where you set ability type, behavior, damage type, special values, and references to the Lua script.The
ScriptFile key points to your Lua file relative to vscripts/:Add the ability to abilities.kv
src/game/scripts/kv/abilities.kv controls which abilities appear on the ability selection screen and what bracket (category) they fall into.Add your ability to the appropriate bracket. The brackets represent power tiers shown in the selection UI. Refer to the existing entries in abilities.kv to choose the right bracket for the ability’s strength.abilities.kv. See the abilities.kv reference for the full list of brackets.Add to bans.kv if needed
If your ability creates a problematic or unplayable combination with another ability, add a ban entry to
src/game/scripts/kv/bans.kv.Most combination bans are now handled with ReduxBans flags directly in the ability’s KV data in npc_abilities_custom.txt, which is the preferred approach. The bans.kv file is used for special cases: group bans (where three or more abilities together are banned), or combinations that cannot be expressed as simple pairwise flags.See the bans.kv reference for the format.Register modifiers in pregame.lua
If your ability defines one or more Lua modifiers with This ensures
LinkLuaModifier, you must also require the ability file in pregame.lua so the modifiers are available during the pregame phase.In src/game/scripts/vscripts/pregame.lua, add a require call alongside the existing ability requires:pregame.lua
LinkLuaModifier runs at startup and the engine can instantiate your modifier class.
