# Create Effect On Unit (From Unit)

Grammar — Execute effect on unit from caster
FlagsNative | Action

Runs an effect, targeting the specified unit, as if it was cast by the specified Caster unit.

# Arguments

  • unit — Caster
  • string [ gamelink::Effect ] — Effect
  • unit — Target

Returns — void

native void UnitCreateEffectUnit(
	unit inUnit,
	string inEffect,
	unit inTarget,
);

Category: Environment / Effects

# Examples

# campaigns/swarm.sc2campaign

MapScript.galaxy

// L1668
UnitCreateEffectUnit(lv_creepTumor, "ScourgeNestAcquire", gv_scourgeNestUnit[lv_index])
// L532
UnitCreateEffectUnit(lp_creator, "VirophageLaunchMissile", UnitLastCreated())
// L2100
UnitCreateEffectUnit(UnitLastCreated(), "VirophageLaunchMissile", auto7A95F5D2_var)
// L3568
UnitCreateEffectUnit(lv_tumor, "ScourgeNestAcquire", gv_objective_ScienceFacilities[lv_i])
// L3978
UnitCreateEffectUnit(EventUnit(), "HyperionPickup", gv_hyperion)
// L1668
UnitCreateEffectUnit(lv_creepTumor, "ScourgeNestAcquire", gv_scourgeNestUnit[lv_index])
// L532
UnitCreateEffectUnit(lp_creator, "VirophageLaunchMissile", UnitLastCreated())
// L2100
UnitCreateEffectUnit(UnitLastCreated(), "VirophageLaunchMissile", auto7A95F5D2_var)
// L3568
UnitCreateEffectUnit(lv_tumor, "ScourgeNestAcquire", gv_objective_ScienceFacilities[lv_i])
// L3978
UnitCreateEffectUnit(EventUnit(), "HyperionPickup", gv_hyperion)

# campaigns/swarmstory.sc2campaign

SwarmCampaignLib.galaxy

// L1984
UnitCreateEffectUnit(lp_hatchery, "ZerglingRespawnPrimaryRemoveOthers", lp_hatchery)
// L11176
UnitCreateEffectUnit(libSwaC_gv_zS_PrimaryHatchery, "CopyHatcheryRally", libSwaC_gv_zS_HeroReviverKerrigan)
// L11222
UnitCreateEffectUnit(libSwaC_gv_zS_PrimaryHatchery, "CopyHatcheryRally", libSwaC_gv_zS_HeroReviverStukov)

# campaigns/void.sc2campaign

MapScript.galaxy

