# Purchase Mercenary

Grammar — Purchase mercenaryId
FlagsNative | Action

Convenience function to mark the specified mercenary as purchased, recently purchased, and play the purchase animation on it.

# Arguments

Returns — void

native void MercenaryPurchase(int inMercenaryId);

Category: Story / Mercenary Panel

# Examples

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

    libCamp_gf_SetMercStatus(lp_mercGifted, libCamp_ge_StoryMercStatus_Purchased);
    libCamp_gf_TS_AddRecentMerc(lp_mercGifted);
    MercenaryPurchase(libCamp_gv_tS_MercUIMercenaries[(lp_mercGifted)]);
}

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

    PlayerModifyPropertyInt(1, c_playerPropCredits, c_playerPropOperSetTo, libCamp_gf_StoryCredits());
    libCamp_gf_TS_AddRecentMerc(lv_mercBought);
    MercenaryPurchase(libCamp_gv_tS_MercUIMercenaries[(lv_mercBought)]);
    MercenarySetImageFilePath(libCamp_gv_tS_MercUIMercenaries[(lv_mercBought)], libCamp_gv_tS_MercHiredImage[(lv_mercBought)]);
    MercenarySetModelLink(libCamp_gv_tS_MercUIMercenaries[(lv_mercBought)], "Invisible");