# Validate Unit Can Create Effect On Unit
Grammar — Validate caster can create effect on unit
Flags —Native
|Function
|Internal
# Arguments
unit
— Casterstring
<gamelink::Effect> — Effectunit
— Target
Returns — int
native int UnitValidateEffectUnit(
unit inUnit,
string inEffect,
unit inTarget,
);
# Related
Category: Environment / Effects / Internal
- Validate Player Can Create Effect At Point —
int
— PlayerValidateEffectPoint - Validate Player Can Create Effect On Unit —
int
— PlayerValidateEffectUnit - Validate Unit Can Create Effect At Point —
int
— UnitValidateEffectPoint - Validate Unit Can Create Effect On Unit —
int
— UnitValidateEffectUnit
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/NativeLib.galaxy:3403
// Automatic Variable Declarations
// Implementation
return (UnitValidateEffectUnit(lp_caster, lp_effect, lp_target) == 0);
}
mods/core.stormmod — base.stormdata/TriggerLibs/NativeLib.galaxy:2899
// Automatic Variable Declarations
// Implementation
return (UnitValidateEffectUnit(lp_caster, lp_effect, lp_target) == 0);
}
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:73
//Scroll of Regeneration
if(!AIUnitIsInCombat(aiUnit)){
if(UnitValidateEffectUnit(aiUnit,c_IT_ScrollofRegenerationAIValidateEffect,aiUnit)==0){
itemType=c_IT_ScrollofRegenerationAI;
ord=AICreateItemOrder(player,aiUnit,itemType,c_abilInventoryCmdItemInstant);
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:114
}
bool GAw3_UnitAttackAir(unit u){
return UnitValidateEffectUnit(u,"Unit_ATTACKS_FLYING",u)>0;
}
bool GAw3_PlayerAllowAirCreep(int player){