// L633
UnitCreateEffectUnit(lp_cHOSEN_UNIT, "AmonTakeoverEffect", lp_cHOSEN_UNIT)
// L657
UnitCreateEffectUnit(lp_unit, "AmonTakeoverEffect", lp_unit)
// L1013
UnitCreateEffectUnit(UnitFromId(1267), "VoidRiftTrainLM", UnitLastCreated())
// L545
UnitCreateEffectUnit(UnitGroupClosestToPoint(UnitGroup("VoidRiftUnselectable", c_playerAny, RegionCircle(UnitGetPosition(lp_cHOSEN_UNIT), 20.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), UnitGetPosition(lp_cHOSEN_UNIT)), "VoidRiftTrainLM", lp_cHOSEN_UNIT)
// L733
UnitCreateEffectUnit(UnitFromId(33), "CopyHatcheryRally", gv_kerriganCocoon)
// L3458
UnitCreateEffectUnit(gv_s1_VoidRift01, "VoidRiftTrainSet", UnitLastCreated())
// L3472
UnitCreateEffectUnit(gv_s1_VoidRift01, "VoidRiftTrainSet", UnitLastCreated())
// L3530
UnitCreateEffectUnit(lv_voidRiftUnit, "VoidRiftTrainSet", UnitLastCreated())
// L3545
UnitCreateEffectUnit(lv_voidRiftUnit, "VoidRiftTrainSet", UnitLastCreated())
// L9266
UnitCreateEffectUnit(UnitFromId(677), "VoidRiftTrainSet", UnitLastCreated())
// L9270
UnitCreateEffectUnit(UnitFromId(381), "VoidRiftTrainSet", UnitLastCreated())
// L9274
UnitCreateEffectUnit(UnitFromId(382), "VoidRiftTrainSet", UnitLastCreated())
// L9278
UnitCreateEffectUnit(UnitFromId(679), "VoidRiftTrainSet", UnitLastCreated())
// L633
UnitCreateEffectUnit(lp_cHOSEN_UNIT, "AmonTakeoverEffect", lp_cHOSEN_UNIT)
// L657
UnitCreateEffectUnit(lp_unit, "AmonTakeoverEffect", lp_unit)
// L1013
UnitCreateEffectUnit(UnitFromId(1267), "VoidRiftTrainLM", UnitLastCreated())
// L545
UnitCreateEffectUnit(UnitGroupClosestToPoint(UnitGroup("VoidRiftUnselectable", c_playerAny, RegionCircle(UnitGetPosition(lp_cHOSEN_UNIT), 20.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), UnitGetPosition(lp_cHOSEN_UNIT)), "VoidRiftTrainLM", lp_cHOSEN_UNIT)
// L733
UnitCreateEffectUnit(UnitFromId(33), "CopyHatcheryRally", gv_kerriganCocoon)
// L3458
UnitCreateEffectUnit(gv_s1_VoidRift01, "VoidRiftTrainSet", UnitLastCreated())
// L3472
UnitCreateEffectUnit(gv_s1_VoidRift01, "VoidRiftTrainSet", UnitLastCreated())
// L3530
UnitCreateEffectUnit(lv_voidRiftUnit, "VoidRiftTrainSet", UnitLastCreated())
// L3545
UnitCreateEffectUnit(lv_voidRiftUnit, "VoidRiftTrainSet", UnitLastCreated())
// L9266
UnitCreateEffectUnit(UnitFromId(677), "VoidRiftTrainSet", UnitLastCreated())
// L9270
UnitCreateEffectUnit(UnitFromId(381), "VoidRiftTrainSet", UnitLastCreated())
// L9274
UnitCreateEffectUnit(UnitFromId(382), "VoidRiftTrainSet", UnitLastCreated())
// L9278
UnitCreateEffectUnit(UnitFromId(679), "VoidRiftTrainSet", UnitLastCreated())

# campaigns/voidstory.sc2campaign

VoidCampaignMissionLib.galaxy

// L1679
UnitCreateEffectUnit(lv_actualReviveLocation, "CopyHatcheryRally", libVCMI_gv_pM_HeroReviverUnit[(lv_heroType)])
// L5189
UnitCreateEffectUnit(EventPlayerEffectUsedUnit(c_effectUnitCaster), "SOASuperShieldApply", auto7D86169B_var)
// L5963
UnitCreateEffectUnit(lv_kerriganStrikeAmon, "StrikeAmonStart", lv_kerriganStrikeAmon)
// L5973
UnitCreateEffectUnit(lv_kerriganStrikeAmon, "StrikeAmonArcStart", lv_kerriganStrikeAmon)
// L5985
UnitCreateEffectUnit(lv_kerriganStrikeAmon, "StrikeAmonArcArrive", lv_kerriganStrikeAmon)
// L5988
UnitCreateEffectUnit(lv_kerriganStrikeAmon, "StrikeAmonBeamHit0", lv_amonTargetUnit)
// L5990
UnitCreateEffectUnit(lv_kerriganStrikeAmon, "StrikeAmonBeamHit1", lv_amonTargetUnit)
// L5992
UnitCreateEffectUnit(lv_kerriganStrikeAmon, "StrikeAmonBeamHit2", lv_amonTargetUnit)
// L5994
UnitCreateEffectUnit(lv_kerriganStrikeAmon, "StrikeAmonBeamHit3", lv_amonTargetUnit)
// L5996
UnitCreateEffectUnit(lv_kerriganStrikeAmon, "StrikeAmonBeamHit4", lv_amonTargetUnit)

# mods/balancemulti.sc2mod

VoidMultiLib.galaxy

// L55
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerUnitSet", lv_target)
// L100
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerUnitSet", lv_target)
// L145
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerDP", lv_caster)
// L185
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerDP", lv_caster)
// L236
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerDP", lv_caster)
// L285
UnitCreateEffectUnit(lv_caster, "BattlecruiserChasingRB", lv_caster)
// L55
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerUnitSet", lv_target)
// L100
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerUnitSet", lv_target)
// L145
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerDP", lv_caster)
// L185
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerDP", lv_caster)
// L236
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerDP", lv_caster)
// L285
UnitCreateEffectUnit(lv_caster, "BattlecruiserChasingRB", lv_caster)
// L55
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerUnitSet", lv_target)
// L100
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerUnitSet", lv_target)
// L145
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerDP", lv_caster)
// L185
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerDP", lv_caster)
// L236
UnitCreateEffectUnit(lv_caster, "BattlecruiserAttackTrackerDP", lv_caster)
// L285
UnitCreateEffectUnit(lv_caster, "BattlecruiserChasingRB", lv_caster)

# mods/core.sc2mod

NativeLib.galaxy

// L4244
UnitCreateEffectUnit(lp_targetUnit, "CopyTargetSelectionAndControlGroups", lp_sourceUnit)

# mods/heroes.stormmod

MapScript.galaxy

// L3673
UnitCreateEffectUnit(UnitFromId(38), "WatchtowerRevealDummy", UnitFromId(38))
// L1518
UnitCreateEffectUnit(gv_heroPlayer, "TutorialCancelMoveOrders", gv_heroPlayer)
// L3673
UnitCreateEffectUnit(UnitFromId(38), "WatchtowerRevealDummy", UnitFromId(38))
// L1518
UnitCreateEffectUnit(gv_heroPlayer, "TutorialCancelMoveOrders", gv_heroPlayer)

# mods/heroesbrawlmods/arenamodemods/arenamode.stormmod

LibAREN.galaxy

// L950
UnitCreateEffectUnit(libGame_gv_players[lv_itPlayer].lv_heroUnit, "UIArenaModeRoundWonSoundDummyPlayerOnly", libGame_gv_players[lv_itPlayer].lv_heroUnit)
// L958
UnitCreateEffectUnit(libGame_gv_players[lv_itPlayer].lv_heroUnit, "UIArenaModeRoundLostSoundDummyPlayerOnly", libGame_gv_players[lv_itPlayer].lv_heroUnit)
// L1278
UnitCreateEffectUnit(libGame_gv_players[lv_itPlayer].lv_heroUnit, lp_effect, libGame_gv_players[lv_itPlayer].lv_heroUnit)

# mods/heroesbrawlmods/arenamodemods/templearena.stormmod

LibAMCT.galaxy

// L1134
UnitCreateEffectUnit(lp_defender, "KillSquish", lp_defender)

# mods/heroesbrawlmods/arenamodemods/trialgrounds.stormmod

LibAMVS.galaxy

// L724
UnitCreateEffectUnit(libAMVS_gv_aRM_TrialGrounds.lv_dummyUnitToRunDamageInstancesFrom[lv_enemyTeam], "RavenLordsCurse", auto9D0046D8_var)
// L3100
UnitCreateEffectUnit(libAMVS_gv_aRM_TrialGrounds.lv_dummyUnitToRunDamageInstancesFrom[libGame_gf_EnemyTeamNumberOfPlayer(UnitGetOwner(auto18E6C008_var))], "SafeZoneDamage", auto18E6C008_var)
// L3110
UnitCreateEffectUnit(libAMVS_gv_aRM_TrialGrounds.lv_dummyUnitToRunDamageInstancesFrom[libGame_gf_EnemyTeamNumberOfPlayer(UnitGetOwner(auto29488539_var))], "SafeZoneDamage", auto29488539_var)

# mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmod

LibMDoE.galaxy

// L682
UnitCreateEffectUnit(auto98962299_var, "MakeCannonFaceBoatModifyUnit", libGame_gv_teams[libGame_gf_EnemyTeam(libGame_gf_TeamNumberOfPlayer(UnitGetOwner(auto98962299_var)))].lv_core)
// L2465
UnitCreateEffectUnit(libGame_gv_teams[libAtDe_gv_attackDefend.lv_attackingTeam].lv_core, "AttackCoreCreatePersistent", libGame_gv_teams[libAtDe_gv_attackDefend.lv_defendingTeam].lv_core)
// L3206
UnitCreateEffectUnit(lv_hero, "UnderworldTeleport", lv_hero)

# mods/heroesbrawlmods/brawlmapmods/coop/deadmansstand.stormmod

LibPEB1.galaxy

// L584
UnitCreateEffectUnit(lv_abathur, "Kill", lv_abathur)
// L604
UnitCreateEffectUnit(lv_abathur, "Kill", lv_abathur)
// L2919
UnitCreateEffectUnit(lv_sludglings[auto4FD4D06E_var], "Kill", lv_sludglings[auto4FD4D06E_var])
// L2930
UnitCreateEffectUnit(lv_sludglings[autoCB37B20D_var], "Kill", lv_sludglings[autoCB37B20D_var])
// L3138
UnitCreateEffectUnit(auto3A39F479_var, "Kill", auto3A39F479_var)
// L4972
UnitCreateEffectUnit(lv_caster, "PVEMinionMonitorApplyInCombatSet", lv_caster)
// L5951
UnitCreateEffectUnit(lv_murky, "Kill", lv_murky)
// L5952
UnitCreateEffectUnit(lv_murky, "Kill", libPEB1_gv_murkyEggUnit)
// L6123
UnitCreateEffectUnit(lv_zagara, "Kill", lv_zagara)
// L6206
UnitCreateEffectUnit(EventUnitTarget(), "ZagaraHunterKillerHydraliskTransfusionCreateHealer", libGame_gv_players[lv_zagaraPlayer].lv_heroUnit)
// L3466
UnitCreateEffectUnit(libPEB1_gv_slivan, "Kill", libPEB1_gv_slivan)
// L3782
UnitCreateEffectUnit(auto90B2268F_var, "PVEGenericAbortMissile", auto90B2268F_var)
// L3894
UnitCreateEffectUnit(auto27FF6D41_var, "PVEGenericAbortMissile", auto27FF6D41_var)
// L4085
UnitCreateEffectUnit(auto7C258293_var, "PVEGenericAbortMissile", auto7C258293_var)
// L4828
UnitCreateEffectUnit(EventUnitTarget(), "ZagaraHunterKillerHydraliskTransfusionCreateHealer", libGame_gv_players[lv_zagaraPlayer].lv_heroUnit)
// L5244
UnitCreateEffectUnit(autoF250EC3F_var, "Kill", autoF250EC3F_var)
// L6937
UnitCreateEffectUnit(libPEB1_gv_slivan, "SlivanBossMovetoCenterCompleteSet", libPEB1_gv_slivan)
// L7849
UnitCreateEffectUnit(auto71F5D142_var, "Kill", auto71F5D142_var)