# Unit Can Create Effect On Unit
Grammar — caster can create effect on target
Flags —Function
Returns true if the specified unit can execute the specified effect on the specified target unit.
# Arguments
unit
— Casterstring
<gamelink::Effect> — Effectunit
— Target
Returns — bool
bool libNtve_gf_UnitCanCreateEffectOnUnit(
unit lp_caster,
string lp_effect,
unit lp_target,
);
# Related
Category: Environment / Effects
- Create Explosion At Point —
void
— libNtve_gf_CreateExplosionAtPoint - Create Effect At Point (From Player) —
void
— PlayerCreateEffectPoint - Create Effect On Unit (From Player) —
void
— PlayerCreateEffectUnit - Create Effect At Point (From Unit) —
void
— UnitCreateEffectPoint - Create Effect On Unit (From Unit) —
void
— UnitCreateEffectUnit - Damage Unit (From Unit) —
void
— UnitDamage - Player Can Create Effect At Point —
bool
— libNtve_gf_PlayerCanCreateEffectAtPoint - Player Can Create Effect On Unit —
bool
— libNtve_gf_PlayerCanCreateEffectOnUnit - Unit Can Create Effect At Point —
bool
— libNtve_gf_UnitCanCreateEffectAtPoint - Unit Can Create Effect On Unit —
bool
— libNtve_gf_UnitCanCreateEffectOnUnit - Destroy Effects —
void
— GameDestroyEffects - Effect Used —
void
— TriggerAddEventPlayerEffectUsed - Effect Used From Scope —
void
— TriggerAddEventPlayerEffectUsedFromScope - Triggering Effect Used —
string
<gamelink::Effect> — EventPlayerEffectUsed - Triggering Effect Point —
point
— EventPlayerEffectUsedPoint - Triggering Effect Unit —
unit
— EventPlayerEffectUsedUnit - Triggering Effect Item —
unit
— EventPlayerEffectUsedItem - Triggering Effect Impact Unit —
unit
— EventPlayerEffectUsedUnitImpact - Triggering Effect Launch Unit —
unit
— EventPlayerEffectUsedUnitLaunch - Triggering Effect Unit Owner —
int
— EventPlayerEffectUsedUnitOwner - Triggering Effect Unit Type —
string
<gamelink::Unit> — EventPlayerEffectUsedUnitType - Triggering Effect Item Type —
string
<gamelink::Unit> — EventPlayerEffectUsedItemType - Triggering Effect Amount (Integer) —
int
— EventPlayerEffectUsedAmountInt - Triggering Effect Amount (Real) —
fixed
— EventPlayerEffectUsedAmountFixed - Triggering Effect Source Behavior —
string
<gamelink::Behavior> — EventPlayerEffectUsedSourceBehavior - Triggering Effect Weapon —
string
<gamelink::Weapon> — EventPlayerEffectUsedWeapon - Triggering Effect Ability —
string
<gamelink::Abil> — EventPlayerEffectUsedAbil
# Examples
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:3766
lv_currentattacktargetunit = UnitGroupUnitFromEnd(auto75294CD3_g, auto75294CD3_u);
if (lv_currentattacktargetunit == null) { break; }
if ((libNtve_gf_UnitCanCreateEffectOnUnit(lv_currentattacktargetunit, "ThreatTest", lp_attacker) == true) && ((UnitFilterMatch(lv_currentattacktargetunit, UnitGetOwner(lp_attacker), UnitFilter(0, 0, (1 << c_targetFilterCloaked), 0)) == true) || (libNtve_gf_UnitIsVisibleToPlayer(lv_currentattacktargetunit, UnitGetOwner(lp_attacker)) == true))) {
lv_currentpathingdistance = AIPathingCostUnit(lp_attacker, UnitGetPosition(lv_currentattacktargetunit), c_ignoreEnemyBuildings);
if ((lv_currentpathingdistance < lp_satisfiedPathingDistance)) {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:3783
}
if ((UnitIsAlive(lv_bestattacktargetunit) == true) && (libNtve_gf_UnitCanCreateEffectOnUnit(lv_bestattacktargetunit, "ThreatTest", lp_attacker) == true) && ((UnitFilterMatch(lv_bestattacktargetunit, UnitGetOwner(lp_attacker), UnitFilter(0, 0, (1 << c_targetFilterCloaked), 0)) == true) || (libNtve_gf_UnitIsVisibleToPlayer(lv_bestattacktargetunit, UnitGetOwner(lp_attacker)) == true))) {
while ((UnitIsAlive(lp_attacker) == true) && (UnitIsAlive(lv_bestattacktargetunit) == true) && (libNtve_gf_UnitCanCreateEffectOnUnit(lv_bestattacktargetunit, "ThreatTest", lp_attacker) == true) && ((UnitFilterMatch(lv_bestattacktargetunit, UnitGetOwner(lp_attacker), UnitFilter(0, 0, (1 << c_targetFilterCloaked), 0)) == true) || (libNtve_gf_UnitIsVisibleToPlayer(lv_bestattacktargetunit, UnitGetOwner(lp_attacker)) == true))) {
UnitIssueOrder(lp_attacker, OrderTargetingPoint(AbilityCommand("attack", 0), UnitGetPosition(lv_bestattacktargetunit)), c_orderQueueReplace);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:3784
if ((UnitIsAlive(lv_bestattacktargetunit) == true) && (libNtve_gf_UnitCanCreateEffectOnUnit(lv_bestattacktargetunit, "ThreatTest", lp_attacker) == true) && ((UnitFilterMatch(lv_bestattacktargetunit, UnitGetOwner(lp_attacker), UnitFilter(0, 0, (1 << c_targetFilterCloaked), 0)) == true) || (libNtve_gf_UnitIsVisibleToPlayer(lv_bestattacktargetunit, UnitGetOwner(lp_attacker)) == true))) {
while ((UnitIsAlive(lp_attacker) == true) && (UnitIsAlive(lv_bestattacktargetunit) == true) && (libNtve_gf_UnitCanCreateEffectOnUnit(lv_bestattacktargetunit, "ThreatTest", lp_attacker) == true) && ((UnitFilterMatch(lv_bestattacktargetunit, UnitGetOwner(lp_attacker), UnitFilter(0, 0, (1 << c_targetFilterCloaked), 0)) == true) || (libNtve_gf_UnitIsVisibleToPlayer(lv_bestattacktargetunit, UnitGetOwner(lp_attacker)) == true))) {
UnitIssueOrder(lp_attacker, OrderTargetingPoint(AbilityCommand("attack", 0), UnitGetPosition(lv_bestattacktargetunit)), c_orderQueueReplace);
Wait((lv_safethinkperiod + RandomFixed(-0.125, 0.125)), c_timeGame);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:14025
}
if (!((libNtve_gf_UnitCanCreateEffectOnUnit(lv_caster, "ObserverTargetLockCPOrderValidate", lv_target) == true))) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:14039
}
if ((libNtve_gf_UnitCanCreateEffectOnUnit(lv_caster, "ObserverTargetLockCP", lv_target) == false)) {
UnitCreateEffectUnit(lv_caster, "ObserverTargetLockDP", lv_caster);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:14072
}
if (!((libNtve_gf_UnitCanCreateEffectOnUnit(lv_caster, "RavenTargetLockCPOrderValidate", lv_target) == true))) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:14086
}
if ((libNtve_gf_UnitCanCreateEffectOnUnit(lv_caster, "RavenAnalyzeCP", lv_target) == false)) {
UnitCreateEffectUnit(lv_caster, "RavenAnalyzeDP", lv_caster);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:28064
UnitSetOwner(lv_missile, lv_p, true);
if ((libNtve_gf_UnitCanCreateEffectOnUnit(lv_missile, lv_effect, lv_reflectTarget) == true)) {
UnitCreateEffectUnit(lv_missile, lv_effect, lv_reflectTarget);
}
mods/warcoop/warclassic.sc2mod — base.sc2data/TriggerLibs/WarClassic.galaxy:144
// Automatic Variable Declarations
// Implementation
return libNtve_gf_UnitCanCreateEffectOnUnit(lp_unit, "TriggerValidatorUnitIsChanneling", lp_unit);
}