swordsEditing Abilities

Adding an Ability

Open: hoff-battlebuddies/shared/open/sh_abilities.lua

Find: Abilities.DB

Add your new ability at the bottom.

Example (Scratch):

scratch = {
	Name = "Scratch",
	Type = "Critter",
	Cooldown = 0,
	Accuracy = 1.0,
	Engage = "Melee",
	Knockback = -10.0,
	Icon = "ability/scratch.png",
	VFX = "GENERIC_BLOOD",
	Effects = {
		{
			On = "Resolve",
			Type = FEffectType.Damage,
			Base = 20.0,
			Increment = 13.0,
			Shake = 0.005
		}
	},
},

Ability Keys

Name Display name (overridden by localization).

Type One of: Aquatic, Beast, Critter, Dragonkin, Elemental, Flying, Humanoid, Magic, Mechanical, Undead

Cooldown Turns until the ability is usable again. 0 = no cooldown.

Accuracy Hit chance from 0.0 to 1.0.

Engage How the “attack animation” is handled:

  • "Melee" = standard melee attack

  • "Ranged" = standard ranged attack

  • "Swarm" = rows of pet peds charge into the enemy like ocean waves

  • function(CasterPed, TargetPed, Event) ... end = full scripted control (see below)

Knockback (optional) Push/pull applied during impact (if the ability uses it).

Icon Relative to: hoff-battlebuddies/ui/assets/images/ Example: "ability/scratch.png"

VFX (optional) A VFX token string (covered in the VFX section).

Effects List of effect blocks (damage, heal, apply aura, swap, multi-hit, etc).


Effects Basics (On / Base / Increment)

On timing

  • Cast = triggers immediately when the ability is chosen

  • Resolve = triggers after the Engage finishes

  • Kill = triggers only if the ability finishes the target

Example:

Base + Increment (damage / heal scaling)

For FEffectType.Damage and FEffectType.Heal:

Final Amount = Base + (Increment * PetLevel)

Example: Base 10, Increment 5, Level 510 + (5 * 5) = 35


Custom Engage Functions

If you want a scripted “mini cutscene” instead of a normal engage type, you can replace Engage with a function.

Example (prop + anim + particles):


Useful BattleEffects Helpers (Engage)

These are the most useful helpers when you’re building custom engages.

Sounds

Particle FX

Examples:

Freeze / collision

Props

Example:

Movement / attacks / anims

Impact

Examples:


Any custom engage that deals damage should include this somewhere near the end:


Adding an Aura

Auras are defined in the same file.

Open: hoff-battlebuddies/shared/open/sh_abilities.lua

Find: Abilities.Auras

Add your aura entry near the bottom.

Example (Poisoned):

Applying an aura from an ability


Creating VFX Types

VFX are optional, but make abilities way more satisfying.

VFX tokens live in:

Abilities.FX (same file)


VFX In Abilities

Add a token to your ability:


VFX In Auras

Auras can use a single token:

Or a table (so Apply / Change / Expire can differ):


VFX Token Formats

Most VFX tokens are either:

1) Simple particle entry

2) Custom event entry (full control)


Finding particle dictionaries / names

This free dev tool makes particle lookup way easier: https://forum.cfx.re/t/free-particle-viewer-dev-tool/5042066arrow-up-right


Ability Effect Types

Damage / Healing

FEffectType.Damage

Flat damage using Base + (Increment * PetLevel).

FEffectType.Heal

Flat healing using Base + (Increment * PetLevel).

FEffectType.HealPercent

Heals a percent of max HP (commonly used on Kill effects).

FEffectType.HealPercentDealt

“Lifesteal” style healing based on damage dealt. Param = { healPercent, accuracyPercent }


Percent / Conditional Damage

FEffectType.DamagePercent

Deals a percent of the target’s max HP. Param = { percent } (10 = 10%)

FEffectType.DamagePercentTaken

Deals damage based on the last hit taken. Param = { percentOfLastHitTaken, accuracyPercent }

FEffectType.RampingDamage

Damage that ramps up over repeated uses (with a cap). Param = { base, accuracyPercent, rampPerUse, max }


Auras

FEffectType.PositiveAura

Applies a buff aura by key.

FEffectType.NegativeAura

Applies a debuff aura by key.


Multi-Action Effects

FEffectType.MultiHit

Runs the nested Each effect multiple times (random hit count).

FEffectType.Channel

Repeats the nested Each effect across multiple rounds.


Battle Utility

FEffectType.Catch

Capture logic for wild pets. Param = { baseChancePercent, bonusPerFailedAttemptPercent }

FEffectType.SwapHigh

Forces the enemy to swap to their highest-health pet. Param = { chancePercent }

FEffectType.ExtraAttackIfMoreFaster

Triggers an extra hit if the caster is faster. Param = { baseDamage, accuracyPercent } (plus optional Increment scaling)

FEffectType.Dummy

No-op effect (used for “Pass” / placeholders).


Last updated