Skip to content

Summons and ground objects ​

Units an ability brings into the world: summons that fight beside you, wards, traps, walls, barrels, portals, and units you cast from (a shadow, a ball).

Quick start ​

ts
import type { AbilityDef, UnitTypeDef } from '@v12-engine/engine'

export const waterElemental: UnitTypeDef = {
	id: 'waterElemental',
	name: 'Water Elemental',
	kind: 'unit',
	radius: 0.5,
	stats: { health: 525, attackDamage: 20, attackSpeed: 1, attackRange: 3, moveSpeed: 3 },
	sight: 8,
	attacks: [{ damagePoint: 0.3, acquisitionRange: 6, projectileSpeed: 10 }]
}

export const summonWaterElemental: AbilityDef = {
	id: 'summonWaterElemental',
	name: 'Summon Water Elemental',
	target: 'none',
	manaCost: 125,
	cooldown: 20,
	effects: [{ type: 'summon', unit: 'waterElemental', lifetime: 60 }]
}

An elemental appears beside the caster for 60 seconds. It follows its master, attacks whoever attacks the master, and dies with it.

Common tasks ​

Summon a pack that fights the nearest enemy ​

ts
import type { EffectDef } from '@v12-engine/engine'

const voidSwarm: EffectDef = { type: 'summon', unit: 'voidling', count: 4, lifetime: 8, spread: 1.5, aggro: 'nearest' }

follow: false leaves them where they appear. diesWithMaster: false keeps them after the master dies. The hero panel lists a hero's live summons with their time left.

Put down a ward ​

spawn puts a unit of the caster's at the spot. Give its type a lifetime, invisible and uses:

ts
import type { AbilityDef, UnitTypeDef } from '@v12-engine/engine'

const sentryWard: UnitTypeDef = {
	id: 'sentryWard',
	name: 'Sentry Ward',
	kind: 'unit',
	radius: 0.3,
	stats: { health: 1 },
	sight: 10,
	lifetime: 180,
	invisible: { after: 1 },
	uses: 2 // goes down after two hits, whatever they deal
}
const placeWard: AbilityDef = { id: 'placeWard', name: 'Sentry Ward', target: 'point', range: 5, effects: [{ type: 'spawn', unit: 'sentryWard' }] }

Raise the dead ​

ts
import type { EffectDef } from '@v12-engine/engine'

const raiseDead: EffectDef = { type: 'raiseDead', unit: 'skeleton', count: 2, duration: 40 }
// Animate Dead: anyone's dead, as what they were
const animateDead: EffectDef = { type: 'raiseDead', as: 'themselves', count: 6, duration: 40 }
// Resurrection: your side's dead, back as they were, for good
const resurrection: EffectDef = { type: 'revive', count: 6, radius: 9 }

Make illusions ​

ts
import type { EffectDef } from '@v12-engine/engine'

const mirrorImage: EffectDef = { type: 'illusion', count: 2, duration: 30, dealt: 0.33, taken: 2, on: 'caster' }

Lay a trap ​

Ground objects need groundObjectsPack() in Rules.packs. A trigger on a unit type sets off an ability when an enemy comes near. Teemo's Noxious Trap:

ts
import { type AbilityDef, groundObjectsPack, type UnitTypeDef } from '@v12-engine/engine'

const shroom: UnitTypeDef = {
	id: 'shroom',
	name: 'Noxious Trap',
	kind: 'unit',
	radius: 0.3,
	stats: { health: 1 },
	sight: 2,
	invisible: { after: 1 },
	trigger: { ability: 'shroomBurst', radius: 0.8, arm: 1 }
}
const noxiousTrap: AbilityDef = { id: 'noxiousTrap', name: 'Noxious Trap', target: 'point', range: 9, effects: [{ type: 'spawn', unit: 'shroom' }] }
const shroomBurst: AbilityDef = { id: 'shroomBurst', name: 'Shroom', target: 'none', effects: [{ type: 'damage', amount: 100, radius: 2 }] }
const rules = { /* … */ packs: [groundObjectsPack()] }

Raise a wall ​

line lays several along the aim; across: true turns the line a quarter so it stands in front. Anivia's Crystallize:

ts
import type { AbilityDef } from '@v12-engine/engine'

const crystallize: AbilityDef = {
	id: 'crystallize',
	name: 'Crystallize',
	target: 'point',
	range: 10,
	effects: [{ type: 'spawn', unit: 'iceWall', duration: 5, line: { count: 5, length: 4, across: true } }]
}

