# Unit Has Order With Ability

Grammarunit order list has an order with ability ability
FlagsNative | Function

Returns true if the unit has an order at any index with the ability

# Arguments

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

Returns — bool

native bool UnitOrderHasAbil(unit inUnit, string abilLink);

Category: Unit / Orders

# Examples

campaigns/liberty.sc2campaignbase.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:276

    //  If we already have a yamato order, ignore new orders so that we do not count
    //  our own markers again.
    if (UnitOrderHasAbil(aiUnit, c_AB_LokiYamato)) {
        return;
    }

campaigns/swarm.sc2campaignbase.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:276

    //  If we already have a yamato order, ignore new orders so that we do not count
    //  our own markers again.
    if (UnitOrderHasAbil(aiUnit, c_AB_LokiYamato)) {
        return;
    }

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:893

    //  If we already have a psi storm order, ignore any new orders since psi storm is more important.
    //  If we already have an Feedback order, ignore any new Feedback orders.
    if (UnitOrderHasAbil(aiUnit, c_AB_Feedback) || UnitOrderHasAbil(aiUnit, c_AB_PsiStorm)) {
        return;
    }

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:893

    //  If we already have a psi storm order, ignore any new orders since psi storm is more important.
    //  If we already have an Feedback order, ignore any new Feedback orders.
    if (UnitOrderHasAbil(aiUnit, c_AB_Feedback) || UnitOrderHasAbil(aiUnit, c_AB_PsiStorm)) {
        return;
    }

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:87

    //  our own marker again, when validating.
    //
    if (UnitOrderHasAbil(aiUnit, c_AB_250mmStrikeCannons)) {
        return;
    }

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:431

    //  If we already have a yamato order, ignore new orders so that we do not count
    //  our own markers again.
    if (UnitOrderHasAbil(aiUnit, c_AB_Yamato)) {
        return null;
    }

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:919

    //  If we already have a changeling order, ignore new orders so that 
    //  we don't cast again
    if (UnitOrderHasAbil(aiUnit, c_AB_Changeling)) {
        return false;
    }

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


    // Implementation
    if (((UnitGroupCount(lp_nearByUnits, c_unitCountAlive) <= 0) || (UnitOrderIsValid(lp_aIUnit, Order(AbilityCommand("MutatorAmonTychusTossGrenade", 0))) == false) || (UnitAbilityGetCooldown(lp_aIUnit, "MutatorAmonTychusTossGrenade", "Abil/MutatorAmonTychusTossGrenade") > 0.0) || (UnitOrderHasAbil(lp_aIUnit, "MutatorAmonTychusTossGrenade") == true))) {
        return ;
    }

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

    AISetFilterBits(lv_enemyNearbyFilter, UnitFilter((1 << c_targetFilterVisible), 0, (1 << c_targetFilterAir) | (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile) | (1 << c_targetFilterBuried), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterHallucination - 32)) | (1 << (c_targetFilterInvulnerable - 32))));
    lv_enemyUnitsNearby = AIGetFilterGroup(lv_enemyNearbyFilter, lp_nearByUnits);
    if (((UnitGroupCount(lv_enemyUnitsNearby, c_unitCountAlive) <= 0) || (UnitOrderIsValid(lp_aIUnit, Order(AbilityCommand("MutatorAmonRaynorSnipe", 0))) == false) || (UnitAbilityGetCooldown(lp_aIUnit, "MutatorAmonRaynorSnipe", "Abil/MutatorAmonRaynorSnipe") > 0.0) || (UnitOrderHasAbil(lp_aIUnit, "MutatorAmonRaynorSnipe") == true))) {
        return ;
    }

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

    }

    if ((UnitOrderHasAbil(lp_aIUnit, "MutatorAmonDehakaDrag") == false) && (UnitAbilityGetCooldown(lp_aIUnit, "MutatorAmonDehakaDrag", "Drag") <= 0.0)) {
        lv_abilityRange = StringToFixed(CatalogFieldValueGet(c_gameCatalogAbil, "MutatorAmonDehakaDrag", "Range[" + IntToString(0) + "]", lp_owner));
        AISetFilterAlliance(lv_canidatesFilter, c_playerGroupEnemy);

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

    }

    if (((UnitOrderHasAbil(lp_aIUnit, "MutatorAmonNovaNuke") == true) || (UnitOrderHasAbil(lp_aIUnit, "MutatorAmonNovaWeaponImprovedCanisterRifleSnipe") == true))) {
        return ;
    }

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

    }

    if (((UnitOrderHasAbil(lp_aIUnit, "MutatorAmonNovaNuke") == true) || (UnitOrderHasAbil(lp_aIUnit, "MutatorAmonNovaWeaponImprovedCanisterRifleSnipe") == true))) {
        return ;
    }

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

    }

    if ((UnitOrderHasAbil(lp_aIUnit, "MutatorAmonShadowBlade") == false) && (UnitAbilityGetCooldown(lp_aIUnit, "MutatorAmonShadowBlade", "Abil/MutatorAmonShadowBlade") <= 0.0)) {
        AISetFilterRange(lv_canidatesFilter, lp_aIUnit, 1.0);
        lv_canidates = AIGetFilterGroup(lv_canidatesFilter, lv_enemyUnitsNearby);

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

    }

    if (((UnitOrderHasAbil(lp_aIUnit, "MutatorAmonKerriganApocalypse") == true) || (UnitOrderHasAbil(lp_aIUnit, "MutatorAmonKerriganPrimalSlash") == true) || (UnitHasBehavior2(lp_aIUnit, "MutatorAmonKerriganPsiStrikeWalkSpeed") == true) || (UnitOrderHasAbil(lp_aIUnit, "MutatorAmonKerriganPsiStrikeWalk") == true) || (UnitMoverExists(lp_aIUnit, "PrimalSlashUpgradedMover") == true))) {
        return ;
    }

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

    }

    if (((UnitOrderHasAbil(lp_aIUnit, "MutatorAmonKerriganApocalypse") == true) || (UnitOrderHasAbil(lp_aIUnit, "MutatorAmonKerriganPrimalSlash") == true) || (UnitHasBehavior2(lp_aIUnit, "MutatorAmonKerriganPsiStrikeWalkSpeed") == true) || (UnitOrderHasAbil(lp_aIUnit, "MutatorAmonKerriganPsiStrikeWalk") == true) || (UnitMoverExists(lp_aIUnit, "PrimalSlashUpgradedMover") == true))) {
        return ;
    }

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

    }

    if (((UnitOrderHasAbil(lp_aIUnit, "MutatorAmonKerriganApocalypse") == true) || (UnitOrderHasAbil(lp_aIUnit, "MutatorAmonKerriganPrimalSlash") == true) || (UnitHasBehavior2(lp_aIUnit, "MutatorAmonKerriganPsiStrikeWalkSpeed") == true) || (UnitOrderHasAbil(lp_aIUnit, "MutatorAmonKerriganPsiStrikeWalk") == true) || (UnitMoverExists(lp_aIUnit, "PrimalSlashUpgradedMover") == true))) {
        return ;
    }

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:632

    //  If we already have a yamato order, ignore new orders so that we do not count
    //  our own markers again.
    if (UnitOrderHasAbil(aiUnit, c_AB_LokiYamato)) {
        return;
    }

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:865

    //  If we already have a psi storm order, ignore any new orders since psi storm is more important.
    //  If we already have an Feedback order, ignore any new Feedback orders.
    if (UnitOrderHasAbil(aiUnit, c_AB_Feedback) || UnitOrderHasAbil(aiUnit, c_AB_PsiStorm)) {
        return;
    }

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:865

    //  If we already have a psi storm order, ignore any new orders since psi storm is more important.
    //  If we already have an Feedback order, ignore any new Feedback orders.
    if (UnitOrderHasAbil(aiUnit, c_AB_Feedback) || UnitOrderHasAbil(aiUnit, c_AB_PsiStorm)) {
        return;
    }

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:90

    //  our own marker again, when validating.
    //
    if (UnitOrderHasAbil(aiUnit, c_AB_250mmStrikeCannons)) {
        return;
    }

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:413

    //  If we already have a yamato order, ignore new orders so that we do not count
    //  our own markers again.
    if (UnitOrderHasAbil(aiUnit, c_AB_Yamato)) {
        return null;
    }

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:1128

    //  If we already have a changeling order, ignore new orders so that 
    //  we don't cast again
    if (UnitOrderHasAbil(aiUnit, c_AB_Changeling)) {
        return false;
    }