# Current Level For Unit Ability

Grammar — Current level for ability ability on unit
FlagsNative | Function

Returns the current level of the specified ability on the specified unit.

# Arguments

  • unit — Unit
  • string<gamelink::Abil> — Ability

Returns — int

native int UnitAbilityGetLevel(unit inUnit, string inAbil);

Category: Ability / Basic

# Examples

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:16950

        }

        if (!((UnitAbilityGetLevel(EventUnit(), libNtve_gf_TriggeringProgressAbility()) == 1))) {
            return false;
        }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:17000

        }

        if (!((UnitAbilityGetLevel(EventUnit(), "DehakaConsume") == 2))) {
            return false;
        }

mods/warcoop/warclassicsystem.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.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");