ring: { count, radius } lays them round a circle (Jarvan's Cataclysm).

Block missiles with a wall ​

blocksMissiles on the type eats enemy missiles that meet it. Yasuo's Wind Wall is a line of these:

ts
import type { UnitTypeDef } from '@v12-engine/engine'

const windWallPiece: UnitTypeDef = {
	id: 'windWallPiece',
	name: 'Wind Wall',
	kind: 'unit',
	radius: 0.6,
	stats: { health: 1 },
	sight: 2,
	invulnerable: true,
	lifetime: 4,
	blocksMissiles: 'enemies'
}

Something allies click to use ​

use makes allies walk up to it and use it on right-click: the ability goes off in its maker's name. Thresh's lantern, a portal pair:

ts
import type { UnitTypeDef } from '@v12-engine/engine'

const lantern: UnitTypeDef = {
	id: 'lantern',
	name: 'Dark Passage',
	kind: 'unit',
	radius: 0.3,
	stats: { health: 1 },
	sight: 3,
	lifetime: 6,
	use: { ability: 'lanternPull', range: 1.5, times: 1 }
}

Barrels that chain explode ​

burst sets off an ability where it dies, and kills others of its type within chain, which burst in turn. Gangplank's Powder Keg (see the cookbook).

Cast from a unit you own ​

origin makes an effect go off from units of the caster's (a shadow, a ball, soldiers) while the caster still owns the damage. Zed's Razor Shuriken flies from him and each shadow:

ts
import type { AbilityDef } from '@v12-engine/engine'

const razorShuriken: AbilityDef = {
	id: 'razorShuriken',
	name: 'Razor Shuriken',
	target: 'point',
	range: 9,
	effects: [{ type: 'missile', speed: 17, distance: 9, pierce: true, origin: { proxy: 'shadow', pick: 'all', caster: true }, effects: [{ type: 'damage', amount: 80 }] }]
}

Send the proxy somewhere ​

sendProxy moves the unit an effect goes off from to where it was aimed. Orianna's ball, thrown from wherever it is (from her if she has none):

ts
import type { AbilityDef } from '@v12-engine/engine'

const commandAttack: AbilityDef = {
	id: 'commandAttack',
	name: 'Command: Attack',
	target: 'point',
	range: 8,
	effects: [
		{ type: 'missile', speed: 12, toPoint: true, pierce: true, origin: { proxy: 'ball', caster: 'otherwise' }, effects: [{ type: 'damage', amount: 60 }] },
		{ type: 'sendProxy', speed: 12, origin: { proxy: 'ball' } }
	]
}
// Azir's soldiers strike as he attacks: an onHit whose effects go off from them
const sandSoldiers: AbilityDef = {
	id: 'sandSoldiers',
	name: 'Sand Soldiers',
	target: 'passive',
	effects: [{ type: 'onHit', effects: [{ type: 'damage', amount: 25, shape: 'line', length: 4, origin: { proxy: 'soldier', pick: 'all', near: 3.5 } }] }]
}

Reference ​

summon ​

FieldTypeDefaultWhat it does
unitstringUnit type
countScaled1How many
lifetimeScaledfor goodSeconds they stay
spreadnumber1.5Cells around where it landed
followbooleantrueWalks with its master when it has nothing to do
aggronearest, mastersAttacker, nonemastersAttackerWho it goes for
diesWithMasterbooleantrueDies when the master dies

spawn, raiseDead, revive, illusion ​

EffectFieldsWhat it does
spawnunit, duration, owner: 'neutral', looksLike, data, line, ringPuts a unit of the caster's at the spot
raiseDeadunit, count, duration, as: 'themselves'Raises corpses around the spot
revivecount (all), radius (6)Your side's dead come back as they were
illusioncount, duration, dealt (1/3), taken (2)Copies of the target

Unit type fields for placed things ​

FieldWhat it does
lifetimeGone by itself after so many seconds
invisible: { after }Enemies can't see it after so many seconds, unless they detect it
usesGoes down after so many attacks or spells, whatever they deal
trigger: { ability, radius, by, arm, times } (pack)Goes off as one it is by (enemies, allies, all, maker) comes within radius; armed after arm seconds; gone after times (1; 0 for ever)
use: { ability, by, range, times } (pack)Allies (by default) right-click to walk up and use it; the point is the next one laid with it (a portal's other end)
blocksMissiles: 'enemies' | 'all' (pack)Missiles that meet it are gone; thrown ones fly over
burst: { ability, chain } (pack)Where it dies the ability goes off; its kind within chain die and burst too
targetableByOnly these abilities may target it

origin (ProxyOrigin) ​

FieldWhat it says
proxyThe unit type of the caster's it goes off from
picknearest to where it was aimed (default), all, newest, oldest
castertrue: from the caster as well. 'otherwise': from the caster when none is picked
range, nearOnly those within this far of the caster, or of where it was aimed
at: 'proxy'Lands where each proxy stands, not where it was aimed
targetThe proxy is the effect's target too (Zed's swap)

The caster's proxies are those of the type it put down (madeBy), or of one nobody put down, those of its owner.

In code ​

summonsOf(world, master) lists living summons (each with a summoned component: by, follow, aggro, diesWithMaster, at). useObject(world, user, object) uses a ground object. proxiesOf(context, origin) says which units an origin picks. A ground object's state is the groundObject component; who made it is madeBy. Both saved.

Notes ​

  • With aggro: 'mastersAttacker', the master being hurt sends every summon at the attacker at once (unless its player gave it an order), and the attacker scores FOE_BONUS in targetScore for 6 seconds.
  • GameView.hud.summons: false hides the summons on the hero panel.
  • raiseDead units are summons too, and outlive whoever raised them.
  • A building laid by line takes a cell, one to a cell.