# New Unit Owner

Grammar — New unit owner
FlagsNative | Function

Returns the new owner of a unit, when used in response to “Unit Owner Changes”.

Returns — int

native int EventUnitOwnerNew();

# Supported triggers

Category: Unit / Basic

# Examples

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/paiur06.sc2map/MapScript.galaxy:3132

    // Conditions
    if (testConds) {
        if (!((EventUnitOwnerNew() == gv_pLAYER_08_NERAZIM))) {
            return false;
        }

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/pcampaigntest.sc2map/MapScript.galaxy:870

    }

    if ((EventUnitOwnerNew() == gv_pLAYER_01_USER)) {
        ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(0.00, 0.00, 100.00), 1.0, 0.0));
    }

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/pcampaigntest.sc2map/MapScript.galaxy:874

    }
    else {
        if (((libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy) == true) || (libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_EnemyMutual) == true))) {
            ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(100.00, 0.00, 0.00), 1.0, 0.0));
        }

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/pcampaigntest.sc2map/MapScript.galaxy:874

    }
    else {
        if (((libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy) == true) || (libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_EnemyMutual) == true))) {
            ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(100.00, 0.00, 0.00), 1.0, 0.0));
        }

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/pcampaigntest.sc2map/MapScript.galaxy:878

        }
        else {
            if (((libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Neutral) == true) || (libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual) == true))) {
                ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(100.00, 100.00, 0.00), 1.0, 0.0));
            }

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/pcampaigntest.sc2map/MapScript.galaxy:878

        }
        else {
            if (((libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Neutral) == true) || (libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual) == true))) {
                ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(100.00, 100.00, 0.00), 1.0, 0.0));
            }

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/pcampaigntest.sc2map/MapScript.galaxy:882

            }
            else {
                if (((libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally) == true) || (libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual) == true))) {
                    ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(0.00, 100.00, 0.00), 1.0, 0.0));
                }

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/pcampaigntest.sc2map/MapScript.galaxy:882

            }
            else {
                if (((libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally) == true) || (libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual) == true))) {
                    ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(0.00, 100.00, 0.00), 1.0, 0.0));
                }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/paiur06.sc2mapMapScript.galaxy:3132

    // Conditions
    if (testConds) {
        if (!((EventUnitOwnerNew() == gv_pLAYER_08_NERAZIM))) {
            return false;
        }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pcampaigntest.sc2mapMapScript.galaxy:870

    }

    if ((EventUnitOwnerNew() == gv_pLAYER_01_USER)) {
        ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(0.00, 0.00, 100.00), 1.0, 0.0));
    }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pcampaigntest.sc2mapMapScript.galaxy:874

    }
    else {
        if (((libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy) == true) || (libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_EnemyMutual) == true))) {
            ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(100.00, 0.00, 0.00), 1.0, 0.0));
        }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pcampaigntest.sc2mapMapScript.galaxy:874

    }
    else {
        if (((libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Enemy) == true) || (libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_EnemyMutual) == true))) {
            ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(100.00, 0.00, 0.00), 1.0, 0.0));
        }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pcampaigntest.sc2mapMapScript.galaxy:878

        }
        else {
            if (((libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Neutral) == true) || (libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual) == true))) {
                ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(100.00, 100.00, 0.00), 1.0, 0.0));
            }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pcampaigntest.sc2mapMapScript.galaxy:878

        }
        else {
            if (((libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Neutral) == true) || (libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual) == true))) {
                ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(100.00, 100.00, 0.00), 1.0, 0.0));
            }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pcampaigntest.sc2mapMapScript.galaxy:882

            }
            else {
                if (((libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally) == true) || (libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual) == true))) {
                    ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(0.00, 100.00, 0.00), 1.0, 0.0));
                }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pcampaigntest.sc2mapMapScript.galaxy:882

            }
            else {
                if (((libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_Ally) == true) || (libNtve_gf_PlayerIsEnemy(EventUnitOwnerNew(), gv_pLAYER_01_USER, libNtve_ge_PlayerRelation_NeutralMutual) == true))) {
                    ActorSend(libNtve_gf_MainActorofUnit(EventUnit()), libNtve_gf_SetTintColor(Color(0.00, 100.00, 0.00), 1.0, 0.0));
                }

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

    }

    if ((PlayerGroupHasPlayer(libCOOC_gf_HumanPlayers(), EventUnitOwnerOld()) == false) && (PlayerGroupHasPlayer(libCOOC_gf_HumanPlayers(), EventUnitOwnerNew()) == true)) {
        libCOMU_gf_CT_RemoveAvenger(EventUnit());
        libCOMU_gf_CT_RemoveUnitSpeed(EventUnit());

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

    }

    if ((PlayerGroupHasPlayer(libCOOC_gf_HumanPlayers(), EventUnitOwnerOld()) == true) && (PlayerGroupHasPlayer(libCOOC_gf_HumanPlayers(), EventUnitOwnerNew()) == false)) {
        libCOMU_gf_CT_RemoveStructureStealBehavior(EventUnit());
    }

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicSystem.galaxy:765


    // Variable Initialization
    lv_playerNew = EventUnitOwnerNew();
    lv_playerOld = EventUnitOwnerOld();