Skip to main content
Dota 2 defines abilities in KV files that follow the DOTAAbilities schema. Legends of Dota Redux uses two files to extend and override the base game’s ability data: Both files live at scripts/npc/ inside the addon directory.

npc_abilities_custom.txt

This file does not contain ability blocks directly. Instead, it is entirely composed of #base directives that include individual ability files:
Each #base-included file contains one or more ability definitions under the root DOTAAbilities block. This structure keeps individual abilities self-contained and easy to locate.

npc_abilities_override.txt

Similarly, npc_abilities_override.txt uses #base directives to include per-hero override files:
Each hero override file patches specific fields on existing Dota 2 abilities without redefining the whole block.

KV Ability Block Format

Every ability block lives inside a DOTAAbilities root key:

Common Fields

AbilityBehavior Flags

Multiple flags are combined with a space-separated list:

Real Example: ranged_punch

The following is the full definition for ranged_punch, a custom Lua ability:
The ScriptFile path points to a Lua file at scripts/vscripts/abilities/ranged_punch.lua. That file defines a class that extends BaseAbility (or a Redux base class) and implements the ability logic:
The KV AbilityValues sub-block is what GetSpecialValueFor("punch_damage") reads. Scepter/Shard upgrades, talent bonuses, and AoE increase flags are all handled through this values block.

Adding a New Custom Ability

  1. Create a new .txt file under scripts/npc/abilities/custom/my_ability.txt with the DOTAAbilities block.
  2. Add a #base line to npc_abilities_custom.txt:
  3. Create the corresponding Lua script at scripts/vscripts/abilities/my_ability.lua.
  4. Add the ability name to abilities.kv in the appropriate bracket.
  5. Restart the server to pick up the new files.