# Selected Mercenary
Grammar — Currently selected mercenary by player player
Flags —Native
|Function
Returns the mercenary the specified player currently has selected.
# Arguments
int
— Player
Returns — int
<preset::Mercenary>
native int MercenaryGetSelected(int player);
# 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:12151
// Conditions
if (testConds) {
if (!((libCamp_gf_MercStatusCheck(libCamp_gv_tS_MercID[(MercenaryGetSelected(1))], libCamp_ge_StoryMercStatus_New) == true))) {
return false;
}
campaigns/libertystory.sc2campaign — base.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.sc2campaign — base.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.sc2campaign — base.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;