# Purchase Mercenary
Grammar — Purchase mercenaryId
Flags —Native
|Action
Convenience function to mark the specified mercenary as purchased, recently purchased, and play the purchase animation on it.
# Arguments
int
<preset::Mercenary> — MercenaryId
Returns — void
native void MercenaryPurchase(int inMercenaryId);
# Related
Category: Story / Mercenary Panel
- Mercenary Panel Exited —
void
— TriggerAddEventMercenaryPanelExit - Mercenary Panel Purchase —
void
— TriggerAddEventMercenaryPanelPurchase - Mercenary Panel Selection Changed —
void
— TriggerAddEventMercenaryPanelSelectionChanged - Create Mercenary —
void
— MercenaryCreate - Last Created Mercenary —
int
<preset::Mercenary> — MercenaryLastCreated - Destroy Mercenary —
void
— MercenaryDestroy - Set Mercenary Title Text —
void
— MercenarySetTitleText - Set Mercenary Unit Text —
void
— MercenarySetUnitText - Set Mercenary CostText —
void
— MercenarySetCostText - Set Mercenary Description Text —
void
— MercenarySetDescriptionText - Set Mercenary Special Text —
void
— MercenarySetSpecialText - Set Mercenary Availability Text —
void
— MercenarySetAvailabilityText - Set Mercenary Cost —
void
— MercenarySetCost - Set Mercenary State —
void
— MercenarySetState - Set Mercenary Portrait Image —
void
— MercenarySetImageFilePath - Set Mercenary Portrait Model —
void
— MercenarySetModelLink - Set Mercenary Scene —
void
— MercenarySetScenePath - Set Mercenary Player Group —
void
— MercenarySetPlayerGroup - Set Mercenary Recently Purchased —
void
— MercenarySetRecentlyPurchased - Mercenary Is Recently Purchased —
bool
— MercenaryIsRecentlyPurchased - Purchase Mercenary —
void
— MercenaryPurchase - Set Selected Mercenary —
void
— MercenarySetSelected - Enable/Disable Mercenary Panel Close Button —
void
— MercenaryPanelSetCloseButtonEnabled - Enable/Disable Mercenary Panel Dismiss Button —
void
— MercenaryPanelSetDismissButtonEnabled - Selected Mercenary —
int
<preset::Mercenary> — MercenaryGetSelected
# Examples
campaigns/libertystory.sc2campaign — base.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.sc2campaign — base.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");