# Create Effect On Unit (From Player)

Grammar — Execute effect on unit from player caster
FlagsNative | Action

Runs an effect, targeting the specified unit. This effect will not have a caster unit.

# Arguments

  • int — Player
  • string<gamelink::Effect> — Effect
  • unit — Target

Returns — void

native void PlayerCreateEffectUnit(
	int inPlayer,
	string inEffect,
	unit inTarget,
);

Category: Environment / Effects

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tvalerian02a.sc2map/MapScript.galaxy:7922

        if (autoD60EF79C_var == null) { break; }
        if ((WorldHeight(c_heightMapGround, UnitGetPosition(autoD60EF79C_var)) <= gv__4HeightOfLava)) {
            PlayerCreateEffectUnit(0, "LavaFireDamage", autoD60EF79C_var);
            if ((UnitHasBehavior(autoD60EF79C_var, "Incapacitated") == true)) {
                UnitSetPropertyFixed(autoD60EF79C_var, c_unitPropLife, (UnitGetPropertyFixed(autoD60EF79C_var, c_unitPropLife, c_unitPropCurrent) - 10.0));

campaigns/liberty.sc2campaignbase.sc2maps/maps/challenges/rushdefense.sc2map/MapScript.galaxy:854

    while (!UnitGroupLoopDone()) {
        if ((UnitHasBehavior(UnitGroupLoopCurrent(), "TimeWarpProduction") == false)) {
            PlayerCreateEffectUnit(gv_p3_ENEMY_PROTOSS, "ChronoBoost", UnitGroupLoopCurrent());
            TriggerEnable(TriggerGetCurrent(), false);
            Wait(45.0, c_timeGame);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tvalerian02a.sc2mapMapScript.galaxy:7922

        if (autoD60EF79C_var == null) { break; }
        if ((WorldHeight(c_heightMapGround, UnitGetPosition(autoD60EF79C_var)) <= gv__4HeightOfLava)) {
            PlayerCreateEffectUnit(0, "LavaFireDamage", autoD60EF79C_var);
            if ((UnitHasBehavior(autoD60EF79C_var, "Incapacitated") == true)) {
                UnitSetPropertyFixed(autoD60EF79C_var, c_unitPropLife, (UnitGetPropertyFixed(autoD60EF79C_var, c_unitPropLife, c_unitPropCurrent) - 10.0));

campaigns/liberty.sc2campaign/base.sc2maps/maps/challenges/rushdefense.sc2mapMapScript.galaxy:854

    while (!UnitGroupLoopDone()) {
        if ((UnitHasBehavior(UnitGroupLoopCurrent(), "TimeWarpProduction") == false)) {
            PlayerCreateEffectUnit(gv_p3_ENEMY_PROTOSS, "ChronoBoost", UnitGroupLoopCurrent());
            TriggerEnable(TriggerGetCurrent(), false);
            Wait(45.0, c_timeGame);

mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmodbase.stormdata/LibMDoE.galaxy:2894

    libMDoE_gf_PlayerPicksUpAmmoDisplayText(lv_collectingPlayer, lv_collectingUnit);
    if ((lv_collectingTeam == libGame_gv_teamOrderIndex_C)) {
        PlayerCreateEffectUnit(libCore_gv_cOMPUTER_TeamChaos, "ApplyCannonballRevealed", lv_collectingUnit);
    }
    else {

mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmodbase.stormdata/LibMDoE.galaxy:2897

    }
    else {
        PlayerCreateEffectUnit(libCore_gv_cOMPUTER_TeamOrder, "ApplyCannonballRevealed", lv_collectingUnit);
    }
    AddUnitOfInterest(lv_collectingUnit, 0.0, 0.0, "InterceptCannonball", libNtve_ge_GoalTeam_Both, 0);

mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmodbase.stormdata/LibMDoE.galaxy:2994

    }

    PlayerCreateEffectUnit(lv_collectingPlayer, "DoubloonPickupSet", lv_collectingUnit);
    if ((lv_collectingTeam == libGame_gv_teamOrderIndex_C)) {
        PlayerCreateEffectUnit(libCore_gv_cOMPUTER_TeamChaos, "ApplyCannonballRevealed", lv_collectingUnit);

mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmodbase.stormdata/LibMDoE.galaxy:2996

    PlayerCreateEffectUnit(lv_collectingPlayer, "DoubloonPickupSet", lv_collectingUnit);
    if ((lv_collectingTeam == libGame_gv_teamOrderIndex_C)) {
        PlayerCreateEffectUnit(libCore_gv_cOMPUTER_TeamChaos, "ApplyCannonballRevealed", lv_collectingUnit);
    }
    else {

mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmodbase.stormdata/LibMDoE.galaxy:2999

    }
    else {
        PlayerCreateEffectUnit(libCore_gv_cOMPUTER_TeamOrder, "ApplyCannonballRevealed", lv_collectingUnit);
    }
    AddUnitOfInterest(lv_collectingUnit, 0.0, 0.0, "InterceptCannonball", libNtve_ge_GoalTeam_Both, 0);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:3101

            libGDHL_gv_heroRexxarMishaLastKnownTargetLocation[lv_player] = UnitGetPosition(libGDHL_gv_heroRexxarMishaPursuitTarget[lv_player]);
            libGDHL_gv_commandMishaTargetUnit[lv_player] = libGDHL_gv_heroRexxarMishaPursuitTarget[lv_player];
            PlayerCreateEffectUnit(lv_player, "RexxarApplyMishaFocusTargetBehavior", libGDHL_gv_heroRexxarMishaPursuitTarget[lv_player]);
            UnitBehaviorAdd(lv_misha, "RexxarMishaFocussedOnUnit", lv_rexxar, 1);
            UnitIssueOrder(lv_misha, OrderTargetingUnit(AbilityCommand("attack", 0), libGDHL_gv_heroRexxarMishaPursuitTarget[lv_player]), c_orderQueueReplace);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:11288

        auto9FB90F8E_var = UnitGroupUnitFromEnd(auto9FB90F8E_g, auto9FB90F8E_u);
        if (auto9FB90F8E_var == null) { break; }
        PlayerCreateEffectUnit(lv_player, "KerriganSummonUltraliskRemoveUltraliskActiveBehavior", auto9FB90F8E_var);
    }
    return true;

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:20750

    else {
        UnitCreateEffectPoint(libGame_gf_UnitEntersSafeZonePuntRegionUnit(), "HallOfStormsKnockbackLaunchMissile", libGame_gf_UnitEntersSafeZonePuntRegionPuntPoint());
        PlayerCreateEffectUnit(UnitGetOwner(libGame_gf_UnitEntersSafeZonePuntRegionUnit()), "HallOfStormsKnockbackImpactSet", libGame_gf_UnitEntersSafeZonePuntRegionUnit());
    }
    return true;

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/StartingExperienceLib.galaxy:659

            	if (lv_itPlayer<0) { break; }
            	if ((lv_itPlayer <= libCore_gv_bALMaxPlayers) && (libGame_gv_players[lv_itPlayer].lv_heroUnit != null)) {
                PlayerCreateEffectUnit(lv_itPlayer, "GodRayDestroyPersistent", libGame_gv_players[lv_itPlayer].lv_heroUnit);
            }

mods/heromods/chogall.stormmodbase.stormdata/LibHCHO.galaxy:2132


    if (((lv_killingPlayer <= 0) || (lv_killingPlayer > libCore_gv_bALMaxPlayers) || (libGame_gv_gameOver == false))) {
        PlayerCreateEffectUnit(lv_killingPlayer, "GallDeathSwitch", libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_gallUnit);
    }
    else {

mods/novastoryassets.sc2modbase.sc2maps/maps/campaign/nova/nova01.sc2map/MapScript.galaxy:406

            SoundPlayForPlayer(SoundLink("MedkitSound", 0), c_maxPlayers, PlayerGroupAll(), 100.0, 0.0);
            SoundPlayForPlayer(SoundLink("UI_Pickup_VultureCube", 0), c_maxPlayers, PlayerGroupAll(), 100.0, 0.0);
            PlayerCreateEffectUnit(1, "PickupHealthFullVulturePathDummySet", gv_artanis);
            if ((gv_currentSection == 1)) {
                lv_i = 1;

mods/novastoryassets.sc2mod/base.sc2maps/maps/campaign/nova/nova01.sc2mapMapScript.galaxy:406

            SoundPlayForPlayer(SoundLink("MedkitSound", 0), c_maxPlayers, PlayerGroupAll(), 100.0, 0.0);
            SoundPlayForPlayer(SoundLink("UI_Pickup_VultureCube", 0), c_maxPlayers, PlayerGroupAll(), 100.0, 0.0);
            PlayerCreateEffectUnit(1, "PickupHealthFullVulturePathDummySet", gv_artanis);
            if ((gv_currentSection == 1)) {
                lv_i = 1;

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:13556

    if (((FixedToInt(lv_foodCompare) + libCOMI_gv_cM_Abathur_Enemy_Death_Create_Locusts_Random_Modifier) >= lv_rand)) {
        libNtve_gf_CreateUnitsWithDefaultFacing(1, lv_locustUnitType, c_unitCreateIgnorePlacement, lv_abathurCommander, UnitGetPosition(EventUnit()));
        PlayerCreateEffectUnit(lv_abathurCommander, "AbathurLocustTimedLife", UnitLastCreated());
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:15672

    if (((FixedToInt(lv_foodCompare) + libCOMI_gv_cM_Abathur_Enemy_Death_Create_Locusts_Random_Modifier) >= lv_rand)) {
        libNtve_gf_CreateUnitsWithDefaultFacing(1, lv_locustUnitType, c_unitCreateIgnorePlacement, lv_abathurAllyOfKillingPlayer, UnitGetPosition(EventUnit()));
        PlayerCreateEffectUnit(lv_abathurAllyOfKillingPlayer, "AbathurLocustTimedLife", UnitLastCreated());
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:2957

        for ( ; ( (auto8224E9CC_ai >= 0 && lv_bonusAmount <= auto8224E9CC_ae) || (auto8224E9CC_ai < 0 && lv_bonusAmount >= auto8224E9CC_ae) ) ; lv_bonusAmount += auto8224E9CC_ai ) {
            lv_mineralPatch = UnitGroupRandomUnit(UnitGroup("MineralField", c_playerAny, RegionCircle(PlayerStartLocation(lp_giftPlayer), 8.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive);
            PlayerCreateEffectUnit(lp_giftPlayer, "MutatorCalldownMULECreateUnit", lv_mineralPatch);
            if ((lv_oracleMade == false)) {
                lv_oracleMade = true;

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:12987

                if ((UnitGroupCount(lv_hungerUnits, c_unitCountAlive) > 0)) {
                    lv_hungerTarget = UnitGroupRandomUnit(lv_hungerUnits, c_unitCountAlive);
                    PlayerCreateEffectUnit(lv_hungryPlayer, "MutatorHungerDamage", lv_hungerTarget);
                    SoundPlayOnUnitForPlayer(SoundLink("InfestedCivilian_Moan", -1), c_maxPlayers, PlayerGroupAll(), lv_hungerTarget, 0.0, 100.0, 0.0);
                }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:12992

                else if ((UnitGroupCount(lv_hungerWorkers, c_unitCountAlive) > 0)) {
                    lv_hungerTarget = UnitGroupRandomUnit(lv_hungerWorkers, c_unitCountAlive);
                    PlayerCreateEffectUnit(lv_hungryPlayer, "MutatorHungerDamage", lv_hungerTarget);
                    SoundPlayOnUnitForPlayer(SoundLink("InfestedCivilian_Moan", -1), c_maxPlayers, PlayerGroupAll(), lv_hungerTarget, 0.0, 100.0, 0.0);
                }