# Alliance Aspect

Grammar — Player inSourcePlayer is giving player inTargetPlayer inAllianceId
FlagsNative | Function

Returns true of the source player is treating the target player with the specified alliance aspect. To check if two players are mutually treating each other with a given alliance aspect, use this function again with the players in reverse order.

# Arguments

  • int — Source Player
  • int<preset::AllianceAspect> — Alliance Aspect
  • int — Target Player

Returns — bool

native bool PlayerGetAlliance(
	int inSourcePlayer,
	int inAllianceId,
	int inTargetPlayer,
);

Category: Player / Alliances

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/thanson03b.sc2map/MapScript.galaxy:2433

        }

        if (!((PlayerGetAlliance(UnitGetOwner(EventUnit()), c_allianceIdPassive, gv_p01_USER) == false))) {
            return false;
        }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thanson03b.sc2mapMapScript.galaxy:2433

        }

        if (!((PlayerGetAlliance(UnitGetOwner(EventUnit()), c_allianceIdPassive, gv_p01_USER) == false))) {
            return false;
        }

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3828

    auto180886E4_val = lp_relation;
    if (auto180886E4_val == libNtve_ge_PlayerRelation_Ally) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_AllyMutual) {

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3828

    auto180886E4_val = lp_relation;
    if (auto180886E4_val == libNtve_ge_PlayerRelation_Ally) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_AllyMutual) {

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3831

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_AllyMutual) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdPassive, lp_sourcePlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdChat, lp_sourcePlayer));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Neutral) {

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3831

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_AllyMutual) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdPassive, lp_sourcePlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdChat, lp_sourcePlayer));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Neutral) {

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3831

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_AllyMutual) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdPassive, lp_sourcePlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdChat, lp_sourcePlayer));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Neutral) {

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3831

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_AllyMutual) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdPassive, lp_sourcePlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdChat, lp_sourcePlayer));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Neutral) {

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3834

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Neutral) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && !(PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer)));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_NeutralMutual) {

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3834

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Neutral) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && !(PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer)));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_NeutralMutual) {

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3837

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_NeutralMutual) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && !(PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer)) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdPassive, lp_sourcePlayer) && !(PlayerGetAlliance(lp_targetPlayer, c_allianceIdChat, lp_sourcePlayer)));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Enemy) {

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3837

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_NeutralMutual) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && !(PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer)) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdPassive, lp_sourcePlayer) && !(PlayerGetAlliance(lp_targetPlayer, c_allianceIdChat, lp_sourcePlayer)));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Enemy) {

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3182

    auto180886E4_val = lp_relation;
    if (auto180886E4_val == libNtve_ge_PlayerRelation_Ally) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_AllyMutual) {

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3182

    auto180886E4_val = lp_relation;
    if (auto180886E4_val == libNtve_ge_PlayerRelation_Ally) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_AllyMutual) {

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3185

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_AllyMutual) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdPassive, lp_sourcePlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdChat, lp_sourcePlayer));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Neutral) {

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3185

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_AllyMutual) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdPassive, lp_sourcePlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdChat, lp_sourcePlayer));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Neutral) {

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3185

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_AllyMutual) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdPassive, lp_sourcePlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdChat, lp_sourcePlayer));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Neutral) {

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3185

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_AllyMutual) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdPassive, lp_sourcePlayer) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdChat, lp_sourcePlayer));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Neutral) {

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3188

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Neutral) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && !(PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer)));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_NeutralMutual) {

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3188

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Neutral) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && !(PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer)));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_NeutralMutual) {

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3191

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_NeutralMutual) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && !(PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer)) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdPassive, lp_sourcePlayer) && !(PlayerGetAlliance(lp_targetPlayer, c_allianceIdChat, lp_sourcePlayer)));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Enemy) {

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3191

    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_NeutralMutual) {
        return (PlayerGetAlliance(lp_sourcePlayer, c_allianceIdPassive, lp_targetPlayer) && !(PlayerGetAlliance(lp_sourcePlayer, c_allianceIdChat, lp_targetPlayer)) && PlayerGetAlliance(lp_targetPlayer, c_allianceIdPassive, lp_sourcePlayer) && !(PlayerGetAlliance(lp_targetPlayer, c_allianceIdChat, lp_sourcePlayer)));
    }
    else if (auto180886E4_val == libNtve_ge_PlayerRelation_Enemy) {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:7456


    // Implementation
    lv_targetIsAllied = PlayerGetAlliance(lp_pingingPlayer, c_allianceIdChat, UnitGetOwner(lp_targetUnit));
    if ((lv_targetIsAllied == true)) {
        lv_colorForTarget = StringExternal("Param/Value/lib_UIUI_1C2DFD0A");

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:15671

        }
    }
    lv_isAlly = PlayerGetAlliance(lv_clickingPlayerID, c_allianceIdChat, lv_targetPlayerID);
    if ((lv_isAlly == true)) {
        libUIUI_gf_PartyFrameAllyPing(lv_clickingPlayerID, lv_targetUnit, lv_targetPlayerID, lv_itRosterIndex, lv_vikingIndex);

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCUI.galaxy:6591

        }

        if (!((PlayerGetAlliance(UnitGetOwner(libNCUI_gv_NU_BB_Boss), c_allianceIdPassive, 1) == true))) {
            return false;
        }

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

        return ;
    }
    if ((PlayerGetAlliance(lv_aIPlayer, c_allianceIdVision, lv_humanPlayer) == true)) {
        PlayerGroupAdd(libCOMI_gv_cM_SharedVisionPlayers[lv_humanPlayer], lv_aIPlayer);
        if ((libCOMI_gv_cM_VisionShareEnabled == false)) {

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

            lv_indexPlayer = PlayerGroupNextPlayer(autoCE320598_g, lv_indexPlayer);
            if (lv_indexPlayer < 0) { break; }
            if ((PlayerGroupHasPlayer(libCOOC_gf_HumanPlayers(), lv_indexPlayer) == false) && (PlayerGetAlliance(lv_indexPlayer, c_allianceIdVision, lv_humanPlayer) == true)) {
                PlayerGroupAdd(libCOMU_gv_cT_MutatorVisionPlayers[lv_humanPlayer], lv_indexPlayer);
                PlayerSetAlliance(lv_indexPlayer, c_allianceIdVision, lv_humanPlayer, false);