# Unit Has Order With Ability
Grammar — unit order list has an order with ability ability
Flags —Native
|Function
Returns true if the unit has an order at any index with the ability
# Arguments
unit
— Unitstring
<gamelink::Abil> — Ability
Returns — bool
native bool UnitOrderHasAbil(unit inUnit, string abilLink);
# Related
Category: Unit / Orders
- Triggering Order —
order
— EventUnitOrder - Issue Order —
bool
— UnitIssueOrder - Issue Order To Unit Group —
bool
— UnitGroupIssueOrder - Unit Order Count —
int
— UnitOrderCount - Unit Order —
order
— UnitOrder - Unit Order Is Acquired —
bool
— UnitOrderIsAcquired - Unit Has Order With Ability —
bool
— UnitOrderHasAbil - Unit Is Issued Order —
void
— TriggerAddEventUnitOrder - Unit Becomes Idle —
void
— TriggerAddEventUnitBecomesIdle - Wait Until Unit Becomes Idle —
void
— UnitWaitUntilIdle - Wait Until Unit Group Becomes Idle —
void
— UnitGroupWaitUntilIdle - Unit Rally Point —
int
— UnitRallyPoint - Unit Rally Point Count —
int
— UnitRallyPointCount - Unit Rally Point Target Count —
int
— UnitRallyPointTargetCount - Unit Rally Point Target Point —
point
— UnitRallyPointTargetPoint - Unit Rally Point Target Unit —
unit
— UnitRallyPointTargetUnit - Unit Order Get Progress —
fixed
— UnitOrderGetProgress
# Examples
campaigns/liberty.sc2campaign — base.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.sc2campaign — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:87
// our own marker again, when validating.
//
if (UnitOrderHasAbil(aiUnit, c_AB_250mmStrikeCannons)) {
return;
}
mods/core.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.sc2data/LibCOMU.galaxy:2108
}
if (((UnitOrderHasAbil(lp_aIUnit, "MutatorAmonNovaNuke") == true) || (UnitOrderHasAbil(lp_aIUnit, "MutatorAmonNovaWeaponImprovedCanisterRifleSnipe") == true))) {
return ;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:2108
}
if (((UnitOrderHasAbil(lp_aIUnit, "MutatorAmonNovaNuke") == true) || (UnitOrderHasAbil(lp_aIUnit, "MutatorAmonNovaWeaponImprovedCanisterRifleSnipe") == true))) {
return ;
}
mods/starcoop/starcoop.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:90
// our own marker again, when validating.
//
if (UnitOrderHasAbil(aiUnit, c_AB_250mmStrikeCannons)) {
return;
}
mods/starcoop/starcoop.sc2mod — base.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.sc2mod — base.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;
}