# Unit Ability

Grammarunit ability index
FlagsNative | Function

Returns the ability in the specified unit’s ability array at the specified index.

# Arguments

  • unit — Unit
  • int — Index

Returns — string<gamelink::Abil>

native string UnitAbilityGet(unit inUnit, int inIndex);

Category: Ability / Basic

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:164

    auto5A8FAC35_i = 1;
    for ( ; auto5A8FAC35_i <= UnitAbilityCount(auto5A8FAC35_unit) ; auto5A8FAC35_i += 1 ) {
        lv_abil = UnitAbilityGet(auto5A8FAC35_unit, auto5A8FAC35_i);
        if ((AbilityClass(lv_abil) == lp_abilityClass)) {
            lv_classIndex += 1;

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:238

    auto981DBC05_i = 1;
    for ( ; auto981DBC05_i <= UnitAbilityCount(auto981DBC05_unit) ; auto981DBC05_i += 1 ) {
        lv_itAbil = UnitAbilityGet(auto981DBC05_unit, auto981DBC05_i);
        if ((libNtve_gf_AbilityMatchesFilters(lv_itAbil, lv_player, lp_abilityClass, lp_alias) == true)) {
            return lv_itAbil;

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:8107

        lv_itAbility = 1;
        for ( ; ( (auto342EB673_ai >= 0 && lv_itAbility <= auto342EB673_ae) || (auto342EB673_ai < 0 && lv_itAbility >= auto342EB673_ae) ) ; lv_itAbility += auto342EB673_ai ) {
            lv_abilLink = UnitAbilityGet(lv_itUnit, lv_itAbility);
            if ((libGame_gf_HeroAbilityCooldownCanBeReset(lv_heroIndex, lv_abilLink) == true)) {
                lv_cooldownLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Cooldown.Link", UnitGetOwner(lv_itUnit));

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:8127

            lv_itAbility = 1;
            for ( ; ( (autoBC2476EA_ai >= 0 && lv_itAbility <= autoBC2476EA_ae) || (autoBC2476EA_ai < 0 && lv_itAbility >= autoBC2476EA_ae) ) ; lv_itAbility += autoBC2476EA_ai ) {
                lv_abilLink = UnitAbilityGet(lv_vehicleUnit, lv_itAbility);
                lv_cooldownLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Cooldown.Link", lp_player);
                libNtve_gf_UnitRemoveCooldown(lv_vehicleUnit, lv_cooldownLink);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SupportLib.galaxy:1648

    lv_itAbility = 1;
    for ( ; ( (auto8A789BA6_ai >= 0 && lv_itAbility <= auto8A789BA6_ae) || (auto8A789BA6_ai < 0 && lv_itAbility >= auto8A789BA6_ae) ) ; lv_itAbility += auto8A789BA6_ai ) {
        lv_abilLink = UnitAbilityGet(lp_unit, lv_itAbility);
        if ((lv_abilLink != "") && (lv_abilLink != null) && ((AbilityClass(lv_abilLink) == c_classIdCAbilAugment) || (AbilityClass(lv_abilLink) == c_classIdCAbilBehavior) || (AbilityClass(lv_abilLink) == c_classIdCAbilEffectInstant) || (AbilityClass(lv_abilLink) == c_classIdCAbilEffectTarget) || (AbilityClass(lv_abilLink) == c_classIdCAbilMorph))) {
            lv_cooldownLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Cooldown.Link", lv_ownerofUnit);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:13307

            lv_abilityIndex = 1;
            for ( ; ( (autoD8196C4C_ai >= 0 && lv_abilityIndex <= autoD8196C4C_ae) || (autoD8196C4C_ai < 0 && lv_abilityIndex >= autoD8196C4C_ae) ) ; lv_abilityIndex += autoD8196C4C_ai ) {
                lv_structureAbility = UnitAbilityGet(lv_indexStructure, lv_abilityIndex);
                if ((UnitAbilityCheck(lv_indexStructure, lv_structureAbility, true) == false)) {
                    continue;

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicTactical.galaxy:634

    autoEE073BD6_i = 1;
    for ( ; autoEE073BD6_i <= UnitAbilityCount(autoEE073BD6_unit) ; autoEE073BD6_i += 1 ) {
        lv_itAbilLink = UnitAbilityGet(autoEE073BD6_unit, autoEE073BD6_i);
        if ((AbilityClass(lv_itAbilLink) == c_classIdCAbilInventory)) {
            lv_inventoryLink = lv_itAbilLink;