# Triggering Ability

Grammar — Triggering ability
FlagsNative | Function

Returns the triggering ability. Used in response to “Unit Uses Ability”.

Returns — abilcmd

native abilcmd EventUnitAbility();

# Supported triggers

Category: Ability / Basic

# Examples

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:17204

    else {
    }
    if ((UnitGetType(EventUnit()) == "Probe") && (EventUnitAbility() == AbilityCommand("ProtossBuild", 1)) && (EventUnitAbilityStage() == c_abilBuildStageApproach)) {
        if ((lv_gatewayValid1 == false) && (lv_gatewayValid2 == false)) {
            TransmissionClearAll();

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/paiur06.sc2map/MapScript.galaxy:6150

        }

        if (!((EventUnitAbility() != AbilityCommand("SOARepairBeam", 0)))) {
            return false;
        }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2mapMapScript.galaxy:17204

    else {
    }
    if ((UnitGetType(EventUnit()) == "Probe") && (EventUnitAbility() == AbilityCommand("ProtossBuild", 1)) && (EventUnitAbilityStage() == c_abilBuildStageApproach)) {
        if ((lv_gatewayValid1 == false) && (lv_gatewayValid2 == false)) {
            TransmissionClearAll();

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/paiur06.sc2mapMapScript.galaxy:6150

        }

        if (!((EventUnitAbility() != AbilityCommand("SOARepairBeam", 0)))) {
            return false;
        }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignLib.galaxy:10899

    }

    if (((EventUnitAbility() == AbilityCommand("Blink", 0)) || (EventUnitAbility() == AbilityCommand("TimeWarp", 0)))) {
        DataTableSetInt(true, ("AbilUsed_" + (AbilityCommandGetAbility(EventUnitAbility()))), (DataTableGetInt(true, ("AbilUsed_" + (AbilityCommandGetAbility(EventUnitAbility()))))+1));
    }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignLib.galaxy:10899

    }

    if (((EventUnitAbility() == AbilityCommand("Blink", 0)) || (EventUnitAbility() == AbilityCommand("TimeWarp", 0)))) {
        DataTableSetInt(true, ("AbilUsed_" + (AbilityCommandGetAbility(EventUnitAbility()))), (DataTableGetInt(true, ("AbilUsed_" + (AbilityCommandGetAbility(EventUnitAbility()))))+1));
    }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignLib.galaxy:10900


    if (((EventUnitAbility() == AbilityCommand("Blink", 0)) || (EventUnitAbility() == AbilityCommand("TimeWarp", 0)))) {
        DataTableSetInt(true, ("AbilUsed_" + (AbilityCommandGetAbility(EventUnitAbility()))), (DataTableGetInt(true, ("AbilUsed_" + (AbilityCommandGetAbility(EventUnitAbility()))))+1));
    }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignLib.galaxy:10900


    if (((EventUnitAbility() == AbilityCommand("Blink", 0)) || (EventUnitAbility() == AbilityCommand("TimeWarp", 0)))) {
        DataTableSetInt(true, ("AbilUsed_" + (AbilityCommandGetAbility(EventUnitAbility()))), (DataTableGetInt(true, ("AbilUsed_" + (AbilityCommandGetAbility(EventUnitAbility()))))+1));
    }

mods/balancemulti.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:214

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserMove", 0)))) {
            return false;
        }

mods/balancemulti.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:218

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserAttack", 0)))) {
            return false;
        }

mods/balancemulti.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:222

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserMove", 2)))) {
            return false;
        }

mods/balancemulti.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:226

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserStop", 0)))) {
            return false;
        }

mods/balancemultilanmethodcleanedup.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:214

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserMove", 0)))) {
            return false;
        }

mods/balancemultilanmethodcleanedup.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:218

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserAttack", 0)))) {
            return false;
        }

mods/balancemultilanmethodcleanedup.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:222

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserMove", 2)))) {
            return false;
        }

mods/balancemultilanmethodcleanedup.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:226

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserStop", 0)))) {
            return false;
        }

mods/balancemultislowwarpprism.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:214

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserMove", 0)))) {
            return false;
        }

