# Units Near Point Matching Condition
Grammar — type units within radius of reg where player player matches filter unitFilter, with at most count
Flags —Native
|Function
Returns a unit group containing all units that match the specified filters within the radius of the specified point. The player parameter determines the player used for the Unit Filter comparisons. For example, if you specify Enemy in the Unit Filter, it will get units that are an enemy to the specified player.
# Arguments
string
<gamelink::Unit> — Unit Typeint
— Playerpoint
— Pointfixed
— Radiusunitfilter
— Unit Filterint
— Count
Returns — unitgroup
native unitgroup UnitGroupSearch(
string type,
int player,
point p,
fixed radius,
unitfilter filter,
int maxCount,
);
# Related
Category: Unit Group / Useful Unit Groups
- Empty Unit Group —
unitgroup
— UnitGroupEmpty - Idle Units For Player —
unitgroup
— UnitGroupIdle - Convert Unit To Unit Group —
unitgroup
— libNtve_gf_ConvertUnitToUnitGroup - Units In Region Matching Condition —
unitgroup
— UnitGroup - Unit Count In Region Matching Condition —
int
— UnitCount - Units Near Point Matching Condition —
unitgroup
— UnitGroupSearch - Units In Region With Alliance To Player —
unitgroup
— UnitGroupAlliance - Unit Count In Region With Alliance To Player —
int
— UnitCountAlliance - Units In Region With Alliance To Player Matching Condition —
unitgroup
— libNtve_gf_UnitsInRegionWithAllianceToPlayerMatchingCondition - Units In Unit Group For Player —
unitgroup
— UnitGroupFilterPlayer - Units In Unit Group Matching Condition —
unitgroup
— UnitGroupFilter - Units In Unit Group Targetable As —
unitgroup
— UnitGroupFilterPlane - Units In Unit Group With Alliance —
unitgroup
— UnitGroupFilterAlliance - Units In Unit Group With Custom Value —
unitgroup
— libNtve_gf_UnitsInUnitGroupWithCustomValue - Units In Unit Group Within Region —
unitgroup
— UnitGroupFilterRegion
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:842
ord = AICreateOrder(player, c_AB_ArchonWarp, 1);
targetGroup = UnitGroupSearch(c_PU_HighTemplar, player, UnitGetPosition(aiUnit), 5.0, UnitFilter((1 << c_targetFilterSelf), 0, 0, 0), c_noMaxCount);
targetUnit = OrderGetTargetUnit( AIUnitGroupGetValidOrder(targetGroup, ord, aiUnit, c_forwards) );
if (targetUnit == null) {
mods/heroesbrawlmods/brawlmapmods/coop/pvebrawlmod.stormmod — base.stormdata/LibPVEB.galaxy:186
}
lv_nearbyUnits = UnitGroupSearch(null, lp_killedUnitPlayer, UnitGetPosition(lp_killedUnit), libCore_gv_bALXPRadius, UnitFilter(0, 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
autoED2F3891_g = lv_nearbyUnits;
autoED2F3891_u = UnitGroupCount(autoED2F3891_g, c_unitCountAll);
mods/heroesbrawlmods/brawlmapmods/coop/pvemod.stormmod — base.stormdata/LibPVEM.galaxy:1170
}
lv_nearbyUnits = UnitGroupSearch(null, lp_killedUnitPlayer, UnitGetPosition(lp_killedUnit), libCore_gv_bALXPRadius, UnitFilter(0, 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
autoED2F3891_g = lv_nearbyUnits;
autoED2F3891_u = UnitGroupCount(autoED2F3891_g, c_unitCountAll);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/AILib.galaxy:215
else {
TriggerEnable(libAIAI_gt_MinionAIUpdateMercPath, false);
auto5DE21723_g = UnitGroupSearch(null, c_playerAny, Point(0.0, 0.0), 300.0, UnitFilter((1 << c_targetFilterMinion), 0, (1 << c_targetFilterCreep) | (1 << c_targetFilterHeroic) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterBenign - 32))), 0);
auto5DE21723_u = UnitGroupCount(auto5DE21723_g, c_unitCountAll);
for (;; auto5DE21723_u -= 1) {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/AILib.galaxy:241
if ((lp_pauseUnpause == true)) {
TriggerEnable(libAIAI_gt_MinionAIUpdateMercPath, false);
autoD1D0173D_g = UnitGroupSearch(null, c_playerAny, Point(0.0, 0.0), 300.0, UnitFilter((1 << c_targetFilterMinion), 0, (1 << c_targetFilterCreep) | (1 << c_targetFilterHeroic) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterBenign - 32))), 0);
autoD1D0173D_u = UnitGroupCount(autoD1D0173D_g, c_unitCountAll);
for (;; autoD1D0173D_u -= 1) {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/AILib.galaxy:250
}
else {
auto6C81EAA0_g = UnitGroupSearch(null, c_playerAny, Point(0.0, 0.0), 300.0, UnitFilter((1 << c_targetFilterMinion), 0, (1 << c_targetFilterCreep) | (1 << c_targetFilterHeroic) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterBenign - 32))), 0);
auto6C81EAA0_u = UnitGroupCount(auto6C81EAA0_g, c_unitCountAll);
for (;; auto6C81EAA0_u -= 1) {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/AILib.galaxy:2252
lv_centerPoint = libNtve_gf_PointOffsetTowardsPoint(lp_selfPosition, (lv_searchRadius - lv_offsetFromEdge), lp_otherPoint);
}
lv_enemyStructures = UnitGroupSearch(null, lp_selfPlayer, lv_centerPoint, lv_searchRadius, libAIAI_gv_uF_MinionAI_GetNearestEnemyStructure, 0);
auto49113F57_g = lv_enemyStructures;
auto49113F57_u = UnitGroupCount(auto49113F57_g, c_unitCountAll);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:5754
}
auto7E23C28A_g = UnitGroupSearch("AbathurEvolvedMonstrosity", lv_abathurPlayer, UnitGetPosition(libGame_gf_SpecialCaseUnitParticipatedInNPCTakedownMinion()), libCore_gv_bALXPRadius, UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto7E23C28A_u = UnitGroupCount(auto7E23C28A_g, c_unitCountAll);
for (;; auto7E23C28A_u -= 1) {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:6187
lv_deadPlayer = UnitGetOwner(lp_deadHero);
if ((lp_killingPlayer > 0) && (lp_killingPlayer <= libCore_gv_bALMaxEnginePlayerCount)) {
lv_nearbyUnits = UnitGroupSearch(null, lp_killingPlayer, UnitGetPosition(lp_deadHero), libCore_gv_bALHeroKillXPRadius, UnitFilter(0, 0, (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterCreep) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
}
else {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:6191
else {
if ((lv_deadPlayer != libCore_gv_cOMPUTER_Hostile)) {
lv_nearbyUnits = UnitGroupSearch(null, lv_deadPlayer, UnitGetPosition(lp_deadHero), libCore_gv_bALHeroKillXPRadius, UnitFilter(0, 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterCreep) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:7103
// Implementation
lv_teamOfDeadPlayer = libGame_gf_TeamNumberOfPlayer(lp_deadPlayer);
lv_nearbyUnits = UnitGroupSearch(null, lp_deadPlayer, UnitGetPosition(lp_deadHero), libCore_gv_bALHeroKillXPRadius, UnitFilter(0, 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto6AD73EDD_g = lv_nearbyUnits;
auto6AD73EDD_u = UnitGroupCount(auto6AD73EDD_g, c_unitCountAll);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:8982
// Implementation
if ((lp_killingPlayer > 0) && (lp_killingPlayer <= libCore_gv_bALMaxEnginePlayerCount)) {
lv_nearbyUnits = UnitGroupSearch(null, lp_killingPlayer, UnitGetPosition(lp_killedUnit), libCore_gv_bALXPRadius, UnitFilter(0, 0, (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterCreep) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
lv_nearbyUnitsAlliedToKilledUnit = UnitGroupSearch(null, lp_killingPlayer, UnitGetPosition(lp_killedUnit), libCore_gv_bALXPRadius, libCore_gv_filtersHeroicEnemy, 0);
auto8BF37171_g = lv_nearbyUnitsAlliedToKilledUnit;
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:8983
if ((lp_killingPlayer > 0) && (lp_killingPlayer <= libCore_gv_bALMaxEnginePlayerCount)) {
lv_nearbyUnits = UnitGroupSearch(null, lp_killingPlayer, UnitGetPosition(lp_killedUnit), libCore_gv_bALXPRadius, UnitFilter(0, 0, (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterCreep) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
lv_nearbyUnitsAlliedToKilledUnit = UnitGroupSearch(null, lp_killingPlayer, UnitGetPosition(lp_killedUnit), libCore_gv_bALXPRadius, libCore_gv_filtersHeroicEnemy, 0);
auto8BF37171_g = lv_nearbyUnitsAlliedToKilledUnit;
auto8BF37171_u = UnitGroupCount(auto8BF37171_g, c_unitCountAll);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:8994
else {
if ((lp_killedUnitPlayer != libCore_gv_cOMPUTER_Hostile)) {
lv_nearbyUnits = UnitGroupSearch(null, lp_killedUnitPlayer, UnitGetPosition(lp_killedUnit), libCore_gv_bALXPRadius, UnitFilter(0, 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterCreep) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
}
else {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:14074
for ( ; ( (auto3B2503E2_ai >= 0 && lv_itTeamNumber <= auto3B2503E2_ae) || (auto3B2503E2_ai < 0 && lv_itTeamNumber >= auto3B2503E2_ae) ) ; lv_itTeamNumber += auto3B2503E2_ai ) {
if ((libGame_gv_teams[lv_itTeamNumber].lv_core != null) && (UnitHasBehavior2(libGame_gv_teams[lv_itTeamNumber].lv_core, "CoreInvulnerability") == false)) {
lv_enemiesNearCore = UnitGroupSearch(null, UnitGetOwner(libGame_gv_teams[lv_itTeamNumber].lv_core), UnitGetPosition(libGame_gv_teams[lv_itTeamNumber].lv_core), libGame_gv_towerCoreUnderAttackScanRange, UnitFilter(0, 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
if ((libGame_gv_towerTeamCoreIsUnderAttack[lv_itTeamNumber] == true) && (UnitGroupCount(UnitGroupFilter(null, c_playerAny, lv_enemiesNearCore, libCore_gv_filtersHeroicjustexcludingCloakedandDead, 0), c_unitCountAll) == 0) && (UnitGroupCount(UnitGroupFilter(null, c_playerAny, lv_enemiesNearCore, libCore_gv_filtersMercLaner, 0), c_unitCountAll) == 0) && (UnitGroupCount(UnitGroupFilter("CatapultMinion", c_playerAny, lv_enemiesNearCore, UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAll) == 0)) {
PingDestroy(libGame_gv_towerTeamCoreAlertPing[lv_itTeamNumber]);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:15134
}
lv_allyUnitGroup = UnitGroupSearch(null, lv_killedPlayer, UnitGetPosition(libGame_gv_players[lv_killedPlayer].lv_heroUnit), libGame_gv_teamfightTrackingRadius, UnitFilter((1 << c_targetFilterHeroic), 0, (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterCreep) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
autoD84BC848_g = lv_allyUnitGroup;
autoD84BC848_u = UnitGroupCount(autoD84BC848_g, c_unitCountAll);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:15260
for ( ; lv_playerIterator <= auto4E466BEE_ae ; lv_playerIterator += 1 ) {
if ((UnitIsValid(libGame_gv_players[lv_playerIterator].lv_heroUnit) == true)) {
lv_allyUnitGroup = UnitGroupSearch(null, lv_playerIterator, UnitGetPosition(libGame_gv_players[lv_playerIterator].lv_heroUnit), libGame_gv_teamfightTrackingRadius, UnitFilter((1 << c_targetFilterHeroic), 0, (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterCreep) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
libGame_gv_teamfightTrackingNearbyAllyCount[lv_playerIterator] = UnitGroupCount(lv_allyUnitGroup, c_unitCountAll);
lv_enemyUnitGroup = UnitGroupSearch(null, lv_playerIterator, UnitGetPosition(libGame_gv_players[lv_playerIterator].lv_heroUnit), libGame_gv_teamfightTrackingRadius, UnitFilter((1 << c_targetFilterHeroic), 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral), (1 << (c_targetFilterDead - 32))), 0);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:15262
lv_allyUnitGroup = UnitGroupSearch(null, lv_playerIterator, UnitGetPosition(libGame_gv_players[lv_playerIterator].lv_heroUnit), libGame_gv_teamfightTrackingRadius, UnitFilter((1 << c_targetFilterHeroic), 0, (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterCreep) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
libGame_gv_teamfightTrackingNearbyAllyCount[lv_playerIterator] = UnitGroupCount(lv_allyUnitGroup, c_unitCountAll);
lv_enemyUnitGroup = UnitGroupSearch(null, lv_playerIterator, UnitGetPosition(libGame_gv_players[lv_playerIterator].lv_heroUnit), libGame_gv_teamfightTrackingRadius, UnitFilter((1 << c_targetFilterHeroic), 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral), (1 << (c_targetFilterDead - 32))), 0);
libGame_gv_teamfightTrackingNearbyEnemyCount[lv_playerIterator] = UnitGroupCount(lv_enemyUnitGroup, c_unitCountAll);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/MapMechanicsLib.galaxy:1744
StatEventAddDataFixed(StatEventLastCreated(), "GameTime", libUIUI_gf_HeroesGameTime());
StatEventSend(StatEventLastCreated());
auto65C1FEA2_g = UnitGroupSearch(null, lp_owner, libMapM_gv_jungleCreepCamps[lp_camp].lv_mapDataCampCaptainSpawnPoint, lv_captureRadiusScoreCredit, libCore_gv_filtersHeroicAllyorPlayerandnotHallucinationorBenign, 0);
auto65C1FEA2_u = UnitGroupCount(auto65C1FEA2_g, c_unitCountAll);
for (;; auto65C1FEA2_u -= 1) {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/MapMechanicsLib.galaxy:1751
PlayerGroupAdd(lv_creditGroup, UnitGetOwner(lv_itUnit));
}
auto6F574477_g = UnitGroupSearch("HeroGall", lp_owner, libMapM_gv_jungleCreepCamps[lp_camp].lv_mapDataCampCaptainSpawnPoint, lv_captureRadiusScoreCredit, libCore_gv_filtersHeroicjustexcludingMissile, 0);
auto6F574477_u = UnitGroupCount(auto6F574477_g, c_unitCountAll);
for (;; auto6F574477_u -= 1) {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/SoundLib.galaxy:497
lv_positionOfHeroUnit = UnitGetPosition(lv_heroUnit);
lv_alliesNearby = UnitGroupSearch(null, lp_player, lv_positionOfHeroUnit, libSond_gv_heroVO_HeroIntroLineAllyCheckRadius_C, libCore_gv_filtersHeroicAllyandnotHallucination, 0);
lv_numberOfAlliesNearby = UnitGroupCount(lv_alliesNearby, c_unitCountAlive);
if ((lv_numberOfAlliesNearby == 0)) {
mods/heroesmapmods/battlegroundmapmods/battlefieldofeternity.stormmod — base.stormdata/LibMLBD.galaxy:2162
// Implementation
lv_potentialTargets = UnitGroupSearch(null, UnitGetOwner(lp_castingUnit), UnitGetPosition(lp_castingUnit), libMLBD_gv_mMBOEExplosionsMaxRange, UnitFilter((1 << c_targetFilterVisible), 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterImmuneToAOE) | (1 << c_targetFilterUser1) | (1 << c_targetFilterMissile) | (1 << c_targetFilterCloaked), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32))), 0);
lv_enemyHeroes = UnitGroupFilter(null, c_playerAny, lv_potentialTargets, libCore_gv_filtersHeroic, 0);
lv_enemySummons = UnitGroupFilter(null, c_playerAny, lv_potentialTargets, UnitFilter(0, (1 << (c_targetFilterSummoned - 32)), (1 << c_targetFilterHeroic) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
mods/heroesmapmods/battlegroundmapmods/battlefieldofeternity.stormmod — base.stormdata/LibMLBD.galaxy:2328
// Implementation
lv_nearbyUnits = UnitGroupSearch(null, UnitGetOwner(lp_bossUnit), UnitGetPosition(lp_bossUnit), libCore_gv_bALXPRadius, UnitFilter(0, 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterCreep) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto1422F9C1_g = lv_nearbyUnits;
auto1422F9C1_u = UnitGroupCount(auto1422F9C1_g, c_unitCountAll);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:28008
}
autoCCD34BBA_g = UnitGroupSearch(null, 0, UnitGetPosition(lv_nexus), 10.0, UnitFilter((1 << c_targetFilterRawResource), 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
autoCCD34BBA_u = UnitGroupCount(autoCCD34BBA_g, c_unitCountAll);
for (;; autoCCD34BBA_u -= 1) {
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:819
ord = AICreateOrder(player, c_AB_ArchonWarp, 1);
targetGroup = UnitGroupSearch(c_PU_HighTemplar, player, UnitGetPosition(aiUnit), 5.0, UnitFilter((1 << c_targetFilterSelf), 0, 0, 0), c_noMaxCount);
targetUnit = OrderGetTargetUnit( AIUnitGroupGetValidOrder(targetGroup, ord, aiUnit, c_forwards) );
if (targetUnit == null) {
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:88
if(goal==null){return null;}
if(DistanceBetweenPoints(UnitGetPosition(aiUnit),goal)>30){
towns=UnitGroupSearch(null,player,goal,20,GAw3_UnitTownFilter,1);
town=UnitGroupUnit(towns,1);
if(town!=null){
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:245
static unitfilter EnemyInvisibleFilter=UnitFilterStr("Enemy,Cloak,Stasis;Dead");
static unitgroup AIGetEtherealEnemies(int player,point pos,fixed range){
return UnitGroupSearch(null, player, pos, range, EnemyEtherealFilter,0);
}
static unitgroup AIGetInvisibleEnemies(int player,point pos,fixed range){
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:248
}
static unitgroup AIGetInvisibleEnemies(int player,point pos,fixed range){
return UnitGroupSearch(null, player, pos, range, EnemyInvisibleFilter,0);
}
static order AIOrderChainLightning(int player, unit aiUnit, unitgroup scanGroup, marker mark, string entry, int level) {
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:235
if (lv_p < 0) { break; }
lv_startloc = PlayerStartLocation(lv_p);
autoF9B19856_g = UnitGroupSearch(null, 15, lv_startloc, 20.0, UnitFilter(0, 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
autoF9B19856_u = UnitGroupCount(autoF9B19856_g, c_unitCountAll);
for (;; autoF9B19856_u -= 1) {
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:269
lv_startloc = PlayerStartLocation(lv_p);
lv_race = PlayerRace(lv_p);
lv_goldmine = UnitGroupClosestToPoint(UnitGroupSearch("ngol", c_playerAny, lv_startloc, 20.0, UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), lv_startloc);
lv_cloestTree = UnitGroupClosestToPoint(UnitGroupSearch(null, c_playerAny, lv_startloc, 20.0, UnitFilter((1 << c_targetFilterHarvestableResource), 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32))), 0), lv_startloc);
lv_townHall = UnitGroupUnit(UnitGroup(null, lv_p, RegionEntireMap(), UnitFilter((1 << c_targetFilterPreventReveal), 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), 1);
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:270
lv_race = PlayerRace(lv_p);
lv_goldmine = UnitGroupClosestToPoint(UnitGroupSearch("ngol", c_playerAny, lv_startloc, 20.0, UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), lv_startloc);
lv_cloestTree = UnitGroupClosestToPoint(UnitGroupSearch(null, c_playerAny, lv_startloc, 20.0, UnitFilter((1 << c_targetFilterHarvestableResource), 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32))), 0), lv_startloc);
lv_townHall = UnitGroupUnit(UnitGroup(null, lv_p, RegionEntireMap(), UnitFilter((1 << c_targetFilterPreventReveal), 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), 1);
auto11D568B2_g = UnitGroupSearch(null, 15, lv_startloc, 20.0, UnitFilter(0, 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:272
lv_cloestTree = UnitGroupClosestToPoint(UnitGroupSearch(null, c_playerAny, lv_startloc, 20.0, UnitFilter((1 << c_targetFilterHarvestableResource), 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32))), 0), lv_startloc);
lv_townHall = UnitGroupUnit(UnitGroup(null, lv_p, RegionEntireMap(), UnitFilter((1 << c_targetFilterPreventReveal), 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), 1);
auto11D568B2_g = UnitGroupSearch(null, 15, lv_startloc, 20.0, UnitFilter(0, 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto11D568B2_u = UnitGroupCount(auto11D568B2_g, c_unitCountAll);
for (;; auto11D568B2_u -= 1) {
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:279
UnitRemove(auto11D568B2_var);
}
auto785D9532_g = UnitGroupSearch("egol", lv_p, lv_startloc, 20.0, UnitFilter(0, 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32))), 0);
auto785D9532_u = UnitGroupCount(auto785D9532_g, c_unitCountAll);
for (;; auto785D9532_u -= 1) {
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:301
else {
}
lv_ghouls = UnitGroupSearch("ugho", lv_p, lv_startloc, 20.0, UnitFilter(0, 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
lv_peons = UnitGroupSearch(null, lv_p, lv_startloc, 20.0, UnitFilter((1 << c_targetFilterWorker), 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
lv_creationOffset = libNtve_gf_PointOffsetTowardsPoint(UnitGetPosition(lv_townHall), 1.0, UnitGetPosition(lv_goldmine));
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:302
}
lv_ghouls = UnitGroupSearch("ugho", lv_p, lv_startloc, 20.0, UnitFilter(0, 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
lv_peons = UnitGroupSearch(null, lv_p, lv_startloc, 20.0, UnitFilter((1 << c_targetFilterWorker), 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
lv_creationOffset = libNtve_gf_PointOffsetTowardsPoint(UnitGetPosition(lv_townHall), 1.0, UnitGetPosition(lv_goldmine));
autoCE2B86A9_g = lv_peons;
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicTactical.galaxy:492
lv_level = UnitAbilityGetLevel(lp_aIUnit, lp_abil);
lv_ug = UnitGroupSearch(null, lp_owner, UnitGetPosition(lp_aIUnit), libGAwT_gf_AIEffectAbilSearchRadius(lp_owner, lp_aIUnit, lp_abil, lv_level, true), libGAwT_gf_AIEffectAbilSearchUnitFilter(lp_owner, lp_aIUnit, lp_abil, lv_level), 0);
lv_ug = UnitGroupFilter(null, c_playerAny, lv_ug, UnitFilter(0, 0, (1 << c_targetFilterWorker), 0), 0);
lv_corpseCount = UnitGroupCount(lv_ug, c_unitCountAll);
mods/warcoop/warcoopdata.sc2mod — base.sc2data/TriggerLibs/WarCoopData.galaxy:2195
PlayerOptionOverride(lv_player, "showcurrentordermodel", "0");
MeleeSetOption(lv_player, c_meleeOptionXPGainDisable, false);
auto38C35668_g = UnitGroupSearch(null, 15, PlayerStartLocation(lv_player), 10.0, UnitFilter(0, 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto38C35668_u = UnitGroupCount(auto38C35668_g, c_unitCountAll);
for (;; auto38C35668_u -= 1) {
mods/warcoop/warcoopdata.sc2mod — base.sc2data/TriggerLibs/WarCoopData.galaxy:2235
if (lv_player < 0) { break; }
lv_startingLocation = PlayerStartLocation(lv_player);
lv_closestGoldmine = UnitGroupClosestToPoint(UnitGroupSearch("ngol", c_playerAny, lv_startingLocation, 10.0, UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), lv_startingLocation);
lv_closestTree = UnitGroupClosestToPoint(UnitGroupSearch(null, c_playerAny, lv_startingLocation, 10.0, UnitFilter((1 << c_targetFilterHarvestableResource), 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32))), 0), lv_startingLocation);
lv_townHall = UnitGroupClosestToPoint(UnitGroup(null, lv_player, RegionEntireMap(), UnitFilter((1 << c_targetFilterPreventReveal), 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), lv_startingLocation);
mods/warcoop/warcoopdata.sc2mod — base.sc2data/TriggerLibs/WarCoopData.galaxy:2236
lv_startingLocation = PlayerStartLocation(lv_player);
lv_closestGoldmine = UnitGroupClosestToPoint(UnitGroupSearch("ngol", c_playerAny, lv_startingLocation, 10.0, UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), lv_startingLocation);
lv_closestTree = UnitGroupClosestToPoint(UnitGroupSearch(null, c_playerAny, lv_startingLocation, 10.0, UnitFilter((1 << c_targetFilterHarvestableResource), 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterInvulnerable - 32))), 0), lv_startingLocation);
lv_townHall = UnitGroupClosestToPoint(UnitGroup(null, lv_player, RegionEntireMap(), UnitFilter((1 << c_targetFilterPreventReveal), 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), lv_startingLocation);
auto03EB927C_val = UserDataGetGameLink("PlayableLegends", libWCdr_gv_legends.lv_player[lv_player].lv_selectedLegend, "Race", 1);
mods/warcoop/warcoopdata.sc2mod — base.sc2data/TriggerLibs/WarCoopData.galaxy:2253
else {
}
lv_ghouls = UnitGroupSearch("ugho", lv_player, lv_startingLocation, 10.0, UnitFilter(0, 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
lv_peons = UnitGroupSearch(null, lv_player, lv_startingLocation, 10.0, UnitFilter((1 << c_targetFilterWorker), 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
if ((UnitIsValid(lv_closestGoldmine) == true)) {
mods/warcoop/warcoopdata.sc2mod — base.sc2data/TriggerLibs/WarCoopData.galaxy:2254
}
lv_ghouls = UnitGroupSearch("ugho", lv_player, lv_startingLocation, 10.0, UnitFilter(0, 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
lv_peons = UnitGroupSearch(null, lv_player, lv_startingLocation, 10.0, UnitFilter((1 << c_targetFilterWorker), 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
if ((UnitIsValid(lv_closestGoldmine) == true)) {
lv_creationOffset = libNtve_gf_PointOffsetTowardsPoint(UnitGetPosition(lv_townHall), 1.0, UnitGetPosition(lv_closestGoldmine));
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/Common_ai.galaxy:68
if(AIGetTownState(player,town)){
loc=AIGetTownLocation(player,town);
mines=UnitGroupSearch("ngol", player, loc, 20.0,UnitFilter(0, 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly) | (1 << c_targetFilterEnemy),0),0);
ui=1;
uc=UnitGroupCount(mines,c_unitCountAlive);
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/Common_ai.galaxy:88
if(AIGetTownState(player,town)){
loc=AIGetTownLocation(player,town);
mines=UnitGroupSearch("ngol", player, loc, 20.0,UnitFilter(0, 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly) | (1 << c_targetFilterEnemy),0),0);
ui=1;
uc=UnitGroupCount(mines,c_unitCountAlive);
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/Common_ai.galaxy:105
int town=townid;
point loc=AIGetTownLocation(player,town);
unitgroup mines=UnitGroupSearch("ngol", player, loc, 20.0,UnitFilter(0, 0, (1 << c_targetFilterPlayer) | (1 << c_targetFilterAlly) | (1 << c_targetFilterEnemy),0),0);
if(AIGetTownState(player,townid)<1){return false;}
if(UnitGroupCount(mines,c_unitCountAlive)){
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:89
if(UnitGroupCount(allCreeps,c_unitCountAlive)==0){break;}
creep=UnitGroupClosestToPoint(allCreeps,p);
camp=UnitGroupSearch(null, GAw3_AICreepPlayer, UnitGetPosition(creep), GAw3_CreepCampBoundary, GAw3_AICreepfilter, 0);
level=GAw3_UnitGroupCRLevel(camp);
UnitGroupRemoveUnitGroup(allCreeps,camp);
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:104
while(UnitGroupCount(allCreeps,c_unitCountAlive)>0){
creep=UnitGroupUnit(allCreeps,1);
camp=UnitGroupSearch(null, GAw3_AICreepPlayer, UnitGetPosition(creep), GAw3_CreepCampBoundary, GAw3_AICreepfilter, 0);
level=GAw3_UnitGroupCRLevel(camp);
if((level>=min)&&(level<=max)&&(flyers_ok||(!GAw3_UnitGroupHasAirUnit(camp)))){