# Alliance Aspect
Grammar — Player inSourcePlayer is giving player inTargetPlayer inAllianceId
Flags —Native
|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 Playerint
<preset::AllianceAspect> — Alliance Aspectint
— Target Player
Returns — bool
native bool PlayerGetAlliance(
int inSourcePlayer,
int inAllianceId,
int inTargetPlayer,
);
# Related
Category: Player / Alliances
- Player Changes Alliances —
void
— TriggerAddEventPlayerAllianceChange - Set Alliance —
void
— libNtve_gf_SetAlliance - Set Alliance (One-Way) —
void
— libNtve_gf_SetAllianceOneWay - Set Alliance Aspect —
void
— PlayerSetAlliance - Set Alliance For Player Group —
void
— libNtve_gf_SetPlayerGroupAlliance - Set Alliance Between Two Player Groups —
void
— libNtve_gf_SetAllianceBetweenTwoPlayerGroups - Set Alliance Aspect For Player Group —
void
— libNtve_gf_SetAllianceAspectForPlayerGroup - Alliance Aspect —
bool
— PlayerGetAlliance - Get Relationship Between Players —
bool
— libNtve_gf_PlayerIsEnemy
# Examples
campaigns/liberty.sc2campaign — base.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.sc2map — MapScript.galaxy:2433
}
if (!((PlayerGetAlliance(UnitGetOwner(EventUnit()), c_allianceIdPassive, gv_p01_USER) == false))) {
return false;
}
mods/core.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.stormmod — base.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.sc2mod — base.sc2data/LibNCUI.galaxy:6591
}
if (!((PlayerGetAlliance(UnitGetOwner(libNCUI_gv_NU_BB_Boss), c_allianceIdPassive, 1) == true))) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.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.sc2mod — base.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);