mods/balancemultislowwarpprism.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:218

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserAttack", 0)))) {
            return false;
        }

mods/balancemultislowwarpprism.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:222

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserMove", 2)))) {
            return false;
        }

mods/balancemultislowwarpprism.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:226

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserStop", 0)))) {
            return false;
        }

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

    // Variable Initialization
    lv_otherUnit = EventUnitAbilityOtherUnit();
    lv_abilUsed = EventUnitAbility();
    lv_itemType = "";

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:10160

    // Automatic Variable Declarations
    // Variable Initialization
    lv_abilityCommand = EventUnitAbility();
    lv_unit = EventUnit();
    lv_heroType = UnitGetType(lv_unit);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:14195

        }

        if (!((EventUnitAbility() != AbilityCommand("LostVikingsRally", 0)))) {
            return false;
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:14199

        }

        if (!((EventUnitAbility() != AbilityCommand("LostVikingsBaleogRally", 0)))) {
            return false;
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:14203

        }

        if (!((EventUnitAbility() != AbilityCommand("LostVikingsOlafRally", 0)))) {
            return false;
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:14207

        }

        if (!((EventUnitAbility() != AbilityCommand("LostVikingsErikRally", 0)))) {
            return false;
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:26096

        }

        if (!((AbilityCommandGetAbility(AbilityCommand("BarbarianShotofFury", 0)) != AbilityCommandGetAbility(EventUnitAbility())))) {
            return false;
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:26100

        }

        if (!((AbilityCommandGetAbility(AbilityCommand("BarbarianAncientSpear", 0)) != AbilityCommandGetAbility(EventUnitAbility())))) {
            return false;
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:26104

        }

        if (!((AbilityCommandGetAbility(AbilityCommand("L90ETCPowerslide", 0)) != AbilityCommandGetAbility(EventUnitAbility())))) {
            return false;
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:26119

    for ( ; ( (auto98ECC35E_ai >= 0 && lv_i <= auto98ECC35E_ae) || (auto98ECC35E_ai < 0 && lv_i >= auto98ECC35E_ae) ) ; lv_i += auto98ECC35E_ai ) {
        lv_abilLink = libGame_gv_players[lv_heroIndex].lv_heroData.lv_abilities[lv_i].lv_ability;
        if ((lv_abilLink == AbilityCommandGetAbility(EventUnitAbility()))) {
            UnitBehaviorAdd(lv_hero, "TalentBucketFollowThrough", lv_hero, 1);
            break;

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

    }

    libSprt_gv_soundRepeatCurrentAbility = AbilityCommandGetAbility(EventUnitAbility());
    libSprt_gv_soundRepeatCasterUnit = EventUnit();
    libSprt_gv_soundRepeatTargetUnit = EventUnit();

mods/heromods/dva.stormmodbase.stormdata/LibHDVA.galaxy:1379

    // Variable Initialization
    lv_stage = c_unitAbilStageAll;
    lv_ability = EventUnitAbility();

    // Conditions

mods/heromods/samuro.stormmodbase.stormdata/LibHSAM.galaxy:910

        if (lv_itUnit == null) { break; }
        if ((lv_itUnit != EventUnit())) {
            UnitIssueOrder(lv_itUnit, Order(EventUnitAbility()), c_orderQueueReplace);
        }

mods/heromods/samuro.stormmodbase.stormdata/LibHSAM.galaxy:1472


    lv_samuroPlayer = UnitGetOwner(EventUnit());
    if ((PlayerHasTalent(lv_samuroPlayer, "SamuroWhirlwindStorm") == true) && (EventUnitAbility() == AbilityCommand("SamuroBladeStormDummy", 0))) {
        auto1ACCA2DA_g = libGame_gv_players[lv_samuroPlayer].lv_heroUnitGroup;
        auto1ACCA2DA_u = UnitGroupCount(auto1ACCA2DA_g, c_unitCountAll);

mods/heromods/samuro.stormmodbase.stormdata/LibHSAM.galaxy:1484

    }
    else {
        if ((PlayerHasTalent(lv_samuroPlayer, "SamuroWhirlwindStorm") == true) && (EventUnitAbility() == AbilityCommand("SamuroBladestormCancel", 0))) {
            auto022C31C7_g = libGame_gv_players[lv_samuroPlayer].lv_heroUnitGroup;
            auto022C31C7_u = UnitGroupCount(auto022C31C7_g, c_unitCountAll);

mods/heromods/samuro.stormmodbase.stormdata/LibHSAM.galaxy:1494

        }
        else {
            if ((EventUnitAbility() == AbilityCommand("SamuroBladeStormDummy", 0))) {
                UnitIssueOrder(EventUnit(), Order(AbilityCommand("SamuroBladestorm", 0)), c_orderQueueReplace);
            }

mods/heromods/tracer.stormmodbase.stormdata/LibTrac.galaxy:705

    // Automatic Variable Declarations
    // Variable Initialization
    lv_ability = EventUnitAbility();

    // Conditions

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

    }

    if ((libCOMI_gf_HeroCanSpendSkillPoint(lv_u, AbilityCommandGetAbility(EventUnitAbility())) == true)) {
        ActorSend(libNtve_gf_MainActorofUnit(lv_u), "HaloStart");
        UISetButtonFaceHighlighted(PlayerGroupSingle(UnitGetOwner(lv_u)), "DehakaLearnAbilities", true);

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

    }

    autoE74B4F8A_val = EventUnitAbility();
    if (autoE74B4F8A_val == AbilityCommand("DehakaGlevigFirebreath", 0)) {
        libCOMI_gv_dehakaGlevigFirebreathAutocast[EventPlayer()] = true;

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

    }

    auto80035AF7_val = EventUnitAbility();
    if (auto80035AF7_val == AbilityCommand("DehakaGlevigFirebreath", 0)) {
        libCOMI_gv_dehakaGlevigFirebreathAutocast[EventPlayer()] = false;

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

    }

    auto1242C3A3_val = EventUnitAbility();
    if (auto1242C3A3_val == AbilityCommand("FenixSoAWhirlwind", 0)) {
        libCOMI_gv_fenixWhirlwindAutocast[EventPlayer()] = true;

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

    }

    auto603B686C_val = EventUnitAbility();
    if (auto603B686C_val == AbilityCommand("FenixSoAWhirlwind", 0)) {
        libCOMI_gv_fenixWhirlwindAutocast[EventPlayer()] = false;

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

    // Variable Initialization
    lv_p = EventPlayer();
    lv_uT = libCOMI_gf_TraingingUnitTypeInAbilCommand(EventUnitAbility(), lv_p, 0);

    // Actions

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

    // Variable Initialization
    lv_p = EventPlayer();
    lv_uT = libCOMI_gf_TraingingUnitTypeInAbilCommand(EventUnitAbility(), lv_p, 0);

    // Actions

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

    }

    if ((libCOMI_gf_HeroCanSpendSkillPoint(EventUnit(), AbilityCommandGetAbility(EventUnitAbility())) == false)) {
        libNtve_gf_StopTimer(libCOMI_gv_cM_DehakaVOLearnReminderTimer);
    }

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

    }

    autoCD529328_val = EventUnitAbility();
    if (autoCD529328_val == AbilityCommand("MutatorBoomBotDefuse", 0)) {
        lv_input = 1;

mods/voidmulti.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:214

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserMove", 0)))) {
            return false;
        }

mods/voidmulti.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:218

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserAttack", 0)))) {
            return false;
        }

mods/voidmulti.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:222

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserMove", 2)))) {
            return false;
        }

mods/voidmulti.sc2modbase.sc2data/TriggerLibs/VoidMultiLib.galaxy:226

        }

        if (!((EventUnitAbility() != AbilityCommand("BattlecruiserStop", 0)))) {
            return false;
        }

mods/warcoop/legends/jainaproudmoore.sc2modbase.sc2data/LibLJai.galaxy:29

    // Conditions
    if (testConds) {
        if (!((CatalogFieldValueGet(c_gameCatalogAbil, AbilityCommandGetAbility(EventUnitAbility()), "AbilityCategories[" + IntToString(0) + "]", c_playerAny) == "1"))) {
            return false;
        }