# For Each Ability On Unit

Grammar — For each abil in unit do (Actions)
FlagsSubFunctions | Action

Runs the contained actions once for each ability on the specified unit.

# Arguments

  • anyvariable — Ability
  • unit — Unit

Returns — void

#AUTOVAR(unit, unit) = #PARAM(unit);
#AUTOVAR(i) = 1;
for ( ; #AUTOVAR(i) <= UnitAbilityCount(#AUTOVAR(unit)) ; #AUTOVAR(i) += 1 ) {
    #PARAM(abil) = UnitAbilityGet(#AUTOVAR(unit), #AUTOVAR(i));
    #SUBFUNCS(actions)
}

Category: Ability / Loops

# Examples

— None found —