# Unit Has Behavior

Grammarunit has behavior
FlagsNative | Function

Returns true if the specified unit has the specified behavior.

# Arguments

  • unit — Unit
  • string [ gamelink::Behavior ] — Behavior

Returns — bool

native bool UnitHasBehavior2(
	unit inUnit,
	string inBehavior,
);

Category: Behavior / Basic

# Examples

# campaigns/swarm.sc2campaign

MapScript.galaxy

// L7006
UnitHasBehavior2(libNtve_gf_KillingUnit(), "NPSwarm")
// L7006
UnitHasBehavior2(libNtve_gf_KillingUnit(), "NPSwarm")
// L3547
UnitHasBehavior2(UnitGroupLoopCurrent(), lv_carryBehavior)
// L3689
UnitHasBehavior2(OrderGetTargetUnit(EventUnitOrder()), "CarryMineralFieldMinerals")
// L9728
UnitHasBehavior2(UnitGroupLoopCurrent(), "ZergBuildingDies6")
// L9733
UnitHasBehavior2(UnitGroupLoopCurrent(), "ZergBuildingDies9")
// L12831
UnitHasBehavior2(UnitGroupLoopCurrent(), "CarryHarvestableVespeneGeyserGasZerg")
// L12877
UnitHasBehavior2(UnitGroupLoopCurrent(), "CarryHarvestableVespeneGeyserGasZerg")
// L12955
UnitHasBehavior2(UnitGroupLoopCurrent(), "CarryHarvestableVespeneGeyserGasZerg")
// L13344
UnitHasBehavior2(UnitGroupLoopCurrent(), "CarryHarvestableVespeneGeyserGasZerg")
// L15557
UnitHasBehavior2(UnitGroupLoopCurrent(), "ZergBuildingDies6")
// L15562
UnitHasBehavior2(UnitGroupLoopCurrent(), "ZergBuildingDies9")
// L3332
UnitHasBehavior2(auto220BF287_var, "CarryHarvestableVespeneGeyserGasProtoss")
// L3453
UnitHasBehavior2(auto70400E0A_var, "CarryHarvestableVespeneGeyserGasProtoss")
// L3811
UnitHasBehavior2(auto4D4BD4E5_var, "CarryHarvestableVespeneGeyserGasProtoss")
// L7231
UnitHasBehavior2(auto19E3EDD0_var, "UnstableEnergyDamage")
// L7237
UnitHasBehavior2(auto19E3EDD0_var, "UnstableEnergyDamage")
// L575
UnitHasBehavior2(autoC20E9EDC_var, "VoidTendrilDeathGripStun")
// L575
UnitHasBehavior2(autoC20E9EDC_var, "VoidTendrilDeathGripWarningDebuff")
// L1015
UnitHasBehavior2(UnitLastCreated(), "VoidRiftTrainPrecursor")
// L885
UnitHasBehavior2(lp_alarak, "AlarakDeadlyCharging")
// L512
UnitHasBehavior2(gv_megalithUnit, "MegalithCutterDockHide")
// L6312
UnitHasBehavior2(auto00DB70CB_var, "QueenMPEnsnare")
// L1045
UnitHasBehavior2(auto641DF5B9_var, "HybridGeneralPhaseShift")
// L1045
UnitHasBehavior2(auto641DF5B9_var, "HybridNemesisStasisPrevention")
// L607
UnitHasBehavior2(gv_voidThrashers.lv_thrasher[lp_index], "ArtanisTemporalField")
// L778
UnitHasBehavior2(lv_currentUnit, "HybridGeneralPhaseShift")
// L778
UnitHasBehavior2(lv_currentUnit, "HybridNemesisStasisPrevention")
// L555
UnitHasBehavior2(lp_cHOSEN_UNIT, "SolarCombustion")
// L1773
UnitHasBehavior2(auto6EEAE39A_var, "TerrazineShadow")
// L1773
UnitHasBehavior2(auto6EEAE39A_var, "ShadowManifestation")
// L615
UnitHasBehavior2(auto28BBCA79_var, "PitAlarakShieldRegen")
// L641
UnitHasBehavior2(auto2856A257_var, "PitMalashShieldRegen")
// L723
UnitHasBehavior2(auto1AEC9506_var, "SlaynElementalGrabStun")
// L735
UnitHasBehavior2(autoDDD5729F_var, "SlaynElementalGrabStun")
// L1081
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnMode")
// L1081
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnModeEnd")
// L1086
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnMode")
// L1086
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnModeEnd")
// L1187
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnMode")
// L1187
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnModeEnd")
// L1192
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnMode")
// L1192
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnModeEnd")
// L1453
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnMode")
// L1464
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnMode")
// L1513
UnitHasBehavior2(autoD5CF45EC_var, "VoidShade")
// L1523
UnitHasBehavior2(autoAC013987_var, "VoidShade")
// L678
UnitHasBehavior2(gv_voidCrystals[lp_index].lv_unit, "AmonCrystalDarkInertia")
// L682
UnitHasBehavior2(gv_voidCrystals[lp_index].lv_unit, "InfiniteCrystalisRepulsorBehavior")
// L3547
UnitHasBehavior2(UnitGroupLoopCurrent(), lv_carryBehavior)
// L3689
UnitHasBehavior2(OrderGetTargetUnit(EventUnitOrder()), "CarryMineralFieldMinerals")
// L9728
UnitHasBehavior2(UnitGroupLoopCurrent(), "ZergBuildingDies6")
// L9733
UnitHasBehavior2(UnitGroupLoopCurrent(), "ZergBuildingDies9")
// L12831
UnitHasBehavior2(UnitGroupLoopCurrent(), "CarryHarvestableVespeneGeyserGasZerg")
// L12877
UnitHasBehavior2(UnitGroupLoopCurrent(), "CarryHarvestableVespeneGeyserGasZerg")
// L12955
UnitHasBehavior2(UnitGroupLoopCurrent(), "CarryHarvestableVespeneGeyserGasZerg")
// L13344
UnitHasBehavior2(UnitGroupLoopCurrent(), "CarryHarvestableVespeneGeyserGasZerg")
// L15557
UnitHasBehavior2(UnitGroupLoopCurrent(), "ZergBuildingDies6")
// L15562
UnitHasBehavior2(UnitGroupLoopCurrent(), "ZergBuildingDies9")
// L3332
UnitHasBehavior2(auto220BF287_var, "CarryHarvestableVespeneGeyserGasProtoss")
// L3453
UnitHasBehavior2(auto70400E0A_var, "CarryHarvestableVespeneGeyserGasProtoss")
// L3811
UnitHasBehavior2(auto4D4BD4E5_var, "CarryHarvestableVespeneGeyserGasProtoss")
// L7231
UnitHasBehavior2(auto19E3EDD0_var, "UnstableEnergyDamage")
// L7237
UnitHasBehavior2(auto19E3EDD0_var, "UnstableEnergyDamage")
// L575
UnitHasBehavior2(autoC20E9EDC_var, "VoidTendrilDeathGripStun")
// L575
UnitHasBehavior2(autoC20E9EDC_var, "VoidTendrilDeathGripWarningDebuff")
// L1015
UnitHasBehavior2(UnitLastCreated(), "VoidRiftTrainPrecursor")
// L885
UnitHasBehavior2(lp_alarak, "AlarakDeadlyCharging")
// L512
UnitHasBehavior2(gv_megalithUnit, "MegalithCutterDockHide")
// L6312
UnitHasBehavior2(auto00DB70CB_var, "QueenMPEnsnare")
// L1045
UnitHasBehavior2(auto641DF5B9_var, "HybridGeneralPhaseShift")
// L1045
UnitHasBehavior2(auto641DF5B9_var, "HybridNemesisStasisPrevention")
// L607
UnitHasBehavior2(gv_voidThrashers.lv_thrasher[lp_index], "ArtanisTemporalField")
// L778
UnitHasBehavior2(lv_currentUnit, "HybridGeneralPhaseShift")
// L778
UnitHasBehavior2(lv_currentUnit, "HybridNemesisStasisPrevention")
// L555
UnitHasBehavior2(lp_cHOSEN_UNIT, "SolarCombustion")
// L1773
UnitHasBehavior2(auto6EEAE39A_var, "TerrazineShadow")
// L1773
UnitHasBehavior2(auto6EEAE39A_var, "ShadowManifestation")
// L615
UnitHasBehavior2(auto28BBCA79_var, "PitAlarakShieldRegen")
// L641
UnitHasBehavior2(auto2856A257_var, "PitMalashShieldRegen")
// L723
UnitHasBehavior2(auto1AEC9506_var, "SlaynElementalGrabStun")
// L735
UnitHasBehavior2(autoDDD5729F_var, "SlaynElementalGrabStun")
// L1081
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnMode")
// L1081
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnModeEnd")
// L1086
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnMode")
// L1086
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnModeEnd")
// L1187
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnMode")
// L1187
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnModeEnd")
// L1192
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnMode")
// L1192
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnModeEnd")
// L1453
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnMode")
// L1464
UnitHasBehavior2(gv_voidThrasher, "NarudEpilogueSpawnMode")
// L1513
UnitHasBehavior2(autoD5CF45EC_var, "VoidShade")
// L1523
UnitHasBehavior2(autoAC013987_var, "VoidShade")
// L678
UnitHasBehavior2(gv_voidCrystals[lp_index].lv_unit, "AmonCrystalDarkInertia")
// L682
UnitHasBehavior2(gv_voidCrystals[lp_index].lv_unit, "InfiniteCrystalisRepulsorBehavior")

# campaigns/voidstory.sc2campaign

VoidCampaignMissionLib.galaxy

// L107
UnitHasBehavior2(lv_currentUnit, "Frenzy")
// L138
UnitHasBehavior2(lv_currentUnit, "Frenzy")
// L1968
UnitHasBehavior2(libVCMI_gv_pM_SoAUnit, "SOAAbilityDisable")
// L2462
UnitHasBehavior2(lv_indexUnit, "RecentlyCreated")