# Set Mercenary State

Grammar — Set the state of mercenaryId to state
FlagsNative | Action

Sets the visibility state for the specified mercenary.

# Arguments

Returns — void

native void MercenarySetState(
	int inMercenaryId,
	int inState,
);

Category: Story / Mercenary Panel

# Examples

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

        MercenarySetModelLink(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], libCamp_gf_MercPortraitModel(lv_indexMerc));
        if ((libCamp_gf_MercStatusCheck(lv_indexMerc, libCamp_ge_StoryMercStatus_Available) == true)) {
            MercenarySetState(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], c_mercenaryStateEnabled);
            if ((libCamp_gf_MercCost(lv_indexMerc) > libCamp_gf_StoryCredits())) {
                MercenarySetImageFilePath(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], libCamp_gv_tS_MercNoCreditImage[(lv_indexMerc)]);

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

        }
        else if ((libCamp_gf_MercStatusCheck(lv_indexMerc, libCamp_ge_StoryMercStatus_New) == true)) {
            MercenarySetState(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], c_mercenaryStateNew);
            if ((libCamp_gf_MercCost(lv_indexMerc) > libCamp_gf_StoryCredits())) {
                MercenarySetImageFilePath(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], libCamp_gv_tS_MercNoCreditImage[(lv_indexMerc)]);

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

        }
        else if ((libCamp_gf_MercStatusCheck(lv_indexMerc, libCamp_ge_StoryMercStatus_Locked) == true)) {
            MercenarySetState(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], c_mercenaryStateDisabled);
        }
        else if ((libCamp_gf_MercStatusCheck(lv_indexMerc, libCamp_ge_StoryMercStatus_Purchased) == true)) {

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

        }
        else if ((libCamp_gf_MercStatusCheck(lv_indexMerc, libCamp_ge_StoryMercStatus_Purchased) == true)) {
            MercenarySetState(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], c_mercenaryStatePurchased);
            MercenarySetImageFilePath(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], libCamp_gv_tS_MercHiredImage[(lv_indexMerc)]);
            MercenarySetModelLink(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], "Invisible");

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;
}