# Current Level For Unit Ability
Grammar — Current level for ability ability on unit
Flags —Native
|Function
Returns the current level of the specified ability on the specified unit.
# Arguments
unit
— Unitstring
<gamelink::Abil> — Ability
Returns — int
native int UnitAbilityGetLevel(unit inUnit, string inAbil);
# Related
Category: Ability / Basic
- Remove Ability —
void
— UnitAbilityRemove - Add Ability —
void
— UnitAbilityAdd - Unit Uses Ability —
void
— TriggerAddEventUnitAbility - Unit Changes Ability Auto Cast State —
void
— TriggerAddEventUnitAbilityAutoCastChange - Triggering Ability —
abilcmd
— EventUnitAbility - Triggering Ability Stage —
int
<preset::AbilityStage> — EventUnitAbilityStage - Triggering Ability Target Point —
point
— EventUnitTargetPoint - Triggering Ability Target Unit —
unit
— EventUnitTargetUnit - Triggering Ability Other Unit —
unit
— EventUnitAbilityOtherUnit - Ability From Item or Trigger —
abilcmd
— libNtve_gf_EventItemAbilityOrUnitAbility - Unit Is Created —
void
— TriggerAddEventUnitCreated - Created Unit —
unit
— EventUnitCreatedUnit - Behavior That Created Unit —
string
<gamelink::Behavior> — EventUnitCreatedBehavior - Ability That Created Unit —
string
<gamelink::Abil> — EventUnitCreatedAbil - Show/Hide Ability For Unit —
void
— UnitAbilityShow - Ability Enabled For Unit —
bool
— UnitAbilityCheck - Number Of Abilities On Unit —
int
— UnitAbilityCount - Unit Ability —
string
<gamelink::Abil> — UnitAbilityGet - Unit Ability By Class —
string
<gamelink::Abil> — libNtve_gf_UnitAbilityGetByType - Unit Ability Command State —
bool
— UnitCheckAbilCmdState - Unit Ability Order State (Flags) —
int
— UnitAbilOrderStateFlags - Unit Has Ability —
bool
— UnitAbilityExists - Enable/Disable Ability For Unit —
void
— UnitAbilityEnable - Add Level To Unit Ability —
void
— UnitAbilityChangeLevel - Replace Unit Ability —
void
— UnitAbilityChangeLink - Set Ability Default Submenu —
void
— UnitAbilityChangeCardId - Current Level For Unit Ability —
int
— UnitAbilityGetLevel - Maximum Level For Unit Ability —
int
— UnitAbilityMaxLevel - Ability Matches Filters —
bool
— libNtve_gf_AbilityMatchesFilters - Unit Ability By Filters —
string
<gamelink::Abil> — libNtve_gf_UnitAbilityByFilters - Unit Ability Default Submenu —
string
— UnitAbilityGetCardId
# Examples
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:16950
}
if (!((UnitAbilityGetLevel(EventUnit(), libNtve_gf_TriggeringProgressAbility()) == 1))) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:17000
}
if (!((UnitAbilityGetLevel(EventUnit(), "DehakaConsume") == 2))) {
return false;
}
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:476
string entryFS=c_AB_FarSight;
bool hold=c_castHold;
int levelCL=UnitAbilityGetLevel(aiUnit,entryCL);
if(!UnitIsAlive(aiUnit)){
return;
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:544
string entrySW=c_AB_SerpentWard;
bool hold=c_castHold;
int LevelHW=UnitAbilityGetLevel(aiUnit,entryHW);
//int LevelWS=UnitAbilityGetLevel(aiUnit,entryWS);
if(!UnitIsAlive(aiUnit)){
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicTactical.galaxy:491
}
lv_level = UnitAbilityGetLevel(lp_aIUnit, lp_abil);
lv_ug = UnitGroupSearch(null, lp_owner, UnitGetPosition(lp_aIUnit), libGAwT_gf_AIEffectAbilSearchRadius(lp_owner, lp_aIUnit, lp_abil, lv_level, true), libGAwT_gf_AIEffectAbilSearchUnitFilter(lp_owner, lp_aIUnit, lp_abil, lv_level), 0);
lv_ug = UnitGroupFilter(null, c_playerAny, lv_ug, UnitFilter(0, 0, (1 << c_targetFilterWorker), 0), 0);
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicTactical.galaxy:549
}
lv_level = UnitAbilityGetLevel(lp_aIUnit, lp_abil);
lv_range = libGAwT_gf_AIEffectAbilRange(lp_owner, lp_aIUnit, lp_abil, lv_level, true);
lv_heal = libGAwT_gf_AIAbilAccumlatedAmount(lp_owner, lp_aIUnit, lp_abil, lv_level, "Heal");