# Class Of Ability

Grammar — Class of ability
FlagsNative | Function

Returns the ability type of an ability. This is the non raw data version of an ability’s scope. Use catalog lookup functions to retrieve a data value or other information from the game data.

# Arguments

  • string<gamelink::Abil> — Ability

Returns — int<preset::AbilityClass>

native int AbilityClass(string ability);

Category: Catalog / Lookup

# Examples

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

    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:193


    // Implementation
    if ((AbilityClass(lp_ability) != c_classIdCAbil)) {
        if ((AbilityClass(lp_ability) != lp_abilityClass)) {
            return false;

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

    // Implementation
    if ((AbilityClass(lp_ability) != c_classIdCAbil)) {
        if ((AbilityClass(lp_ability) != lp_abilityClass)) {
            return false;
        }

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


    // Implementation
    if ((AbilityClass(lp_abilityLink) != c_classIdCAbilEffect) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectInstant) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectTarget) && (AbilityClass(lp_abilityLink) != c_classIdCAbilAugment) && (AbilityClass(lp_abilityLink) != c_classIdCAbilBehavior) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorph) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorphPlacement)) {
        return false;
    }

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


    // Implementation
    if ((AbilityClass(lp_abilityLink) != c_classIdCAbilEffect) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectInstant) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectTarget) && (AbilityClass(lp_abilityLink) != c_classIdCAbilAugment) && (AbilityClass(lp_abilityLink) != c_classIdCAbilBehavior) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorph) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorphPlacement)) {
        return false;
    }

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


    // Implementation
    if ((AbilityClass(lp_abilityLink) != c_classIdCAbilEffect) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectInstant) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectTarget) && (AbilityClass(lp_abilityLink) != c_classIdCAbilAugment) && (AbilityClass(lp_abilityLink) != c_classIdCAbilBehavior) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorph) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorphPlacement)) {
        return false;
    }

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


    // Implementation
    if ((AbilityClass(lp_abilityLink) != c_classIdCAbilEffect) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectInstant) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectTarget) && (AbilityClass(lp_abilityLink) != c_classIdCAbilAugment) && (AbilityClass(lp_abilityLink) != c_classIdCAbilBehavior) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorph) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorphPlacement)) {
        return false;
    }

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


    // Implementation
    if ((AbilityClass(lp_abilityLink) != c_classIdCAbilEffect) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectInstant) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectTarget) && (AbilityClass(lp_abilityLink) != c_classIdCAbilAugment) && (AbilityClass(lp_abilityLink) != c_classIdCAbilBehavior) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorph) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorphPlacement)) {
        return false;
    }

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


    // Implementation
    if ((AbilityClass(lp_abilityLink) != c_classIdCAbilEffect) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectInstant) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectTarget) && (AbilityClass(lp_abilityLink) != c_classIdCAbilAugment) && (AbilityClass(lp_abilityLink) != c_classIdCAbilBehavior) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorph) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorphPlacement)) {
        return false;
    }

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


    // Implementation
    if ((AbilityClass(lp_abilityLink) != c_classIdCAbilEffect) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectInstant) && (AbilityClass(lp_abilityLink) != c_classIdCAbilEffectTarget) && (AbilityClass(lp_abilityLink) != c_classIdCAbilAugment) && (AbilityClass(lp_abilityLink) != c_classIdCAbilBehavior) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorph) && (AbilityClass(lp_abilityLink) != c_classIdCAbilMorphPlacement)) {
        return false;
    }

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

    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);
            libNtve_gf_UnitRemoveCooldown(lp_unit, lv_cooldownLink);

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

    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);
            libNtve_gf_UnitRemoveCooldown(lp_unit, lv_cooldownLink);

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

    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);
            libNtve_gf_UnitRemoveCooldown(lp_unit, lv_cooldownLink);

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

    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);
            libNtve_gf_UnitRemoveCooldown(lp_unit, lv_cooldownLink);

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

    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);
            libNtve_gf_UnitRemoveCooldown(lp_unit, lv_cooldownLink);

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

        lv_ability = CatalogEntryGet(c_gameCatalogAbil, auto0FE65364_ai);
        auto0FE65364_ai = auto0FE65364_ai + 1;
        if ((AbilityClass(lv_ability) == c_classIdCAbilResearch)) {
            lv_i = 0;
            for ( ; ( (auto6642A659_ai >= 0 && lv_i <= auto6642A659_ae) || (auto6642A659_ai < 0 && lv_i >= auto6642A659_ae) ) ; lv_i += auto6642A659_ai ) {

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

    }
    else if (true) {
        if ((UnitTypeTestAttribute(UnitGetType(lp_orderedUnit), c_unitAttributeStructure) == true) && (AbilityClass(lv_abil) != c_classIdCAbilAttack) && (AbilityClass(lv_abil) != c_classIdCAbilMove) && (AbilityClass(lv_abil) != c_classIdCAbilStop) && (AbilityClass(lv_abil) != c_classIdCAbilTransport) && (AbilityClass(lv_abil) != c_classIdCAbilMorph) && (AbilityClass(lv_abil) != c_classIdCAbilMorphPlacement)) {
        }
        else {

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

    }
    else if (true) {
        if ((UnitTypeTestAttribute(UnitGetType(lp_orderedUnit), c_unitAttributeStructure) == true) && (AbilityClass(lv_abil) != c_classIdCAbilAttack) && (AbilityClass(lv_abil) != c_classIdCAbilMove) && (AbilityClass(lv_abil) != c_classIdCAbilStop) && (AbilityClass(lv_abil) != c_classIdCAbilTransport) && (AbilityClass(lv_abil) != c_classIdCAbilMorph) && (AbilityClass(lv_abil) != c_classIdCAbilMorphPlacement)) {
        }
        else {

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

    }
    else if (true) {
        if ((UnitTypeTestAttribute(UnitGetType(lp_orderedUnit), c_unitAttributeStructure) == true) && (AbilityClass(lv_abil) != c_classIdCAbilAttack) && (AbilityClass(lv_abil) != c_classIdCAbilMove) && (AbilityClass(lv_abil) != c_classIdCAbilStop) && (AbilityClass(lv_abil) != c_classIdCAbilTransport) && (AbilityClass(lv_abil) != c_classIdCAbilMorph) && (AbilityClass(lv_abil) != c_classIdCAbilMorphPlacement)) {
        }
        else {

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

    }
    else if (true) {
        if ((UnitTypeTestAttribute(UnitGetType(lp_orderedUnit), c_unitAttributeStructure) == true) && (AbilityClass(lv_abil) != c_classIdCAbilAttack) && (AbilityClass(lv_abil) != c_classIdCAbilMove) && (AbilityClass(lv_abil) != c_classIdCAbilStop) && (AbilityClass(lv_abil) != c_classIdCAbilTransport) && (AbilityClass(lv_abil) != c_classIdCAbilMorph) && (AbilityClass(lv_abil) != c_classIdCAbilMorphPlacement)) {
        }
        else {

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

    }
    else if (true) {
        if ((UnitTypeTestAttribute(UnitGetType(lp_orderedUnit), c_unitAttributeStructure) == true) && (AbilityClass(lv_abil) != c_classIdCAbilAttack) && (AbilityClass(lv_abil) != c_classIdCAbilMove) && (AbilityClass(lv_abil) != c_classIdCAbilStop) && (AbilityClass(lv_abil) != c_classIdCAbilTransport) && (AbilityClass(lv_abil) != c_classIdCAbilMorph) && (AbilityClass(lv_abil) != c_classIdCAbilMorphPlacement)) {
        }
        else {

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

    }
    else if (true) {
        if ((UnitTypeTestAttribute(UnitGetType(lp_orderedUnit), c_unitAttributeStructure) == true) && (AbilityClass(lv_abil) != c_classIdCAbilAttack) && (AbilityClass(lv_abil) != c_classIdCAbilMove) && (AbilityClass(lv_abil) != c_classIdCAbilStop) && (AbilityClass(lv_abil) != c_classIdCAbilTransport) && (AbilityClass(lv_abil) != c_classIdCAbilMorph) && (AbilityClass(lv_abil) != c_classIdCAbilMorphPlacement)) {
        }
        else {

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

                }

                autoA1283C56_val = AbilityClass(lv_structureAbility);
                if (autoA1283C56_val == c_classIdCAbilTrain) {
                    lv_commandCount = 0;

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

    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;
        }