-
Notifications
You must be signed in to change notification settings - Fork 82
NPC Combat Scripts
Greg edited this page Jan 11, 2026
·
4 revisions
As of Void 2.5.0 npc combat scripts are primarily done using .combat.toml config files which follow the following format:
# Header
[combat_id]
attack_speed = 4 # Number of ticks between attacks
retreat_range = 8 # Range from spawn tile npc can retreat within see: https://oldschool.runescape.wiki/w/Retreat
defend_anim = "defend_anim_id" # Animation when hit by an enemy
defend_sound = "defend_sound_id" # Sound played to enemy when hit
death_anim = "death_anim_id" # Animation played when killed
death_sound = "death_sound_id" # Sound played when killed
# Attack types
[combat_id.attack_name]
# Selection
chance = 1 # Weight given to this attack when selecting between multiple attack styles (default 1)
range = 1 # Tiles from target when this attack can be used
approach = false # Whether melee attack has to be within range to use or the npc should move closer
condition = "custom_name" # Custom conditions for using this attack (see: npcCondition)
# Execution
say = "Urg!" # Force the npc to say something when attacking
anim = "attack_anim_id" # Attack animation id
gfx = "attack_gfx_id" # Attack graphics id
sound = "attack_sound_id" # Attack sound id (typically only for area sounds)
projectile_origin = "tile" # Where the projectile should start (entity, tile, centre)
projectile = "projectile_gfx_id" # Projectile gfx to shoot at target
## Target
target_anim = "anim_id" # Animation for the target to play (typically blank as defend anims handled separately)
target_gfx = "gfx_id" # Graphic to play on the target
target_sound = "attack_sound_id" # Sound to play the target (usually used over "sound")
target_hit = { offense = "slash", max = 10 } # Damage roll applied to target
multi_target_area = "boss_dungeon" # Area to select multi-targets from (single target if blank)
## On Impact
impact_anim = "anim_id" # TODO
impact_gfx = "gfx_id" #
impact_sound = "sound_id" #
miss_gfx = "gfx_id" #
miss_sound = "sound_id" #
impact_regardless = false #
impact_drain { id = "skill", amount = 1 } #
impact_freeze = 10 #
impact_poison = 10 #
impact_message = "You have been frozen!" #See CombatDefinition for more detailed documentation.
[npc_id]
combat_def = "combat_id"
max_hit_crush = 100 # Max hit's can be overriddenHits, drains, sounds, gfxs, projectiles
sound = { id = "", radius = 5 }gfx = { id = "", area = true }hits = []