# Selected Mercenary

Grammar — Currently selected mercenary by player player
FlagsNative | Function

Returns the mercenary the specified player currently has selected.

# Arguments

  • int — Player

Returns — int<preset::Mercenary>

native int MercenaryGetSelected(int player);

Category: Story / Mercenary Panel

# Examples

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:12151

    // Conditions
    if (testConds) {
        if (!((libCamp_gf_MercStatusCheck(libCamp_gv_tS_MercID[(MercenaryGetSelected(1))], libCamp_ge_StoryMercStatus_New) == true))) {
            return false;
        }

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:12161

    }

    libCamp_gf_SetMercStatus(libCamp_gv_tS_MercID[(MercenaryGetSelected(1))], libCamp_ge_StoryMercStatus_Available);
    MercenarySetState(MercenaryGetSelected(1), c_mercenaryStateEnabled);
    return true;

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:12162


    libCamp_gf_SetMercStatus(libCamp_gv_tS_MercID[(MercenaryGetSelected(1))], libCamp_ge_StoryMercStatus_Available);
    MercenarySetState(MercenaryGetSelected(1), c_mercenaryStateEnabled);
    return true;
}

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:12197

    while (auto2FC87EAD_i <= libCamp_gv_TSC_MERC_LAST) {
        lv_indexMerc = libCamp_gv_tS_MercID[auto2FC87EAD_i];
        if ((MercenaryGetSelected(1) == libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)])) {
            lv_mercBought = lv_indexMerc;
            break;