# Last Created Mercenary

Grammar — Last created mercenary
FlagsNative | Function

Returns the last mercenary created using “Create Mercenary”.

Returns — int<preset::Mercenary>

native int MercenaryLastCreated();

Category: Story / Mercenary Panel

# Examples

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

            lv_indexMerc = libCamp_gv_tS_MercID[autoA433EE21_i];
            MercenaryCreate(PlayerGroupAll(), c_mercenaryStateDisabled);
            libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)] = MercenaryLastCreated();
            MercenarySetTitleText(MercenaryLastCreated(), libCamp_gf_MercName(lv_indexMerc));
            MercenarySetDescriptionText(MercenaryLastCreated(), libCamp_gf_MercDescription(lv_indexMerc));

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

            MercenaryCreate(PlayerGroupAll(), c_mercenaryStateDisabled);
            libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)] = MercenaryLastCreated();
            MercenarySetTitleText(MercenaryLastCreated(), libCamp_gf_MercName(lv_indexMerc));
            MercenarySetDescriptionText(MercenaryLastCreated(), libCamp_gf_MercDescription(lv_indexMerc));
            MercenarySetCost(MercenaryLastCreated(), libCamp_gf_MercCost(lv_indexMerc));

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

            libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)] = MercenaryLastCreated();
            MercenarySetTitleText(MercenaryLastCreated(), libCamp_gf_MercName(lv_indexMerc));
            MercenarySetDescriptionText(MercenaryLastCreated(), libCamp_gf_MercDescription(lv_indexMerc));
            MercenarySetCost(MercenaryLastCreated(), libCamp_gf_MercCost(lv_indexMerc));
            MercenarySetUnitText(MercenaryLastCreated(), libCamp_gf_MercUnitText(lv_indexMerc));

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

            MercenarySetTitleText(MercenaryLastCreated(), libCamp_gf_MercName(lv_indexMerc));
            MercenarySetDescriptionText(MercenaryLastCreated(), libCamp_gf_MercDescription(lv_indexMerc));
            MercenarySetCost(MercenaryLastCreated(), libCamp_gf_MercCost(lv_indexMerc));
            MercenarySetUnitText(MercenaryLastCreated(), libCamp_gf_MercUnitText(lv_indexMerc));
            MercenarySetSpecialText(MercenaryLastCreated(), libCamp_gf_MercSpecialText(lv_indexMerc));

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

            MercenarySetDescriptionText(MercenaryLastCreated(), libCamp_gf_MercDescription(lv_indexMerc));
            MercenarySetCost(MercenaryLastCreated(), libCamp_gf_MercCost(lv_indexMerc));
            MercenarySetUnitText(MercenaryLastCreated(), libCamp_gf_MercUnitText(lv_indexMerc));
            MercenarySetSpecialText(MercenaryLastCreated(), libCamp_gf_MercSpecialText(lv_indexMerc));
            MercenarySetModelLink(MercenaryLastCreated(), libCamp_gf_MercPortraitModel(lv_indexMerc));

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

            MercenarySetCost(MercenaryLastCreated(), libCamp_gf_MercCost(lv_indexMerc));
            MercenarySetUnitText(MercenaryLastCreated(), libCamp_gf_MercUnitText(lv_indexMerc));
            MercenarySetSpecialText(MercenaryLastCreated(), libCamp_gf_MercSpecialText(lv_indexMerc));
            MercenarySetModelLink(MercenaryLastCreated(), libCamp_gf_MercPortraitModel(lv_indexMerc));
            MercenarySetScenePath(MercenaryLastCreated(), libCamp_gf_MercVideo(lv_indexMerc));

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

            MercenarySetUnitText(MercenaryLastCreated(), libCamp_gf_MercUnitText(lv_indexMerc));
            MercenarySetSpecialText(MercenaryLastCreated(), libCamp_gf_MercSpecialText(lv_indexMerc));
            MercenarySetModelLink(MercenaryLastCreated(), libCamp_gf_MercPortraitModel(lv_indexMerc));
            MercenarySetScenePath(MercenaryLastCreated(), libCamp_gf_MercVideo(lv_indexMerc));
            auto90A2DADE_val = lv_indexMerc;

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

            MercenarySetSpecialText(MercenaryLastCreated(), libCamp_gf_MercSpecialText(lv_indexMerc));
            MercenarySetModelLink(MercenaryLastCreated(), libCamp_gf_MercPortraitModel(lv_indexMerc));
            MercenarySetScenePath(MercenaryLastCreated(), libCamp_gf_MercVideo(lv_indexMerc));
            auto90A2DADE_val = lv_indexMerc;
            if (auto90A2DADE_val == libCamp_ge_StoryMercID_MercKelmorianMercenaries) {

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

            auto90A2DADE_val = lv_indexMerc;
            if (auto90A2DADE_val == libCamp_ge_StoryMercID_MercKelmorianMercenaries) {
                MercenarySetScenePath(MercenaryLastCreated(), "Assets\\Textures\\merccontract_marines.ogv");
            }
            else if (auto90A2DADE_val == libCamp_ge_StoryMercID_MercHammerSecurities) {

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

            }
            else if (auto90A2DADE_val == libCamp_ge_StoryMercID_MercHammerSecurities) {
                MercenarySetScenePath(MercenaryLastCreated(), "Assets\\Textures\\merccontract_marauders.ogv");
            }
            else if (auto90A2DADE_val == libCamp_ge_StoryMercID_MercDevilDogs) {