AddSpellEffectTargetById

Parameters
abilityId integer
t effecttype
targetWidget widget
attachPoint string
comment

Attaches the special effect to the attachment point attachPointName of the target widget, using the model file from the Object Editor field of type t from the ability, unit or buff (works with all these types, though the name states it's ability-only function) with raw code abilityId. If this field has more than one effect inside, it will only create the first effect stated in the field, ignoring all others.

Example (Lua):

Attach an effect based on unit's attack missile model ('hsor' is human Sorceress) to the head of the Blood Mage hero. A fire bird (SD) will follow him around:

bloodmage = CreateUnit(Player(0), FourCC("Hblm"), 0,0, 0)
birdEffect = AddSpellEffectTargetById(FourCC("hsor"), EFFECT_TYPE_MISSILE, bloodmage, "head")
BlzSetSpecialEffectScale(birdEffect, 3)
patch

1.00

Source
common.j
return type
effect
Source code
native AddSpellEffectTargetById     takes integer abilityId, effecttype t, widget targetWidget, string attachPoint returns effect