Your browser does not support HTML5 canvas. Fork me on GitHub

Available Packages:

DummyCaster

Source

class DummyCaster

Source

Dummy casters are commonly used in custom spells to cast abilities dynamically onto targets or points. For example hexing all units in an AoE, or impaling in multiple directions. If your spell's effect is entirely instant, you should use `InstantDummyCaster`. For many spells however, InstantDummyCaster is not feasible, because they - are of type impale or channel - attach effects to the caster, like chain lightning - deal delayed damage (fireball, shockwave) In all of these scenarios the unit has to stand in a place and the spell's effects are not instant. DummyCaster uses one dummy per cast, and only removes it after a set delay, to allow effects and damage to process Example with long delay for blizzard: new DummyCaster(casterPos) ..owner(caster) ..delay(15) ..castPoint('A000', 1, OrderIds.OrderIds.blizzard, target) The dummy caster will be recycled automatically, after the last spell's `delay` duration has expired. You shouldn't destroy the object yourself. Just cast any amount of spells at once or shortly after and leave it. Allocate DummyCasters dynamically on the spot and don't save them.

real delay

Source

vec2 origin

Source

unknown type owner

Source

function castImmediate(int abilityId, int lvl, int orderId) returns unit

Source

Returns the casting dummy unit if the cast order was successful, or null if cast failed.

function castPoint(int abilityId, int lvl, int orderId, vec2 targetPos) returns unit

Source

Returns the casting dummy unit if the cast order was successful, or null if cast failed.

function castTarget(int abilityId, int lvl, int orderId, widget target) returns unit

Source

Returns the casting dummy unit if the cast order was successful, or null if cast failed.

function delay(real delay)

Source

Delay after which the dummy is recycled. Increase this if your spell is longer. Default 5 seconds.

function finish(unit dummy, int id)

Source

function origin(vec2 pos)

Source

function owner(player owner)

Source

Sets the owner of the dummy

function prepare(int id, int lvl) returns unit

Source

function recycleDummy(unit dummy, int id)

Source