include "TriggerLibs/NativeLib"
include "TriggerLibs/LibertyLib"

//--------------------------------------------------------------------------------------------------
// Library: Campaign
//--------------------------------------------------------------------------------------------------
// Constants
const fixed libCamp_gv_campaignObjectiveDelay = 2.0;
const fixed libCamp_gv_campaignHintDelay = 2.0;
const fixed libCamp_gv_campaignSecretDelay = 5.0;
const fixed libCamp_gv_campaignAchievementDelay = 2.0;
const int libCamp_gv__CBC_LINEMAX = 500;
const fixed libCamp_gv__CBC_LINE_DEFAULT_DURATION = 8.0;
const fixed libCamp_gv__CBC_LINE_DEFAULT_TEXTSIZE = 10.0;
const color libCamp_gv__CBC_LINE_DEFAULT_TEXTCOLOR = Color(0,0,0);
const color libCamp_gv__CBC_LINE_DEFAULT_BGCOLOR = Color(100,100,100);
const int libCamp_gv__CBC_UNITMAX = 100;
const int libCamp_gv__CBC_PLAYERMAX = 16;
const fixed libCamp_gv__CBC_UNIT_DEFAULT_ACTIVATIONDISTANCE = 12.0;
const int libCamp_gv__CBC_WAITSOUNDCOUNTMAX = 30;
const fixed libCamp_gv_gRIDDLG_GRID = 60.0;
const fixed libCamp_gv_gRIDDLG_GRIDGAP_X = 10.0;
const fixed libCamp_gv_gRIDDLG_GRIDGAP_Y = 10.0;
const fixed libCamp_gv_gRIDDLG_MARGINE_X = 50.0;
const fixed libCamp_gv_gRIDDLG_MARGINE_Y = 40.0;
const int libCamp_gv_tSC_MAXMAPACHIEVEMENT = 4;
const int libCamp_gv_tS_RecentTechMax = 6;
const int libCamp_gv_tS_RecentMercMax = 2;
const int libCamp_gv_tS_RecentResearchMax = 2;
const int libCamp_gv_TSC_MAP_FIRST = 1;
const int libCamp_gv_TSC_MISSIONOBJECTIVECOUNT = 5;
const int libCamp_gv_TSC_MERC_FIRST = 1;
const int libCamp_gv_TSC_MERC_LAST2 = 3;
const int libCamp_gv_TSC_MERC_LAST22 = 2;
const int libCamp_gv_TSC_OBJECTIVE_FIRST = 1;
const int libCamp_gv_TSC_RESEARCH_FIRST = 1;
const int libCamp_gv_tSC_RESEARCH_MISSIONCOUNT = 3;
const int libCamp_gv_tSC_RESEARCH_TIERLEVEL = 5;
const int libCamp_gv_TSC_SCENE_FIRST = 1;
const int libCamp_gv_TSC_STORYSTATE_FIRST = 1;
const int libCamp_gv_tSC_PLANET_FIRST = 1;
const int libCamp_gv_TSC_TECHCATEGORY_FIRST = 1;
const int libCamp_gv_TSC_TECHGROUP_FIRST = 1;
const int libCamp_gv_TSC_TECH_FIRST = 1;
const int libCamp_gv_tSC_TECH_AC_COUNT = 4;
const int libCamp_gv_tSC_TECH_UG_COUNT = 2;
const int libCamp_gv_tSC_HelpUnitsPanel_EnabledUnitTypesCountMax = 100;
const string libCamp_gv_tS_BankName = "TCampaign";
const string libCamp_gv_cPC_BANKNAME = "CampaignPS";
const bool libCamp_gv_cPC_CAMPAIGNBANKREADY = false;
const int libCamp_gv_tSC_Tutorial_HistoryMaxCount = 100;

// Variables
point libCamp_gv__TP_DropPod_Location;
unitgroup libCamp_gv__TP_DropPod_Units;
bool libCamp_gv_tS_MissionVictoryActionQueyeEmpty;
int libCamp_gv_tS_MissionCompleteTime;
int libCamp_gv_tS_MissionAutoSaveIndex;
int libCamp_gv_zS_ObjectivePanel;
text[501] libCamp_gv__CB_Line;
color[501] libCamp_gv__CB_Line_TextColor;
color[501] libCamp_gv__CB_Line_BGColor;
string[501] libCamp_gv__CB_Line_AnimationStart;
int[501] libCamp_gv__CB_Line_AnimationStartOptions;
string[501] libCamp_gv__CB_Line_AnimationEnd;
int[501] libCamp_gv__CB_Line_AnimationEndOptions;
soundlink[501] libCamp_gv__CB_Line_Sound;
fixed[501] libCamp_gv__CB_Line_Duration;
int[501] libCamp_gv__CB_Line_DurationType;
bool[501] libCamp_gv__CB_Line_FaceOption;
point[501] libCamp_gv__CB_Line_FaceLocation;
trigger[501] libCamp_gv__CB_Line_TriggerStart;
trigger[501] libCamp_gv__CB_Line_TriggerEnd;
int libCamp_gv__CB_Line_Last;
unit[101] libCamp_gv__CB_Unit;
int libCamp_gv__CB_Unit_Count;
fixed[101] libCamp_gv__CB_Unit_OriginalFacing;
playergroup[101] libCamp_gv__CB_Unit_ActivationPlayerGroup;
fixed[101][17] libCamp_gv__CB_Unit_ActivationDistance;
int[101][17] libCamp_gv__CB_Unit_LineCount;
int[101][17] libCamp_gv__CB_Unit_LineCurrent;
int[101][17] libCamp_gv__CB_Unit_UnitLine_StartIndex;
int[501] libCamp_gv__CB_UnitLine;
int libCamp_gv__CB_UnitLine_Count;
unit[33] libCamp_gv__CB_Current_ChatBubbleTarget;
int[33] libCamp_gv__CB_Current_ChatBubble;
sound[33] libCamp_gv__CB_Current_Sound;
int[33] libCamp_gv__CB_Current_UnitIndex;
int[33] libCamp_gv__CB_Current_LineIndex;
unit libCamp_gv__CB_TP_UNIT;
int libCamp_gv__CB_TP_PLAYER;
bool libCamp_gv__CB_TP_FORCED;
text libCamp_gv__CB_TP_TEXT;
soundlink libCamp_gv__CB_TP_SOUNDLINK;
fixed libCamp_gv__CB_TP_DURATION;
int libCamp_gv__CB_TP_DURATIONTYPE;
int libCamp_gv__CB_TP_TEXTTAG;
bool[101] libCamp_gv__CB_WaitSoundDone;
int libCamp_gv__CB_WaitSoundID;
int libCamp_gv__CB_TP_WAITSOUND_ID;
sound libCamp_gv__CB_TP_WAITSOUND;
fixed libCamp_gv__CB_TP_WAITSOUND_DURATION;
int libCamp_gv__CB_TP_WAITSOUND_DURATIONTYPE;
int libCamp_gv__MsgDlg;
int libCamp_gv__MsgDlgButton;
bool libCamp_gv__MsgDlgOpened;
int libCamp_gv_zS_CampaignTrialEndDialog;
int libCamp_gv_zS_CampaignTrialEndPanel;
int libCamp_gv_zS_CampaignTrialEndUpgradeButton;
int libCamp_gv_zS_CampaignTrialEndQuitButton;
string[36][5] libCamp_gv_tS_MapAchievements;
int[11] libCamp_gv_tSX_RecentTech;
int[3] libCamp_gv_tSX_RecentMerc;
int[3] libCamp_gv_tSX_RecentResearch;
int libCamp_gv_tS_ConvoCount;
string[51] libCamp_gv_tS_Convos;
int libCamp_gv_TSC_MAP_LAST;
int libCamp_gv_TSC_MISSION_FIRST;
int libCamp_gv_TSC_MISSION_LAST;
int libCamp_gv_tS_CurrentMap;
int[36] libCamp_gv_tS_MapID;
int[36] libCamp_gv_tS_MapType;
string[36] libCamp_gv_tS_MapConvoID;
text[36] libCamp_gv_tS_MapSubtitle;
string[36] libCamp_gv_tS_MapFile;
text[36] libCamp_gv_tS_MapProgressCheatName;
string[36] libCamp_gv_tS_MapLoadingScreenImage;
string[36] libCamp_gv_tS_MapBackLoadingImage;
string[36] libCamp_gv_tS_MapBackDefeatLoadingImage;
text[36] libCamp_gv_tS_MissionSummary;
int[36] libCamp_gv_tS_MissionLocation;
int[36] libCamp_gv_tS_MissionContact;
bool[36] libCamp_gv_tS_MissionIsRequired;
text[36] libCamp_gv_tS_MissionEnemyForces;
int[36][6] libCamp_gv_tS_MissionObjectives;
string[36] libCamp_gv_tS_MissionPitches;
int[36][4] libCamp_gv_tS_MissionTechUnitsEnabled;
trigger[36] libCamp_gv_tS_MissionBriefing;
trigger[36] libCamp_gv_tS_MissionBriefingPreload;
trigger[36] libCamp_gv_tS_MissionBriefingPreloadRough;
trigger[36] libCamp_gv_tS_MissionABChoice;
string[36] libCamp_gv_tS_MissionBattleReportImage;
string[36] libCamp_gv_tS_MissionBattleReportIcon;
int[36] libCamp_gv_tS_ExpectedCreditsPoor;
int[36] libCamp_gv_tS_ExpectedCreditsAvg;
int[36] libCamp_gv_tS_ExpectedCreditsRich;
text[151] libCamp_gv_tS_ContactName;
string[151] libCamp_gv_tS_ContactPortrait;
string[151] libCamp_gv_tS_ContactStateIndex;
int[36] libCamp_gv_tSX_MissionDoneAge;
int[36] libCamp_gv_tSX_MissionSkipAge;
bool[36][6] libCamp_gv_tSX_MissionDifficultyCompleted;
int[36][6] libCamp_gv_tSX_MissionDifficultyBestTime;
int libCamp_gv_tSX_LastMap;
bool libCamp_gv_tSX_LastMapSuccess;
int libCamp_gv_tSX_LastMission;
bool libCamp_gv_tSX_LastMissionSuccess;
bool libCamp_gv_tSX_LastMissionSimulation;
int libCamp_gv_tS_MissionABChoiceResult;
int libCamp_gv_TSC_MERC_LAST;
int[17] libCamp_gv_tS_MercID;
text[17] libCamp_gv_tS_MercNames;
text[17] libCamp_gv_tS_MercDescriptions;
int[17] libCamp_gv_tS_MercCost;
int[17][3] libCamp_gv_tS_MercTechSubGroup;
int[17][3] libCamp_gv_tS_MercUnitCount;
text[17] libCamp_gv_tS_MercUnitText;
string[17] libCamp_gv_tS_MercUnitType;
text[17] libCamp_gv_tS_MercAvailabilityText;
text[17] libCamp_gv_tS_MercSpecialText;
string[17] libCamp_gv_tS_MercPortrait;
string[17] libCamp_gv_tS_MercVideo;
abilcmd[17][4] libCamp_gv_tS_MercAbilityCommands;
string[17] libCamp_gv_tS_MercUpgrade;
string[17] libCamp_gv_tS_MercHiredImage;
string[17] libCamp_gv_tS_MercNoCreditImage;
int[17] libCamp_gv_tSX_MercStatus;
bool libCamp_gv_tS_MercUICreated;
int[11] libCamp_gv_tS_MercUIMercenaries;
trigger libCamp_gv_tS_MercUIExitCallback;
int[51] libCamp_gv_tS_BattleReportMissions;
int[31] libCamp_gv_tS_BattleReportScenes;
bool libCamp_gv_tS_BattleReportReady;
trigger libCamp_gv_tS_BattleReportSceneFinishCallback;
trigger libCamp_gv_tS_BattleReportPanelLeaveCallback;
trigger[36] libCamp_gv_tS_MissionDebriefingCallbacks;
int libCamp_gv_TSC_OBJECTIVE_LAST;
int[101] libCamp_gv_tSX_MissionObjState;
text[101] libCamp_gv_tSX_MissionObjName;
bool[101] libCamp_gv_tSX_MissionObjIsPrimary;
bool[101] libCamp_gv_tS_MissionObjIsRegistered;
int[101] libCamp_gv_tS_MissionObjObjective;
int[101] libCamp_gv_tS_MissionObjMap;
int[101] libCamp_gv_tS_MissionObjIDs;
string[101] libCamp_gv_tS_MissionObjConvoID;
int[101] libCamp_gv_tS_MissionObjProgressCurrent;
int libCamp_gv_tSX_MissionObjRewardsEarnedCurrent;
int libCamp_gv_TSC_RESEARCH_LAST;
int[31] libCamp_gv_tS_ResearchID;
int[4][11][4] libCamp_gv_tS_ResearchIDInUIStructure;
string[31] libCamp_gv_tS_ResearchConvoID;
int[31] libCamp_gv_tS_ResearchCategory;
int[31] libCamp_gv_tS_ResearchSlot;
int[31] libCamp_gv_tS_ResearchUIItem;
text[31] libCamp_gv_tS_ResearchConfirmationText;
int[26] libCamp_gv_tS_ResearchObjID;
string[26] libCamp_gv_tS_ResearchObjConvoID;
int[31] libCamp_gv_tSX_ResearchState;
int[36][3] libCamp_gv_tS_ResearchMissionObjects;
int[36][3] libCamp_gv_tS_ResearchMissionObjectCount;
int[36][3] libCamp_gv_tSX_ResearchMissionProgress;
int[3] libCamp_gv_tS_ResearchMissionProgressCurrent;
int[3] libCamp_gv_tSX_ResearchPointsConverted;
int[3] libCamp_gv_tSX_ResearchPointsOld;
bool libCamp_gv_tS_ResearchUICreated;
int[3] libCamp_gv_tS_ResearchUICategories;
int[3][6] libCamp_gv_tS_ResearchUITiers;
trigger libCamp_gv_tS_ResearchUIExitCallback;
bool libCamp_gv_tS_ResearchUIExitEnabled;
int[3] libCamp_gv_tSX_ResearchUIOldPoints;
int libCamp_gv_tS_RoomChangeDialog;
int libCamp_gv_tS_RoomChangeDialogBorder;
int libCamp_gv_tS_RoomChangeDialogSubtitle;
int[11] libCamp_gv_tS_RoomChangeButtonCustomData;
int[11] libCamp_gv_tS_RoomChangeButtons;
int[11] libCamp_gv_tS_RoomChangeButtonText;
text[11] libCamp_gv_tS_RoomChangeButtonNames;
int[11] libCamp_gv_tS_RoomChangeButtonBG;
bool[11] libCamp_gv_tS_RoomChangeButtonFlashing;
trigger[11] libCamp_gv_tS_RoomChangeButtonCallbackClick;
trigger[11] libCamp_gv_tS_RoomChangeButtonCallbackUpdate;
int libCamp_gv_tS_RoomChangeButtonCount;
int libCamp_gv_tS_RoomChangeButtonCurrent;
int libCamp_gv_TSC_SCENE_LAST;
int[31] libCamp_gv_tS_SceneIDs;
text[31] libCamp_gv_tS_SceneNames;
string[31] libCamp_gv_tS_SceneImages;
string[31] libCamp_gv_tS_SceneIcon;
trigger[31] libCamp_gv_tS_SceneCallback;
bool[31] libCamp_gv_tSX_ScenePlayed;
string libCamp_gv_tS_CurrentAmbienceLink;
bool libCamp_gv_tS_InStoryMode;
int libCamp_gv_TSC_STORYSTATE_LAST;
int libCamp_gv_tSX_CampaignDifficulty;
string[41] libCamp_gv_tS_StoryStateConvoID;
int libCamp_gv_tSC_PLANET_LAST;
int[51] libCamp_gv_tS_PlanetID;
int[51] libCamp_gv_tS_PlanetMission;
soundlink[51] libCamp_gv_tS_PlanetAmbientSound;
string[51] libCamp_gv_tS_PlanetModel;
string[51] libCamp_gv_tS_PlanetButtonModel;
string[51] libCamp_gv_tS_PlanetLighting;
text[51] libCamp_gv_tS_PlanetSubtitle;
text[51] libCamp_gv_tS_PlanetName;
string[51] libCamp_gv_tS_PlanetImage;
trigger libCamp_gv_tS_TechLimitsCallback;
trigger libCamp_gv_tS_TechExitCallback;
int libCamp_gv_TSC_TECHCATEGORY_LAST;
int[11] libCamp_gv_tS_TechCategoryID;
text[11] libCamp_gv_tS_TechCategoryName;
int[11] libCamp_gv_tS_TechCategorySlot;
int[11] libCamp_gv_tS_TechCategory_UI;
int[11] libCamp_gv_tSX_TechCategoryCount;
int libCamp_gv_TSC_TECHGROUP_LAST;
int[51] libCamp_gv_tS_TechGroupID;
int[51] libCamp_gv_tS_TechGroupCategoryID;
string[51] libCamp_gv_tS_TechGroupUnitType;
text[51] libCamp_gv_tS_TechGroupName;
text[51] libCamp_gv_tS_TechGroupDescription;
text[51] libCamp_gv_tS_TechGroupTooltip;
string[51] libCamp_gv_tS_TechGroupIcon;
string[51] libCamp_gv_tS_TechGroupIconBig;
bool[51] libCamp_gv_tS_TechGroupShowOnReport;
int[51] libCamp_gv_tS_TechGroupState;
int[51] libCamp_gv_tS_TechGroup_UI;
bool[51] libCamp_gv_tSX_TechGroup_UI_New;
int libCamp_gv_TSC_TECH_LAST;
int[101] libCamp_gv_tS_TechID;
int[101] libCamp_gv_tS_Tech_GroupID;
string[101] libCamp_gv_tS_Tech_ConvoID;
int[101] libCamp_gv_tS_Tech_Requires;
int[101] libCamp_gv_tS_Tech_UI;
int[101] libCamp_gv_tSX_Tech_Status;
int libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypesCount;
string[101] libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypes;
bool libCamp_gv_tS_UpgradeInfantry2;
bool libCamp_gv_tS_UpgradeInfantry3;
bool libCamp_gv_tS_UpgradeVehicle2;
bool libCamp_gv_tS_UpgradeVehicle3;
bool libCamp_gv_tS_UpgradeShip2;
bool libCamp_gv_tS_UpgradeShip3;
bool libCamp_gv_tSX_IsSimulation;
bool libCamp_gv_tSX_IsVictoryPlayAgain;
string libCamp_gv_tSX_RoomStates;
trigger libCamp_gv_tS_RoomStatesDefaultCallback;
int libCamp_gv_debug_MapIDForPerfTest;
bank[36] libCamp_gv_tS_MissionBanks;
int[101] libCamp_gv_tS_NonSnapShotObjectiveStates;
int[101] libCamp_gv_tS_NonSnapShotObjectiveProgress;
bool libCamp_gv_tS_NonSnapShotMissionDifficultyCompleted;
int libCamp_gv_tS_NonSnapShotMissionBestTime;
int[3] libCamp_gv_tS_NonSnapShotMissionResearchProgress;
bool libCamp_gv_tS_Horner05sSimulationBeforeCompleted;
string[11][41] libCamp_gv_tS_StoryRoomUnitTypes;
int[11] libCamp_gv_tS_StoryRoomUnitTypeCount;
string[41] libCamp_gv_tS_StoryActorUnitTypes;
int libCamp_gv_tSX_LoadingImageCurrentHyperion;
string[11] libCamp_gv_tS_LoadingImagesLab;
int libCamp_gv_tS_LoadingImageCountLab;
int libCamp_gv_tSX_LoadingImageCurrentLab;
string[11] libCamp_gv_tS_LoadingImagesCantina;
int libCamp_gv_tS_LoadingImageCountCantina;
int libCamp_gv_tSX_LoadingImageCurrentCantina;
string[11] libCamp_gv_tS_LoadingImagesArmory;
int libCamp_gv_tS_LoadingImageCountArmory;
int libCamp_gv_tSX_LoadingImageCurrentArmory;
string[11] libCamp_gv_tS_LoadingImagesChar;
int libCamp_gv_tS_LoadingImageCountChar;
int libCamp_gv_tSX_LoadingImageCurrentChar;
int libCamp_gv_tS_LoadingImageCountHyperion;
string[11] libCamp_gv_tS_LoadingImagesHyperion;
int libCamp_gv_tSX_LoadingImageCurrentMarSara;
int libCamp_gv_tS_LoadingImageCountMarSara;
string[11] libCamp_gv_tS_LoadingImagesMarSara;
bool libCamp_gv_cPX_CampaignCompleted;
bank libCamp_gv_cP_Bank;
int libCamp_gv_tSX_Tutorial_HistoryCount;
text[101] libCamp_gv_tSX_Tutorial_HistoryTitle;
text[101] libCamp_gv_tSX_Tutorial_HistoryDescription;
string[101] libCamp_gv_tSX_Tutorial_HistoryIcon;
string[101] libCamp_gv_tSX_Tutorial_HistoryMovie;
bool[21] libCamp_gv_tS_StoryUIVisibility_Menu;
bool[21] libCamp_gv_tS_StoryUIVisibility_Cash;
bool[21] libCamp_gv_tS_StoryUIVisibility_RoomChange;
bool[21] libCamp_gv_tS_StoryUIVisibility_Tip;
int libCamp_gv_tS_StoryUIVisibilityCounter;
bool libCamp_gv_tS_EndCinematicFinished;
bool libCamp_gv_tS_EndCreditFinished;
bool[36][36] libCamp_gv_tS_DebugProgressMissionPathEarly;
bool[36][36] libCamp_gv_tS_DebugProgressMissionPathAverage;
bool[36][36] libCamp_gv_tS_DebugProgressMissionPathLate;
int libCamp_gv_tS_DebugProgressDialog;
int libCamp_gv_tS_DebugProgressImageCurrent;
int libCamp_gv_tS_DebugProgressImageOK;
int libCamp_gv_tS_DebugProgressButtonOK;
int libCamp_gv_tS_DebugProgressLabelWarning;
int libCamp_gv_tS_DebugProgressLabelsCompleted;
int libCamp_gv_tS_DebugProgressButtonCancel;
int libCamp_gv_tS_DebugProgressButtonReset;
int libCamp_gv_tS_DebugProgressButtonResetTech;
int libCamp_gv_tS_DebugProgressButtonLaunchMission;
int[51] libCamp_gv_tS_DebugProgressMissionButtons;
int libCamp_gv_tS_DebugProgressMissionButtonUnlockSecret;
int[51] libCamp_gv_tS_DebugProgressMissionLabelsStates;
int[51] libCamp_gv_tS_DebugProgressMissionLabelsUnits;
int[51] libCamp_gv_tS_DebugProgressMissionLabelsCredits;
int[51] libCamp_gv_tS_DebugProgressMissionLabelsRequirement;
int libCamp_gv_tS_DebugProgressMissionLabelsUnlocked;
int libCamp_gv_tS_DebugProgressLastMission;
int libCamp_gv_tS_DebugProgressLastCreditMission;
int libCamp_gv_tS_DebugProgressCurrentMission;
trigger libCamp_gv_tS_DebugProgressExitCallbackOK;
trigger libCamp_gv_tS_DebugProgressExitCallbackCancel;
bool libCamp_gv_tS_DebugProgressDialogOpened;
bool libCamp_gv_tS_DebugProgressCheating;
bool libCamp_gv_tS_DebugProgressResetUsed;
int[8] libCamp_gv_tS_DebugProgressMissionOptions;
int[8] libCamp_gv_tS_DebugProgressMissionLaunchButtons;
int libCamp_gv_tS_DebugProgressMissionLaunchCancel;
int libCamp_gv_tS_DebugProgressMissionLaunchDialog;
bool libCamp_gv_tS_DebugProgressLaunchingMission;
bank libCamp_gv_tS_DebugProgressBank;
int libCamp_gv_tS_DebugResearchDialogProtoss;
int libCamp_gv_tS_DebugResearchButtonProtossPlus;
int libCamp_gv_tS_DebugResearchButtonProtossMinus;
int libCamp_gv_tS_DebugResearchButtonProtossReset;
int libCamp_gv_tS_DebugResearchDialogZerg;
int libCamp_gv_tS_DebugResearchButtonZergPlus;
int libCamp_gv_tS_DebugResearchButtonZergMinus;
int libCamp_gv_tS_DebugResearchButtonZergReset;
int[3] libCamp_gv_tSX_DebugResearchLevel;
int libCamp_gv_tS_DebugMercenaryDialog;
int libCamp_gv_tS_DebugMercenaryButtonReset;
int libCamp_gv_tS_DebugMercenaryButtonCredits;
bool libCamp_gv_tS_DebugBuyTechActive;
int libCamp_gv_tS_DebugBuyTechDialog;
int libCamp_gv_tS_DebugBuyTechTitleUnitCredits;
int libCamp_gv_tS_DebugBuyTechButtonUnitsUnlock;
int libCamp_gv_tS_DebugBuyTechButtonUnitsUnlockAll;
int libCamp_gv_tS_DebugBuyTechButtonUnitsReset;
int libCamp_gv_tS_DebugBuyTechLabelUnitsUnlocked;
int libCamp_gv_tS_DebugBuyTechLabelCreditsEarned;
int libCamp_gv_tS_DebugBuyTechLabelMissionNotUnlocked;
int libCamp_gv_tS_DebugBuyTechLabelMissionExtraSelected;
int libCamp_gv_tS_DebugBuyTechTitleUpgrades;
int libCamp_gv_tS_DebugBuyTechButtonUpgradeBuy;
int libCamp_gv_tS_DebugBuyTechButtonUpgradeBuyAll;
int libCamp_gv_tS_DebugBuyTechButtonUpgradeReset;
int libCamp_gv_tS_DebugBuyTechButtonCreditsIncrease;
int libCamp_gv_tS_DebugBuyTechLabelUpgradeBought;
int libCamp_gv_tS_DebugBuyTechLabelCreditsSpent;
int libCamp_gv_tS_DebugBuyTechLabelUpgradeAvailable;
int libCamp_gv_tS_DebugBuyTechLabelCreditsAvailable;
int libCamp_gv_tS_DebugBuyTechButtonAverage;
int libCamp_gv_tS_DebugBuyTechButtonEarly;
int libCamp_gv_tS_DebugBuyTechButtonLate;
int libCamp_gv_tS_DebugBuyTechButtonSave;
int libCamp_gv_tS_DebugBuyTechButtonCancel;
int libCamp_gv_tS_DebugBuyTechTotalCredits;
bool[36][11] libCamp_gv_tS_DebugBuyTechMercEarly;
bool[36][11] libCamp_gv_tS_DebugBuyTechMercAverage;
bool[36][11] libCamp_gv_tS_DebugBuyTechMercLate;
bool[36][101] libCamp_gv_tS_DebugBuyTechPurchasableEarly;
bool[36][101] libCamp_gv_tS_DebugBuyTechPurchasableAverage;
bool[36][101] libCamp_gv_tS_DebugBuyTechPurchasableLate;
int libCamp_gv_tSX_DebugTechCheatOption;
int libCamp_gv_tS_DebugTechCustomButton;
int libCamp_gv_tS_DebugTechCustomDialog;
trigger libCamp_gv_tS_FootageRecordingCallback;
string libCamp_gv_mapMusicTrack;

void libCamp_InitVariables () {
    int init_i;
    int init_j;

    libCamp_gv__TP_DropPod_Units = UnitGroupEmpty();
    libCamp_gv_zS_ObjectivePanel = c_invalidDialogControlId;
    for (init_i = 0; init_i <= 500; init_i += 1) {
        libCamp_gv__CB_Line_TextColor[init_i] = Color(0,0,0);
    }
    for (init_i = 0; init_i <= 500; init_i += 1) {
        libCamp_gv__CB_Line_BGColor[init_i] = Color(0,0,0);
    }
    for (init_i = 0; init_i <= 500; init_i += 1) {
        libCamp_gv__CB_Line_AnimationStartOptions[init_i] = 0;
    }
    for (init_i = 0; init_i <= 500; init_i += 1) {
        libCamp_gv__CB_Line_AnimationEndOptions[init_i] = 0;
    }
    for (init_i = 0; init_i <= 500; init_i += 1) {
        libCamp_gv__CB_Line_DurationType[init_i] = c_transmissionDurationAdd;
    }
    for (init_i = 0; init_i <= 500; init_i += 1) {
        libCamp_gv__CB_Line_FaceOption[init_i] = true;
    }
    libCamp_gv__CB_Line_Last = -1;
    for (init_i = 0; init_i <= 100; init_i += 1) {
        libCamp_gv__CB_Unit_ActivationPlayerGroup[init_i] = PlayerGroupEmpty();
    }
    for (init_i = 0; init_i <= 32; init_i += 1) {
        libCamp_gv__CB_Current_ChatBubble[init_i] = c_textTagNone;
    }
    for (init_i = 0; init_i <= 32; init_i += 1) {
        libCamp_gv__CB_Current_UnitIndex[init_i] = -1;
    }
    for (init_i = 0; init_i <= 32; init_i += 1) {
        libCamp_gv__CB_Current_LineIndex[init_i] = -1;
    }
    libCamp_gv__CB_TP_TEXT = StringExternal("Param/Value/lib_Camp_6000C5DC");
    libCamp_gv__CB_TP_SOUNDLINK = SoundLink("EditorDefaultSound", -1);
    libCamp_gv__CB_TP_DURATIONTYPE = c_transmissionDurationAdd;
    libCamp_gv__CB_TP_TEXTTAG = c_textTagNone;
    libCamp_gv__CB_TP_WAITSOUND_DURATIONTYPE = c_transmissionDurationAdd;
    libCamp_gv__MsgDlg = c_invalidDialogId;
    libCamp_gv__MsgDlgButton = c_invalidDialogControlId;
    libCamp_gv_zS_CampaignTrialEndDialog = c_invalidDialogId;
    libCamp_gv_zS_CampaignTrialEndPanel = c_invalidDialogControlId;
    libCamp_gv_zS_CampaignTrialEndUpgradeButton = c_invalidDialogControlId;
    libCamp_gv_zS_CampaignTrialEndQuitButton = c_invalidDialogControlId;
    libCamp_gv_TSC_MAP_LAST = ((34) - 1);
    libCamp_gv_TSC_MISSION_FIRST = (1);
    libCamp_gv_TSC_MISSION_LAST = (30);
    for (init_i = 0; init_i <= 35; init_i += 1) {
        libCamp_gv_tS_MapID[init_i] = c_timerWindowNone;
    }
    for (init_i = 0; init_i <= 35; init_i += 1) {
        libCamp_gv_tS_MapSubtitle[init_i] = StringExternal("Param/Value/lib_Camp_63F699AC");
    }
    for (init_i = 0; init_i <= 35; init_i += 1) {
        libCamp_gv_tS_MapFile[init_i] = "";
    }
    for (init_i = 0; init_i <= 35; init_i += 1) {
        libCamp_gv_tS_MissionSummary[init_i] = StringExternal("Param/Value/lib_Camp_318FCC8E");
    }
    for (init_i = 0; init_i <= 35; init_i += 1) {
        libCamp_gv_tS_MissionEnemyForces[init_i] = StringExternal("Param/Value/lib_Camp_B076181C");
    }
    for (init_i = 0; init_i <= 150; init_i += 1) {
        libCamp_gv_tS_ContactName[init_i] = StringExternal("Param/Value/lib_Camp_647B48DD");
    }
    libCamp_gv_TSC_MERC_LAST = ((9) - 1);
    for (init_i = 0; init_i <= 16; init_i += 1) {
        libCamp_gv_tS_MercNames[init_i] = StringExternal("Param/Value/lib_Camp_9EF97DB4");
    }
    for (init_i = 0; init_i <= 16; init_i += 1) {
        libCamp_gv_tS_MercDescriptions[init_i] = StringExternal("Param/Value/lib_Camp_CBD27903");
    }
    for (init_i = 0; init_i <= 16; init_i += 1) {
        libCamp_gv_tS_MercUnitText[init_i] = StringExternal("Param/Value/lib_Camp_67BE9DBD");
    }
    for (init_i = 0; init_i <= 16; init_i += 1) {
        libCamp_gv_tS_MercAvailabilityText[init_i] = StringExternal("Param/Value/lib_Camp_EFE8C0A5");
    }
    for (init_i = 0; init_i <= 16; init_i += 1) {
        libCamp_gv_tS_MercSpecialText[init_i] = StringExternal("Param/Value/lib_Camp_18704262");
    }
    for (init_i = 0; init_i <= 10; init_i += 1) {
        libCamp_gv_tS_MercUIMercenaries[init_i] = c_invalidMercenaryId;
    }
    for (init_i = 0; init_i <= 50; init_i += 1) {
        libCamp_gv_tS_BattleReportMissions[init_i] = c_invalidBattleReportId;
    }
    for (init_i = 0; init_i <= 30; init_i += 1) {
        libCamp_gv_tS_BattleReportScenes[init_i] = c_invalidBattleReportId;
    }
    libCamp_gv_TSC_OBJECTIVE_LAST = ((97) - 1);
    for (init_i = 0; init_i <= 100; init_i += 1) {
        libCamp_gv_tS_MissionObjObjective[init_i] = c_invalidObjectiveId;
    }
    libCamp_gv_TSC_RESEARCH_LAST = ((21) - 1);
    for (init_i = 0; init_i <= 30; init_i += 1) {
        libCamp_gv_tS_ResearchUIItem[init_i] = c_invalidResearchItemId;
    }
    for (init_i = 0; init_i <= 2; init_i += 1) {
        libCamp_gv_tS_ResearchUICategories[init_i] = c_invalidResearchCategoryId;
    }
    for (init_i = 0; init_i <= 2; init_i += 1) {
        for (init_j = 0; init_j <= 5; init_j += 1) {
            libCamp_gv_tS_ResearchUITiers[init_i][init_j] = c_invalidResearchTierId;
        }
    }
    libCamp_gv_tS_RoomChangeDialog = c_invalidDialogId;
    libCamp_gv_tS_RoomChangeDialogBorder = c_invalidDialogControlId;
    libCamp_gv_tS_RoomChangeDialogSubtitle = c_invalidDialogId;
    for (init_i = 0; init_i <= 10; init_i += 1) {
        libCamp_gv_tS_RoomChangeButtons[init_i] = c_invalidDialogControlId;
    }
    for (init_i = 0; init_i <= 10; init_i += 1) {
        libCamp_gv_tS_RoomChangeButtonText[init_i] = c_invalidDialogControlId;
    }
    for (init_i = 0; init_i <= 10; init_i += 1) {
        libCamp_gv_tS_RoomChangeButtonBG[init_i] = c_invalidDialogControlId;
    }
    libCamp_gv_TSC_SCENE_LAST = ((22) - 1);
    for (init_i = 0; init_i <= 30; init_i += 1) {
        libCamp_gv_tS_SceneNames[init_i] = StringExternal("Param/Value/lib_Camp_23583985");
    }
    libCamp_gv_TSC_STORYSTATE_LAST = ((39) - 1);
    libCamp_gv_tSC_PLANET_LAST = ((43) - 1);
    for (init_i = 0; init_i <= 50; init_i += 1) {
        libCamp_gv_tS_PlanetSubtitle[init_i] = StringExternal("Param/Value/lib_Camp_05ABC20E");
    }
    for (init_i = 0; init_i <= 50; init_i += 1) {
        libCamp_gv_tS_PlanetName[init_i] = StringExternal("Param/Value/lib_Camp_318D8F4D");
    }
    libCamp_gv_TSC_TECHCATEGORY_LAST = ((6) - 1);
    for (init_i = 0; init_i <= 10; init_i += 1) {
        libCamp_gv_tS_TechCategoryName[init_i] = StringExternal("Param/Value/lib_Camp_B7A2B2B3");
    }
    for (init_i = 0; init_i <= 10; init_i += 1) {
        libCamp_gv_tS_TechCategory_UI[init_i] = c_invalidPurchaseCategoryId;
    }
    libCamp_gv_TSC_TECHGROUP_LAST = ((25) - 1);
    for (init_i = 0; init_i <= 50; init_i += 1) {
        libCamp_gv_tS_TechGroupName[init_i] = StringExternal("Param/Value/lib_Camp_F12707C8");
    }
    for (init_i = 0; init_i <= 50; init_i += 1) {
        libCamp_gv_tS_TechGroupState[init_i] = c_purchaseCategoryStateEnabled;
    }
    for (init_i = 0; init_i <= 50; init_i += 1) {
        libCamp_gv_tS_TechGroup_UI[init_i] = c_invalidPurchaseGroupId;
    }
    libCamp_gv_TSC_TECH_LAST = ((45) - 1);
    for (init_i = 0; init_i <= 100; init_i += 1) {
        libCamp_gv_tS_Tech_ConvoID[init_i] = "Tech|Tech_SCV_1";
    }
    for (init_i = 0; init_i <= 100; init_i += 1) {
        libCamp_gv_tS_Tech_UI[init_i] = c_invalidPurchaseItemId;
    }
    for (init_i = 0; init_i <= 100; init_i += 1) {
        libCamp_gv_tSX_Tech_Status[init_i] = 3;
    }
    libCamp_gv_tSX_RoomStates = "";
    for (init_i = 0; init_i <= 100; init_i += 1) {
        libCamp_gv_tSX_Tutorial_HistoryTitle[init_i] = StringExternal("Param/Value/lib_Camp_9316EE58");
    }
    for (init_i = 0; init_i <= 100; init_i += 1) {
        libCamp_gv_tSX_Tutorial_HistoryDescription[init_i] = StringExternal("Param/Value/lib_Camp_F51E9D3D");
    }
    for (init_i = 0; init_i <= 20; init_i += 1) {
        libCamp_gv_tS_StoryUIVisibility_Menu[init_i] = true;
    }
    for (init_i = 0; init_i <= 20; init_i += 1) {
        libCamp_gv_tS_StoryUIVisibility_Cash[init_i] = true;
    }
    for (init_i = 0; init_i <= 20; init_i += 1) {
        libCamp_gv_tS_StoryUIVisibility_RoomChange[init_i] = true;
    }
    for (init_i = 0; init_i <= 20; init_i += 1) {
        libCamp_gv_tS_StoryUIVisibility_Tip[init_i] = true;
    }
    libCamp_gv_tS_DebugProgressDialog = c_invalidDialogId;
    libCamp_gv_tS_DebugProgressImageCurrent = c_invalidDialogControlId;
    libCamp_gv_tS_DebugProgressImageOK = c_invalidDialogControlId;
    libCamp_gv_tS_DebugProgressButtonOK = c_invalidDialogControlId;
    libCamp_gv_tS_DebugProgressLabelWarning = c_invalidDialogControlId;
    libCamp_gv_tS_DebugProgressLabelsCompleted = c_invalidDialogControlId;
    libCamp_gv_tS_DebugProgressButtonCancel = c_invalidDialogControlId;
    libCamp_gv_tS_DebugProgressButtonReset = c_invalidDialogControlId;
    libCamp_gv_tS_DebugProgressButtonResetTech = c_invalidDialogControlId;
    libCamp_gv_tS_DebugProgressButtonLaunchMission = c_invalidDialogControlId;
    for (init_i = 0; init_i <= 50; init_i += 1) {
        libCamp_gv_tS_DebugProgressMissionButtons[init_i] = c_invalidDialogControlId;
    }
    libCamp_gv_tS_DebugProgressMissionButtonUnlockSecret = c_invalidDialogControlId;
    for (init_i = 0; init_i <= 50; init_i += 1) {
        libCamp_gv_tS_DebugProgressMissionLabelsStates[init_i] = c_invalidDialogControlId;
    }
    for (init_i = 0; init_i <= 50; init_i += 1) {
        libCamp_gv_tS_DebugProgressMissionLabelsUnits[init_i] = c_invalidDialogControlId;
    }
    for (init_i = 0; init_i <= 50; init_i += 1) {
        libCamp_gv_tS_DebugProgressMissionLabelsCredits[init_i] = c_invalidDialogControlId;
    }
    for (init_i = 0; init_i <= 50; init_i += 1) {
        libCamp_gv_tS_DebugProgressMissionLabelsRequirement[init_i] = c_invalidDialogControlId;
    }
    libCamp_gv_tS_DebugProgressMissionLabelsUnlocked = c_invalidDialogControlId;
    for (init_i = 0; init_i <= 7; init_i += 1) {
        libCamp_gv_tS_DebugProgressMissionLaunchButtons[init_i] = c_invalidDialogControlId;
    }
    libCamp_gv_tS_DebugProgressMissionLaunchCancel = c_invalidDialogControlId;
    libCamp_gv_tS_DebugProgressMissionLaunchDialog = c_invalidDialogId;
    libCamp_gv_tS_DebugResearchDialogProtoss = c_invalidDialogId;
    libCamp_gv_tS_DebugResearchButtonProtossPlus = c_invalidDialogControlId;
    libCamp_gv_tS_DebugResearchButtonProtossMinus = c_invalidDialogControlId;
    libCamp_gv_tS_DebugResearchButtonProtossReset = c_invalidDialogControlId;
    libCamp_gv_tS_DebugResearchDialogZerg = c_invalidDialogId;
    libCamp_gv_tS_DebugResearchButtonZergPlus = c_invalidDialogControlId;
    libCamp_gv_tS_DebugResearchButtonZergMinus = c_invalidDialogControlId;
    libCamp_gv_tS_DebugResearchButtonZergReset = c_invalidDialogControlId;
    libCamp_gv_tS_DebugMercenaryDialog = c_invalidDialogId;
    libCamp_gv_tS_DebugMercenaryButtonReset = c_invalidDialogControlId;
    libCamp_gv_tS_DebugMercenaryButtonCredits = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechDialog = c_invalidDialogId;
    libCamp_gv_tS_DebugBuyTechTitleUnitCredits = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechButtonUnitsUnlock = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechButtonUnitsUnlockAll = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechButtonUnitsReset = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechLabelUnitsUnlocked = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechLabelCreditsEarned = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechLabelMissionNotUnlocked = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechLabelMissionExtraSelected = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechTitleUpgrades = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechButtonUpgradeBuy = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechButtonUpgradeBuyAll = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechButtonUpgradeReset = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechButtonCreditsIncrease = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechLabelUpgradeBought = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechLabelCreditsSpent = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechLabelUpgradeAvailable = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechLabelCreditsAvailable = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechButtonAverage = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechButtonEarly = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechButtonLate = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechButtonSave = c_invalidDialogControlId;
    libCamp_gv_tS_DebugBuyTechButtonCancel = c_invalidDialogControlId;
    libCamp_gv_tSX_DebugTechCheatOption = 2;
    libCamp_gv_tS_DebugTechCustomButton = c_invalidDialogControlId;
    libCamp_gv_tS_DebugTechCustomDialog = c_invalidDialogId;
}

// Function Declarations
void libCamp_gf_DisplayCampaignMessage (playergroup lp_toPlayerGroup, int lp_messageType, text lp_message, int lp_formatOrNot);
void libCamp_gf__ZergDropPod (point lp_location, unitgroup lp_units);
void libCamp_gf__TerranDropPod (point lp_location, unitgroup lp_units);
void libCamp_gf_CreateDropPod (int lp_race, point lp_location, unitgroup lp_units, bool lp_waitDontWait);
void libCamp_gf_TS_SaveMissionCompletion ();
void libCamp_gf_TS_GameOver ();
void libCamp_gf_EndCampaignMission (int lp_player, int lp_type);
void libCamp_gf_RunMissionVictorySequence (trigger lp_victoryCinematic);
void libCamp_gf_CreateStorymodeTips ();
void libCamp_gf_CreateNewStructureTips ();
void libCamp_gf_TS_CreateNewUpgradeTips ();
void libCamp_gf_CreateTipFromConversationState (string lp_convoState, int lp_tipType, playergroup lp_players);
void libCamp_gf_CreateMissionAutosavePoint (text lp_description);
void libCamp_gf_SendTransmissionCampaign (unit lp_unit, soundlink lp_sound, int lp_durationType, fixed lp_duration, bool lp_waitUntilDone);
void libCamp_gf_SetAllSoundChannelVolumesCampaign (int lp_mode);
void libCamp_gf_ResearchAIUpgrade (int lp_count, string lp_upgrade, int lp_player);
void libCamp_gf_DestroyCacheAndGivePlayerResources (unit lp_cacheUnit, int lp_resourceType, int lp_resourceAmount, int lp_player);
void libCamp_gf_DisplayResearchPointsGiventoPlayer (int lp_researchObject, unit lp_researchUnit, int lp_player);
int libCamp_gf_LastAddedChatBubble ();
void libCamp_gf_ShowChatBubble (unit lp_unit, int lp_player);
void libCamp_gf_AddChatBubbleLine2 (int lp_player, unit lp_unit, soundlink lp_sound, text lp_text, fixed lp_duration, int lp_durationType, bool lp_faceOption);
void libCamp_gf_ClearChatBubble (int lp_player);
void libCamp_gf_RandomlyShuffleChatBubbleLines (unit lp_unit, int lp_player);
void libCamp_gf_ClearAllChatBubbleLinesFromUnit (unit lp_unit, int lp_player);
void libCamp_gf_SetChatBubbleActivationDistance (unit lp_unit, int lp_player, fixed lp_distance);
void libCamp_gf_SetChatBubbleColor (int lp_chatBubble, color lp_color, color lp_backgroundColor);
void libCamp_gf_SetChatBubbleAnimation2 (int lp_chatBubble, string lp_animation1, int lp_animation1Option, string lp_animation2, int lp_animation2Option);
void libCamp_gf_SetChatBubbleTrigger (int lp_chatBubble, trigger lp_triggerStart, trigger lp_triggerEnd);
void libCamp_gf_SetChatBubbleFacingPoint (int lp_chatBubble, point lp_point);
void libCamp_gf_ShowChatBubbleOnUnit (int lp_player, unit lp_unit, soundlink lp_sound, text lp_message, fixed lp_duration, int lp_durationType, bool lp_WaitUntilDone);
void libCamp_gf_TurnChatBubbleOnOff (unit lp_unit, bool lp_onOff, int lp_player);
text libCamp_gf_TextOfSound (soundlink lp_soundLink);
bool libCamp_gf__CB_Line_IsValid (int lp_lineIndex);
int libCamp_gf__CB_Line_Add (text lp_line, color lp_textColor, color lp_bGColor, string lp_animationStart, int lp_animationStartOption, string lp_animationEnd, int lp_animationEndOption, soundlink lp_sound, fixed lp_duration, int lp_durationType, bool lp_faceOption, trigger lp_triggerStart, trigger lp_triggerEnd);
void libCamp_gf__CB_Line_Remove (int lp_lineIndex);
int libCamp_gf__CB_Unit_GetIndex (unit lp_unit);
int libCamp_gf__CB_Unit_GetLineEndIndex (int lp_unitIndex, int lp_playerIndex);
int libCamp_gf__CB_Unit_GetLineCurrentIndex (int lp_unitIndex, int lp_playerIndex);
int libCamp_gf__CB_Unit_Add (unit lp_unit);
void libCamp_gf__CB_Unit_Remove (unit lp_unit);
void libCamp_gf__CB_Unit_RemoveByIndex (int lp_unitIndex);
void libCamp_gf__CB_UnitLine_Add (int lp_unitIndex, int lp_playerIndex, int lp_lineIndex);
void libCamp_gf__CB_UnitLine_RemoveUnit (int lp_unitIndex, int lp_playerIndex);
void libCamp_gf__CB_Current_Create (int lp_unitIndex, int lp_playerIndex, unit lp_target);
void libCamp_gf__CB_Current_Remove (int lp_playerIndex);
int libCamp_gf__CB_LastWaitSound ();
void libCamp_gf__CB_StarWaitingSound (sound lp_sound, fixed lp_duration, int lp_durationType);
fixed libCamp_gf_GD_Gap (int lp_hV);
fixed libCamp_gf_GD_GridToReal (fixed lp_grid, int lp_hV, int lp_sizeOrPos);
int libCamp_gf_GD_GridToInteger (fixed lp_grid, int lp_hV, int lp_sizeOrPos);
fixed libCamp_gf_GD_RealToGrid (fixed lp_value, int lp_hV, int lp_sizeOrPos);
fixed libCamp_gf_GD_IntegerToGrid (int lp_value, int lp_hV, int lp_sizeOrPos);
fixed libCamp_gf_DialogWidthInGrid (int lp_dialog);
fixed libCamp_gf_DialogHeightInGrid (int lp_dialog);
fixed libCamp_gf_DialogOffsetXInGrid (int lp_dialog);
fixed libCamp_gf_DialogOffsetYInGrid (int lp_dialog);
fixed libCamp_gf_DialogItemWidthInGrid (int lp_dialogItem, int lp_player);
fixed libCamp_gf_DialogItemHeightInGrid (int lp_dialogItem, int lp_player);
fixed libCamp_gf_DialogItemOffsetXInGrid (int lp_dialogItem, int lp_player);
fixed libCamp_gf_DialogItemOffsetYInGrid (int lp_dialogItem, int lp_player);
void libCamp_gf_CreateDialogInGrid (fixed lp_width, fixed lp_height, int lp_anchor, fixed lp_offsetX, fixed lp_offsetY, bool lp_modal);
void libCamp_gf_MoveDialogInGrid (int lp_dialog, int lp_anchor, fixed lp_offsetX, fixed lp_offsetY);
void libCamp_gf_MoveDialogInGridRelative (int lp_dialog, int lp_anchor, int lp_relativeDialog, int lp_relativeAnchor, fixed lp_offsetX, fixed lp_offsetY);
void libCamp_gf_SetDialogSizeInGrid (int lp_dialog, fixed lp_width, fixed lp_height);
void libCamp_gf_CreateDialogItemInGrid (int lp_dialog, int lp_type, int lp_anchor, fixed lp_offsetX, fixed lp_offsetY, fixed lp_width, fixed lp_height, text lp_label);
void libCamp_gf_MoveDialogItemInGrid (int lp_dialogItem, playergroup lp_players, int lp_anchor, fixed lp_offsetX, fixed lp_offsetY);
void libCamp_gf_MoveDialogItemInGridRelative (int lp_item, playergroup lp_players, int lp_anchor, int lp_relativeItem, int lp_relativeAnchor, fixed lp_offsetX, fixed lp_offsetY);
void libCamp_gf_SetDialogItemSizeInGrid (int lp_dialogItem, playergroup lp_players, fixed lp_width, fixed lp_height);
void libCamp_gf_DisplayMessageDialog (text lp_title, string lp_titleStyle, text lp_body1, string lp_bodyStyle1, text lp_body2, string lp_bodyStyle2, int lp_width, int lp_height, text lp_buttonText);
text libCamp_gf_FormatTimeCampaign (int lp_second);
void libCamp_gf_ZS_DisplayCampaignTrialDialog (bool lp_showBackground);
void libCamp_gf_ZS_CloseCampaignTrialDialog ();
bool libCamp_gf_ZS_TrialEnd ();
void libCamp_gf_TS_InitializeMapAchievementDataSingle (int lp_map, string lp_achievement1, string lp_achievement2, string lp_achievement3, string lp_achievement4);
void libCamp_gf_TS_InitializeMapAchievementData ();
int libCamp_gf_TS_CampaignMissionShortestTime ();
int libCamp_gf_TS_MissionCompletionCountOnDifficulty (int lp_difficulty);
int libCamp_gf_TS_MissionDifficultyComparison (int lp_difficulty1, int lp_difficulty2);
void libCamp_gf_TS_CheckAchievementUnlocking ();
void libCamp_gf_TS_CompletionistCheck (int lp_map, string lp_normal, string lp_hard, string lp_brutal);
void libCamp_gf_TS_UpdateCharacterSheepPanel ();
void libCamp_gf_TS_AddRecentTech (int lp_tech);
void libCamp_gf_TS_AddRecentMerc (int lp_merc);
void libCamp_gf_TS_AddRecentResearch (int lp_research);
void libCamp_gf_TS_ResetRecentlyPurchasedData ();
void libCamp_gf_TS_InitizlizeStoryConversationSingle (string lp_conversation);
void libCamp_gf_TS_InitizlizeStoryConversations ();
string libCamp_gf_ContactPortraitModel (int lp_contactID);
int libCamp_gf_CountMissions (int lp_status);
int libCamp_gf_LastMap ();
bool libCamp_gf_LastMapConditionCheck (int lp_condition);
int libCamp_gf_LastMission ();
bool libCamp_gf_LastMissionConditionCheck (int lp_condition);
int libCamp_gf_LastSuccessfulMission ();
bool libCamp_gf_MapTypeCheck (int lp_mapId, int lp_mapType);
string libCamp_gf_MapFile (int lp_map);
trigger libCamp_gf_MissionBriefing (int lp_mapID);
trigger libCamp_gf_MissionBriefingPreload (int lp_mapID);
trigger libCamp_gf_MissionBriefingRoughPreload (int lp_mapID);
int libCamp_gf_MissionContact (int lp_mapID);
int libCamp_gf_MissionPlanet (int lp_mission);
int libCamp_gf_MissionStatusAge (int lp_mission, int lp_status);
bool libCamp_gf_MissionDifficultyCompleted (int lp_mission, int lp_difficulty);
int libCamp_gf_MissionCompleteBestTime (int lp_mission, int lp_difficulty);
int libCamp_gf_MissionStatus (int lp_missionID);
bool libCamp_gf_MissionStatusCheck (int lp_missionID, int lp_status);
int libCamp_gf_MissionReward (int lp_mission);
text libCamp_gf_MissionName (int lp_mission);
text libCamp_gf_MissionNameInUpperCase (int lp_mission);
text libCamp_gf_MissionEpilogue (int lp_mission);
text libCamp_gf_MissionPlanetInfo (int lp_mission);
text libCamp_gf_MissionObjectivesText (int lp_mission);
string libCamp_gf_MissionPitches (int lp_mission);
int libCamp_gf_MissionUnlockedTechSubgorup (int lp_mission, int lp_index);
string libCamp_gf_MissionUnlockedUnitType (int lp_mission, int lp_index);
string libCamp_gf_MissionLoadingScreenImage (int lp_mission);
int libCamp_gf_NumberOfMissions (int lp_options);
int libCamp_gf_TS_MissionRewardResearchPoints (int lp_mission, int lp_researchCategory);
int libCamp_gf_TS_TertiaryIntegerOp (bool lp_condition, int lp_trueValue, int lp_falseValue);
bool libCamp_gf_TS_MapIsMission (int lp_map);
int libCamp_gf_TS_MapIDFromIndex (int lp_mapIndex);
string libCamp_gf_TS_MapConvoID (int lp_map);
text libCamp_gf_FormatCredits (int lp_credits, bool lp_withDollarSign);
int libCamp_gf_CurrentMap ();
void libCamp_gf_UpdateMissionFlow ();
void libCamp_gf_SetMissionBriefing (int lp_mapID, trigger lp_briefing, trigger lp_briefingPreload, trigger lp_briefingPreloadRough);
void libCamp_gf_SetMissionABChoiceCallback (int lp_mapID, trigger lp_aBChoice);
void libCamp_gf_SetMissionABChoiceResult (int lp_mapID);
void libCamp_gf_TS_MarkMissionAsStatus (int lp_missionID, int lp_status);
void libCamp_gf_TS_SetMissionStatusAge (int lp_mission, int lp_status, int lp_age);
void libCamp_gf_TS_SetMissionDifficultyCompleted (int lp_mission, int lp_difficulty, bool lp_completed);
void libCamp_gf_TS_SetMissionCompleteBestTime (int lp_mission, int lp_difficulty, int lp_time);
void libCamp_gf_TS_CompleteMission (int lp_mission);
void libCamp_gf_TS_IncreaseMissionAge (int lp_mission);
void libCamp_gf_TS_InitializeMapDataSingle (int lp_mapID, string lp_map, text lp_progressCheatName, int lp_type, string lp_convoID, text lp_subtitle, string lp_loadingScreenImage, string lp_backLoadingScreenImage, string lp_backDefeatLoadingScreenImage, text lp_summary, int lp_location, bool lp_isRequired, int lp_contact, int lp_creditsPoor, int lp_creditsAvg, int lp_creditsRich, int lp_enabedTechUnit1, int lp_enabedTechUnit2, int lp_enabedTechUnit3, string lp_pitches, text lp_enemyForces, string lp_battleReportImage, string lp_battleReportIcon);
void libCamp_gf_TS_InitializeMapData ();
void libCamp_gf_TS_InitializeContactDataSingle (int lp_contactID, text lp_name, string lp_convoStateIndex, string lp_portrait);
void libCamp_gf_TS_InitializeContactData ();
void libCamp_gf_TS_LockUnlockMissionIfCondition (bool lp_lockUnlockOption, int lp_mission, bool lp_condition);
void libCamp_gf_TS_SetLastSuccessfulMission (int lp_mission);
void libCamp_gf_TS_UpdateNewMissionOpened ();
void libCamp_gf_LaunchMission (int lp_mission, bool lp_simulationOnOff, int lp_difficulty);
text libCamp_gf_MercName (int lp_mercID);
text libCamp_gf_MercDescription (int lp_mercID);
int libCamp_gf_MercCost (int lp_mercID);
int libCamp_gf_MercTechSubgroup (int lp_mercID, int lp_index);
int libCamp_gf_MercCount (int lp_mercID, int lp_index);
text libCamp_gf_MercUnitText (int lp_mercID);
string libCamp_gf_MercUnitText2 (int lp_mercID);
text libCamp_gf_MercAvailablityText (int lp_mercID);
text libCamp_gf_MercSpecialText (int lp_mercID);
string libCamp_gf_MercPortraitModel (int lp_mercID);
string libCamp_gf_MercVideo (int lp_mercID);
string libCamp_gf_MercUpgrade (int lp_mercID);
bool libCamp_gf_MercStatusCheck (int lp_mercID, int lp_status);
int libCamp_gf_CostofPurchasedMerc ();
abilcmd libCamp_gf_TS_MercAbilityCommand (int lp_mercID, int lp_index);
void libCamp_gf_SetMercStatus (int lp_mercID, int lp_status);
void libCamp_gf_TS_InitializeMercDataSingle (int lp_iD, text lp_name, text lp_description, int lp_cost, int lp_techSubgroup1, int lp_unitCount1, int lp_techSubgroup2, int lp_unitCount2, text lp_unitText, string lp_unitType, text lp_availabilityText, text lp_specialText, string lp_portrait, string lp_video, abilcmd lp_command1, abilcmd lp_command2, abilcmd lp_command3, string lp_upgrade, string lp_hiredImage, string lp_noCreditImage);
void libCamp_gf_TS_InitializeMercData ();
void libCamp_gf_TS_ResetMercData ();
void libCamp_gf_TS_ApplyMercenaryTech (int lp_player);
void libCamp_gf_TS_UpdateMercStatus ();
void libCamp_gf_TS_ApplyMercUpgrades (int lp_player);
void libCamp_gf_DisplayMercenaryPanel (trigger lp_exitCallback);
void libCamp_gf_TS_MercUIUpdateUI ();
void libCamp_gf_TS_MercUIGift (int lp_mercGifted);
void libCamp_gf_TS_BattleReportUpdate ();
text libCamp_gf_TS_BattleReportFormatObjectives (int lp_mission);
text libCamp_gf_TS_BattleReportFormatBestTime (int lp_mission, int lp_difficulty);
bool libCamp_gf_TS_BattleReportMissionCompleted (int lp_mission);
void libCamp_gf_TS_BattleReportAddMission (int lp_mission, int lp_state, int lp_priority);
void libCamp_gf_TS_BattleReportAddScene (int lp_scene, int lp_priority);
void libCamp_gf_TS_BattleReportHide ();
void libCamp_gf_DisplayBattleReport (trigger lp_sceneFinishCallback, trigger lp_leaveCallback);
void libCamp_gf_RefreshBattleReport ();
bool libCamp_gf_TS_GameFullyDownloaded ();
void libCamp_gf_RegisterMissionDebriefingCallback (int lp_mission, trigger lp_callback);
trigger libCamp_gf_MissionDebriefingCallback (int lp_mission);
bool libCamp_gf_MissionObjectiveStateCheck (int lp_objective, int lp_state);
bool libCamp_gf_MissionObjectiveIsPrimary (int lp_objective);
text libCamp_gf_MissionObjectiveName (int lp_objective);
int libCamp_gf_MissionObjectiveMap (int lp_objective);
int libCamp_gf_MissionObjectiveRewardsEarned (int lp_objective);
int libCamp_gf_MissionObjectiveRewardsEarnedLastMission ();
int libCamp_gf_MissionObjectiveItemCount (int lp_objective);
int libCamp_gf_MissionObjectiveCreditsPerItem (int lp_objective);
int libCamp_gf_MissionObjectiveProgress (int lp_objective);
bool libCamp_gf_TS_AllObjectivesCompletedForMission (int lp_mission);
string libCamp_gf_TS_MissionObjectiveConvoID (int lp_objective);
void libCamp_gf_RegisterMissionObjective (int lp_objectiveID, int lp_objective, text lp_objectiveName);
void libCamp_gf_SetMissionObjectiveState (int lp_objective, int lp_state);
void libCamp_gf_SetMissionObjectiveProgress (int lp_objective, int lp_progress);
void libCamp_gf_AddProgressToStoryObjective (int lp_progress, int lp_objective);
void libCamp_gf_TS_InitializeMissionObjectiveDataSingle (int lp_obj, int lp_map, string lp_convoID);
void libCamp_gf_TS_InitializeMissionObjectiveData ();
void libCamp_gf_TS_UpdateMissionObjectives ();
text libCamp_gf_StoryResearchName (int lp_researchID);
text libCamp_gf_StoryResearchDescription (int lp_researchID);
int libCamp_gf_StoryResearchCategory (int lp_researchID);
string libCamp_gf_StoryResearchIcon (int lp_researchID);
text libCamp_gf_StoryResearchTooltip (int lp_researchID);
text libCamp_gf_StoryResearchConfirmationText (int lp_researchID);
string libCamp_gf_StoryResearchMovie (int lp_researchID);
int libCamp_gf_StoryResearchLevelRequirement (int lp_researchID);
int libCamp_gf_StoryResearchMissionObject (int lp_missionID);
int libCamp_gf_StoryResearchMissionProgress (int lp_missionID, int lp_researchCat);
bool libCamp_gf_StoryResearchStateCheck (int lp_researchID, int lp_state);
int libCamp_gf_StoryResearchPoints (int lp_categeory);
int libCamp_gf_StoryResearchPointsOld (int lp_categeory);
int libCamp_gf_StoryResearchPointsConverted (int lp_categeory);
int libCamp_gf_StoryResearchPointCap (int lp_categeory);
int libCamp_gf_StoryResearchCreditsPerPoint ();
int libCamp_gf_TS_StoryResearchUIItem (int lp_researchID);
string libCamp_gf_TS_StoryResearchRewardUpgrade1 (int lp_researchID);
string libCamp_gf_TS_StoryResearchRewardUpgrade2 (int lp_researchID);
abilcmd libCamp_gf_TS_StoryResearchRewardAC1 (int lp_researchID);
abilcmd libCamp_gf_TS_StoryResearchRewardAC2 (int lp_researchID);
int libCamp_gf_TS_StoryResearchMissionProgressCurrent (int lp_categeory);
int libCamp_gf_TS_StoryResearchMissionObject (int lp_mission, int lp_index);
int libCamp_gf_TS_StoryResearchMissionObjectCount (int lp_mission, int lp_index);
int libCamp_gf_TS_StoryResearchMissionMainObjectiveReward (int lp_mission, int lp_category);
int libCamp_gf_TS_StoryResearchMissionOpportunities (int lp_mission, int lp_category);
int libCamp_gf_TS_StoryResearchTier (int lp_research);
int libCamp_gf_TS_StoryResearchSlot (int lp_research);
int libCamp_gf_TS_StoryResearchTheOtherOfTheSameTier (int lp_research);
int libCamp_gf_StoryResearchObjectReward (int lp_researchObject, int lp_category);
text libCamp_gf_StoryResearchSupplementTextForObjective (int lp_researchObject, int lp_style, int lp_total, int lp_progress);
void libCamp_gf_TS_InitializeResearchDataSingle (int lp_iD, string lp_convoID);
void libCamp_gf_TS_InitializeResearchData ();
void libCamp_gf_TS_InitializeResearchObjDataSingle (int lp_iD, string lp_convoID);
void libCamp_gf_TS_InitializeResearchObjData ();
void libCamp_gf_TS_ResetResearchData ();
void libCamp_gf_TS_ApplyResearchesTech (int lp_player);
void libCamp_gf_TS_UpdateResearchUnitHelpPanel (int lp_player);
void libCamp_gf_AddProgressToStoryResearch (int lp_researchObject, int lp_count);
void libCamp_gf_SetStoryResearchPurchased (int lp_researchID);
void libCamp_gf_SetStoryResearchPointsConverted (int lp_category, int lp_points);
void libCamp_gf_SetStoryResearchPointsOld (int lp_category, int lp_points);
int libCamp_gf_TS_StoryResearchPointsOld (int lp_categeory);
int libCamp_gf_TS_ResearchUIResearchID (int lp_researchItem);
void libCamp_gf_DisplayResearchPanel (trigger lp_exitCallback);
void libCamp_gf_TS_ResearchUICreate ();
void libCamp_gf_TS_ResearchUIUpdate ();
void libCamp_gf_TS_ResearchUIClearProtossConfirmationText ();
void libCamp_gf_TS_ResearchUIClearZergConfirmationText ();
void libCamp_gf_TS_RoomChangePanelCreate ();
void libCamp_gf_AddRoomChangePanelButton (text lp_roomName, trigger lp_clickCallback, trigger lp_updateCallback, int lp_custonData, text lp_tip);
int libCamp_gf_LastAddRoomChangePanelButton ();
int libCamp_gf_RoomChangePanelButtonCount ();
int libCamp_gf_RoomChangePanelCurrentButton ();
int libCamp_gf_RoomChangePanelButtonCustomData (int lp_buttonId);
bool libCamp_gf_RoomChangePanelIsVisible ();
void libCamp_gf_HideRoomChangePanel (bool lp_showHide);
void libCamp_gf_UpdateRoomChangePanel ();
void libCamp_gf_DisableRoomChangePanelButton (bool lp_enableDisable, int lp_buttonId);
void libCamp_gf_SetRoomChangePanelButtonState (int lp_buttonId, int lp_state);
void libCamp_gf_FlashRoomChangePanelButton (int lp_buttonId);
void libCamp_gf_StopFlashingRoomChangePanelButton (int lp_buttonId);
void libCamp_gf_TS_InitializeSceneDataSingle (int lp_iD, text lp_name, string lp_image, string lp_icon);
void libCamp_gf_TS_InitializeSceneData ();
void libCamp_gf_RegisterSceneCallback (int lp_scene, trigger lp_callback);
trigger libCamp_gf_SceneCallback (int lp_scene);
bool libCamp_gf_ScenePlayed (int lp_scene);
text libCamp_gf_SceneName (int lp_scene);
void libCamp_gf_SetScenePlayed (int lp_scene, bool lp_played);
void libCamp_gf_ChangeAmbience (string lp_ambience);
int libCamp_gf_StoryState (int lp_stateID);
int libCamp_gf_StoryCredits ();
int libCamp_gf_TS_CampaignDifficulty ();
void libCamp_gf_SetStoryState (int lp_stateID, int lp_value);
void libCamp_gf_SetStoryCredits (int lp_value);
void libCamp_gf_TS_SetCampaignDifficulty (int lp_difficulty);
void libCamp_gf_TS_InitializeStateData ();
void libCamp_gf_TS_UpdateStoryStates ();
text libCamp_gf_PlanetName (int lp_planetID);
int libCamp_gf_PlanetID (int lp_index);
text libCamp_gf_PlanetSubtitle (int lp_planetID);
int libCamp_gf_PlanetMission (int lp_planetID);
string libCamp_gf_PlanetLighting (int lp_planetID);
string libCamp_gf_PlanetIconModel (int lp_planetID);
string libCamp_gf_PlanetModel (int lp_planetID);
text libCamp_gf_PlanetMissionResearchOpportunitiesText (int lp_mission, text lp_protossStyle, text lp_zergStyle);
int libCamp_gf_FirstPlanet ();
int libCamp_gf_LastPlanet ();
void libCamp_gf_TS_InitializePlanetDataSingle (int lp_planetID, text lp_name, text lp_subtitle, string lp_model, string lp_buttonModel, string lp_lighting, string lp_image, soundlink lp_ambientSound);
void libCamp_gf_TS_InitializePlanetData ();
int libCamp_gf_AddPlanet (int lp_planet);
int libCamp_gf_TechPurchasableTechID (int lp_techPurchasable);
bool libCamp_gf_CanAffordTech (int lp_techID);
int libCamp_gf_CostofPurchasedTech ();
int libCamp_gf_NumberofPurchasedTech ();
int libCamp_gf_NumberofAvailableTech ();
string libCamp_gf_TS_StoryTechConvoID (int lp_tech);
text libCamp_gf_StoryTechName (int lp_tech);
text libCamp_gf_StoryTechTooltip (int lp_tech);
text libCamp_gf_StoryTechDescription (int lp_tech);
int libCamp_gf_StoryTechCost (int lp_tech);
int libCamp_gf_StoryTechSlot (int lp_tech);
string libCamp_gf_StoryTechIcon (int lp_tech);
string libCamp_gf_StoryTechMovie (int lp_tech);
string libCamp_gf_StoryTechUpgrade (int lp_tech, int lp_index);
abilcmd libCamp_gf_StoryTechAbilityCommand (int lp_tech, int lp_index);
bool libCamp_gf_StoryTechUnitIsEnabled (string lp_techUnit);
string libCamp_gf_StoryTechGroupIcon (int lp_group);
string libCamp_gf_StoryTechGroupUnitType (int lp_group);
text libCamp_gf_StoryTechGroupDescription (int lp_group);
text libCamp_gf_StoryTechGroupTooltip (int lp_group);
bool libCamp_gf_StoryTechStateCheck (int lp_storyTech, int lp_state);
string libCamp_gf_TS_HelpUnitsPanel_UnitTypeStringID (string lp_unitType);
bool libCamp_gf_TS_HelpUnitsPanel_EnabledUnitTypeAlreadyExisted (string lp_unitType);
bool libCamp_gf_TS_StoryTechGroupUIUnlocked (int lp_group);
int libCamp_gf_TS_StoryTechPurchasedCountInCategory (int lp_category);
void libCamp_gf_SetTechRestrictionsCallback (trigger lp_callbackTrigger);
void libCamp_gf_DisplayTechConsole (trigger lp_exitTrigger);
void libCamp_gf_EnableCampaignTechUnit (bool lp_enableDisable, int lp_techUnit, int lp_player);
void libCamp_gf_AddUnitTypeToUnitHelpPanel (string lp_unitType, bool lp_saveInHistory, int lp_player);
void libCamp_gf_ApplyCampaignTech (int lp_player);
void libCamp_gf_TS_ApplyCampaignTechLimitsUnlockUnits (int lp_player);
void libCamp_gf_TS_ApplyCampaignTechLimitsProtoss ();
void libCamp_gf_TS_UpdateTechAddons (int lp_player);
void libCamp_gf_TS_UpdateTechUpgrades (int lp_player);
void libCamp_gf_TS_UpdateTechGroupStates ();
void libCamp_gf_TS_UpdateTechStates ();
void libCamp_gf_TS_InitializeTechCategorySingle (int lp_techGroup, text lp_name, int lp_slot);
void libCamp_gf_TS_InitializeTechCategory ();
void libCamp_gf_TS_InitializeTechGroundSingle (int lp_techSubGroup, int lp_category, string lp_unitType, text lp_name, text lp_description, text lp_tooltip, string lp_icon, string lp_iconBig, bool lp_showOnReport);
void libCamp_gf_TS_InitializeTechGroup ();
void libCamp_gf_TS_InitializeTechDataSingle (int lp_tech, int lp_group, string lp_convoID, int lp_requires);
void libCamp_gf_TS_InitializeTechData ();
void libCamp_gf_TS_ResetTechData ();
void libCamp_gf_TS_CreateTechCategoryUI ();
void libCamp_gf_TS_CreateTechGroupUI ();
void libCamp_gf_TS_CreateTechUI ();
void libCamp_gf_TS_UpdateTechGroupUI ();
void libCamp_gf_TS_UpdateTechUI ();
void libCamp_gf_TS_UpdateTechUINewGroups ();
void libCamp_gf_TS_UpdateTechVisuals ();
void libCamp_gf_TS_BuyAllTech ();
void libCamp_gf_TS_StoryCheckTechReqSingle (int lp_tech, int lp_requiredTech);
void libCamp_gf_TS_StoryCheckTechReqs ();
void libCamp_gf_TS_HelpUnitsPanel_AddEnabledUnitType (string lp_unitType);
void libCamp_gf_TS_HelpUnitsPanel_ResetEnabledUnitTypes ();
void libCamp_gf_TS_HelpUnitsPanel_UpdatePanel ();
void libCamp_gf_TS_HelpTechTree_UpdatePanel ();
string libCamp_gf_TS_BankSectionName (string lp_section);
string libCamp_gf_TS_BackToStoryModeLoadingImage (string lp_imageToDo);
text libCamp_gf_TS_FormatLoadingScreenText (int lp_mission);
string libCamp_gf_TS_MissionBankName (int lp_mission);
string libCamp_gf_StoryModeRoomStates ();
void libCamp_gf_LoadCampaignData (int lp_map);
void libCamp_gf_PrepareForMission (int lp_nextMission, bool lp_nextIsSimulation, bool lp_nextIsVictoryPlayAgain, int lp_difficulty);
void libCamp_gf_TS_PrepareForMissionLoadingScreen (int lp_nextMission, bool lp_restart);
void libCamp_gf_PrepareForStoryMode (int lp_resultFromVictory, int lp_difficulty);
void libCamp_gf_PrepareForStoryModeTransitionalSave ();
void libCamp_gf_SetStoryModeRoomStates (string lp_roomStates);
void libCamp_gf_RegisterStoryModeRoomStatesDefaultCallback (trigger lp_defaultCallback);
void libCamp_gf_TS_LoadAllTransitionData (int lp_map);
void libCamp_gf_TS_SaveAllTransitionData (bool lp_nextIsSimulation, bool lp_nextIsVictoryPlayAgain, bool lp_resultFromDefeat);
void libCamp_gf_TS_DefaultTransitionVars (bool lp_includeTransitionDetails, bool lp_includeTech, bool lp_includeMissionFlow, bool lp_includeStates);
int libCamp_gf_TS_LoadTransitionVarInteger (bank lp_bank, string lp_section, string lp_key, int lp_default);
bool libCamp_gf_TS_LoadTransitionVarBoolean (bank lp_bank, string lp_section, string lp_key, bool lp_default);
string libCamp_gf_TS_LoadTransitionVarString (bank lp_bank, string lp_section, string lp_key, string lp_default);
void libCamp_gf_TS_SaveTransitionVarInteger (bank lp_bank, string lp_section, string lp_key, int lp_value, int lp_default);
void libCamp_gf_TS_SaveTransitionVarBoolean (bank lp_bank, string lp_section, string lp_key, bool lp_value, bool lp_default);
void libCamp_gf_TS_SaveTransitionVarString (bank lp_bank, string lp_section, string lp_key, string lp_value, string lp_default);
string libCamp_gf_TS_CampaignDifficultyBankKey (int lp_mission, int lp_difficulty);
void libCamp_gf_TS_LoadTransitionVars (bank lp_sourceBank, bool lp_simulation);
void libCamp_gf_TS_SaveTransitionVars (bank lp_targetBank, bool lp_nextIsSimulation, bool lp_nextIsVictoryPlayAgain, bool lp_resultFromDefeat, int lp_saveType);
void libCamp_gf_TS_UpdateTransitionVars ();
void libCamp_gf_TS_OpenCampaignBank ();
void libCamp_gf_TS_OpenMissionBanks ();
void libCamp_gf_TS_SaveMissionBanks ();
void libCamp_gf_CreateStoryModeTransitionSave (text lp_name, text lp_transition);
void libCamp_gf_SaveArcadeGameData ();
void libCamp_gf_TS_PrepareNextMissionPreloading (int lp_victoryStatus);
void libCamp_gf_TS_PrepareNextMissionRooms (int lp_victoryStatus);
void libCamp_gf_TS_PrepareNextMissionActors (int lp_victoryStatus);
void libCamp_gf_TS_PrepareRoomPreloading (int lp_room);
void libCamp_gf_TS_PrepareActorPreloading (int lp_actor);
int libCamp_gf_TS_NextMissionLocation (int lp_victoryStatus);
void libCamp_gf_TS_InitializeStoryRoomSingle (int lp_room, string lp_roomUnitString);
void libCamp_gf_TS_InitializeStoryRooms ();
void libCamp_gf_TS_InitializeStoryActorSingle (int lp_actor, string lp_unitType);
void libCamp_gf_TS_InitializeStoryActors ();
void libCamp_gf_TS_InitializeStoryModeLoadingImages ();
void libCamp_gf_CP_SetCampaignCompleted (bool lp_completed);
void libCamp_gf_CP_LoadVars ();
void libCamp_gf_CP_SaveVars ();
bool libCamp_gf_CampaignCompleted ();
void libCamp_gf_CreateCampaignTutorial (text lp_title, text lp_description, string lp_icon, string lp_movie);
string libCamp_gf_TS_Tutorial_ConvertMovieToString (string lp_movie);
string libCamp_gf_TS_Tutorial_ConvertImageToString (string lp_image);
string libCamp_gf_TS_Tutorial_ConvertStringToMovie (string lp_string);
string libCamp_gf_TS_Tutorial_ConvertStringToImage (string lp_string);
bool libCamp_gf_TS_Tutorial_AlreadyExisted (string lp_movie);
void libCamp_gf_TS_Tutorial_AddToHistory (text lp_title, text lp_description, string lp_icon, string lp_movie);
void libCamp_gf_TS_Tutorial_ResetHistory ();
void libCamp_gf_TS_Tutorial_RestoreHistoryToUI ();
void libCamp_gf_HideStoryUI (bool lp_showHide, bool lp_includeTip);
void libCamp_gf_DisplayCampaignVictoryScoreScreen (int lp_mission);
string libCamp_gf_TS_SetVictoryScreenBackground (int lp_map);
void libCamp_gf_TS_UpdateCampaignScreen (int lp_mission);
void libCamp_gf_TS_CampaignVictory ();
bool libCamp_gf_CampaignDebugModeIsOn (string lp_mode);
void libCamp_gf_TS_DebugProgressInitMissionPath ();
void libCamp_gf_TS_DebugProgressInitMissionPathEarly ();
void libCamp_gf_TS_DebugProgressInitMissionPathAverage ();
void libCamp_gf_TS_DebugProgressInitMissionPathLate ();
void libCamp_gf_TS_DebugProgressMissionPathRequireCopy (int lp_by, int lp_required, int lp_type);
void libCamp_gf_TS_DebugProgressMissionPathRequireSet (int lp_by, int lp_required, int lp_type);
void libCamp_gf_TS_DebugProgressAddMissionButton (int lp_mission, fixed lp_col, fixed lp_row);
void libCamp_gf_TS_DebugProgressCreateDialog ();
text libCamp_gf_TS_DebugProgressFormatRequirementsCount (int lp_missionCount, text lp_extraText, bool lp_met);
text libCamp_gf_TS_DebugProgressFormatRequirementsMission (int lp_mission, bool lp_met);
text libCamp_gf_TS_DebugProgressFormatMissionUnitUnlocked (int lp_mission);
text libCamp_gf_TS_DebugProgressFormatMissionCredits (int lp_mission);
void libCamp_gf_TS_DebugProgressUpdateDialog ();
void libCamp_gf_TS_DebugProgressDisplayDialog (int lp_currentMission, trigger lp_oKCallback, trigger lp_cancelCallback);
void libCamp_gf_TS_DebugProgressSaveStates ();
void libCamp_gf_TS_DebugProgressRestoreStates ();
void libCamp_gf_TS_DebugProgressMissionDialogShow ();
int libCamp_gf_TS_DebugBuyTechNumberOfUnitsUnlocked ();
void libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl (int lp_type, int lp_anchor, int lp_offsetX, int lp_offsetY, int lp_width, int lp_height, text lp_label);
void libCamp_gf_TS_DebugBuyTechCreateDialog ();
void libCamp_gf_TS_DebugBuyTechCreateDialogMission ();
void libCamp_gf_TS_DebugBuyTechCreateDialogStory ();
void libCamp_gf_TS_DebugBuyTechUpdateCredits ();
void libCamp_gf_TS_DebugBuyTechUnitsUnlockAll ();
void libCamp_gf_TS_DebugBuyTechUnitsReset ();
void libCamp_gf_TS_DebugBuyTechUpgradesBuyAll ();
void libCamp_gf_TS_DebugBuyTechUpgradesReset ();
void libCamp_gf_TS_DebugBuyTechSaveMissionBank (int lp_mission);
void libCamp_gf_TS_DebugBuyTechInitPurchasableShortcut ();
void libCamp_gf_TS_DebugBuyTechInitPurchasableEarly ();
void libCamp_gf_TS_DebugBuyTechInitPurchasableAverage ();
void libCamp_gf_TS_DebugBuyTechInitPurchasableLate ();
void libCamp_gf_TS_DebugBuyTechEarly ();
void libCamp_gf_TS_DebugBuyTechAverage ();
void libCamp_gf_TS_DebugBuyTechLate ();
void libCamp_gf_PurchaseStorymodeTech ();
int libCamp_gf_TS_DebugConvertIntegerToTechCheatOption (int lp_option);
void libCamp_gf_TS_DebugSetTechCheatOption (int lp_option);
void libCamp_gf_TS_DebugUpdateTechCustomDialog ();
text libCamp_gf_TS_DebugBoolToText (bool lp_bool);
void libCamp_gf_RegisterFootageRecording (trigger lp_callback);
void libCamp_gf_TS_FootageRecording ();

// Trigger Declarations
trigger libCamp_gt__ZergDropPod;
trigger libCamp_gt__TerranDropPod;
trigger libCamp_gt_TS_MissionVictoryCallbackBlockActionQueueOneMinute;
trigger libCamp_gt_TS_MissionVictoryCallbackBlockActionQueue;
trigger libCamp_gt_TS_AbortMission;
trigger libCamp_gt__CB_ChatBubbleActivated;
trigger libCamp_gt__CB_ActivateChatBubble;
trigger libCamp_gt__CB_ChatBubbleUnitDied;
trigger libCamp_gt__CB_ShowChatBubbleOnUnit;
trigger libCamp_gt_chatbubbledebug;
trigger libCamp_gt__CB_WaitForSound;
trigger libCamp_gt__MsgDlgButtonClicked;
trigger libCamp_gt_ZS_CampaignTrialDialogQuitClicked;
trigger libCamp_gt_ZS_CampaignTrialDialogUpgradeClicked;
trigger libCamp_gt_TS_MercNewToAvailable;
trigger libCamp_gt_TS_MercUIPurchase;
trigger libCamp_gt_TS_MercUIExit;
trigger libCamp_gt_TS_BattleReportMissionReplay;
trigger libCamp_gt_TS_BattleReportSceneReplay;
trigger libCamp_gt_TS_BattleReportPanelLeave;
trigger libCamp_gt_TS_ResearchUIPurchase;
trigger libCamp_gt_TS_ResearchUIExit;
trigger libCamp_gt_TS_RoomChangeButtonResponse;
trigger libCamp_gt_TSTechConsoleExit;
trigger libCamp_gt_TSTechItemSelected;
trigger libCamp_gt_TSTechCategorySelected;
trigger libCamp_gt_TSTechConsolePurchase;
trigger libCamp_gt_TS_Tech_CalldownSupplyDepot;
trigger libCamp_gt_Debug_StartPerformanceLogging;
trigger libCamp_gt_Debug_Preloading;
trigger libCamp_gt_LoadingDone;
trigger libCamp_gt_TS_VSScreenContinue;
trigger libCamp_gt_TS_VSScreenPlayAgain;
trigger libCamp_gt_TS_EndCinematic;
trigger libCamp_gt_TS_EndCredits;
trigger libCamp_gt_TS_EndCreditsEnds;
trigger libCamp_gt_TS_CheatUsed;
trigger libCamp_gt_TS_FlyingOutHouse;
trigger libCamp_gt_TS_TerranUpTheNight;
trigger libCamp_gt_TS_Temp;
trigger libCamp_gt_TS_DebugProgressMissionButton;
trigger libCamp_gt_TS_DebugProgressUnlockSecretButton;
trigger libCamp_gt_TS_DebugProgressReset;
trigger libCamp_gt_TS_DebugProgressLaunchMission;
trigger libCamp_gt_TS_DebugProgressLaunchMissionPopup;
trigger libCamp_gt_TS_DebugProgressOK;
trigger libCamp_gt_TS_DebugProgressCancel;
trigger libCamp_gt_TS_DebugPROGRESS;
trigger libCamp_gt_TS_DebugPROGRESSDevelop;
trigger libCamp_gt_TS_DebugProgressOKCallback;
trigger libCamp_gt_TS_DebugResearchPanel;
trigger libCamp_gt_TS_DebugResearchPanelCloseButtonClicked;
trigger libCamp_gt_TS_DebugResearchPanelExit;
trigger libCamp_gt_TS_DebugResearchPanelButtonClicked;
trigger libCamp_gt_TS_DebugResearchPoint;
trigger libCamp_gt_TS_DebugMercenaryPanel;
trigger libCamp_gt_TS_DebugMercenaryPanelCloseButtonClicked;
trigger libCamp_gt_TS_DebugMercenaryPanelExit;
trigger libCamp_gt_TS_DebugMercenaryPanelButtonClicked;
trigger libCamp_gt_TS_DebugBuyTechButtonClicked;
trigger libCamp_gt_TS_DebugBuyTechConsoleExit;
trigger libCamp_gt_DebugBUYTECH;
trigger libCamp_gt_DebugDisplayTechCustomButton;
trigger libCamp_gt_DebugHideTechCustomButton;
trigger libCamp_gt_DebugTechCustomButtonClicked;
trigger libCamp_gt_DebugCREDITS;
trigger libCamp_gt_DebugDIFFICULTY;
trigger libCamp_gt_TS_DebugXDATA;
trigger libCamp_gt_TS_DebugXDEFAULT;
trigger libCamp_gt_TS_DebugXLOAD;
trigger libCamp_gt_TS_FootageRecording;
trigger libCamp_gt_TS_DebugVictorySequence;
trigger libCamp_gt_TS_DebugVictoryScoreScreen;
trigger libCamp_gt_DebugPerfTestGetFps;
trigger libCamp_gt_DebugSTARTFPS;
trigger libCamp_gt_DebugSTOPFPS;
trigger libCamp_gt_StartTensionMusic;
trigger libCamp_gt_StopTensionMusic;

// Functions
void libCamp_gf_DisplayCampaignMessage (playergroup lp_toPlayerGroup, int lp_messageType, text lp_message, int lp_formatOrNot) {
    int auto7647A521_val;

    // Implementation
    if ((lp_formatOrNot == 0)) {
        auto7647A521_val = lp_messageType;
        if (auto7647A521_val == 1) {
            UIDisplayMessage(lp_toPlayerGroup, c_messageAreaSubtitle, (StringExternal("Param/Value/lib_Camp_E402A24F") + lp_message));
            SoundPlay(SoundLink("TUIHint", 0), lp_toPlayerGroup, 100.0, 0.0);
        }
        else if (auto7647A521_val == 2) {
            UIDisplayMessage(lp_toPlayerGroup, c_messageAreaSubtitle, (StringExternal("Param/Value/lib_Camp_CF4DC4D7") + lp_message));
            SoundPlay(SoundLink("TUIHint", 0), lp_toPlayerGroup, 100.0, 0.0);
        }
        else if (auto7647A521_val == 3) {
            UIDisplayMessage(lp_toPlayerGroup, c_messageAreaSubtitle, (StringExternal("Param/Value/lib_Camp_0BABB1CE") + lp_message));
            SoundPlay(SoundLink("TUISecret", 0), lp_toPlayerGroup, 100.0, 0.0);
        }
        else if (auto7647A521_val == 5) {
            UIDisplayMessage(lp_toPlayerGroup, c_messageAreaSubtitle, (StringExternal("Param/Value/lib_Camp_BD584907") + lp_message));
            SoundPlay(SoundLink("TUINewUnitAcquired", 0), lp_toPlayerGroup, 100.0, 0.0);
        }
        else if (auto7647A521_val == 6) {
            UIDisplayMessage(lp_toPlayerGroup, c_messageAreaSubtitle, (StringExternal("Param/Value/lib_Camp_B323D792") + lp_message));
            SoundPlay(SoundLink("TUINewUnitAvailable", 0), lp_toPlayerGroup, 100.0, 0.0);
        }
        else if (auto7647A521_val == 7) {
            UIDisplayMessage(lp_toPlayerGroup, c_messageAreaSubtitle, (StringExternal("Param/Value/lib_Camp_CF96AAC8") + lp_message));
            SoundPlay(SoundLink("TUINewTechAvailable", 0), lp_toPlayerGroup, 100.0, 0.0);
        }
        else if (auto7647A521_val == 4) {
            UIDisplayMessage(lp_toPlayerGroup, c_messageAreaSubtitle, (StringExternal("Param/Value/lib_Camp_72F8214E") + lp_message));
            SoundPlay(SoundLink("TUIWarning", 0), lp_toPlayerGroup, 100.0, 0.0);
        }
        else if (auto7647A521_val == 0) {
            UIDisplayMessage(lp_toPlayerGroup, c_messageAreaSubtitle, (StringExternal("Param/Value/lib_Camp_B35FFFD8") + lp_message));
            SoundPlay(SoundLink("TUIWarning", 0), lp_toPlayerGroup, 100.0, 0.0);
        }
        else {
        }
    }
    else {
        UIDisplayMessage(lp_toPlayerGroup, c_messageAreaSubtitle, lp_message);
    }
}

void libCamp_gf__ZergDropPod (point lp_location, unitgroup lp_units) {
    unitgroup auto07D8FB02_g;
    int auto07D8FB02_u;
    unitgroup autoC5AA5B6F_g;
    int autoC5AA5B6F_u;

    // Variable Declarations
    unit lv_chosenUnit;
    unit lv_dropPod;
    point lv_dropPodLocation;
    fixed lv_angle;
    point lv_dropLocation;
    unit lv_creep;

    // Variable Initialization

    // Implementation
    auto07D8FB02_g = lp_units;
    auto07D8FB02_u = 1;
    for ( ; auto07D8FB02_u <= UnitGroupCount(auto07D8FB02_g, c_unitCountAll) ; auto07D8FB02_u += BoolToInt(lv_chosenUnit == UnitGroupUnit(auto07D8FB02_g, auto07D8FB02_u)) ) {
        lv_chosenUnit = UnitGroupUnit(auto07D8FB02_g, auto07D8FB02_u);
        libNtve_gf_ShowHideUnit(lv_chosenUnit, false);
        libNtve_gf_PauseUnit(lv_chosenUnit, true);
    }
    libNtve_gf_CreateUnitsAtPoint2(1, "ZergDropPod", 0, 0, lp_location);
    UnitSetTeamColorIndex(UnitLastCreated(), 4);
    lv_dropPod = UnitLastCreated();
    Wait(2.5, c_timeGame);
    lv_dropPodLocation = UnitGetPosition(lv_dropPod);
    libNtve_gf_CreateUnitsAtPoint2(1, "ZergDropPodCreep", 0, 0, lv_dropPodLocation);
    lv_creep = UnitLastCreated();
    Wait(1.0, c_timeGame);
    lv_angle = 0.0;
    autoC5AA5B6F_g = lp_units;
    autoC5AA5B6F_u = 1;
    for ( ; autoC5AA5B6F_u <= UnitGroupCount(autoC5AA5B6F_g, c_unitCountAll) ; autoC5AA5B6F_u += BoolToInt(lv_chosenUnit == UnitGroupUnit(autoC5AA5B6F_g, autoC5AA5B6F_u)) ) {
        lv_chosenUnit = UnitGroupUnit(autoC5AA5B6F_g, autoC5AA5B6F_u);
        lv_dropLocation = PointWithOffsetPolar(lv_dropPodLocation, RandomFixed(0.5, 2.0), lv_angle);
        UnitSetPosition(lv_chosenUnit, lv_dropLocation, false);
        libNtve_gf_ShowHideUnit(lv_chosenUnit, true);
        libNtve_gf_PauseUnit(lv_chosenUnit, false);
        Wait(0.125, c_timeGame);
        lv_angle = (lv_angle + 77.0);
    }
    libNtve_gf_PauseUnit(lv_creep, true);
    Wait(3.0, c_timeGame);
    UnitRemove(lv_creep);
    Wait(4.0, c_timeGame);
    UnitKill(lv_dropPod);
}

void libCamp_gf__TerranDropPod (point lp_location, unitgroup lp_units) {
    unitgroup autoD1C3C149_g;
    int autoD1C3C149_u;
    unitgroup auto44CBF278_g;
    int auto44CBF278_u;

    // Variable Declarations
    unit lv_chosenUnit;
    unit lv_dropPod;
    point lv_dropPodLocation;
    fixed lv_angle;
    fixed lv_angleStart;
    point lv_dropLocation;
    fixed lv_distance;
    int lv_subIndex;
    point lv_moveLocation;
    int lv_countPerLine;

    // Variable Initialization

    // Implementation
    autoD1C3C149_g = lp_units;
    autoD1C3C149_u = 1;
    for ( ; autoD1C3C149_u <= UnitGroupCount(autoD1C3C149_g, c_unitCountAll) ; autoD1C3C149_u += BoolToInt(lv_chosenUnit == UnitGroupUnit(autoD1C3C149_g, autoD1C3C149_u)) ) {
        lv_chosenUnit = UnitGroupUnit(autoD1C3C149_g, autoD1C3C149_u);
        libNtve_gf_ShowHideUnit(lv_chosenUnit, false);
        libNtve_gf_PauseUnit(lv_chosenUnit, true);
    }
    libNtve_gf_CreateUnitsAtPoint2(1, "TerranDropPod", 0, 0, lp_location);
    lv_dropPod = UnitLastCreated();
    libNtve_gf_PlayAnimation(libNtve_gf_MainActorofUnit(lv_dropPod), c_animNameDefault, "Birth", c_animFlagNonLooping, c_animTimeDefault);
    Wait(3.5, c_timeGame);
    lv_countPerLine = 4;
    if ((UnitGroupCount(lp_units, c_unitCountAlive) > 16)) {
        lv_countPerLine = ((UnitGroupCount(lp_units, c_unitCountAlive) + 3) / 4);
    }
    else {
    }
    lv_dropPodLocation = UnitGetPosition(lv_dropPod);
    lv_distance = (0.8 + ((IntToFixed((UnitGroupCount(lp_units, c_unitCountAlive) + 3)) / IntToFixed(lv_countPerLine)) * 0.8));
    lv_subIndex = 1;
    lv_angleStart = 225.0;
    lv_angle = lv_angleStart;
    auto44CBF278_g = lp_units;
    auto44CBF278_u = 1;
    for ( ; auto44CBF278_u <= UnitGroupCount(auto44CBF278_g, c_unitCountAll) ; auto44CBF278_u += BoolToInt(lv_chosenUnit == UnitGroupUnit(auto44CBF278_g, auto44CBF278_u)) ) {
        lv_chosenUnit = UnitGroupUnit(auto44CBF278_g, auto44CBF278_u);
        lv_dropLocation = PointWithOffsetPolar(lv_dropPodLocation, 1.0, lv_angle);
        SoundPlayAtPoint(SoundLink("Medivac_Unload", 0), PlayerGroupAll(), lv_dropLocation, 0.0, 100.0, 0.0);
        Wait(0.125, c_timeGame);
        UnitSetPosition(lv_chosenUnit, lv_dropLocation, false);
        libNtve_gf_ShowHideUnit(lv_chosenUnit, true);
        libNtve_gf_PauseUnit(lv_chosenUnit, false);
        lv_moveLocation = PointWithOffsetPolar(lv_dropPodLocation, lv_distance, lv_angle);
        UnitIssueOrder(lv_chosenUnit, OrderTargetingPoint(AbilityCommand("move", 0), lv_moveLocation), c_orderQueueReplace);
        if ((lv_subIndex == lv_countPerLine)) {
            lv_subIndex = 1;
            lv_angle = lv_angleStart;
            lv_distance -= 0.8;
        }
        else {
            lv_subIndex += 1;
            lv_angle += 10.0;
        }
    }
    UnitKill(lv_dropPod);
}

void libCamp_gf_CreateDropPod (int lp_race, point lp_location, unitgroup lp_units, bool lp_waitDontWait) {
    int auto64417E0D_val;

    // Variable Declarations
    point lv_dropLocation;
    unitgroup lv_dropUnits;

    // Variable Initialization
    lv_dropUnits = UnitGroupEmpty();

    // Implementation
    lv_dropLocation = Point(PointGetX(lp_location), PointGetY(lp_location));
    lv_dropUnits = UnitGroupCopy(lp_units);
    auto64417E0D_val = lp_race;
    if (auto64417E0D_val == 0) {
        if ((lp_waitDontWait == true)) {
            libCamp_gf__TerranDropPod(lv_dropLocation, lv_dropUnits);
        }
        else {
            libCamp_gv__TP_DropPod_Location = lv_dropLocation;
            libCamp_gv__TP_DropPod_Units = lv_dropUnits;
            TriggerExecute(libCamp_gt__TerranDropPod, true, false);
        }
    }
    else if (auto64417E0D_val == 1) {
        if ((lp_waitDontWait == true)) {
            libCamp_gf__ZergDropPod(lv_dropLocation, lv_dropUnits);
        }
        else {
            libCamp_gv__TP_DropPod_Location = lv_dropLocation;
            libCamp_gv__TP_DropPod_Units = lv_dropUnits;
            TriggerExecute(libCamp_gt__ZergDropPod, true, false);
        }
    }
    else {
    }
}

void libCamp_gf_TS_SaveMissionCompletion () {
    // Variable Declarations
    int lv_difficulty;
    int lv_bestTime;

    // Variable Initialization
    lv_difficulty = 1;

    // Implementation
    if ((libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 1) == false)) {
        return ;
    }
    else {
    }
    lv_difficulty = PlayerDifficulty(1);
    libCamp_gv_tS_MissionCompleteTime = FixedToInt(libNtve_gf_GamePlayTime(1));
    libCamp_gf_TS_SetMissionDifficultyCompleted(libCamp_gv_tS_CurrentMap, lv_difficulty, true);
    lv_bestTime = libCamp_gf_MissionCompleteBestTime(libCamp_gv_tS_CurrentMap, lv_difficulty);
    if (((lv_bestTime <= 0) || (libCamp_gv_tS_MissionCompleteTime < lv_bestTime))) {
        libCamp_gf_TS_SetMissionCompleteBestTime(libCamp_gv_tS_CurrentMap, lv_difficulty, libCamp_gv_tS_MissionCompleteTime);
    }
    else {
    }
}

void libCamp_gf_TS_GameOver () {
}

void libCamp_gf_EndCampaignMission (int lp_player, int lp_type) {
    // Implementation
    PerfTestStop();
    TriggerStop(libCamp_gt_DebugPerfTestGetFps);
    TriggerQueueClear(c_triggerQueueRetain);
    TriggerQueuePause(true);
    if ((lp_type == c_gameOverVictory)) {
        libCamp_gf_DisplayCampaignVictoryScoreScreen(libCamp_gv_tS_CurrentMap);
    }
    else {
        GameOver(lp_player, lp_type, true, false);
    }
}

void libCamp_gf_RunMissionVictorySequence (trigger lp_victoryCinematic) {
    // Implementation
    if ((libCamp_gv_tS_DebugProgressLaunchingMission == true) && (GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true)) {
        return ;
    }
    else {
    }
    libCamp_gf_TS_GameOver();
    libCamp_gf_TS_SaveMissionCompletion();
    libCamp_gf_TS_UpdateMissionObjectives();
    AITimePause(true);
    TriggerQueueClear(c_triggerQueueRetain);
    libCamp_gv_tS_MissionVictoryActionQueyeEmpty = false;
    TriggerExecute(libCamp_gt_TS_MissionVictoryCallbackBlockActionQueueOneMinute, true, false);
    while (!((libCamp_gv_tS_MissionVictoryActionQueyeEmpty == true))) {
        Wait(1.0, c_timeGame);
    }
    TriggerQueueClear(c_triggerQueueKill);
    TriggerExecute(lp_victoryCinematic, true, false);
    TriggerExecute(libCamp_gt_TS_MissionVictoryCallbackBlockActionQueue, true, false);
}

void libCamp_gf_CreateStorymodeTips () {
    int autoD4A0925D_i;
    int auto88BEAAAC_i;

    // Variable Declarations
    int lv_indexMerc;
    int lv_indexResearch;
    int lv_index;

    // Variable Initialization

    // Implementation
    if ((libCamp_gf_NumberOfMissions(3) == 9) && (ConversationDataStateGetValue("StoryTips|KeyboardShortcuts") == 0)) {
        ConversationDataStateSetValue("StoryTips|KeyboardShortcuts", 1);
        libCamp_gf_CreateTipFromConversationState("StoryTips|KeyboardShortcuts", 0, PlayerGroupAll());
        Wait(libCamp_gv_campaignHintDelay, c_timeReal);
    }
    else {
    }
    if ((libCamp_gf_StoryState(7) == 0) && (libCamp_gv_tS_CurrentMap != 16) && (libCamp_gv_tS_CurrentMap != 10) && (libCamp_gv_tS_CurrentMap != 11) && (libCamp_gv_tS_CurrentMap != 27) && (libCamp_gv_tS_CurrentMap != 22) && (libCamp_gv_tS_CurrentMap != 23) && (libCamp_gv_tS_CurrentMap != 24) && (libCamp_gv_tS_CurrentMap != 25)) {
        autoD4A0925D_i = libCamp_gv_TSC_MERC_FIRST;
        while (autoD4A0925D_i <= libCamp_gv_TSC_MERC_LAST) {
            lv_indexMerc = libCamp_gv_tS_MercID[autoD4A0925D_i];
            if ((libCamp_gf_MercStatusCheck(lv_indexMerc, 2) == true)) {
                libCamp_gf_SetStoryState(7, 1);
                libCamp_gf_CreateTipFromConversationState("StoryTips|MissionMercenaries", 0, PlayerGroupAll());
                Wait(libCamp_gv_campaignHintDelay, c_timeReal);
                break;
            }
            else {
            }
            autoD4A0925D_i = autoD4A0925D_i + 1;
        }
    }
    else {
    }
    if ((libCamp_gf_StoryState(8) == 0)) {
        auto88BEAAAC_i = libCamp_gv_TSC_RESEARCH_FIRST;
        while (auto88BEAAAC_i <= libCamp_gv_TSC_RESEARCH_LAST) {
            lv_indexResearch = libCamp_gv_tS_ResearchID[auto88BEAAAC_i];
            if ((libCamp_gf_StoryResearchMissionObject(libCamp_gv_tS_CurrentMap) != 0)) {
                libCamp_gf_SetStoryState(8, 1);
                if ((libCamp_gf_NumberOfMissions(3) >= 5)) {
                    libCamp_gf_CreateTipFromConversationState("StoryTips|MissionResearch", 0, PlayerGroupAll());
                }
                else {
                    libCamp_gf_CreateTipFromConversationState("StoryTips|MissionResearchNoLab", 0, PlayerGroupAll());
                }
                Wait(libCamp_gv_campaignHintDelay, c_timeReal);
                break;
            }
            else {
            }
            auto88BEAAAC_i = auto88BEAAAC_i + 1;
        }
    }
    else {
    }
    libCamp_gf_CreateNewStructureTips();
    libCamp_gf_TS_CreateNewUpgradeTips();
}

void libCamp_gf_CreateNewStructureTips () {
    // Implementation
    if (((libCamp_gv_tS_CurrentMap == 10) || (libCamp_gv_tS_CurrentMap == 11) || (libCamp_gv_tS_CurrentMap == 16) || (libCamp_gv_tS_CurrentMap == 22) || (libCamp_gv_tS_CurrentMap == 23) || (libCamp_gv_tS_CurrentMap == 24) || (libCamp_gv_tS_CurrentMap == 25) || (libCamp_gv_tS_CurrentMap == 27))) {
        return ;
    }
    else {
    }
    if ((libCamp_gf_StoryState(32) == 0)) {
        if ((TechTreeAbilityIsAllowed(1, AbilityCommand("TerranBuild", 10)) == true)) {
            libCamp_gf_SetStoryState(32, 1);
            libCamp_gf_CreateTipFromConversationState("StoryTips|MissionNewStructureFactory", 2, PlayerGroupAll());
            Wait(libCamp_gv_campaignHintDelay, c_timeReal);
        }
        else {
        }
    }
    else {
    }
    if ((libCamp_gf_StoryState(33) == 0)) {
        if ((TechTreeAbilityIsAllowed(1, AbilityCommand("TerranBuild", 11)) == true)) {
            libCamp_gf_SetStoryState(33, 1);
            libCamp_gf_CreateTipFromConversationState("StoryTips|MissionNewStructureStarport", 2, PlayerGroupAll());
            Wait(libCamp_gv_campaignHintDelay, c_timeReal);
        }
        else {
        }
    }
    else {
    }
}

void libCamp_gf_TS_CreateNewUpgradeTips () {
    // Implementation
    if (((libCamp_gv_tS_CurrentMap == 10) || (libCamp_gv_tS_CurrentMap == 11) || (libCamp_gv_tS_CurrentMap == 16) || (libCamp_gv_tS_CurrentMap == 22) || (libCamp_gv_tS_CurrentMap == 23) || (libCamp_gv_tS_CurrentMap == 24) || (libCamp_gv_tS_CurrentMap == 25) || (libCamp_gv_tS_CurrentMap == 27))) {
        return ;
    }
    else {
    }
    if ((libCamp_gv_tS_UpgradeInfantry2 == true) && (ConversationDataStateGetValue("StoryTips|EngineeringBay2") == 0)) {
        libCamp_gf_CreateTipFromConversationState("StoryTips|EngineeringBay2", 0, PlayerGroupAll());
        ConversationDataStateSetValue("StoryTips|EngineeringBay2", 1);
        Wait(libCamp_gv_campaignHintDelay, c_timeReal);
    }
    else {
    }
    if ((libCamp_gv_tS_UpgradeInfantry3 == true) && (ConversationDataStateGetValue("StoryTips|EngineeringBay3") == 0)) {
        libCamp_gf_CreateTipFromConversationState("StoryTips|EngineeringBay3", 0, PlayerGroupAll());
        ConversationDataStateSetValue("StoryTips|EngineeringBay3", 1);
        Wait(libCamp_gv_campaignHintDelay, c_timeReal);
    }
    else {
    }
    if (((libCamp_gv_tS_UpgradeVehicle2 == true) || (libCamp_gv_tS_UpgradeShip2 == true)) && (ConversationDataStateGetValue("StoryTips|ArmoryLevel2") == 0)) {
        libCamp_gf_CreateTipFromConversationState("StoryTips|ArmoryLevel2", 0, PlayerGroupAll());
        ConversationDataStateSetValue("StoryTips|ArmoryLevel2", 1);
        Wait(libCamp_gv_campaignHintDelay, c_timeReal);
    }
    else {
    }
    if (((libCamp_gv_tS_UpgradeVehicle3 == true) || (libCamp_gv_tS_UpgradeShip3 == true)) && (ConversationDataStateGetValue("StoryTips|ArmoryLevel3") == 0)) {
        libCamp_gf_CreateTipFromConversationState("StoryTips|ArmoryLevel3", 0, PlayerGroupAll());
        ConversationDataStateSetValue("StoryTips|ArmoryLevel3", 1);
        Wait(libCamp_gv_campaignHintDelay, c_timeReal);
    }
    else {
    }
}

void libCamp_gf_CreateTipFromConversationState (string lp_convoState, int lp_tipType, playergroup lp_players) {
    // Implementation
    HelpPanelAddTip(lp_players, libNtve_gf_FormatTipTitle(ConversationDataStateName(lp_convoState), lp_tipType), ConversationDataStateText(lp_convoState, "Description"), ConversationDataStateName(lp_convoState), ConversationDataStateImagePath(lp_convoState));
    ConversationDataStateSetValue(lp_convoState, 1);
}

void libCamp_gf_CreateMissionAutosavePoint (text lp_description) {
    // Variable Declarations
    text lv_name;
    int lv_autosaveDialog;

    // Variable Initialization
    lv_name = StringExternal("Param/Value/lib_Camp_75AB98AF");
    lv_autosaveDialog = c_invalidDialogId;

    // Implementation
    if ((libCamp_gv_tS_CurrentMap == 0)) {
        return ;
    }
    else {
    }
    libCamp_gv_tS_MissionAutoSaveIndex += 1;
    lv_name = (libCamp_gf_MissionName(libCamp_gv_tS_CurrentMap) + StringExternal("Param/Value/lib_Camp_C21C1513"));
    GameSaveCreate(lv_name, lp_description, "", true);
}

void libCamp_gf_SendTransmissionCampaign (unit lp_unit, soundlink lp_sound, int lp_durationType, fixed lp_duration, bool lp_waitUntilDone) {
    // Variable Declarations
    bool lv_flashOption;
    int lv_portrait;
    transmissionsource lv_source;

    // Variable Initialization
    lv_portrait = c_invalidPortraitId;
    lv_source = TransmissionSource();

    // Implementation
    if ((libNtve_gf_PlayerInCinematicMode(1) == false) && (libNtve_gf_PlayerInStoryMode(1) == false)) {
        lv_flashOption = true;
        lv_portrait = libNtve_gf_CinematicPortrait(4);
    }
    else {
        lv_flashOption = false;
        lv_portrait = libNtve_gf_CinematicPortrait(2);
    }
    if ((lp_unit == null)) {
        lv_source = TransmissionSourceFromModel(null);
    }
    else {
        lv_source = TransmissionSourceFromUnit(lp_unit, lv_flashOption, false, "Talk");
    }
    TransmissionSend(PlayerGroupAll(), lv_source, lv_portrait, "Talk", lp_sound, null, null, lp_duration, lp_durationType, lp_waitUntilDone);
}

void libCamp_gf_SetAllSoundChannelVolumesCampaign (int lp_mode) {
    // Implementation
    if ((lp_mode == 2)) {
        libNtve_gf_SetAllSoundChannelVolumes(lp_mode, PlayerGroupAll(), 2.5);
        SoundChannelSetVolume(PlayerGroupAll(), c_soundCategoryVoice, 100.0, 0.5);
    }
    else {
        libNtve_gf_SetAllSoundChannelVolumes(lp_mode, PlayerGroupAll(), 1.0);
        SoundChannelSetVolume(PlayerGroupAll(), c_soundCategoryVoice, 0.0, 0.25);
    }
}

void libCamp_gf_ResearchAIUpgrade (int lp_count, string lp_upgrade, int lp_player) {
    int autoF8AEAD25_n;
    int autoF8AEAD25_i;

    // Implementation
    autoF8AEAD25_n = lp_count;
    for (autoF8AEAD25_i = 1; autoF8AEAD25_i <= autoF8AEAD25_n; autoF8AEAD25_i += 1) {
        AIResearch(lp_player, 4, -1, lp_upgrade);
    }
}

void libCamp_gf_DestroyCacheAndGivePlayerResources (unit lp_cacheUnit, int lp_resourceType, int lp_resourceAmount, int lp_player) {
    int auto5EE29D27_val;

    // Variable Declarations
    int lv_textTag;

    // Variable Initialization
    lv_textTag = c_textTagNone;

    // Implementation
    auto5EE29D27_val = lp_resourceType;
    if (auto5EE29D27_val == c_playerPropMinerals) {
        SoundPlay(SoundLink("UI_ResourcePickup", 0), PlayerGroupAll(), 100.0, 0.0);
        TextTagCreate((StringExternal("Param/Value/lib_Camp_F6EDE668") + IntToText(lp_resourceAmount) + StringExternal("Param/Value/lib_Camp_A7A85440")), 24, UnitGetPosition(lp_cacheUnit), 1.0, true, false, PlayerGroupAll());
        lv_textTag = TextTagLastCreated();
        TextTagSetVelocity(lv_textTag, 0.5, 90.0);
        TextTagSetTime(lv_textTag, c_textTagTimeDuration, 2.0);
        UnitKill(lp_cacheUnit);
        PlayerModifyPropertyInt(lp_player, c_playerPropMinerals, c_playerPropOperAdd, lp_resourceAmount);
    }
    else if (auto5EE29D27_val == c_playerPropVespene) {
        SoundPlay(SoundLink("UI_ResourcePickup", 0), PlayerGroupAll(), 100.0, 0.0);
        TextTagCreate((StringExternal("Param/Value/lib_Camp_0DAA8706") + IntToText(lp_resourceAmount) + StringExternal("Param/Value/lib_Camp_8E9001C5")), 24, UnitGetPosition(lp_cacheUnit), 1.0, true, false, PlayerGroupAll());
        lv_textTag = TextTagLastCreated();
        TextTagSetVelocity(lv_textTag, 0.5, 90.0);
        TextTagSetTime(lv_textTag, c_textTagTimeDuration, 2.0);
        UnitKill(lp_cacheUnit);
        PlayerModifyPropertyInt(lp_player, c_playerPropVespene, c_playerPropOperAdd, lp_resourceAmount);
    }
    else {
    }
}

void libCamp_gf_DisplayResearchPointsGiventoPlayer (int lp_researchObject, unit lp_researchUnit, int lp_player) {
    int autoC89FF57C_val;

    // Variable Declarations
    int lv_category;
    int lv_rewardProtoss;
    int lv_rewardZerg;
    text lv_text;

    // Variable Initialization
    lv_category = 1;

    // Implementation
    lv_rewardProtoss = libCamp_gf_StoryResearchObjectReward(lp_researchObject, 1);
    lv_rewardZerg = libCamp_gf_StoryResearchObjectReward(lp_researchObject, 2);
    if ((lv_rewardProtoss > 0)) {
        lv_category = 1;
        lv_text = TextReplaceWord(StringExternal("Param/Value/lib_Camp_74665700"), StringExternal("Param/Value/lib_Camp_CB944759"), IntToText(lv_rewardProtoss), c_stringReplaceAll, c_stringCase);
    }
    else {
        lv_category = 2;
        lv_text = TextReplaceWord(StringExternal("Param/Value/lib_Camp_E7B59D5B"), StringExternal("Param/Value/lib_Camp_A2E6741E"), IntToText(lv_rewardZerg), c_stringReplaceAll, c_stringCase);
    }
    TextTagCreate(lv_text, 24, UnitGetPosition(lp_researchUnit), 1.0, true, false, PlayerGroupSingle(lp_player));
    libCamp_gf_AddProgressToStoryResearch(lp_researchObject, 1);
    autoC89FF57C_val = lv_category;
    if (autoC89FF57C_val == 1) {
        TextTagSetColor(TextTagLastCreated(), c_textTagColorText, Color(0.00, 50.20, 100.00));
        TextTagSetVelocity(TextTagLastCreated(), 0.5, 90.0);
        TextTagSetTime(TextTagLastCreated(), c_textTagTimeDuration, 4.0);
        SoundPlay(SoundLink("UI_ResourcePickup", -1), PlayerGroupAll(), 100.0, 0.0);
    }
    else if (autoC89FF57C_val == 2) {
        TextTagSetColor(TextTagLastCreated(), c_textTagColorText, Color(100.00, 50.20, 0.00));
        TextTagSetVelocity(TextTagLastCreated(), 0.5, 90.0);
        TextTagSetTime(TextTagLastCreated(), c_textTagTimeDuration, 4.0);
        SoundPlay(SoundLink("UI_ResourcePickup", -1), PlayerGroupAll(), 100.0, 0.0);
    }
    else {
    }
}

int libCamp_gf_LastAddedChatBubble () {
    // Implementation
    return libCamp_gv__CB_Line_Last;
}

void libCamp_gf_ShowChatBubble (unit lp_unit, int lp_player) {
    // Implementation
    libCamp_gv__CB_TP_UNIT = lp_unit;
    libCamp_gv__CB_TP_PLAYER = lp_player;
    libCamp_gv__CB_TP_FORCED = true;
    TriggerExecute(libCamp_gt__CB_ActivateChatBubble, true, false);
}

void libCamp_gf_AddChatBubbleLine2 (int lp_player, unit lp_unit, soundlink lp_sound, text lp_text, fixed lp_duration, int lp_durationType, bool lp_faceOption) {
    // Variable Declarations
    int lv_unitIndex;
    int lv_lineIndex;

    // Variable Initialization

    // Implementation
    if ((libCamp_gv__CB_UnitLine_Count > libCamp_gv__CBC_LINEMAX)) {
        return ;
    }
    else {
    }
    lv_unitIndex = libCamp_gf__CB_Unit_GetIndex(lp_unit);
    if ((lv_unitIndex <= 0)) {
        if ((libCamp_gv__CB_Unit_Count > libCamp_gv__CBC_UNITMAX)) {
            return ;
        }
        else {
        }
        lv_unitIndex = libCamp_gf__CB_Unit_Add(lp_unit);
    }
    else {
    }
    if ((lv_unitIndex <= 0)) {
        return ;
    }
    else {
    }
    lv_lineIndex = libCamp_gf__CB_Line_Add(lp_text, Color(0,0,0), Color(100,100,100), "Talk", 0, "", 0, lp_sound, lp_duration, lp_durationType, lp_faceOption, null, null);
    libCamp_gf__CB_UnitLine_Add(lv_unitIndex, lp_player, lv_lineIndex);
}

void libCamp_gf_ClearChatBubble (int lp_player) {
    // Implementation
    libCamp_gf__CB_Current_Remove(lp_player);
}

void libCamp_gf_RandomlyShuffleChatBubbleLines (unit lp_unit, int lp_player) {
    int auto8B85FB58_ae;
    int auto8B85FB58_ai;

    // Variable Declarations
    int lv_unitIndex;
    int lv_unitLineIndex;
    int lv_unitLineIndexEnd;
    int lv_unitLineTemp;
    int lv_unitLineIndexRandom;

    // Variable Initialization

    // Implementation
    lv_unitIndex = libCamp_gf__CB_Unit_GetIndex(lp_unit);
    if ((lv_unitIndex <= 0)) {
        return ;
    }
    else {
    }
    if (((libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_unitIndex][lp_player] <= 0) || (libCamp_gv__CB_Unit_LineCount[lv_unitIndex][lp_player] <= 0))) {
        return ;
    }
    else {
    }
    lv_unitLineIndexEnd = libCamp_gf__CB_Unit_GetLineEndIndex(lv_unitIndex, lp_player);
    auto8B85FB58_ae = (lv_unitLineIndexEnd + 1);
    auto8B85FB58_ai = 1;
    lv_unitLineIndex = libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_unitIndex][lp_player];
    for ( ; ( (auto8B85FB58_ai >= 0 && lv_unitLineIndex <= auto8B85FB58_ae) || (auto8B85FB58_ai <= 0 && lv_unitLineIndex >= auto8B85FB58_ae) ) ; lv_unitLineIndex += auto8B85FB58_ai ) {
        lv_unitLineIndexRandom = RandomInt(lv_unitLineIndex, lv_unitLineIndexEnd);
        lv_unitLineTemp = libCamp_gv__CB_UnitLine[lv_unitLineIndex];
        libCamp_gv__CB_UnitLine[lv_unitLineIndex] = libCamp_gv__CB_UnitLine[lv_unitLineIndexRandom];
        libCamp_gv__CB_UnitLine[lv_unitLineIndexRandom] = lv_unitLineTemp;
    }
}

void libCamp_gf_ClearAllChatBubbleLinesFromUnit (unit lp_unit, int lp_player) {
    int auto92B2B8A1_ae;
    int auto92B2B8A1_ai;

    // Variable Declarations
    int lv_unitIndex;
    int lv_unitLineIndex;

    // Variable Initialization

    // Implementation
    lv_unitIndex = libCamp_gf__CB_Unit_GetIndex(lp_unit);
    if ((lv_unitIndex < 0)) {
        return ;
    }
    else {
    }
    if (((libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_unitIndex][lp_player] <= 0) || (libCamp_gv__CB_Unit_LineCount[lv_unitIndex][lp_player] <= 0))) {
        return ;
    }
    else {
    }
    auto92B2B8A1_ae = libCamp_gf__CB_Unit_GetLineEndIndex(lv_unitIndex, lp_player);
    auto92B2B8A1_ai = 1;
    lv_unitLineIndex = libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_unitIndex][lp_player];
    for ( ; ( (auto92B2B8A1_ai >= 0 && lv_unitLineIndex <= auto92B2B8A1_ae) || (auto92B2B8A1_ai <= 0 && lv_unitLineIndex >= auto92B2B8A1_ae) ) ; lv_unitLineIndex += auto92B2B8A1_ai ) {
        libCamp_gf__CB_Line_Remove(libCamp_gv__CB_UnitLine[lv_unitLineIndex]);
    }
    libCamp_gf__CB_UnitLine_RemoveUnit(lv_unitIndex, lp_player);
}

void libCamp_gf_SetChatBubbleActivationDistance (unit lp_unit, int lp_player, fixed lp_distance) {
    // Variable Declarations
    int lv_unitIndex;

    // Variable Initialization

    // Implementation
    lv_unitIndex = libCamp_gf__CB_Unit_GetIndex(lp_unit);
    if ((lv_unitIndex <= 0)) {
        return ;
    }
    else {
    }
    libCamp_gv__CB_Unit_ActivationDistance[lv_unitIndex][lp_player] = lp_distance;
}

void libCamp_gf_SetChatBubbleColor (int lp_chatBubble, color lp_color, color lp_backgroundColor) {
    // Variable Declarations
    int lv_lineIndex;

    // Variable Initialization

    // Implementation
    lv_lineIndex = (lp_chatBubble);
    if ((libCamp_gf__CB_Line_IsValid(lv_lineIndex) == false)) {
        return ;
    }
    else {
    }
    libCamp_gv__CB_Line_TextColor[lv_lineIndex] = lp_color;
    libCamp_gv__CB_Line_BGColor[lv_lineIndex] = lp_backgroundColor;
}

void libCamp_gf_SetChatBubbleAnimation2 (int lp_chatBubble, string lp_animation1, int lp_animation1Option, string lp_animation2, int lp_animation2Option) {
    // Variable Declarations
    int lv_lineIndex;

    // Variable Initialization

    // Implementation
    lv_lineIndex = (lp_chatBubble);
    if ((libCamp_gf__CB_Line_IsValid(lv_lineIndex) == false)) {
        return ;
    }
    else {
    }
    libCamp_gv__CB_Line_AnimationStart[lv_lineIndex] = lp_animation1;
    libCamp_gv__CB_Line_AnimationStartOptions[lv_lineIndex] = lp_animation1Option;
    libCamp_gv__CB_Line_AnimationEnd[lv_lineIndex] = lp_animation2;
    libCamp_gv__CB_Line_AnimationEndOptions[lv_lineIndex] = lp_animation2Option;
}

void libCamp_gf_SetChatBubbleTrigger (int lp_chatBubble, trigger lp_triggerStart, trigger lp_triggerEnd) {
    // Variable Declarations
    int lv_lineIndex;

    // Variable Initialization

    // Implementation
    lv_lineIndex = (lp_chatBubble);
    if ((libCamp_gf__CB_Line_IsValid(lv_lineIndex) == false)) {
        return ;
    }
    else {
    }
    libCamp_gv__CB_Line_TriggerStart[lv_lineIndex] = lp_triggerStart;
    libCamp_gv__CB_Line_TriggerEnd[lv_lineIndex] = lp_triggerEnd;
}

void libCamp_gf_SetChatBubbleFacingPoint (int lp_chatBubble, point lp_point) {
    // Variable Declarations
    int lv_lineIndex;

    // Variable Initialization

    // Implementation
    lv_lineIndex = (lp_chatBubble);
    if ((libCamp_gf__CB_Line_IsValid(lv_lineIndex) == false)) {
        return ;
    }
    else {
    }
    libCamp_gv__CB_Line_FaceLocation[lv_lineIndex] = lp_point;
}

void libCamp_gf_ShowChatBubbleOnUnit (int lp_player, unit lp_unit, soundlink lp_sound, text lp_message, fixed lp_duration, int lp_durationType, bool lp_WaitUntilDone) {
    // Variable Declarations
    text lv_msg;

    // Variable Initialization
    lv_msg = StringExternal("Param/Value/lib_Camp_2983A012");

    // Implementation
    if ((lp_message == null)) {
        lv_msg = libCamp_gf_TextOfSound(lp_sound);
    }
    else {
        lv_msg = lp_message;
    }
    TextTagCreate(lv_msg, 24, UnitGetPosition(lp_unit), 0.5, true, false, PlayerGroupAll());
    TextTagShow(TextTagLastCreated(), PlayerGroupAll(), false);
    libCamp_gv__CB_TP_PLAYER = lp_player;
    libCamp_gv__CB_TP_UNIT = lp_unit;
    libCamp_gv__CB_TP_SOUNDLINK = lp_sound;
    libCamp_gv__CB_TP_TEXT = lv_msg;
    libCamp_gv__CB_TP_DURATION = lp_duration;
    libCamp_gv__CB_TP_DURATIONTYPE = lp_durationType;
    libCamp_gv__CB_TP_TEXTTAG = TextTagLastCreated();
    TriggerExecute(libCamp_gt__CB_ShowChatBubbleOnUnit, true, lp_WaitUntilDone);
}

void libCamp_gf_TurnChatBubbleOnOff (unit lp_unit, bool lp_onOff, int lp_player) {
    // Variable Declarations
    int lv_unitIndex;

    // Variable Initialization

    // Implementation
    lv_unitIndex = libCamp_gf__CB_Unit_GetIndex(lp_unit);
    if ((lv_unitIndex <= 0)) {
        return ;
    }
    else {
    }
    if ((lp_onOff == true)) {
        PlayerGroupAdd(libCamp_gv__CB_Unit_ActivationPlayerGroup[lv_unitIndex], lp_player);
    }
    else {
        PlayerGroupRemove(libCamp_gv__CB_Unit_ActivationPlayerGroup[lv_unitIndex], lp_player);
    }
}

text libCamp_gf_TextOfSound (soundlink lp_soundLink) {
    // Variable Declarations
    string lv_sndGameLink;
    int lv_sndAssetID;
    string lv_strMsg;
    text lv_msg;

    // Variable Initialization
    lv_strMsg = "";
    lv_msg = StringExternal("Param/Value/lib_Camp_60258AB5");

    // Implementation
    lv_sndGameLink = SoundLinkId(lp_soundLink);
    lv_sndAssetID = SoundLinkAsset(lp_soundLink);
    if ((lv_sndAssetID < 0)) {
        lv_sndAssetID = 0;
    }
    else {
    }
    lv_strMsg = CatalogFieldValueGet(c_gameCatalogSound, lv_sndGameLink, ("AssetArray[" + IntToString(lv_sndAssetID) + "].Subtitle"), 1);
    lv_msg = StringExternal(lv_strMsg);
    return lv_msg;
}

bool libCamp_gf__CB_Line_IsValid (int lp_lineIndex) {
    // Implementation
    if (((lp_lineIndex <= 0) || (lp_lineIndex > libCamp_gv__CBC_LINEMAX))) {
        return false;
    }
    else {
    }
    if ((libCamp_gv__CB_Line[lp_lineIndex] == null)) {
        return false;
    }
    else {
    }
    return true;
}

int libCamp_gf__CB_Line_Add (text lp_line, color lp_textColor, color lp_bGColor, string lp_animationStart, int lp_animationStartOption, string lp_animationEnd, int lp_animationEndOption, soundlink lp_sound, fixed lp_duration, int lp_durationType, bool lp_faceOption, trigger lp_triggerStart, trigger lp_triggerEnd) {
    // Variable Declarations
    int lv_lineIndex;
    int lv_lineIndexEnd;
    int lv_playerIndex;

    // Variable Initialization

    // Implementation
    if ((libCamp_gv__CB_Line_Last <= 0)) {
        lv_lineIndex = 1;
    }
    else {
        lv_lineIndex = libCamp_gv__CB_Line_Last;
        lv_lineIndexEnd = (libCamp_gv__CB_Line_Last - 1);
        if ((lv_lineIndexEnd == 0)) {
            lv_lineIndexEnd = libCamp_gv__CBC_LINEMAX;
        }
        else {
        }
        while (true) {
            if ((libCamp_gv__CB_Line[lv_lineIndex] == null)) {
                break;
            }
            else {
            }
            if ((lv_lineIndex == lv_lineIndexEnd)) {
                return -1;
            }
            else {
            }
            lv_lineIndex = (lv_lineIndex + 1);
            if ((lv_lineIndex > libCamp_gv__CBC_LINEMAX)) {
                lv_lineIndex = 1;
            }
            else {
            }
        }
    }
    if ((lp_line == null)) {
        libCamp_gv__CB_Line[lv_lineIndex] = libCamp_gf_TextOfSound(lp_sound);
    }
    else {
        libCamp_gv__CB_Line[lv_lineIndex] = lp_line;
    }
    if ((libCamp_gv__CB_Line[lv_lineIndex] == null)) {
        libCamp_gv__CB_Line[lv_lineIndex] = StringExternal("Param/Value/lib_Camp_22034346");
    }
    else {
    }
    libCamp_gv__CB_Line_TextColor[lv_lineIndex] = lp_textColor;
    libCamp_gv__CB_Line_BGColor[lv_lineIndex] = lp_bGColor;
    libCamp_gv__CB_Line_AnimationStart[lv_lineIndex] = lp_animationStart;
    libCamp_gv__CB_Line_AnimationStartOptions[lv_lineIndex] = lp_animationStartOption;
    libCamp_gv__CB_Line_AnimationEnd[lv_lineIndex] = lp_animationEnd;
    libCamp_gv__CB_Line_AnimationEndOptions[lv_lineIndex] = lp_animationEndOption;
    libCamp_gv__CB_Line_Sound[lv_lineIndex] = lp_sound;
    libCamp_gv__CB_Line_Duration[lv_lineIndex] = lp_duration;
    libCamp_gv__CB_Line_DurationType[lv_lineIndex] = lp_durationType;
    libCamp_gv__CB_Line_FaceOption[lv_lineIndex] = lp_faceOption;
    libCamp_gv__CB_Line_TriggerStart[lv_lineIndex] = lp_triggerStart;
    libCamp_gv__CB_Line_TriggerEnd[lv_lineIndex] = lp_triggerEnd;
    libCamp_gv__CB_Line_Last = lv_lineIndex;
    return lv_lineIndex;
}

void libCamp_gf__CB_Line_Remove (int lp_lineIndex) {
    // Implementation
    if ((lp_lineIndex <= 0)) {
        return ;
    }
    else {
    }
    libCamp_gv__CB_Line[lp_lineIndex] = null;
    libCamp_gv__CB_Line_TriggerStart[lp_lineIndex] = null;
    libCamp_gv__CB_Line_TriggerEnd[lp_lineIndex] = null;
}

int libCamp_gf__CB_Unit_GetIndex (unit lp_unit) {
    int autoF08FB2FB_ae;
    int autoF08FB2FB_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    autoF08FB2FB_ae = libCamp_gv__CBC_UNITMAX;
    autoF08FB2FB_ai = 1;
    lv_index = 1;
    for ( ; ( (autoF08FB2FB_ai >= 0 && lv_index <= autoF08FB2FB_ae) || (autoF08FB2FB_ai <= 0 && lv_index >= autoF08FB2FB_ae) ) ; lv_index += autoF08FB2FB_ai ) {
        if ((libCamp_gv__CB_Unit[lv_index] == lp_unit)) {
            return lv_index;
        }
        else {
        }
    }
    return -1;
}

int libCamp_gf__CB_Unit_GetLineEndIndex (int lp_unitIndex, int lp_playerIndex) {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    if (((libCamp_gv__CB_Unit_UnitLine_StartIndex[lp_unitIndex][lp_playerIndex] <= 0) || (libCamp_gv__CB_Unit_LineCount[lp_unitIndex][lp_playerIndex] <= 0))) {
        return -1;
    }
    else {
    }
    return ((libCamp_gv__CB_Unit_UnitLine_StartIndex[lp_unitIndex][lp_playerIndex] + libCamp_gv__CB_Unit_LineCount[lp_unitIndex][lp_playerIndex]) - 1);
}

int libCamp_gf__CB_Unit_GetLineCurrentIndex (int lp_unitIndex, int lp_playerIndex) {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    if (((libCamp_gv__CB_Unit_UnitLine_StartIndex[lp_unitIndex][lp_playerIndex] <= 0) || (libCamp_gv__CB_Unit_LineCount[lp_unitIndex][lp_playerIndex] <= 0) || (libCamp_gv__CB_Unit_LineCurrent[lp_unitIndex][lp_playerIndex] <= 0))) {
        return -1;
    }
    else {
    }
    return ((libCamp_gv__CB_Unit_UnitLine_StartIndex[lp_unitIndex][lp_playerIndex] + libCamp_gv__CB_Unit_LineCurrent[lp_unitIndex][lp_playerIndex]) - 1);
}

int libCamp_gf__CB_Unit_Add (unit lp_unit) {
    int auto67975871_ae;
    int auto67975871_ai;
    int autoF0157342_ae;
    int autoF0157342_ai;

    // Variable Declarations
    int lv_unitIndex;
    int lv_playerIndex;

    // Variable Initialization

    // Implementation
    lv_unitIndex = libCamp_gf__CB_Unit_GetIndex(lp_unit);
    if ((lv_unitIndex > 0)) {
        return lv_unitIndex;
    }
    else {
    }
    auto67975871_ae = libCamp_gv__CBC_UNITMAX;
    auto67975871_ai = 1;
    lv_unitIndex = 1;
    for ( ; ( (auto67975871_ai >= 0 && lv_unitIndex <= auto67975871_ae) || (auto67975871_ai <= 0 && lv_unitIndex >= auto67975871_ae) ) ; lv_unitIndex += auto67975871_ai ) {
        if ((libCamp_gv__CB_Unit[lv_unitIndex] == null)) {
            libCamp_gv__CB_Unit[lv_unitIndex] = lp_unit;
            libCamp_gv__CB_Unit_OriginalFacing[lv_unitIndex] = UnitGetFacing(lp_unit);
            libCamp_gv__CB_Unit_ActivationPlayerGroup[lv_unitIndex] = PlayerGroupSingle(1);
            autoF0157342_ae = libCamp_gv__CBC_PLAYERMAX;
            autoF0157342_ai = 1;
            lv_playerIndex = 1;
            for ( ; ( (autoF0157342_ai >= 0 && lv_playerIndex <= autoF0157342_ae) || (autoF0157342_ai <= 0 && lv_playerIndex >= autoF0157342_ae) ) ; lv_playerIndex += autoF0157342_ai ) {
                libCamp_gv__CB_Unit_ActivationDistance[lv_unitIndex][lv_playerIndex] = 12.0;
                libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_unitIndex][lv_playerIndex] = -1;
                libCamp_gv__CB_Unit_LineCount[lv_unitIndex][lv_playerIndex] = 0;
                libCamp_gv__CB_Unit_LineCurrent[lv_unitIndex][lv_playerIndex] = -1;
            }
            libCamp_gv__CB_Unit_Count = (libCamp_gv__CB_Unit_Count + 1);
            if ((libCamp_gv__CB_Unit_Count > 0)) {
                TriggerEnable(libCamp_gt__CB_ChatBubbleUnitDied, true);
            }
            else {
            }
            return lv_unitIndex;
        }
        else {
        }
    }
    return -1;
}

void libCamp_gf__CB_Unit_Remove (unit lp_unit) {
    // Variable Declarations
    int lv_unitIndex;

    // Variable Initialization

    // Implementation
    lv_unitIndex = libCamp_gf__CB_Unit_GetIndex(lp_unit);
    libCamp_gf__CB_Unit_RemoveByIndex(lv_unitIndex);
}

void libCamp_gf__CB_Unit_RemoveByIndex (int lp_unitIndex) {
    // Implementation
    if ((lp_unitIndex < 0)) {
        return ;
    }
    else {
    }
    libCamp_gv__CB_Unit[lp_unitIndex] = null;
    libCamp_gv__CB_Unit_ActivationPlayerGroup[lp_unitIndex] = null;
    libCamp_gv__CB_Unit_Count = (libCamp_gv__CB_Unit_Count - 1);
    if ((libCamp_gv__CB_Unit_Count <= 0)) {
        TriggerEnable(libCamp_gt__CB_ChatBubbleUnitDied, false);
    }
    else {
    }
}

void libCamp_gf__CB_UnitLine_Add (int lp_unitIndex, int lp_playerIndex, int lp_lineIndex) {
    int auto09EC20DF_ae;
    int auto09EC20DF_ai;
    int autoF9F4AE62_ae;
    int autoF9F4AE62_ai;
    int auto219FFDBA_ae;
    int auto219FFDBA_ai;

    // Variable Declarations
    int lv_unitLineIndex;
    int lv_index_UnitLine;
    int lv_index_Player;
    int lv_index_Unit;

    // Variable Initialization

    // Implementation
    if (((lp_unitIndex <= 0) || (lp_lineIndex <= 0) || (lp_playerIndex <= 0))) {
        return ;
    }
    else {
    }
    if ((libCamp_gv__CB_Unit_UnitLine_StartIndex[lp_unitIndex][lp_playerIndex] <= 0)) {
        libCamp_gv__CB_Unit_UnitLine_StartIndex[lp_unitIndex][lp_playerIndex] = (libCamp_gv__CB_UnitLine_Count + 1);
        libCamp_gv__CB_Unit_LineCount[lp_unitIndex][lp_playerIndex] = 0;
        libCamp_gv__CB_Unit_LineCurrent[lp_unitIndex][lp_playerIndex] = -1;
        lv_unitLineIndex = libCamp_gv__CB_Unit_UnitLine_StartIndex[lp_unitIndex][lp_playerIndex];
    }
    else {
        lv_unitLineIndex = (libCamp_gv__CB_Unit_UnitLine_StartIndex[lp_unitIndex][lp_playerIndex] + libCamp_gv__CB_Unit_LineCount[lp_unitIndex][lp_playerIndex]);
        auto09EC20DF_ae = lv_unitLineIndex;
        auto09EC20DF_ai = -1;
        lv_index_UnitLine = libCamp_gv__CB_UnitLine_Count;
        for ( ; ( (auto09EC20DF_ai >= 0 && lv_index_UnitLine <= auto09EC20DF_ae) || (auto09EC20DF_ai <= 0 && lv_index_UnitLine >= auto09EC20DF_ae) ) ; lv_index_UnitLine += auto09EC20DF_ai ) {
            libCamp_gv__CB_UnitLine[(lv_index_UnitLine + 1)] = libCamp_gv__CB_UnitLine[lv_index_UnitLine];
        }
        autoF9F4AE62_ae = libCamp_gv__CBC_UNITMAX;
        autoF9F4AE62_ai = 1;
        lv_index_Unit = 1;
        for ( ; ( (autoF9F4AE62_ai >= 0 && lv_index_Unit <= autoF9F4AE62_ae) || (autoF9F4AE62_ai <= 0 && lv_index_Unit >= autoF9F4AE62_ae) ) ; lv_index_Unit += autoF9F4AE62_ai ) {
            if ((libCamp_gv__CB_Unit[lv_index_Unit] != null)) {
                auto219FFDBA_ae = libCamp_gv__CBC_PLAYERMAX;
                auto219FFDBA_ai = 1;
                lv_index_Player = 1;
                for ( ; ( (auto219FFDBA_ai >= 0 && lv_index_Player <= auto219FFDBA_ae) || (auto219FFDBA_ai <= 0 && lv_index_Player >= auto219FFDBA_ae) ) ; lv_index_Player += auto219FFDBA_ai ) {
                    if ((libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_index_Unit][lv_index_Player] >= lv_unitLineIndex)) {
                        libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_index_Unit][lv_index_Player] = (libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_index_Unit][lv_index_Player] + 1);
                    }
                    else {
                    }
                }
            }
            else {
            }
        }
    }
    libCamp_gv__CB_UnitLine[lv_unitLineIndex] = lp_lineIndex;
    libCamp_gv__CB_Unit_LineCount[lp_unitIndex][lp_playerIndex] = (libCamp_gv__CB_Unit_LineCount[lp_unitIndex][lp_playerIndex] + 1);
    libCamp_gv__CB_UnitLine_Count = (libCamp_gv__CB_UnitLine_Count + 1);
    if ((libCamp_gv__CB_UnitLine_Count > 0)) {
        TriggerEnable(libCamp_gt__CB_ChatBubbleActivated, true);
    }
    else {
    }
}

void libCamp_gf__CB_UnitLine_RemoveUnit (int lp_unitIndex, int lp_playerIndex) {
    int auto18C61ED6_ae;
    int auto18C61ED6_ai;
    int auto20A4B5DE_ae;
    int auto20A4B5DE_ai;
    int auto8DC8B463_ae;
    int auto8DC8B463_ai;

    // Variable Declarations
    int lv_unitLineIndexAfter;
    int lv_lineCount;
    int lv_index_UnitLine;
    int lv_index_Player;
    int lv_index_Unit;

    // Variable Initialization

    // Implementation
    if (((lp_unitIndex <= 0) || (lp_playerIndex <= 0))) {
        return ;
    }
    else {
    }
    if (((libCamp_gv__CB_Unit_UnitLine_StartIndex[lp_unitIndex][lp_playerIndex] <= 0) || (libCamp_gv__CB_Unit_LineCount[lp_unitIndex][lp_playerIndex] <= 0))) {
        return ;
    }
    else {
    }
    lv_unitLineIndexAfter = (libCamp_gf__CB_Unit_GetLineEndIndex(lp_unitIndex, lp_playerIndex) + 1);
    lv_lineCount = libCamp_gv__CB_Unit_LineCount[lp_unitIndex][lp_playerIndex];
    auto18C61ED6_ae = libCamp_gv__CB_UnitLine_Count;
    auto18C61ED6_ai = 1;
    lv_index_UnitLine = lv_unitLineIndexAfter;
    for ( ; ( (auto18C61ED6_ai >= 0 && lv_index_UnitLine <= auto18C61ED6_ae) || (auto18C61ED6_ai <= 0 && lv_index_UnitLine >= auto18C61ED6_ae) ) ; lv_index_UnitLine += auto18C61ED6_ai ) {
        libCamp_gv__CB_UnitLine[(lv_index_UnitLine - lv_lineCount)] = libCamp_gv__CB_UnitLine[lv_index_UnitLine];
    }
    libCamp_gv__CB_Unit_LineCount[lp_unitIndex][lp_playerIndex] = 0;
    libCamp_gv__CB_Unit_UnitLine_StartIndex[lp_unitIndex][lp_playerIndex] = -1;
    libCamp_gv__CB_Unit_LineCurrent[lp_unitIndex][lp_playerIndex] = -1;
    libCamp_gv__CB_UnitLine_Count = (libCamp_gv__CB_UnitLine_Count - lv_lineCount);
    auto20A4B5DE_ae = libCamp_gv__CBC_UNITMAX;
    auto20A4B5DE_ai = 1;
    lv_index_Unit = 1;
    for ( ; ( (auto20A4B5DE_ai >= 0 && lv_index_Unit <= auto20A4B5DE_ae) || (auto20A4B5DE_ai <= 0 && lv_index_Unit >= auto20A4B5DE_ae) ) ; lv_index_Unit += auto20A4B5DE_ai ) {
        if ((libCamp_gv__CB_Unit[lv_index_Unit] != null)) {
            auto8DC8B463_ae = libCamp_gv__CBC_PLAYERMAX;
            auto8DC8B463_ai = 1;
            lv_index_Player = 1;
            for ( ; ( (auto8DC8B463_ai >= 0 && lv_index_Player <= auto8DC8B463_ae) || (auto8DC8B463_ai <= 0 && lv_index_Player >= auto8DC8B463_ae) ) ; lv_index_Player += auto8DC8B463_ai ) {
                if ((libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_index_Unit][lv_index_Player] >= lv_unitLineIndexAfter)) {
                    libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_index_Unit][lv_index_Player] = (libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_index_Unit][lv_index_Player] - lv_lineCount);
                }
                else {
                }
            }
        }
        else {
        }
    }
    if ((libCamp_gv__CB_UnitLine_Count <= 0)) {
        TriggerEnable(libCamp_gt__CB_ChatBubbleActivated, false);
    }
    else {
    }
}

void libCamp_gf__CB_Current_Create (int lp_unitIndex, int lp_playerIndex, unit lp_target) {
    // Variable Declarations
    int lv_lineIndex;

    // Variable Initialization

    // Implementation
    if ((libCamp_gv__CB_Unit_LineCurrent[lp_unitIndex][lp_playerIndex] <= 0)) {
        libCamp_gv__CB_Unit_LineCurrent[lp_unitIndex][lp_playerIndex] = 1;
    }
    else {
        libCamp_gv__CB_Unit_LineCurrent[lp_unitIndex][lp_playerIndex] = (libCamp_gv__CB_Unit_LineCurrent[lp_unitIndex][lp_playerIndex] + 1);
    }
    if ((libCamp_gv__CB_Unit_LineCurrent[lp_unitIndex][lp_playerIndex] > libCamp_gv__CB_Unit_LineCount[lp_unitIndex][lp_playerIndex])) {
        libCamp_gv__CB_Unit_LineCurrent[lp_unitIndex][lp_playerIndex] = 1;
    }
    else {
    }
    lv_lineIndex = libCamp_gv__CB_UnitLine[libCamp_gf__CB_Unit_GetLineCurrentIndex(lp_unitIndex, lp_playerIndex)];
    libCamp_gv__CB_Current_UnitIndex[lp_playerIndex] = lp_unitIndex;
    libCamp_gv__CB_Current_ChatBubbleTarget[lp_playerIndex] = lp_target;
    libCamp_gv__CB_Current_LineIndex[lp_playerIndex] = lv_lineIndex;
    TextTagCreate(libCamp_gv__CB_Line[lv_lineIndex], 24, UnitGetPosition(libCamp_gv__CB_Unit[lp_unitIndex]), 0.5, true, false, PlayerGroupAll());
    TextTagShow(TextTagLastCreated(), PlayerGroupAll(), false);
    libCamp_gv__CB_Current_ChatBubble[lp_playerIndex] = TextTagLastCreated();
    TextTagAttachToUnit(libCamp_gv__CB_Current_ChatBubble[lp_playerIndex], libCamp_gv__CB_Unit[lp_unitIndex], 2.5);
    TextTagSetAlignment(libCamp_gv__CB_Current_ChatBubble[lp_playerIndex], c_alignCenter, c_alignBottom);
    TextTagSetMaxSize(libCamp_gv__CB_Current_ChatBubble[lp_playerIndex], 25.0, 40.0);
    TextTagSetColor(libCamp_gv__CB_Current_ChatBubble[lp_playerIndex], c_textTagColorText, libCamp_gv__CB_Line_TextColor[lv_lineIndex]);
    TextTagSetTextShadow(libCamp_gv__CB_Current_ChatBubble[lp_playerIndex], false);
    TextTagSetTime(libCamp_gv__CB_Current_ChatBubble[lp_playerIndex], c_textTagTimeDuration, 360000.0);
    TextTagShowBackground(libCamp_gv__CB_Current_ChatBubble[lp_playerIndex], true);
    TextTagSetBackgroundBorderSize(libCamp_gv__CB_Current_ChatBubble[lp_playerIndex], 1.0, 1.0);
    TextTagSetColor(libCamp_gv__CB_Current_ChatBubble[lp_playerIndex], c_textTagColorBackground, libCamp_gv__CB_Line_BGColor[lv_lineIndex]);
    TextTagSetBackgroundImage(libCamp_gv__CB_Current_ChatBubble[lp_playerIndex], "Assets/Textures/border-tooltip-game.dds", true);
    if ((libCamp_gv__CB_Line_FaceLocation[lv_lineIndex] == null)) {
        if (((libCamp_gv__CB_Line_FaceOption[lv_lineIndex] == true) && (libCamp_gv__CB_Current_ChatBubbleTarget[lp_playerIndex] != null))) {
            libNtve_gf_MakeUnitFacePoint(libCamp_gv__CB_Unit[lp_unitIndex], UnitGetPosition(libCamp_gv__CB_Current_ChatBubbleTarget[lp_playerIndex]), 0.5);
        }
        else {
        }
    }
    else {
        libNtve_gf_MakeUnitFacePoint(libCamp_gv__CB_Unit[lp_unitIndex], libCamp_gv__CB_Line_FaceLocation[lv_lineIndex], 0.5);
    }
    libNtve_gf_PlayAnimation(libNtve_gf_MainActorofUnit(libCamp_gv__CB_Unit[lp_unitIndex]), c_animNameDefault, libCamp_gv__CB_Line_AnimationStart[lv_lineIndex], libCamp_gv__CB_Line_AnimationStartOptions[lv_lineIndex], c_animTimeDefault);
    if ((libCamp_gv__CB_Line_TriggerStart[lv_lineIndex] != null)) {
        TriggerExecute(libCamp_gv__CB_Line_TriggerStart[lv_lineIndex], true, false);
    }
    else {
    }
    TextTagShow(libCamp_gv__CB_Current_ChatBubble[lp_playerIndex], PlayerGroupSingle(lp_playerIndex), true);
    if ((libCamp_gv__CB_Line_Sound[lv_lineIndex] != null)) {
        SoundPlayOnUnit(libCamp_gv__CB_Line_Sound[lv_lineIndex], PlayerGroupSingle(lp_playerIndex), libCamp_gv__CB_Unit[lp_unitIndex], 0.0, 100.0, 0.0);
        libCamp_gv__CB_Current_Sound[lp_playerIndex] = SoundLastPlayed();
    }
    else {
    }
}

void libCamp_gf__CB_Current_Remove (int lp_playerIndex) {
    // Implementation
    if ((libCamp_gv__CB_Current_UnitIndex[lp_playerIndex] > 0)) {
        if ((libCamp_gv__CB_Current_LineIndex[lp_playerIndex] > 0)) {
            if (((libCamp_gv__CB_Line_FaceLocation[libCamp_gv__CB_Current_LineIndex[lp_playerIndex]] != null) || (libCamp_gv__CB_Line_FaceOption[libCamp_gv__CB_Current_LineIndex[lp_playerIndex]] == true))) {
                UnitSetFacing(libCamp_gv__CB_Unit[libCamp_gv__CB_Current_UnitIndex[lp_playerIndex]], libCamp_gv__CB_Unit_OriginalFacing[libCamp_gv__CB_Current_UnitIndex[lp_playerIndex]], 0.5);
            }
            else {
            }
            libNtve_gf_PlayAnimation(libNtve_gf_MainActorofUnit(libCamp_gv__CB_Unit[libCamp_gv__CB_Current_UnitIndex[lp_playerIndex]]), c_animNameDefault, libCamp_gv__CB_Line_AnimationEnd[libCamp_gv__CB_Current_LineIndex[lp_playerIndex]], libCamp_gv__CB_Line_AnimationEndOptions[libCamp_gv__CB_Current_LineIndex[lp_playerIndex]], c_animTimeDefault);
        }
        else {
        }
    }
    else {
    }
    if ((libCamp_gv__CB_Current_LineIndex[lp_playerIndex] > 0)) {
        if ((libCamp_gv__CB_Line_TriggerEnd[libCamp_gv__CB_Current_LineIndex[lp_playerIndex]] != null)) {
            TriggerExecute(libCamp_gv__CB_Line_TriggerEnd[libCamp_gv__CB_Current_LineIndex[lp_playerIndex]], true, false);
        }
        else {
        }
    }
    else {
    }
    if ((libCamp_gv__CB_Current_ChatBubble[lp_playerIndex] != c_textTagNone)) {
        TextTagDestroy(libCamp_gv__CB_Current_ChatBubble[lp_playerIndex]);
        libCamp_gv__CB_Current_ChatBubble[lp_playerIndex] = c_textTagNone;
    }
    else {
    }
    if ((libCamp_gv__CB_Current_Sound[lp_playerIndex] != null)) {
        SoundStop(libCamp_gv__CB_Current_Sound[lp_playerIndex], true);
        libCamp_gv__CB_Current_Sound[lp_playerIndex] = null;
    }
    else {
    }
    libCamp_gv__CB_Current_UnitIndex[lp_playerIndex] = -1;
    libCamp_gv__CB_Current_ChatBubbleTarget[lp_playerIndex] = null;
    libCamp_gv__CB_Current_LineIndex[lp_playerIndex] = -1;
}

int libCamp_gf__CB_LastWaitSound () {
    // Implementation
    return libCamp_gv__CB_WaitSoundID;
}

void libCamp_gf__CB_StarWaitingSound (sound lp_sound, fixed lp_duration, int lp_durationType) {
    // Implementation
    libCamp_gv__CB_WaitSoundID += 1;
    if ((libCamp_gv__CB_WaitSoundID > libCamp_gv__CBC_WAITSOUNDCOUNTMAX)) {
        libCamp_gv__CB_WaitSoundID = 1;
    }
    else {
    }
    libCamp_gv__CB_WaitSoundDone[libCamp_gv__CB_WaitSoundID] = false;
    libCamp_gv__CB_TP_WAITSOUND = lp_sound;
    libCamp_gv__CB_TP_WAITSOUND_DURATION = lp_duration;
    libCamp_gv__CB_TP_WAITSOUND_DURATIONTYPE = lp_durationType;
    libCamp_gv__CB_TP_WAITSOUND_ID = libCamp_gv__CB_WaitSoundID;
    TriggerExecute(libCamp_gt__CB_WaitForSound, true, false);
}

fixed libCamp_gf_GD_Gap (int lp_hV) {
    int autoE579BA21_val;

    // Implementation
    autoE579BA21_val = lp_hV;
    if (autoE579BA21_val == 0) {
        return libCamp_gv_gRIDDLG_GRIDGAP_X;
    }
    else if (autoE579BA21_val == 1) {
        return libCamp_gv_gRIDDLG_GRIDGAP_Y;
    }
    else {
    }
    return 0.0;
}

fixed libCamp_gf_GD_GridToReal (fixed lp_grid, int lp_hV, int lp_sizeOrPos) {
    // Variable Declarations
    fixed lv_ret;
    fixed lv_gap;
    fixed lv_sign;

    // Variable Initialization

    // Implementation
    lv_gap = libCamp_gf_GD_Gap(lp_hV);
    if ((lp_grid >= 0.0)) {
        lv_sign = 1.0;
    }
    else {
        lv_sign = -1.0;
    }
    lv_ret = (AbsF(lp_grid) * libCamp_gv_gRIDDLG_GRID);
    if ((lp_sizeOrPos == 1)) {
        lv_ret = MaxF((lv_ret - lv_gap), 0.0);
    }
    else {
    }
    return (lv_ret * lv_sign);
}

int libCamp_gf_GD_GridToInteger (fixed lp_grid, int lp_hV, int lp_sizeOrPos) {
    // Implementation
    return FixedToInt(libCamp_gf_GD_GridToReal(lp_grid, lp_hV, lp_sizeOrPos));
}

fixed libCamp_gf_GD_RealToGrid (fixed lp_value, int lp_hV, int lp_sizeOrPos) {
    // Variable Declarations
    fixed lv_sign;
    fixed lv_grid;
    fixed lv_gap;
    fixed lv_ret;
    int lv_gapCount;

    // Variable Initialization

    // Implementation
    lv_gap = libCamp_gf_GD_Gap(lp_hV);
    if ((lp_value >= 0.0)) {
        lv_sign = 1.0;
    }
    else {
        lv_sign = -1.0;
    }
    lv_ret = AbsF(lp_value);
    if ((lp_sizeOrPos == 1)) {
        lv_ret += lv_gap;
    }
    else {
    }
    lv_ret /= libCamp_gv_gRIDDLG_GRID;
    return (lv_sign * lv_ret);
}

fixed libCamp_gf_GD_IntegerToGrid (int lp_value, int lp_hV, int lp_sizeOrPos) {
    // Implementation
    return libCamp_gf_GD_RealToGrid(IntToFixed(lp_value), lp_hV, lp_sizeOrPos);
}

fixed libCamp_gf_DialogWidthInGrid (int lp_dialog) {
    // Implementation
    return libCamp_gf_GD_IntegerToGrid(DialogGetWidth(lp_dialog), 0, 1);
}

fixed libCamp_gf_DialogHeightInGrid (int lp_dialog) {
    // Implementation
    return libCamp_gf_GD_IntegerToGrid(DialogGetHeight(lp_dialog), 1, 1);
}

fixed libCamp_gf_DialogOffsetXInGrid (int lp_dialog) {
    // Implementation
    return libCamp_gf_GD_IntegerToGrid(DialogGetOffsetX(lp_dialog), 0, 2);
}

fixed libCamp_gf_DialogOffsetYInGrid (int lp_dialog) {
    // Implementation
    return libCamp_gf_GD_IntegerToGrid(DialogGetOffsetY(lp_dialog), 1, 2);
}

fixed libCamp_gf_DialogItemWidthInGrid (int lp_dialogItem, int lp_player) {
    // Implementation
    return libCamp_gf_GD_IntegerToGrid(DialogControlGetWidth(lp_dialogItem, lp_player), 0, 1);
}

fixed libCamp_gf_DialogItemHeightInGrid (int lp_dialogItem, int lp_player) {
    // Implementation
    return libCamp_gf_GD_IntegerToGrid(DialogControlGetHeight(lp_dialogItem, lp_player), 1, 1);
}

fixed libCamp_gf_DialogItemOffsetXInGrid (int lp_dialogItem, int lp_player) {
    // Variable Declarations
    fixed lv_x;
    int lv_anchor;

    // Variable Initialization
    lv_anchor = c_anchorBottomLeft;

    // Implementation
    lv_x = IntToFixed(DialogControlGetOffsetX(lp_dialogItem, lp_player));
    if ((DialogControlGetRelativeControl(lp_dialogItem, lp_player) == c_invalidDialogControlId)) {
        lv_anchor = DialogControlGetAnchor(lp_dialogItem, lp_player);
        if (((lv_anchor == c_anchorTopLeft) || (lv_anchor == c_anchorTopRight) || (lv_anchor == c_anchorBottomLeft) || (lv_anchor == c_anchorBottomRight) || (lv_anchor == c_anchorLeft) || (lv_anchor == c_anchorRight))) {
            lv_x -= libCamp_gv_gRIDDLG_MARGINE_X;
        }
    }
    else {
    }
    return libCamp_gf_GD_RealToGrid(lv_x, 0, 0);
}

fixed libCamp_gf_DialogItemOffsetYInGrid (int lp_dialogItem, int lp_player) {
    // Variable Declarations
    fixed lv_y;
    int lv_anchor;

    // Variable Initialization
    lv_anchor = c_anchorBottomLeft;

    // Implementation
    lv_y = IntToFixed(DialogControlGetOffsetY(lp_dialogItem, lp_player));
    if ((DialogControlGetRelativeControl(lp_dialogItem, lp_player) == c_invalidDialogControlId)) {
        lv_anchor = DialogControlGetAnchor(lp_dialogItem, lp_player);
        if (((lv_anchor == c_anchorTopLeft) || (lv_anchor == c_anchorTopRight) || (lv_anchor == c_anchorBottomLeft) || (lv_anchor == c_anchorBottomRight) || (lv_anchor == c_anchorTop) || (lv_anchor == c_anchorBottom))) {
            lv_y -= libCamp_gv_gRIDDLG_MARGINE_Y;
        }
    }
    else {
    }
    return libCamp_gf_GD_RealToGrid(lv_y, 1, 0);
}

void libCamp_gf_CreateDialogInGrid (fixed lp_width, fixed lp_height, int lp_anchor, fixed lp_offsetX, fixed lp_offsetY, bool lp_modal) {
    // Variable Declarations
    fixed lv_w;
    fixed lv_h;
    int lv_x;
    int lv_y;

    // Variable Initialization

    // Implementation
    lv_w = libCamp_gf_GD_GridToReal(lp_width, 0, 1);
    lv_w += (2.0 * libCamp_gv_gRIDDLG_MARGINE_X);
    lv_h = libCamp_gf_GD_GridToReal(lp_height, 1, 1);
    lv_h += (2.0 * libCamp_gv_gRIDDLG_MARGINE_Y);
    lv_x = libCamp_gf_GD_GridToInteger(lp_offsetX, 0, 2);
    lv_y = libCamp_gf_GD_GridToInteger(lp_offsetY, 1, 2);
    DialogCreate(FixedToInt(lv_w), FixedToInt(lv_h), lp_anchor, lv_x, lv_y, lp_modal);
}

void libCamp_gf_MoveDialogInGrid (int lp_dialog, int lp_anchor, fixed lp_offsetX, fixed lp_offsetY) {
    // Variable Declarations
    int lv_x;
    int lv_y;

    // Variable Initialization

    // Implementation
    lv_x = libCamp_gf_GD_GridToInteger(lp_offsetX, 0, 2);
    lv_y = libCamp_gf_GD_GridToInteger(lp_offsetY, 1, 2);
    DialogSetPosition(lp_dialog, lp_anchor, lv_x, lv_y);
}

void libCamp_gf_MoveDialogInGridRelative (int lp_dialog, int lp_anchor, int lp_relativeDialog, int lp_relativeAnchor, fixed lp_offsetX, fixed lp_offsetY) {
    // Variable Declarations
    int lv_x;
    int lv_y;

    // Variable Initialization

    // Implementation
    lv_x = libCamp_gf_GD_GridToInteger(lp_offsetX, 0, 2);
    lv_y = libCamp_gf_GD_GridToInteger(lp_offsetY, 1, 2);
    DialogSetPositionRelative(lp_dialog, lp_anchor, lp_relativeDialog, lp_relativeAnchor, lv_x, lv_y);
}

void libCamp_gf_SetDialogSizeInGrid (int lp_dialog, fixed lp_width, fixed lp_height) {
    // Variable Declarations
    fixed lv_w;
    fixed lv_h;

    // Variable Initialization

    // Implementation
    lv_w = libCamp_gf_GD_GridToReal(lp_width, 0, 1);
    lv_w += (2.0 * libCamp_gv_gRIDDLG_MARGINE_X);
    lv_h = libCamp_gf_GD_GridToReal(lp_height, 1, 1);
    lv_h += (2.0 * libCamp_gv_gRIDDLG_MARGINE_Y);
    DialogSetSize(lp_dialog, FixedToInt(lv_w), FixedToInt(lv_h));
}

void libCamp_gf_CreateDialogItemInGrid (int lp_dialog, int lp_type, int lp_anchor, fixed lp_offsetX, fixed lp_offsetY, fixed lp_width, fixed lp_height, text lp_label) {
    // Implementation
    DialogControlCreate(lp_dialog, lp_type);
    libCamp_gf_SetDialogItemSizeInGrid(DialogControlLastCreated(), PlayerGroupAll(), lp_width, lp_height);
    libCamp_gf_MoveDialogItemInGrid(DialogControlLastCreated(), PlayerGroupAll(), lp_anchor, lp_offsetX, lp_offsetY);
    libNtve_gf_SetDialogItemText(DialogControlLastCreated(), lp_label, PlayerGroupAll());
}

void libCamp_gf_MoveDialogItemInGrid (int lp_dialogItem, playergroup lp_players, int lp_anchor, fixed lp_offsetX, fixed lp_offsetY) {
    // Variable Declarations
    fixed lv_x;
    fixed lv_y;

    // Variable Initialization

    // Implementation
    lv_x = libCamp_gf_GD_GridToReal(lp_offsetX, 0, 0);
    lv_y = libCamp_gf_GD_GridToReal(lp_offsetY, 1, 0);
    if (((lp_anchor == c_anchorTopLeft) || (lp_anchor == c_anchorTopRight) || (lp_anchor == c_anchorBottomLeft) || (lp_anchor == c_anchorBottomRight))) {
        lv_x += libCamp_gv_gRIDDLG_MARGINE_X;
        lv_y += libCamp_gv_gRIDDLG_MARGINE_Y;
    }
    else if (((lp_anchor == c_anchorLeft) || (lp_anchor == c_anchorRight))) {
        lv_x += libCamp_gv_gRIDDLG_MARGINE_X;
    }
    else if (((lp_anchor == c_anchorTop) || (lp_anchor == c_anchorBottom))) {
        lv_y += libCamp_gv_gRIDDLG_MARGINE_Y;
    }
    DialogControlSetPosition(lp_dialogItem, PlayerGroupAll(), lp_anchor, FixedToInt(lv_x), FixedToInt(lv_y));
}

void libCamp_gf_MoveDialogItemInGridRelative (int lp_item, playergroup lp_players, int lp_anchor, int lp_relativeItem, int lp_relativeAnchor, fixed lp_offsetX, fixed lp_offsetY) {
    // Variable Declarations
    fixed lv_x;
    fixed lv_y;

    // Variable Initialization

    // Implementation
    lv_x = libCamp_gf_GD_GridToReal(lp_offsetX, 0, 0);
    lv_y = libCamp_gf_GD_GridToReal(lp_offsetY, 1, 0);
    DialogControlSetPositionRelative(lp_item, PlayerGroupAll(), lp_anchor, lp_relativeItem, lp_relativeAnchor, FixedToInt(lp_offsetX), FixedToInt(lp_offsetY));
}

void libCamp_gf_SetDialogItemSizeInGrid (int lp_dialogItem, playergroup lp_players, fixed lp_width, fixed lp_height) {
    // Variable Declarations
    int lv_w;
    int lv_h;

    // Variable Initialization

    // Implementation
    lv_w = libCamp_gf_GD_GridToInteger(lp_width, 0, 1);
    lv_h = libCamp_gf_GD_GridToInteger(lp_height, 1, 1);
    DialogControlSetSize(lp_dialogItem, PlayerGroupAll(), lv_w, lv_h);
}

void libCamp_gf_DisplayMessageDialog (text lp_title, string lp_titleStyle, text lp_body1, string lp_bodyStyle1, text lp_body2, string lp_bodyStyle2, int lp_width, int lp_height, text lp_buttonText) {
    // Variable Declarations
    int lv_titleItem;
    int lv_textWidth;
    int lv_bodyItem1;
    int lv_bodyItem2;
    const int lv_buttonHeight = 55;
    const int lv_titleHeight = 60;
    int lv_bodyHeight;

    // Variable Initialization
    lv_titleItem = c_invalidDialogControlId;
    lv_textWidth = (lp_width - 80);
    lv_bodyItem1 = c_invalidDialogControlId;
    lv_bodyItem2 = c_invalidDialogControlId;
    lv_bodyHeight = lp_height;

    // Implementation
    DialogCreate(lp_width, lp_height, c_anchorCenter, 0, 0, true);
    libCamp_gv__MsgDlg = DialogLastCreated();
    DialogSetImage(DialogLastCreated(), "Assets\\Textures\\ui_protoss_glass_stroke.dds");
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeImage);
    libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), Color(6.27, 14.51, 24.71), PlayerGroupAll());
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), (lp_width - 10), (lp_height - 10));
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorCenter, 0, 1);
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
    libCamp_gv__MsgDlgButton = DialogControlLastCreated();
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 180, lv_buttonHeight);
    libNtve_gf_SetDialogItemText(DialogControlLastCreated(), lp_buttonText, PlayerGroupAll());
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorBottom, 0, 35);
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
    lv_titleItem = DialogControlLastCreated();
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_textWidth, lv_titleHeight);
    libNtve_gf_SetDialogItemText(DialogControlLastCreated(), lp_title, PlayerGroupAll());
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), lp_titleStyle, PlayerGroupAll());
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTop, 0, 45);
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
    lv_bodyItem1 = DialogControlLastCreated();
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_textWidth, lv_bodyHeight);
    libNtve_gf_SetDialogItemText(DialogControlLastCreated(), lp_body1, PlayerGroupAll());
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), lp_bodyStyle1, PlayerGroupAll());
    DialogControlSetPositionRelative(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTop, lv_titleItem, c_anchorBottom, 0, 5);
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
    lv_bodyItem2 = DialogControlLastCreated();
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_textWidth, lv_bodyHeight);
    libNtve_gf_SetDialogItemText(DialogControlLastCreated(), lp_body2, PlayerGroupAll());
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), lp_bodyStyle2, PlayerGroupAll());
    DialogControlSetPositionRelative(DialogControlLastCreated(), PlayerGroupAll(), c_anchorBottom, libCamp_gv__MsgDlgButton, c_anchorTop, 0, -15);
    libCamp_gv__MsgDlgOpened = true;
    TriggerEnable(libCamp_gt__MsgDlgButtonClicked, true);
    DialogSetVisible(DialogLastCreated(), PlayerGroupAll(), true);
    while (!((libCamp_gv__MsgDlgOpened == false))) {
        Wait(0.3, c_timeReal);
    }
}

text libCamp_gf_FormatTimeCampaign (int lp_second) {
    // Variable Declarations
    int lv_h;
    int lv_m;
    int lv_s;
    text lv_result;

    // Variable Initialization
    lv_result = StringExternal("Param/Value/lib_Camp_08B76E4C");

    // Implementation
    lv_h = (lp_second / 3600);
    lv_m = ModI((lp_second / 60), 60);
    lv_s = ModI(lp_second, 60);
    lv_result = IntToText(lv_s);
    if ((lv_s < 10)) {
        lv_result = (StringExternal("Param/Value/lib_Camp_3A82E671") + lv_result);
    }
    else {
    }
    lv_result = (IntToText(lv_m) + StringExternal("Param/Value/lib_Camp_46321341") + lv_result);
    if ((lv_m < 10) && (lv_h > 0)) {
        lv_result = (StringExternal("Param/Value/lib_Camp_5590F086") + lv_result);
    }
    else {
    }
    if ((lv_h > 0)) {
        lv_result = (IntToText(lv_h) + StringExternal("Param/Value/lib_Camp_F6FE8D84") + lv_result);
        if ((lv_h < 10)) {
            lv_result = (StringExternal("Param/Value/lib_Camp_FC74FA13") + lv_result);
        }
        else {
        }
    }
    else {
    }
    return lv_result;
}

void libCamp_gf_ZS_DisplayCampaignTrialDialog (bool lp_showBackground) {
    // Implementation
    libNtve_gf_HideGameUI(false, PlayerGroupAll());
    if ((libCamp_gv_zS_CampaignTrialEndDialog == c_invalidDialogId)) {
        DialogCreate(1000, 600, c_anchorCenter, 0, 0, true);
        libCamp_gv_zS_CampaignTrialEndDialog = DialogLastCreated();
        DialogSetImageVisible(DialogLastCreated(), false);
        DialogSetFullscreen(DialogLastCreated(), true);
        DialogControlCreateFromTemplate(DialogLastCreated(), c_triggerControlTypePanel, "CampaignTrialDialog/CampaignTrialDialogTemplate");
        libCamp_gv_zS_CampaignTrialEndPanel = DialogControlLastCreated();
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorCenter, 0, 0);
        DialogControlSetFullDialog(DialogControlLastCreated(), PlayerGroupAll(), true);
        DialogControlHookup(libCamp_gv_zS_CampaignTrialEndPanel, c_triggerControlTypeButton, "UpgradeButton");
        libCamp_gv_zS_CampaignTrialEndUpgradeButton = DialogControlLastCreated();
        DialogControlHookup(libCamp_gv_zS_CampaignTrialEndPanel, c_triggerControlTypeButton, "ContinueButton");
        libCamp_gv_zS_CampaignTrialEndQuitButton = DialogControlLastCreated();
    }
    else {
    }
    DialogSetVisible(libCamp_gv_zS_CampaignTrialEndDialog, PlayerGroupAll(), true);
    TriggerEnable(libCamp_gt_ZS_CampaignTrialDialogQuitClicked, true);
    TriggerEnable(libCamp_gt_ZS_CampaignTrialDialogUpgradeClicked, true);
}

void libCamp_gf_ZS_CloseCampaignTrialDialog () {
    // Implementation
    TriggerEnable(libCamp_gt_ZS_CampaignTrialDialogQuitClicked, false);
    TriggerEnable(libCamp_gt_ZS_CampaignTrialDialogUpgradeClicked, false);
    if ((libCamp_gv_zS_CampaignTrialEndDialog != c_invalidDialogId)) {
        DialogSetVisible(libCamp_gv_zS_CampaignTrialEndDialog, PlayerGroupAll(), false);
    }
    else {
    }
}

bool libCamp_gf_ZS_TrialEnd () {
    // Implementation
    if ((PlayerHasLicense(1, c_playerLicenseLibertyFull) == false) && (libCamp_gf_NumberOfMissions(3) >= 4)) {
        return true;
    }
    else {
    }
    return false;
}

void libCamp_gf_TS_InitializeMapAchievementDataSingle (int lp_map, string lp_achievement1, string lp_achievement2, string lp_achievement3, string lp_achievement4) {
    // Implementation
    libCamp_gv_tS_MapAchievements[(lp_map)][1] = lp_achievement1;
    libCamp_gv_tS_MapAchievements[(lp_map)][2] = lp_achievement2;
    libCamp_gv_tS_MapAchievements[(lp_map)][3] = lp_achievement3;
    libCamp_gv_tS_MapAchievements[(lp_map)][4] = lp_achievement4;
}

void libCamp_gf_TS_InitializeMapAchievementData () {
    // Variable Declarations
    string lv_defaultAchievement;

    // Variable Initialization

    // Implementation
    libCamp_gf_TS_InitializeMapAchievementDataSingle(31, "TStory01_9", "TStory01_10", "TStory01_10", "TStory01_11");
    libCamp_gf_TS_InitializeMapAchievementDataSingle(32, "TStory01_13", "LostVikingBronze", "LostVikingGold", "LostVikingSilver");
    libCamp_gf_TS_InitializeMapAchievementDataSingle(1, "TRaynor01_1", "TRaynor01_2", "TRaynor01_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(2, "TRaynor02_1", "TRaynor02_2", "TRaynor02_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(3, "TRaynor03_1", "TRaynor03_2", "TRaynor03_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(4, "THanson01_1", "THanson01_2", "THanson01_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(5, "THanson02_1", "THanson02_2", "THanson02_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(6, "THanson03A_1", "THanson03A_2", "THanson03A_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(7, "THanson03B_1", "THanson03B_2", "THanson03B_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(12, "THorner01_1", "THorner01_2", "THorner01_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(13, "THorner02_1", "THorner02_2", "THorner02_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(14, "THorner03_1", "THorner03_2", "THorner03_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(15, "THorner04_1", "THorner04_2", "THorner04_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(16, "THorner05_1", "THorner05_3", "THorner05_2", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(8, "TTosh01_1", "TTosh01_2", "TTosh01_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(9, "TTosh02_1", "TTosh02_2", "TTosh02_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(10, "TTosh03A_1", "TTosh03A_2", "TTosh03A_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(11, "TTosh03B_1", "TTosh03B_2", "TTosh03B_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(17, "TTychus01_1", "TTychus01_2", "TTychus01_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(18, "TTychus02_1", "TTychus02_2", "TTychus02_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(19, "TTychus03_1", "TTychus03_2", "TTychus03_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(20, "TTychus04_1", "TTychus04_2", "TTychus04_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(21, "TTychus05_1", "TTychus05_2", "TTychus05_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(26, "TValerian01_1", "TValerian01_2", "TValerian01_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(27, "TValerian02A_1", "TValerian02A_2", "TValerian02A_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(28, "TValerian02B_1", "TValerian02B_2", "TValerian02B_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(29, "TValerian03_1", "TValerian03_2", "TValerian03_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(22, "TZeratul01_1", "TZeratul01_2", "TZeratul01_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(23, "TZeratul02_1", "TZeratul02_2", "TZeratul02_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(24, "TZeratul03_1", "TZeratul03_2", "TZeratul03_3", null);
    libCamp_gf_TS_InitializeMapAchievementDataSingle(25, "TZeratul04_1", "TZeratul04_2", "TZeratul04_3", null);
    if ((libCamp_gv_tS_CurrentMap == 0)) {
        return ;
    }
    else {
    }
    lv_defaultAchievement = libCamp_gv_tS_MapAchievements[(libCamp_gv_tS_CurrentMap)][1];
    if ((lv_defaultAchievement != null)) {
        AchievementPanelSetCategory(PlayerGroupAll(), lv_defaultAchievement);
    }
    else {
    }
}

int libCamp_gf_TS_CampaignMissionShortestTime () {
    int auto61978BC2_i;
    int autoABE444FE_i;

    // Variable Declarations
    int lv_indexMission;
    int lv_time;
    int lv_timeSingle;

    // Variable Initialization

    // Implementation
    if ((libCamp_gf_MissionStatusCheck(29, 2) == false)) {
        return 0;
    }
    else {
    }
    auto61978BC2_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto61978BC2_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto61978BC2_i];
        if ((libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 1) == true) && (libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 2) == false) && (libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 3) == false) && (libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 4) == false)) {
            return 0;
        }
        else {
        }
        auto61978BC2_i = auto61978BC2_i + 1;
    }
    autoABE444FE_i = libCamp_gv_TSC_MISSION_FIRST;
    while (autoABE444FE_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[autoABE444FE_i];
        lv_timeSingle = 0;
        if ((libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 2) == true)) {
            lv_timeSingle = libCamp_gf_MissionCompleteBestTime(lv_indexMission, 2);
        }
        else {
        }
        if ((libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 3) == true) && ((lv_timeSingle <= 0) || (libCamp_gf_MissionCompleteBestTime(lv_indexMission, 3) < lv_timeSingle))) {
            lv_timeSingle = libCamp_gf_MissionCompleteBestTime(lv_indexMission, 3);
        }
        else {
        }
        if ((libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 4) == true) && ((lv_timeSingle <= 0) || (libCamp_gf_MissionCompleteBestTime(lv_indexMission, 4) < lv_timeSingle))) {
            lv_timeSingle = libCamp_gf_MissionCompleteBestTime(lv_indexMission, 4);
        }
        else {
        }
        lv_time += lv_timeSingle;
        autoABE444FE_i = autoABE444FE_i + 1;
    }
    return lv_time;
}

int libCamp_gf_TS_MissionCompletionCountOnDifficulty (int lp_difficulty) {
    int autoEDDE5D9A_i;

    // Variable Declarations
    int lv_indexMission;
    int lv_count;

    // Variable Initialization

    // Implementation
    autoEDDE5D9A_i = libCamp_gv_TSC_MISSION_FIRST;
    while (autoEDDE5D9A_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[autoEDDE5D9A_i];
        if ((libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 4) == true) && (libCamp_gf_TS_MissionDifficultyComparison(4, lp_difficulty) >= 0)) {
            lv_count += 1;
        }
        else if ((libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 3) == true) && (libCamp_gf_TS_MissionDifficultyComparison(3, lp_difficulty) >= 0)) {
            lv_count += 1;
        }
        else if ((libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 2) == true) && (libCamp_gf_TS_MissionDifficultyComparison(2, lp_difficulty) >= 0)) {
            lv_count += 1;
        }
        else if ((libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 1) == true) && (libCamp_gf_TS_MissionDifficultyComparison(1, lp_difficulty) >= 0)) {
            lv_count += 1;
        }
        autoEDDE5D9A_i = autoEDDE5D9A_i + 1;
    }
    return lv_count;
}

int libCamp_gf_TS_MissionDifficultyComparison (int lp_difficulty1, int lp_difficulty2) {
    int auto6A4CF7F4_val;
    int auto71E86CC4_val;

    // Variable Declarations
    int lv_value1;
    int lv_value2;

    // Variable Initialization

    // Implementation
    auto6A4CF7F4_val = lp_difficulty1;
    if (auto6A4CF7F4_val == 1) {
        lv_value1 = 1;
    }
    else if (auto6A4CF7F4_val == 2) {
        lv_value1 = 2;
    }
    else if (auto6A4CF7F4_val == 3) {
        lv_value1 = 3;
    }
    else if (auto6A4CF7F4_val == 4) {
        lv_value1 = 4;
    }
    else {
        lv_value1 = 0;
    }
    auto71E86CC4_val = lp_difficulty2;
    if (auto71E86CC4_val == 1) {
        lv_value2 = 1;
    }
    else if (auto71E86CC4_val == 2) {
        lv_value2 = 2;
    }
    else if (auto71E86CC4_val == 3) {
        lv_value2 = 3;
    }
    else if (auto71E86CC4_val == 4) {
        lv_value2 = 4;
    }
    else {
        lv_value2 = 0;
    }
    if ((lv_value1 > lv_value2)) {
        return 1;
    }
    else {
    }
    if ((lv_value1 < lv_value2)) {
        return -1;
    }
    else {
    }
    return 0;
}

void libCamp_gf_TS_CheckAchievementUnlocking () {
    // Variable Declarations
    int lv_indexMission;
    bool lv_unlock;
    int lv_count;
    int lv_time;

    // Variable Initialization

    // Implementation
    if ((libCamp_gf_MissionStatusCheck(29, 2) == true)) {
        AchievementAward(1, "WingsofLiberty");
    }
    else {
    }
    lv_count = libCamp_gf_TS_MissionCompletionCountOnDifficulty(2);
    lv_count = libCamp_gf_TS_MissionCompletionCountOnDifficulty(3);
    AchievementTermQuantitySet(1, "WingsofLibertyHard5", lv_count);
    AchievementTermQuantitySet(1, "WingsofLibertyHard10", lv_count);
    AchievementTermQuantitySet(1, "WingsofLibertyHard15", lv_count);
    AchievementTermQuantitySet(1, "WingsofLibertyHard20", lv_count);
    AchievementTermQuantitySet(1, "WingsofLibertyHard25", lv_count);
    lv_count = libCamp_gf_TS_MissionCompletionCountOnDifficulty(4);
    AchievementTermQuantitySet(1, "WingsofLibertyBrutal5", lv_count);
    AchievementTermQuantitySet(1, "WingsofLibertyBrutal10", lv_count);
    AchievementTermQuantitySet(1, "WingsofLibertyBrutal15", lv_count);
    AchievementTermQuantitySet(1, "WingsofLibertyBrutal20", lv_count);
    AchievementTermQuantitySet(1, "WingsofLibertyBrutal25", lv_count);
    if ((libCamp_gf_MissionStatusCheck(3, 2) == true)) {
        AchievementAward(1, "MarSaraMissions");
    }
    else {
    }
    if (((libCamp_gf_MissionStatusCheck(6, 2) == true) || (libCamp_gf_MissionStatusCheck(7, 2) == true))) {
        AchievementAward(1, "DrArielHansonMissions");
    }
    else {
    }
    if (((libCamp_gf_MissionStatusCheck(10, 2) == true) || (libCamp_gf_MissionStatusCheck(11, 2) == true))) {
        AchievementAward(1, "GabrielToshMissions");
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(15, 2) == true)) {
        AchievementAward(1, "MattHornerMissions");
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(25, 2) == true)) {
        AchievementAward(1, "ZeratulMissions");
    }
    else {
    }
    lv_time = libCamp_gf_TS_CampaignMissionShortestTime();
    if ((lv_time > 0) && (lv_time <= (8 * 3600))) {
        AchievementAward(1, "HurryUpItsRaidNight");
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(2, 2) == true)) {
        AchievementTermQuantitySet(1, "TheArtifact", 1);
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(17, 2) == true)) {
        AchievementTermQuantitySet(1, "TheArtifact", 2);
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(18, 2) == true)) {
        AchievementTermQuantitySet(1, "TheArtifact", 3);
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(20, 2) == true)) {
        AchievementTermQuantitySet(1, "TheArtifact", 4);
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(21, 2) == true)) {
        AchievementTermQuantitySet(1, "TheArtifact", 5);
    }
    else {
    }
    libCamp_gf_TS_CompletionistCheck(1, "LibertyCompletionistNormal_01", "LibertyCompletionistHard_01", "LibertyCompletionistBrutal_01");
    libCamp_gf_TS_CompletionistCheck(2, "LibertyCompletionistNormal_02", "LibertyCompletionistHard_02", "LibertyCompletionistBrutal_02");
    libCamp_gf_TS_CompletionistCheck(3, "LibertyCompletionistNormal_03", "LibertyCompletionistHard_03", "LibertyCompletionistBrutal_03");
    libCamp_gf_TS_CompletionistCheck(4, "LibertyCompletionistNormal_04", "LibertyCompletionistHard_04", "LibertyCompletionistBrutal_04");
    libCamp_gf_TS_CompletionistCheck(5, "LibertyCompletionistNormal_05", "LibertyCompletionistHard_05", "LibertyCompletionistBrutal_05");
    libCamp_gf_TS_CompletionistCheck(6, "LibertyCompletionistNormal_06", "LibertyCompletionistHard_06", "LibertyCompletionistBrutal_06");
    libCamp_gf_TS_CompletionistCheck(7, "LibertyCompletionistNormal_07", "LibertyCompletionistHard_07", "LibertyCompletionistBrutal_07");
    libCamp_gf_TS_CompletionistCheck(12, "LibertyCompletionistNormal_12", "LibertyCompletionistHard_12", "LibertyCompletionistBrutal_12");
    libCamp_gf_TS_CompletionistCheck(13, "LibertyCompletionistNormal_13", "LibertyCompletionistHard_13", "LibertyCompletionistBrutal_13");
    libCamp_gf_TS_CompletionistCheck(14, "LibertyCompletionistNormal_14", "LibertyCompletionistHard_14", "LibertyCompletionistBrutal_14");
    libCamp_gf_TS_CompletionistCheck(15, "LibertyCompletionistNormal_15", "LibertyCompletionistHard_15", "LibertyCompletionistBrutal_15");
    libCamp_gf_TS_CompletionistCheck(16, "LibertyCompletionistNormal_16", "LibertyCompletionistHard_16", "LibertyCompletionistBrutal_16");
    libCamp_gf_TS_CompletionistCheck(8, "LibertyCompletionistNormal_08", "LibertyCompletionistHard_08", "LibertyCompletionistBrutal_08");
    libCamp_gf_TS_CompletionistCheck(9, "LibertyCompletionistNormal_09", "LibertyCompletionistHard_09", "LibertyCompletionistBrutal_09");
    libCamp_gf_TS_CompletionistCheck(10, "LibertyCompletionistNormal_10", "LibertyCompletionistHard_10", "LibertyCompletionistBrutal_10");
    libCamp_gf_TS_CompletionistCheck(11, "LibertyCompletionistNormal_11", "LibertyCompletionistHard_11", "LibertyCompletionistBrutal_11");
    libCamp_gf_TS_CompletionistCheck(17, "LibertyCompletionistNormal_21", "LibertyCompletionistHard_21", "LibertyCompletionistBrutal_21");
    libCamp_gf_TS_CompletionistCheck(18, "LibertyCompletionistNormal_22", "LibertyCompletionistHard_22", "LibertyCompletionistBrutal_22");
    libCamp_gf_TS_CompletionistCheck(19, "LibertyCompletionistNormal_23", "LibertyCompletionistHard_23", "LibertyCompletionistBrutal_23");
    libCamp_gf_TS_CompletionistCheck(20, "LibertyCompletionistNormal_24", "LibertyCompletionistHard_24", "LibertyCompletionistBrutal_24");
    libCamp_gf_TS_CompletionistCheck(21, "LibertyCompletionistNormal_25", "LibertyCompletionistHard_25", "LibertyCompletionistBrutal_25");
    libCamp_gf_TS_CompletionistCheck(26, "LibertyCompletionistNormal_26", "LibertyCompletionistHard_26", "LibertyCompletionistBrutal_26");
    libCamp_gf_TS_CompletionistCheck(27, "LibertyCompletionistNormal_27", "LibertyCompletionistHard_27", "LibertyCompletionistBrutal_27");
    libCamp_gf_TS_CompletionistCheck(28, "LibertyCompletionistNormal_28", "LibertyCompletionistHard_28", "LibertyCompletionistBrutal_28");
    libCamp_gf_TS_CompletionistCheck(29, "LibertyCompletionistNormal_29", "LibertyCompletionistHard_29", "LibertyCompletionistBrutal_29");
    libCamp_gf_TS_CompletionistCheck(22, "LibertyCompletionistNormal_17", "LibertyCompletionistHard_17", "LibertyCompletionistBrutal_17");
    libCamp_gf_TS_CompletionistCheck(23, "LibertyCompletionistNormal_18", "LibertyCompletionistHard_18", "LibertyCompletionistBrutal_18");
    libCamp_gf_TS_CompletionistCheck(24, "LibertyCompletionistNormal_19", "LibertyCompletionistHard_19", "LibertyCompletionistBrutal_19");
    libCamp_gf_TS_CompletionistCheck(25, "LibertyCompletionistNormal_20", "LibertyCompletionistHard_20", "LibertyCompletionistBrutal_20");
}

void libCamp_gf_TS_CompletionistCheck (int lp_map, string lp_normal, string lp_hard, string lp_brutal) {
    // Implementation
    if ((libCamp_gv_tS_CurrentMap == lp_map)) {
        if ((libNtve_gf_DifficultyValueInt(0, 1, 1, 1) == 1)) {
            AchievementTermQuantitySet(1, lp_normal, 1);
        }
        else {
        }
        if ((libNtve_gf_DifficultyValueInt(0, 0, 1, 1) == 1)) {
            AchievementTermQuantitySet(1, lp_hard, 1);
        }
        else {
        }
        if ((libNtve_gf_DifficultyValueInt(0, 0, 0, 1) == 1)) {
            AchievementTermQuantitySet(1, lp_brutal, 1);
        }
        else {
        }
    }
    else {
    }
}

void libCamp_gf_TS_UpdateCharacterSheepPanel () {
    // Variable Declarations
    int lv_index;
    int lv_indexTech;
    int lv_indexMerc;
    int lv_indexResearch;

    // Variable Initialization

    // Implementation
    CharacterSheetPanelSetPortraitModelLink(PlayerGroupAll(), libCamp_gf_ContactPortraitModel(55));
    CharacterSheetPanelSetNameText(PlayerGroupAll(), StringExternal("Param/Value/lib_Camp_7B411DE2"));
}

void libCamp_gf_TS_AddRecentTech (int lp_tech) {
    int auto85D33835_ae;
    int auto85D33835_ai;
    int auto6C118211_ae;
    int auto6C118211_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    auto85D33835_ae = libCamp_gv_tS_RecentTechMax;
    auto85D33835_ai = 1;
    lv_index = 1;
    for ( ; ( (auto85D33835_ai >= 0 && lv_index <= auto85D33835_ae) || (auto85D33835_ai <= 0 && lv_index >= auto85D33835_ae) ) ; lv_index += auto85D33835_ai ) {
        if ((libCamp_gv_tSX_RecentTech[lv_index] == 0)) {
            libCamp_gv_tSX_RecentTech[lv_index] = lp_tech;
            libCamp_gf_TS_UpdateCharacterSheepPanel();
            return ;
        }
        else {
        }
    }
    auto6C118211_ae = libCamp_gv_tS_RecentTechMax;
    auto6C118211_ai = 1;
    lv_index = 2;
    for ( ; ( (auto6C118211_ai >= 0 && lv_index <= auto6C118211_ae) || (auto6C118211_ai <= 0 && lv_index >= auto6C118211_ae) ) ; lv_index += auto6C118211_ai ) {
        libCamp_gv_tSX_RecentTech[(lv_index - 1)] = libCamp_gv_tSX_RecentTech[lv_index];
    }
    libCamp_gv_tSX_RecentTech[libCamp_gv_tS_RecentTechMax] = lp_tech;
    libCamp_gf_TS_UpdateCharacterSheepPanel();
}

void libCamp_gf_TS_AddRecentMerc (int lp_merc) {
    int auto1978B64C_ae;
    int auto1978B64C_ai;
    int autoEF6DB6C7_ae;
    int autoEF6DB6C7_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    auto1978B64C_ae = libCamp_gv_tS_RecentMercMax;
    auto1978B64C_ai = 1;
    lv_index = 1;
    for ( ; ( (auto1978B64C_ai >= 0 && lv_index <= auto1978B64C_ae) || (auto1978B64C_ai <= 0 && lv_index >= auto1978B64C_ae) ) ; lv_index += auto1978B64C_ai ) {
        if ((libCamp_gv_tSX_RecentMerc[lv_index] == 0)) {
            libCamp_gv_tSX_RecentMerc[lv_index] = lp_merc;
            libCamp_gf_TS_UpdateCharacterSheepPanel();
            return ;
        }
        else {
        }
    }
    autoEF6DB6C7_ae = libCamp_gv_tS_RecentMercMax;
    autoEF6DB6C7_ai = 1;
    lv_index = 2;
    for ( ; ( (autoEF6DB6C7_ai >= 0 && lv_index <= autoEF6DB6C7_ae) || (autoEF6DB6C7_ai <= 0 && lv_index >= autoEF6DB6C7_ae) ) ; lv_index += autoEF6DB6C7_ai ) {
        libCamp_gv_tSX_RecentMerc[(lv_index - 1)] = libCamp_gv_tSX_RecentMerc[lv_index];
    }
    libCamp_gv_tSX_RecentMerc[libCamp_gv_tS_RecentMercMax] = lp_merc;
    libCamp_gf_TS_UpdateCharacterSheepPanel();
}

void libCamp_gf_TS_AddRecentResearch (int lp_research) {
    int autoF1FC96B4_ae;
    int autoF1FC96B4_ai;
    int autoFD2908C3_ae;
    int autoFD2908C3_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    autoF1FC96B4_ae = libCamp_gv_tS_RecentResearchMax;
    autoF1FC96B4_ai = 1;
    lv_index = 1;
    for ( ; ( (autoF1FC96B4_ai >= 0 && lv_index <= autoF1FC96B4_ae) || (autoF1FC96B4_ai <= 0 && lv_index >= autoF1FC96B4_ae) ) ; lv_index += autoF1FC96B4_ai ) {
        if ((libCamp_gv_tSX_RecentResearch[lv_index] == 0)) {
            libCamp_gv_tSX_RecentResearch[lv_index] = lp_research;
            libCamp_gf_TS_UpdateCharacterSheepPanel();
            return ;
        }
        else {
        }
    }
    autoFD2908C3_ae = libCamp_gv_tS_RecentResearchMax;
    autoFD2908C3_ai = 1;
    lv_index = 2;
    for ( ; ( (autoFD2908C3_ai >= 0 && lv_index <= autoFD2908C3_ae) || (autoFD2908C3_ai <= 0 && lv_index >= autoFD2908C3_ae) ) ; lv_index += autoFD2908C3_ai ) {
        libCamp_gv_tSX_RecentResearch[(lv_index - 1)] = libCamp_gv_tSX_RecentResearch[lv_index];
    }
    libCamp_gv_tSX_RecentResearch[libCamp_gv_tS_RecentResearchMax] = lp_research;
    libCamp_gf_TS_UpdateCharacterSheepPanel();
}

void libCamp_gf_TS_ResetRecentlyPurchasedData () {
    int autoF0E28FCB_ae;
    int autoF0E28FCB_ai;
    int auto6218F18D_ae;
    int auto6218F18D_ai;
    int auto85841DC7_ae;
    int auto85841DC7_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    autoF0E28FCB_ae = libCamp_gv_tS_RecentTechMax;
    autoF0E28FCB_ai = 1;
    lv_index = 1;
    for ( ; ( (autoF0E28FCB_ai >= 0 && lv_index <= autoF0E28FCB_ae) || (autoF0E28FCB_ai <= 0 && lv_index >= autoF0E28FCB_ae) ) ; lv_index += autoF0E28FCB_ai ) {
        libCamp_gv_tSX_RecentTech[lv_index] = 0;
    }
    auto6218F18D_ae = libCamp_gv_tS_RecentMercMax;
    auto6218F18D_ai = 1;
    lv_index = 1;
    for ( ; ( (auto6218F18D_ai >= 0 && lv_index <= auto6218F18D_ae) || (auto6218F18D_ai <= 0 && lv_index >= auto6218F18D_ae) ) ; lv_index += auto6218F18D_ai ) {
        libCamp_gv_tSX_RecentMerc[lv_index] = 0;
    }
    auto85841DC7_ae = libCamp_gv_tS_RecentResearchMax;
    auto85841DC7_ai = 1;
    lv_index = 1;
    for ( ; ( (auto85841DC7_ai >= 0 && lv_index <= auto85841DC7_ae) || (auto85841DC7_ai <= 0 && lv_index >= auto85841DC7_ae) ) ; lv_index += auto85841DC7_ai ) {
        libCamp_gv_tSX_RecentResearch[lv_index] = 0;
    }
}

void libCamp_gf_TS_InitizlizeStoryConversationSingle (string lp_conversation) {
    // Implementation
    libCamp_gv_tS_ConvoCount = (libCamp_gv_tS_ConvoCount + 1);
    libCamp_gv_tS_Convos[libCamp_gv_tS_ConvoCount] = lp_conversation;
}

void libCamp_gf_TS_InitizlizeStoryConversations () {
    // Implementation
    libCamp_gf_TS_InitizlizeStoryConversationSingle("ArmorySwann");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("BridgeHanson");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("BridgeHorner");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("BridgeTosh");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("BridgeTychus");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("CantinafidgetsJukebox");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("CantinaTosh");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("CantinaTychus");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("CharFidgetsArtifact");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("CharTychus");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("CharWarfield");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("LabFidgetsAdjutant");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("LabFidgetsArtifact");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("LabHanson");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("Labresearch");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSaraFidgetsArmyphoto");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSaraFidgetsBadge");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSaraFidgetsEvolutionofrevolution2");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSaraFidgetsFreedomposter");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSaraFidgetsHeavensDevils");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSaraFidgetsHydrahead");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSaraFidgetsHydrahunt");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSarafidgetsintro");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSaraFidgetsKerriganPhoto");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSaraFidgetsLocalhero2");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSaraFidgetsvikingphoto2");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSaraFidgetswantedposter");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("MarSaraTychus");
    libCamp_gf_TS_InitizlizeStoryConversationSingle("Valerian");
}

string libCamp_gf_ContactPortraitModel (int lp_contactID) {
    // Implementation
    return libCamp_gv_tS_ContactPortrait[(lp_contactID)];
}

int libCamp_gf_CountMissions (int lp_status) {
    int autoB06E88C4_i;

    // Variable Declarations
    int lv_subtotal;
    int lv_map;

    // Variable Initialization

    // Implementation
    lv_subtotal = 0;
    autoB06E88C4_i = libCamp_gv_TSC_MISSION_FIRST;
    while (autoB06E88C4_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_map = libCamp_gv_tS_MapID[autoB06E88C4_i];
        if ((libCamp_gf_MissionStatusCheck(lv_map, lp_status) == true)) {
            lv_subtotal = (lv_subtotal + 1);
        }
        else {
        }
        autoB06E88C4_i = autoB06E88C4_i + 1;
    }
    return lv_subtotal;
}

int libCamp_gf_LastMap () {
    // Implementation
    return libCamp_gf_TS_MapIDFromIndex(libCamp_gv_tSX_LastMap);
}

bool libCamp_gf_LastMapConditionCheck (int lp_condition) {
    int autoCCC0747B_val;

    // Implementation
    if ((libCamp_gf_MapTypeCheck(libCamp_gf_LastMap(), 1) == true)) {
        return libCamp_gf_LastMissionConditionCheck(lp_condition);
    }
    else {
    }
    autoCCC0747B_val = lp_condition;
    if (autoCCC0747B_val == 0) {
        return libCamp_gv_tSX_LastMapSuccess;
    }
    else {
    }
    return false;
}

int libCamp_gf_LastMission () {
    // Implementation
    return libCamp_gf_TS_MapIDFromIndex(libCamp_gv_tSX_LastMission);
}

bool libCamp_gf_LastMissionConditionCheck (int lp_condition) {
    int auto93D5F6CB_val;

    // Implementation
    auto93D5F6CB_val = lp_condition;
    if (auto93D5F6CB_val == 0) {
        return libCamp_gv_tSX_LastMissionSuccess;
    }
    else if (auto93D5F6CB_val == 1) {
        return libCamp_gv_tSX_LastMissionSimulation;
    }
    else {
    }
    return false;
}

int libCamp_gf_LastSuccessfulMission () {
    int auto06336F42_i;

    // Variable Declarations
    int lv_mission;

    // Variable Initialization

    // Implementation
    auto06336F42_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto06336F42_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_mission = libCamp_gv_tS_MapID[auto06336F42_i];
        if ((ConversationDataStateGetValue(ConversationDataStateIndex("MissionLast", (lv_mission))) == 1)) {
            return lv_mission;
        }
        else {
        }
        auto06336F42_i = auto06336F42_i + 1;
    }
    return 0;
}

bool libCamp_gf_MapTypeCheck (int lp_mapId, int lp_mapType) {
    // Implementation
    return (libCamp_gv_tS_MapType[(lp_mapId)] == lp_mapType);
}

string libCamp_gf_MapFile (int lp_map) {
    // Implementation
    return libCamp_gv_tS_MapFile[(lp_map)];
}

trigger libCamp_gf_MissionBriefing (int lp_mapID) {
    // Variable Declarations
    int lv_mapIndex;

    // Variable Initialization

    // Implementation
    lv_mapIndex = (lp_mapID);
    return libCamp_gv_tS_MissionBriefing[lv_mapIndex];
}

trigger libCamp_gf_MissionBriefingPreload (int lp_mapID) {
    // Variable Declarations
    int lv_mapIndex;

    // Variable Initialization

    // Implementation
    lv_mapIndex = (lp_mapID);
    return libCamp_gv_tS_MissionBriefingPreload[lv_mapIndex];
}

trigger libCamp_gf_MissionBriefingRoughPreload (int lp_mapID) {
    // Variable Declarations
    int lv_mapIndex;

    // Variable Initialization

    // Implementation
    lv_mapIndex = (lp_mapID);
    return libCamp_gv_tS_MissionBriefingPreloadRough[lv_mapIndex];
}

int libCamp_gf_MissionContact (int lp_mapID) {
    // Variable Declarations
    int lv_mapIndex;

    // Variable Initialization

    // Implementation
    lv_mapIndex = (lp_mapID);
    return libCamp_gv_tS_MissionContact[lv_mapIndex];
}

int libCamp_gf_MissionPlanet (int lp_mission) {
    // Implementation
    return libCamp_gv_tS_MissionLocation[(lp_mission)];
}

int libCamp_gf_MissionStatusAge (int lp_mission, int lp_status) {
    int auto87D2C2FD_val;

    // Implementation
    auto87D2C2FD_val = lp_status;
    if (auto87D2C2FD_val == 1) {
        return ConversationDataStateGetValue(ConversationDataStateIndex("MissionAvailable", (lp_mission)));
    }
    else if (auto87D2C2FD_val == 2) {
        return ConversationDataStateGetValue(ConversationDataStateIndex("MissionCompleted", (lp_mission)));
    }
    else {
    }
    return 0;
}

bool libCamp_gf_MissionDifficultyCompleted (int lp_mission, int lp_difficulty) {
    // Implementation
    if (((libCamp_gv_tSX_MissionDifficultyCompleted[(lp_mission)][(lp_difficulty)] == true) || (libCamp_gv_tSX_MissionDifficultyBestTime[(lp_mission)][(lp_difficulty)] > 0))) {
        return true;
    }
    else {
    }
    return false;
}

int libCamp_gf_MissionCompleteBestTime (int lp_mission, int lp_difficulty) {
    // Implementation
    return libCamp_gv_tSX_MissionDifficultyBestTime[(lp_mission)][(lp_difficulty)];
}

int libCamp_gf_MissionStatus (int lp_missionID) {
    // Implementation
    if ((libCamp_gf_MissionStatusAge(lp_missionID, 2) != 0)) {
        return 2;
    }
    else {
    }
    if ((libCamp_gf_MissionStatusAge(lp_missionID, 1) != 0)) {
        return 1;
    }
    else {
    }
    return 0;
}

bool libCamp_gf_MissionStatusCheck (int lp_missionID, int lp_status) {
    // Implementation
    return (libCamp_gf_MissionStatus(lp_missionID) == lp_status);
}

int libCamp_gf_MissionReward (int lp_mission) {
    // Implementation
    return FixedToInt((ConversationDataStateFixedValue(libCamp_gf_TS_MapConvoID(lp_mission), "Reward") * 1000.0));
}

text libCamp_gf_MissionName (int lp_mission) {
    // Implementation
    return ConversationDataStateText(libCamp_gf_TS_MapConvoID(lp_mission), "Name");
}

text libCamp_gf_MissionNameInUpperCase (int lp_mission) {
    // Implementation
    return TextCase(libCamp_gf_MissionName(lp_mission), true);
}

text libCamp_gf_MissionEpilogue (int lp_mission) {
    // Implementation
    return ConversationDataStateText(libCamp_gf_TS_MapConvoID(lp_mission), "Epilogue");
}

text libCamp_gf_MissionPlanetInfo (int lp_mission) {
    // Implementation
    return ConversationDataStateText(libCamp_gf_TS_MapConvoID(lp_mission), "Planet Info");
}

text libCamp_gf_MissionObjectivesText (int lp_mission) {
    // Implementation
    return ConversationDataStateText(libCamp_gf_TS_MapConvoID(lp_mission), "Objectives");
}

string libCamp_gf_MissionPitches (int lp_mission) {
    // Implementation
    return libCamp_gv_tS_MissionPitches[(lp_mission)];
}

int libCamp_gf_MissionUnlockedTechSubgorup (int lp_mission, int lp_index) {
    // Implementation
    return libCamp_gv_tS_MissionTechUnitsEnabled[(lp_mission)][lp_index];
}

string libCamp_gf_MissionUnlockedUnitType (int lp_mission, int lp_index) {
    // Implementation
    return libCamp_gf_StoryTechGroupUnitType(libCamp_gf_MissionUnlockedTechSubgorup(lp_mission, lp_index));
}

string libCamp_gf_MissionLoadingScreenImage (int lp_mission) {
    // Variable Declarations
    string lv_image;
    int lv_planet;

    // Variable Initialization

    // Implementation
    lv_image = libCamp_gv_tS_MapLoadingScreenImage[(lp_mission)];
    lv_planet = libCamp_gv_tS_MissionLocation[(lp_mission)];
    if ((lv_image == null) && (lv_planet != 0)) {
        lv_image = libCamp_gv_tS_PlanetImage[(lv_planet)];
    }
    else {
    }
    return lv_image;
}

int libCamp_gf_NumberOfMissions (int lp_options) {
    int autoFD311C5A_i;
    int auto9210BCE2_val;

    // Variable Declarations
    int lv_mission;
    int lv_count;

    // Variable Initialization

    // Implementation
    autoFD311C5A_i = libCamp_gv_TSC_MISSION_FIRST;
    while (autoFD311C5A_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_mission = libCamp_gv_tS_MapID[autoFD311C5A_i];
        auto9210BCE2_val = lp_options;
        if (auto9210BCE2_val == 0) {
            lv_count += 1;
        }
        else if (auto9210BCE2_val == 2) {
            if ((libCamp_gf_MissionStatusCheck(lv_mission, 1) == true)) {
                lv_count += 1;
            }
            else {
            }
        }
        else if (auto9210BCE2_val == 3) {
            if ((libCamp_gf_MissionStatusCheck(lv_mission, 2) == true)) {
                lv_count += 1;
            }
            else {
            }
        }
        else if (auto9210BCE2_val == 1) {
            if ((libCamp_gf_MissionStatusCheck(lv_mission, 0) == true)) {
                lv_count += 1;
            }
            else {
            }
        }
        else {
        }
        autoFD311C5A_i = autoFD311C5A_i + 1;
    }
    return lv_count;
}

int libCamp_gf_TS_MissionRewardResearchPoints (int lp_mission, int lp_researchCategory) {
    int auto9FC8E896_val;

    // Implementation
    auto9FC8E896_val = lp_researchCategory;
    if (auto9FC8E896_val == 1) {
        return FixedToInt(ConversationDataStateFixedValue(libCamp_gf_TS_MapConvoID(lp_mission), "ResearchProtoss"));
    }
    else if (auto9FC8E896_val == 2) {
        return FixedToInt(ConversationDataStateFixedValue(libCamp_gf_TS_MapConvoID(lp_mission), "ResearchZerg"));
    }
    else {
    }
    return 0;
}

int libCamp_gf_TS_TertiaryIntegerOp (bool lp_condition, int lp_trueValue, int lp_falseValue) {
    // Implementation
    if ((lp_condition == true)) {
        return lp_trueValue;
    }
    else {
        return lp_falseValue;
    }
}

bool libCamp_gf_TS_MapIsMission (int lp_map) {
    // Implementation
    return libCamp_gf_MapTypeCheck(lp_map, 1);
}

int libCamp_gf_TS_MapIDFromIndex (int lp_mapIndex) {
    // Implementation
    return libCamp_gv_tS_MapID[lp_mapIndex];
}

string libCamp_gf_TS_MapConvoID (int lp_map) {
    // Implementation
    return libCamp_gv_tS_MapConvoID[(lp_map)];
}

text libCamp_gf_FormatCredits (int lp_credits, bool lp_withDollarSign) {
    // Variable Declarations

    // Variable Initialization

    // Implementation
    return FormatNumber(lp_credits);
}

int libCamp_gf_CurrentMap () {
    // Implementation
    return libCamp_gv_tS_CurrentMap;
}

void libCamp_gf_UpdateMissionFlow () {
    int auto911CEB10_i;

    // Variable Declarations
    int lv_indexMission;

    // Variable Initialization

    // Implementation
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 1, true);
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 2, libCamp_gf_MissionStatusCheck(1, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 3, libCamp_gf_MissionStatusCheck(2, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 4, libCamp_gf_MissionStatusCheck(3, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 5, libCamp_gf_MissionStatusCheck(4, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 6, ((libCamp_gf_MissionStatusAge(5, 2) > 2) || (libCamp_gf_MissionStatusCheck(5, 2) && (libCamp_gf_CountMissions(2) >= 12))));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 7, ((libCamp_gf_MissionStatusAge(5, 2) > 2) || (libCamp_gf_MissionStatusCheck(5, 2) && (libCamp_gf_CountMissions(2) >= 12))));
    libCamp_gf_TS_LockUnlockMissionIfCondition(true, 6, libCamp_gf_MissionStatusCheck(7, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(true, 7, libCamp_gf_MissionStatusCheck(6, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 8, (libCamp_gf_CountMissions(2) >= 4));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 9, libCamp_gf_MissionStatusCheck(8, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 10, ((libCamp_gf_MissionStatusAge(9, 2) > 2) || (libCamp_gf_MissionStatusCheck(9, 2) && (libCamp_gf_CountMissions(2) >= 13))));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 11, ((libCamp_gf_MissionStatusAge(9, 2) > 2) || (libCamp_gf_MissionStatusCheck(9, 2) && (libCamp_gf_CountMissions(2) >= 13))));
    libCamp_gf_TS_LockUnlockMissionIfCondition(true, 10, libCamp_gf_MissionStatusCheck(11, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(true, 11, libCamp_gf_MissionStatusCheck(10, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 12, (libCamp_gf_CountMissions(2) >= 6));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 13, libCamp_gf_MissionStatusCheck(12, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 14, libCamp_gf_MissionStatusCheck(13, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 15, libCamp_gf_MissionStatusCheck(14, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 16, (libCamp_gf_MissionStatusCheck(15, 2) && (libCamp_gf_StoryState(27) > 0)));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 17, libCamp_gf_MissionStatusCheck(3, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 18, (libCamp_gf_MissionStatusCheck(17, 2) && (libCamp_gf_CountMissions(2) >= 8)));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 19, (libCamp_gf_MissionStatusCheck(18, 2) && (libCamp_gf_CountMissions(2) >= 11)));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 20, (libCamp_gf_MissionStatusCheck(19, 2) && (libCamp_gf_CountMissions(2) >= 14)));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 21, libCamp_gf_MissionStatusCheck(20, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 22, libCamp_gf_MissionStatusCheck(18, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 23, libCamp_gf_MissionStatusCheck(22, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 24, libCamp_gf_MissionStatusCheck(23, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 25, libCamp_gf_MissionStatusCheck(24, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 26, libCamp_gf_MissionStatusCheck(21, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 27, libCamp_gf_MissionStatusCheck(26, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 28, libCamp_gf_MissionStatusCheck(26, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(true, 27, libCamp_gf_MissionStatusCheck(28, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(true, 28, libCamp_gf_MissionStatusCheck(27, 2));
    libCamp_gf_TS_LockUnlockMissionIfCondition(false, 29, (libCamp_gf_MissionStatusCheck(27, 2) || libCamp_gf_MissionStatusCheck(28, 2)));
    if ((libCamp_gf_MissionStatusCheck(26, 2) == true)) {
        auto911CEB10_i = libCamp_gv_TSC_MISSION_FIRST;
        while (auto911CEB10_i <= libCamp_gv_TSC_MISSION_LAST) {
            lv_indexMission = libCamp_gv_tS_MapID[auto911CEB10_i];
            if ((lv_indexMission != 26) && (lv_indexMission != 27) && (lv_indexMission != 28) && (lv_indexMission != 29)) {
                libCamp_gf_TS_LockUnlockMissionIfCondition(true, lv_indexMission, true);
            }
            else {
            }
            auto911CEB10_i = auto911CEB10_i + 1;
        }
    }
    else {
    }
}

void libCamp_gf_SetMissionBriefing (int lp_mapID, trigger lp_briefing, trigger lp_briefingPreload, trigger lp_briefingPreloadRough) {
    // Variable Declarations
    int lv_mapIndex;

    // Variable Initialization

    // Implementation
    lv_mapIndex = (lp_mapID);
    libCamp_gv_tS_MissionBriefing[lv_mapIndex] = lp_briefing;
    libCamp_gv_tS_MissionBriefingPreload[lv_mapIndex] = lp_briefingPreload;
    libCamp_gv_tS_MissionBriefingPreloadRough[lv_mapIndex] = lp_briefingPreloadRough;
}

void libCamp_gf_SetMissionABChoiceCallback (int lp_mapID, trigger lp_aBChoice) {
    // Variable Declarations
    int lv_mapIndex;

    // Variable Initialization

    // Implementation
    lv_mapIndex = (lp_mapID);
    libCamp_gv_tS_MissionABChoice[lv_mapIndex] = lp_aBChoice;
}

void libCamp_gf_SetMissionABChoiceResult (int lp_mapID) {
    // Implementation
    libCamp_gv_tS_MissionABChoiceResult = lp_mapID;
}

void libCamp_gf_TS_MarkMissionAsStatus (int lp_missionID, int lp_status) {
    int auto8ADDD5CF_val;

    // Implementation
    auto8ADDD5CF_val = lp_status;
    if (auto8ADDD5CF_val == 0) {
        libCamp_gf_TS_SetMissionStatusAge(lp_missionID, 1, 0);
        libCamp_gf_TS_SetMissionStatusAge(lp_missionID, 2, 0);
    }
    else if (auto8ADDD5CF_val == 1) {
        libCamp_gf_TS_SetMissionStatusAge(lp_missionID, 1, 1);
        libCamp_gf_TS_SetMissionStatusAge(lp_missionID, 2, 0);
    }
    else if (auto8ADDD5CF_val == 2) {
        libCamp_gf_TS_SetMissionStatusAge(lp_missionID, 1, 0);
        libCamp_gf_TS_SetMissionStatusAge(lp_missionID, 2, 1);
    }
    else {
    }
}

void libCamp_gf_TS_SetMissionStatusAge (int lp_mission, int lp_status, int lp_age) {
    int autoFDA5092A_val;

    // Implementation
    autoFDA5092A_val = lp_status;
    if (autoFDA5092A_val == 1) {
        ConversationDataStateSetValue(ConversationDataStateIndex("MissionAvailable", (lp_mission)), lp_age);
    }
    else if (autoFDA5092A_val == 2) {
        ConversationDataStateSetValue(ConversationDataStateIndex("MissionCompleted", (lp_mission)), lp_age);
    }
    else {
    }
}

void libCamp_gf_TS_SetMissionDifficultyCompleted (int lp_mission, int lp_difficulty, bool lp_completed) {
    // Implementation
    libCamp_gv_tSX_MissionDifficultyCompleted[(lp_mission)][(lp_difficulty)] = lp_completed;
}

void libCamp_gf_TS_SetMissionCompleteBestTime (int lp_mission, int lp_difficulty, int lp_time) {
    // Implementation
    libCamp_gv_tSX_MissionDifficultyBestTime[(lp_mission)][(lp_difficulty)] = lp_time;
}

void libCamp_gf_TS_CompleteMission (int lp_mission) {
    int auto6BC20551_i;

    // Variable Declarations
    int lv_index;
    int lv_indexMission;

    // Variable Initialization

    // Implementation
    if (((lp_mission == 0) || (libCamp_gf_MissionStatusCheck(lp_mission, 2) == true))) {
        return ;
    }
    else {
    }
    libCamp_gf_TS_MarkMissionAsStatus(lp_mission, 2);
    auto6BC20551_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto6BC20551_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto6BC20551_i];
        if ((lv_indexMission != lp_mission)) {
            libCamp_gf_TS_IncreaseMissionAge(lv_indexMission);
        }
        else {
        }
        auto6BC20551_i = auto6BC20551_i + 1;
    }
    libCamp_gf_UpdateMissionFlow();
}

void libCamp_gf_TS_IncreaseMissionAge (int lp_mission) {
    int auto7B5F5DA0_val;

    // Implementation
    auto7B5F5DA0_val = libCamp_gf_MissionStatus(lp_mission);
    if (auto7B5F5DA0_val == 0) {
        libCamp_gf_TS_SetMissionStatusAge(lp_mission, 1, 0);
        libCamp_gf_TS_SetMissionStatusAge(lp_mission, 2, 0);
    }
    else if (auto7B5F5DA0_val == 1) {
        libCamp_gf_TS_SetMissionStatusAge(lp_mission, 1, (libCamp_gf_MissionStatusAge(lp_mission, 1) + 1));
    }
    else if (auto7B5F5DA0_val == 2) {
        libCamp_gf_TS_SetMissionStatusAge(lp_mission, 2, (libCamp_gf_MissionStatusAge(lp_mission, 2) + 1));
    }
    else {
    }
}

void libCamp_gf_TS_InitializeMapDataSingle (int lp_mapID, string lp_map, text lp_progressCheatName, int lp_type, string lp_convoID, text lp_subtitle, string lp_loadingScreenImage, string lp_backLoadingScreenImage, string lp_backDefeatLoadingScreenImage, text lp_summary, int lp_location, bool lp_isRequired, int lp_contact, int lp_creditsPoor, int lp_creditsAvg, int lp_creditsRich, int lp_enabedTechUnit1, int lp_enabedTechUnit2, int lp_enabedTechUnit3, string lp_pitches, text lp_enemyForces, string lp_battleReportImage, string lp_battleReportIcon) {
    // Variable Declarations
    int lv_mapIndex;

    // Variable Initialization

    // Implementation
    lv_mapIndex = (lp_mapID);
    libCamp_gv_tS_MapID[lv_mapIndex] = lp_mapID;
    libCamp_gv_tS_MapFile[lv_mapIndex] = lp_map;
    libCamp_gv_tS_MapProgressCheatName[lv_mapIndex] = lp_progressCheatName;
    libCamp_gv_tS_MapProgressCheatName[lv_mapIndex] = ConversationDataStateText(lp_convoID, "Name");
    libCamp_gv_tS_MapType[lv_mapIndex] = lp_type;
    libCamp_gv_tS_MapConvoID[lv_mapIndex] = lp_convoID;
    libCamp_gv_tS_MapSubtitle[lv_mapIndex] = lp_subtitle;
    libCamp_gv_tS_MapLoadingScreenImage[lv_mapIndex] = lp_loadingScreenImage;
    libCamp_gv_tS_MapBackLoadingImage[lv_mapIndex] = lp_backLoadingScreenImage;
    libCamp_gv_tS_MapBackDefeatLoadingImage[lv_mapIndex] = lp_backDefeatLoadingScreenImage;
    libCamp_gv_tS_MissionSummary[lv_mapIndex] = lp_summary;
    libCamp_gv_tS_MissionLocation[lv_mapIndex] = lp_location;
    libCamp_gv_tS_MissionIsRequired[lv_mapIndex] = lp_isRequired;
    libCamp_gv_tS_MissionContact[lv_mapIndex] = lp_contact;
    libCamp_gv_tS_ExpectedCreditsPoor[lv_mapIndex] = lp_creditsPoor;
    libCamp_gv_tS_ExpectedCreditsAvg[lv_mapIndex] = lp_creditsAvg;
    libCamp_gv_tS_ExpectedCreditsRich[lv_mapIndex] = lp_creditsRich;
    libCamp_gv_tS_MissionPitches[lv_mapIndex] = lp_pitches;
    libCamp_gv_tS_MissionTechUnitsEnabled[lv_mapIndex][1] = lp_enabedTechUnit1;
    libCamp_gv_tS_MissionTechUnitsEnabled[lv_mapIndex][2] = lp_enabedTechUnit2;
    libCamp_gv_tS_MissionTechUnitsEnabled[lv_mapIndex][3] = lp_enabedTechUnit3;
    libCamp_gv_tS_MissionEnemyForces[lv_mapIndex] = lp_enemyForces;
    libCamp_gv_tS_MissionBattleReportImage[lv_mapIndex] = lp_battleReportImage;
    libCamp_gv_tS_MissionBattleReportIcon[lv_mapIndex] = lp_battleReportIcon;
    libCamp_gf_TS_SetMissionDifficultyCompleted(lp_mapID, 1, false);
    libCamp_gf_TS_SetMissionDifficultyCompleted(lp_mapID, 2, false);
    libCamp_gf_TS_SetMissionDifficultyCompleted(lp_mapID, 3, false);
    libCamp_gf_TS_SetMissionDifficultyCompleted(lp_mapID, 4, false);
    libCamp_gf_TS_SetMissionCompleteBestTime(lp_mapID, 1, 0);
    libCamp_gf_TS_SetMissionCompleteBestTime(lp_mapID, 2, 0);
    libCamp_gf_TS_SetMissionCompleteBestTime(lp_mapID, 3, 0);
    libCamp_gf_TS_SetMissionCompleteBestTime(lp_mapID, 4, 0);
}

void libCamp_gf_TS_InitializeMapData () {
    // Variable Declarations
    string lv_loading_MarSaraBar;
    string lv_loading_HyperionBridge;
    string lv_loading_CharBattleZone;
    string lv_loading_HyperionArmory;
    string lv_loading_HyperionCantina;
    string lv_loading_HyperionLab;

    // Variable Initialization
    lv_loading_MarSaraBar = "MarSaraLoadingScreenImage";
    lv_loading_HyperionBridge = "HyperionLoadingScreenImage";
    lv_loading_CharBattleZone = "CharLoadingScreenImage";
    lv_loading_HyperionArmory = "ArmoryLoadingScreenImage";
    lv_loading_HyperionCantina = "CantinaLoadingScreenImage";
    lv_loading_HyperionLab = "LabLoadingScreenImage";

    // Implementation
    libCamp_gf_TS_InitializeContactData();
    libCamp_gf_TS_InitializeMapDataSingle(1, "TRaynor01", StringExternal("Param/Value/lib_Camp_12F0346D"), 1, "Maps|TRaynor01", StringExternal("Param/Value/lib_Camp_07CBE499"), "Assets\\Textures\\loading-marsara.dds", "Assets\\Textures\\loading-kerriganphoto.dds", "Assets\\Textures\\loading-marsarabarexterior.dds", StringExternal("Param/Value/lib_Camp_054388C1"), 20, true, 1, 0, 0, 0, 5, 0, 0, "MissionPitch|TRaynor01", StringExternal("Param/Value/lib_Camp_E93CFA3C"), "Assets\\Textures\\ui_battlereports_traynor01.dds", "Assets\\Textures\\ui_list_battlereports_traynor01.dds");
    libCamp_gf_TS_InitializeMapDataSingle(2, "TRaynor02", StringExternal("Param/Value/lib_Camp_E252F0A8"), 1, "Maps|TRaynor02", StringExternal("Param/Value/lib_Camp_AA0E57F6"), "Assets\\Textures\\loading-marsara.dds", "Assets\\Textures\\loading-marsarabar.dds", null, StringExternal("Param/Value/lib_Camp_489114A5"), 20, true, 1, 0, 0, 0, 6, 0, 0, "MissionPitch|TRaynor02", StringExternal("Param/Value/lib_Camp_4CAB2A15"), "Assets\\Textures\\ui_battlereports_traynor02.dds", "Assets\\Textures\\ui_list_battlereports_traynor02.dds");
    libCamp_gf_TS_InitializeMapDataSingle(3, "TRaynor03", StringExternal("Param/Value/lib_Camp_04414D7D"), 1, "Maps|TRaynor03", StringExternal("Param/Value/lib_Camp_A64CF18B"), "Assets\\Textures\\loading-marsara.dds", "Assets\\Textures\\loading-terran05.dds", lv_loading_MarSaraBar, StringExternal("Param/Value/lib_Camp_D7D767FF"), 20, true, 1, 5, 5, 5, 1, 2, 23, "MissionPitch|TRaynor03", StringExternal("Param/Value/lib_Camp_195718A4"), "Assets\\Textures\\ui_battlereports_traynor03.dds", "Assets\\Textures\\ui_list_battlereports_traynor03.dds");
    libCamp_gf_TS_InitializeMapDataSingle(4, "THanson01", StringExternal("Param/Value/lib_Camp_EFA6508B"), 1, "Maps|THanson01", StringExternal("Param/Value/lib_Camp_17D68862"), null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_397B339D"), 1, false, 44, 120000, 200000, 560000, 7, 0, 0, "MissionPitch|THanson01", StringExternal("Param/Value/lib_Camp_C71ABB46"), "Assets\\Textures\\ui_battlereports_thanson01.dds", "Assets\\Textures\\ui_list_battlereports_thanson01.dds");
    libCamp_gf_TS_InitializeMapDataSingle(5, "THanson02", StringExternal("Param/Value/lib_Camp_80DD44F1"), 1, "Maps|THanson02", StringExternal("Param/Value/lib_Camp_CC7A0EF4"), null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_34DFF125"), 21, false, 44, 180000, 260000, 620000, 10, 24, 0, "MissionPitch|THanson02", StringExternal("Param/Value/lib_Camp_D0A11C82"), "Assets\\Textures\\ui_battlereports_thanson02.dds", "Assets\\Textures\\ui_list_battlereports_thanson02.dds");
    libCamp_gf_TS_InitializeMapDataSingle(6, "THanson03A", StringExternal("Param/Value/lib_Camp_C8307E40"), 1, "Maps|THanson03A", StringExternal("Param/Value/lib_Camp_2A478B46"), null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_055B2EED"), 16, false, 44, 570000, 1010000, 1330000, 17, 0, 0, "MissionPitch|THanson03A", StringExternal("Param/Value/lib_Camp_300E1F98"), "Assets\\Textures\\ui_battlereports_thanson03a.dds", "Assets\\Textures\\ui_list_battlereports_thanson03a.dds");
    libCamp_gf_TS_InitializeMapDataSingle(7, "THanson03B", StringExternal("Param/Value/lib_Camp_82841463"), 1, "Maps|THanson03B", StringExternal("Param/Value/lib_Camp_8DFFDB26"), null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_D20378E5"), 16, false, 44, 570000, 1010000, 1330000, 17, 0, 0, "MissionPitch|THanson03B", StringExternal("Param/Value/lib_Camp_3D12CCA2"), "Assets\\Textures\\ui_battlereports_thanson03b.dds", "Assets\\Textures\\ui_list_battlereports_thanson03b.dds");
    libCamp_gf_TS_InitializeMapDataSingle(8, "TTosh01", StringExternal("Param/Value/lib_Camp_C82F3C6A"), 1, "Maps|TTosh01", StringExternal("Param/Value/lib_Camp_389DAF39"), null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_3493D443"), 29, false, 62, 180000, 350000, 970000, 9, 0, 0, "MissionPitch|TTosh01", StringExternal("Param/Value/lib_Camp_968C61BC"), "Assets\\Textures\\ui_battlereports_ttosh01.dds", "Assets\\Textures\\ui_list_battlereports_ttosh01.dds");
    libCamp_gf_TS_InitializeMapDataSingle(9, "TTosh02", StringExternal("Param/Value/lib_Camp_CF3C9EC3"), 1, "Maps|TTosh02", StringExternal("Param/Value/lib_Camp_C1DE606F"), null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_B5CFCCFB"), 6, false, 62, 280000, 450000, 1070000, 12, 0, 0, "MissionPitch|TTosh02", StringExternal("Param/Value/lib_Camp_307CA02C"), "Assets\\Textures\\ui_battlereports_ttosh02.dds", "Assets\\Textures\\ui_list_battlereports_ttosh02.dds");
    libCamp_gf_TS_InitializeMapDataSingle(10, "TTosh03A", StringExternal("Param/Value/lib_Camp_906322EE"), 1, "Maps|TTosh03A", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_46B08872"), 24, false, 62, 570000, 1180000, 1510000, 21, 0, 0, "MissionPitch|TTosh03A", StringExternal("Param/Value/lib_Camp_9EFDA03D"), "Assets\\Textures\\ui_battlereports_ttosh03a.dds", "Assets\\Textures\\ui_list_battlereports_ttosh03a.dds");
    libCamp_gf_TS_InitializeMapDataSingle(11, "TTosh03B", StringExternal("Param/Value/lib_Camp_88FC70C3"), 1, "Maps|TTosh03B", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_1F536FF4"), 4, false, 62, 570000, 1180000, 1510000, 20, 0, 0, "MissionPitch|TTosh03B", StringExternal("Param/Value/lib_Camp_1AAC6854"), "Assets\\Textures\\ui_battlereports_ttosh03b.dds", "Assets\\Textures\\ui_list_battlereports_ttosh03b.dds");
    libCamp_gf_TS_InitializeMapDataSingle(12, "THorner01", StringExternal("Param/Value/lib_Camp_243E3B8B"), 1, "Maps|THorner01", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_0AB29161"), 32, false, 47, 360000, 630000, 1030000, 13, 0, 0, "MissionPitch|THorner01", StringExternal("Param/Value/lib_Camp_2882682B"), "Assets\\Textures\\ui_battlereports_thorner01.dds", "Assets\\Textures\\ui_list_battlereports_thorner01.dds");
    libCamp_gf_TS_InitializeMapDataSingle(13, "THorner02", StringExternal("Param/Value/lib_Camp_AEDB68C2"), 1, "Maps|THorner02", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_EC264544"), 13, false, 47, 500000, 770000, 1170000, 11, 0, 0, "MissionPitch|THorner02", StringExternal("Param/Value/lib_Camp_516FD7AC"), "Assets\\Textures\\ui_battlereports_thorner02.dds", "Assets\\Textures\\ui_list_battlereports_thorner02.dds");
    libCamp_gf_TS_InitializeMapDataSingle(14, "THorner03", StringExternal("Param/Value/lib_Camp_79B9EADF"), 1, "Maps|THorner03", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_E79B3B7C"), 38, false, 47, 650000, 920000, 1320000, 16, 0, 0, "MissionPitch|THorner03", StringExternal("Param/Value/lib_Camp_CE29A8F0"), "Assets\\Textures\\ui_battlereports_thorner03.dds", "Assets\\Textures\\ui_list_battlereports_thorner03.dds");
    libCamp_gf_TS_InitializeMapDataSingle(15, "THorner04", StringExternal("Param/Value/lib_Camp_E50563DB"), 1, "Maps|THorner04", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_CC6B04A7"), 19, false, 47, 810000, 1080000, 1480000, 22, 0, 0, "MissionPitch|THorner04", StringExternal("Param/Value/lib_Camp_58035DCF"), "Assets\\Textures\\ui_battlereports_thorner04.dds", "Assets\\Textures\\ui_list_battlereports_thorner04.dds");
    libCamp_gf_TS_InitializeMapDataSingle(16, "THorner05S", StringExternal("Param/Value/lib_Camp_3BBCC86D"), 1, "Maps|THorner05S", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_52BA31A7"), 11, false, 47, 980000, 1250000, 1650000, 0, 0, 0, "MissionPitch|THorner05S", StringExternal("Param/Value/lib_Camp_D7CA258D"), "Assets\\Textures\\ui_battlereports_thorner05s.dds", "Assets\\Textures\\ui_list_battlereports_thorner05s.dds");
    libCamp_gf_TS_InitializeMapDataSingle(17, "TTychus01", StringExternal("Param/Value/lib_Camp_0D0C7511"), 1, "Maps|TTychus01", StringExternal("Param/Value/lib_Camp_EC5A9063"), null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_C1C9F076"), 22, true, 63, 120000, 270000, 630000, 8, 0, 0, "MissionPitch|TTychus01", StringExternal("Param/Value/lib_Camp_C37FBDD9"), "Assets\\Textures\\ui_battlereports_ttychus01.dds", "Assets\\Textures\\ui_list_battlereports_ttychus01.dds");
    libCamp_gf_TS_InitializeMapDataSingle(18, "TTychus02", StringExternal("Param/Value/lib_Camp_017DF311"), 1, "Maps|TTychus02", StringExternal("Param/Value/lib_Camp_D352F4DF"), null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_5DB46EFF"), 41, true, 63, 570000, 870000, 1510000, 14, 0, 0, "MissionPitch|TTychus02", StringExternal("Param/Value/lib_Camp_C1686C5A"), "Assets\\Textures\\ui_battlereports_ttychus02.dds", "Assets\\Textures\\ui_list_battlereports_ttychus02.dds");
    libCamp_gf_TS_InitializeMapDataSingle(19, "TTychus03", StringExternal("Param/Value/lib_Camp_E182326E"), 1, "Maps|TTychus03", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_EA61E401"), 35, true, 63, 730000, 1320000, 1670000, 15, 0, 0, "MissionPitch|TTychus03", StringExternal("Param/Value/lib_Camp_8B07D59F"), "Assets\\Textures\\ui_battlereports_ttychus03.dds", "Assets\\Textures\\ui_list_battlereports_ttychus03.dds");
    libCamp_gf_TS_InitializeMapDataSingle(20, "TTychus04", StringExternal("Param/Value/lib_Camp_6002246B"), 1, "Maps|TTychus04", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_80001ED8"), 34, true, 63, 920000, 1670000, 2020000, 18, 0, 0, "MissionPitch|TTychus04", StringExternal("Param/Value/lib_Camp_2E93DE67"), "Assets\\Textures\\ui_battlereports_ttychus04.dds", "Assets\\Textures\\ui_list_battlereports_ttychus04.dds");
    libCamp_gf_TS_InitializeMapDataSingle(21, "TTychus05", StringExternal("Param/Value/lib_Camp_01271247"), 1, "Maps|TTychus05", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_0969EEBE"), 31, true, 64, 1140000, 1890000, 2240000, 19, 0, 0, "MissionPitch|TTychus05", StringExternal("Param/Value/lib_Camp_7B5708BC"), "Assets\\Textures\\ui_battlereports_ttychus05.dds", "Assets\\Textures\\ui_list_battlereports_ttychus05.dds");
    libCamp_gf_TS_InitializeMapDataSingle(22, "TZeratul01", StringExternal("Param/Value/lib_Camp_555D6817"), 1, "Maps|TZeratul01", null, null, lv_loading_HyperionLab, null, StringExternal("Param/Value/lib_Camp_FCFE67E4"), 36, false, 68, 730000, 1030000, 1670000, 0, 0, 0, "MissionPitch|TZeratul01", StringExternal("Param/Value/lib_Camp_33295101"), "Assets\\Textures\\ui_battlereports_tzeratul01.dds", "Assets\\Textures\\ui_list_battlereports_tzeratul01.dds");
    libCamp_gf_TS_InitializeMapDataSingle(23, "TZeratul02", StringExternal("Param/Value/lib_Camp_35D9D23E"), 1, "Maps|TZeratul02", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_C5544A6B"), 42, false, 68, 730000, 1030000, 1670000, 0, 0, 0, "MissionPitch|TZeratul02", StringExternal("Param/Value/lib_Camp_D28717FB"), "Assets\\Textures\\ui_battlereports_tzeratul02.dds", "Assets\\Textures\\ui_list_battlereports_tzeratul02.dds");
    libCamp_gf_TS_InitializeMapDataSingle(24, "TZeratul03", StringExternal("Param/Value/lib_Camp_5FB4D985"), 1, "Maps|TZeratul03", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_07220182"), 2, false, 68, 730000, 1030000, 1670000, 0, 0, 0, "MissionPitch|TZeratul03", StringExternal("Param/Value/lib_Camp_6ACEBBC7"), "Assets\\Textures\\ui_battlereports_tzeratul03.dds", "Assets\\Textures\\ui_list_battlereports_tzeratul03.dds");
    libCamp_gf_TS_InitializeMapDataSingle(25, "TZeratul04", StringExternal("Param/Value/lib_Camp_FDCCBD0E"), 1, "Maps|TZeratul04", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_F6B2AC48"), 30, false, 68, 730000, 1030000, 1670000, 0, 0, 0, "MissionPitch|TZeratul04", StringExternal("Param/Value/lib_Camp_C569E503"), "Assets\\Textures\\ui_battlereports_tzeratul04.dds", "Assets\\Textures\\ui_list_battlereports_tzeratul04.dds");
    libCamp_gf_TS_InitializeMapDataSingle(26, "TValerian01", StringExternal("Param/Value/lib_Camp_789D4EFC"), 1, "Maps|TValerian01", null, null, lv_loading_CharBattleZone, lv_loading_HyperionBridge, StringExternal("Param/Value/lib_Camp_23F16BCD"), 12, true, 64, 1380000, 2130000, 2480000, 0, 0, 0, "MissionPitch|TValerian01", StringExternal("Param/Value/lib_Camp_68C43653"), "Assets\\Textures\\ui_battlereports_tvalerian01.dds", "Assets\\Textures\\ui_list_battlereports_tvalerian01.dds");
    libCamp_gf_TS_InitializeMapDataSingle(27, "TValerian02A", StringExternal("Param/Value/lib_Camp_8A82E437"), 1, "Maps|TValerian02A", null, null, lv_loading_CharBattleZone, null, StringExternal("Param/Value/lib_Camp_3B8EBB2B"), 12, false, 64, 1630000, 2380000, 2730000, 0, 0, 0, "MissionPitch|TValerian02A", StringExternal("Param/Value/lib_Camp_A7AC8C03"), "Assets\\Textures\\ui_battlereports_tvalerian02a.dds", "Assets\\Textures\\ui_list_battlereports_tvalerian02a.dds");
    libCamp_gf_TS_InitializeMapDataSingle(28, "TValerian02B", StringExternal("Param/Value/lib_Camp_7BE6511A"), 1, "Maps|TValerian02B", null, "Assets\\Textures\\loading-char.dds", "Assets\\Textures\\loading-char.dds", null, StringExternal("Param/Value/lib_Camp_9D461F08"), 12, false, 64, 1630000, 2380000, 2730000, 0, 0, 0, "MissionPitch|TValerian02B", StringExternal("Param/Value/lib_Camp_CEF81DB8"), "Assets\\Textures\\ui_battlereports_tvalerian02b.dds", "Assets\\Textures\\ui_list_battlereports_tvalerian02a.dds");
    libCamp_gf_TS_InitializeMapDataSingle(29, "TValerian03", StringExternal("Param/Value/lib_Camp_C5570C17"), 1, "Maps|TValerian03", null, null, lv_loading_CharBattleZone, null, StringExternal("Param/Value/lib_Camp_35DF4293"), 12, true, 64, 1890000, 2640000, 2990000, 0, 0, 0, "MissionPitch|TValerian03", StringExternal("Param/Value/lib_Camp_F288B5E4"), "Assets\\Textures\\ui_battlereports_tvalerian03.dds", "Assets\\Textures\\ui_list_battlereports_tvalerian03.dds");
    libCamp_gf_TS_InitializeMapDataSingle(30, "TSecret", StringExternal("Param/Value/lib_Camp_3E5B1722"), 1, "Maps|TSecret01", null, null, null, null, StringExternal("Param/Value/lib_Camp_5E31B6E6"), 0, false, 0, 0, 0, 0, 0, 0, 0, "", StringExternal("Param/Value/lib_Camp_AF42F7E9"), null, null);
    libCamp_gf_TS_InitializeMapDataSingle(31, "TStory01", StringExternal("Param/Value/lib_Camp_40A468A0"), 2, "Maps|TStory01", null, null, null, null, StringExternal("Param/Value/lib_Camp_A602E25B"), 0, true, 0, 0, 0, 0, 0, 0, 0, "", StringExternal("Param/Value/lib_Camp_01DEC33C"), null, null);
    libCamp_gf_TS_InitializeMapDataSingle(32, "TArcade", StringExternal("Param/Value/lib_Camp_CD615CB4"), 3, "Maps|TArcade", null, null, lv_loading_HyperionBridge, null, StringExternal("Param/Value/lib_Camp_2A605C70"), 0, false, 0, 0, 0, 0, 0, 0, 0, "", StringExternal("Param/Value/lib_Camp_B0681161"), null, null);
    libCamp_gf_TS_InitializeMapDataSingle(33, "TSimulator", StringExternal("Param/Value/lib_Camp_9F231CA2"), 3, "Maps|TSimulator", null, null, lv_loading_HyperionArmory, null, StringExternal("Param/Value/lib_Camp_EC626D89"), 0, false, 0, 0, 0, 0, 0, 0, 0, "", StringExternal("Param/Value/lib_Camp_649F90FE"), null, null);
    libCamp_gf_TS_DebugProgressInitMissionPath();
}

void libCamp_gf_TS_InitializeContactDataSingle (int lp_contactID, text lp_name, string lp_convoStateIndex, string lp_portrait) {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    lv_index = (lp_contactID);
    libCamp_gv_tS_ContactName[lv_index] = lp_name;
    libCamp_gv_tS_ContactStateIndex[lv_index] = lp_convoStateIndex;
    libCamp_gv_tS_ContactPortrait[lv_index] = lp_portrait;
}

void libCamp_gf_TS_InitializeContactData () {
    // Implementation
    libCamp_gf_TS_InitializeContactDataSingle(1, StringExternal("Param/Value/lib_Camp_F93E794E"), "Characters|CharAdjutant", "AdjutantPortrait_L");
    libCamp_gf_TS_InitializeContactDataSingle(2, StringExternal("Param/Value/lib_Camp_53EE8195"), "Characters|CharConfederateAdjutant", null);
    libCamp_gf_TS_InitializeContactDataSingle(5, StringExternal("Param/Value/lib_Camp_3A2257C5"), "Characters|CharArcturus", "ArcturusPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(6, UnitTypeGetName("Banshee"), "Characters|CharBanshee", "BansheePortrait");
    libCamp_gf_TS_InitializeContactDataSingle(8, UnitTypeGetName("Battlecruiser"), "Characters|CharBattlecruiser", "BattlecruiserPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(13, UnitTypeGetName("CivilianFemale"), "Characters|CharCivilianFemale1", "FemaleCivilian1Portrait");
    libCamp_gf_TS_InitializeContactDataSingle(14, UnitTypeGetName("CivilianFemale"), "Characters|CharCivilianFemale2", "FemaleCivilian2Portrait");
    libCamp_gf_TS_InitializeContactDataSingle(15, UnitTypeGetName("Civilian"), "Characters|CharCivilian1", "MaleCivilian1Portrait");
    libCamp_gf_TS_InitializeContactDataSingle(16, UnitTypeGetName("Civilian"), "Characters|CharCivilian2", "MaleCivilian2Portrait");
    libCamp_gf_TS_InitializeContactDataSingle(41, UnitTypeGetName("Goliath"), "Characters|CharGoliath", "GoliathPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(44, StringExternal("Param/Value/lib_Camp_C9310C87"), "Characters|CharHanson", "HansonPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(45, UnitTypeGetName("Jackal"), "Characters|CharHellion", "JackalPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(46, UnitTypeGetName("HighTemplar"), "Characters|CharHighTemplar", "HighTemplarPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(47, StringExternal("Param/Value/lib_Camp_5289F428"), "Characters|CharHorner", "HornerPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(48, StringExternal("Param/Value/lib_Camp_C3449B56"), "Characters|CharKerrigan", "KerriganPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(49, UnitTypeGetName("Marine"), "Characters|CharMarine", "MarinePortrait");
    libCamp_gf_TS_InitializeContactDataSingle(50, UnitTypeGetName("Medic"), "Characters|CharMedic", "MedicPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(51, UnitTypeGetName("Dropship"), "Characters|CharMedivac", "MedivacPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(52, StringExternal("Param/Value/lib_Camp_B53F6AE0"), "Characters|CharHan", "HanPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(53, StringExternal("Param/Value/lib_Camp_A869087A"), "Characters|CharNarud", "NarudPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(54, StringExternal("Param/Value/lib_Camp_8C2EB2DA"), "Characters|CharNova", "NovaPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(69, StringExternal("Param/Value/lib_Camp_F4FB4566"), "Characters|CharOrlan", "OrlanPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(55, StringExternal("Param/Value/lib_Camp_A7E5EEF3"), "Characters|CharRaynor", "RaynorCommanderPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(56, StringExternal("Param/Value/lib_Camp_8347FFD5"), "Characters|CharRaynor", "RaynorMarinePortrait");
    libCamp_gf_TS_InitializeContactDataSingle(57, UnitTypeGetName("Reaper"), "Characters|CharReaper", "ReaperPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(58, UnitTypeGetName("SCV"), "Characters|CharSCV", "SCVPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(59, StringExternal("Param/Value/lib_Camp_DAAA402F"), "Characters|CharSelendis", "SelendisPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(60, UnitTypeGetName("SiegeTank"), "Characters|CharSiegeTank", "SiegeTankPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(61, StringExternal("Param/Value/lib_Camp_6A371C69"), "Characters|CharSwann", "SwannPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(62, StringExternal("Param/Value/lib_Camp_F7A848C0"), "Characters|CharTosh", "ToshPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(63, StringExternal("Param/Value/lib_Camp_A1CBBD0C"), "Characters|CharTychus", "TychusPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(64, StringExternal("Param/Value/lib_Camp_0F8F976C"), "Characters|CharValerian", "ValerianPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(65, UnitTypeGetName("VikingFighter"), "Characters|CharViking", "VikingFighterPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(66, StringExternal("Param/Value/lib_Camp_1B9DE67B"), "Characters|CharWarfield", "PortraitWarfield");
    libCamp_gf_TS_InitializeContactDataSingle(67, UnitTypeGetName("Zealot"), "Characters|CharZealot", "ZealotPortrait");
    libCamp_gf_TS_InitializeContactDataSingle(68, StringExternal("Param/Value/lib_Camp_A2B2661A"), "Characters|CharZeratul", "ZeratulPortrait");
}

void libCamp_gf_TS_LockUnlockMissionIfCondition (bool lp_lockUnlockOption, int lp_mission, bool lp_condition) {
    // Implementation
    if ((lp_condition == true) && (lp_lockUnlockOption == false) && (libCamp_gf_MissionStatus(lp_mission) == 0)) {
        libCamp_gf_TS_MarkMissionAsStatus(lp_mission, 1);
    }
    else {
    }
    if ((lp_condition == true) && (lp_lockUnlockOption == true) && (libCamp_gf_MissionStatus(lp_mission) == 1)) {
        libCamp_gf_TS_MarkMissionAsStatus(lp_mission, 0);
    }
    else {
    }
}

void libCamp_gf_TS_SetLastSuccessfulMission (int lp_mission) {
    int auto32A829D7_i;

    // Variable Declarations
    int lv_indexMission;

    // Variable Initialization

    // Implementation
    auto32A829D7_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto32A829D7_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto32A829D7_i];
        if ((lv_indexMission == lp_mission)) {
            ConversationDataStateSetValue(ConversationDataStateIndex("MissionLast", (lv_indexMission)), 1);
        }
        else {
            ConversationDataStateSetValue(ConversationDataStateIndex("MissionLast", (lv_indexMission)), 0);
        }
        auto32A829D7_i = auto32A829D7_i + 1;
    }
}

void libCamp_gf_TS_UpdateNewMissionOpened () {
    int auto526B2920_i;

    // Variable Declarations
    bool lv_opened;
    int lv_indexMission;

    // Variable Initialization

    // Implementation
    auto526B2920_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto526B2920_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto526B2920_i];
        if ((libCamp_gf_MissionStatusAge(lv_indexMission, 1) == 1)) {
            ConversationDataStateSetValue("NewMissionOpened", 1);
            return ;
        }
        else {
        }
        auto526B2920_i = auto526B2920_i + 1;
    }
    ConversationDataStateSetValue("NewMissionOpened", 0);
}

void libCamp_gf_LaunchMission (int lp_mission, bool lp_simulationOnOff, int lp_difficulty) {
    // Variable Declarations
    int lv_planet;
    text lv_body;
    int lv_missionPicked;

    // Variable Initialization
    lv_body = StringExternal("Param/Value/lib_Camp_71D5F2F2");

    // Implementation
    lv_missionPicked = lp_mission;
    if ((libCamp_gv_tS_MissionABChoice[(lp_mission)] != null) && (lp_simulationOnOff == false)) {
        libCamp_gv_tS_MissionABChoiceResult = 0;
        TriggerExecute(libCamp_gv_tS_MissionABChoice[(lp_mission)], true, true);
        if ((libCamp_gv_tS_MissionABChoiceResult == 0)) {
            return ;
        }
        else {
            lv_missionPicked = libCamp_gv_tS_MissionABChoiceResult;
        }
    }
    else {
    }
    if (((libCamp_gf_TS_GameFullyDownloaded() == true) || (lp_simulationOnOff == false)) && (libCamp_gv_tS_MissionBriefing[(lv_missionPicked)] != null)) {
        TriggerExecute(libCamp_gv_tS_MissionBriefing[(lv_missionPicked)], true, true);
    }
    else {
    }
    libCamp_gf_PrepareForMission(lv_missionPicked, lp_simulationOnOff, false, lp_difficulty);
    GameOver(1, c_gameOverVictory, false, false);
}

text libCamp_gf_MercName (int lp_mercID) {
    // Implementation
    return libCamp_gv_tS_MercNames[(lp_mercID)];
}

text libCamp_gf_MercDescription (int lp_mercID) {
    // Implementation
    return libCamp_gv_tS_MercDescriptions[(lp_mercID)];
}

int libCamp_gf_MercCost (int lp_mercID) {
    // Implementation
    return libCamp_gv_tS_MercCost[(lp_mercID)];
}

int libCamp_gf_MercTechSubgroup (int lp_mercID, int lp_index) {
    // Implementation
    return libCamp_gv_tS_MercTechSubGroup[(lp_mercID)][lp_index];
}

int libCamp_gf_MercCount (int lp_mercID, int lp_index) {
    // Implementation
    return libCamp_gv_tS_MercUnitCount[(lp_mercID)][lp_index];
}

text libCamp_gf_MercUnitText (int lp_mercID) {
    // Implementation
    return libCamp_gv_tS_MercUnitText[(lp_mercID)];
}

string libCamp_gf_MercUnitText2 (int lp_mercID) {
    // Implementation
    return libCamp_gv_tS_MercUnitType[(lp_mercID)];
}

text libCamp_gf_MercAvailablityText (int lp_mercID) {
    // Implementation
    return libCamp_gv_tS_MercAvailabilityText[(lp_mercID)];
}

text libCamp_gf_MercSpecialText (int lp_mercID) {
    // Implementation
    return libCamp_gv_tS_MercSpecialText[(lp_mercID)];
}

string libCamp_gf_MercPortraitModel (int lp_mercID) {
    // Implementation
    return libCamp_gv_tS_MercPortrait[(lp_mercID)];
}

string libCamp_gf_MercVideo (int lp_mercID) {
    // Implementation
    return libCamp_gv_tS_MercVideo[(lp_mercID)];
}

string libCamp_gf_MercUpgrade (int lp_mercID) {
    // Implementation
    return libCamp_gv_tS_MercUpgrade[(lp_mercID)];
}

bool libCamp_gf_MercStatusCheck (int lp_mercID, int lp_status) {
    // Implementation
    return (libCamp_gv_tSX_MercStatus[(lp_mercID)] == (lp_status));
}

int libCamp_gf_CostofPurchasedMerc () {
    int autoB964D864_i;

    // Variable Declarations
    int lv_indexMerc;
    int lv_cost;

    // Variable Initialization

    // Implementation
    lv_cost = 0;
    autoB964D864_i = libCamp_gv_TSC_MERC_FIRST;
    while (autoB964D864_i <= libCamp_gv_TSC_MERC_LAST) {
        lv_indexMerc = libCamp_gv_tS_MercID[autoB964D864_i];
        if ((libCamp_gf_MercStatusCheck(lv_indexMerc, 2) == true)) {
            lv_cost += libCamp_gf_MercCost(lv_indexMerc);
        }
        else {
        }
        autoB964D864_i = autoB964D864_i + 1;
    }
    return lv_cost;
}

abilcmd libCamp_gf_TS_MercAbilityCommand (int lp_mercID, int lp_index) {
    // Implementation
    return libCamp_gv_tS_MercAbilityCommands[(lp_mercID)][lp_index];
}

void libCamp_gf_SetMercStatus (int lp_mercID, int lp_status) {
    // Implementation
    libCamp_gv_tSX_MercStatus[(lp_mercID)] = (lp_status);
}

void libCamp_gf_TS_InitializeMercDataSingle (int lp_iD, text lp_name, text lp_description, int lp_cost, int lp_techSubgroup1, int lp_unitCount1, int lp_techSubgroup2, int lp_unitCount2, text lp_unitText, string lp_unitType, text lp_availabilityText, text lp_specialText, string lp_portrait, string lp_video, abilcmd lp_command1, abilcmd lp_command2, abilcmd lp_command3, string lp_upgrade, string lp_hiredImage, string lp_noCreditImage) {
    // Variable Declarations
    int lv_mercIndex;

    // Variable Initialization

    // Implementation
    lv_mercIndex = (lp_iD);
    libCamp_gv_tS_MercID[lv_mercIndex] = lp_iD;
    libCamp_gv_tS_MercNames[lv_mercIndex] = lp_name;
    libCamp_gv_tS_MercDescriptions[lv_mercIndex] = lp_description;
    libCamp_gv_tS_MercCost[lv_mercIndex] = lp_cost;
    libCamp_gv_tS_MercTechSubGroup[lv_mercIndex][1] = lp_techSubgroup1;
    libCamp_gv_tS_MercUnitCount[lv_mercIndex][1] = lp_unitCount1;
    libCamp_gv_tS_MercTechSubGroup[lv_mercIndex][2] = lp_techSubgroup2;
    libCamp_gv_tS_MercUnitCount[lv_mercIndex][2] = lp_unitCount2;
    libCamp_gv_tS_MercUnitText[lv_mercIndex] = lp_unitText;
    libCamp_gv_tS_MercUnitType[lv_mercIndex] = lp_unitType;
    libCamp_gv_tS_MercAvailabilityText[lv_mercIndex] = lp_availabilityText;
    libCamp_gv_tS_MercSpecialText[lv_mercIndex] = lp_specialText;
    libCamp_gv_tS_MercPortrait[lv_mercIndex] = lp_portrait;
    libCamp_gv_tS_MercVideo[lv_mercIndex] = lp_video;
    libCamp_gv_tSX_MercStatus[lv_mercIndex] = 0;
    libCamp_gv_tS_MercAbilityCommands[lv_mercIndex][1] = lp_command1;
    libCamp_gv_tS_MercAbilityCommands[lv_mercIndex][2] = lp_command2;
    libCamp_gv_tS_MercAbilityCommands[lv_mercIndex][3] = lp_command3;
    libCamp_gv_tS_MercUpgrade[lv_mercIndex] = lp_upgrade;
    libCamp_gv_tS_MercHiredImage[lv_mercIndex] = lp_hiredImage;
    libCamp_gv_tS_MercNoCreditImage[lv_mercIndex] = lp_noCreditImage;
}

void libCamp_gf_TS_InitializeMercData () {
    // Implementation
    libCamp_gf_TS_InitializeMercDataSingle(1, StringExternal("Param/Value/lib_Camp_5709963B"), StringExternal("Param/Value/lib_Camp_82484E1D"), 35000, 5, 4, 0, 0, StringExternal("Param/Value/lib_Camp_E6C595F8"), "WarPig", StringExternal("Param/Value/lib_Camp_86D8F734"), StringExternal("Param/Value/lib_Camp_84A6C943"), "MarineMercenaryPortrait", "Assets\\Textures\\merccontract_marines.ogv", AbilityCommand("SummonMercenaries", 0), null, null, "HireKelmorianMinersPH", "Assets\\Textures\\ui_mercenaries_marinemercenaryportrait_hired.dds", "Assets\\Textures\\ui_mercenaries_marinemercenaryportrait_nocredit.dds");
    libCamp_gf_TS_InitializeMercDataSingle(2, StringExternal("Param/Value/lib_Camp_641BF2D2"), StringExternal("Param/Value/lib_Camp_71DB1873"), 25000, 7, 2, 0, 0, StringExternal("Param/Value/lib_Camp_6C11495B"), "DevilDog", StringExternal("Param/Value/lib_Camp_75CAA55B"), StringExternal("Param/Value/lib_Camp_CB897CEB"), "FirebatMercenaryPortrait", "Assets\\Textures\\merccontract_firebats.ogv", AbilityCommand("SummonMercenaries", 1), null, null, "HireDevilDogsPH", "Assets\\Textures\\ui_mercenaries_firebatmercenaryportrait_hired.dds", "Assets\\Textures\\ui_mercenaries_firebatmercenaryportrait_nocredit.dds");
    libCamp_gf_TS_InitializeMercDataSingle(3, StringExternal("Param/Value/lib_Camp_C85BB3E4"), StringExternal("Param/Value/lib_Camp_85BC4731"), 30000, 8, 2, 0, 0, StringExternal("Param/Value/lib_Camp_79400908"), "HammerSecurity", StringExternal("Param/Value/lib_Camp_C371C7AB"), StringExternal("Param/Value/lib_Camp_8F80A835"), "MarauderMercenaryPortrait", "Assets\\Textures\\merccontract_marauders.ogv", AbilityCommand("SummonMercenaries", 3), null, null, "HireHammerSecuritiesPH", "Assets\\Textures\\ui_mercenaries_maraudermercenaryportrait_hired.dds", "Assets\\Textures\\ui_mercenaries_maraudermercenaryportrait_nocredit.dds");
    libCamp_gf_TS_InitializeMercDataSingle(4, StringExternal("Param/Value/lib_Camp_975FA3A7"), StringExternal("Param/Value/lib_Camp_B11498BE"), 40000, 12, 2, 0, 0, StringExternal("Param/Value/lib_Camp_28873B56"), "SpartanCompany", StringExternal("Param/Value/lib_Camp_5527506C"), StringExternal("Param/Value/lib_Camp_6EF98CCD"), "GoliathMercenaryPortrait", "Assets\\Textures\\merccontract_goliaths.ogv", AbilityCommand("SummonMercenaries", 2), null, null, "HireSpartanCompanyPH", "Assets\\Textures\\ui_mercenaries_goliathmercenaryportrait_hired.dds", "Assets\\Textures\\ui_mercenaries_goliathmercenaryportrait_nocredit.dds");
    libCamp_gf_TS_InitializeMercDataSingle(5, StringExternal("Param/Value/lib_Camp_B3664797"), StringExternal("Param/Value/lib_Camp_FDD5463C"), 45000, 14, 2, 0, 0, StringExternal("Param/Value/lib_Camp_6C8DF40F"), "SiegeBreaker", StringExternal("Param/Value/lib_Camp_F2644219"), StringExternal("Param/Value/lib_Camp_6254E3B0"), "SiegeTankMercenaryPortrait", "Assets\\Textures\\merccontract_siegetanks.ogv", AbilityCommand("SummonMercenaries", 4), null, null, "HireSiegeBreakersPH", "Assets\\Textures\\ui_mercenaries_siegetankmercenaryportrait_hired.dds", "Assets\\Textures\\ui_mercenaries_siegetankmercenaryportrait_nocredit.dds");
    libCamp_gf_TS_InitializeMercDataSingle(6, StringExternal("Param/Value/lib_Camp_058D22C6"), StringExternal("Param/Value/lib_Camp_43297AFD"), 45000, 17, 3, 0, 0, StringExternal("Param/Value/lib_Camp_BBF535E6"), "HelsAngelFighter", StringExternal("Param/Value/lib_Camp_5B8B623E"), StringExternal("Param/Value/lib_Camp_EF94B48A"), "VikingMercenaryFighterPortrait", "Assets\\Textures\\merccontract_viking.ogv", AbilityCommand("SummonMercenaries", 5), null, null, "HireHelsAngelsPH", "Assets\\Textures\\ui_mercenaries_vikingmercenaryfighterportrait_hired.dds", "Assets\\Textures\\ui_mercenaries_vikingmercenaryfighterportrait_nocredit.dds");
    libCamp_gf_TS_InitializeMercDataSingle(7, StringExternal("Param/Value/lib_Camp_7FEAD837"), StringExternal("Param/Value/lib_Camp_F2AE798E"), 60000, 18, 2, 0, 0, StringExternal("Param/Value/lib_Camp_D68DB969"), "DuskWing", StringExternal("Param/Value/lib_Camp_FC6F4FA1"), StringExternal("Param/Value/lib_Camp_E31332D4"), "BansheeMercenaryPortrait", "Assets\\Textures\\merccontract_banshees.ogv", AbilityCommand("SummonMercenaries", 6), null, null, "HireDuskWingPH", "Assets\\Textures\\ui_mercenaries_bansheemercenaryportrait_hired.dds", "Assets\\Textures\\ui_mercenaries_bansheemercenaryportrait_nocredit.dds");
    libCamp_gf_TS_InitializeMercDataSingle(8, StringExternal("Param/Value/lib_Camp_F8E5AF99"), StringExternal("Param/Value/lib_Camp_EA7988FC"), 80000, 19, 1, 0, 0, StringExternal("Param/Value/lib_Camp_75C95FB1"), "DukesRevenge", StringExternal("Param/Value/lib_Camp_AEF737CD"), StringExternal("Param/Value/lib_Camp_AA55AF0B"), "BattlecruiserMercenaryPortrait", "Assets\\Textures\\merccontract_battlecruisers.ogv", AbilityCommand("SummonMercenaries", 7), null, null, "HireDukesRevenge", "Assets\\Textures\\ui_mercenaries_battlecruisermercenaryportrait_hired.dds", "Assets\\Textures\\ui_mercenaries_battlecruisermercenaryportrait_nocredit.dds");
}

void libCamp_gf_TS_ResetMercData () {
    int auto76E5E1B9_i;

    // Variable Declarations
    int lv_indexMerc;

    // Variable Initialization

    // Implementation
    auto76E5E1B9_i = libCamp_gv_TSC_MERC_FIRST;
    while (auto76E5E1B9_i <= libCamp_gv_TSC_MERC_LAST) {
        lv_indexMerc = libCamp_gv_tS_MercID[auto76E5E1B9_i];
        libCamp_gf_SetMercStatus(lv_indexMerc, 0);
        auto76E5E1B9_i = auto76E5E1B9_i + 1;
    }
}

void libCamp_gf_TS_ApplyMercenaryTech (int lp_player) {
    int autoBF7CB687_i;
    int auto546E7D8E_ae;
    int auto546E7D8E_ai;

    // Variable Declarations
    int lv_indexMerc;
    bool lv_allowDisallow;
    int lv_abilityCommandIndex;

    // Variable Initialization
    lv_allowDisallow = true;

    // Implementation
    autoBF7CB687_i = libCamp_gv_TSC_MERC_FIRST;
    while (autoBF7CB687_i <= libCamp_gv_TSC_MERC_LAST) {
        lv_indexMerc = libCamp_gv_tS_MercID[autoBF7CB687_i];
        if ((libCamp_gf_MercStatusCheck(lv_indexMerc, 2) == true)) {
            lv_allowDisallow = true;
        }
        else {
            lv_allowDisallow = false;
        }
        auto546E7D8E_ae = libCamp_gv_TSC_MERC_LAST2;
        auto546E7D8E_ai = 1;
        lv_abilityCommandIndex = 1;
        for ( ; ( (auto546E7D8E_ai >= 0 && lv_abilityCommandIndex <= auto546E7D8E_ae) || (auto546E7D8E_ai <= 0 && lv_abilityCommandIndex >= auto546E7D8E_ae) ) ; lv_abilityCommandIndex += auto546E7D8E_ai ) {
            if ((libCamp_gf_TS_MercAbilityCommand(lv_indexMerc, lv_abilityCommandIndex) != null)) {
                TechTreeAbilityAllow(lp_player, libCamp_gf_TS_MercAbilityCommand(lv_indexMerc, lv_abilityCommandIndex), lv_allowDisallow);
            }
            else {
            }
        }
        if ((lv_allowDisallow == true)) {
            libCamp_gf_AddUnitTypeToUnitHelpPanel(libCamp_gf_MercUnitText2(lv_indexMerc), true, lp_player);
        }
        else {
        }
        autoBF7CB687_i = autoBF7CB687_i + 1;
    }
}

void libCamp_gf_TS_UpdateMercStatus () {
    int auto94ADC81C_i;
    int auto9CD7260A_ae;
    int auto9CD7260A_ai;

    // Variable Declarations
    int lv_indexMerc;
    bool lv_enabled;
    int lv_index;

    // Variable Initialization

    // Implementation
    auto94ADC81C_i = libCamp_gv_TSC_MERC_FIRST;
    while (auto94ADC81C_i <= libCamp_gv_TSC_MERC_LAST) {
        lv_indexMerc = libCamp_gv_tS_MercID[auto94ADC81C_i];
        lv_enabled = true;
        auto9CD7260A_ae = libCamp_gv_TSC_MERC_LAST22;
        auto9CD7260A_ai = 1;
        lv_index = 1;
        for ( ; ( (auto9CD7260A_ai >= 0 && lv_index <= auto9CD7260A_ae) || (auto9CD7260A_ai <= 0 && lv_index >= auto9CD7260A_ae) ) ; lv_index += auto9CD7260A_ai ) {
            if ((libCamp_gf_MercTechSubgroup(lv_indexMerc, lv_index) != 0) && (libCamp_gv_tS_TechGroupState[(libCamp_gf_MercTechSubgroup(lv_indexMerc, lv_index))] != c_purchaseCategoryStateEnabled)) {
                lv_enabled = false;
                break;
            }
            else {
            }
        }
        if ((lv_enabled == true)) {
            if ((libCamp_gf_MercStatusCheck(lv_indexMerc, 0) == true)) {
                libCamp_gf_SetMercStatus(lv_indexMerc, 3);
            }
            else {
            }
        }
        else {
            libCamp_gf_SetMercStatus(lv_indexMerc, 0);
        }
        auto94ADC81C_i = auto94ADC81C_i + 1;
    }
}

void libCamp_gf_TS_ApplyMercUpgrades (int lp_player) {
    int auto373D0882_i;
    int auto5DBA7D93_ae;
    int auto5DBA7D93_ai;

    // Variable Declarations
    int lv_indexMerc;
    bool lv_enabled;
    int lv_index;

    // Variable Initialization

    // Implementation
    auto373D0882_i = libCamp_gv_TSC_MERC_FIRST;
    while (auto373D0882_i <= libCamp_gv_TSC_MERC_LAST) {
        lv_indexMerc = libCamp_gv_tS_MercID[auto373D0882_i];
        lv_enabled = true;
        auto5DBA7D93_ae = libCamp_gv_TSC_MERC_LAST22;
        auto5DBA7D93_ai = 1;
        lv_index = 1;
        for ( ; ( (auto5DBA7D93_ai >= 0 && lv_index <= auto5DBA7D93_ae) || (auto5DBA7D93_ai <= 0 && lv_index >= auto5DBA7D93_ae) ) ; lv_index += auto5DBA7D93_ai ) {
            if ((libCamp_gf_MercTechSubgroup(lv_indexMerc, lv_index) != 0) && (libCamp_gv_tS_TechGroupState[(libCamp_gf_MercTechSubgroup(lv_indexMerc, lv_index))] != c_purchaseCategoryStateEnabled)) {
                lv_enabled = false;
                break;
            }
            else {
            }
        }
        if ((lv_enabled == true)) {
            libNtve_gf_SetUpgradeLevelForPlayer(lp_player, libCamp_gf_MercUpgrade(lv_indexMerc), 1);
        }
        else {
        }
        auto373D0882_i = auto373D0882_i + 1;
    }
}

void libCamp_gf_DisplayMercenaryPanel (trigger lp_exitCallback) {
    // Variable Declarations
    int lv_indexMerc;
    int lv_index;
    text lv_mercText;

    // Variable Initialization
    lv_mercText = StringExternal("Param/Value/lib_Camp_7218BEED");

    // Implementation
    libCamp_gv_tS_MercUIExitCallback = lp_exitCallback;
    libCamp_gf_TS_MercUIUpdateUI();
    libCamp_gf_TS_MercUIGift(1);
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeMercenaryPanel, true);
}

void libCamp_gf_TS_MercUIUpdateUI () {
    int autoA433EE21_i;
    int auto90A2DADE_val;
    int auto6EC12EBE_i;

    // Variable Declarations
    int lv_indexMerc;
    int lv_index;
    text lv_mercText;

    // Variable Initialization
    lv_mercText = StringExternal("Param/Value/lib_Camp_F6348700");

    // Implementation
    if ((libCamp_gv_tS_MercUICreated == false)) {
        libCamp_gv_tS_MercUICreated = true;
        autoA433EE21_i = libCamp_gv_TSC_MERC_FIRST;
        while (autoA433EE21_i <= libCamp_gv_TSC_MERC_LAST) {
            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));
            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));
            auto90A2DADE_val = lv_indexMerc;
            if (auto90A2DADE_val == 1) {
                MercenarySetScenePath(MercenaryLastCreated(), "Assets\\Textures\\merccontract_marines.ogv");
            }
            else if (auto90A2DADE_val == 3) {
                MercenarySetScenePath(MercenaryLastCreated(), "Assets\\Textures\\merccontract_marauders.ogv");
            }
            else if (auto90A2DADE_val == 2) {
                MercenarySetScenePath(MercenaryLastCreated(), "Assets\\Textures\\merccontract_firebats.ogv");
            }
            else {
            }
            autoA433EE21_i = autoA433EE21_i + 1;
        }
    }
    else {
    }
    auto6EC12EBE_i = libCamp_gv_TSC_MERC_FIRST;
    while (auto6EC12EBE_i <= libCamp_gv_TSC_MERC_LAST) {
        lv_indexMerc = libCamp_gv_tS_MercID[auto6EC12EBE_i];
        MercenarySetImageFilePath(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], null);
        MercenarySetModelLink(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], libCamp_gf_MercPortraitModel(lv_indexMerc));
        if ((libCamp_gf_MercStatusCheck(lv_indexMerc, 1) == 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)]);
                MercenarySetModelLink(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], "Invisible");
            }
            else {
            }
        }
        else if ((libCamp_gf_MercStatusCheck(lv_indexMerc, 3) == 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)]);
                MercenarySetModelLink(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], "Invisible");
            }
            else {
            }
        }
        else if ((libCamp_gf_MercStatusCheck(lv_indexMerc, 0) == true)) {
            MercenarySetState(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], c_mercenaryStateDisabled);
        }
        else if ((libCamp_gf_MercStatusCheck(lv_indexMerc, 2) == 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");
        }
        auto6EC12EBE_i = auto6EC12EBE_i + 1;
    }
}

void libCamp_gf_TS_MercUIGift (int lp_mercGifted) {
    // Implementation
    if ((lp_mercGifted == 0) && (libCamp_gf_MercStatusCheck(lp_mercGifted, 2) == true)) {
        return ;
    }
    else {
    }
    libCamp_gf_SetMercStatus(lp_mercGifted, 2);
    libCamp_gf_TS_AddRecentMerc(lp_mercGifted);
    MercenaryPurchase(libCamp_gv_tS_MercUIMercenaries[(lp_mercGifted)]);
}

void libCamp_gf_TS_BattleReportUpdate () {
    int auto4E600C23_i;
    int auto43C5E3A7_ae;
    int auto43C5E3A7_ai;
    int autoED3EE3A4_ae;
    int autoED3EE3A4_ai;
    int auto66C9F3E9_ae;
    int auto66C9F3E9_ai;
    int autoECD02CB4_val;
    int auto0F40DF3B_val;
    int auto5402E988_ae;
    int auto5402E988_ai;
    int auto54ACC2E0_i;

    // Variable Declarations
    int lv_indexMission;
    int lv_index;
    int lv_count;
    bool[81] lv_isMission;
    int[81] lv_missions;
    int[41] lv_missionCompleted;
    int lv_missionCompletedCount;
    int[81] lv_scenes;
    int lv_indexOuter;
    int lv_indexInner;
    bool lv_swapped;
    int lv_missionSwap;

    // Variable Initialization

    // Implementation
    if ((libCamp_gv_tS_BattleReportReady == true)) {
        return ;
    }
    else {
    }
    libCamp_gv_tS_BattleReportReady = true;
    lv_missionCompletedCount = 0;
    auto4E600C23_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto4E600C23_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto4E600C23_i];
        if (((libCamp_gf_MissionStatusCheck(lv_indexMission, 2) == true) || ((lv_indexMission == 16) && (libCamp_gf_MissionStatusCheck(26, 2) == true) && (libCamp_gf_StoryState(27) > 0)))) {
            lv_missionCompletedCount += 1;
            lv_missionCompleted[lv_missionCompletedCount] = lv_indexMission;
        }
        else {
        }
        auto4E600C23_i = auto4E600C23_i + 1;
    }
    auto43C5E3A7_ae = (lv_missionCompletedCount - 1);
    auto43C5E3A7_ai = 1;
    lv_indexOuter = 1;
    for ( ; ( (auto43C5E3A7_ai >= 0 && lv_indexOuter <= auto43C5E3A7_ae) || (auto43C5E3A7_ai <= 0 && lv_indexOuter >= auto43C5E3A7_ae) ) ; lv_indexOuter += auto43C5E3A7_ai ) {
        lv_swapped = false;
        autoED3EE3A4_ae = (lv_missionCompletedCount - lv_indexOuter);
        autoED3EE3A4_ai = 1;
        lv_indexInner = 1;
        for ( ; ( (autoED3EE3A4_ai >= 0 && lv_indexInner <= autoED3EE3A4_ae) || (autoED3EE3A4_ai <= 0 && lv_indexInner >= autoED3EE3A4_ae) ) ; lv_indexInner += autoED3EE3A4_ai ) {
            if ((libCamp_gf_MissionStatusAge(lv_missionCompleted[(lv_indexInner + 1)], 2) > libCamp_gf_MissionStatusAge(lv_missionCompleted[lv_indexInner], 2))) {
                lv_missionSwap = lv_missionCompleted[lv_indexInner];
                lv_missionCompleted[lv_indexInner] = lv_missionCompleted[(lv_indexInner + 1)];
                lv_missionCompleted[(lv_indexInner + 1)] = lv_missionSwap;
                lv_swapped = true;
            }
            else {
            }
        }
        if ((lv_swapped == false)) {
            break;
        }
        else {
        }
    }
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_858B87B2") + IntToText(lv_missionCompletedCount)), false);
    lv_count = 0;
    lv_count += 1;
    lv_isMission[lv_count] = false;
    lv_scenes[lv_count] = 19;
    lv_count += 1;
    lv_isMission[lv_count] = false;
    lv_scenes[lv_count] = 1;
    auto66C9F3E9_ae = lv_missionCompletedCount;
    auto66C9F3E9_ai = 1;
    lv_index = 1;
    for ( ; ( (auto66C9F3E9_ai >= 0 && lv_index <= auto66C9F3E9_ae) || (auto66C9F3E9_ai <= 0 && lv_index >= auto66C9F3E9_ae) ) ; lv_index += auto66C9F3E9_ai ) {
        autoECD02CB4_val = lv_missionCompleted[lv_index];
        if (autoECD02CB4_val == 22) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 18;
        }
        else if (autoECD02CB4_val == 26) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 16;
        }
        else if (autoECD02CB4_val == 7) {
            lv_count += 1;
            lv_isMission[lv_count] = true;
            lv_missions[lv_count] = 6;
            if ((libCamp_gf_TS_BattleReportMissionCompleted(6) == true)) {
                lv_count += 1;
                lv_isMission[lv_count] = false;
                lv_scenes[lv_count] = 8;
            }
            else {
            }
        }
        else if (autoECD02CB4_val == 11) {
            lv_count += 1;
            lv_isMission[lv_count] = true;
            lv_missions[lv_count] = 10;
            if ((libCamp_gf_TS_BattleReportMissionCompleted(10) == true)) {
                lv_count += 1;
                lv_isMission[lv_count] = false;
                lv_scenes[lv_count] = 9;
            }
            else {
            }
        }
        else if (autoECD02CB4_val == 28) {
            lv_count += 1;
            lv_isMission[lv_count] = true;
            lv_missions[lv_count] = 27;
        }
        else {
        }
        lv_count += 1;
        lv_isMission[lv_count] = true;
        lv_missions[lv_count] = lv_missionCompleted[lv_index];
        auto0F40DF3B_val = lv_missionCompleted[lv_index];
        if (auto0F40DF3B_val == 1) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 4;
        }
        else if (auto0F40DF3B_val == 3) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 5;
        }
        else if (auto0F40DF3B_val == 17) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 15;
        }
        else if (auto0F40DF3B_val == 18) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 3;
        }
        else if (auto0F40DF3B_val == 19) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 20;
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 10;
        }
        else if (auto0F40DF3B_val == 20) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 6;
        }
        else if (auto0F40DF3B_val == 21) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 7;
        }
        else if (auto0F40DF3B_val == 26) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 11;
        }
        else if (auto0F40DF3B_val == 27) {
            lv_count += 1;
            lv_isMission[lv_count] = true;
            lv_missions[lv_count] = 28;
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 17;
        }
        else if (auto0F40DF3B_val == 28) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 17;
        }
        else if (auto0F40DF3B_val == 29) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 21;
        }
        else if (auto0F40DF3B_val == 6) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 8;
            lv_count += 1;
            lv_isMission[lv_count] = true;
            lv_missions[lv_count] = 7;
            if ((libCamp_gf_TS_BattleReportMissionCompleted(7) == true)) {
                lv_count += 1;
                lv_isMission[lv_count] = false;
                lv_scenes[lv_count] = 13;
            }
            else {
            }
        }
        else if (auto0F40DF3B_val == 7) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 13;
        }
        else if (auto0F40DF3B_val == 10) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 9;
            lv_count += 1;
            lv_isMission[lv_count] = true;
            lv_missions[lv_count] = 11;
            if ((libCamp_gf_TS_BattleReportMissionCompleted(11) == true)) {
                lv_count += 1;
                lv_isMission[lv_count] = false;
                lv_scenes[lv_count] = 14;
            }
            else {
            }
        }
        else if (auto0F40DF3B_val == 11) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 14;
        }
        else if (auto0F40DF3B_val == 15) {
            lv_count += 1;
            lv_isMission[lv_count] = false;
            lv_scenes[lv_count] = 12;
        }
        else {
        }
    }
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_0D654D17") + IntToText(lv_count)), false);
    auto5402E988_ae = lv_count;
    auto5402E988_ai = 1;
    lv_index = 1;
    for ( ; ( (auto5402E988_ai >= 0 && lv_index <= auto5402E988_ae) || (auto5402E988_ai <= 0 && lv_index >= auto5402E988_ae) ) ; lv_index += auto5402E988_ai ) {
        if ((lv_isMission[lv_index] == true)) {
            libCamp_gf_TS_BattleReportAddMission(lv_missions[lv_index], c_battleReportStateCompleted, ((lv_count + 1) - lv_index));
            TriggerDebugOutput(1, (IntToText(lv_index) + StringExternal("Param/Value/lib_Camp_39F50B9E") + libCamp_gf_MissionNameInUpperCase(lv_missions[lv_index])), false);
        }
        else {
            libCamp_gf_TS_BattleReportAddScene(lv_scenes[lv_index], ((lv_count + 1) - lv_index));
            TriggerDebugOutput(1, (IntToText(lv_index) + StringExternal("Param/Value/lib_Camp_7BFD3F6C") + libCamp_gv_tS_SceneNames[(lv_scenes[lv_index])]), false);
        }
    }
    auto54ACC2E0_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto54ACC2E0_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto54ACC2E0_i];
        if ((libCamp_gf_MissionStatusCheck(lv_indexMission, 2) == false) && (lv_indexMission != 30) && ((lv_indexMission != 6) || (libCamp_gf_MissionStatusCheck(7, 2) == false)) && ((lv_indexMission != 7) || (libCamp_gf_MissionStatusCheck(6, 2) == false)) && ((lv_indexMission != 10) || (libCamp_gf_MissionStatusCheck(11, 2) == false)) && ((lv_indexMission != 11) || (libCamp_gf_MissionStatusCheck(10, 2) == false)) && ((lv_indexMission != 27) || (libCamp_gf_MissionStatusCheck(28, 2) == false)) && ((lv_indexMission != 28) || (libCamp_gf_MissionStatusCheck(27, 2) == false)) && ((lv_indexMission != 16) || (libCamp_gf_MissionStatusCheck(26, 2) == false) || (libCamp_gf_StoryState(27) == 0))) {
            libCamp_gf_TS_BattleReportAddMission(lv_indexMission, c_battleReportStateHidden, 0);
        }
        else {
        }
        auto54ACC2E0_i = auto54ACC2E0_i + 1;
    }
}

text libCamp_gf_TS_BattleReportFormatObjectives (int lp_mission) {
    int autoC17FB862_i;

    // Variable Declarations
    text lv_result;
    text lv_resultCompleted;
    text lv_resultDiscovered;
    text lv_resultUndiscovered;
    int lv_indexObj;

    // Variable Initialization
    lv_result = StringExternal("Param/Value/lib_Camp_0124F4C1");
    lv_resultCompleted = StringExternal("Param/Value/lib_Camp_2E68B7CE");
    lv_resultDiscovered = StringExternal("Param/Value/lib_Camp_D6A5B4A0");
    lv_resultUndiscovered = StringExternal("Param/Value/lib_Camp_5FA10621");

    // Implementation
    autoC17FB862_i = 1;
    while (autoC17FB862_i <= libCamp_gv_TSC_MISSIONOBJECTIVECOUNT) {
        if (libCamp_gv_tS_MissionObjectives[lp_mission][autoC17FB862_i] != 0) {
            lv_indexObj = libCamp_gv_tS_MissionObjectives[lp_mission][autoC17FB862_i];
            if ((libCamp_gf_MissionObjectiveStateCheck(lv_indexObj, 2) == true)) {
                lv_resultCompleted = (lv_resultCompleted + StringExternal("Param/Value/lib_Camp_5B0EDBCC") + libCamp_gf_MissionObjectiveName(lv_indexObj) + StringExternal("Param/Value/lib_Camp_DA804F5F") + StringExternal("Param/Value/lib_Camp_E58D633B") + StringExternal("Param/Value/lib_Camp_1EA77982"));
            }
            else if ((libCamp_gf_MissionObjectiveStateCheck(lv_indexObj, 1) == true)) {
                lv_resultDiscovered = (lv_resultDiscovered + StringExternal("Param/Value/lib_Camp_93EBC434") + libCamp_gf_MissionObjectiveName(lv_indexObj) + StringExternal("Param/Value/lib_Camp_9301E42D") + StringExternal("Param/Value/lib_Camp_13F0DB33") + StringExternal("Param/Value/lib_Camp_B3E383E8"));
            }
            else if ((libCamp_gf_MissionObjectiveStateCheck(lv_indexObj, 0) == true)) {
                lv_resultUndiscovered = (lv_resultUndiscovered + StringExternal("Param/Value/lib_Camp_2E204251") + StringExternal("Param/Value/lib_Camp_916333EC") + StringExternal("Param/Value/lib_Camp_769DAC78") + StringExternal("Param/Value/lib_Camp_3AC4D3FF"));
            }
        }
        autoC17FB862_i = autoC17FB862_i + 1;
    }
    lv_result = (lv_resultCompleted + lv_resultDiscovered + lv_resultUndiscovered);
    return lv_result;
}

text libCamp_gf_TS_BattleReportFormatBestTime (int lp_mission, int lp_difficulty) {
    // Variable Declarations
    text lv_result;

    // Variable Initialization
    lv_result = StringExternal("Param/Value/lib_Camp_94ECF50F");

    // Implementation
    lv_result = libCamp_gf_FormatTimeCampaign(libCamp_gf_MissionCompleteBestTime(lp_mission, lp_difficulty));
    lv_result = (StringExternal("Param/Value/lib_Camp_54775210") + StringExternal("Param/Value/lib_Camp_058AD239") + lv_result + StringExternal("Param/Value/lib_Camp_379EE81C"));
    return lv_result;
}

bool libCamp_gf_TS_BattleReportMissionCompleted (int lp_mission) {
    // Implementation
    if ((libCamp_gf_MissionStatusCheck(lp_mission, 2) == true)) {
        return true;
    }
    else {
    }
    if (((libCamp_gf_MissionDifficultyCompleted(lp_mission, 1) == true) || (libCamp_gf_MissionDifficultyCompleted(lp_mission, 2) == true) || (libCamp_gf_MissionDifficultyCompleted(lp_mission, 3) == true) || (libCamp_gf_MissionDifficultyCompleted(lp_mission, 4) == true))) {
        return true;
    }
    else {
    }
    return false;
}

void libCamp_gf_TS_BattleReportAddMission (int lp_mission, int lp_state, int lp_priority) {
    int autoFAD0F74B_ae;
    int autoFAD0F74B_ai;
    int auto0A8AEE93_i;

    // Variable Declarations
    int lv_index;
    int lv_indexMission;
    int lv_indexAchievement;
    int lv_indexObjective;
    int lv_bonus;
    int lv_bonusMax;
    int lv_researchPointZergMax;
    int lv_researchPointProtMax;
    int lv_researchPointZerg;
    int lv_researchPointProt;
    text lv_researchText;
    bool lv_missionCompleted;

    // Variable Initialization

    // Implementation
    lv_indexMission = (lp_mission);
    BattleReportCreate(PlayerGroupAll(), libCamp_gf_MissionNameInUpperCase(lp_mission), c_battleReportTypeMission, lp_state);
    libCamp_gv_tS_BattleReportMissions[lv_indexMission] = BattleReportLastCreated();
    BattleReportSetButtonImage(BattleReportLastCreated(), libCamp_gv_tS_MissionBattleReportIcon[(lp_mission)]);
    BattleReportSetMissionText(BattleReportLastCreated(), libCamp_gf_MissionNameInUpperCase(lp_mission));
    BattleReportSetMissionImage(BattleReportLastCreated(), libCamp_gv_tS_MissionBattleReportImage[(lp_mission)]);
    autoFAD0F74B_ae = libCamp_gv_tSC_MAXMAPACHIEVEMENT;
    autoFAD0F74B_ai = 1;
    lv_index = 1;
    for ( ; ( (autoFAD0F74B_ai >= 0 && lv_index <= autoFAD0F74B_ae) || (autoFAD0F74B_ai <= 0 && lv_index >= autoFAD0F74B_ae) ) ; lv_index += autoFAD0F74B_ai ) {
        if ((libCamp_gv_tS_MapAchievements[(lp_mission)][lv_index] != null)) {
            BattleReportAddAchievement(BattleReportLastCreated(), libCamp_gv_tS_MapAchievements[(lp_mission)][lv_index]);
        }
        else {
        }
    }
    auto0A8AEE93_i = 1;
    while (auto0A8AEE93_i <= libCamp_gv_TSC_MISSIONOBJECTIVECOUNT) {
        if (libCamp_gv_tS_MissionObjectives[lp_mission][auto0A8AEE93_i] != 0) {
            lv_indexObjective = libCamp_gv_tS_MissionObjectives[lp_mission][auto0A8AEE93_i];
            lv_bonus += libCamp_gf_MissionObjectiveRewardsEarned(lv_indexObjective);
            lv_bonusMax += (libCamp_gf_MissionObjectiveItemCount(lv_indexObjective) * libCamp_gf_MissionObjectiveCreditsPerItem(lv_indexObjective));
        }
        auto0A8AEE93_i = auto0A8AEE93_i + 1;
    }
    if ((lv_bonusMax > 0)) {
        BattleReportSetBonusTitle(BattleReportLastCreated(), StringExternal("Param/Value/lib_Camp_350E8EA1"));
        BattleReportSetBonusText(BattleReportLastCreated(), (StringExternal("Param/Value/lib_Camp_40F61B93") + libCamp_gf_FormatCredits(lv_bonus, true) + StringExternal("Param/Value/lib_Camp_C3ACEFBC") + libCamp_gf_FormatCredits(lv_bonusMax, true) + StringExternal("Param/Value/lib_Camp_CC270BAB")));
    }
    else {
        BattleReportSetBonusTitle(BattleReportLastCreated(), StringExternal("Param/Value/lib_Camp_30F8194A"));
        BattleReportSetBonusText(BattleReportLastCreated(), StringExternal("Param/Value/lib_Camp_C7183189"));
    }
    lv_researchPointZergMax = libCamp_gf_TS_StoryResearchMissionOpportunities(lp_mission, 2);
    lv_researchPointZergMax += libCamp_gf_TS_MissionRewardResearchPoints(lp_mission, 2);
    lv_researchPointProtMax = libCamp_gf_TS_StoryResearchMissionOpportunities(lp_mission, 1);
    lv_researchPointProtMax += libCamp_gf_TS_MissionRewardResearchPoints(lp_mission, 1);
    lv_researchPointZerg = libCamp_gf_StoryResearchMissionProgress(lp_mission, 2);
    lv_researchPointProt = libCamp_gf_StoryResearchMissionProgress(lp_mission, 1);
    if ((libCamp_gf_MissionStatusCheck(lp_mission, 2) == true)) {
        lv_researchPointZerg += libCamp_gf_TS_MissionRewardResearchPoints(lp_mission, 2);
        lv_researchPointProt += libCamp_gf_TS_MissionRewardResearchPoints(lp_mission, 1);
    }
    else {
    }
    if (((lv_researchPointZergMax > 0) || (lv_researchPointProtMax > 0))) {
        BattleReportSetResearchTitle(BattleReportLastCreated(), StringExternal("Param/Value/lib_Camp_CE047F63"));
        lv_researchText = StringExternal("Param/Value/lib_Camp_5D999348");
        if ((lv_researchPointZergMax > 0)) {
            lv_researchText = (lv_researchText + StringExternal("Param/Value/lib_Camp_D4749C57") + IntToText(lv_researchPointZerg) + StringExternal("Param/Value/lib_Camp_D3B16190") + IntToText(lv_researchPointZergMax) + StringExternal("Param/Value/lib_Camp_D5620D04") + StringExternal("Param/Value/lib_Camp_A8A249A6"));
            if ((lv_researchPointProtMax > 0)) {
                lv_researchText = (lv_researchText + StringExternal("Param/Value/lib_Camp_ABBF8DB2"));
            }
            else {
            }
        }
        else {
        }
        if ((lv_researchPointProtMax > 0)) {
            lv_researchText = (lv_researchText + StringExternal("Param/Value/lib_Camp_2D105E6B") + IntToText(lv_researchPointProt) + StringExternal("Param/Value/lib_Camp_413A4A21") + IntToText(lv_researchPointProtMax) + StringExternal("Param/Value/lib_Camp_02921D85") + StringExternal("Param/Value/lib_Camp_B13DB64B"));
        }
        else {
        }
        BattleReportSetResearchText(BattleReportLastCreated(), lv_researchText);
    }
    else {
    }
    BattleReportSetDifficultyLevelCompleted(BattleReportLastCreated(), 1, libCamp_gf_MissionDifficultyCompleted(lp_mission, 1));
    BattleReportSetDifficultyLevelCompleted(BattleReportLastCreated(), 2, libCamp_gf_MissionDifficultyCompleted(lp_mission, 2));
    BattleReportSetDifficultyLevelCompleted(BattleReportLastCreated(), 3, libCamp_gf_MissionDifficultyCompleted(lp_mission, 3));
    BattleReportSetDifficultyLevelCompleted(BattleReportLastCreated(), 4, libCamp_gf_MissionDifficultyCompleted(lp_mission, 4));
    BattleReportSetDifficultyLevelBestTimeText(BattleReportLastCreated(), 1, libCamp_gf_TS_BattleReportFormatBestTime(lp_mission, 1));
    BattleReportSetDifficultyLevelBestTimeText(BattleReportLastCreated(), 2, libCamp_gf_TS_BattleReportFormatBestTime(lp_mission, 2));
    BattleReportSetDifficultyLevelBestTimeText(BattleReportLastCreated(), 3, libCamp_gf_TS_BattleReportFormatBestTime(lp_mission, 3));
    BattleReportSetDifficultyLevelBestTimeText(BattleReportLastCreated(), 4, libCamp_gf_TS_BattleReportFormatBestTime(lp_mission, 4));
    BattleReportSetPriority(BattleReportLastCreated(), lp_priority);
    if (((lp_mission != 7) && (lp_mission != 11) && (lp_mission != 28) && ((lp_mission != 16) || (libCamp_gf_TS_BattleReportMissionCompleted(16) == true)))) {
        BattleReportSetShownInMissionTotal(BattleReportLastCreated(), true);
    }
    else {
        BattleReportSetShownInMissionTotal(BattleReportLastCreated(), false);
    }
}

void libCamp_gf_TS_BattleReportAddScene (int lp_scene, int lp_priority) {
    // Variable Declarations
    int lv_indexScene;

    // Variable Initialization

    // Implementation
    lv_indexScene = (lp_scene);
    if ((libCamp_gf_TS_GameFullyDownloaded() == false) && (lp_scene != 20) && (lp_scene != 18) && (lp_scene != 21) && (lp_scene != 19)) {
        TextExpressionSetToken("Param/Expression/lib_Camp_880903F1", "SCENENAME", libCamp_gv_tS_SceneNames[lv_indexScene]);
        BattleReportCreate(PlayerGroupAll(), TextExpressionAssemble("Param/Expression/lib_Camp_880903F1"), c_battleReportTypeScene, c_battleReportStateCompleted);
    }
    else {
        BattleReportCreate(PlayerGroupAll(), libCamp_gv_tS_SceneNames[lv_indexScene], c_battleReportTypeScene, c_battleReportStateCompleted);
    }
    libCamp_gv_tS_BattleReportScenes[lv_indexScene] = BattleReportLastCreated();
    BattleReportSetSceneImage(BattleReportLastCreated(), libCamp_gv_tS_SceneImages[lv_indexScene]);
    BattleReportSetButtonImage(BattleReportLastCreated(), libCamp_gv_tS_SceneIcon[lv_indexScene]);
    BattleReportSetSceneText(BattleReportLastCreated(), libCamp_gv_tS_SceneNames[lv_indexScene]);
    BattleReportSetPriority(BattleReportLastCreated(), lp_priority);
}

void libCamp_gf_TS_BattleReportHide () {
    // Implementation
    libCamp_gf_SetStoryState(23, (BattleReportPanelGetSelectedBattleReport(1)));
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeBattleReportPanel, false);
}

void libCamp_gf_DisplayBattleReport (trigger lp_sceneFinishCallback, trigger lp_leaveCallback) {
    int auto4CD770DA_i;
    int auto4728ED0A_i;

    // Variable Declarations
    int lv_mission;
    int lv_indexMission;
    int lv_scene;
    int lv_indexScene;

    // Variable Initialization

    // Implementation
    libCamp_gv_tS_BattleReportSceneFinishCallback = lp_sceneFinishCallback;
    libCamp_gv_tS_BattleReportPanelLeaveCallback = lp_leaveCallback;
    libCamp_gf_TS_BattleReportUpdate();
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeBattleReportPanel, true);
    if ((libCamp_gf_StoryState(23) > 0)) {
        lv_mission = 0;
        lv_scene = 0;
        auto4CD770DA_i = libCamp_gv_TSC_MISSION_FIRST;
        while (auto4CD770DA_i <= libCamp_gv_TSC_MISSION_LAST) {
            lv_indexMission = libCamp_gv_tS_MapID[auto4CD770DA_i];
            if (((libCamp_gv_tS_BattleReportMissions[(lv_indexMission)]) == libCamp_gf_StoryState(23))) {
                lv_mission = lv_indexMission;
                break;
            }
            else {
            }
            auto4CD770DA_i = auto4CD770DA_i + 1;
        }
        if ((lv_mission != 0)) {
            BattleReportPanelSetSelectedBattleReport(PlayerGroupAll(), libCamp_gv_tS_BattleReportMissions[(lv_mission)]);
        }
        else {
            auto4728ED0A_i = libCamp_gv_TSC_SCENE_FIRST;
            while (auto4728ED0A_i <= libCamp_gv_TSC_SCENE_LAST) {
                lv_indexScene = libCamp_gv_tS_SceneIDs[auto4728ED0A_i];
                if (((libCamp_gv_tS_BattleReportScenes[(lv_indexScene)]) == libCamp_gf_StoryState(23))) {
                    lv_scene = lv_indexScene;
                    break;
                }
                else {
                }
                auto4728ED0A_i = auto4728ED0A_i + 1;
            }
            if ((lv_scene != 0)) {
                BattleReportPanelSetSelectedBattleReport(PlayerGroupAll(), libCamp_gv_tS_BattleReportScenes[(lv_scene)]);
            }
            else {
            }
        }
    }
    else {
        BattleReportPanelSetSelectedBattleReport(PlayerGroupAll(), libCamp_gv_tS_BattleReportScenes[(1)]);
    }
}

void libCamp_gf_RefreshBattleReport () {
    int auto75A6E318_i;
    int autoC3AB5AB5_i;

    // Variable Declarations
    int lv_mission;
    int lv_indexMission;
    int lv_scene;
    int lv_indexScene;
    int lv_missionSelected;
    int lv_sceneSelected;

    // Variable Initialization

    // Implementation
    auto75A6E318_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto75A6E318_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto75A6E318_i];
        if ((libCamp_gv_tS_BattleReportMissions[(lv_indexMission)] != c_invalidBattleReportId)) {
            if (((libCamp_gv_tS_BattleReportMissions[(lv_indexMission)]) == libCamp_gf_StoryState(23))) {
                lv_missionSelected = lv_indexMission;
            }
            else {
            }
            BattleReportDestroy(libCamp_gv_tS_BattleReportMissions[(lv_indexMission)]);
            libCamp_gv_tS_BattleReportMissions[(lv_indexMission)] = c_invalidBattleReportId;
        }
        else {
        }
        auto75A6E318_i = auto75A6E318_i + 1;
    }
    autoC3AB5AB5_i = libCamp_gv_TSC_SCENE_FIRST;
    while (autoC3AB5AB5_i <= libCamp_gv_TSC_SCENE_LAST) {
        lv_indexScene = libCamp_gv_tS_SceneIDs[autoC3AB5AB5_i];
        if ((libCamp_gv_tS_BattleReportScenes[(lv_indexScene)] != c_invalidBattleReportId)) {
            if (((libCamp_gv_tS_BattleReportScenes[(lv_indexScene)]) == libCamp_gf_StoryState(23))) {
                lv_sceneSelected = lv_indexScene;
            }
            else {
            }
            BattleReportDestroy(libCamp_gv_tS_BattleReportScenes[(lv_indexScene)]);
            libCamp_gv_tS_BattleReportScenes[(lv_indexScene)] = c_invalidBattleReportId;
        }
        else {
        }
        autoC3AB5AB5_i = autoC3AB5AB5_i + 1;
    }
    libCamp_gv_tS_BattleReportReady = false;
    libCamp_gf_TS_BattleReportUpdate();
    libCamp_gf_SetStoryState(23, (c_invalidBattleReportId));
    if ((lv_missionSelected != 0)) {
        libCamp_gf_SetStoryState(23, (libCamp_gv_tS_BattleReportMissions[(lv_missionSelected)]));
    }
    else {
    }
    if ((lv_sceneSelected != 0)) {
        libCamp_gf_SetStoryState(23, (libCamp_gv_tS_BattleReportScenes[(lv_sceneSelected)]));
    }
    else {
    }
}

bool libCamp_gf_TS_GameFullyDownloaded () {
    // Implementation
    return GameDataIsFullyDownloaded(1);
}

void libCamp_gf_RegisterMissionDebriefingCallback (int lp_mission, trigger lp_callback) {
    // Implementation
    libCamp_gv_tS_MissionDebriefingCallbacks[(lp_mission)] = lp_callback;
}

trigger libCamp_gf_MissionDebriefingCallback (int lp_mission) {
    // Implementation
    return libCamp_gv_tS_MissionDebriefingCallbacks[(lp_mission)];
}

bool libCamp_gf_MissionObjectiveStateCheck (int lp_objective, int lp_state) {
    // Implementation
    return (libCamp_gv_tSX_MissionObjState[(lp_objective)] == (lp_state));
}

bool libCamp_gf_MissionObjectiveIsPrimary (int lp_objective) {
    // Implementation
    return libCamp_gv_tSX_MissionObjIsPrimary[(lp_objective)];
}

text libCamp_gf_MissionObjectiveName (int lp_objective) {
    // Implementation
    return libCamp_gv_tSX_MissionObjName[(lp_objective)];
}

int libCamp_gf_MissionObjectiveMap (int lp_objective) {
    // Implementation
    return libCamp_gv_tS_MissionObjMap[(lp_objective)];
}

int libCamp_gf_MissionObjectiveRewardsEarned (int lp_objective) {
    // Implementation
    if ((libCamp_gf_MissionStatusCheck(libCamp_gf_MissionObjectiveMap(lp_objective), 2) == true)) {
        return (libCamp_gf_MissionObjectiveProgress(lp_objective) * libCamp_gf_MissionObjectiveCreditsPerItem(lp_objective));
    }
    else {
    }
    return 0;
}

int libCamp_gf_MissionObjectiveRewardsEarnedLastMission () {
    // Implementation
    return libCamp_gv_tSX_MissionObjRewardsEarnedCurrent;
}

int libCamp_gf_MissionObjectiveItemCount (int lp_objective) {
    // Implementation
    return FixedToInt(ConversationDataStateFixedValue(libCamp_gf_TS_MissionObjectiveConvoID(lp_objective), "Item Count"));
}

int libCamp_gf_MissionObjectiveCreditsPerItem (int lp_objective) {
    // Implementation
    return FixedToInt(ConversationDataStateFixedValue(libCamp_gf_TS_MissionObjectiveConvoID(lp_objective), "Credits Per Item"));
}

int libCamp_gf_MissionObjectiveProgress (int lp_objective) {
    // Implementation
    return ConversationDataStateGetValue(libCamp_gv_tS_MissionObjConvoID[(lp_objective)]);
}

bool libCamp_gf_TS_AllObjectivesCompletedForMission (int lp_mission) {
    int auto4FE66050_i;

    // Variable Declarations
    int lv_obj;

    // Variable Initialization

    // Implementation
    auto4FE66050_i = 1;
    while (auto4FE66050_i <= libCamp_gv_TSC_MISSIONOBJECTIVECOUNT) {
        if (libCamp_gv_tS_MissionObjectives[lp_mission][auto4FE66050_i] != 0) {
            lv_obj = libCamp_gv_tS_MissionObjectives[lp_mission][auto4FE66050_i];
            if ((ObjectiveGetState(libCamp_gv_tS_MissionObjObjective[(lv_obj)]) != c_objectiveStateCompleted)) {
                return false;
            }
            else {
            }
        }
        auto4FE66050_i = auto4FE66050_i + 1;
    }
    return true;
}

string libCamp_gf_TS_MissionObjectiveConvoID (int lp_objective) {
    // Variable Declarations
    int lv_obj;

    // Variable Initialization

    // Implementation
    return libCamp_gv_tS_MissionObjConvoID[(lp_objective)];
}

void libCamp_gf_RegisterMissionObjective (int lp_objectiveID, int lp_objective, text lp_objectiveName) {
    // Variable Declarations
    int lv_objIndex;

    // Variable Initialization

    // Implementation
    lv_objIndex = (lp_objectiveID);
    libCamp_gv_tS_MissionObjObjective[lv_objIndex] = lp_objective;
    libCamp_gv_tSX_MissionObjName[lv_objIndex] = lp_objectiveName;
    libCamp_gv_tSX_MissionObjIsPrimary[lv_objIndex] = ObjectiveGetPrimary(lp_objective);
}

void libCamp_gf_SetMissionObjectiveState (int lp_objective, int lp_state) {
    // Implementation
    libCamp_gv_tSX_MissionObjState[(lp_objective)] = (lp_state);
}

void libCamp_gf_SetMissionObjectiveProgress (int lp_objective, int lp_progress) {
    // Implementation
    ConversationDataStateSetValue(libCamp_gf_TS_MissionObjectiveConvoID(lp_objective), lp_progress);
}

void libCamp_gf_AddProgressToStoryObjective (int lp_progress, int lp_objective) {
    int autoBD9E28D6_i;

    // Variable Declarations
    int lv_indexObjective;
    int lv_rewardsOld;
    int lv_rewardsNew;

    // Variable Initialization

    // Implementation
    libCamp_gv_tS_MissionObjProgressCurrent[(lp_objective)] += lp_progress;
    autoBD9E28D6_i = libCamp_gv_TSC_OBJECTIVE_FIRST;
    while (autoBD9E28D6_i <= libCamp_gv_TSC_OBJECTIVE_LAST) {
        lv_indexObjective = libCamp_gv_tS_MissionObjIDs[autoBD9E28D6_i];
        if ((libCamp_gf_MissionObjectiveMap(lv_indexObjective) == libCamp_gv_tS_CurrentMap)) {
            lv_rewardsOld += (libCamp_gv_tS_NonSnapShotObjectiveProgress[(lv_indexObjective)] * libCamp_gf_MissionObjectiveCreditsPerItem(lv_indexObjective));
            lv_rewardsNew += (libCamp_gv_tS_MissionObjProgressCurrent[(lv_indexObjective)] * libCamp_gf_MissionObjectiveCreditsPerItem(lv_indexObjective));
        }
        else {
        }
        autoBD9E28D6_i = autoBD9E28D6_i + 1;
    }
    libCamp_gv_tSX_MissionObjRewardsEarnedCurrent = (lv_rewardsNew - lv_rewardsOld);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_96D015C4") + IntToText(lv_rewardsNew) + StringExternal("Param/Value/lib_Camp_7F31FEC5") + IntToText(lv_rewardsOld) + StringExternal("Param/Value/lib_Camp_C2965B18") + IntToText(libCamp_gv_tSX_MissionObjRewardsEarnedCurrent) + StringExternal("Param/Value/lib_Camp_E042403A")), false);
    if ((libCamp_gv_tSX_MissionObjRewardsEarnedCurrent < 0)) {
        libCamp_gv_tSX_MissionObjRewardsEarnedCurrent = 0;
    }
    else {
    }
    if ((libCamp_gv_tSX_MissionObjRewardsEarnedCurrent > 0)) {
        libCamp_gf_SetMissionObjectiveProgress(lp_objective, libCamp_gv_tS_MissionObjProgressCurrent[(lp_objective)]);
    }
    else {
    }
}

void libCamp_gf_TS_InitializeMissionObjectiveDataSingle (int lp_obj, int lp_map, string lp_convoID) {
    int autoA768C5C4_ae;
    int autoA768C5C4_ai;

    // Variable Declarations
    int lv_objIndex;
    int lv_mapIndex;
    int lv_missionObjIndex;

    // Variable Initialization

    // Implementation
    lv_objIndex = (lp_obj);
    libCamp_gv_tS_MissionObjIDs[lv_objIndex] = lp_obj;
    libCamp_gv_tS_MissionObjMap[lv_objIndex] = lp_map;
    libCamp_gv_tS_MissionObjConvoID[lv_objIndex] = lp_convoID;
    libCamp_gv_tSX_MissionObjName[lv_objIndex] = null;
    libCamp_gv_tSX_MissionObjIsPrimary[lv_objIndex] = false;
    lv_mapIndex = (lp_map);
    autoA768C5C4_ae = libCamp_gv_TSC_MISSIONOBJECTIVECOUNT;
    autoA768C5C4_ai = 1;
    lv_missionObjIndex = 1;
    for ( ; ( (autoA768C5C4_ai >= 0 && lv_missionObjIndex <= autoA768C5C4_ae) || (autoA768C5C4_ai <= 0 && lv_missionObjIndex >= autoA768C5C4_ae) ) ; lv_missionObjIndex += autoA768C5C4_ai ) {
        if ((libCamp_gv_tS_MissionObjectives[lv_mapIndex][lv_missionObjIndex] == 0)) {
            libCamp_gv_tS_MissionObjectives[lv_mapIndex][lv_missionObjIndex] = lp_obj;
            break;
        }
        else {
        }
    }
}

void libCamp_gf_TS_InitializeMissionObjectiveData () {
    // Implementation
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(1, 1, "MissionObjective|TRaynor01_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(2, 1, "MissionObjective|TRaynor01_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(3, 2, "MissionObjective|TRaynor02_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(4, 2, "MissionObjective|TRaynor02_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(5, 3, "MissionObjective|TRaynor03_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(6, 3, "MissionObjective|TRaynor03_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(7, 4, "MissionObjective|THanson01_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(8, 4, "MissionObjective|THanson01_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(9, 4, "MissionObjective|THanson01_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(10, 4, "MissionObjective|THanson01_4");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(11, 5, "MissionObjective|THanson02_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(12, 5, "MissionObjective|THanson02_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(13, 6, "MissionObjective|THanson03A_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(14, 6, "MissionObjective|THanson03A_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(15, 6, "MissionObjective|THanson03A_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(16, 6, "MissionObjective|THanson03A_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(17, 6, "MissionObjective|THanson03A_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(18, 7, "MissionObjective|THanson03B_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(19, 8, "MissionObjective|TTosh01_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(20, 8, "MissionObjective|TTosh01_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(21, 8, "MissionObjective|TTosh01_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(22, 9, "MissionObjective|TTosh02_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(23, 9, "MissionObjective|TTosh02_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(24, 9, "MissionObjective|TTosh02_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(25, 10, "MissionObjective|TTosh03A_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(26, 10, "MissionObjective|TTosh03A_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(27, 10, "MissionObjective|TTosh03A_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(28, 10, "MissionObjective|TTosh03A_4");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(29, 11, "MissionObjective|TTosh03B_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(30, 11, "MissionObjective|TTosh03B_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(31, 11, "MissionObjective|TTosh03B_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(33, 11, "MissionObjective|TTosh03B_5");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(32, 11, "MissionObjective|TTosh03B_4");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(34, 12, "MissionObjective|THorner01_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(35, 12, "MissionObjective|THorner01_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(36, 12, "MissionObjective|THorner01_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(37, 12, "MissionObjective|THorner01_4");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(38, 13, "MissionObjective|THorner02_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(39, 13, "MissionObjective|THorner02_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(40, 13, "MissionObjective|THorner02_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(41, 14, "MissionObjective|THorner03_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(42, 14, "MissionObjective|THorner03_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(43, 14, "MissionObjective|THorner03_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(44, 14, "MissionObjective|THorner03_4");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(45, 14, "MissionObjective|THorner03_5");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(46, 14, "MissionObjective|THorner03_6");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(47, 15, "MissionObjective|THorner04_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(48, 15, "MissionObjective|THorner04_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(49, 15, "MissionObjective|THorner04_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(50, 16, "MissionObjective|THorner05_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(51, 16, "MissionObjective|THorner05_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(52, 16, "MissionObjective|THorner05_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(53, 16, "MissionObjective|THorner05_4");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(54, 16, "MissionObjective|THorner05_5");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(55, 16, "MissionObjective|THorner05_6");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(56, 17, "MissionObjective|TTychus01_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(57, 17, "MissionObjective|TTychus01_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(59, 18, "MissionObjective|TTychus02_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(60, 18, "MissionObjective|TTychus02_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(61, 18, "MissionObjective|TTychus02_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(62, 18, "MissionObjective|TTychus02_4");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(63, 19, "MissionObjective|TTychus03_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(64, 19, "MissionObjective|TTychus03_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(65, 19, "MissionObjective|TTychus03_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(66, 20, "MissionObjective|TTychus04_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(67, 20, "MissionObjective|TTychus04_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(68, 20, "MissionObjective|TTychus04_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(69, 21, "MissionObjective|TTychus05_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(70, 21, "MissionObjective|TTychus05_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(71, 21, "MissionObjective|TTychus05_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(72, 21, "MissionObjective|TTychus05_4");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(73, 22, "MissionObjective|TZeratul01_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(74, 22, "MissionObjective|TZeratul01_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(75, 22, "MissionObjective|TZeratul01_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(76, 22, "MissionObjective|TZeratul01_4");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(77, 23, "MissionObjective|TZeratul02_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(78, 23, "MissionObjective|TZeratul02_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(79, 23, "MissionObjective|TZeratul02_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(80, 24, "MissionObjective|TZeratul03_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(81, 24, "MissionObjective|TZeratul03_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(83, 24, "MissionObjective|TZeratul03_4");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(82, 24, "MissionObjective|TZeratul03_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(84, 25, "MissionObjective|TZeratul04_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(85, 25, "MissionObjective|TZeratul04_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(86, 25, "MissionObjective|TZeratul04_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(87, 26, "MissionObjective|TValerian01_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(88, 26, "MissionObjective|TValerian01_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(90, 26, "MissionObjective|TValerian01_4");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(89, 26, "MissionObjective|TValerian01_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(91, 27, "MissionObjective|TValerian02A_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(92, 27, "MissionObjective|TValerian02A_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(93, 28, "MissionObjective|TValerian02B_1");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(94, 28, "MissionObjective|TValerian02B_2");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(95, 28, "MissionObjective|TValerian02B_3");
    libCamp_gf_TS_InitializeMissionObjectiveDataSingle(96, 29, "MissionObjective|TValerian03_1");
}

void libCamp_gf_TS_UpdateMissionObjectives () {
    int autoA2BA8FCC_i;
    int auto5A9BDEA2_val;

    // Variable Declarations
    int lv_obj;
    int lv_objective;

    // Variable Initialization
    lv_objective = c_invalidObjectiveId;

    // Implementation
    autoA2BA8FCC_i = 1;
    while (autoA2BA8FCC_i <= libCamp_gv_TSC_MISSIONOBJECTIVECOUNT) {
        if (libCamp_gv_tS_MissionObjectives[libCamp_gv_tS_CurrentMap][autoA2BA8FCC_i] != 0) {
            lv_obj = libCamp_gv_tS_MissionObjectives[libCamp_gv_tS_CurrentMap][autoA2BA8FCC_i];
            lv_objective = libCamp_gv_tS_MissionObjObjective[(lv_obj)];
            if ((lv_objective != c_invalidObjectiveId)) {
                libCamp_gv_tSX_MissionObjIsPrimary[(lv_obj)] = ObjectiveGetPrimary(lv_objective);
                auto5A9BDEA2_val = ObjectiveGetState(lv_objective);
                if (auto5A9BDEA2_val == c_objectiveStateActive) {
                    if ((libCamp_gf_MissionObjectiveStateCheck(lv_obj, 0) == true)) {
                        libCamp_gf_SetMissionObjectiveState(lv_obj, 1);
                    }
                    else {
                    }
                }
                else if (auto5A9BDEA2_val == c_objectiveStateFailed) {
                    if ((libCamp_gf_MissionObjectiveStateCheck(lv_obj, 0) == true)) {
                        libCamp_gf_SetMissionObjectiveState(lv_obj, 1);
                    }
                    else {
                    }
                }
                else if (auto5A9BDEA2_val == c_objectiveStateCompleted) {
                    if ((libCamp_gf_MissionObjectiveStateCheck(lv_obj, 2) == false)) {
                        libCamp_gf_SetMissionObjectiveState(lv_obj, 2);
                    }
                    else {
                    }
                }
                else {
                }
            }
            else {
            }
        }
        autoA2BA8FCC_i = autoA2BA8FCC_i + 1;
    }
}

text libCamp_gf_StoryResearchName (int lp_researchID) {
    // Implementation
    return ConversationDataStateName(libCamp_gv_tS_ResearchConvoID[(lp_researchID)]);
}

text libCamp_gf_StoryResearchDescription (int lp_researchID) {
    // Implementation
    return ConversationDataStateText(libCamp_gv_tS_ResearchConvoID[(lp_researchID)], ("Description"));
}

int libCamp_gf_StoryResearchCategory (int lp_researchID) {
    int auto44255F66_val;

    // Implementation
    auto44255F66_val = FixedToInt(ConversationDataStateFixedValue(libCamp_gv_tS_ResearchConvoID[(lp_researchID)], ("Category")));
    if (auto44255F66_val == (1)) {
        return 1;
    }
    else if (auto44255F66_val == (2)) {
        return 2;
    }
    else {
        return 0;
    }
}

string libCamp_gf_StoryResearchIcon (int lp_researchID) {
    // Implementation
    return ConversationDataStateImagePath(libCamp_gv_tS_ResearchConvoID[(lp_researchID)]);
}

text libCamp_gf_StoryResearchTooltip (int lp_researchID) {
    // Implementation
    return ConversationDataStateText(libCamp_gv_tS_ResearchConvoID[(lp_researchID)], ("Tooltip"));
}

text libCamp_gf_StoryResearchConfirmationText (int lp_researchID) {
    // Implementation
    return ConversationDataStateText(libCamp_gv_tS_ResearchConvoID[(lp_researchID)], ("Confirmation"));
}

string libCamp_gf_StoryResearchMovie (int lp_researchID) {
    // Implementation
    return ConversationDataStateMoviePath(libCamp_gv_tS_ResearchConvoID[(lp_researchID)]);
}

int libCamp_gf_StoryResearchLevelRequirement (int lp_researchID) {
    // Implementation
    return FixedToInt(ConversationDataStateFixedValue(libCamp_gv_tS_ResearchConvoID[(lp_researchID)], ("Required Level")));
}

int libCamp_gf_StoryResearchMissionObject (int lp_missionID) {
    // Implementation
    return libCamp_gv_tS_ResearchMissionObjects[(lp_missionID)][0];
}

int libCamp_gf_StoryResearchMissionProgress (int lp_missionID, int lp_researchCat) {
    // Implementation
    return libCamp_gv_tSX_ResearchMissionProgress[(lp_missionID)][(lp_researchCat)];
}

bool libCamp_gf_StoryResearchStateCheck (int lp_researchID, int lp_state) {
    // Implementation
    return (libCamp_gv_tSX_ResearchState[(lp_researchID)] == (lp_state));
}

int libCamp_gf_StoryResearchPoints (int lp_categeory) {
    int auto541A273F_val;
    int auto13201A47_i;

    // Variable Declarations
    int lv_indexMission;
    int lv_points;

    // Variable Initialization

    // Implementation
    auto541A273F_val = lp_categeory;
    if (auto541A273F_val == 1) {
        lv_points = FixedToInt(ConversationDataStateFixedValue("LabResearchConstants|ResearchStartPointProt", "Value"));
    }
    else if (auto541A273F_val == 2) {
        lv_points = FixedToInt(ConversationDataStateFixedValue("LabResearchConstants|ResearchStartPointZerg", "Value"));
    }
    else {
    }
    auto13201A47_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto13201A47_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto13201A47_i];
        if ((libCamp_gf_MissionStatusCheck(lv_indexMission, 2) == true)) {
            lv_points += (libCamp_gf_StoryResearchMissionProgress(lv_indexMission, lp_categeory) * 1);
            lv_points += libCamp_gf_TS_MissionRewardResearchPoints(lv_indexMission, lp_categeory);
        }
        else {
        }
        auto13201A47_i = auto13201A47_i + 1;
    }
    lv_points += libCamp_gv_tSX_DebugResearchLevel[(lp_categeory)];
    return lv_points;
}

int libCamp_gf_StoryResearchPointsOld (int lp_categeory) {
    // Implementation
    return libCamp_gv_tSX_ResearchPointsOld[(lp_categeory)];
}

int libCamp_gf_StoryResearchPointsConverted (int lp_categeory) {
    // Implementation
    return libCamp_gv_tSX_ResearchPointsConverted[(lp_categeory)];
}

int libCamp_gf_StoryResearchPointCap (int lp_categeory) {
    int autoC9E12BFB_val;

    // Implementation
    autoC9E12BFB_val = lp_categeory;
    if (autoC9E12BFB_val == 1) {
        return FixedToInt(ConversationDataStateFixedValue("LabResearchConstants|ResearchPointCapProt", "Value"));
    }
    else if (autoC9E12BFB_val == 2) {
        return FixedToInt(ConversationDataStateFixedValue("LabResearchConstants|ResearchPointCapZerg", "Value"));
    }
    else {
    }
    return 0;
}

int libCamp_gf_StoryResearchCreditsPerPoint () {
    // Implementation
    return FixedToInt(ConversationDataStateFixedValue("LabResearchConstants|ResearchPointToCredits", "Value"));
}

int libCamp_gf_TS_StoryResearchUIItem (int lp_researchID) {
    // Implementation
    return libCamp_gv_tS_ResearchUIItem[(lp_researchID)];
}

string libCamp_gf_TS_StoryResearchRewardUpgrade1 (int lp_researchID) {
    // Implementation
    return ConversationDataStateUpgrade(libCamp_gv_tS_ResearchConvoID[(lp_researchID)], ("Upgrade 1"));
}

string libCamp_gf_TS_StoryResearchRewardUpgrade2 (int lp_researchID) {
    // Implementation
    return ConversationDataStateUpgrade(libCamp_gv_tS_ResearchConvoID[(lp_researchID)], ("Upgrade 2"));
}

abilcmd libCamp_gf_TS_StoryResearchRewardAC1 (int lp_researchID) {
    // Implementation
    return ConversationDataStateAbilCmd(libCamp_gv_tS_ResearchConvoID[(lp_researchID)], ("Ability Command 1"));
}

abilcmd libCamp_gf_TS_StoryResearchRewardAC2 (int lp_researchID) {
    // Implementation
    return ConversationDataStateAbilCmd(libCamp_gv_tS_ResearchConvoID[(lp_researchID)], ("Ability Command 2"));
}

int libCamp_gf_TS_StoryResearchMissionProgressCurrent (int lp_categeory) {
    // Implementation
    return libCamp_gv_tS_ResearchMissionProgressCurrent[(lp_categeory)];
}

int libCamp_gf_TS_StoryResearchMissionObject (int lp_mission, int lp_index) {
    // Implementation
    return libCamp_gv_tS_ResearchMissionObjects[(lp_mission)][lp_index];
}

int libCamp_gf_TS_StoryResearchMissionObjectCount (int lp_mission, int lp_index) {
    // Implementation
    return libCamp_gv_tS_ResearchMissionObjectCount[(lp_mission)][lp_index];
}

int libCamp_gf_TS_StoryResearchMissionMainObjectiveReward (int lp_mission, int lp_category) {
    int auto3A04085F_val;
    int auto9A5FAA69_val;
    int auto6617D391_val;
    int autoB6F34D5E_val;
    int autoFC748367_val;

    // Variable Declarations
    int lv_index;
    int lv_point;

    // Variable Initialization

    // Implementation
    auto3A04085F_val = lp_mission;
    if (auto3A04085F_val == 22) {
        auto9A5FAA69_val = lp_category;
        if (auto9A5FAA69_val == 1) {
            return 3;
        }
        else {
        }
    }
    else if (auto3A04085F_val == 23) {
        auto6617D391_val = lp_category;
        if (auto6617D391_val == 2) {
            return 3;
        }
        else {
        }
    }
    else if (auto3A04085F_val == 24) {
        autoB6F34D5E_val = lp_category;
        if (autoB6F34D5E_val == 2) {
            return 4;
        }
        else {
        }
    }
    else if (auto3A04085F_val == 25) {
        autoFC748367_val = lp_category;
        if (autoFC748367_val == 2) {
            return 3;
        }
        else {
        }
    }
    else {
    }
    return 0;
}

int libCamp_gf_TS_StoryResearchMissionOpportunities (int lp_mission, int lp_category) {
    int autoE5F8F0D5_ae;
    int autoE5F8F0D5_ai;

    // Variable Declarations
    int lv_index;
    int lv_point;

    // Variable Initialization

    // Implementation
    lv_point = 0;
    autoE5F8F0D5_ae = 2;
    autoE5F8F0D5_ai = 1;
    lv_index = 1;
    for ( ; ( (autoE5F8F0D5_ai >= 0 && lv_index <= autoE5F8F0D5_ae) || (autoE5F8F0D5_ai <= 0 && lv_index >= autoE5F8F0D5_ae) ) ; lv_index += autoE5F8F0D5_ai ) {
        lv_point += (libCamp_gf_StoryResearchObjectReward(libCamp_gf_TS_StoryResearchMissionObject(lp_mission, lv_index), lp_category) * libCamp_gf_TS_StoryResearchMissionObjectCount(lp_mission, lv_index));
    }
    lv_point += libCamp_gf_TS_StoryResearchMissionMainObjectiveReward(lp_mission, lp_category);
    return lv_point;
}

int libCamp_gf_TS_StoryResearchTier (int lp_research) {
    // Implementation
    return (libCamp_gf_StoryResearchLevelRequirement(lp_research) / libCamp_gv_tSC_RESEARCH_TIERLEVEL);
}

int libCamp_gf_TS_StoryResearchSlot (int lp_research) {
    // Implementation
    return libCamp_gv_tS_ResearchSlot[(lp_research)];
}

int libCamp_gf_TS_StoryResearchTheOtherOfTheSameTier (int lp_research) {
    // Variable Declarations
    int lv_catIndex;
    int lv_tierIndex;
    int lv_slotIndex;

    // Variable Initialization

    // Implementation
    lv_catIndex = (libCamp_gf_StoryResearchCategory(lp_research));
    lv_tierIndex = libCamp_gf_TS_StoryResearchTier(lp_research);
    lv_slotIndex = libCamp_gf_TS_StoryResearchSlot(lp_research);
    return libCamp_gv_tS_ResearchIDInUIStructure[lv_catIndex][lv_tierIndex][(3 - lv_slotIndex)];
}

int libCamp_gf_StoryResearchObjectReward (int lp_researchObject, int lp_category) {
    int autoA068D31A_val;

    // Variable Declarations
    string lv_name;

    // Variable Initialization
    lv_name = "";

    // Implementation
    autoA068D31A_val = lp_category;
    if (autoA068D31A_val == 1) {
        lv_name = "RewardProtoss";
    }
    else if (autoA068D31A_val == 2) {
        lv_name = "RewardZerg";
    }
    else {
    }
    return FixedToInt(ConversationDataStateFixedValue(libCamp_gv_tS_ResearchObjConvoID[(lp_researchObject)], lv_name));
}

text libCamp_gf_StoryResearchSupplementTextForObjective (int lp_researchObject, int lp_style, int lp_total, int lp_progress) {
    int autoE405FEA0_val;
    int auto5C54CB39_val;

    // Variable Declarations
    int lv_category;
    text lv_text;
    int lv_reward;

    // Variable Initialization
    lv_category = 1;

    // Implementation
    lv_category = 1;
    lv_reward = libCamp_gf_StoryResearchObjectReward(lp_researchObject, lv_category);
    if ((lv_reward == 0)) {
        lv_category = 2;
        lv_reward = libCamp_gf_StoryResearchObjectReward(lp_researchObject, lv_category);
    }
    else {
    }
    autoE405FEA0_val = lp_style;
    if (autoE405FEA0_val == 0) {
        lv_text = (lv_text + StringExternal("Param/Value/lib_Camp_A6E6F804") + IntToText((lp_progress * lv_reward)) + StringExternal("Param/Value/lib_Camp_803A9FEA") + IntToText((lp_total * lv_reward)) + StringExternal("Param/Value/lib_Camp_064EEE94"));
    }
    else if (autoE405FEA0_val == 1) {
        lv_text = (lv_text);
    }
    else {
    }
    auto5C54CB39_val = lv_category;
    if (auto5C54CB39_val == 1) {
        lv_text = (lv_text + StringExternal("Param/Value/lib_Camp_2C8B3814"));
    }
    else if (auto5C54CB39_val == 2) {
        lv_text = (lv_text + StringExternal("Param/Value/lib_Camp_EFA54EDC"));
    }
    else {
    }
    return lv_text;
}

void libCamp_gf_TS_InitializeResearchDataSingle (int lp_iD, string lp_convoID) {
    int autoE8C2DF9E_ae;
    int autoE8C2DF9E_ai;

    // Variable Declarations
    int lv_researchIndex;
    int lv_catIndex;
    int lv_tierIndex;
    int lv_slotIndex;

    // Variable Initialization

    // Implementation
    lv_researchIndex = (lp_iD);
    libCamp_gv_tS_ResearchID[lv_researchIndex] = lp_iD;
    libCamp_gv_tS_ResearchConvoID[lv_researchIndex] = lp_convoID;
    libCamp_gv_tS_ResearchUIItem[lv_researchIndex] = c_invalidResearchItemId;
    lv_catIndex = (libCamp_gf_StoryResearchCategory(lp_iD));
    lv_tierIndex = libCamp_gf_TS_StoryResearchTier(lp_iD);
    autoE8C2DF9E_ae = 2;
    autoE8C2DF9E_ai = 1;
    lv_slotIndex = 1;
    for ( ; ( (autoE8C2DF9E_ai >= 0 && lv_slotIndex <= autoE8C2DF9E_ae) || (autoE8C2DF9E_ai <= 0 && lv_slotIndex >= autoE8C2DF9E_ae) ) ; lv_slotIndex += autoE8C2DF9E_ai ) {
        if ((libCamp_gv_tS_ResearchIDInUIStructure[lv_catIndex][lv_tierIndex][lv_slotIndex] == 0)) {
            libCamp_gv_tS_ResearchIDInUIStructure[lv_catIndex][lv_tierIndex][lv_slotIndex] = lp_iD;
            libCamp_gv_tS_ResearchSlot[lv_researchIndex] = lv_slotIndex;
            break;
        }
        else {
        }
    }
}

void libCamp_gf_TS_InitializeResearchData () {
    int auto20A5AD78_i;

    // Variable Declarations
    int lv_indexMission;

    // Variable Initialization

    // Implementation
    libCamp_gf_TS_InitializeResearchObjData();
    libCamp_gf_TS_InitializeResearchDataSingle(1, "LabResearch|ResearchP1_1");
    libCamp_gf_TS_InitializeResearchDataSingle(2, "LabResearch|ResearchP1_2");
    libCamp_gf_TS_InitializeResearchDataSingle(3, "LabResearch|ResearchP2_1");
    libCamp_gf_TS_InitializeResearchDataSingle(4, "LabResearch|ResearchP2_2");
    libCamp_gf_TS_InitializeResearchDataSingle(5, "LabResearch|ResearchP3_1");
    libCamp_gf_TS_InitializeResearchDataSingle(6, "LabResearch|ResearchP3_2");
    libCamp_gf_TS_InitializeResearchDataSingle(7, "LabResearch|ResearchP4_1");
    libCamp_gf_TS_InitializeResearchDataSingle(8, "LabResearch|ResearchP4_2");
    libCamp_gf_TS_InitializeResearchDataSingle(9, "LabResearch|ResearchP5_1");
    libCamp_gf_TS_InitializeResearchDataSingle(10, "LabResearch|ResearchP5_2");
    libCamp_gf_TS_InitializeResearchDataSingle(11, "LabResearch|ResearchZ1_1");
    libCamp_gf_TS_InitializeResearchDataSingle(12, "LabResearch|ResearchZ1_2");
    libCamp_gf_TS_InitializeResearchDataSingle(13, "LabResearch|ResearchZ2_1");
    libCamp_gf_TS_InitializeResearchDataSingle(14, "LabResearch|ResearchZ2_2");
    libCamp_gf_TS_InitializeResearchDataSingle(15, "LabResearch|ResearchZ3_1");
    libCamp_gf_TS_InitializeResearchDataSingle(16, "LabResearch|ResearchZ3_2");
    libCamp_gf_TS_InitializeResearchDataSingle(17, "LabResearch|ResearchZ4_1");
    libCamp_gf_TS_InitializeResearchDataSingle(18, "LabResearch|ResearchZ4_2");
    libCamp_gf_TS_InitializeResearchDataSingle(19, "LabResearch|ResearchZ5_1");
    libCamp_gf_TS_InitializeResearchDataSingle(20, "LabResearch|ResearchZ5_2");
    libCamp_gv_tS_ResearchMissionObjects[(4)][1] = 9;
    libCamp_gv_tS_ResearchMissionObjectCount[(4)][1] = 3;
    libCamp_gv_tS_ResearchMissionObjects[(5)][1] = 10;
    libCamp_gv_tS_ResearchMissionObjectCount[(5)][1] = 2;
    libCamp_gv_tS_ResearchMissionObjects[(12)][1] = 12;
    libCamp_gv_tS_ResearchMissionObjectCount[(12)][1] = 3;
    libCamp_gv_tS_ResearchMissionObjects[(13)][1] = 2;
    libCamp_gv_tS_ResearchMissionObjectCount[(13)][1] = 3;
    libCamp_gv_tS_ResearchMissionObjects[(14)][1] = 13;
    libCamp_gv_tS_ResearchMissionObjectCount[(14)][1] = 3;
    libCamp_gv_tS_ResearchMissionObjects[(26)][1] = 14;
    libCamp_gv_tS_ResearchMissionObjectCount[(26)][1] = 4;
    libCamp_gv_tS_ResearchMissionObjects[(17)][1] = 1;
    libCamp_gv_tS_ResearchMissionObjectCount[(17)][1] = 4;
    libCamp_gv_tS_ResearchMissionObjects[(18)][1] = 1;
    libCamp_gv_tS_ResearchMissionObjectCount[(18)][1] = 3;
    libCamp_gv_tS_ResearchMissionObjects[(20)][1] = 1;
    libCamp_gv_tS_ResearchMissionObjectCount[(20)][1] = 4;
    libCamp_gv_tS_ResearchMissionObjects[(9)][1] = 1;
    libCamp_gv_tS_ResearchMissionObjectCount[(9)][1] = 3;
    libCamp_gv_tS_ResearchMissionObjects[(16)][2] = 1;
    libCamp_gv_tS_ResearchMissionObjectCount[(16)][2] = 4;
    libCamp_gv_tS_ResearchMissionObjects[(21)][1] = 8;
    libCamp_gv_tS_ResearchMissionObjectCount[(21)][1] = 4;
    libCamp_gv_tS_ResearchMissionObjects[(8)][1] = 18;
    libCamp_gv_tS_ResearchMissionObjectCount[(8)][1] = 1;
    libCamp_gv_tS_ResearchMissionObjects[(19)][1] = 18;
    libCamp_gv_tS_ResearchMissionObjectCount[(19)][1] = 1;
    libCamp_gv_tS_ResearchMissionObjects[(16)][1] = 18;
    libCamp_gv_tS_ResearchMissionObjectCount[(16)][1] = 1;
    libCamp_gv_tS_ResearchMissionObjects[(22)][1] = 11;
    libCamp_gv_tS_ResearchMissionObjectCount[(22)][1] = 3;
    libCamp_gv_tS_ResearchMissionObjects[(23)][1] = 3;
    libCamp_gv_tS_ResearchMissionObjectCount[(23)][1] = 3;
    libCamp_gv_tS_ResearchMissionObjects[(24)][1] = 4;
    libCamp_gv_tS_ResearchMissionObjectCount[(24)][1] = 2;
    libCamp_gv_tS_ResearchMissionObjects[(25)][1] = 7;
    libCamp_gv_tS_ResearchMissionObjectCount[(25)][1] = 1;
    auto20A5AD78_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto20A5AD78_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto20A5AD78_i];
        libCamp_gv_tSX_ResearchMissionProgress[(lv_indexMission)][(1)] = 0;
        libCamp_gv_tSX_ResearchMissionProgress[(lv_indexMission)][(2)] = 0;
        auto20A5AD78_i = auto20A5AD78_i + 1;
    }
}

void libCamp_gf_TS_InitializeResearchObjDataSingle (int lp_iD, string lp_convoID) {
    // Variable Declarations
    int lv_researchObjIndex;

    // Variable Initialization

    // Implementation
    lv_researchObjIndex = (lp_iD);
    libCamp_gv_tS_ResearchObjID[lv_researchObjIndex] = lp_iD;
    libCamp_gv_tS_ResearchObjConvoID[lv_researchObjIndex] = lp_convoID;
}

void libCamp_gf_TS_InitializeResearchObjData () {
    // Implementation
    libCamp_gf_TS_InitializeResearchObjDataSingle(9, "LabResearchObject|FindChrysalisDNA");
    libCamp_gf_TS_InitializeResearchObjDataSingle(10, "LabResearchObject|KillInfestors");
    libCamp_gf_TS_InitializeResearchObjDataSingle(11, "LabResearchObject|DestroyHatcheries");
    libCamp_gf_TS_InitializeResearchObjDataSingle(12, "LabResearchObject|FindDefilerBoneSamples");
    libCamp_gf_TS_InitializeResearchObjDataSingle(13, "LabResearchObject|FindCerebrateTissueSamples");
    libCamp_gf_TS_InitializeResearchObjDataSingle(14, "LabResearchObject|KillSporeCannons");
    libCamp_gf_TS_InitializeResearchObjDataSingle(15, "LabResearchObject|DestroyPreserverPrisons");
    libCamp_gf_TS_InitializeResearchObjDataSingle(16, "LabResearchObject|OvermindTendrils");
    libCamp_gf_TS_InitializeResearchObjDataSingle(17, "LabResearchObject|Kill1500Zerg");
    libCamp_gf_TS_InitializeResearchObjDataSingle(18, "LabResearchObject|KillBrutalisk");
    libCamp_gf_TS_InitializeResearchObjDataSingle(18, "LabResearchObject|KillBrutalisk");
    libCamp_gf_TS_InitializeResearchObjDataSingle(18, "LabResearchObject|KillBrutalisk");
    libCamp_gf_TS_InitializeResearchObjDataSingle(1, "LabResearchObject|FindProtossRelic");
    libCamp_gf_TS_InitializeResearchObjDataSingle(2, "LabResearchObject|FindProtossRelicContraband");
    libCamp_gf_TS_InitializeResearchObjDataSingle(3, "LabResearchObject|PowerupAbandonedStructure");
    libCamp_gf_TS_InitializeResearchObjDataSingle(4, "LabResearchObject|PowerupAncientObelisk");
    libCamp_gf_TS_InitializeResearchObjDataSingle(5, "LabResearchObject|FindProtossPsiElements");
    libCamp_gf_TS_InitializeResearchObjDataSingle(6, "LabResearchObject|VisitEachShrine");
    libCamp_gf_TS_InitializeResearchObjDataSingle(7, "LabResearchObject|ProtectArchive");
    libCamp_gf_TS_InitializeResearchObjDataSingle(8, "LabResearchObject|ReleasePrisoners");
}

void libCamp_gf_TS_ResetResearchData () {
    int auto49357283_i;
    int auto94AD0AA2_i;

    // Variable Declarations
    int lv_indexResearch;
    int lv_indexMission;

    // Variable Initialization

    // Implementation
    auto49357283_i = libCamp_gv_TSC_RESEARCH_FIRST;
    while (auto49357283_i <= libCamp_gv_TSC_RESEARCH_LAST) {
        lv_indexResearch = libCamp_gv_tS_ResearchID[auto49357283_i];
        auto94AD0AA2_i = libCamp_gv_TSC_MISSION_FIRST;
        while (auto94AD0AA2_i <= libCamp_gv_TSC_MISSION_LAST) {
            lv_indexMission = libCamp_gv_tS_MapID[auto94AD0AA2_i];
            libCamp_gv_tSX_ResearchMissionProgress[(lv_indexResearch)][(1)] = 0;
            libCamp_gv_tSX_ResearchMissionProgress[(lv_indexResearch)][(2)] = 0;
            auto94AD0AA2_i = auto94AD0AA2_i + 1;
        }
        libCamp_gv_tSX_ResearchState[(lv_indexResearch)] = (1);
        auto49357283_i = auto49357283_i + 1;
    }
    libCamp_gv_tS_ResearchMissionProgressCurrent[(1)] = 0;
    libCamp_gv_tS_ResearchMissionProgressCurrent[(2)] = 0;
    libCamp_gv_tSX_DebugResearchLevel[(1)] = 0;
    libCamp_gv_tSX_DebugResearchLevel[(2)] = 0;
    libCamp_gv_tSX_ResearchPointsConverted[(1)] = 0;
    libCamp_gv_tSX_ResearchPointsConverted[(2)] = 0;
    libCamp_gv_tSX_ResearchUIOldPoints[(1)] = 0;
    libCamp_gv_tSX_ResearchUIOldPoints[(2)] = 0;
}

void libCamp_gf_TS_ApplyResearchesTech (int lp_player) {
    int auto980C5D8E_i;

    // Variable Declarations
    int lv_indexResearch;
    int lv_level;
    bool lv_allowDisallow;

    // Variable Initialization
    lv_allowDisallow = true;

    // Implementation
    auto980C5D8E_i = libCamp_gv_TSC_RESEARCH_FIRST;
    while (auto980C5D8E_i <= libCamp_gv_TSC_RESEARCH_LAST) {
        lv_indexResearch = libCamp_gv_tS_ResearchID[auto980C5D8E_i];
        if ((libCamp_gf_StoryResearchStateCheck(lv_indexResearch, 2) == true)) {
            lv_level = 1;
            lv_allowDisallow = true;
        }
        else {
            lv_level = 0;
            lv_allowDisallow = false;
        }
        if ((libCamp_gf_TS_StoryResearchRewardUpgrade1(lv_indexResearch) != null)) {
            libNtve_gf_SetUpgradeLevelForPlayer(lp_player, libCamp_gf_TS_StoryResearchRewardUpgrade1(lv_indexResearch), lv_level);
        }
        else {
        }
        if ((libCamp_gf_TS_StoryResearchRewardUpgrade2(lv_indexResearch) != null)) {
            libNtve_gf_SetUpgradeLevelForPlayer(lp_player, libCamp_gf_TS_StoryResearchRewardUpgrade2(lv_indexResearch), lv_level);
        }
        else {
        }
        if ((libCamp_gf_TS_StoryResearchRewardAC1(lv_indexResearch) != null)) {
            TechTreeAbilityAllow(lp_player, libCamp_gf_TS_StoryResearchRewardAC1(lv_indexResearch), lv_allowDisallow);
        }
        else {
        }
        if ((libCamp_gf_TS_StoryResearchRewardAC2(lv_indexResearch) != null)) {
            TechTreeAbilityAllow(lp_player, libCamp_gf_TS_StoryResearchRewardAC2(lv_indexResearch), lv_allowDisallow);
        }
        else {
        }
        auto980C5D8E_i = auto980C5D8E_i + 1;
    }
    libCamp_gf_TS_UpdateTechAddons(lp_player);
    libCamp_gf_TS_UpdateTechUpgrades(lp_player);
    libCamp_gf_TS_UpdateResearchUnitHelpPanel(lp_player);
    if ((TechTreeUpgradeCount(lp_player, "CellularReactors", c_techCountQueuedOrBetter) == 1)) {
        UnitGroupLoopBegin(UnitGroup(null, lp_player, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32))), 0));
        for ( ; !UnitGroupLoopDone() ; UnitGroupLoopStep() ) {
            UnitSetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergy, (UnitGetPropertyFixed(UnitGroupLoopCurrent(), c_unitPropEnergy, c_unitPropCurrent) + 100.0));
        }
        UnitGroupLoopEnd();
    }
    else {
    }
}

void libCamp_gf_TS_UpdateResearchUnitHelpPanel (int lp_player) {
    // Implementation
    if ((libCamp_gf_StoryResearchStateCheck(7, 2) == true)) {
        libCamp_gf_AddUnitTypeToUnitHelpPanel("Raven", true, lp_player);
    }
    else {
    }
    if ((libCamp_gf_StoryResearchStateCheck(8, 2) == true)) {
        libCamp_gf_AddUnitTypeToUnitHelpPanel("ScienceVessel", true, lp_player);
    }
    else {
    }
    if ((libCamp_gf_StoryResearchStateCheck(9, 2) == true)) {
        libCamp_gf_AddUnitTypeToUnitHelpPanel("TechReactor", true, lp_player);
    }
    else {
    }
    if ((libCamp_gf_StoryResearchStateCheck(13, 2) == true)) {
        libCamp_gf_AddUnitTypeToUnitHelpPanel("PlanetaryFortress", true, lp_player);
    }
    else {
    }
    if ((libCamp_gf_StoryResearchStateCheck(14, 2) == true)) {
        libCamp_gf_AddUnitTypeToUnitHelpPanel("PerditionTurret", true, lp_player);
    }
    else {
    }
    if ((libCamp_gf_StoryResearchStateCheck(15, 2) == true)) {
        libCamp_gf_AddUnitTypeToUnitHelpPanel("Predator", true, lp_player);
    }
    else {
    }
    if ((libCamp_gf_StoryResearchStateCheck(16, 2) == true)) {
        libCamp_gf_AddUnitTypeToUnitHelpPanel("Hercules", true, lp_player);
    }
    else {
    }
    if ((libCamp_gf_StoryResearchStateCheck(19, 2) == true)) {
        libCamp_gf_AddUnitTypeToUnitHelpPanel("HiveMindEmulator", true, lp_player);
    }
    else {
    }
    if ((libCamp_gf_StoryResearchStateCheck(20, 2) == true)) {
        libCamp_gf_AddUnitTypeToUnitHelpPanel("PsiDisruptor", true, lp_player);
    }
    else {
    }
}

void libCamp_gf_AddProgressToStoryResearch (int lp_researchObject, int lp_count) {
    // Implementation
    libCamp_gv_tS_ResearchMissionProgressCurrent[(1)] += (lp_count * libCamp_gf_StoryResearchObjectReward(lp_researchObject, 1));
    libCamp_gv_tS_ResearchMissionProgressCurrent[(2)] += (lp_count * libCamp_gf_StoryResearchObjectReward(lp_researchObject, 2));
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_9FCB7B36") + IntToText(libCamp_gv_tS_ResearchMissionProgressCurrent[(2)])), false);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_20D12B86") + IntToText(libCamp_gf_StoryResearchMissionProgress(libCamp_gv_tS_CurrentMap, 2))), false);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_94BE7099") + IntToText(libCamp_gv_tS_ResearchMissionProgressCurrent[(1)])), false);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_072C0622") + IntToText(libCamp_gf_StoryResearchMissionProgress(libCamp_gv_tS_CurrentMap, 1))), false);
    if ((libCamp_gf_TS_StoryResearchMissionProgressCurrent(1) > libCamp_gf_StoryResearchMissionProgress(libCamp_gv_tS_CurrentMap, 1))) {
        libCamp_gv_tSX_ResearchMissionProgress[(libCamp_gv_tS_CurrentMap)][(1)] = libCamp_gf_TS_StoryResearchMissionProgressCurrent(1);
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_02AE8CE6") + IntToText(libCamp_gf_StoryResearchMissionProgress(libCamp_gv_tS_CurrentMap, 1))), false);
    }
    else {
    }
    if ((libCamp_gf_TS_StoryResearchMissionProgressCurrent(2) > libCamp_gf_StoryResearchMissionProgress(libCamp_gv_tS_CurrentMap, 2))) {
        libCamp_gv_tSX_ResearchMissionProgress[(libCamp_gv_tS_CurrentMap)][(2)] = libCamp_gf_TS_StoryResearchMissionProgressCurrent(2);
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_094C58AF") + IntToText(libCamp_gf_StoryResearchMissionProgress(libCamp_gv_tS_CurrentMap, 2))), false);
    }
    else {
    }
}

void libCamp_gf_SetStoryResearchPurchased (int lp_researchID) {
    // Implementation
    libCamp_gv_tSX_ResearchState[(lp_researchID)] = 2;
}

void libCamp_gf_SetStoryResearchPointsConverted (int lp_category, int lp_points) {
    // Implementation
    libCamp_gv_tSX_ResearchPointsConverted[(lp_category)] = lp_points;
}

void libCamp_gf_SetStoryResearchPointsOld (int lp_category, int lp_points) {
    // Implementation
    libCamp_gv_tSX_ResearchPointsOld[(lp_category)] = lp_points;
}

int libCamp_gf_TS_StoryResearchPointsOld (int lp_categeory) {
    // Implementation
    return libCamp_gv_tSX_ResearchUIOldPoints[(lp_categeory)];
}

int libCamp_gf_TS_ResearchUIResearchID (int lp_researchItem) {
    int auto41A72E46_i;

    // Variable Declarations
    int lv_indexResearch;

    // Variable Initialization

    // Implementation
    auto41A72E46_i = libCamp_gv_TSC_RESEARCH_FIRST;
    while (auto41A72E46_i <= libCamp_gv_TSC_RESEARCH_LAST) {
        lv_indexResearch = libCamp_gv_tS_ResearchID[auto41A72E46_i];
        if ((libCamp_gf_TS_StoryResearchUIItem(lv_indexResearch) == lp_researchItem)) {
            return lv_indexResearch;
        }
        else {
        }
        auto41A72E46_i = auto41A72E46_i + 1;
    }
    return 0;
}

void libCamp_gf_DisplayResearchPanel (trigger lp_exitCallback) {
    // Implementation
    libCamp_gv_tS_ResearchUIExitCallback = lp_exitCallback;
    libCamp_gv_tS_ResearchUIExitEnabled = false;
    libCamp_gf_TS_ResearchUICreate();
    ResearchCategorySetCurrentLevel(libCamp_gv_tS_ResearchUICategories[(1)], libCamp_gv_tSX_ResearchUIOldPoints[(1)]);
    ResearchCategorySetCurrentLevel(libCamp_gv_tS_ResearchUICategories[(2)], libCamp_gv_tSX_ResearchUIOldPoints[(2)]);
    ResearchCategorySetLastLevel(libCamp_gv_tS_ResearchUICategories[(1)], libCamp_gv_tSX_ResearchUIOldPoints[(1)]);
    ResearchCategorySetLastLevel(libCamp_gv_tS_ResearchUICategories[(2)], libCamp_gv_tSX_ResearchUIOldPoints[(2)]);
    libCamp_gf_TS_ResearchUIUpdate();
    libCamp_gv_tSX_ResearchUIOldPoints[(1)] = libCamp_gf_StoryResearchPoints(1);
    libCamp_gv_tSX_ResearchUIOldPoints[(2)] = libCamp_gf_StoryResearchPoints(2);
    libCamp_gv_tS_ResearchUIExitEnabled = true;
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeResearchPanel, true);
}

void libCamp_gf_TS_ResearchUICreate () {
    int init_i;
    int init_j;
    int init_k;

    int auto912ABAB3_ae;
    int auto912ABAB3_ai;
    int autoA1BE3232_val;
    int autoBD7EADA4_ae;
    int autoBD7EADA4_ai;
    int auto9C5BB20A_i;

    // Variable Declarations
    int lv_categoryIndex;
    text lv_categoryName;
    int lv_indexCategory;
    int lv_tierIndex;
    int lv_indexResearch;
    int lv_slotIndex;
    int[3][6][3] lv_uIItem;

    // Variable Initialization
    lv_indexCategory = 1;
    for (init_i = 0; init_i <= 2; init_i += 1) {
        for (init_j = 0; init_j <= 5; init_j += 1) {
            for (init_k = 0; init_k <= 2; init_k += 1) {
                lv_uIItem[init_i][init_j][init_k] = c_invalidResearchItemId;
            }
        }
    }

    // Implementation
    if ((libCamp_gv_tS_ResearchUICreated == true)) {
        return ;
    }
    else {
    }
    libCamp_gv_tS_ResearchUICreated = true;
    auto912ABAB3_ae = 2;
    auto912ABAB3_ai = 1;
    lv_categoryIndex = 1;
    for ( ; ( (auto912ABAB3_ai >= 0 && lv_categoryIndex <= auto912ABAB3_ae) || (auto912ABAB3_ai <= 0 && lv_categoryIndex >= auto912ABAB3_ae) ) ; lv_categoryIndex += auto912ABAB3_ai ) {
        autoA1BE3232_val = lv_categoryIndex;
        if (autoA1BE3232_val == (1)) {
            lv_indexCategory = 1;
            lv_categoryName = StringExternal("Param/Value/lib_Camp_3E9A4A97");
        }
        else if (autoA1BE3232_val == (2)) {
            lv_indexCategory = 2;
            lv_categoryName = StringExternal("Param/Value/lib_Camp_F968DADB");
        }
        else {
        }
        ResearchCategoryCreate(PlayerGroupAll(), lv_categoryIndex);
        libCamp_gv_tS_ResearchUICategories[lv_categoryIndex] = ResearchCategoryLastCreated();
        ResearchCategorySetNameText(ResearchCategoryLastCreated(), lv_categoryName);
        autoBD7EADA4_ae = 5;
        autoBD7EADA4_ai = 1;
        lv_tierIndex = 1;
        for ( ; ( (autoBD7EADA4_ai >= 0 && lv_tierIndex <= autoBD7EADA4_ae) || (autoBD7EADA4_ai <= 0 && lv_tierIndex >= autoBD7EADA4_ae) ) ; lv_tierIndex += autoBD7EADA4_ai ) {
            ResearchTierCreate(PlayerGroupAll(), ResearchCategoryLastCreated(), lv_tierIndex);
            libCamp_gv_tS_ResearchUITiers[lv_categoryIndex][lv_tierIndex] = ResearchTierLastCreated();
            ResearchTierSetMaxPurchasesAllowed(ResearchTierLastCreated(), 1);
            ResearchTierSetRequiredLevel(ResearchTierLastCreated(), (lv_tierIndex * libCamp_gv_tSC_RESEARCH_TIERLEVEL));
        }
    }
    auto9C5BB20A_i = libCamp_gv_TSC_RESEARCH_FIRST;
    while (auto9C5BB20A_i <= libCamp_gv_TSC_RESEARCH_LAST) {
        lv_indexResearch = libCamp_gv_tS_ResearchID[auto9C5BB20A_i];
        lv_categoryIndex = (libCamp_gf_StoryResearchCategory(lv_indexResearch));
        lv_tierIndex = libCamp_gf_TS_StoryResearchTier(lv_indexResearch);
        lv_slotIndex = libCamp_gf_TS_StoryResearchSlot(lv_indexResearch);
        ResearchItemCreate(PlayerGroupAll(), libCamp_gv_tS_ResearchUITiers[lv_categoryIndex][lv_tierIndex], lv_slotIndex);
        libCamp_gv_tS_ResearchUIItem[(lv_indexResearch)] = ResearchItemLastCreated();
        lv_uIItem[lv_categoryIndex][lv_tierIndex][lv_slotIndex] = ResearchItemLastCreated();
        ResearchItemSetNameText(ResearchItemLastCreated(), libCamp_gf_StoryResearchName(lv_indexResearch));
        ResearchItemSetDescriptionText(ResearchItemLastCreated(), libCamp_gf_StoryResearchDescription(lv_indexResearch));
        ResearchItemSetIconFilePath(ResearchItemLastCreated(), libCamp_gf_StoryResearchIcon(lv_indexResearch));
        ResearchItemSetMovieFilePath(ResearchItemLastCreated(), libCamp_gf_StoryResearchMovie(lv_indexResearch));
        ResearchItemSetTooltipText(ResearchItemLastCreated(), libCamp_gf_StoryResearchTooltip(lv_indexResearch));
        ResearchItemSetConfirmationText(ResearchItemLastCreated(), libCamp_gf_StoryResearchConfirmationText(lv_indexResearch));
        ResearchItemSetState(ResearchItemLastCreated(), c_researchItemStateEnabled);
        auto9C5BB20A_i = auto9C5BB20A_i + 1;
    }
}

void libCamp_gf_TS_ResearchUIUpdate () {
    int autoCE1E6292_i;
    int autoBAF0C87C_i;
    int autoD1456021_val;

    // Variable Declarations
    int lv_indexResearch;
    int lv_otherResearch;
    text lv_tip;

    // Variable Initialization

    // Implementation
    libCamp_gf_TS_ResearchUICreate();
    ResearchCategorySetCurrentLevel(libCamp_gv_tS_ResearchUICategories[(1)], MinI(libCamp_gf_StoryResearchPointCap(1), libCamp_gf_StoryResearchPoints(1)));
    ResearchCategorySetCurrentLevel(libCamp_gv_tS_ResearchUICategories[(2)], MinI(libCamp_gf_StoryResearchPointCap(2), libCamp_gf_StoryResearchPoints(2)));
    autoCE1E6292_i = libCamp_gv_TSC_RESEARCH_FIRST;
    while (autoCE1E6292_i <= libCamp_gv_TSC_RESEARCH_LAST) {
        lv_indexResearch = libCamp_gv_tS_ResearchID[autoCE1E6292_i];
        ResearchItemSetTooltipText(libCamp_gv_tS_ResearchUIItem[(lv_indexResearch)], libCamp_gf_StoryResearchTooltip(lv_indexResearch));
        ResearchItemSetState(libCamp_gf_TS_StoryResearchUIItem(lv_indexResearch), c_researchItemStateEnabled);
        autoCE1E6292_i = autoCE1E6292_i + 1;
    }
    autoBAF0C87C_i = libCamp_gv_TSC_RESEARCH_FIRST;
    while (autoBAF0C87C_i <= libCamp_gv_TSC_RESEARCH_LAST) {
        lv_indexResearch = libCamp_gv_tS_ResearchID[autoBAF0C87C_i];
        if ((libCamp_gf_StoryResearchStateCheck(lv_indexResearch, 2) == true)) {
            ResearchItemSetState(libCamp_gf_TS_StoryResearchUIItem(lv_indexResearch), c_researchItemStatePurchased);
            lv_otherResearch = libCamp_gf_TS_StoryResearchTheOtherOfTheSameTier(lv_indexResearch);
            ResearchItemSetState(libCamp_gf_TS_StoryResearchUIItem(lv_otherResearch), c_researchItemStateDisabled);
            autoD1456021_val = libCamp_gf_StoryResearchCategory(lv_otherResearch);
            if (autoD1456021_val == 1) {
                lv_tip = (StringExternal("Param/Value/lib_Camp_922BF17E") + libCamp_gf_StoryResearchName(lv_otherResearch) + StringExternal("Param/Value/lib_Camp_323EDACB"));
                libCamp_gf_TS_ResearchUIClearProtossConfirmationText();
            }
            else if (autoD1456021_val == 2) {
                lv_tip = (StringExternal("Param/Value/lib_Camp_F92407E3") + libCamp_gf_StoryResearchName(lv_otherResearch) + StringExternal("Param/Value/lib_Camp_D7DAE7B6"));
                libCamp_gf_TS_ResearchUIClearZergConfirmationText();
            }
            else {
            }
            ResearchItemSetTooltipText(libCamp_gv_tS_ResearchUIItem[(lv_otherResearch)], lv_tip);
        }
        else {
        }
        autoBAF0C87C_i = autoBAF0C87C_i + 1;
    }
}

void libCamp_gf_TS_ResearchUIClearProtossConfirmationText () {
    int autoCC12C21D_i;

    // Variable Declarations
    int lv_indexResearch;
    int lv_otherResearch;

    // Variable Initialization

    // Implementation
    autoCC12C21D_i = libCamp_gv_TSC_RESEARCH_FIRST;
    while (autoCC12C21D_i <= libCamp_gv_TSC_RESEARCH_LAST) {
        lv_indexResearch = libCamp_gv_tS_ResearchID[autoCC12C21D_i];
        if ((libCamp_gf_StoryResearchCategory(lv_indexResearch) == 1)) {
            ResearchItemSetConfirmationText(libCamp_gf_TS_StoryResearchUIItem(lv_indexResearch), StringExternal("Param/Value/lib_Camp_1349BB5C"));
        }
        else {
        }
        autoCC12C21D_i = autoCC12C21D_i + 1;
    }
}

void libCamp_gf_TS_ResearchUIClearZergConfirmationText () {
    int auto96137861_i;

    // Variable Declarations
    int lv_indexResearch;
    int lv_otherResearch;

    // Variable Initialization

    // Implementation
    auto96137861_i = libCamp_gv_TSC_RESEARCH_FIRST;
    while (auto96137861_i <= libCamp_gv_TSC_RESEARCH_LAST) {
        lv_indexResearch = libCamp_gv_tS_ResearchID[auto96137861_i];
        if ((libCamp_gf_StoryResearchCategory(lv_indexResearch) == 2)) {
            ResearchItemSetConfirmationText(libCamp_gf_TS_StoryResearchUIItem(lv_indexResearch), StringExternal("Param/Value/lib_Camp_356F93A4"));
        }
        else {
        }
        auto96137861_i = auto96137861_i + 1;
    }
}

void libCamp_gf_TS_RoomChangePanelCreate () {
    // Implementation
    if ((libCamp_gv_tS_RoomChangeDialog == c_invalidDialogId)) {
        DialogCreate(500, 50, c_anchorBottom, 0, 0, false);
        libCamp_gv_tS_RoomChangeDialog = DialogLastCreated();
        DialogSetImageVisible(DialogLastCreated(), false);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeImage);
        libCamp_gv_tS_RoomChangeDialogBorder = DialogControlLastCreated();
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorCenter, 0, 0);
        libNtve_gf_SetDialogItemImageType(DialogControlLastCreated(), c_triggerImageTypeBorder, PlayerGroupAll());
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\ui_roomselectionframe.dds", PlayerGroupAll());
        libNtve_gf_SetDialogItemImageType2(DialogControlLastCreated(), true, PlayerGroupAll());
        DialogCreate(1600, 400, c_anchorBottom, 0, 70, false);
        libCamp_gv_tS_RoomChangeDialogSubtitle = DialogLastCreated();
        DialogSetTransparency(DialogLastCreated(), 100.0);
    }
    else {
    }
}

void libCamp_gf_AddRoomChangePanelButton (text lp_roomName, trigger lp_clickCallback, trigger lp_updateCallback, int lp_custonData, text lp_tip) {
    // Variable Declarations
    const int lv_buttonX = 220;
    const int lv_buttonY = 42;

    // Variable Initialization

    // Implementation
    libCamp_gf_TS_RoomChangePanelCreate();
    DialogControlCreate(libCamp_gv_tS_RoomChangeDialog, c_triggerControlTypeButton);
    libCamp_gv_tS_RoomChangeButtonCount += 1;
    libCamp_gv_tS_RoomChangeButtons[libCamp_gv_tS_RoomChangeButtonCount] = DialogControlLastCreated();
    libNtve_gf_SetDialogItemHandle(DialogControlLastCreated(), ("WoL_RoomChangeButton" + IntToString(libCamp_gv_tS_RoomChangeButtonCount)), PlayerGroupAll());
    libNtve_gf_SetDialogItemText(DialogControlLastCreated(), lp_roomName, PlayerGroupAll());
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_buttonX, lv_buttonY);
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorCenter, 0, 0);
    libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\ui_options_selectonbutton_normalpressed_terran.dds", PlayerGroupAll());
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "RoomChangePanelText", PlayerGroupAll());
    libNtve_gf_SetDialogItemImage2(DialogControlLastCreated(), "Assets\\Textures\\ui_options_selectonbutton_normaloverpressedover_terran.dds", PlayerGroupAll());
    libNtve_gf_SetDialogItemTooltip(DialogControlLastCreated(), lp_tip, PlayerGroupAll());
    libCamp_gv_tS_RoomChangeButtonCallbackClick[libCamp_gv_tS_RoomChangeButtonCount] = lp_clickCallback;
    libCamp_gv_tS_RoomChangeButtonCallbackUpdate[libCamp_gv_tS_RoomChangeButtonCount] = lp_updateCallback;
    libCamp_gv_tS_RoomChangeButtonCustomData[libCamp_gv_tS_RoomChangeButtonCount] = lp_custonData;
    DialogControlCreate(libCamp_gv_tS_RoomChangeDialog, c_triggerControlTypeImage);
    libCamp_gv_tS_RoomChangeButtonBG[libCamp_gv_tS_RoomChangeButtonCount] = DialogControlLastCreated();
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_buttonX, lv_buttonY);
    DialogControlSetPositionRelative(DialogControlLastCreated(), PlayerGroupAll(), c_anchorCenter, libCamp_gv_tS_RoomChangeButtons[libCamp_gv_tS_RoomChangeButtonCount], c_anchorCenter, 0, 0);
    libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\ui_options_selectonbutton_selected.dds", PlayerGroupAll());
    libNtve_gf_SetDialogItemImageType(DialogControlLastCreated(), c_triggerImageTypeBorder, PlayerGroupAll());
    DialogControlSetVisible(DialogControlLastCreated(), PlayerGroupAll(), false);
    DialogControlCreate(libCamp_gv_tS_RoomChangeDialog, c_triggerControlTypeLabel);
    libCamp_gv_tS_RoomChangeButtonText[libCamp_gv_tS_RoomChangeButtonCount] = DialogControlLastCreated();
    libNtve_gf_SetDialogItemHandle(DialogControlLastCreated(), ("WoL_RoomChangeLabel" + IntToString(libCamp_gv_tS_RoomChangeButtonCount)), PlayerGroupAll());
    libNtve_gf_SetDialogItemText(DialogControlLastCreated(), lp_roomName, PlayerGroupAll());
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_buttonX, lv_buttonY);
    DialogControlSetPositionRelative(DialogControlLastCreated(), PlayerGroupAll(), c_anchorCenter, libCamp_gv_tS_RoomChangeButtons[libCamp_gv_tS_RoomChangeButtonCount], c_anchorCenter, 0, 0);
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "RoomChangePanelTextDisabled", PlayerGroupAll());
    DialogControlSetVisible(DialogControlLastCreated(), PlayerGroupAll(), false);
    libCamp_gf_UpdateRoomChangePanel();
}

int libCamp_gf_LastAddRoomChangePanelButton () {
    // Implementation
    return libCamp_gv_tS_RoomChangeButtonCount;
}

int libCamp_gf_RoomChangePanelButtonCount () {
    // Implementation
    return libCamp_gv_tS_RoomChangeButtonCount;
}

int libCamp_gf_RoomChangePanelCurrentButton () {
    // Implementation
    return libCamp_gv_tS_RoomChangeButtonCurrent;
}

int libCamp_gf_RoomChangePanelButtonCustomData (int lp_buttonId) {
    // Implementation
    return libCamp_gv_tS_RoomChangeButtonCustomData[lp_buttonId];
}

bool libCamp_gf_RoomChangePanelIsVisible () {
    // Implementation
    return DialogIsVisible(libCamp_gv_tS_RoomChangeDialog, 1);
}

void libCamp_gf_HideRoomChangePanel (bool lp_showHide) {
    // Implementation
    libCamp_gf_TS_RoomChangePanelCreate();
    if ((lp_showHide == true)) {
        if ((libCamp_gv_tS_RoomChangeButtonCount > 0)) {
            DialogSetVisible(libCamp_gv_tS_RoomChangeDialog, PlayerGroupAll(), true);
            DialogSetVisible(libCamp_gv_tS_RoomChangeDialogSubtitle, PlayerGroupAll(), false);
            DialogSetSubtitlePositionOverride(libCamp_gv_tS_RoomChangeDialogSubtitle);
        }
        else {
        }
    }
    else {
        DialogSetVisible(libCamp_gv_tS_RoomChangeDialog, PlayerGroupAll(), false);
        DialogSetVisible(libCamp_gv_tS_RoomChangeDialogSubtitle, PlayerGroupAll(), false);
        DialogSetSubtitlePositionOverride(c_invalidDialogId);
    }
}

void libCamp_gf_UpdateRoomChangePanel () {
    int autoC6B803EA_ae;
    int autoC6B803EA_ai;

    // Variable Declarations
    int lv_index;
    int lv_sizeX;
    int lv_sizeY;

    // Variable Initialization

    // Implementation
    if ((libCamp_gv_tS_RoomChangeButtonCount > 0)) {
        lv_sizeX = 30;
        lv_sizeY = 60;
        autoC6B803EA_ae = libCamp_gv_tS_RoomChangeButtonCount;
        autoC6B803EA_ai = 1;
        lv_index = 1;
        for ( ; ( (autoC6B803EA_ai >= 0 && lv_index <= autoC6B803EA_ae) || (autoC6B803EA_ai <= 0 && lv_index >= autoC6B803EA_ae) ) ; lv_index += autoC6B803EA_ai ) {
            if ((libCamp_gv_tS_RoomChangeButtonCallbackUpdate[lv_index] != null)) {
                libCamp_gv_tS_RoomChangeButtonCurrent = lv_index;
                TriggerExecute(libCamp_gv_tS_RoomChangeButtonCallbackUpdate[lv_index], true, false);
            }
            else {
            }
            DialogControlSetPosition(libCamp_gv_tS_RoomChangeButtons[lv_index], PlayerGroupAll(), c_anchorTopLeft, lv_sizeX, 13);
            lv_sizeX += 215;
        }
        lv_sizeX += 36;
        DialogSetSize(libCamp_gv_tS_RoomChangeDialog, lv_sizeX, lv_sizeY);
        DialogControlSetSize(libCamp_gv_tS_RoomChangeDialogBorder, PlayerGroupAll(), lv_sizeX, lv_sizeY);
        DialogSetPosition(libCamp_gv_tS_RoomChangeDialog, c_anchorBottom, 0, 0);
    }
    else {
    }
}

void libCamp_gf_DisableRoomChangePanelButton (bool lp_enableDisable, int lp_buttonId) {
    // Deprecated
    libCamp_gf_SetRoomChangePanelButtonState(lp_buttonId, 2);
}

void libCamp_gf_SetRoomChangePanelButtonState (int lp_buttonId, int lp_state) {
    int auto575891EC_val;

    // Implementation
    if ((lp_buttonId > libCamp_gv_tS_RoomChangeButtonCount)) {
        return ;
    }
    else {
    }
    auto575891EC_val = lp_state;
    if (auto575891EC_val == 2) {
        DialogControlSetEnabled(libCamp_gv_tS_RoomChangeButtons[lp_buttonId], PlayerGroupAll(), true);
        DialogControlSetVisible(libCamp_gv_tS_RoomChangeButtons[lp_buttonId], PlayerGroupAll(), true);
        DialogControlSetVisible(libCamp_gv_tS_RoomChangeButtonBG[lp_buttonId], PlayerGroupAll(), false);
        DialogControlSetVisible(libCamp_gv_tS_RoomChangeButtonText[lp_buttonId], PlayerGroupAll(), false);
    }
    else if (auto575891EC_val == 0) {
        DialogControlSetEnabled(libCamp_gv_tS_RoomChangeButtons[lp_buttonId], PlayerGroupAll(), false);
        DialogControlSetVisible(libCamp_gv_tS_RoomChangeButtons[lp_buttonId], PlayerGroupAll(), true);
        DialogControlSetVisible(libCamp_gv_tS_RoomChangeButtonBG[lp_buttonId], PlayerGroupAll(), false);
        DialogControlSetVisible(libCamp_gv_tS_RoomChangeButtonText[lp_buttonId], PlayerGroupAll(), false);
    }
    else if (auto575891EC_val == 1) {
        DialogControlSetEnabled(libCamp_gv_tS_RoomChangeButtons[lp_buttonId], PlayerGroupAll(), false);
        DialogControlSetVisible(libCamp_gv_tS_RoomChangeButtons[lp_buttonId], PlayerGroupAll(), false);
        DialogControlSetVisible(libCamp_gv_tS_RoomChangeButtonBG[lp_buttonId], PlayerGroupAll(), true);
        DialogControlSetVisible(libCamp_gv_tS_RoomChangeButtonText[lp_buttonId], PlayerGroupAll(), true);
    }
    else {
    }
}

trigger auto_libCamp_gf_FlashRoomChangePanelButton_Trigger = null;
int auto_libCamp_gf_FlashRoomChangePanelButton_lp_buttonId;

void libCamp_gf_FlashRoomChangePanelButton (int lp_buttonId) {
    auto_libCamp_gf_FlashRoomChangePanelButton_lp_buttonId = lp_buttonId;

    if (auto_libCamp_gf_FlashRoomChangePanelButton_Trigger == null) {
        auto_libCamp_gf_FlashRoomChangePanelButton_Trigger = TriggerCreate("auto_libCamp_gf_FlashRoomChangePanelButton_TriggerFunc");
    }

    TriggerExecute(auto_libCamp_gf_FlashRoomChangePanelButton_Trigger, false, false);
}

bool auto_libCamp_gf_FlashRoomChangePanelButton_TriggerFunc (bool testConds, bool runActions) {
    int lp_buttonId = auto_libCamp_gf_FlashRoomChangePanelButton_lp_buttonId;

    // Implementation
    if (((lp_buttonId > libCamp_gv_tS_RoomChangeButtonCount) || (libCamp_gv_tS_RoomChangeDialog == c_invalidDialogId) || (libCamp_gv_tS_RoomChangeButtons[lp_buttonId] == c_invalidDialogControlId) || (libCamp_gv_tS_RoomChangeButtonFlashing[lp_buttonId] == true))) {
        return true;
    }
    else {
    }
    libCamp_gv_tS_RoomChangeButtonFlashing[lp_buttonId] = true;
    DialogControlCreate(libCamp_gv_tS_RoomChangeDialog, c_triggerControlTypeImage);
    libNtve_gf_SetDialogItemImageType(DialogControlLastCreated(), c_triggerImageTypeBorder, PlayerGroupAll());
    libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\ui_options_selectonbutton_anim_terran.dds", PlayerGroupAll());
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), (DialogControlGetWidth(libCamp_gv_tS_RoomChangeButtons[lp_buttonId], 1) + 18), (DialogControlGetHeight(libCamp_gv_tS_RoomChangeButtons[lp_buttonId], 1) + 24));
    DialogControlSetPositionRelative(DialogControlLastCreated(), PlayerGroupAll(), c_anchorCenter, libCamp_gv_tS_RoomChangeButtons[lp_buttonId], c_anchorCenter, 0, -1);
    while (true) {
        DialogControlFadeTransparency(DialogControlLastCreated(), PlayerGroupAll(), 0.2, 100.0);
        Wait(0.5, c_timeGame);
        if (((lp_buttonId > libCamp_gv_tS_RoomChangeButtonCount) || (libCamp_gv_tS_RoomChangeDialog == c_invalidDialogId) || (libCamp_gv_tS_RoomChangeButtons[lp_buttonId] == c_invalidDialogControlId) || (libCamp_gv_tS_RoomChangeButtonFlashing[lp_buttonId] == false))) {
            DialogControlDestroy(DialogControlLastCreated());
            return true;
        }
        else {
        }
        DialogControlFadeTransparency(DialogControlLastCreated(), PlayerGroupAll(), 0.2, 0.0);
        Wait(0.5, c_timeReal);
        if (((lp_buttonId > libCamp_gv_tS_RoomChangeButtonCount) || (libCamp_gv_tS_RoomChangeDialog == c_invalidDialogId) || (libCamp_gv_tS_RoomChangeButtons[lp_buttonId] == c_invalidDialogControlId) || (libCamp_gv_tS_RoomChangeButtonFlashing[lp_buttonId] == false))) {
            DialogControlDestroy(DialogControlLastCreated());
            return true;
        }
        else {
        }
    }
    return true;
}

trigger auto_libCamp_gf_StopFlashingRoomChangePanelButton_Trigger = null;
int auto_libCamp_gf_StopFlashingRoomChangePanelButton_lp_buttonId;

void libCamp_gf_StopFlashingRoomChangePanelButton (int lp_buttonId) {
    auto_libCamp_gf_StopFlashingRoomChangePanelButton_lp_buttonId = lp_buttonId;

    if (auto_libCamp_gf_StopFlashingRoomChangePanelButton_Trigger == null) {
        auto_libCamp_gf_StopFlashingRoomChangePanelButton_Trigger = TriggerCreate("auto_libCamp_gf_StopFlashingRoomChangePanelButton_TriggerFunc");
    }

    TriggerExecute(auto_libCamp_gf_StopFlashingRoomChangePanelButton_Trigger, false, false);
}

bool auto_libCamp_gf_StopFlashingRoomChangePanelButton_TriggerFunc (bool testConds, bool runActions) {
    int lp_buttonId = auto_libCamp_gf_StopFlashingRoomChangePanelButton_lp_buttonId;

    // Implementation
    if (((lp_buttonId > libCamp_gv_tS_RoomChangeButtonCount) || (libCamp_gv_tS_RoomChangeDialog == c_invalidDialogId) || (libCamp_gv_tS_RoomChangeButtons[lp_buttonId] == c_invalidDialogControlId))) {
        return true;
    }
    else {
    }
    libCamp_gv_tS_RoomChangeButtonFlashing[lp_buttonId] = false;
    return true;
}

void libCamp_gf_TS_InitializeSceneDataSingle (int lp_iD, text lp_name, string lp_image, string lp_icon) {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    lv_index = (lp_iD);
    libCamp_gv_tS_SceneIDs[lv_index] = lp_iD;
    libCamp_gv_tS_SceneNames[lv_index] = lp_name;
    libCamp_gv_tS_SceneImages[lv_index] = lp_image;
    libCamp_gv_tS_SceneIcon[lv_index] = lp_icon;
    libCamp_gv_tS_SceneCallback[lv_index] = null;
    libCamp_gv_tSX_ScenePlayed[lv_index] = false;
}

void libCamp_gf_TS_InitializeSceneData () {
    // Implementation
    libCamp_gf_TS_InitializeSceneDataSingle(1, StringExternal("Param/Value/lib_Camp_11ED9936"), "Assets\\Textures\\ui_battlereports_raynorintro.dds", "Assets\\Textures\\ui_list_battlereports_raynorintro.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(2, StringExternal("Param/Value/lib_Camp_2C87E7E3"), "Assets\\Textures\\loading-hyperionarmory.dds", "Assets\\Textures\\ui_list_battlereports_barfight.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(3, StringExternal("Param/Value/lib_Camp_23AD65B9"), "Assets\\Textures\\ui_battlereports_zeratulswarning.dds", "Assets\\Textures\\ui_list_battlereports_zeratulswarning.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(4, StringExternal("Param/Value/lib_Camp_AFB61769"), "Assets\\Textures\\ui_battlereports_tychusintro.dds", "Assets\\Textures\\ui_list_battlereports_tychusintro.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(5, StringExternal("Param/Value/lib_Camp_3725F4D5"), "Assets\\Textures\\ui_battlereports_escapefrommarsara.dds", "Assets\\Textures\\ui_list_battlereports_escapefrommarsara.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(6, StringExternal("Param/Value/lib_Camp_9CA392F6"), "Assets\\Textures\\ui_battlereports_valerianintro.dds", "Assets\\Textures\\ui_list_battlereports_valerianintro.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(7, StringExternal("Param/Value/lib_Camp_B50CE300"), "Assets\\Textures\\ui_battlereports_barfight.dds", "Assets\\Textures\\ui_list_battlereports_barfight.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(8, StringExternal("Param/Value/lib_Camp_A11E7A2C"), "Assets\\Textures\\ui_battlereports_hansonenda.dds", "Assets\\Textures\\ui_list_battlereports_hansonenda.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(9, StringExternal("Param/Value/lib_Camp_41743AAC"), "Assets\\Textures\\ui_battlereports_toshenda.dds", "Assets\\Textures\\ui_list_battlereports_toshenda.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(10, StringExternal("Param/Value/lib_Camp_F3A90455"), "Assets\\Textures\\ui_battlereports_raynorsdream.dds", "Assets\\Textures\\ui_list_battlereports_raynorsdream.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(11, StringExternal("Param/Value/lib_Camp_4AC8B2B0"), "Assets\\Textures\\ui_battlereports_charbattlefield.dds", "Assets\\Textures\\ui_list_battlereports_charbattlefield.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(12, StringExternal("Param/Value/lib_Camp_392F550C"), "Assets\\Textures\\ui_battlereports_hornervictory.dds", "Assets\\Textures\\ui_list_battlereports_hornervictory.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(13, StringExternal("Param/Value/lib_Camp_4FA89672"), "Assets\\Textures\\ui_battlereports_hansonendb.dds", "Assets\\Textures\\ui_list_battlereports_hansonendb.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(14, StringExternal("Param/Value/lib_Camp_6BD02DB4"), "Assets\\Textures\\ui_battlereports_toshendb.dds", "Assets\\Textures\\ui_list_battlereports_toshendb.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(15, StringExternal("Param/Value/lib_Camp_DD9D710E"), "Assets\\Textures\\ui_battlereports_kerriganintro.dds", "Assets\\Textures\\ui_list_battlereports_kerriganintro.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(16, StringExternal("Param/Value/lib_Camp_F0D96F1F"), "Assets\\Textures\\ui_battlereports_charintro.dds", "Assets\\Textures\\ui_list_battlereports_charintro.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(17, StringExternal("Param/Value/lib_Camp_4E8AB1E5"), "Assets\\Textures\\ui_battlereports_charbattlefieldend.dds", "Assets\\Textures\\ui_list_battlereports_charbattlefieldend.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(18, StringExternal("Param/Value/lib_Camp_11BE9934"), "Assets\\Textures\\ui_battlereports_oldrivals.dds", "Assets\\Textures\\ui_list_battlereports_oldrivals.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(19, StringExternal("Param/Value/lib_Camp_19E6D6CB"), "Assets\\Textures\\ui_battlereports_buildabettermarine.dds", "Assets\\Textures\\ui_list_battlereports_buildabettermarine.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(20, StringExternal("Param/Value/lib_Camp_59387068"), "Assets\\Textures\\ui_battlereports_thedream.dds", "Assets\\Textures\\ui_list_battlereports_thedream.dds");
    libCamp_gf_TS_InitializeSceneDataSingle(21, StringExternal("Param/Value/lib_Camp_43021831"), "Assets\\Textures\\ui_battlereports_theshowdown.dds", "Assets\\Textures\\ui_list_battlereports_theshowdown.dds");
}

void libCamp_gf_RegisterSceneCallback (int lp_scene, trigger lp_callback) {
    // Implementation
    libCamp_gv_tS_SceneCallback[(lp_scene)] = lp_callback;
}

trigger libCamp_gf_SceneCallback (int lp_scene) {
    // Implementation
    return libCamp_gv_tS_SceneCallback[(lp_scene)];
}

bool libCamp_gf_ScenePlayed (int lp_scene) {
    // Implementation
    return libCamp_gv_tSX_ScenePlayed[(lp_scene)];
}

text libCamp_gf_SceneName (int lp_scene) {
    // Implementation
    return libCamp_gv_tS_SceneNames[(lp_scene)];
}

void libCamp_gf_SetScenePlayed (int lp_scene, bool lp_played) {
    // Implementation
    libCamp_gv_tSX_ScenePlayed[(lp_scene)] = lp_played;
}

void libCamp_gf_ChangeAmbience (string lp_ambience) {
    // Implementation
    if ((lp_ambience == libCamp_gv_tS_CurrentAmbienceLink)) {
        return ;
    }
    else {
    }
    libCamp_gv_tS_CurrentAmbienceLink = lp_ambience;
    if ((lp_ambience != null)) {
        SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryAmbience, lp_ambience, c_soundtrackCueAny, c_soundtrackIndexAny, false);
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_F5EEF511") + StringToText(lp_ambience)), false);
    }
    else {
        SoundtrackStop(PlayerGroupAll(), c_soundtrackCategoryAmbience, true);
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_646D4F41") + StringExternal("Param/Value/lib_Camp_ABE2EC7C")), false);
    }
}

int libCamp_gf_StoryState (int lp_stateID) {
    // Implementation
    return ConversationDataStateGetValue(libCamp_gv_tS_StoryStateConvoID[(lp_stateID)]);
}

int libCamp_gf_StoryCredits () {
    // Implementation
    return ConversationDataStateGetValue("Credits");
}

int libCamp_gf_TS_CampaignDifficulty () {
    int auto26A25F2E_val;

    // Implementation
    auto26A25F2E_val = libCamp_gv_tSX_CampaignDifficulty;
    if (auto26A25F2E_val == 1) {
        return 1;
    }
    else if (auto26A25F2E_val == 2) {
        return 2;
    }
    else if (auto26A25F2E_val == 3) {
        return 3;
    }
    else if (auto26A25F2E_val == 4) {
        return 4;
    }
    else {
    }
    return 2;
}

void libCamp_gf_SetStoryState (int lp_stateID, int lp_value) {
    // Implementation
    ConversationDataStateSetValue(libCamp_gv_tS_StoryStateConvoID[(lp_stateID)], lp_value);
}

void libCamp_gf_SetStoryCredits (int lp_value) {
    // Implementation
    ConversationDataStateSetValue("Credits", lp_value);
    PlayerModifyPropertyInt(1, c_playerPropCredits, c_playerPropOperSetTo, libCamp_gf_StoryCredits());
}

void libCamp_gf_TS_SetCampaignDifficulty (int lp_difficulty) {
    int autoBBC4285F_val;

    // Implementation
    autoBBC4285F_val = lp_difficulty;
    if (autoBBC4285F_val == 1) {
        libCamp_gv_tSX_CampaignDifficulty = 1;
    }
    else if (autoBBC4285F_val == 2) {
        libCamp_gv_tSX_CampaignDifficulty = 2;
    }
    else if (autoBBC4285F_val == 3) {
        libCamp_gv_tSX_CampaignDifficulty = 3;
    }
    else if (autoBBC4285F_val == 4) {
        libCamp_gv_tSX_CampaignDifficulty = 4;
    }
    else {
    }
}

void libCamp_gf_TS_InitializeStateData () {
    // Implementation
    libCamp_gv_tS_InStoryMode = (libCamp_gv_tS_CurrentMap == 31);
    libCamp_gv_tS_StoryStateConvoID[(1)] = "StoryState|AchievementDisabled";
    libCamp_gv_tS_StoryStateConvoID[(2)] = "StoryState|ArmoryIntroDone";
    libCamp_gv_tS_StoryStateConvoID[(23)] = "StoryState|BattleReportCurrentSel";
    libCamp_gv_tS_StoryStateConvoID[(26)] = "StoryState|CantinaHornerLinePlayed";
    libCamp_gv_tS_StoryStateConvoID[(3)] = "StoryState|CantinaIntroDone";
    libCamp_gv_tS_StoryStateConvoID[(24)] = "StoryState|CharInvasionStarted";
    libCamp_gv_tS_StoryStateConvoID[(8)] = "StoryState|FirstMissionLabResearchObjective";
    libCamp_gv_tS_StoryStateConvoID[(7)] = "StoryState|FirstMissionMercBought";
    libCamp_gv_tS_StoryStateConvoID[(16)] = "StoryState|HansonOn";
    libCamp_gv_tS_StoryStateConvoID[(19)] = "StoryState|HornerOn";
    libCamp_gv_tS_StoryStateConvoID[(25)] = "StoryState|LabHornerLinePlayed";
    libCamp_gv_tS_StoryStateConvoID[(4)] = "StoryState|LabIntroDone";
    libCamp_gv_tS_StoryStateConvoID[(21)] = "StoryState|CowinOn";
    libCamp_gv_tS_StoryStateConvoID[(18)] = "StoryState|SwannOn";
    libCamp_gv_tS_StoryStateConvoID[(17)] = "StoryState|ToshOn";
    libCamp_gv_tS_StoryStateConvoID[(15)] = "StoryState|TychusOn";
    libCamp_gv_tS_StoryStateConvoID[(5)] = "StoryState|Hanson02DebriefingDone";
    libCamp_gv_tS_StoryStateConvoID[(6)] = "StoryState|Valerian01DebriefingDone";
    libCamp_gv_tS_StoryStateConvoID[(22)] = "StoryState|WarfieldOn";
    libCamp_gv_tS_StoryStateConvoID[(20)] = "StoryState|YbarraOn";
    libCamp_gv_tS_StoryStateConvoID[(27)] = "StoryState|HornerSecretMissionOn";
    libCamp_gv_tS_StoryStateConvoID[(28)] = "StoryState|ResearchCapNoticeProtossDone";
    libCamp_gv_tS_StoryStateConvoID[(29)] = "StoryState|ResearchCapNoticeZergDone";
    libCamp_gv_tS_StoryStateConvoID[(30)] = "StoryState|LastMissionZ2OrZ3";
    libCamp_gv_tS_StoryStateConvoID[(31)] = "StoryState|LabArtifactCount";
    libCamp_gv_tS_StoryStateConvoID[(9)] = "StoryState|ArmoryOpened";
    libCamp_gv_tS_StoryStateConvoID[(10)] = "StoryState|ArmoryVisited";
    libCamp_gv_tS_StoryStateConvoID[(11)] = "StoryState|CantinaOpened";
    libCamp_gv_tS_StoryStateConvoID[(12)] = "StoryState|CantinaVisited";
    libCamp_gv_tS_StoryStateConvoID[(13)] = "StoryState|LabOpened";
    libCamp_gv_tS_StoryStateConvoID[(14)] = "StoryState|LabVisited";
    libCamp_gv_tS_StoryStateConvoID[(32)] = "StoryState|TipFactoryPlayed";
    libCamp_gv_tS_StoryStateConvoID[(33)] = "StoryState|TipStarportPlayed";
    libCamp_gv_tS_StoryStateConvoID[(34)] = "StoryState|TipVisitLabPlayed";
    libCamp_gv_tS_StoryStateConvoID[(35)] = "StoryState|TipNewProtossResearchPlayed";
    libCamp_gv_tS_StoryStateConvoID[(36)] = "StoryState|TipNewZergResearchPlayed";
    libCamp_gv_tS_StoryStateConvoID[(37)] = "StoryState|TipZergCreepPlayed";
    libCamp_gv_tS_StoryStateConvoID[(38)] = "StoryState|TaurenOutHouseActivated";
}

void libCamp_gf_TS_UpdateStoryStates () {
    // Implementation
    ConversationDataStateSetValue("MissionCompletedCount", libCamp_gf_CountMissions(2));
    if (((libCamp_gf_LastSuccessfulMission() == 23) || (libCamp_gf_LastSuccessfulMission() == 24))) {
        ConversationDataStateSetValue("StoryState|LastMissionZ2OrZ3", 1);
    }
    else {
        ConversationDataStateSetValue("StoryState|LastMissionZ2OrZ3", 0);
    }
}

text libCamp_gf_PlanetName (int lp_planetID) {
    // Implementation
    return libCamp_gv_tS_PlanetName[(lp_planetID)];
}

int libCamp_gf_PlanetID (int lp_index) {
    // Implementation
    if (((lp_index < libCamp_gv_tSC_PLANET_FIRST) || (lp_index > libCamp_gv_tSC_PLANET_LAST))) {
        return 0;
    }
    else {
    }
    return libCamp_gv_tS_PlanetID[lp_index];
}

text libCamp_gf_PlanetSubtitle (int lp_planetID) {
    // Implementation
    return libCamp_gv_tS_PlanetSubtitle[(lp_planetID)];
}

int libCamp_gf_PlanetMission (int lp_planetID) {
    int auto6D3A38E7_i;

    // Variable Declarations
    int lv_indexMission;

    // Variable Initialization

    // Implementation
    auto6D3A38E7_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto6D3A38E7_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto6D3A38E7_i];
        if ((libCamp_gf_MissionPlanet(lv_indexMission) == lp_planetID) && (libCamp_gf_MissionStatusCheck(lv_indexMission, 1) == true)) {
            return lv_indexMission;
        }
        else {
        }
        auto6D3A38E7_i = auto6D3A38E7_i + 1;
    }
    return 0;
}

string libCamp_gf_PlanetLighting (int lp_planetID) {
    // Implementation
    return libCamp_gv_tS_PlanetLighting[(lp_planetID)];
}

string libCamp_gf_PlanetIconModel (int lp_planetID) {
    // Implementation
    return libCamp_gv_tS_PlanetButtonModel[(lp_planetID)];
}

string libCamp_gf_PlanetModel (int lp_planetID) {
    // Implementation
    return libCamp_gv_tS_PlanetModel[(lp_planetID)];
}

text libCamp_gf_PlanetMissionResearchOpportunitiesText (int lp_mission, text lp_protossStyle, text lp_zergStyle) {
    // Variable Declarations
    int lv_researchProtoss;
    int lv_researchZerg;
    text lv_researchText;

    // Variable Initialization

    // Implementation
    lv_researchText = StringExternal("Param/Value/lib_Camp_8587E962");
    lv_researchProtoss = libCamp_gf_TS_StoryResearchMissionOpportunities(lp_mission, 1);
    lv_researchZerg = libCamp_gf_TS_StoryResearchMissionOpportunities(lp_mission, 2);
    if ((lv_researchProtoss <= 0) && (lv_researchZerg <= 0)) {
        return null;
    }
    else {
    }
    if ((lv_researchProtoss > 0)) {
        lv_researchText = (lv_researchText + StringExternal("Param/Value/lib_Camp_B150EF10") + lp_protossStyle + StringExternal("Param/Value/lib_Camp_164027AB") + IntToText(lv_researchProtoss) + StringExternal("Param/Value/lib_Camp_9CA72998"));
        if ((lv_researchZerg > 0)) {
            lv_researchText = (lv_researchText + StringExternal("Param/Value/lib_Camp_497471D7"));
        }
        else {
        }
    }
    else {
    }
    if ((lv_researchZerg > 0)) {
        lv_researchText = (lv_researchText + StringExternal("Param/Value/lib_Camp_607E15F5") + lp_zergStyle + StringExternal("Param/Value/lib_Camp_5EE0797E") + IntToText(lv_researchZerg) + StringExternal("Param/Value/lib_Camp_E9C6C0D6"));
    }
    else {
    }
    return lv_researchText;
}

int libCamp_gf_FirstPlanet () {
    // Implementation
    return libCamp_gf_PlanetID(libCamp_gv_tSC_PLANET_FIRST);
}

int libCamp_gf_LastPlanet () {
    // Implementation
    return libCamp_gf_PlanetID(libCamp_gv_tSC_PLANET_LAST);
}

void libCamp_gf_TS_InitializePlanetDataSingle (int lp_planetID, text lp_name, text lp_subtitle, string lp_model, string lp_buttonModel, string lp_lighting, string lp_image, soundlink lp_ambientSound) {
    // Variable Declarations
    int lv_planetIndex;

    // Variable Initialization

    // Implementation
    lv_planetIndex = (lp_planetID);
    libCamp_gv_tS_PlanetID[lv_planetIndex] = lp_planetID;
    libCamp_gv_tS_PlanetName[lv_planetIndex] = lp_name;
    libCamp_gv_tS_PlanetSubtitle[lv_planetIndex] = lp_subtitle;
    libCamp_gv_tS_PlanetModel[lv_planetIndex] = lp_model;
    libCamp_gv_tS_PlanetButtonModel[lv_planetIndex] = lp_buttonModel;
    libCamp_gv_tS_PlanetLighting[lv_planetIndex] = lp_lighting;
    libCamp_gv_tS_PlanetImage[lv_planetIndex] = lp_image;
    libCamp_gv_tS_PlanetAmbientSound[lv_planetIndex] = lp_ambientSound;
    libCamp_gv_tS_PlanetMission[lv_planetIndex] = 0;
}

void libCamp_gf_TS_InitializePlanetData () {
    // Implementation
    libCamp_gf_TS_InitializePlanetDataSingle(1, StringExternal("Param/Value/lib_Camp_32DAF29C"), StringExternal("Param/Value/lib_Camp_E4C25526"), "PlanetViewAgria", "PlanetIconAgria", "PlanetViewAgria", "Assets\\Textures\\loading-agria.dds", SoundLink("Ambience_Agria", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(2, StringExternal("Param/Value/lib_Camp_67D7B0A2"), StringExternal("Param/Value/lib_Camp_DB058B20"), "PlanetViewAiur", "PlanetIconAiur", "PlanetViewAiur", "Assets\\Textures\\loading-aiur.dds", null);
    libCamp_gf_TS_InitializePlanetDataSingle(4, StringExternal("Param/Value/lib_Camp_17EF9630"), StringExternal("Param/Value/lib_Camp_B0F79BF2"), "PlanetViewAvernus", "PlanetIconAvernus", "PlanetViewAvernus", "Assets\\Textures\\loading-avernus.dds", SoundLink("Ambience_Avernus", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(6, StringExternal("Param/Value/lib_Camp_25484E49"), StringExternal("Param/Value/lib_Camp_E890C71F"), "PlanetViewBelShir", "PlanetIconBelShir", "PlanetViewBelShir", "Assets\\Textures\\loading-belshir.dds", SoundLink("Ambience_BelShir", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(11, StringExternal("Param/Value/lib_Camp_BFBBD422"), StringExternal("Param/Value/lib_Camp_46677C72"), "PlanetViewCastanar", "PlanetIconCastanar", "PlanetViewCastanar", "Assets\\Textures\\loading-castanar.dds", null);
    libCamp_gf_TS_InitializePlanetDataSingle(12, StringExternal("Param/Value/lib_Camp_EB15BEFE"), StringExternal("Param/Value/lib_Camp_F37EB66E"), "PlanetViewChar", "PlanetIconChar", "PlanetViewChar", "Assets\\Textures\\loading-char.dds", SoundLink("Ambience_Char", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(13, StringExternal("Param/Value/lib_Camp_217CF675"), StringExternal("Param/Value/lib_Camp_B5050D6C"), "PlanetViewPortZion", "PlanetIconPortZion", "PlanetViewPortZion", "Assets\\Textures\\loading-portzion.dds", null);
    libCamp_gf_TS_InitializePlanetDataSingle(16, StringExternal("Param/Value/lib_Camp_2F01CD49"), StringExternal("Param/Value/lib_Camp_CCFB8F00"), "PlanetViewHaven", "PlanetIconHaven", "PlanetViewHaven", "Assets\\Textures\\loading-haven.dds", SoundLink("Ambience_Haven", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(19, StringExternal("Param/Value/lib_Camp_19E56832"), StringExternal("Param/Value/lib_Camp_2739E8AA"), "PlanetViewKorhal", "PlanetIconKorhal", "PlanetViewKorhal", "Assets\\Textures\\loading-korhal.dds", SoundLink("Ambience_Korhal", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(20, StringExternal("Param/Value/lib_Camp_4FD4EF13"), StringExternal("Param/Value/lib_Camp_E2E1FD9A"), "PlanetViewMarSara", "PlanetIconMarSara", "PlanetViewMarSara", "Assets\\Textures\\loading-marsara.dds", SoundLink("Ambience_MarSara", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(21, StringExternal("Param/Value/lib_Camp_BD3C2C63"), StringExternal("Param/Value/lib_Camp_84D42FBF"), "PlanetViewMeinhoff", "PlanetIconMeinhoff", "PlanetViewMeinhoff", "Assets\\Textures\\loading-meinhoff.dds", SoundLink("Ambience_Meinhoff", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(22, StringExternal("Param/Value/lib_Camp_3BC660EA"), StringExternal("Param/Value/lib_Camp_A022EEA1"), "PlanetViewMonlyth", "PlanetIconMonlyth", "PlanetViewMeinhoff", "Assets\\Textures\\loading-monlyth.dds", SoundLink("Ambience_Monlyth", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(24, StringExternal("Param/Value/lib_Camp_272CE763"), StringExternal("Param/Value/lib_Camp_8DF6EFB8"), "PlanetViewNewFolsom", "PlanetIconNewFolsom", "PlanetViewNewFolsom", "Assets\\Textures\\loading-newfolsom.dds", SoundLink("Ambience_NewFolsom", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(29, StringExternal("Param/Value/lib_Camp_74827189"), StringExternal("Param/Value/lib_Camp_F9A7EE82"), "PlanetViewRedstone", "PlanetIconRedstone", "PlanetViewRedstone", "Assets\\Textures\\loading-redstone.dds", SoundLink("Ambience_Redstone", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(31, StringExternal("Param/Value/lib_Camp_5622FB12"), StringExternal("Param/Value/lib_Camp_5431E016"), "PlanetViewSigmaQuadrant", "PlanetIconSigmaQuadrant", null, "Assets\\Textures\\loading-ulnar.dds", null);
    libCamp_gf_TS_InitializePlanetDataSingle(32, StringExternal("Param/Value/lib_Camp_E0079759"), StringExternal("Param/Value/lib_Camp_A5BC4B4B"), "PlanetViewTarsonis", "PlanetIconTarsonis", "PlanetViewTarsonis", "Assets\\Textures\\loading-tarsonis.dds", SoundLink("Ambience_Tarsonis", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(34, StringExternal("Param/Value/lib_Camp_0A846A0F"), StringExternal("Param/Value/lib_Camp_BFC1F78D"), "PlanetViewTyphon", "PlanetIconTyphon", null, "Assets\\Textures\\loading-typhon.dds", null);
    libCamp_gf_TS_InitializePlanetDataSingle(35, StringExternal("Param/Value/lib_Camp_1CF63478"), StringExternal("Param/Value/lib_Camp_72810DB5"), "PlanetViewTyrador", "PlanetIconTyrador", "PlanetViewTyrador", "Assets\\Textures\\loading-tyrador.dds", null);
    libCamp_gf_TS_InitializePlanetDataSingle(36, StringExternal("Param/Value/lib_Camp_B21453FB"), StringExternal("Param/Value/lib_Camp_812B3F4F"), "PlanetViewUlaan", "PlanetIconUlaan", "PlanetViewUlaan", "Assets\\Textures\\loading-ulaan.dds", null);
    libCamp_gf_TS_InitializePlanetDataSingle(30, StringExternal("Param/Value/lib_Camp_F82527E0"), StringExternal("Param/Value/lib_Camp_0FA3186C"), "PlanetViewShakuras", "PlanetIconUlnar", null, "Assets\\Textures\\loading-ulnar.dds", null);
    libCamp_gf_TS_InitializePlanetDataSingle(38, StringExternal("Param/Value/lib_Camp_478B9C37"), StringExternal("Param/Value/lib_Camp_97FD4573"), "PlanetViewValhalla", "PlanetIconValhalla", "PlanetViewValhalla", "Assets\\Textures\\loading-valhalla.dds", null);
    libCamp_gf_TS_InitializePlanetDataSingle(41, StringExternal("Param/Value/lib_Camp_B5829691"), StringExternal("Param/Value/lib_Camp_1637B84F"), "PlanetViewXil", "PlanetIconXil", "PlanetViewXil", "Assets\\Textures\\loading-xil.dds", SoundLink("Ambience_Xil", -1));
    libCamp_gf_TS_InitializePlanetDataSingle(42, StringExternal("Param/Value/lib_Camp_661E4410"), StringExternal("Param/Value/lib_Camp_F137ABE5"), "PlanetViewZhakulDas", "PlanetIconZhakulDas", "PlanetViewZhakulDas", "Assets\\Textures\\loading-zhakuldas.dds", null);
}

int libCamp_gf_AddPlanet (int lp_planet) {
    int autoA0174EFC_i;
    int autoA4BDE018_val;
    int auto01A44EB2_val;

    // Variable Declarations
    int lv_planetIndex;
    int lv_mission;
    int lv_missionIndex;
    int lv_contactIndex;
    int lv_groupEnabled;
    int lv_groupEnabledIndex;
    int lv_researchProtoss;
    int lv_researchZerg;
    text lv_researchText;
    int lv_objective;
    int lv_bonusRewards;
    string lv_contactTooltipConvo;
    string lv_techTooltipID;

    // Variable Initialization
    lv_techTooltipID = "";

    // Implementation
    lv_planetIndex = (lp_planet);
    lv_mission = libCamp_gf_PlanetMission(lp_planet);
    lv_missionIndex = (lv_mission);
    PlanetCreate(PlayerGroupAll(), c_planetStateActive);
    PlanetSetPlanetName(PlanetLastCreated(), libCamp_gf_PlanetName(lp_planet));
    PlanetSetPlanetModelLink(PlanetLastCreated(), libCamp_gv_tS_PlanetButtonModel[lv_planetIndex]);
    PlanetSetBackgroundModelLink(PlanetLastCreated(), libCamp_gv_tS_PlanetModel[lv_planetIndex]);
    PlanetSetTooltipText(PlanetLastCreated(), libCamp_gf_MissionPlanetInfo(lv_mission));
    PlanetSetMissionName(PlanetLastCreated(), libCamp_gf_MissionNameInUpperCase(lv_mission));
    PlanetSetPrimaryObjectiveText(PlanetLastCreated(), (libCamp_gf_MissionObjectivesText(lv_mission)));
    PlanetSetRewardTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_98485AE1"));
    if ((libCamp_gf_MissionReward(lv_mission) <= 0)) {
        PlanetSetRewardText(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_0C3B6D71"));
    }
    else {
        PlanetSetRewardText(PlanetLastCreated(), (libCamp_gf_FormatCredits(libCamp_gf_MissionReward(lv_mission), false)));
    }
    if ((lv_mission == 16)) {
        PlanetSetMissionTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_549F1F43"));
        PlanetSetPlanetText(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_50B1B2CB"));
    }
    else {
        PlanetSetMissionTitle(PlanetLastCreated(), StringExternal("UI/PlanetPanelMissionTitle"));
    }
    PlanetSetPrimaryObjectiveTitle(PlanetLastCreated(), StringExternal("UI/PlanetPanelObjectiveTitle"));
    PlanetSetSecondaryObjectiveTitle(PlanetLastCreated(), StringExternal("UI/PlanetPanelBonusObjectiveTitle"));
    PlanetSetResearchTitle(PlanetLastCreated(), StringExternal("UI/PlanetPanelResearchTitle"));
    PlanetSetBonusTitle(PlanetLastCreated(), StringExternal("UI/PlanetPanelBonusTitle"));
    if ((lv_mission == 6)) {
        lv_researchText = StringExternal("Param/Value/lib_Camp_843C196A");
    }
    else {
        lv_researchText = libCamp_gf_PlanetMissionResearchOpportunitiesText(lv_mission, StringExternal("Param/Value/lib_Camp_F706E9F6"), StringExternal("Param/Value/lib_Camp_6B5EC3C6"));
    }
    if ((lv_researchText != null)) {
        PlanetSetResearchText(PlanetLastCreated(), lv_researchText);
    }
    else {
    }
    lv_bonusRewards = 0;
    autoA0174EFC_i = 1;
    while (autoA0174EFC_i <= libCamp_gv_TSC_MISSIONOBJECTIVECOUNT) {
        if (libCamp_gv_tS_MissionObjectives[lv_mission][autoA0174EFC_i] != 0) {
            lv_objective = libCamp_gv_tS_MissionObjectives[lv_mission][autoA0174EFC_i];
            lv_bonusRewards += (libCamp_gf_MissionObjectiveItemCount(lv_objective) * libCamp_gf_MissionObjectiveCreditsPerItem(lv_objective));
        }
        autoA0174EFC_i = autoA0174EFC_i + 1;
    }
    if ((lv_bonusRewards > 0)) {
        PlanetSetBonusText(PlanetLastCreated(), libCamp_gf_FormatCredits(lv_bonusRewards, true));
    }
    else {
    }
    lv_groupEnabled = libCamp_gf_MissionUnlockedTechSubgorup(lv_mission, 1);
    lv_groupEnabledIndex = (lv_groupEnabled);
    PlanetSetTechnologyTooltipText(PlanetLastCreated(), ConversationDataStateText("PlanetPanelTooltips|TechImage", "Description"));
    if ((lv_groupEnabled != 0) && (libCamp_gv_tS_TechGroupShowOnReport[lv_groupEnabledIndex] == true)) {
        PlanetSetTechnologyName(PlanetLastCreated(), UnitTypeGetName(libCamp_gf_StoryTechGroupUnitType(lv_groupEnabled)));
        PlanetSetTechnologyText(PlanetLastCreated(), libCamp_gf_StoryTechGroupDescription(lv_groupEnabled));
        PlanetSetTechnologyTooltipText(PlanetLastCreated(), libCamp_gf_StoryTechGroupTooltip(lv_groupEnabled));
        PlanetSetTechnologyUnitLink(PlanetLastCreated(), libCamp_gf_StoryTechGroupUnitType(lv_groupEnabled));
    }
    else {
        PlanetSetTechnologyName(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_12E4122F"));
    }
    if (((lv_mission == 10))) {
        PlanetSetTechnologyName(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_F41EE844"));
        PlanetSetTechnologyText(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_6DDB4C5F"));
        PlanetSetTechnologyUnitLink(PlanetLastCreated(), "QuestionMark");
    }
    else {
    }
    lv_contactIndex = (libCamp_gv_tS_MissionContact[lv_missionIndex]);
    PlanetSetContactName(PlanetLastCreated(), libCamp_gv_tS_ContactName[lv_contactIndex]);
    if ((lv_mission == 4)) {
        PlanetSetContactModelLink(PlanetLastCreated(), "HansonDistressPortrait");
    }
    else {
        PlanetSetContactModelLink(PlanetLastCreated(), libCamp_gf_ContactPortraitModel(libCamp_gf_MissionContact(lv_mission)));
    }
    lv_contactTooltipConvo = "PlanetPanelTooltips|Employer_Image";
    autoA4BDE018_val = libCamp_gv_tS_MissionContact[lv_missionIndex];
    if (autoA4BDE018_val == 44) {
        lv_contactTooltipConvo = "PlanetPanelTooltips|DrHanson";
    }
    else if (autoA4BDE018_val == 1) {
        lv_contactTooltipConvo = "PlanetPanelTooltips|Adjutant";
    }
    else if (autoA4BDE018_val == 64) {
        lv_contactTooltipConvo = "PlanetPanelTooltips|CrownPrinceValerian";
    }
    else if (autoA4BDE018_val == 63) {
        lv_contactTooltipConvo = "PlanetPanelTooltips|Tychus";
    }
    else if (autoA4BDE018_val == 62) {
        auto01A44EB2_val = lv_mission;
        if (auto01A44EB2_val == 8) {
            lv_contactTooltipConvo = "PlanetPanelTooltips|Tosh_Tosh01";
        }
        else if (auto01A44EB2_val == 9) {
            lv_contactTooltipConvo = "PlanetPanelTooltips|Tosh_Tosh02/03";
        }
        else if (auto01A44EB2_val == 10) {
            lv_contactTooltipConvo = "PlanetPanelTooltips|Tosh_Tosh02/03";
        }
        else if (auto01A44EB2_val == 11) {
            lv_contactTooltipConvo = "PlanetPanelTooltips|Tosh_Tosh02/03";
        }
        else {
        }
    }
    else if (autoA4BDE018_val == 47) {
        lv_contactTooltipConvo = "PlanetPanelTooltips|Horner";
    }
    else if (autoA4BDE018_val == 68) {
        lv_contactTooltipConvo = "PlanetPanelTooltips|Zeratul";
    }
    else {
    }
    PlanetSetContactTooltipText(PlanetLastCreated(), ConversationDataStateText(lv_contactTooltipConvo, "Description"));
    if (((lv_mission == 26) || (lv_mission == 27) || (lv_mission == 28) || (lv_mission == 29))) {
        PlanetSetContactTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_C5B9FF07"));
        PlanetSetTechnologyTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_01685EF0"));
    }
    else {
    }
    return PlanetLastCreated();
}

int libCamp_gf_TechPurchasableTechID (int lp_techPurchasable) {
    int auto0A5AA2BD_i;

    // Variable Declarations
    int lv_tech;

    // Variable Initialization

    // Implementation
    auto0A5AA2BD_i = libCamp_gv_TSC_TECH_FIRST;
    while (auto0A5AA2BD_i <= libCamp_gv_TSC_TECH_LAST) {
        lv_tech = libCamp_gv_tS_TechID[auto0A5AA2BD_i];
        if ((libCamp_gv_tS_Tech_UI[(lv_tech)] == lp_techPurchasable)) {
            return lv_tech;
        }
        else {
        }
        auto0A5AA2BD_i = auto0A5AA2BD_i + 1;
    }
    return 0;
}

bool libCamp_gf_CanAffordTech (int lp_techID) {
    // Variable Declarations
    int lv_techIndex;

    // Variable Initialization

    // Implementation
    lv_techIndex = (lp_techID);
    if ((libCamp_gv_tSX_Tech_Status[lv_techIndex] != 0) && (libCamp_gf_StoryCredits() >= libCamp_gf_StoryTechCost(lp_techID))) {
        return true;
    }
    else {
        return false;
    }
}

int libCamp_gf_CostofPurchasedTech () {
    int autoA540636D_i;

    // Variable Declarations
    int lv_indexTech;
    int lv_total;

    // Variable Initialization

    // Implementation
    lv_total = 0;
    autoA540636D_i = libCamp_gv_TSC_TECH_FIRST;
    while (autoA540636D_i <= libCamp_gv_TSC_TECH_LAST) {
        lv_indexTech = libCamp_gv_tS_TechID[autoA540636D_i];
        if ((libCamp_gv_tSX_Tech_Status[(lv_indexTech)] == 2)) {
            lv_total = (lv_total + libCamp_gf_StoryTechCost(lv_indexTech));
        }
        else {
        }
        autoA540636D_i = autoA540636D_i + 1;
    }
    return lv_total;
}

int libCamp_gf_NumberofPurchasedTech () {
    int auto558C5954_ae;
    int auto558C5954_ai;

    // Variable Declarations
    int lv_index;
    int lv_total;

    // Variable Initialization

    // Implementation
    lv_total = 0;
    auto558C5954_ae = libCamp_gv_TSC_TECH_LAST;
    auto558C5954_ai = 1;
    lv_index = libCamp_gv_TSC_TECH_FIRST;
    for ( ; ( (auto558C5954_ai >= 0 && lv_index <= auto558C5954_ae) || (auto558C5954_ai <= 0 && lv_index >= auto558C5954_ae) ) ; lv_index += auto558C5954_ai ) {
        if ((libCamp_gv_tSX_Tech_Status[lv_index] == 2)) {
            lv_total += 1;
        }
        else {
        }
    }
    return lv_total;
}

int libCamp_gf_NumberofAvailableTech () {
    int auto2630D323_ae;
    int auto2630D323_ai;

    // Variable Declarations
    int lv_index;
    int lv_total;

    // Variable Initialization

    // Implementation
    lv_total = 0;
    auto2630D323_ae = libCamp_gv_TSC_TECH_LAST;
    auto2630D323_ai = 1;
    lv_index = libCamp_gv_TSC_TECH_FIRST;
    for ( ; ( (auto2630D323_ai >= 0 && lv_index <= auto2630D323_ae) || (auto2630D323_ai <= 0 && lv_index >= auto2630D323_ae) ) ; lv_index += auto2630D323_ai ) {
        if (((libCamp_gv_tSX_Tech_Status[lv_index] == 1) || (libCamp_gv_tSX_Tech_Status[lv_index] == 4))) {
            lv_total += 1;
        }
        else {
        }
    }
    return lv_total;
}

string libCamp_gf_TS_StoryTechConvoID (int lp_tech) {
    // Implementation
    return libCamp_gv_tS_Tech_ConvoID[(lp_tech)];
}

text libCamp_gf_StoryTechName (int lp_tech) {
    // Implementation
    return ConversationDataStateName(libCamp_gf_TS_StoryTechConvoID(lp_tech));
}

text libCamp_gf_StoryTechTooltip (int lp_tech) {
    // Implementation
    return ConversationDataStateText(libCamp_gf_TS_StoryTechConvoID(lp_tech), ("Tooltip"));
}

text libCamp_gf_StoryTechDescription (int lp_tech) {
    // Implementation
    return ConversationDataStateText(libCamp_gf_TS_StoryTechConvoID(lp_tech), ("Description"));
}

int libCamp_gf_StoryTechCost (int lp_tech) {
    // Implementation
    return FixedToInt(ConversationDataStateFixedValue(libCamp_gf_TS_StoryTechConvoID(lp_tech), ("Cost")));
}

int libCamp_gf_StoryTechSlot (int lp_tech) {
    // Implementation
    return FixedToInt(ConversationDataStateFixedValue(libCamp_gf_TS_StoryTechConvoID(lp_tech), ("Slot")));
}

string libCamp_gf_StoryTechIcon (int lp_tech) {
    // Implementation
    return ConversationDataStateImagePath(libCamp_gf_TS_StoryTechConvoID(lp_tech));
}

string libCamp_gf_StoryTechMovie (int lp_tech) {
    // Implementation
    return ConversationDataStateMoviePath(libCamp_gf_TS_StoryTechConvoID(lp_tech));
}

string libCamp_gf_StoryTechUpgrade (int lp_tech, int lp_index) {
    int auto749D8E3E_val;

    // Variable Declarations
    string lv_convoID;

    // Variable Initialization
    lv_convoID = "Upgrade1";

    // Implementation
    auto749D8E3E_val = lp_index;
    if (auto749D8E3E_val == 1) {
        lv_convoID = "Upgrade1";
    }
    else if (auto749D8E3E_val == 2) {
        lv_convoID = "Upgrade2";
    }
    else {
        lv_convoID = "Upgrade1";
    }
    return ConversationDataStateUpgrade(libCamp_gf_TS_StoryTechConvoID(lp_tech), (lv_convoID));
}

abilcmd libCamp_gf_StoryTechAbilityCommand (int lp_tech, int lp_index) {
    int autoBF14B95F_val;

    // Variable Declarations
    string lv_convoID;

    // Variable Initialization
    lv_convoID = "AC1";

    // Implementation
    autoBF14B95F_val = lp_index;
    if (autoBF14B95F_val == 1) {
        lv_convoID = "AC1";
    }
    else if (autoBF14B95F_val == 2) {
        lv_convoID = "AC2";
    }
    else if (autoBF14B95F_val == 3) {
        lv_convoID = "AC3";
    }
    else if (autoBF14B95F_val == 4) {
        lv_convoID = "AC4";
    }
    else {
        lv_convoID = "AC1";
    }
    return ConversationDataStateAbilCmd(libCamp_gf_TS_StoryTechConvoID(lp_tech), (lv_convoID));
}

bool libCamp_gf_StoryTechUnitIsEnabled (string lp_techUnit) {
    int autoC8272909_i;

    // Variable Declarations
    int lv_indexTechGroup;

    // Variable Initialization

    // Implementation
    autoC8272909_i = libCamp_gv_TSC_TECHGROUP_FIRST;
    while (autoC8272909_i <= libCamp_gv_TSC_TECHGROUP_LAST) {
        lv_indexTechGroup = libCamp_gv_tS_TechGroupID[autoC8272909_i];
        if ((libCamp_gv_tS_TechGroupUnitType[(lv_indexTechGroup)] == lp_techUnit)) {
            return (libCamp_gv_tS_TechGroupState[(lv_indexTechGroup)] == c_purchaseCategoryStateEnabled);
        }
        else {
        }
        autoC8272909_i = autoC8272909_i + 1;
    }
    if ((lp_techUnit == "Raven")) {
        return libCamp_gf_StoryResearchStateCheck(7, 2);
    }
    else {
    }
    if ((lp_techUnit == "ScienceVessel")) {
        return libCamp_gf_StoryResearchStateCheck(8, 2);
    }
    else {
    }
    if ((lp_techUnit == "TechReactor")) {
        return libCamp_gf_StoryResearchStateCheck(9, 2);
    }
    else {
    }
    if ((lp_techUnit == "PlanetaryFortress")) {
        return libCamp_gf_StoryResearchStateCheck(13, 2);
    }
    else {
    }
    if ((lp_techUnit == "PerditionTurret")) {
        return libCamp_gf_StoryResearchStateCheck(14, 2);
    }
    else {
    }
    if ((lp_techUnit == "Predator")) {
        return libCamp_gf_StoryResearchStateCheck(15, 2);
    }
    else {
    }
    if ((lp_techUnit == "Hercules")) {
        return libCamp_gf_StoryResearchStateCheck(16, 2);
    }
    else {
    }
    if ((lp_techUnit == "HiveMindEmulator")) {
        return libCamp_gf_StoryResearchStateCheck(19, 2);
    }
    else {
    }
    if ((lp_techUnit == "PsiDisruptor")) {
        return libCamp_gf_StoryResearchStateCheck(20, 2);
    }
    else {
    }
    return false;
}

string libCamp_gf_StoryTechGroupIcon (int lp_group) {
    // Implementation
    return libCamp_gv_tS_TechGroupIcon[(lp_group)];
}

string libCamp_gf_StoryTechGroupUnitType (int lp_group) {
    // Implementation
    return libCamp_gv_tS_TechGroupUnitType[(lp_group)];
}

text libCamp_gf_StoryTechGroupDescription (int lp_group) {
    // Implementation
    return libCamp_gv_tS_TechGroupDescription[(lp_group)];
}

text libCamp_gf_StoryTechGroupTooltip (int lp_group) {
    // Implementation
    return libCamp_gv_tS_TechGroupTooltip[(lp_group)];
}

bool libCamp_gf_StoryTechStateCheck (int lp_storyTech, int lp_state) {
    // Implementation
    return (libCamp_gv_tSX_Tech_Status[(lp_storyTech)] == lp_state);
}

string libCamp_gf_TS_HelpUnitsPanel_UnitTypeStringID (string lp_unitType) {
    // Implementation
    return (lp_unitType);
}

bool libCamp_gf_TS_HelpUnitsPanel_EnabledUnitTypeAlreadyExisted (string lp_unitType) {
    // Implementation
    return DataTableValueExists(true, libCamp_gf_TS_HelpUnitsPanel_UnitTypeStringID(lp_unitType));
}

bool libCamp_gf_TS_StoryTechGroupUIUnlocked (int lp_group) {
    int autoF9141DF8_val;

    // Implementation
    autoF9141DF8_val = lp_group;
    if (autoF9141DF8_val == 2) {
        return (libCamp_gf_NumberOfMissions(3) >= 6);
    }
    else if (autoF9141DF8_val == 3) {
        return (libCamp_gf_NumberOfMissions(3) >= 9);
    }
    else if (autoF9141DF8_val == 4) {
        return (libCamp_gf_NumberOfMissions(3) >= 12);
    }
    else {
    }
    return (libCamp_gv_tS_TechGroupState[(lp_group)] == c_purchaseCategoryStateEnabled);
}

int libCamp_gf_TS_StoryTechPurchasedCountInCategory (int lp_category) {
    int autoE51DDEB2_i;

    // Variable Declarations
    int lv_indexTech;
    int lv_techGroup;
    int lv_techCategory;
    int lv_count;

    // Variable Initialization

    // Implementation
    lv_count = 0;
    autoE51DDEB2_i = libCamp_gv_TSC_TECH_FIRST;
    while (autoE51DDEB2_i <= libCamp_gv_TSC_TECH_LAST) {
        lv_indexTech = libCamp_gv_tS_TechID[autoE51DDEB2_i];
        lv_techGroup = libCamp_gv_tS_Tech_GroupID[(lv_indexTech)];
        lv_techCategory = libCamp_gv_tS_TechGroupCategoryID[(lv_techGroup)];
        if ((lv_techCategory == lp_category) && (libCamp_gf_StoryTechStateCheck(lv_indexTech, 2) == true)) {
            lv_count += 1;
        }
        else {
        }
        autoE51DDEB2_i = autoE51DDEB2_i + 1;
    }
    return lv_count;
}

void libCamp_gf_SetTechRestrictionsCallback (trigger lp_callbackTrigger) {
    // Implementation
    libCamp_gv_tS_TechLimitsCallback = lp_callbackTrigger;
}

void libCamp_gf_DisplayTechConsole (trigger lp_exitTrigger) {
    // Implementation
    libCamp_gv_tS_TechExitCallback = lp_exitTrigger;
    libCamp_gf_TS_CreateTechUI();
    libCamp_gf_HideStoryUI(false, false);
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypePurchasePanel, true);
    if ((PurchaseGetSelectedPurchaseCategory(1) == c_invalidPurchaseCategoryId)) {
        PurchaseSetSelectedPurchaseCategory(PlayerGroupAll(), libCamp_gv_tS_TechCategory_UI[(2)]);
    }
    else {
    }
}

void libCamp_gf_EnableCampaignTechUnit (bool lp_enableDisable, int lp_techUnit, int lp_player) {
    int auto7F02F34F_val;

    // Variable Declarations
    bool lv_allowDisallow;

    // Variable Initialization
    lv_allowDisallow = true;

    // Implementation
    if ((lp_enableDisable == true)) {
        lv_allowDisallow = true;
        libCamp_gv_tS_TechGroupState[(lp_techUnit)] = c_purchaseCategoryStateEnabled;
        libCamp_gf_AddUnitTypeToUnitHelpPanel(libCamp_gf_StoryTechGroupUnitType(lp_techUnit), true, lp_player);
    }
    else {
        lv_allowDisallow = false;
        libCamp_gv_tS_TechGroupState[(lp_techUnit)] = c_purchaseCategoryStateHidden;
    }
    auto7F02F34F_val = lp_techUnit;
    if (auto7F02F34F_val == 3) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("CommandCenterTrain", 0), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 4) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("TerranBuild", 0), lv_allowDisallow);
        TechTreeAbilityAllow(lp_player, AbilityCommand("TerranBuild", 1), lv_allowDisallow);
        TechTreeAbilityAllow(lp_player, AbilityCommand("TerranBuild", 2), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 1) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("TerranBuild", 6), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 2) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("TerranBuild", 5), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 5) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("BarracksTrain", 0), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 6) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("BarracksTrain", 4), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 7) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("BarracksTrain", 5), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 8) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("BarracksTrain", 3), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 9) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("BarracksTrain", 1), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 10) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("FactoryTrain", 5), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 12) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("FactoryTrain", 6), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 13) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("FactoryTrain", 7), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 11) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("FactoryTrain", 8), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 14) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("FactoryTrain", 1), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 15) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("StarportTrain", 0), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 16) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("StarportTrain", 7), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 17) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("StarportTrain", 4), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 18) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("StarportTrain", 1), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 19) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("StarportTrain", 3), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 21) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("BarracksTrain", 6), lv_allowDisallow);
        if ((lv_allowDisallow == true)) {
            TechTreeUpgradeAddLevel(lp_player, "SpectreTooltipUpgrade", 1);
        }
        else {
        }
    }
    else if (auto7F02F34F_val == 20) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("BarracksTrain", 2), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 22) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("FactoryTrain", 4), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 23) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("BarracksAddOns", 1), lv_allowDisallow);
    }
    else if (auto7F02F34F_val == 24) {
        TechTreeAbilityAllow(lp_player, AbilityCommand("TerranBuild", 8), lv_allowDisallow);
    }
    else {
    }
    libCamp_gf_TS_UpdateTechAddons(lp_player);
    libCamp_gf_TS_UpdateTechUpgrades(lp_player);
}

void libCamp_gf_AddUnitTypeToUnitHelpPanel (string lp_unitType, bool lp_saveInHistory, int lp_player) {
    // Implementation
    TechTreeUnitHelp(lp_player, lp_unitType, true);
    if ((lp_saveInHistory == true)) {
        libCamp_gf_TS_HelpUnitsPanel_AddEnabledUnitType(lp_unitType);
    }
    else {
    }
}

void libCamp_gf_ApplyCampaignTech (int lp_player) {
    int auto8191891C_i;
    int autoBF8ED7BC_ae;
    int autoBF8ED7BC_ai;
    int auto160227D4_ae;
    int auto160227D4_ai;

    // Variable Declarations
    int lv_indexTech;
    int lv_techACIndex;
    int lv_techUGIndex;

    // Variable Initialization

    // Implementation
    TechTreeRestrictionsEnable(lp_player, true);
    libCamp_gf_TS_UpdateTechStates();
    libCamp_gf_TS_ApplyCampaignTechLimitsUnlockUnits(lp_player);
    TechTreeUpgradeAddLevel(lp_player, "ReaperSpeed", 1);
    TechTreeUpgradeAddLevel(lp_player, "ReaperD8Charge", 1);
    TechTreeUpgradeAddLevel(lp_player, "SiegeTech", 1);
    TechTreeUpgradeAddLevel(lp_player, "BansheeCloak", 1);
    TechTreeUpgradeAddLevel(lp_player, "WraithCloak", 1);
    TechTreeUpgradeAddLevel(lp_player, "YamatoCannon", 1);
    TechTreeUpgradeAddLevel(lp_player, "PersonalCloaking", 1);
    TechTreeUpgradeAddLevel(lp_player, "HunterSeeker", 1);
    auto8191891C_i = libCamp_gv_TSC_TECH_FIRST;
    while (auto8191891C_i <= libCamp_gv_TSC_TECH_LAST) {
        lv_indexTech = libCamp_gv_tS_TechID[auto8191891C_i];
        autoBF8ED7BC_ae = libCamp_gv_tSC_TECH_AC_COUNT;
        autoBF8ED7BC_ai = 1;
        lv_techACIndex = 1;
        for ( ; ( (autoBF8ED7BC_ai >= 0 && lv_techACIndex <= autoBF8ED7BC_ae) || (autoBF8ED7BC_ai <= 0 && lv_techACIndex >= autoBF8ED7BC_ae) ) ; lv_techACIndex += autoBF8ED7BC_ai ) {
            if ((libCamp_gf_StoryTechAbilityCommand(lv_indexTech, lv_techACIndex) != null)) {
                if ((libCamp_gv_tSX_Tech_Status[(lv_indexTech)] == 2)) {
                    TechTreeAbilityAllow(lp_player, libCamp_gf_StoryTechAbilityCommand(lv_indexTech, lv_techACIndex), true);
                }
                else {
                    TechTreeAbilityAllow(lp_player, libCamp_gf_StoryTechAbilityCommand(lv_indexTech, lv_techACIndex), false);
                }
            }
            else {
            }
        }
        auto160227D4_ae = libCamp_gv_tSC_TECH_UG_COUNT;
        auto160227D4_ai = 1;
        lv_techUGIndex = 1;
        for ( ; ( (auto160227D4_ai >= 0 && lv_techUGIndex <= auto160227D4_ae) || (auto160227D4_ai <= 0 && lv_techUGIndex >= auto160227D4_ae) ) ; lv_techUGIndex += auto160227D4_ai ) {
            if ((libCamp_gf_StoryTechUpgrade(lv_indexTech, lv_techUGIndex) != null)) {
                if ((libCamp_gv_tSX_Tech_Status[(lv_indexTech)] == 2)) {
                    libNtve_gf_SetUpgradeLevelForPlayer(lp_player, libCamp_gf_StoryTechUpgrade(lv_indexTech, lv_techUGIndex), 1);
                }
                else {
                    libNtve_gf_SetUpgradeLevelForPlayer(lp_player, libCamp_gf_StoryTechUpgrade(lv_indexTech, lv_techUGIndex), 0);
                }
            }
            else {
            }
        }
        auto8191891C_i = auto8191891C_i + 1;
    }
    if ((lp_player == 1)) {
        libCamp_gf_TS_ApplyCampaignTechLimitsProtoss();
    }
    else {
    }
    libCamp_gf_TS_ApplyResearchesTech(lp_player);
    libCamp_gf_TS_ApplyMercenaryTech(lp_player);
    libCamp_gf_TS_ApplyMercUpgrades(lp_player);
    if ((TechTreeUpgradeCount(lp_player, "NeoSteelFrame", c_techCountCompleteOnly) > 0) && (TechTreeUpgradeCount(lp_player, "ShrikeTurret", c_techCountCompleteOnly) > 0)) {
        libNtve_gf_SetUpgradeLevelForPlayer(lp_player, "NeoSteelAndShrikeTurretIconUpgrade", 1);
    }
    else {
    }
    if ((lp_player == 1)) {
        libCamp_gf_TS_HelpUnitsPanel_UpdatePanel();
        libCamp_gf_TS_HelpTechTree_UpdatePanel();
    }
    else {
    }
}

void libCamp_gf_TS_ApplyCampaignTechLimitsUnlockUnits (int lp_player) {
    int autoAB84843D_ae;
    int autoAB84843D_ai;
    int auto7F90A2CE_ae;
    int auto7F90A2CE_ai;

    // Variable Declarations
    int lv_index;
    int lv_techSubgroup;

    // Variable Initialization

    // Implementation
    TechTreeUnitHelpDefault(lp_player, false);
    autoAB84843D_ae = libCamp_gv_TSC_TECHGROUP_LAST;
    autoAB84843D_ai = 1;
    lv_index = libCamp_gv_TSC_TECHGROUP_FIRST;
    for ( ; ( (autoAB84843D_ai >= 0 && lv_index <= autoAB84843D_ae) || (autoAB84843D_ai <= 0 && lv_index >= autoAB84843D_ae) ) ; lv_index += autoAB84843D_ai ) {
        if ((libCamp_gv_tS_TechGroupID[lv_index] != 0)) {
            if ((libCamp_gv_tS_TechGroupState[lv_index] == c_purchaseCategoryStateEnabled)) {
                libCamp_gf_EnableCampaignTechUnit(true, libCamp_gv_tS_TechGroupID[lv_index], lp_player);
            }
            else {
                libCamp_gf_EnableCampaignTechUnit(false, libCamp_gv_tS_TechGroupID[lv_index], lp_player);
            }
        }
        else {
            TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_86092700") + StringExternal("Param/Value/lib_Camp_E5512204") + IntToText(lv_index)), false);
        }
    }
    if ((libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 1) == true)) {
        auto7F90A2CE_ae = 3;
        auto7F90A2CE_ai = 1;
        lv_index = 1;
        for ( ; ( (auto7F90A2CE_ai >= 0 && lv_index <= auto7F90A2CE_ae) || (auto7F90A2CE_ai <= 0 && lv_index >= auto7F90A2CE_ae) ) ; lv_index += auto7F90A2CE_ai ) {
            lv_techSubgroup = libCamp_gv_tS_MissionTechUnitsEnabled[(libCamp_gv_tS_CurrentMap)][lv_index];
            if ((lv_techSubgroup != 0) && (lv_techSubgroup != 2)) {
                libCamp_gf_AddUnitTypeToUnitHelpPanel(libCamp_gf_StoryTechGroupUnitType(lv_techSubgroup), true, lp_player);
            }
            else {
            }
        }
    }
    else {
    }
}

void libCamp_gf_TS_ApplyCampaignTechLimitsProtoss () {
    // Variable Declarations
    int lv_player;

    // Variable Initialization

    // Implementation
    lv_player = 1;
    if (((libCamp_gv_tS_CurrentMap == 22) || (libCamp_gv_tS_CurrentMap == 23) || (libCamp_gv_tS_CurrentMap == 24) || (libCamp_gv_tS_CurrentMap == 25))) {
        TechTreeAbilityAllow(lv_player, AbilityCommand("TimeWarp", 0), false);
        TechTreeUnitAllow(lv_player, "Probe", true);
        TechTreeUnitAllow(lv_player, "PhotonCannon", true);
        TechTreeUnitAllow(lv_player, "Assimilator", true);
        TechTreeUpgradeAllow(lv_player, "BlinkTech", true);
    }
    else {
    }
    if (((libCamp_gv_tS_CurrentMap == 23) || (libCamp_gv_tS_CurrentMap == 24) || (libCamp_gv_tS_CurrentMap == 25))) {
        TechTreeUnitAllow(lv_player, "Zealot", true);
        TechTreeUnitAllow(lv_player, "Stalker", true);
        TechTreeUnitAllow(lv_player, "Archon", true);
        TechTreeUpgradeAllow(lv_player, "ProtossGroundArmorsLevel1", true);
        TechTreeUpgradeAllow(lv_player, "ProtossGroundWeaponsLevel1", true);
        TechTreeUpgradeAllow(lv_player, "ProtossShieldsLevel1", true);
        TechTreeUpgradeAllow(lv_player, "Charge", true);
        TechTreeUpgradeAllow(lv_player, "VoidRaySpeedUpgrade", true);
        TechTreeUpgradeAllow(lv_player, "ExtendedThermalLance", true);
        libCamp_gf_AddUnitTypeToUnitHelpPanel("Zealot", false, lv_player);
        libCamp_gf_AddUnitTypeToUnitHelpPanel("Stalker", false, lv_player);
    }
    else {
    }
    if (((libCamp_gv_tS_CurrentMap == 24) || (libCamp_gv_tS_CurrentMap == 25))) {
        TechTreeUnitAllow(lv_player, "DarkTemplar", true);
        TechTreeUnitAllow(lv_player, "Immortal", true);
        TechTreeUnitAllow(lv_player, "HighTemplar", true);
        TechTreeUpgradeAllow(lv_player, "ProtossGroundArmorsLevel2", true);
        TechTreeUpgradeAllow(lv_player, "ProtossGroundWeaponsLevel2", true);
        TechTreeUpgradeAllow(lv_player, "ProtossShieldsLevel2", true);
        TechTreeUpgradeAllow(lv_player, "PsiStormTech", true);
        TechTreeUpgradeAllow(lv_player, "HighTemplarKhaydarinAmulet", true);
        libCamp_gf_AddUnitTypeToUnitHelpPanel("DarkTemplar", false, lv_player);
        libCamp_gf_AddUnitTypeToUnitHelpPanel("Immortal", false, lv_player);
        libCamp_gf_AddUnitTypeToUnitHelpPanel("Archon", false, lv_player);
        libCamp_gf_AddUnitTypeToUnitHelpPanel("HighTemplar", false, lv_player);
    }
    else {
    }
    if (((libCamp_gv_tS_CurrentMap == 25))) {
        TechTreeUnitAllow(lv_player, "Colossus", true);
        TechTreeUnitAllow(lv_player, "Observer", true);
        TechTreeUpgradeAllow(lv_player, "ProtossGroundArmorsLevel3", true);
        TechTreeUpgradeAllow(lv_player, "ProtossGroundWeaponsLevel3", true);
        TechTreeUpgradeAllow(lv_player, "ProtossShieldsLevel3", true);
        TechTreeUpgradeAllow(lv_player, "ObserverGraviticBooster", true);
        TechTreeUpgradeAllow(lv_player, "ExtendedThermalLance", true);
        libCamp_gf_AddUnitTypeToUnitHelpPanel("Colossus", false, lv_player);
        libCamp_gf_AddUnitTypeToUnitHelpPanel("Observer", false, lv_player);
    }
    else {
    }
}

void libCamp_gf_TS_UpdateTechAddons (int lp_player) {
    // Variable Declarations
    bool lv_allowDisallowBarracksTechLab;
    bool lv_allowDisallowFactory;
    bool lv_allowDisallowFactoryTechLab;
    bool lv_allowDisallowStarport;
    bool lv_allowDisallowStarportTechLab;

    // Variable Initialization

    // Implementation
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("BarracksTrain", 5)) == true))) {
        lv_allowDisallowBarracksTechLab = true;
    }
    else {
        lv_allowDisallowBarracksTechLab = false;
    }
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 5)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 6)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 7)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 8)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 9)) == true))) {
        lv_allowDisallowFactory = true;
    }
    else {
        lv_allowDisallowFactory = false;
    }
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 6)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 7)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("FactoryTrain", 9)) == true))) {
        lv_allowDisallowFactoryTechLab = true;
    }
    else {
        lv_allowDisallowFactoryTechLab = false;
    }
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 4)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 0)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 7)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 6)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 5)) == true))) {
        lv_allowDisallowStarport = true;
    }
    else {
        lv_allowDisallowStarport = false;
    }
    if (((TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 1)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 3)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 7)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 2)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 6)) == true) || (TechTreeAbilityIsAllowed(lp_player, AbilityCommand("StarportTrain", 5)) == true))) {
        lv_allowDisallowStarportTechLab = true;
    }
    else {
        lv_allowDisallowStarportTechLab = false;
    }
    TechTreeAbilityAllow(lp_player, AbilityCommand("BarracksAddOns", 0), lv_allowDisallowBarracksTechLab);
    TechTreeAbilityAllow(lp_player, AbilityCommand("FactoryAddOns", 1), lv_allowDisallowFactory);
    TechTreeAbilityAllow(lp_player, AbilityCommand("FactoryAddOns", 0), lv_allowDisallowFactoryTechLab);
    TechTreeAbilityAllow(lp_player, AbilityCommand("StarportAddOns", 1), lv_allowDisallowStarport);
    TechTreeAbilityAllow(lp_player, AbilityCommand("StarportAddOns", 0), lv_allowDisallowStarportTechLab);
}

void libCamp_gf_TS_UpdateTechUpgrades (int lp_player) {
    // Variable Declarations
    bool lv_infantry1;
    bool lv_infantry2;
    bool lv_infantry3;
    bool lv_vehicle1;
    bool lv_vehicle2;
    bool lv_vehicle3;
    bool lv_shipWeapon1;
    bool lv_shipArmor1;
    bool lv_shipWeapon2;
    bool lv_shipArmor2;
    bool lv_shipWeapon3;
    bool lv_shipArmor3;

    // Variable Initialization

    // Implementation
    if (((libCamp_gf_MissionStatusCheck(2, 2) == true))) {
        lv_infantry1 = true;
        if (((libCamp_gf_StoryTechUnitIsEnabled("Hellion") == true) || (libCamp_gf_StoryTechUnitIsEnabled("SiegeTank") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Thor") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Vulture") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Diamondback") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Goliath") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Predator") == true))) {
            lv_vehicle1 = true;
        }
        else {
        }
        if (((libCamp_gf_StoryTechUnitIsEnabled("VikingFighter") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Banshee") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Battlecruiser") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Wraith") == true))) {
            lv_shipWeapon1 = true;
        }
        else {
        }
        if (((libCamp_gf_StoryTechUnitIsEnabled("Medivac") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Raven") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Hercules") == true) || (libCamp_gf_StoryTechUnitIsEnabled("VikingFighter") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Banshee") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Battlecruiser") == true) || (libCamp_gf_StoryTechUnitIsEnabled("Wraith") == true) || (libCamp_gf_StoryTechUnitIsEnabled("ScienceVessel") == true))) {
            lv_shipArmor1 = true;
        }
        else {
        }
    }
    else {
    }
    TechTreeAbilityAllow(lp_player, AbilityCommand("EngineeringBayResearch", 2), lv_infantry1);
    TechTreeAbilityAllow(lp_player, AbilityCommand("EngineeringBayResearch", 6), lv_infantry1);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 5), lv_vehicle1);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 2), lv_vehicle1);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 11), lv_shipWeapon1);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 8), lv_shipArmor1);
    TechTreeAbilityAllow(lp_player, AbilityCommand("EngineeringBayResearch", 10), lv_infantry1);
    TechTreeAbilityAllow(lp_player, AbilityCommand("EngineeringBayResearch", 13), lv_infantry1);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 15), lv_vehicle1);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 21), lv_vehicle1);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 18), lv_shipWeapon1);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 24), lv_shipArmor1);
    if (((libCamp_gf_NumberOfMissions(3) >= 9))) {
        if ((lv_infantry1 == true)) {
            lv_infantry2 = true;
            libCamp_gv_tS_UpgradeInfantry2 = true;
        }
        else {
        }
        if ((lv_vehicle1 == true)) {
            lv_vehicle2 = true;
            libCamp_gv_tS_UpgradeVehicle2 = true;
        }
        else {
        }
        if ((lv_shipWeapon1 == true)) {
            lv_shipWeapon2 = true;
            libCamp_gv_tS_UpgradeShip2 = true;
        }
        else {
        }
        if ((lv_shipArmor1 == true)) {
            lv_shipArmor2 = true;
            libCamp_gv_tS_UpgradeShip2 = true;
        }
        else {
        }
    }
    else {
    }
    TechTreeAbilityAllow(lp_player, AbilityCommand("EngineeringBayResearch", 3), lv_infantry2);
    TechTreeAbilityAllow(lp_player, AbilityCommand("EngineeringBayResearch", 7), lv_infantry2);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 6), lv_vehicle2);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 3), lv_vehicle2);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 12), lv_shipWeapon2);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 9), lv_shipArmor2);
    TechTreeAbilityAllow(lp_player, AbilityCommand("EngineeringBayResearch", 11), lv_infantry2);
    TechTreeAbilityAllow(lp_player, AbilityCommand("EngineeringBayResearch", 14), lv_infantry2);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 16), lv_vehicle2);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 22), lv_vehicle2);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 19), lv_shipWeapon2);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 25), lv_shipArmor2);
    if (((libCamp_gf_NumberOfMissions(3) >= 16))) {
        if ((lv_infantry2 == true)) {
            lv_infantry3 = true;
            libCamp_gv_tS_UpgradeInfantry3 = true;
        }
        else {
        }
        if ((lv_vehicle2 == true)) {
            lv_vehicle3 = true;
            libCamp_gv_tS_UpgradeVehicle3 = true;
        }
        else {
        }
        if ((lv_shipWeapon2 == true)) {
            lv_shipWeapon3 = true;
            libCamp_gv_tS_UpgradeShip3 = true;
        }
        else {
        }
        if ((lv_shipArmor2 == true)) {
            lv_shipArmor3 = true;
            libCamp_gv_tS_UpgradeShip3 = true;
        }
        else {
        }
    }
    else {
    }
    TechTreeAbilityAllow(lp_player, AbilityCommand("EngineeringBayResearch", 4), lv_infantry3);
    TechTreeAbilityAllow(lp_player, AbilityCommand("EngineeringBayResearch", 8), lv_infantry3);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 7), lv_vehicle3);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 4), lv_vehicle3);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 13), lv_shipWeapon3);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 10), lv_shipArmor3);
    TechTreeAbilityAllow(lp_player, AbilityCommand("EngineeringBayResearch", 12), lv_infantry3);
    TechTreeAbilityAllow(lp_player, AbilityCommand("EngineeringBayResearch", 15), lv_infantry3);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 17), lv_vehicle3);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 23), lv_vehicle3);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 20), lv_shipWeapon3);
    TechTreeAbilityAllow(lp_player, AbilityCommand("ArmoryResearch", 26), lv_shipArmor3);
}

void libCamp_gf_TS_UpdateTechGroupStates () {
    int auto8554F329_ae;
    int auto8554F329_ai;
    int autoEB15E298_i;
    int auto7A83BB79_ae;
    int auto7A83BB79_ai;

    // Variable Declarations
    int lv_indexMission;
    int lv_techUnitIndex;
    int lv_techEnabledIndex;

    // Variable Initialization

    // Implementation
    auto8554F329_ae = libCamp_gv_TSC_TECHGROUP_LAST;
    auto8554F329_ai = 1;
    lv_techUnitIndex = libCamp_gv_TSC_TECHGROUP_FIRST;
    for ( ; ( (auto8554F329_ai >= 0 && lv_techUnitIndex <= auto8554F329_ae) || (auto8554F329_ai <= 0 && lv_techUnitIndex >= auto8554F329_ae) ) ; lv_techUnitIndex += auto8554F329_ai ) {
        libCamp_gv_tS_TechGroupState[lv_techUnitIndex] = c_purchaseCategoryStateHidden;
    }
    if (((libCamp_gf_MissionStatus(2) == 2) || (libCamp_gv_tS_CurrentMap == 2))) {
        libCamp_gv_tS_TechGroupState[(3)] = c_purchaseCategoryStateEnabled;
        libCamp_gv_tS_TechGroupState[(4)] = c_purchaseCategoryStateEnabled;
    }
    else {
    }
    autoEB15E298_i = libCamp_gv_TSC_MISSION_FIRST;
    while (autoEB15E298_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[autoEB15E298_i];
        if (((libCamp_gf_MissionStatusCheck(lv_indexMission, 2) == true))) {
            auto7A83BB79_ae = 3;
            auto7A83BB79_ai = 1;
            lv_techEnabledIndex = 1;
            for ( ; ( (auto7A83BB79_ai >= 0 && lv_techEnabledIndex <= auto7A83BB79_ae) || (auto7A83BB79_ai <= 0 && lv_techEnabledIndex >= auto7A83BB79_ae) ) ; lv_techEnabledIndex += auto7A83BB79_ai ) {
                if ((libCamp_gf_MissionUnlockedTechSubgorup(lv_indexMission, lv_techEnabledIndex) != 0)) {
                    libCamp_gv_tS_TechGroupState[(libCamp_gf_MissionUnlockedTechSubgorup(lv_indexMission, lv_techEnabledIndex))] = c_purchaseCategoryStateEnabled;
                }
                else {
                }
            }
        }
        else {
        }
        autoEB15E298_i = autoEB15E298_i + 1;
    }
}

void libCamp_gf_TS_UpdateTechStates () {
    int auto28BB6960_ae;
    int auto28BB6960_ai;

    // Variable Declarations
    int lv_index;
    int lv_subgroup;

    // Variable Initialization

    // Implementation
    libCamp_gf_TS_UpdateTechGroupStates();
    libCamp_gf_TS_StoryCheckTechReqs();
    auto28BB6960_ae = libCamp_gv_TSC_TECH_LAST;
    auto28BB6960_ai = 1;
    lv_index = libCamp_gv_TSC_TECH_FIRST;
    for ( ; ( (auto28BB6960_ai >= 0 && lv_index <= auto28BB6960_ae) || (auto28BB6960_ai <= 0 && lv_index >= auto28BB6960_ae) ) ; lv_index += auto28BB6960_ai ) {
        lv_subgroup = libCamp_gv_tS_Tech_GroupID[lv_index];
        if ((libCamp_gv_tS_TechGroupState[(lv_subgroup)] != c_purchaseCategoryStateEnabled)) {
            libCamp_gv_tSX_Tech_Status[lv_index] = 3;
        }
        else {
            if ((libCamp_gv_tSX_Tech_Status[lv_index] == 3)) {
                libCamp_gv_tSX_Tech_Status[lv_index] = 1;
                libCamp_gv_tSX_Tech_Status[lv_index] = 4;
            }
            else {
            }
        }
    }
    libCamp_gf_TS_UpdateMercStatus();
}

void libCamp_gf_TS_InitializeTechCategorySingle (int lp_techGroup, text lp_name, int lp_slot) {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    lv_index = (lp_techGroup);
    libCamp_gv_tS_TechCategoryID[lv_index] = lp_techGroup;
    libCamp_gv_tS_TechCategoryName[lv_index] = lp_name;
    libCamp_gv_tS_TechCategorySlot[lv_index] = lp_slot;
}

void libCamp_gf_TS_InitializeTechCategory () {
    // Implementation
    libCamp_gf_TS_InitializeTechCategorySingle(1, StringExternal("Param/Value/lib_Camp_AEA41A6D"), 1);
    libCamp_gf_TS_InitializeTechCategorySingle(2, StringExternal("Param/Value/lib_Camp_2F946631"), 2);
    libCamp_gf_TS_InitializeTechCategorySingle(3, StringExternal("Param/Value/lib_Camp_4B148DA0"), 3);
    libCamp_gf_TS_InitializeTechCategorySingle(4, StringExternal("Param/Value/lib_Camp_EFA7FB0B"), 4);
    libCamp_gf_TS_InitializeTechCategorySingle(5, StringExternal("Param/Value/lib_Camp_E8346A45"), 5);
}

void libCamp_gf_TS_InitializeTechGroundSingle (int lp_techSubGroup, int lp_category, string lp_unitType, text lp_name, text lp_description, text lp_tooltip, string lp_icon, string lp_iconBig, bool lp_showOnReport) {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    lv_index = (lp_techSubGroup);
    libCamp_gv_tS_TechGroupID[lv_index] = lp_techSubGroup;
    libCamp_gv_tS_TechGroupCategoryID[lv_index] = lp_category;
    libCamp_gv_tS_TechGroupUnitType[lv_index] = lp_unitType;
    libCamp_gv_tS_TechGroupName[lv_index] = lp_name;
    libCamp_gv_tS_TechGroupDescription[lv_index] = lp_description;
    libCamp_gv_tS_TechGroupTooltip[lv_index] = lp_tooltip;
    libCamp_gv_tS_TechGroupIcon[lv_index] = lp_icon;
    libCamp_gv_tS_TechGroupIconBig[lv_index] = lp_iconBig;
    libCamp_gv_tS_TechGroupState[lv_index] = c_purchaseCategoryStateEnabled;
    libCamp_gv_tS_TechGroupShowOnReport[lv_index] = lp_showOnReport;
}

void libCamp_gf_TS_InitializeTechGroup () {
    // Variable Declarations
    string lv_unitType;

    // Variable Initialization

    // Implementation
    lv_unitType = "SCV";
    libCamp_gf_TS_InitializeTechGroundSingle(3, 1, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_32E0F2B1"), StringExternal("Param/Value/lib_Camp_F77FFB66"), "Assets\\Textures\\btn-unit-terran-scv.dds", "Assets\\Textures\\tu_scv.dds", false);
    lv_unitType = "Bunker";
    libCamp_gf_TS_InitializeTechGroundSingle(1, 1, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_B5682BA6"), StringExternal("Button/Tooltip/Bunker"), "Assets\\Textures\\btn-building-terran-bunker.dds", "Assets\\Textures\\ui-technology-bunker.dds", true);
    lv_unitType = "MissileTurret";
    libCamp_gf_TS_InitializeTechGroundSingle(2, 1, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_EB28D30B"), StringExternal("Param/Value/lib_Camp_3DE90074"), "Assets\\Textures\\btn-building-terran-missileturret.dds", "", true);
    lv_unitType = "CommandCenter";
    libCamp_gf_TS_InitializeTechGroundSingle(4, 1, lv_unitType, StringExternal("Param/Value/lib_Camp_4E59EBB8"), StringExternal("Param/Value/lib_Camp_505076C1"), StringExternal("Param/Value/lib_Camp_62E61C1F"), "Assets\\Textures\\btn-building-terran-commandcenter.dds", "", false);
    lv_unitType = "Marine";
    libCamp_gf_TS_InitializeTechGroundSingle(5, 2, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_A8DF01B6"), StringExternal("Button/Tooltip/Marine"), "Assets\\Textures\\btn-unit-terran-marine.dds", "Assets\\Textures\\ui-technology-marine.dds", true);
    lv_unitType = "Medic";
    libCamp_gf_TS_InitializeTechGroundSingle(6, 2, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_D1AD7751"), StringExternal("Button/Tooltip/Medic"), "Assets\\Textures\\btn-unit-terran-medic.dds", "Assets\\Textures\\ui-technology-medic.dds", true);
    lv_unitType = "Firebat";
    libCamp_gf_TS_InitializeTechGroundSingle(7, 2, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_56CD313A"), StringExternal("Button/Tooltip/Firebat"), "Assets\\Textures\\btn-unit-terran-firebat.dds", "Assets\\Textures\\ui-technology-firebat.dds", true);
    lv_unitType = "Marauder";
    libCamp_gf_TS_InitializeTechGroundSingle(8, 2, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_9D4658BA"), StringExternal("Button/Tooltip/Marauder"), "Assets\\Textures\\btn-unit-terran-marauder.dds", "Assets\\Textures\\ui-technology-marauder.dds", true);
    lv_unitType = "Reaper";
    libCamp_gf_TS_InitializeTechGroundSingle(9, 2, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_B12AC0F6"), StringExternal("Button/Tooltip/Reaper"), "Assets\\Textures\\btn-unit-terran-reaper.dds", "Assets\\Textures\\ui-technology-reaper.dds", true);
    lv_unitType = "Hellion";
    libCamp_gf_TS_InitializeTechGroundSingle(10, 3, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_3FC8C9FD"), StringExternal("Button/Tooltip/Hellion"), "Assets\\Textures\\btn-unit-terran-jackal.dds", "Assets\\Textures\\ui-technology-hellion.dds", true);
    lv_unitType = "Goliath";
    libCamp_gf_TS_InitializeTechGroundSingle(12, 3, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_B4ACB2C7"), StringExternal("Button/Tooltip/Goliath"), "Assets\\Textures\\btn-unit-terran-goliath.dds", "Assets\\Textures\\ui-technology-goliath.dds", true);
    lv_unitType = "Vulture";
    libCamp_gf_TS_InitializeTechGroundSingle(11, 3, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_49F7B506"), StringExternal("Button/Tooltip/Vulture"), "Assets\\Textures\\btn-unit-terran-vulture.dds", "Assets\\Textures\\ui-technology-vulture.dds", true);
    lv_unitType = "Diamondback";
    libCamp_gf_TS_InitializeTechGroundSingle(13, 3, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_DDE72428"), StringExternal("Button/Tooltip/Diamondback"), "Assets\\Textures\\btn-unit-terran-diamondback.dds", "Assets\\Textures\\ui-technology-cobra.dds", true);
    lv_unitType = "SiegeTank";
    libCamp_gf_TS_InitializeTechGroundSingle(14, 3, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_F4F2155A"), StringExternal("Button/Tooltip/SiegeTank"), "Assets\\Textures\\BTN-Unit-Terran-SiegeTank.dds", "Assets\\Textures\\ui-technology-siegetanksieged.dds", true);
    lv_unitType = "Medivac";
    libCamp_gf_TS_InitializeTechGroundSingle(15, 4, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_5CBA56EF"), StringExternal("Button/Tooltip/Medivac"), "Assets\\Textures\\btn-unit-terran-medivac.dds", "Assets\\Textures\\ui-technology-medivac.dds", true);
    lv_unitType = "Wraith";
    libCamp_gf_TS_InitializeTechGroundSingle(16, 4, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_25930BC5"), StringExternal("Button/Tooltip/Wraith"), "Assets\\Textures\\btn-unit-terran-wraith.dds", "Assets\\Textures\\ui-technology-wraith.dds", true);
    lv_unitType = "VikingFighter";
    libCamp_gf_TS_InitializeTechGroundSingle(17, 4, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_826DB20A"), StringExternal("Button/Tooltip/VikingFighter"), "Assets\\Textures\\btn-unit-terran-vikingfighter.dds", "Assets\\Textures\\ui-technology-vikingfighter.dds", true);
    lv_unitType = "Banshee";
    libCamp_gf_TS_InitializeTechGroundSingle(18, 4, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_C948F016"), StringExternal("Button/Tooltip/Banshee"), "Assets\\Textures\\BTN-Unit-Terran-Banshee.dds", "Assets\\Textures\\ui-technology-banshee.dds", true);
    lv_unitType = "Battlecruiser";
    libCamp_gf_TS_InitializeTechGroundSingle(19, 4, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_EF93D4C0"), StringExternal("Button/Tooltip/Battlecruiser"), "Assets\\Textures\\BTN-Unit-Terran-Battlecruiser.dds", "Assets\\Textures\\ui-technology-battlecruiser.dds", true);
    lv_unitType = "Ghost";
    libCamp_gf_TS_InitializeTechGroundSingle(20, 5, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_BA1436DA"), StringExternal("Param/Value/lib_Camp_2958A780"), "Assets\\Textures\\btn-unit-terran-ghost.dds", "", false);
    lv_unitType = "Spectre";
    libCamp_gf_TS_InitializeTechGroundSingle(21, 5, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_83BE6BD1"), StringExternal("Param/Value/lib_Camp_A155DEBE"), "Assets\\Textures\\btn-unit-terran-spectre.dds", "Assets\\Textures\\ui-technology-spectre.dds", false);
    lv_unitType = "Thor";
    libCamp_gf_TS_InitializeTechGroundSingle(22, 5, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_3C84AB55"), StringExternal("Button/Tooltip/Thor"), "Assets\\Textures\\btn-unit-terran-thor.dds", "Assets\\Textures\\ui-technology-thor.dds", true);
    lv_unitType = "NuclearReactor";
    libCamp_gf_TS_InitializeTechGroundSingle(23, 0, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_2C62DAA5"), StringExternal("Param/Value/lib_Camp_7F541EBF"), "Assets\\Textures\\btn-building-terran-reactor.dds", "", false);
    lv_unitType = "SensorTower";
    libCamp_gf_TS_InitializeTechGroundSingle(24, 0, lv_unitType, UnitTypeGetName(lv_unitType), StringExternal("Param/Value/lib_Camp_5AC37997"), StringExternal("Param/Value/lib_Camp_28C12F44"), "Assets\\Textures\\btn-building-terran-sensordome.dds", "", false);
}

void libCamp_gf_TS_InitializeTechDataSingle (int lp_tech, int lp_group, string lp_convoID, int lp_requires) {
    // Variable Declarations
    int lv_techIndex;

    // Variable Initialization

    // Implementation
    lv_techIndex = (lp_tech);
    libCamp_gv_tS_TechID[lv_techIndex] = lp_tech;
    libCamp_gv_tS_Tech_GroupID[lv_techIndex] = lp_group;
    libCamp_gv_tS_Tech_ConvoID[lv_techIndex] = lp_convoID;
    libCamp_gv_tS_Tech_Requires[lv_techIndex] = lp_requires;
}

void libCamp_gf_TS_InitializeTechData () {
    // Variable Declarations
    string lv_tBDVideo;

    // Variable Initialization
    lv_tBDVideo = "Assets\\Textures\\video_static.ogv";

    // Implementation
    libCamp_gf_TS_InitializeTechCategory();
    libCamp_gf_TS_InitializeTechGroup();
    libCamp_gf_TS_InitializeTechDataSingle(1, 3, "Tech|Tech_SCV_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(2, 3, "Tech|Tech_SCV_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(3, 1, "Tech|Tech_Bunker_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(4, 1, "Tech|Tech_Bunker_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(5, 2, "Tech|Tech_MissileTurret_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(6, 2, "Tech|Tech_MissileTurret_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(7, 4, "Tech|Tech_CommandCenter_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(8, 4, "Tech|Tech_CommandCenter_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(9, 5, "Tech|Tech_Marine_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(10, 5, "Tech|Tech_Marine_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(11, 6, "Tech|Tech_Medic_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(12, 6, "Tech|Tech_Medic_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(13, 7, "Tech|Tech_Firebat_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(14, 7, "Tech|Tech_Firebat_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(15, 8, "Tech|Tech_Marauder_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(16, 8, "Tech|Tech_Marauder_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(17, 9, "Tech|Tech_Reaper_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(18, 9, "Tech|Tech_Reaper_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(19, 10, "Tech|Tech_Hellion_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(20, 10, "Tech|Tech_Hellion_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(21, 12, "Tech|Tech_Goliath_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(22, 12, "Tech|Tech_Goliath_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(25, 13, "Tech|Tech_Diamondback_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(26, 13, "Tech|Tech_Diamondback_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(23, 11, "Tech|Tech_Vulture_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(24, 11, "Tech|Tech_Vulture_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(27, 14, "Tech|Tech_SiegeTank_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(28, 14, "Tech|Tech_SiegeTank_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(30, 15, "Tech|Tech_Medivac_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(29, 15, "Tech|Tech_Medivac_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(31, 16, "Tech|Tech_Wraith_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(32, 16, "Tech|Tech_Wraith_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(33, 17, "Tech|Tech_Viking_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(34, 17, "Tech|Tech_Viking_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(35, 18, "Tech|Tech_Banshee_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(36, 18, "Tech|Tech_Banshee_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(37, 19, "Tech|Tech_Battlecruiser_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(38, 19, "Tech|Tech_Battlecruiser_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(39, 20, "Tech|Tech_Ghost_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(40, 20, "Tech|Tech_Ghost_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(41, 21, "Tech|Tech_Spectre_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(42, 21, "Tech|Tech_Spectre_2", 0);
    libCamp_gf_TS_InitializeTechDataSingle(43, 22, "Tech|Tech_Thor_1", 0);
    libCamp_gf_TS_InitializeTechDataSingle(44, 22, "Tech|Tech_Thor_2", 0);
}

void libCamp_gf_TS_ResetTechData () {
    int auto4D60B8E4_ae;
    int auto4D60B8E4_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    auto4D60B8E4_ae = libCamp_gv_TSC_TECH_LAST;
    auto4D60B8E4_ai = 1;
    lv_index = libCamp_gv_TSC_TECH_FIRST;
    for ( ; ( (auto4D60B8E4_ai >= 0 && lv_index <= auto4D60B8E4_ae) || (auto4D60B8E4_ai <= 0 && lv_index >= auto4D60B8E4_ae) ) ; lv_index += auto4D60B8E4_ai ) {
        libCamp_gv_tSX_Tech_Status[lv_index] = 1;
    }
    libCamp_gf_TS_UpdateTechStates();
}

void libCamp_gf_TS_CreateTechCategoryUI () {
    int autoCC1C88BE_ae;
    int autoCC1C88BE_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    autoCC1C88BE_ae = libCamp_gv_TSC_TECHCATEGORY_LAST;
    autoCC1C88BE_ai = 1;
    lv_index = libCamp_gv_TSC_TECHCATEGORY_FIRST;
    for ( ; ( (autoCC1C88BE_ai >= 0 && lv_index <= autoCC1C88BE_ae) || (autoCC1C88BE_ai <= 0 && lv_index >= autoCC1C88BE_ae) ) ; lv_index += autoCC1C88BE_ai ) {
        if ((libCamp_gv_tS_TechCategoryID[lv_index] != 0) && (libCamp_gv_tS_TechCategory_UI[lv_index] == c_invalidPurchaseCategoryId)) {
            PurchaseCategoryCreate(PlayerGroupAll(), libCamp_gv_tS_TechCategorySlot[lv_index]);
            libCamp_gv_tS_TechCategory_UI[lv_index] = PurchaseCategoryLastCreated();
            PurchaseCategorySetNameText(PurchaseCategoryLastCreated(), libCamp_gv_tS_TechCategoryName[lv_index]);
        }
        else {
        }
    }
}

void libCamp_gf_TS_CreateTechGroupUI () {
    int auto583598E1_ae;
    int auto583598E1_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    auto583598E1_ae = libCamp_gv_TSC_TECHGROUP_LAST;
    auto583598E1_ai = 1;
    lv_index = libCamp_gv_TSC_TECHGROUP_FIRST;
    for ( ; ( (auto583598E1_ai >= 0 && lv_index <= auto583598E1_ae) || (auto583598E1_ai <= 0 && lv_index >= auto583598E1_ae) ) ; lv_index += auto583598E1_ai ) {
        if ((libCamp_gv_tS_TechGroupID[lv_index] != 0) && (libCamp_gv_tS_TechGroupCategoryID[lv_index] != 0) && (libCamp_gv_tS_TechGroup_UI[lv_index] == c_invalidPurchaseGroupId)) {
            PurchaseGroupCreate(PlayerGroupAll(), libCamp_gv_tS_TechCategory_UI[(libCamp_gv_tS_TechGroupCategoryID[lv_index])], 1);
            libCamp_gv_tS_TechGroup_UI[lv_index] = PurchaseGroupLastCreated();
            PurchaseGroupSetNameText(PurchaseGroupLastCreated(), libCamp_gv_tS_TechGroupName[lv_index]);
        }
        else {
        }
    }
}

void libCamp_gf_TS_CreateTechUI () {
    int auto35BDE233_i;

    // Variable Declarations
    int lv_techIndex;
    int lv_indexTech;
    text lv_requirements;

    // Variable Initialization
    lv_requirements = StringExternal("Param/Value/lib_Camp_CAA04127");

    // Implementation
    libCamp_gf_TS_CreateTechCategoryUI();
    libCamp_gf_TS_CreateTechGroupUI();
    auto35BDE233_i = libCamp_gv_TSC_TECH_FIRST;
    while (auto35BDE233_i <= libCamp_gv_TSC_TECH_LAST) {
        lv_indexTech = libCamp_gv_tS_TechID[auto35BDE233_i];
        lv_techIndex = (lv_indexTech);
        if ((libCamp_gv_tS_Tech_UI[lv_techIndex] == c_invalidPurchaseItemId)) {
            PurchaseItemCreate(PlayerGroupAll(), libCamp_gv_tS_TechGroup_UI[(libCamp_gv_tS_Tech_GroupID[lv_techIndex])], libCamp_gf_StoryTechSlot(lv_indexTech));
            libCamp_gv_tS_Tech_UI[lv_techIndex] = PurchaseItemLastCreated();
            PurchaseItemSetCost(PurchaseItemLastCreated(), libCamp_gf_StoryTechCost(lv_indexTech));
            PurchaseItemSetIconFilePath(PurchaseItemLastCreated(), libCamp_gf_StoryTechIcon(lv_indexTech));
            PurchaseItemSetMovieFilePath(PurchaseItemLastCreated(), libCamp_gf_StoryTechMovie(lv_indexTech));
            PurchaseItemSetNameText(PurchaseItemLastCreated(), libCamp_gf_StoryTechName(lv_indexTech));
        }
        else {
        }
        auto35BDE233_i = auto35BDE233_i + 1;
    }
    libCamp_gf_TS_UpdateTechUI();
    libCamp_gf_TS_UpdateTechUINewGroups();
    libCamp_gf_TS_UpdateTechVisuals();
}

void libCamp_gf_TS_UpdateTechGroupUI () {
    int auto8062DA62_i;
    int autoB46F1BE5_i;
    int auto4E4FF2EB_i;

    // Variable Declarations
    int lv_indexCategory;
    int lv_indexGroup;
    int lv_categoryIndex;
    int lv_groupIndex;
    int lv_slot;
    text lv_debugtext;

    // Variable Initialization

    // Implementation
    auto8062DA62_i = libCamp_gv_TSC_TECHCATEGORY_FIRST;
    while (auto8062DA62_i <= libCamp_gv_TSC_TECHCATEGORY_LAST) {
        lv_indexCategory = libCamp_gv_tS_TechCategoryID[auto8062DA62_i];
        lv_categoryIndex = (lv_indexCategory);
        lv_slot = 0;
        libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] = 0;
        autoB46F1BE5_i = libCamp_gv_TSC_TECHGROUP_FIRST;
        while (autoB46F1BE5_i <= libCamp_gv_TSC_TECHGROUP_LAST) {
            lv_indexGroup = libCamp_gv_tS_TechGroupID[autoB46F1BE5_i];
            lv_groupIndex = (lv_indexGroup);
            if ((lv_indexGroup != 0) && (libCamp_gv_tS_TechGroup_UI[lv_groupIndex] != c_invalidPurchaseGroupId) && (libCamp_gv_tS_TechGroupCategoryID[lv_groupIndex] == lv_indexCategory)) {
                if ((libCamp_gf_TS_StoryTechGroupUIUnlocked(lv_indexGroup) == true)) {
                    PurchaseGroupSetState(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], c_purchaseCategoryStateEnabled);
                    lv_slot += 1;
                    PurchaseGroupSetSlot(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], lv_slot);
                    PurchaseGroupSetState(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], c_purchaseGroupStateNew);
                    libCamp_gv_tSX_TechGroup_UI_New[lv_groupIndex] = true;
                    PurchaseGroupSetUnitLink(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], libCamp_gv_tS_TechGroupUnitType[lv_groupIndex]);
                    libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] += 1;
                }
                else {
                    PurchaseGroupSetState(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], c_purchaseCategoryStateHidden);
                }
            }
            else {
            }
            autoB46F1BE5_i = autoB46F1BE5_i + 1;
        }
        if ((lv_slot > 0)) {
            PurchaseCategorySetState(libCamp_gv_tS_TechCategory_UI[(lv_indexCategory)], c_purchaseCategoryStateEnabled);
        }
        else {
            PurchaseCategorySetState(libCamp_gv_tS_TechCategory_UI[(lv_indexCategory)], c_purchaseCategoryStateHidden);
        }
        auto8062DA62_i = auto8062DA62_i + 1;
    }
    auto4E4FF2EB_i = libCamp_gv_TSC_TECHCATEGORY_FIRST;
    while (auto4E4FF2EB_i <= libCamp_gv_TSC_TECHCATEGORY_LAST) {
        lv_indexCategory = libCamp_gv_tS_TechCategoryID[auto4E4FF2EB_i];
        lv_categoryIndex = (lv_indexCategory);
        if ((libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] == 0)) {
            libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] = -1;
        }
        else {
        }
        auto4E4FF2EB_i = auto4E4FF2EB_i + 1;
    }
}

void libCamp_gf_TS_UpdateTechUI () {
    int auto87FE512E_i;
    int autoB1B8A49C_val;

    // Variable Declarations
    int lv_techIndex;
    int lv_indexTech;
    text lv_tooltip;
    text lv_specification;
    int lv_groupID;

    // Variable Initialization
    lv_tooltip = StringExternal("Param/Value/lib_Camp_46487168");

    // Implementation
    libCamp_gf_TS_UpdateTechStates();
    libCamp_gf_TS_UpdateTechGroupUI();
    auto87FE512E_i = libCamp_gv_TSC_TECH_FIRST;
    while (auto87FE512E_i <= libCamp_gv_TSC_TECH_LAST) {
        lv_indexTech = libCamp_gv_tS_TechID[auto87FE512E_i];
        lv_techIndex = (lv_indexTech);
        lv_tooltip = libCamp_gf_StoryTechTooltip(lv_indexTech);
        if ((libCamp_gv_tSX_Tech_Status[lv_techIndex] == 0)) {
            if ((libCamp_gv_tS_Tech_Requires[lv_techIndex] != 0) && (libCamp_gv_tSX_Tech_Status[(libCamp_gv_tS_Tech_Requires[lv_techIndex])] != 2)) {
                lv_tooltip = (lv_tooltip + StringExternal("Param/Value/lib_Camp_848F0F00") + libCamp_gf_StoryTechName(libCamp_gv_tS_Tech_Requires[lv_techIndex]) + StringExternal("Param/Value/lib_Camp_21CFFC8D") + StringExternal("Param/Value/lib_Camp_8ECFA0EF"));
            }
            else {
            }
        }
        else {
        }
        PurchaseItemSetTooltipText(libCamp_gv_tS_Tech_UI[lv_techIndex], lv_tooltip);
        PurchaseItemSetDescriptionText(libCamp_gv_tS_Tech_UI[(lv_indexTech)], (libCamp_gf_StoryTechDescription(lv_indexTech)));
        autoB1B8A49C_val = libCamp_gv_tSX_Tech_Status[lv_techIndex];
        if (autoB1B8A49C_val == 0) {
            PurchaseItemSetState(libCamp_gv_tS_Tech_UI[lv_techIndex], c_purchaseItemStateDisabled);
        }
        else if (autoB1B8A49C_val == 3) {
            PurchaseItemSetState(libCamp_gv_tS_Tech_UI[lv_techIndex], c_purchaseItemStateDisabled);
        }
        else if (autoB1B8A49C_val == 1) {
            PurchaseItemSetState(libCamp_gv_tS_Tech_UI[lv_techIndex], c_purchaseItemStateEnabled);
        }
        else if (autoB1B8A49C_val == 4) {
            PurchaseItemSetState(libCamp_gv_tS_Tech_UI[lv_techIndex], c_purchaseItemStateEnabled);
        }
        else if (autoB1B8A49C_val == 2) {
            PurchaseItemSetState(libCamp_gv_tS_Tech_UI[lv_techIndex], c_purchaseItemStatePurchased);
        }
        else {
        }
        auto87FE512E_i = auto87FE512E_i + 1;
    }
    PlayerModifyPropertyInt(1, c_playerPropCredits, c_playerPropOperSetTo, libCamp_gf_StoryCredits());
}

void libCamp_gf_TS_UpdateTechUINewGroups () {
    int auto8C3260D2_i;
    int auto96C4DC0C_i;

    // Variable Declarations
    int lv_techIndex;
    int lv_indexTech;
    text lv_debugstring;
    int lv_categoryIndex;
    int lv_indexCategory;
    int lv_groupIndex;
    int lv_indexGroup;
    int lv_groupID;

    // Variable Initialization

    // Implementation
    auto8C3260D2_i = libCamp_gv_TSC_TECH_FIRST;
    while (auto8C3260D2_i <= libCamp_gv_TSC_TECH_LAST) {
        lv_indexTech = libCamp_gv_tS_TechID[auto8C3260D2_i];
        lv_techIndex = (lv_indexTech);
        if (((libCamp_gv_tSX_Tech_Status[lv_techIndex] == 1) || (libCamp_gv_tSX_Tech_Status[lv_techIndex] == 2))) {
            lv_groupID = (libCamp_gv_tS_Tech_GroupID[lv_techIndex]);
            lv_categoryIndex = (libCamp_gv_tS_TechCategoryID[(libCamp_gv_tS_TechGroupCategoryID[lv_groupID])]);
            if ((libCamp_gv_tSX_TechGroup_UI_New[lv_groupID] == true)) {
                libCamp_gv_tSX_TechGroup_UI_New[lv_groupID] = false;
                PurchaseGroupSetState(libCamp_gv_tS_TechGroup_UI[lv_groupID], c_purchaseGroupStateEnabled);
                libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] -= 1;
            }
            else {
            }
        }
        else {
        }
        auto8C3260D2_i = auto8C3260D2_i + 1;
    }
    auto96C4DC0C_i = libCamp_gv_TSC_TECHCATEGORY_FIRST;
    while (auto96C4DC0C_i <= libCamp_gv_TSC_TECHCATEGORY_LAST) {
        lv_indexCategory = libCamp_gv_tS_TechCategoryID[auto96C4DC0C_i];
        lv_categoryIndex = (lv_indexCategory);
        if ((libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] > -1)) {
            if ((libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] > 0)) {
                PurchaseCategorySetState(libCamp_gv_tS_TechCategory_UI[lv_categoryIndex], c_purchaseCategoryStateNew);
            }
            else {
                PurchaseCategorySetState(libCamp_gv_tS_TechCategory_UI[lv_categoryIndex], c_purchaseCategoryStateEnabled);
            }
        }
        else {
        }
        auto96C4DC0C_i = auto96C4DC0C_i + 1;
    }
}

void libCamp_gf_TS_UpdateTechVisuals () {
    int auto94D2BCB2_i;
    int auto69D612FB_i;
    int auto11801BDF_i;

    // Variable Declarations
    int[51] lv_purchasedCounts;
    int[51] lv_lowMoneyCounts;
    string[51] lv_purchasedCounts_Images;
    string[51] lv_lowMoneyCounts_Images;
    int lv_techIndex;
    int lv_indexTech;
    int lv_categoryIndex;
    int lv_indexCategory;
    int lv_groupIndex;
    int lv_indexGroup;
    int lv_groupID;
    text lv_debugstring;
    int lv_slot;

    // Variable Initialization

    // Implementation
    lv_purchasedCounts_Images[1] = "Assets\\Textures\\ui_techpurchase_bunker_hired.dds";
    lv_lowMoneyCounts_Images[1] = "Assets\\Textures\\ui_techpurchase_bunker_nocredit.dds";
    lv_purchasedCounts_Images[2] = "Assets\\Textures\\ui_techpurchase_missileturret_hired.dds";
    lv_lowMoneyCounts_Images[2] = "Assets\\Textures\\ui_techpurchase_missileturret_nocredit.dds";
    lv_purchasedCounts_Images[3] = "Assets\\Textures\\ui_techpurchase_scv_hired.dds";
    lv_lowMoneyCounts_Images[3] = "Assets\\Textures\\ui_techpurchase_scv_nocredit.dds";
    lv_purchasedCounts_Images[4] = "Assets\\Textures\\ui_techpurchase_commandcenter_hired.dds";
    lv_lowMoneyCounts_Images[4] = "Assets\\Textures\\ui_techpurchase_commandcenter_nocredit.dds";
    lv_purchasedCounts_Images[5] = "Assets\\Textures\\ui_techpurchase_marine_hired.dds";
    lv_lowMoneyCounts_Images[5] = "Assets\\Textures\\ui_techpurchase_marine_nocredit.dds";
    lv_purchasedCounts_Images[6] = "Assets\\Textures\\ui_techpurchase_medic_hired.dds";
    lv_lowMoneyCounts_Images[6] = "Assets\\Textures\\ui_techpurchase_medic_nocredit.dds";
    lv_purchasedCounts_Images[7] = "Assets\\Textures\\ui_techpurchase_firebat_hired.dds";
    lv_lowMoneyCounts_Images[7] = "Assets\\Textures\\ui_techpurchase_firebat_nocredit.dds";
    lv_purchasedCounts_Images[8] = "Assets\\Textures\\ui_techpurchase_marauder_hired.dds";
    lv_lowMoneyCounts_Images[8] = "Assets\\Textures\\ui_techpurchase_marauder_nocredit.dds";
    lv_purchasedCounts_Images[9] = "Assets\\Textures\\ui_techpurchase_reaper_hired.dds";
    lv_lowMoneyCounts_Images[9] = "Assets\\Textures\\ui_techpurchase_reaper_nocredit.dds";
    lv_purchasedCounts_Images[10] = "Assets\\Textures\\ui_techpurchase_hellion_hired.dds";
    lv_lowMoneyCounts_Images[10] = "Assets\\Textures\\ui_techpurchase_hellion_nocredit.dds";
    lv_purchasedCounts_Images[11] = "Assets\\Textures\\ui_techpurchase_vulture_hired.dds";
    lv_lowMoneyCounts_Images[11] = "Assets\\Textures\\ui_techpurchase_vulture_nocredit.dds";
    lv_purchasedCounts_Images[12] = "Assets\\Textures\\ui_techpurchase_goliath_hired.dds";
    lv_lowMoneyCounts_Images[12] = "Assets\\Textures\\ui_techpurchase_goliath_nocredit.dds";
    lv_purchasedCounts_Images[13] = "Assets\\Textures\\ui_techpurchase_diamondback_hired.dds";
    lv_lowMoneyCounts_Images[13] = "Assets\\Textures\\ui_techpurchase_diamondback_nocredit.dds";
    lv_purchasedCounts_Images[14] = "Assets\\Textures\\ui_techpurchase_siegetank_hired.dds";
    lv_lowMoneyCounts_Images[14] = "Assets\\Textures\\ui_techpurchase_siegetank_nocredit.dds";
    lv_purchasedCounts_Images[15] = "Assets\\Textures\\ui_techpurchase_medivac_hired.dds";
    lv_lowMoneyCounts_Images[15] = "Assets\\Textures\\ui_techpurchase_medivac_nocredit.dds";
    lv_purchasedCounts_Images[16] = "Assets\\Textures\\ui_techpurchase_wraith_hired.dds";
    lv_lowMoneyCounts_Images[16] = "Assets\\Textures\\ui_techpurchase_wraith_nocredit.dds";
    lv_purchasedCounts_Images[17] = "Assets\\Textures\\ui_techpurchase_viking_hired.dds";
    lv_lowMoneyCounts_Images[17] = "Assets\\Textures\\ui_techpurchase_viking_nocredit.dds";
    lv_purchasedCounts_Images[18] = "Assets\\Textures\\ui_techpurchase_banshee_hired.dds";
    lv_lowMoneyCounts_Images[18] = "Assets\\Textures\\ui_techpurchase_banshee_nocredit.dds";
    lv_purchasedCounts_Images[19] = "Assets\\Textures\\ui_techpurchase_battlecruiser_hired.dds";
    lv_lowMoneyCounts_Images[19] = "Assets\\Textures\\ui_techpurchase_battlecruiser_nocredit.dds";
    lv_purchasedCounts_Images[20] = "Assets\\Textures\\ui_techpurchase_ghost_hired.dds";
    lv_lowMoneyCounts_Images[20] = "Assets\\Textures\\ui_techpurchase_ghost_nocredit.dds";
    lv_purchasedCounts_Images[21] = "Assets\\Textures\\ui_techpurchase_spectre_hired.dds";
    lv_lowMoneyCounts_Images[21] = "Assets\\Textures\\ui_techpurchase_spectre_nocredit.dds";
    lv_purchasedCounts_Images[22] = "Assets\\Textures\\ui_techpurchase_thor_hired.dds";
    lv_lowMoneyCounts_Images[22] = "Assets\\Textures\\ui_techpurchase_thor_nocredit.dds";
    auto94D2BCB2_i = libCamp_gv_TSC_TECH_FIRST;
    while (auto94D2BCB2_i <= libCamp_gv_TSC_TECH_LAST) {
        lv_indexTech = libCamp_gv_tS_TechID[auto94D2BCB2_i];
        lv_techIndex = (lv_indexTech);
        if ((libCamp_gv_tSX_Tech_Status[lv_techIndex] == 2)) {
            lv_groupID = (libCamp_gv_tS_Tech_GroupID[lv_techIndex]);
            lv_purchasedCounts[lv_groupID] += 1;
        }
        else {
            if (((libCamp_gf_StoryCredits() < libCamp_gf_StoryTechCost(lv_indexTech)) && ((libCamp_gv_tSX_Tech_Status[lv_techIndex] == 4) || (libCamp_gv_tSX_Tech_Status[lv_techIndex] == 1)))) {
                lv_groupID = (libCamp_gv_tS_Tech_GroupID[lv_techIndex]);
                lv_lowMoneyCounts[lv_groupID] += 1;
            }
            else {
            }
        }
        auto94D2BCB2_i = auto94D2BCB2_i + 1;
    }
    auto69D612FB_i = libCamp_gv_TSC_TECHCATEGORY_FIRST;
    while (auto69D612FB_i <= libCamp_gv_TSC_TECHCATEGORY_LAST) {
        lv_indexCategory = libCamp_gv_tS_TechCategoryID[auto69D612FB_i];
        lv_categoryIndex = (lv_indexCategory);
        lv_slot = 0;
        libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] = 0;
        auto11801BDF_i = libCamp_gv_TSC_TECHGROUP_FIRST;
        while (auto11801BDF_i <= libCamp_gv_TSC_TECHGROUP_LAST) {
            lv_indexGroup = libCamp_gv_tS_TechGroupID[auto11801BDF_i];
            lv_groupIndex = (lv_indexGroup);
            if ((lv_indexGroup != 0) && (libCamp_gv_tS_TechGroup_UI[lv_groupIndex] != c_invalidPurchaseGroupId) && (libCamp_gv_tS_TechGroupCategoryID[lv_groupIndex] == lv_indexCategory)) {
                if ((libCamp_gf_TS_StoryTechGroupUIUnlocked(lv_indexGroup) == true)) {
                    lv_slot += 1;
                    libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] += 1;
                    PurchaseGroupSetIconFilePath(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], "Assets\\Textures\\blank.dds");
                    PurchaseGroupSetUnitLink(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], libCamp_gv_tS_TechGroupUnitType[lv_groupIndex]);
                    if ((lv_purchasedCounts[lv_groupIndex] == 2)) {
                        PurchaseGroupSetUnitLink(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], "InvisiblePylon");
                        PurchaseGroupSetIconFilePath(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], lv_purchasedCounts_Images[lv_groupIndex]);
                    }
                    else {
                    }
                    if (((lv_lowMoneyCounts[lv_groupIndex] == 2) || ((lv_lowMoneyCounts[lv_groupIndex] == 1) && (lv_purchasedCounts[lv_groupIndex] == 1)))) {
                        PurchaseGroupSetUnitLink(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], "InvisiblePylon");
                        PurchaseGroupSetIconFilePath(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], lv_lowMoneyCounts_Images[lv_groupIndex]);
                    }
                    else {
                    }
                }
                else {
                }
            }
            else {
            }
            auto11801BDF_i = auto11801BDF_i + 1;
        }
        auto69D612FB_i = auto69D612FB_i + 1;
    }
}

void libCamp_gf_TS_BuyAllTech () {
    int auto45FF2EB0_ae;
    int auto45FF2EB0_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    auto45FF2EB0_ae = libCamp_gv_TSC_TECH_LAST;
    auto45FF2EB0_ai = 1;
    lv_index = libCamp_gv_TSC_TECH_FIRST;
    for ( ; ( (auto45FF2EB0_ai >= 0 && lv_index <= auto45FF2EB0_ae) || (auto45FF2EB0_ai <= 0 && lv_index >= auto45FF2EB0_ae) ) ; lv_index += auto45FF2EB0_ai ) {
        libCamp_gv_tSX_Tech_Status[lv_index] = 2;
    }
    libCamp_gf_TS_UpdateTechStates();
}

void libCamp_gf_TS_StoryCheckTechReqSingle (int lp_tech, int lp_requiredTech) {
    // Variable Declarations
    int lv_techIndex;
    int lv_requiredTechIndex;

    // Variable Initialization

    // Implementation
    lv_techIndex = (lp_tech);
    lv_requiredTechIndex = (lp_requiredTech);
    if ((libCamp_gv_tSX_Tech_Status[lv_requiredTechIndex] != 2)) {
        libCamp_gv_tSX_Tech_Status[lv_techIndex] = 0;
    }
    else {
        if ((libCamp_gv_tSX_Tech_Status[lv_techIndex] == 0)) {
            libCamp_gv_tSX_Tech_Status[lv_techIndex] = 1;
        }
        else {
        }
    }
}

void libCamp_gf_TS_StoryCheckTechReqs () {
    int auto648F03B3_ae;
    int auto648F03B3_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    auto648F03B3_ae = libCamp_gv_TSC_TECH_LAST;
    auto648F03B3_ai = 1;
    lv_index = libCamp_gv_TSC_TECH_FIRST;
    for ( ; ( (auto648F03B3_ai >= 0 && lv_index <= auto648F03B3_ae) || (auto648F03B3_ai <= 0 && lv_index >= auto648F03B3_ae) ) ; lv_index += auto648F03B3_ai ) {
        if ((libCamp_gv_tS_Tech_Requires[lv_index] != 0)) {
            libCamp_gf_TS_StoryCheckTechReqSingle(libCamp_gv_tS_TechID[lv_index], libCamp_gv_tS_Tech_Requires[lv_index]);
        }
    }
}

void libCamp_gf_TS_HelpUnitsPanel_AddEnabledUnitType (string lp_unitType) {
    // Implementation
    if (((libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypesCount == libCamp_gv_tSC_HelpUnitsPanel_EnabledUnitTypesCountMax) || (libCamp_gf_TS_HelpUnitsPanel_EnabledUnitTypeAlreadyExisted(lp_unitType) == true))) {
        return ;
    }
    else {
    }
    libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypesCount += 1;
    libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypes[libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypesCount] = lp_unitType;
    DataTableSetString(true, libCamp_gf_TS_HelpUnitsPanel_UnitTypeStringID(lp_unitType), IntToString(libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypesCount));
}

void libCamp_gf_TS_HelpUnitsPanel_ResetEnabledUnitTypes () {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypesCount = 0;
}

void libCamp_gf_TS_HelpUnitsPanel_UpdatePanel () {
    int auto76A09CC2_ae;
    int auto76A09CC2_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    auto76A09CC2_ae = libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypesCount;
    auto76A09CC2_ai = 1;
    lv_index = 1;
    for ( ; ( (auto76A09CC2_ai >= 0 && lv_index <= auto76A09CC2_ae) || (auto76A09CC2_ai <= 0 && lv_index >= auto76A09CC2_ae) ) ; lv_index += auto76A09CC2_ai ) {
        if ((libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypes[lv_index] == null)) {
            TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_E3B25A20") + StringExternal("Param/Value/lib_Camp_E87EDEEC") + IntToText(lv_index)), false);
        }
        else {
            TextExpressionSetToken("Param/Expression/lib_Camp_5A99EA6C", "A", UnitTypeGetName(libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypes[lv_index]));
            TriggerDebugOutput(1, TextExpressionAssemble("Param/Expression/lib_Camp_5A99EA6C"), false);
            TechTreeUnitHelp(1, libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypes[lv_index], true);
        }
    }
}

void libCamp_gf_TS_HelpTechTree_UpdatePanel () {
    // Implementation
    HelpPanelShowTechTreeRace(PlayerGroupAll(), "Terr", false);
    HelpPanelShowTechTreeRace(PlayerGroupAll(), "Prot", false);
    HelpPanelShowTechTreeRace(PlayerGroupAll(), "Zerg", false);
    if ((libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 1) == false)) {
        return ;
    }
    else {
    }
    if ((libCamp_gv_tS_CurrentMap == 31)) {
        HelpPanelShowTechTreeRace(PlayerGroupAll(), "Terr", true);
    }
    else if (((libCamp_gv_tS_CurrentMap == 22) || (libCamp_gv_tS_CurrentMap == 23) || (libCamp_gv_tS_CurrentMap == 24) || (libCamp_gv_tS_CurrentMap == 25))) {
        HelpPanelShowTechTreeRace(PlayerGroupAll(), "Prot", true);
    }
    else if ((libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 1) == true)) {
        HelpPanelShowTechTreeRace(PlayerGroupAll(), "Terr", true);
    }
}

string libCamp_gf_TS_BankSectionName (string lp_section) {
    // Implementation
    return (lp_section);
}

string libCamp_gf_TS_BackToStoryModeLoadingImage (string lp_imageToDo) {
    string auto1BDC892D_val;

    // Variable Declarations
    string lv_image;

    // Variable Initialization

    // Implementation
    auto1BDC892D_val = lp_imageToDo;
    if (auto1BDC892D_val == "MarSaraLoadingScreenImage") {
        libCamp_gv_tSX_LoadingImageCurrentMarSara += 1;
        if ((libCamp_gv_tSX_LoadingImageCurrentMarSara > libCamp_gv_tS_LoadingImageCountMarSara)) {
            libCamp_gv_tSX_LoadingImageCurrentMarSara = 1;
        }
        else {
        }
        lv_image = libCamp_gv_tS_LoadingImagesMarSara[libCamp_gv_tSX_LoadingImageCurrentMarSara];
    }
    else if (auto1BDC892D_val == "HyperionLoadingScreenImage") {
        libCamp_gv_tSX_LoadingImageCurrentHyperion += 1;
        if ((libCamp_gv_tSX_LoadingImageCurrentHyperion > libCamp_gv_tS_LoadingImageCountHyperion)) {
            libCamp_gv_tSX_LoadingImageCurrentHyperion = 1;
        }
        else {
        }
        lv_image = libCamp_gv_tS_LoadingImagesHyperion[libCamp_gv_tSX_LoadingImageCurrentHyperion];
    }
    else if (auto1BDC892D_val == "LabLoadingScreenImage") {
        libCamp_gv_tSX_LoadingImageCurrentLab += 1;
        if ((libCamp_gv_tSX_LoadingImageCurrentLab > libCamp_gv_tS_LoadingImageCountLab)) {
            libCamp_gv_tSX_LoadingImageCurrentLab = 1;
        }
        else {
        }
        lv_image = libCamp_gv_tS_LoadingImagesLab[libCamp_gv_tSX_LoadingImageCurrentLab];
    }
    else if (auto1BDC892D_val == "CantinaLoadingScreenImage") {
        libCamp_gv_tSX_LoadingImageCurrentCantina += 1;
        if ((libCamp_gv_tSX_LoadingImageCurrentCantina > libCamp_gv_tS_LoadingImageCountCantina)) {
            libCamp_gv_tSX_LoadingImageCurrentCantina = 1;
        }
        else {
        }
        lv_image = libCamp_gv_tS_LoadingImagesCantina[libCamp_gv_tSX_LoadingImageCurrentCantina];
    }
    else if (auto1BDC892D_val == "ArmoryLoadingScreenImage") {
        libCamp_gv_tSX_LoadingImageCurrentArmory += 1;
        if ((libCamp_gv_tSX_LoadingImageCurrentArmory > libCamp_gv_tS_LoadingImageCountArmory)) {
            libCamp_gv_tSX_LoadingImageCurrentArmory = 1;
        }
        else {
        }
        lv_image = libCamp_gv_tS_LoadingImagesArmory[libCamp_gv_tSX_LoadingImageCurrentArmory];
    }
    else if (auto1BDC892D_val == "CharLoadingScreenImage") {
        libCamp_gv_tSX_LoadingImageCurrentChar += 1;
        if ((libCamp_gv_tSX_LoadingImageCurrentChar > libCamp_gv_tS_LoadingImageCountChar)) {
            libCamp_gv_tSX_LoadingImageCurrentChar = 1;
        }
        else {
        }
        lv_image = libCamp_gv_tS_LoadingImagesChar[libCamp_gv_tSX_LoadingImageCurrentChar];
    }
    else {
        lv_image = lp_imageToDo;
    }
    return lv_image;
}

text libCamp_gf_TS_FormatLoadingScreenText (int lp_mission) {
    // Implementation
    return libCamp_gf_MissionPlanetInfo(lp_mission);
}

string libCamp_gf_TS_MissionBankName (int lp_mission) {
    // Implementation
    return libCamp_gv_tS_MapFile[(lp_mission)];
}

string libCamp_gf_StoryModeRoomStates () {
    // Implementation
    return libCamp_gv_tSX_RoomStates;
}

void libCamp_gf_LoadCampaignData (int lp_map) {
    int auto149C01FA_val;
    playergroup auto12F40F19_g;
    int auto12F40F19_p;
    playergroup autoD57400DD_g;
    int autoD57400DD_p;
    playergroup autoD3898CB1_g;
    int autoD3898CB1_p;
    playergroup auto4C85CA01_g;
    int auto4C85CA01_p;
    playergroup autoED5BF6AF_g;
    int autoED5BF6AF_p;
    playergroup auto05DE0937_g;
    int auto05DE0937_p;

    // Variable Declarations
    int lv_indexPlayer;
    int lv_mission;
    string lv_bankName;

    // Variable Initialization
    lv_indexPlayer = 1;
    lv_bankName = "TRaynor01";

    // Implementation
    CampaignMode(PlayerGroupAll(), true);
    if ((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true)) {
        TriggerDebugSetTypeFile(1, "StoryModeDebug.txt");
        libCamp_gv_debug_MapIDForPerfTest = lp_map;
        TriggerExecute(libCamp_gt_Debug_StartPerformanceLogging, true, false);
    }
    else {
    }
    libCamp_gf_CP_LoadVars();
    libCamp_gv_tS_CurrentMap = (lp_map);
    libCamp_gf_TS_InitializeStateData();
    libCamp_gf_TS_InitializeStoryModeLoadingImages();
    libCamp_gf_TS_InitizlizeStoryConversations();
    libCamp_gf_TS_InitializeMapData();
    libCamp_gf_TS_InitializeSceneData();
    libCamp_gf_TS_InitializeMissionObjectiveData();
    libCamp_gf_TS_InitializePlanetData();
    libCamp_gf_TS_InitializeTechData();
    libCamp_gf_TS_InitializeResearchData();
    libCamp_gf_TS_InitializeMercData();
    libCamp_gf_TS_DebugBuyTechInitPurchasableShortcut();
    libCamp_gf_TS_InitializeStoryRooms();
    libCamp_gf_TS_InitializeStoryActors();
    libCamp_gf_TS_InitializeMapAchievementData();
    libCamp_gf_TS_LoadAllTransitionData(lp_map);
    libCamp_gf_TS_UpdateStoryStates();
    if ((libCamp_gf_StoryState(1) > 0)) {
        AchievementsDisable(1);
    }
    else {
    }
    if ((lp_map != 31) && (lp_map != 32)) {
        AIDisableAllScouting();
        auto149C01FA_val = PlayerDifficulty(1);
        if (auto149C01FA_val == 4) {
            GameSetSpeedValueMinimum(c_gameSpeedFaster);
        }
        else if (auto149C01FA_val == 3) {
            GameSetSpeedValueMinimum(c_gameSpeedFast);
        }
        else {
        }
    }
    else {
    }
    if (((libCamp_gv_tS_CurrentMap == 1) || (libCamp_gv_tS_CurrentMap == 2) || (libCamp_gv_tS_CurrentMap == 3)) && (GameIsTransitionMap() == false)) {
        libCamp_gf_TS_DebugBuyTechAverage();
    }
    else {
    }
    libCamp_gf_ApplyCampaignTech(1);
    auto12F40F19_g = PlayerGroupAll(); 
    auto12F40F19_p = 1;
    for ( ; auto12F40F19_p <= PlayerGroupCount(auto12F40F19_g) ; auto12F40F19_p += BoolToInt(lv_indexPlayer == PlayerGroupPlayer(auto12F40F19_g, auto12F40F19_p)) ) {
        lv_indexPlayer = PlayerGroupPlayer(auto12F40F19_g, auto12F40F19_p);
        if ((PlayerType(lv_indexPlayer) != c_playerTypeUser) && (PlayerType(lv_indexPlayer) != c_playerTypeNeutral)) {
            TechTreeUpgradeAddLevel(lv_indexPlayer, "TechReactorAI", 1);
            TechTreeUpgradeAddLevel(lv_indexPlayer, "haltech", libNtve_gf_DifficultyValueInt(0, 0, 1, 1));
            TechTreeUpgradeAddLevel(lv_indexPlayer, "MarauderLifeBoost", libNtve_gf_DifficultyValueInt(0, 0, 1, 1));
            TechTreeUpgradeAddLevel(lv_indexPlayer, "PsiStormTech", libNtve_gf_DifficultyValueInt(0, 0, 1, 1));
            TechTreeUpgradeAddLevel(lv_indexPlayer, "StabilizerMedPacks", libNtve_gf_DifficultyValueInt(0, 0, 0, 1));
            TechTreeUpgradeAddLevel(lv_indexPlayer, "InterceptorLimit4", libNtve_gf_DifficultyValueInt(1, 1, 0, 0));
            TechTreeUpgradeAddLevel(lv_indexPlayer, "InterceptorLimit6", libNtve_gf_DifficultyValueInt(0, 0, 1, 0));
        }
        else {
        }
    }
    libCamp_gf_TS_Tutorial_RestoreHistoryToUI();
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeCharacterSheetButton, false);
    if ((libCamp_gv_tS_CurrentMap == 31) && (libCamp_gf_MissionStatusCheck(2, 2) == true)) {
        UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeCashPanel, true);
    }
    else {
        UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeCashPanel, false);
    }
    UISetGameMenuItemVisible(PlayerGroupAll(), c_gameMenuDialogRestartDifficultyPulldown, true);
    if (((libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 1) == true) || (libCamp_gv_tS_CurrentMap == 32))) {
        libCamp_gf_TS_PrepareForMissionLoadingScreen(libCamp_gv_tS_CurrentMap, true);
    }
    else {
    }
    DialogControlHookupStandard(c_triggerControlTypePanel, "UIContainer/FullscreenUpperContainer/ObjectivePanel");
    libCamp_gv_zS_ObjectivePanel = DialogControlLastCreated();
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, 0, 30);
    TransmissionSetOption(c_transmissionOptionHideAlertPanel, true);
    autoD57400DD_g = PlayerGroupAll(); 
    autoD57400DD_p = 1;
    for ( ; autoD57400DD_p <= PlayerGroupCount(autoD57400DD_g) ; autoD57400DD_p += BoolToInt(lv_indexPlayer == PlayerGroupPlayer(autoD57400DD_g, autoD57400DD_p)) ) {
        lv_indexPlayer = PlayerGroupPlayer(autoD57400DD_g, autoD57400DD_p);
        if ((PlayerType(lv_indexPlayer) != c_playerTypeUser)) {
            PlayerSetState(lv_indexPlayer, c_playerStateDisplayInLeaderPanel, false);
            PlayerSetState(lv_indexPlayer, c_playerStateDisplayInViewMenu, false);
        }
        else {
        }
    }
    autoD3898CB1_g = PlayerGroupAll(); 
    autoD3898CB1_p = 1;
    for ( ; autoD3898CB1_p <= PlayerGroupCount(autoD3898CB1_g) ; autoD3898CB1_p += BoolToInt(lv_indexPlayer == PlayerGroupPlayer(autoD3898CB1_g, autoD3898CB1_p)) ) {
        lv_indexPlayer = PlayerGroupPlayer(autoD3898CB1_g, autoD3898CB1_p);
        if ((PlayerType(lv_indexPlayer) != c_playerTypeUser)) {
            PlayerSetState(lv_indexPlayer, c_playerStateShowScore, false);
        }
        else {
        }
    }
    GameCheatAllow(c_gameCheatNoVictory, false);
    GameCheatAllow(c_gameCheatNoDefeat, false);
    auto4C85CA01_g = PlayerGroupAll(); 
    auto4C85CA01_p = 1;
    for ( ; auto4C85CA01_p <= PlayerGroupCount(auto4C85CA01_g) ; auto4C85CA01_p += BoolToInt(lv_indexPlayer == PlayerGroupPlayer(auto4C85CA01_g, auto4C85CA01_p)) ) {
        lv_indexPlayer = PlayerGroupPlayer(auto4C85CA01_g, auto4C85CA01_p);
        PlayerSetState(lv_indexPlayer, c_playerStateContinueEnabled, false);
    }
    if ((libCamp_gv_tS_InStoryMode == false)) {
        auto05DE0937_g = PlayerGroupAll(); 
        auto05DE0937_p = 1;
        for ( ; auto05DE0937_p <= PlayerGroupCount(auto05DE0937_g) ; auto05DE0937_p += BoolToInt(lv_indexPlayer == PlayerGroupPlayer(auto05DE0937_g, auto05DE0937_p)) ) {
            lv_indexPlayer = PlayerGroupPlayer(auto05DE0937_g, auto05DE0937_p);
            UISetGameMenuItemVisible(PlayerGroupAll(), c_gameMenuDialogRestartButton, true);
            UISetGameMenuItemVisible(PlayerGroupAll(), c_gameMenuDialogAbortButton, true);
        }
    }
    else {
        autoED5BF6AF_g = PlayerGroupAll(); 
        autoED5BF6AF_p = 1;
        for ( ; autoED5BF6AF_p <= PlayerGroupCount(autoED5BF6AF_g) ; autoED5BF6AF_p += BoolToInt(lv_indexPlayer == PlayerGroupPlayer(autoED5BF6AF_g, autoED5BF6AF_p)) ) {
            lv_indexPlayer = PlayerGroupPlayer(autoED5BF6AF_g, autoED5BF6AF_p);
            UISetGameMenuItemVisible(PlayerGroupAll(), c_gameMenuDialogRestartButton, false);
            UISetGameMenuItemVisible(PlayerGroupAll(), c_gameMenuDialogAbortButton, false);
        }
    }
    TriggerDebugOutput(1, StringExternal("Param/Value/lib_Camp_DE16BDF6"), false);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_75436892") + libNtve_gf_ConvertBooleanToText(libCamp_gf_CampaignDebugModeIsOn("ProgressCheat"))), false);
    if ((libCamp_gv_tS_CurrentMap == 31) && (libCamp_gf_CampaignDebugModeIsOn("ProgressCheat") == true) && (libCamp_gf_NumberOfMissions(3) == 0)) {
        libCamp_gf_TS_DebugProgressDisplayDialog(0, libCamp_gt_TS_DebugProgressOKCallback, null);
        while (!((libCamp_gv_tS_DebugProgressDialogOpened == false))) {
            Wait(0.5, c_timeReal);
        }
    }
    else {
    }
    if ((libCamp_gf_ZS_TrialEnd() == true)) {
        libCamp_gf_ZS_DisplayCampaignTrialDialog(true);
        while (true) {
            Wait(10.0, c_timeGame);
        }
    }
    else {
    }
}

void libCamp_gf_PrepareForMission (int lp_nextMission, bool lp_nextIsSimulation, bool lp_nextIsVictoryPlayAgain, int lp_difficulty) {
    // Variable Declarations
    string lv_image;
    int lv_planet;
    text lv_title;
    text lv_subTitle;

    // Variable Initialization
    lv_title = StringExternal("Param/Value/lib_Camp_FAE8D887");
    lv_subTitle = StringExternal("Param/Value/lib_Camp_4C2BABC5");

    // Implementation
    SetNextMissionDifficulty(PlayerGroupAll(), lp_difficulty);
    if ((lp_nextIsSimulation == false)) {
        libCamp_gf_TS_SetCampaignDifficulty(lp_difficulty);
    }
    else {
    }
    libCamp_gf_TS_SaveAllTransitionData((lp_nextIsSimulation == true), lp_nextIsVictoryPlayAgain, false);
    GameSetNextMap(("Campaign/" + libCamp_gv_tS_MapFile[(lp_nextMission)]));
    libCamp_gf_TS_PrepareForMissionLoadingScreen(lp_nextMission, false);
}

void libCamp_gf_TS_PrepareForMissionLoadingScreen (int lp_nextMission, bool lp_restart) {
    // Variable Declarations
    string lv_image;
    int lv_planet;
    text lv_title;
    text lv_subTitle;
    text lv_help;

    // Variable Initialization
    lv_title = StringExternal("Param/Value/lib_Camp_F8D0C7A8");
    lv_subTitle = StringExternal("Param/Value/lib_Camp_C4DF4946");

    // Implementation
    lv_image = libCamp_gf_MissionLoadingScreenImage(lp_nextMission);
    lv_title = (StringExternal("Param/Value/lib_Camp_8096E0CA"));
    lv_subTitle = (StringExternal("Param/Value/lib_Camp_313A7E60") + libCamp_gf_MissionNameInUpperCase(lp_nextMission) + StringExternal("Param/Value/lib_Camp_C7EDB8C8"));
    lv_help = StringExternal("Param/Value/lib_Camp_161ED481");
    if ((libCamp_gf_MapTypeCheck(lp_nextMission, 1) == true)) {
        if ((lp_nextMission == 29) && (libCamp_gf_MissionStatusCheck(28, 2) == true)) {
            if ((lp_restart == false)) {
                lv_help = ConversationDataStateText(libCamp_gf_TS_MapConvoID(lp_nextMission), "Loading Screen Help 2");
            }
            else {
                lv_help = ConversationDataStateText(libCamp_gf_TS_MapConvoID(lp_nextMission), "Loading Screen Restart 2");
            }
        }
        else {
            if ((lp_restart == false)) {
                lv_help = ConversationDataStateText(libCamp_gf_TS_MapConvoID(lp_nextMission), "Loading Screen Help");
            }
            else {
                lv_help = ConversationDataStateText(libCamp_gf_TS_MapConvoID(lp_nextMission), "Loading Screen Restart");
            }
        }
    }
    else {
    }
    if ((lp_nextMission == 32)) {
        if ((lp_restart == true)) {
            UISetRestartLoadingScreen(StringExternal("Param/Value/lib_Camp_486A5433"));
        }
        else {
        }
        UISetNextLoadingScreen("Assets\\Textures\\loading-lostviking.dds", StringExternal("Param/Value/lib_Camp_42623648"), (StringExternal("Param/Value/lib_Camp_D1F4D6A7") + StringExternal("Param/Value/lib_Camp_3AB64EDD") + StringExternal("Param/Value/lib_Camp_8172429D")), StringExternal("Param/Value/lib_Camp_3EF6726E"), StringExternal("Param/Value/lib_Camp_5B28E86A"), true);
        UISetNextLoadingScreenImageScale(c_scaleAspect);
        UISetNextLoadingScreenTextPosition(c_anchorTop, 0, 250, 750, 400);
    }
    else {
        if ((lp_restart == true)) {
            UISetRestartLoadingScreen(lv_help);
        }
        else {
            UISetNextLoadingScreen(lv_image, lv_title, lv_subTitle, StringExternal("Param/Value/lib_Camp_0CA92CB6"), lv_help, true);
            UISetNextLoadingScreenImageScale(c_scaleAspect);
            UISetNextLoadingScreenTextPosition(c_anchorTopLeft, 50, 250, 750, 400);
        }
    }
}

void libCamp_gf_PrepareForStoryMode (int lp_resultFromVictory, int lp_difficulty) {
    // Variable Declarations
    int lv_mapID;
    string lv_image;
    bool lv_isActuallyVictory;

    // Variable Initialization

    // Implementation
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_6291DFB9") + libNtve_gf_ConvertBooleanToText((lp_resultFromVictory == c_gameOverVictory)) + StringExternal("Param/Value/lib_Camp_C1F1A5CC") + DifficultyNameCampaign(lp_difficulty)), false);
    lv_isActuallyVictory = ((lp_resultFromVictory == c_gameOverVictory) || libCamp_gv_tSX_IsVictoryPlayAgain);
    if ((libCamp_gv_tSX_IsSimulation == false) && (libCamp_gf_MapTypeCheck(libCamp_gf_TS_MapIDFromIndex(libCamp_gv_tS_CurrentMap), 1) == true) && (lv_isActuallyVictory == true)) {
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_22F0B82E")), false);
        if ((libCamp_gv_tS_CurrentMap == 29)) {
            libCamp_gf_CP_SetCampaignCompleted(true);
        }
        else {
        }
        libCamp_gf_TS_SetLastSuccessfulMission(libCamp_gf_TS_MapIDFromIndex(libCamp_gv_tS_CurrentMap));
        libCamp_gf_TS_CompleteMission(libCamp_gf_TS_MapIDFromIndex(libCamp_gv_tS_CurrentMap));
        libCamp_gf_TS_UpdateTransitionVars();
    }
    else {
        if ((libCamp_gv_tS_Horner05sSimulationBeforeCompleted == true) && (lv_isActuallyVictory == true)) {
            libCamp_gf_TS_CompleteMission(libCamp_gf_TS_MapIDFromIndex(libCamp_gv_tS_CurrentMap));
            libCamp_gf_TS_UpdateTransitionVars();
        }
        else {
        }
    }
    SetNextMissionDifficulty(PlayerGroupSingle(1), lp_difficulty);
    if (((libCamp_gv_tSX_IsSimulation == true) || (libCamp_gf_MissionStatusCheck(29, 2) == true))) {
        lv_image = "HyperionLoadingScreenImage";
    }
    else {
        if ((lv_isActuallyVictory == true)) {
            lv_image = libCamp_gv_tS_MapBackLoadingImage[(libCamp_gv_tS_CurrentMap)];
        }
        else {
            lv_image = libCamp_gv_tS_MapBackDefeatLoadingImage[(libCamp_gv_tS_CurrentMap)];
            if ((lv_image == null)) {
                lv_image = libCamp_gv_tS_MapBackLoadingImage[(libCamp_gv_tS_CurrentMap)];
            }
            else {
            }
        }
    }
    lv_image = libCamp_gf_TS_BackToStoryModeLoadingImage(lv_image);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_85AB6480") + StringToText(lv_image)), false);
    UISetNextLoadingScreen(lv_image, StringToText(""), StringToText(""), StringExternal("Param/Value/lib_Camp_EA5E7C73"), StringExternal("Param/Value/lib_Camp_CFB915EF"), false);
    UISetNextLoadingScreenImageScale(c_scaleAspect);
    UISetNextLoadingScreenTextPosition(c_anchorTopLeft, 40, 60, 1100, 400);
    libCamp_gf_TS_SaveAllTransitionData(false, false, (lp_resultFromVictory == c_gameOverDefeat));
    lv_mapID = 31;
    GameSetNextMap(("Campaign/" + libCamp_gv_tS_MapFile[lv_mapID]));
}

void libCamp_gf_PrepareForStoryModeTransitionalSave () {
    // Implementation
    libCamp_gf_TS_OpenCampaignBank();
    libCamp_gf_TS_SaveTransitionVars(BankLastCreated(), false, false, false, 0);
    BankSave(BankLastCreated());
    libCamp_gf_TS_SaveMissionBanks();
}

void libCamp_gf_SetStoryModeRoomStates (string lp_roomStates) {
    // Implementation
    libCamp_gv_tSX_RoomStates = lp_roomStates;
}

void libCamp_gf_RegisterStoryModeRoomStatesDefaultCallback (trigger lp_defaultCallback) {
    // Implementation
    libCamp_gv_tS_RoomStatesDefaultCallback = lp_defaultCallback;
}

void libCamp_gf_TS_LoadAllTransitionData (int lp_map) {
    int auto1792D481_i;

    // Variable Declarations
    string lv_section;
    int lv_indexObjective;
    string lv_bankName;
    int lv_campaignDifficulty;

    // Variable Initialization
    lv_section = "Terran";
    lv_bankName = "TRaynor01";
    lv_campaignDifficulty = 1;

    // Implementation
    if ((BankExists(libCamp_gv_tS_BankName, 1) == true)) {
        libCamp_gf_TS_OpenCampaignBank();
        libCamp_gf_TS_LoadTransitionVars(BankLastCreated(), false);
        libCamp_gf_TS_UpdateCampaignScreen(libCamp_gf_LastSuccessfulMission());
        if ((libCamp_gf_MapTypeCheck(lp_map, 1) == true)) {
            if ((libCamp_gv_tS_CurrentMap == 16) && (libCamp_gf_MissionStatusCheck(16, 2) == false) && (libCamp_gv_tSX_IsSimulation == true)) {
                libCamp_gv_tS_Horner05sSimulationBeforeCompleted = true;
            }
            else {
            }
            auto1792D481_i = libCamp_gv_TSC_OBJECTIVE_FIRST;
            while (auto1792D481_i <= libCamp_gv_TSC_OBJECTIVE_LAST) {
                lv_indexObjective = libCamp_gv_tS_MissionObjIDs[auto1792D481_i];
                if ((libCamp_gf_MissionObjectiveStateCheck(lv_indexObjective, 1) == true)) {
                    libCamp_gv_tS_NonSnapShotObjectiveStates[(lv_indexObjective)] = 1;
                }
                else if ((libCamp_gf_MissionObjectiveStateCheck(lv_indexObjective, 2) == true)) {
                    libCamp_gv_tS_NonSnapShotObjectiveStates[(lv_indexObjective)] = 2;
                }
                else if ((libCamp_gf_MissionObjectiveStateCheck(lv_indexObjective, 0) == true)) {
                    libCamp_gv_tS_NonSnapShotObjectiveStates[(lv_indexObjective)] = 0;
                }
                libCamp_gv_tS_NonSnapShotObjectiveProgress[(lv_indexObjective)] = libCamp_gf_MissionObjectiveProgress(lv_indexObjective);
                auto1792D481_i = auto1792D481_i + 1;
            }
            libCamp_gv_tS_NonSnapShotMissionDifficultyCompleted = libCamp_gf_MissionDifficultyCompleted(lp_map, PlayerDifficulty(1));
            libCamp_gv_tS_NonSnapShotMissionBestTime = libCamp_gf_MissionCompleteBestTime(lp_map, PlayerDifficulty(1));
            libCamp_gv_tS_NonSnapShotMissionResearchProgress[(1)] = libCamp_gf_StoryResearchMissionProgress(lp_map, 1);
            libCamp_gv_tS_NonSnapShotMissionResearchProgress[(2)] = libCamp_gf_StoryResearchMissionProgress(lp_map, 2);
        }
        else {
        }
        lv_campaignDifficulty = libCamp_gf_TS_CampaignDifficulty();
        libCamp_gf_TS_OpenMissionBanks();
        libCamp_gf_TS_SetCampaignDifficulty(lv_campaignDifficulty);
    }
    else {
        libCamp_gf_TS_DefaultTransitionVars(true, true, true, true);
        libCamp_gf_TS_SetCampaignDifficulty(PlayerDifficulty(1));
    }
}

void libCamp_gf_TS_SaveAllTransitionData (bool lp_nextIsSimulation, bool lp_nextIsVictoryPlayAgain, bool lp_resultFromDefeat) {
    // Variable Declarations
    string lv_section;
    int lv_saveAll;

    // Variable Initialization
    lv_section = "Terran";

    // Implementation
    libCamp_gf_TS_OpenCampaignBank();
    libCamp_gv_tSX_LastMap = libCamp_gv_tS_CurrentMap;
    if ((libCamp_gv_tSX_IsVictoryPlayAgain == true)) {
        libCamp_gv_tSX_LastMapSuccess = true;
    }
    else {
        libCamp_gv_tSX_LastMapSuccess = (lp_resultFromDefeat == false);
    }
    if ((libCamp_gf_MapTypeCheck(libCamp_gf_TS_MapIDFromIndex(libCamp_gv_tSX_LastMap), 1) == true)) {
        libCamp_gv_tSX_LastMission = libCamp_gv_tSX_LastMap;
        libCamp_gv_tSX_LastMissionSuccess = libCamp_gv_tSX_LastMapSuccess;
        libCamp_gv_tSX_LastMissionSimulation = libCamp_gv_tSX_IsSimulation;
    }
    else {
    }
    if ((libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 1) == true) && (((libCamp_gv_tSX_IsSimulation == true) && (libCamp_gv_tS_Horner05sSimulationBeforeCompleted == false)) || (libCamp_gv_tSX_IsVictoryPlayAgain == true))) {
        lv_saveAll = 2;
    }
    else {
        lv_saveAll = 0;
    }
    libCamp_gf_TS_SaveTransitionVars(BankLastCreated(), lp_nextIsSimulation, lp_nextIsVictoryPlayAgain, lp_resultFromDefeat, lv_saveAll);
    BankSave(BankLastCreated());
    libCamp_gf_TS_SaveMissionBanks();
}

void libCamp_gf_TS_DefaultTransitionVars (bool lp_includeTransitionDetails, bool lp_includeTech, bool lp_includeMissionFlow, bool lp_includeStates) {
    int auto3013C6B6_i;
    int autoD8C543D5_i;
    int auto5C6F3E82_i;
    int auto1D6D0375_ae;
    int auto1D6D0375_ai;

    // Variable Declarations
    int lv_index;
    int lv_indexMission;
    int lv_convoIndex;
    int lv_indexObjective;
    int lv_indexStoryState;
    int lv_iindexScene;

    // Variable Initialization

    // Implementation
    TriggerDebugOutput(1, StringExternal("Param/Value/lib_Camp_03BCF8D4"), false);
    if ((lp_includeTransitionDetails == true)) {
        libCamp_gv_tSX_IsSimulation = false;
        libCamp_gv_tSX_IsVictoryPlayAgain = false;
        libCamp_gv_tSX_LastMap = 0;
        libCamp_gv_tSX_LastMapSuccess = true;
        libCamp_gv_tSX_LastMission = 0;
        libCamp_gv_tSX_LastMissionSuccess = true;
        libCamp_gv_tSX_LastMissionSimulation = false;
        libCamp_gf_TS_SetLastSuccessfulMission(0);
    }
    else {
    }
    if ((lp_includeMissionFlow == true)) {
        auto3013C6B6_i = libCamp_gv_TSC_MISSION_FIRST;
        while (auto3013C6B6_i <= libCamp_gv_TSC_MISSION_LAST) {
            lv_indexMission = libCamp_gv_tS_MapID[auto3013C6B6_i];
            libCamp_gf_TS_MarkMissionAsStatus(lv_indexMission, 0);
            libCamp_gf_TS_SetMissionDifficultyCompleted(lv_indexMission, 1, false);
            libCamp_gf_TS_SetMissionDifficultyCompleted(lv_indexMission, 2, false);
            libCamp_gf_TS_SetMissionDifficultyCompleted(lv_indexMission, 3, false);
            libCamp_gf_TS_SetMissionDifficultyCompleted(lv_indexMission, 4, false);
            libCamp_gf_TS_SetMissionCompleteBestTime(lv_indexMission, 1, 0);
            libCamp_gf_TS_SetMissionCompleteBestTime(lv_indexMission, 2, 0);
            libCamp_gf_TS_SetMissionCompleteBestTime(lv_indexMission, 3, 0);
            libCamp_gf_TS_SetMissionCompleteBestTime(lv_indexMission, 4, 0);
            auto3013C6B6_i = auto3013C6B6_i + 1;
        }
        libCamp_gf_TS_MarkMissionAsStatus(1, 1);
    }
    else {
    }
    if ((lp_includeTech == true)) {
        libCamp_gf_TS_ResetTechData();
    }
    else {
    }
    if ((lp_includeStates == true)) {
        libCamp_gf_SetStoryCredits(0);
        libCamp_gf_TS_ResetResearchData();
        libCamp_gf_TS_ResetMercData();
        autoD8C543D5_i = libCamp_gv_TSC_STORYSTATE_FIRST;
        while (autoD8C543D5_i <= libCamp_gv_TSC_STORYSTATE_LAST) {
            lv_indexStoryState = autoD8C543D5_i;
            libCamp_gf_SetStoryState(lv_indexStoryState, 0);
            autoD8C543D5_i = autoD8C543D5_i + 1;
        }
        libCamp_gv_tSX_MissionObjRewardsEarnedCurrent = 0;
        ConversationDataResetStateValues("MissionObjective");
        auto5C6F3E82_i = libCamp_gv_TSC_SCENE_FIRST;
        while (auto5C6F3E82_i <= libCamp_gv_TSC_SCENE_LAST) {
            lv_iindexScene = libCamp_gv_tS_SceneIDs[auto5C6F3E82_i];
            libCamp_gf_SetScenePlayed(lv_iindexScene, false);
            auto5C6F3E82_i = auto5C6F3E82_i + 1;
        }
        libCamp_gv_tSX_DebugTechCheatOption = 2;
        if ((libCamp_gv_tS_RoomStatesDefaultCallback != null)) {
            TriggerExecute(libCamp_gv_tS_RoomStatesDefaultCallback, true, false);
        }
        else {
            libCamp_gv_tSX_RoomStates = "";
        }
        libCamp_gv_tSX_LoadingImageCurrentMarSara = 0;
        libCamp_gv_tSX_LoadingImageCurrentHyperion = 0;
        libCamp_gv_tSX_LoadingImageCurrentLab = 0;
        libCamp_gv_tSX_LoadingImageCurrentCantina = 0;
        libCamp_gv_tSX_LoadingImageCurrentArmory = 0;
        libCamp_gv_tSX_LoadingImageCurrentChar = 0;
        libCamp_gf_TS_HelpUnitsPanel_ResetEnabledUnitTypes();
        libCamp_gf_TS_Tutorial_ResetHistory();
        auto1D6D0375_ae = libCamp_gv_tS_ConvoCount;
        auto1D6D0375_ai = 1;
        lv_index = 1;
        for ( ; ( (auto1D6D0375_ai >= 0 && lv_index <= auto1D6D0375_ae) || (auto1D6D0375_ai <= 0 && lv_index >= auto1D6D0375_ae) ) ; lv_index += auto1D6D0375_ai ) {
            ConversationDataResetNodeState(libCamp_gv_tS_Convos[lv_index]);
        }
        ConversationDataResetStateValues("ABChoice");
        ConversationDataResetStateValues("ABChoiceRewards");
        ConversationDataResetStateValues("ArcadeGameVariables");
        ConversationDataResetStateValues("CharacterLocationStatus");
        ConversationDataResetStateValues("Characters");
        ConversationDataResetStateValues("Credits");
        ConversationDataResetStateValues("DebriefRoomChange");
        ConversationDataResetStateValues("Hotspots");
        ConversationDataResetStateValues("LabResearch");
        ConversationDataResetStateValues("LabResearchCompleted");
        ConversationDataResetStateValues("LabResearchObject");
        ConversationDataResetStateValues("LabResearchUnlocked");
        ConversationDataResetStateValues("MissionCompletedCount");
        ConversationDataResetStateValues("MissionObjective");
        ConversationDataResetStateValues("NewMissionOpened");
        ConversationDataResetStateValues("StoryNews");
        ConversationDataResetStateValues("StoryState");
        ConversationDataResetStateValues("StoryTips");
        ConversationDataResetStateValues("Tech");
        ConversationDataResetStateValues("TechState");
        ConversationDataResetStateValues("Timestamps");
        ConversationDataResetStateValues("WritingCustomStates");
        ConversationDataResetStateValues("ArcadeGameVariables");
    }
    else {
    }
}

int libCamp_gf_TS_LoadTransitionVarInteger (bank lp_bank, string lp_section, string lp_key, int lp_default) {
    // Implementation
    if ((BankKeyExists(lp_bank, lp_section, lp_key) == false)) {
        return lp_default;
    }
    else {
        return BankValueGetAsInt(lp_bank, lp_section, lp_key);
    }
}

bool libCamp_gf_TS_LoadTransitionVarBoolean (bank lp_bank, string lp_section, string lp_key, bool lp_default) {
    // Implementation
    if ((BankKeyExists(lp_bank, lp_section, lp_key) == false)) {
        return lp_default;
    }
    else {
        return BankValueGetAsFlag(lp_bank, lp_section, lp_key);
    }
}

string libCamp_gf_TS_LoadTransitionVarString (bank lp_bank, string lp_section, string lp_key, string lp_default) {
    // Implementation
    if ((BankKeyExists(lp_bank, lp_section, lp_key) == false)) {
        return lp_default;
    }
    else {
        return BankValueGetAsString(lp_bank, lp_section, lp_key);
    }
}

void libCamp_gf_TS_SaveTransitionVarInteger (bank lp_bank, string lp_section, string lp_key, int lp_value, int lp_default) {
    // Implementation
    if ((lp_value == lp_default)) {
        BankKeyRemove(lp_bank, lp_section, lp_key);
    }
    else {
        BankValueSetFromInt(lp_bank, lp_section, lp_key, lp_value);
    }
}

void libCamp_gf_TS_SaveTransitionVarBoolean (bank lp_bank, string lp_section, string lp_key, bool lp_value, bool lp_default) {
    // Implementation
    if ((lp_value == lp_default)) {
        BankKeyRemove(lp_bank, lp_section, lp_key);
    }
    else {
        BankValueSetFromFlag(lp_bank, lp_section, lp_key, lp_value);
    }
}

void libCamp_gf_TS_SaveTransitionVarString (bank lp_bank, string lp_section, string lp_key, string lp_value, string lp_default) {
    // Implementation
    if ((lp_value == lp_default)) {
        BankKeyRemove(lp_bank, lp_section, lp_key);
        return ;
    }
    else {
    }
    BankValueSetFromString(lp_bank, lp_section, lp_key, lp_value);
}

string libCamp_gf_TS_CampaignDifficultyBankKey (int lp_mission, int lp_difficulty) {
    int auto3D36807C_val;

    // Variable Declarations
    string lv_key;

    // Variable Initialization
    lv_key = "";

    // Implementation
    auto3D36807C_val = lp_difficulty;
    if (auto3D36807C_val == 1) {
        lv_key = "Casual";
    }
    else if (auto3D36807C_val == 2) {
        lv_key = "Normal";
    }
    else if (auto3D36807C_val == 3) {
        lv_key = "Hard";
    }
    else if (auto3D36807C_val == 4) {
        lv_key = "Brutal";
    }
    else {
    }
    return (IntToString((lp_mission)) + "-" + lv_key);
}

void libCamp_gf_TS_LoadTransitionVars (bank lp_sourceBank, bool lp_simulation) {
    int auto27BB3ED0_i;
    int auto890900C1_i;
    int auto45CDDF23_i;
    int auto23FD73C6_i;
    int auto009D82FC_i;
    int auto4AAF2001_i;
    int auto9E8E8BCC_i;
    int auto0841871E_i;
    int autoD29E95DB_ae;
    int autoD29E95DB_ai;
    int auto7B79738F_val;
    int auto62551DF2_ae;
    int auto62551DF2_ai;
    int auto4D414022_ae;
    int auto4D414022_ai;
    int auto90FBB9B2_i;
    int autoCF80CEC2_ae;
    int autoCF80CEC2_ai;

    // Variable Declarations
    string lv__SectionName;
    int lv_index;
    int lv_indexMission;
    int lv_indexObjective;
    int lv_indexResearch;
    int lv_indexMerc;
    int lv_tempTechStatus;
    int lv_indexStoryState;
    int lv_indexScene;
    int lv_normalDifficulty;
    int lv_count;
    text lv_title;
    text lv_description;
    string lv_icon;
    string lv_movie;

    // Variable Initialization
    lv__SectionName = "";
    lv_normalDifficulty = 2;
    lv_title = StringExternal("Param/Value/lib_Camp_4CEAECEC");
    lv_description = StringExternal("Param/Value/lib_Camp_E425AF1F");

    // Implementation
    TriggerDebugOutput(1, StringExternal("Param/Value/lib_Camp_8CA54644"), false);
    if ((lp_simulation == false)) {
        lv__SectionName = libCamp_gf_TS_BankSectionName("StoryStage");
        libCamp_gv_tSX_IsSimulation = libCamp_gf_TS_LoadTransitionVarBoolean(lp_sourceBank, lv__SectionName, IntToString((0)), false);
        libCamp_gv_tSX_IsVictoryPlayAgain = libCamp_gf_TS_LoadTransitionVarBoolean(lp_sourceBank, lv__SectionName, IntToString((1)), false);
        libCamp_gv_tSX_LastMap = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((2)), 0);
        libCamp_gv_tSX_LastMapSuccess = libCamp_gf_TS_LoadTransitionVarBoolean(lp_sourceBank, lv__SectionName, IntToString((3)), false);
        libCamp_gv_tSX_LastMission = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((4)), 0);
        libCamp_gv_tSX_LastMissionSuccess = libCamp_gf_TS_LoadTransitionVarBoolean(lp_sourceBank, lv__SectionName, IntToString((5)), false);
        libCamp_gv_tSX_LastMissionSimulation = libCamp_gf_TS_LoadTransitionVarBoolean(lp_sourceBank, lv__SectionName, IntToString((6)), false);
        libCamp_gf_TS_SetLastSuccessfulMission(libCamp_gf_TS_MapIDFromIndex(libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((7)), 0)));
        libCamp_gf_SetStoryCredits(libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((8)), 0));
    }
    else {
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("MissionAvailableAge");
    auto27BB3ED0_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto27BB3ED0_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto27BB3ED0_i];
        libCamp_gf_TS_SetMissionStatusAge(lv_indexMission, 1, libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((lv_indexMission)), 0));
        auto27BB3ED0_i = auto27BB3ED0_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("MissionCompletedAge");
    auto890900C1_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto890900C1_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto890900C1_i];
        libCamp_gf_TS_SetMissionStatusAge(lv_indexMission, 2, libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((lv_indexMission)), 0));
        auto890900C1_i = auto890900C1_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("MissionCompletion");
    auto45CDDF23_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto45CDDF23_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto45CDDF23_i];
        libCamp_gf_TS_SetMissionDifficultyCompleted(lv_indexMission, 1, libCamp_gf_TS_LoadTransitionVarBoolean(lp_sourceBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 1), false));
        libCamp_gf_TS_SetMissionDifficultyCompleted(lv_indexMission, 2, libCamp_gf_TS_LoadTransitionVarBoolean(lp_sourceBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 2), false));
        libCamp_gf_TS_SetMissionDifficultyCompleted(lv_indexMission, 3, libCamp_gf_TS_LoadTransitionVarBoolean(lp_sourceBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 3), false));
        libCamp_gf_TS_SetMissionDifficultyCompleted(lv_indexMission, 4, libCamp_gf_TS_LoadTransitionVarBoolean(lp_sourceBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 4), false));
        auto45CDDF23_i = auto45CDDF23_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("MissionBestTime");
    auto23FD73C6_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto23FD73C6_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto23FD73C6_i];
        libCamp_gf_TS_SetMissionCompleteBestTime(lv_indexMission, 1, libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 1), 0));
        libCamp_gf_TS_SetMissionCompleteBestTime(lv_indexMission, 2, libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 2), 0));
        libCamp_gf_TS_SetMissionCompleteBestTime(lv_indexMission, 3, libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 3), 0));
        libCamp_gf_TS_SetMissionCompleteBestTime(lv_indexMission, 4, libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 4), 0));
        auto23FD73C6_i = auto23FD73C6_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("ObjectiveProgress");
    ConversationDataLoadStateValues("MissionObjective", lp_sourceBank, lv__SectionName);
    if ((libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 2) == true)) {
        lv__SectionName = libCamp_gf_TS_BankSectionName("ObjectiveCreditsEarnedLastMission");
        libCamp_gv_tSX_MissionObjRewardsEarnedCurrent = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString(0), 0);
    }
    else {
        libCamp_gv_tSX_MissionObjRewardsEarnedCurrent = 0;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchProgressProtoss");
    libCamp_gv_tSX_DebugResearchLevel[(1)] = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString(0), 0);
    auto009D82FC_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto009D82FC_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto009D82FC_i];
        libCamp_gv_tSX_ResearchMissionProgress[(lv_indexMission)][(1)] = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((lv_indexMission)), 0);
        auto009D82FC_i = auto009D82FC_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchProgressZerg");
    libCamp_gv_tSX_DebugResearchLevel[(2)] = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString(0), 0);
    auto4AAF2001_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto4AAF2001_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto4AAF2001_i];
        libCamp_gv_tSX_ResearchMissionProgress[(lv_indexMission)][(2)] = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((lv_indexMission)), 0);
        auto4AAF2001_i = auto4AAF2001_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchOldLevel");
    libCamp_gv_tSX_ResearchPointsOld[(1)] = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((1)), 0);
    libCamp_gv_tSX_ResearchPointsOld[(2)] = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((2)), 0);
    lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchOldLevelUI");
    libCamp_gv_tSX_ResearchUIOldPoints[(1)] = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((1)), 0);
    libCamp_gv_tSX_ResearchUIOldPoints[(2)] = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((2)), 0);
    lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchState");
    auto9E8E8BCC_i = libCamp_gv_TSC_RESEARCH_FIRST;
    while (auto9E8E8BCC_i <= libCamp_gv_TSC_RESEARCH_LAST) {
        lv_indexResearch = libCamp_gv_tS_ResearchID[auto9E8E8BCC_i];
        libCamp_gv_tSX_ResearchState[(lv_indexResearch)] = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((lv_indexResearch)), (1));
        auto9E8E8BCC_i = auto9E8E8BCC_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchPointsConverted");
    libCamp_gv_tSX_ResearchPointsConverted[(1)] = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((1)), 0);
    libCamp_gv_tSX_ResearchPointsConverted[(2)] = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((2)), 0);
    lv__SectionName = libCamp_gf_TS_BankSectionName("MercStatus");
    auto0841871E_i = libCamp_gv_TSC_MERC_FIRST;
    while (auto0841871E_i <= libCamp_gv_TSC_MERC_LAST) {
        lv_indexMerc = libCamp_gv_tS_MercID[auto0841871E_i];
        libCamp_gv_tSX_MercStatus[(lv_indexMerc)] = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((lv_indexMerc)), 0);
        auto0841871E_i = auto0841871E_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("TechStatus");
    autoD29E95DB_ae = libCamp_gv_TSC_TECH_LAST;
    autoD29E95DB_ai = 1;
    lv_index = libCamp_gv_TSC_TECH_FIRST;
    for ( ; ( (autoD29E95DB_ai >= 0 && lv_index <= autoD29E95DB_ae) || (autoD29E95DB_ai <= 0 && lv_index >= autoD29E95DB_ae) ) ; lv_index += autoD29E95DB_ai ) {
        lv_tempTechStatus = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString(lv_index), (3));
        auto7B79738F_val = lv_tempTechStatus;
        if (auto7B79738F_val == (0)) {
            libCamp_gv_tSX_Tech_Status[lv_index] = 0;
        }
        else if (auto7B79738F_val == (4)) {
            libCamp_gv_tSX_Tech_Status[lv_index] = 4;
        }
        else if (auto7B79738F_val == (1)) {
            libCamp_gv_tSX_Tech_Status[lv_index] = 1;
        }
        else if (auto7B79738F_val == (2)) {
            libCamp_gv_tSX_Tech_Status[lv_index] = 2;
        }
        else if (auto7B79738F_val == (3)) {
            libCamp_gv_tSX_Tech_Status[lv_index] = 3;
        }
        else {
        }
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("HelpUnitsPanel");
    lv_count = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString(0), 0);
    auto62551DF2_ae = lv_count;
    auto62551DF2_ai = 1;
    lv_index = 1;
    for ( ; ( (auto62551DF2_ai >= 0 && lv_index <= auto62551DF2_ae) || (auto62551DF2_ai <= 0 && lv_index >= auto62551DF2_ae) ) ; lv_index += auto62551DF2_ai ) {
        if ((BankKeyExists(lp_sourceBank, lv__SectionName, IntToString(lv_index)) == true)) {
            libCamp_gf_TS_HelpUnitsPanel_AddEnabledUnitType(UnitTypeFromString(libCamp_gf_TS_LoadTransitionVarString(lp_sourceBank, lv__SectionName, IntToString(lv_index), "")));
        }
        else {
        }
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("TutorialHistory");
    lv_count = BankValueGetAsInt(lp_sourceBank, lv__SectionName, IntToString(0));
    auto4D414022_ae = lv_count;
    auto4D414022_ai = 1;
    lv_index = 1;
    for ( ; ( (auto4D414022_ai >= 0 && lv_index <= auto4D414022_ae) || (auto4D414022_ai <= 0 && lv_index >= auto4D414022_ae) ) ; lv_index += auto4D414022_ai ) {
        lv_title = BankValueGetAsText(lp_sourceBank, lv__SectionName, (IntToString(lv_index) + "_1"));
        lv_description = BankValueGetAsText(lp_sourceBank, lv__SectionName, (IntToString(lv_index) + "_2"));
        lv_icon = libCamp_gf_TS_Tutorial_ConvertStringToImage(BankValueGetAsString(lp_sourceBank, lv__SectionName, (IntToString(lv_index) + "_3")));
        lv_movie = libCamp_gf_TS_Tutorial_ConvertStringToMovie(BankValueGetAsString(lp_sourceBank, lv__SectionName, (IntToString(lv_index) + "_4")));
        libCamp_gf_TS_Tutorial_AddToHistory(lv_title, lv_description, lv_icon, lv_movie);
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("StoryState");
    ConversationDataLoadStateValues("StoryState", lp_sourceBank, lv__SectionName);
    lv__SectionName = libCamp_gf_TS_BankSectionName("ScenePlayed");
    auto90FBB9B2_i = libCamp_gv_TSC_SCENE_FIRST;
    while (auto90FBB9B2_i <= libCamp_gv_TSC_SCENE_LAST) {
        lv_indexScene = libCamp_gv_tS_SceneIDs[auto90FBB9B2_i];
        libCamp_gf_SetScenePlayed(lv_indexScene, libCamp_gf_TS_LoadTransitionVarBoolean(lp_sourceBank, lv__SectionName, IntToString((lv_indexScene)), false));
        auto90FBB9B2_i = auto90FBB9B2_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("SceneExtraObjects");
    ConversationDataLoadStateValues("SceneExtraObjects", lp_sourceBank, lv__SectionName);
    lv__SectionName = libCamp_gf_TS_BankSectionName("NewsPlayed");
    ConversationDataLoadStateValues("StoryNews", lp_sourceBank, lv__SectionName);
    libCamp_gf_TS_UpdateNewMissionOpened();
    lv__SectionName = libCamp_gf_TS_BankSectionName("Tips");
    ConversationDataLoadStateValues("StoryTips", lp_sourceBank, lv__SectionName);
    lv__SectionName = libCamp_gf_TS_BankSectionName("StoryMisc");
    libCamp_gv_tSX_CampaignDifficulty = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((0)), 0);
    libCamp_gv_tSX_RoomStates = libCamp_gf_TS_LoadTransitionVarString(lp_sourceBank, lv__SectionName, IntToString((1)), "");
    libCamp_gv_tSX_LoadingImageCurrentMarSara = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((2)), 0);
    libCamp_gv_tSX_LoadingImageCurrentHyperion = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((3)), 0);
    libCamp_gv_tSX_LoadingImageCurrentLab = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((4)), 0);
    libCamp_gv_tSX_LoadingImageCurrentCantina = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((5)), 0);
    libCamp_gv_tSX_LoadingImageCurrentArmory = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((6)), 0);
    libCamp_gv_tSX_LoadingImageCurrentChar = libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, IntToString((7)), 0);
    lv__SectionName = libCamp_gf_TS_BankSectionName("Conversation");
    autoCF80CEC2_ae = libCamp_gv_tS_ConvoCount;
    autoCF80CEC2_ai = 1;
    lv_index = 1;
    for ( ; ( (autoCF80CEC2_ai >= 0 && lv_index <= autoCF80CEC2_ae) || (autoCF80CEC2_ai <= 0 && lv_index >= autoCF80CEC2_ae) ) ; lv_index += autoCF80CEC2_ai ) {
        ConversationDataLoadNodeState(libCamp_gv_tS_Convos[lv_index], lp_sourceBank, lv__SectionName);
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("Hotspots");
    ConversationDataLoadStateValues("Hotspots", lp_sourceBank, lv__SectionName);
    lv__SectionName = libCamp_gf_TS_BankSectionName("ArcadeGame");
    ConversationDataLoadStateValues("ArcadeGameVariables", lp_sourceBank, lv__SectionName);
    lv__SectionName = libCamp_gf_TS_BankSectionName("DebugTechCheatOption");
    libCamp_gv_tSX_DebugTechCheatOption = libCamp_gf_TS_DebugConvertIntegerToTechCheatOption(libCamp_gf_TS_LoadTransitionVarInteger(lp_sourceBank, lv__SectionName, "0", 0));
    TriggerDebugOutput(1, StringExternal("Param/Value/lib_Camp_B621076E"), false);
}

void libCamp_gf_TS_SaveTransitionVars (bank lp_targetBank, bool lp_nextIsSimulation, bool lp_nextIsVictoryPlayAgain, bool lp_resultFromDefeat, int lp_saveType) {
    int autoD7277012_i;
    int auto4289BA5C_i;
    int auto0A924734_i;
    int auto019E8C30_i;
    int autoDF62E1FA_i;
    int auto8712728A_i;
    int auto9F534327_i;
    int autoDD9A22CB_ae;
    int autoDD9A22CB_ai;
    int auto5DF93212_i;
    int autoE680B800_i;
    int auto8BE28940_i;
    int auto07860F11_i;
    int auto6E2B5874_i;
    int auto96825A1C_i;
    int autoD8094CA3_i;
    int auto59B72122_i;
    int auto194C13E9_ae;
    int auto194C13E9_ai;
    int autoD1B9C075_ae;
    int autoD1B9C075_ai;
    int auto2473C567_ae;
    int auto2473C567_ai;
    int auto8105B7AA_i;
    int autoDB4CFAF2_ae;
    int autoDB4CFAF2_ai;

    // Variable Declarations
    string lv__SectionName;
    int lv_index;
    int lv_indexMission;
    int lv_indexObjective;
    int lv_indexResearch;
    int lv_indexMerc;
    int lv_indexStoryState;
    int lv_indexScene;
    int lv_difficulty;
    int lv_availableAge;
    int lv_completedAge;
    int[101] lv_tempObjectiveProgress;

    // Variable Initialization
    lv__SectionName = "";
    lv_difficulty = 2;

    // Implementation
    TriggerDebugOutput(1, StringExternal("Param/Value/lib_Camp_6DFB46DF"), false);
    lv__SectionName = libCamp_gf_TS_BankSectionName("StoryStage");
    libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, IntToString((0)), lp_nextIsSimulation, false);
    libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, IntToString((1)), lp_nextIsVictoryPlayAgain, false);
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((2)), libCamp_gv_tSX_LastMap, 0);
    libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, IntToString((3)), libCamp_gv_tSX_LastMapSuccess, false);
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((4)), libCamp_gv_tSX_LastMission, 0);
    libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, IntToString((5)), libCamp_gv_tSX_LastMissionSuccess, false);
    libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, IntToString((6)), libCamp_gv_tSX_LastMissionSimulation, false);
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((7)), (libCamp_gf_LastSuccessfulMission()), 0);
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((8)), libCamp_gf_StoryCredits(), 0);
    lv__SectionName = libCamp_gf_TS_BankSectionName("StoryMisc");
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((0)), libCamp_gv_tSX_CampaignDifficulty, 0);
    if ((libCamp_gf_StoryState(1) > 0)) {
        lv__SectionName = libCamp_gf_TS_BankSectionName("StoryState");
        ConversationDataSaveStateValue("StoryState|AchievementDisabled", lp_targetBank, lv__SectionName);
    }
    else {
    }
    if ((lp_resultFromDefeat == true)) {
        return ;
    }
    else {
    }
    if ((libCamp_gv_tS_DebugProgressCheating == false) && (libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 1) == true) && (lp_saveType == 2)) {
        if ((libCamp_gf_StoryState(27) > 0)) {
            lv__SectionName = libCamp_gf_TS_BankSectionName("StoryState");
            ConversationDataSaveStateValue("StoryState|HornerSecretMissionOn", lp_targetBank, lv__SectionName);
            lv__SectionName = libCamp_gf_TS_BankSectionName("MissionAvailableAge");
            lv_availableAge = libCamp_gf_TS_LoadTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((16)), 0);
            lv__SectionName = libCamp_gf_TS_BankSectionName("MissionCompletedAge");
            lv_completedAge = libCamp_gf_TS_LoadTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((16)), 0);
            if ((lv_completedAge == 0) && (lv_availableAge == 0)) {
                lv__SectionName = libCamp_gf_TS_BankSectionName("MissionAvailableAge");
                libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((16)), 1, 0);
            }
            else {
            }
        }
        else {
        }
        lv__SectionName = libCamp_gf_TS_BankSectionName("ObjectiveCreditsEarnedLastMission");
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString(0), libCamp_gv_tSX_MissionObjRewardsEarnedCurrent, 0);
        lv__SectionName = libCamp_gf_TS_BankSectionName("ObjectiveProgress");
        if ((libCamp_gv_tSX_MissionObjRewardsEarnedCurrent > 0)) {
            autoD7277012_i = libCamp_gv_TSC_OBJECTIVE_FIRST;
            while (autoD7277012_i <= libCamp_gv_TSC_OBJECTIVE_LAST) {
                lv_indexObjective = libCamp_gv_tS_MissionObjIDs[autoD7277012_i];
                lv_tempObjectiveProgress[(lv_indexObjective)] = libCamp_gf_MissionObjectiveProgress(lv_indexObjective);
                if ((libCamp_gf_MissionObjectiveMap(lv_indexObjective) != libCamp_gv_tS_CurrentMap)) {
                    libCamp_gf_SetMissionObjectiveProgress(lv_indexObjective, libCamp_gv_tS_NonSnapShotObjectiveProgress[(lv_indexObjective)]);
                }
                else {
                }
                if ((lv_indexObjective == 32)) {
                    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_72091AF9") + IntToText(libCamp_gv_tS_NonSnapShotObjectiveProgress[(lv_indexObjective)])), false);
                    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_5D133853") + IntToText(libCamp_gf_MissionObjectiveProgress(lv_indexObjective))), false);
                }
                else {
                }
                autoD7277012_i = autoD7277012_i + 1;
            }
            ConversationDataSaveStateValues("MissionObjective", lp_targetBank, lv__SectionName);
            auto4289BA5C_i = libCamp_gv_TSC_OBJECTIVE_FIRST;
            while (auto4289BA5C_i <= libCamp_gv_TSC_OBJECTIVE_LAST) {
                lv_indexObjective = libCamp_gv_tS_MissionObjIDs[auto4289BA5C_i];
                libCamp_gf_SetMissionObjectiveProgress(lv_indexObjective, lv_tempObjectiveProgress[(lv_indexObjective)]);
                auto4289BA5C_i = auto4289BA5C_i + 1;
            }
        }
        else {
        }
        lv_difficulty = PlayerDifficulty(1);
        lv__SectionName = libCamp_gf_TS_BankSectionName("MissionCompletion");
        if ((libCamp_gv_tS_NonSnapShotMissionDifficultyCompleted == false)) {
            libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(libCamp_gv_tS_CurrentMap, lv_difficulty), libCamp_gf_MissionDifficultyCompleted(libCamp_gv_tS_CurrentMap, lv_difficulty), false);
        }
        else {
        }
        lv__SectionName = libCamp_gf_TS_BankSectionName("MissionBestTime");
        if (((libCamp_gv_tS_NonSnapShotMissionBestTime <= 0) || (libCamp_gf_MissionCompleteBestTime(libCamp_gv_tS_CurrentMap, lv_difficulty) < libCamp_gv_tS_NonSnapShotMissionBestTime))) {
            libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(libCamp_gv_tS_CurrentMap, lv_difficulty), libCamp_gf_MissionCompleteBestTime(libCamp_gv_tS_CurrentMap, lv_difficulty), 0);
        }
        else {
        }
        lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchProgressProtoss");
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString(0), libCamp_gv_tSX_DebugResearchLevel[(1)], 0);
        if ((libCamp_gv_tSX_ResearchMissionProgress[(libCamp_gv_tS_CurrentMap)][(1)] > libCamp_gv_tS_NonSnapShotMissionResearchProgress[(1)])) {
            libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((libCamp_gv_tS_CurrentMap)), libCamp_gv_tSX_ResearchMissionProgress[(libCamp_gv_tS_CurrentMap)][(1)], 0);
        }
        else {
        }
        lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchProgressZerg");
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString(0), libCamp_gv_tSX_DebugResearchLevel[(2)], 0);
        if ((libCamp_gv_tSX_ResearchMissionProgress[(libCamp_gv_tS_CurrentMap)][(2)] > libCamp_gv_tS_NonSnapShotMissionResearchProgress[(2)])) {
            libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((libCamp_gv_tS_CurrentMap)), libCamp_gv_tSX_ResearchMissionProgress[(libCamp_gv_tS_CurrentMap)][(2)], 0);
        }
        else {
        }
        if ((GameIsTransitionMap() == false)) {
            lv__SectionName = libCamp_gf_TS_BankSectionName("MissionAvailableAge");
            auto0A924734_i = libCamp_gv_TSC_MISSION_FIRST;
            while (auto0A924734_i <= libCamp_gv_TSC_MISSION_LAST) {
                lv_indexMission = libCamp_gv_tS_MapID[auto0A924734_i];
                libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((lv_indexMission)), libCamp_gf_MissionStatusAge(lv_indexMission, 1), 0);
                auto0A924734_i = auto0A924734_i + 1;
            }
            lv__SectionName = libCamp_gf_TS_BankSectionName("MissionCompletedAge");
            auto019E8C30_i = libCamp_gv_TSC_MISSION_FIRST;
            while (auto019E8C30_i <= libCamp_gv_TSC_MISSION_LAST) {
                lv_indexMission = libCamp_gv_tS_MapID[auto019E8C30_i];
                libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((lv_indexMission)), libCamp_gf_MissionStatusAge(lv_indexMission, 2), 0);
                auto019E8C30_i = auto019E8C30_i + 1;
            }
            lv__SectionName = libCamp_gf_TS_BankSectionName("MissionCompletion");
            autoDF62E1FA_i = libCamp_gv_TSC_MISSION_FIRST;
            while (autoDF62E1FA_i <= libCamp_gv_TSC_MISSION_LAST) {
                lv_indexMission = libCamp_gv_tS_MapID[autoDF62E1FA_i];
                libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 1), libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 1), false);
                libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 2), libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 2), false);
                libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 3), libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 3), false);
                libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 4), libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 4), false);
                autoDF62E1FA_i = autoDF62E1FA_i + 1;
            }
            lv__SectionName = libCamp_gf_TS_BankSectionName("MissionBestTime");
            auto8712728A_i = libCamp_gv_TSC_MISSION_FIRST;
            while (auto8712728A_i <= libCamp_gv_TSC_MISSION_LAST) {
                lv_indexMission = libCamp_gv_tS_MapID[auto8712728A_i];
                libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 1), libCamp_gf_MissionCompleteBestTime(lv_indexMission, 1), 0);
                libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 2), libCamp_gf_MissionCompleteBestTime(lv_indexMission, 2), 0);
                libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 3), libCamp_gf_MissionCompleteBestTime(lv_indexMission, 3), 0);
                libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 4), libCamp_gf_MissionCompleteBestTime(lv_indexMission, 4), 0);
                auto8712728A_i = auto8712728A_i + 1;
            }
            lv__SectionName = libCamp_gf_TS_BankSectionName("MercStatus");
            auto9F534327_i = libCamp_gv_TSC_MERC_FIRST;
            while (auto9F534327_i <= libCamp_gv_TSC_MERC_LAST) {
                lv_indexMerc = libCamp_gv_tS_MercID[auto9F534327_i];
                libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((lv_indexMerc)), libCamp_gv_tSX_MercStatus[(lv_indexMerc)], 0);
                auto9F534327_i = auto9F534327_i + 1;
            }
            lv__SectionName = libCamp_gf_TS_BankSectionName("TechStatus");
            autoDD9A22CB_ae = libCamp_gv_TSC_TECH_LAST;
            autoDD9A22CB_ai = 1;
            lv_index = libCamp_gv_TSC_TECH_FIRST;
            for ( ; ( (autoDD9A22CB_ai >= 0 && lv_index <= autoDD9A22CB_ae) || (autoDD9A22CB_ai <= 0 && lv_index >= autoDD9A22CB_ae) ) ; lv_index += autoDD9A22CB_ai ) {
                libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString(lv_index), (libCamp_gv_tSX_Tech_Status[lv_index]), (3));
            }
        }
        else {
        }
        return ;
    }
    else {
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("MissionAvailableAge");
    auto5DF93212_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto5DF93212_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto5DF93212_i];
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((lv_indexMission)), libCamp_gf_MissionStatusAge(lv_indexMission, 1), 0);
        auto5DF93212_i = auto5DF93212_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("MissionCompletedAge");
    autoE680B800_i = libCamp_gv_TSC_MISSION_FIRST;
    while (autoE680B800_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[autoE680B800_i];
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((lv_indexMission)), libCamp_gf_MissionStatusAge(lv_indexMission, 2), 0);
        autoE680B800_i = autoE680B800_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("MissionCompletion");
    auto8BE28940_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto8BE28940_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto8BE28940_i];
        libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 1), libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 1), false);
        libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 2), libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 2), false);
        libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 3), libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 3), false);
        libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 4), libCamp_gf_MissionDifficultyCompleted(lv_indexMission, 4), false);
        auto8BE28940_i = auto8BE28940_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("MissionBestTime");
    auto07860F11_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto07860F11_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto07860F11_i];
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 1), libCamp_gf_MissionCompleteBestTime(lv_indexMission, 1), 0);
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 2), libCamp_gf_MissionCompleteBestTime(lv_indexMission, 2), 0);
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 3), libCamp_gf_MissionCompleteBestTime(lv_indexMission, 3), 0);
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, libCamp_gf_TS_CampaignDifficultyBankKey(lv_indexMission, 4), libCamp_gf_MissionCompleteBestTime(lv_indexMission, 4), 0);
        auto07860F11_i = auto07860F11_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("ObjectiveProgress");
    ConversationDataSaveStateValues("MissionObjective", lp_targetBank, lv__SectionName);
    lv__SectionName = libCamp_gf_TS_BankSectionName("ObjectiveCreditsEarnedLastMission");
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString(0), libCamp_gv_tSX_MissionObjRewardsEarnedCurrent, 0);
    lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchProgressProtoss");
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString(0), libCamp_gv_tSX_DebugResearchLevel[(1)], 0);
    auto6E2B5874_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto6E2B5874_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto6E2B5874_i];
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((lv_indexMission)), libCamp_gv_tSX_ResearchMissionProgress[(lv_indexMission)][(1)], 0);
        auto6E2B5874_i = auto6E2B5874_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchProgressZerg");
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString(0), libCamp_gv_tSX_DebugResearchLevel[(2)], 0);
    auto96825A1C_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto96825A1C_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto96825A1C_i];
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((lv_indexMission)), libCamp_gv_tSX_ResearchMissionProgress[(lv_indexMission)][(2)], 0);
        auto96825A1C_i = auto96825A1C_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchOldLevel");
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((1)), libCamp_gv_tSX_ResearchPointsOld[(1)], 0);
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((2)), libCamp_gv_tSX_ResearchPointsOld[(2)], 0);
    lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchOldLevelUI");
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((1)), libCamp_gv_tSX_ResearchUIOldPoints[(1)], 0);
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((2)), libCamp_gv_tSX_ResearchUIOldPoints[(2)], 0);
    lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchState");
    autoD8094CA3_i = libCamp_gv_TSC_RESEARCH_FIRST;
    while (autoD8094CA3_i <= libCamp_gv_TSC_RESEARCH_LAST) {
        lv_indexResearch = libCamp_gv_tS_ResearchID[autoD8094CA3_i];
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((lv_indexResearch)), libCamp_gv_tSX_ResearchState[(lv_indexResearch)], (1));
        autoD8094CA3_i = autoD8094CA3_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("LabResearchPointsConverted");
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((1)), libCamp_gv_tSX_ResearchPointsConverted[(1)], 0);
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((2)), libCamp_gv_tSX_ResearchPointsConverted[(2)], 0);
    lv__SectionName = libCamp_gf_TS_BankSectionName("MercStatus");
    auto59B72122_i = libCamp_gv_TSC_MERC_FIRST;
    while (auto59B72122_i <= libCamp_gv_TSC_MERC_LAST) {
        lv_indexMerc = libCamp_gv_tS_MercID[auto59B72122_i];
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((lv_indexMerc)), libCamp_gv_tSX_MercStatus[(lv_indexMerc)], 0);
        auto59B72122_i = auto59B72122_i + 1;
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("TechStatus");
    auto194C13E9_ae = libCamp_gv_TSC_TECH_LAST;
    auto194C13E9_ai = 1;
    lv_index = libCamp_gv_TSC_TECH_FIRST;
    for ( ; ( (auto194C13E9_ai >= 0 && lv_index <= auto194C13E9_ae) || (auto194C13E9_ai <= 0 && lv_index >= auto194C13E9_ae) ) ; lv_index += auto194C13E9_ai ) {
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString(lv_index), (libCamp_gv_tSX_Tech_Status[lv_index]), (3));
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("HelpUnitsPanel");
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString(0), libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypesCount, 0);
    autoD1B9C075_ae = libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypesCount;
    autoD1B9C075_ai = 1;
    lv_index = 1;
    for ( ; ( (autoD1B9C075_ai >= 0 && lv_index <= autoD1B9C075_ae) || (autoD1B9C075_ai <= 0 && lv_index >= autoD1B9C075_ae) ) ; lv_index += autoD1B9C075_ai ) {
        libCamp_gf_TS_SaveTransitionVarString(lp_targetBank, lv__SectionName, IntToString(lv_index), libCamp_gf_TS_HelpUnitsPanel_UnitTypeStringID(libCamp_gv_tSX_HelpUnitsPanel_EnabledUnitTypes[lv_index]), "");
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("TutorialHistory");
    BankValueSetFromInt(lp_targetBank, lv__SectionName, IntToString(0), libCamp_gv_tSX_Tutorial_HistoryCount);
    auto2473C567_ae = libCamp_gv_tSX_Tutorial_HistoryCount;
    auto2473C567_ai = 1;
    lv_index = 1;
    for ( ; ( (auto2473C567_ai >= 0 && lv_index <= auto2473C567_ae) || (auto2473C567_ai <= 0 && lv_index >= auto2473C567_ae) ) ; lv_index += auto2473C567_ai ) {
        BankValueSetFromText(lp_targetBank, lv__SectionName, (IntToString(lv_index) + "_1"), libCamp_gv_tSX_Tutorial_HistoryTitle[lv_index]);
        BankValueSetFromText(lp_targetBank, lv__SectionName, (IntToString(lv_index) + "_2"), libCamp_gv_tSX_Tutorial_HistoryDescription[lv_index]);
        BankValueSetFromString(lp_targetBank, lv__SectionName, (IntToString(lv_index) + "_3"), libCamp_gf_TS_Tutorial_ConvertImageToString(libCamp_gv_tSX_Tutorial_HistoryIcon[lv_index]));
        BankValueSetFromString(lp_targetBank, lv__SectionName, (IntToString(lv_index) + "_4"), libCamp_gf_TS_Tutorial_ConvertMovieToString(libCamp_gv_tSX_Tutorial_HistoryMovie[lv_index]));
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("StoryState");
    ConversationDataSaveStateValues("StoryState", lp_targetBank, lv__SectionName);
    if ((lp_saveType == 0)) {
        lv__SectionName = libCamp_gf_TS_BankSectionName("ScenePlayed");
        auto8105B7AA_i = libCamp_gv_TSC_SCENE_FIRST;
        while (auto8105B7AA_i <= libCamp_gv_TSC_SCENE_LAST) {
            lv_indexScene = libCamp_gv_tS_SceneIDs[auto8105B7AA_i];
            libCamp_gf_TS_SaveTransitionVarBoolean(lp_targetBank, lv__SectionName, IntToString((lv_indexScene)), libCamp_gf_ScenePlayed(lv_indexScene), false);
            auto8105B7AA_i = auto8105B7AA_i + 1;
        }
        lv__SectionName = libCamp_gf_TS_BankSectionName("SceneExtraObjects");
        ConversationDataSaveStateValues("SceneExtraObjects", lp_targetBank, lv__SectionName);
        lv__SectionName = libCamp_gf_TS_BankSectionName("NewsPlayed");
        ConversationDataSaveStateValues("StoryNews", lp_targetBank, lv__SectionName);
        lv__SectionName = libCamp_gf_TS_BankSectionName("StoryMisc");
        libCamp_gf_TS_SaveTransitionVarString(lp_targetBank, lv__SectionName, IntToString((1)), libCamp_gv_tSX_RoomStates, "");
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((2)), libCamp_gv_tSX_LoadingImageCurrentMarSara, 0);
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((3)), libCamp_gv_tSX_LoadingImageCurrentHyperion, 0);
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((4)), libCamp_gv_tSX_LoadingImageCurrentLab, 0);
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((5)), libCamp_gv_tSX_LoadingImageCurrentCantina, 0);
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((6)), libCamp_gv_tSX_LoadingImageCurrentArmory, 0);
        libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, IntToString((7)), libCamp_gv_tSX_LoadingImageCurrentChar, 0);
        lv__SectionName = libCamp_gf_TS_BankSectionName("Tips");
        ConversationDataSaveStateValues("StoryTips", lp_targetBank, lv__SectionName);
        lv__SectionName = libCamp_gf_TS_BankSectionName("Conversation");
        autoDB4CFAF2_ae = libCamp_gv_tS_ConvoCount;
        autoDB4CFAF2_ai = 1;
        lv_index = 1;
        for ( ; ( (autoDB4CFAF2_ai >= 0 && lv_index <= autoDB4CFAF2_ae) || (autoDB4CFAF2_ai <= 0 && lv_index >= autoDB4CFAF2_ae) ) ; lv_index += autoDB4CFAF2_ai ) {
            ConversationDataSaveNodeState(libCamp_gv_tS_Convos[lv_index], lp_targetBank, lv__SectionName);
        }
        lv__SectionName = libCamp_gf_TS_BankSectionName("Hotspots");
        ConversationDataSaveStateValues("Hotspots", lp_targetBank, lv__SectionName);
        lv__SectionName = libCamp_gf_TS_BankSectionName("ArcadeGame");
        ConversationDataSaveStateValues("ArcadeGameVariables", lp_targetBank, lv__SectionName);
    }
    else {
    }
    lv__SectionName = libCamp_gf_TS_BankSectionName("DebugTechCheatOption");
    libCamp_gf_TS_SaveTransitionVarInteger(lp_targetBank, lv__SectionName, "0", (libCamp_gv_tSX_DebugTechCheatOption), 0);
    TriggerDebugOutput(1, StringExternal("Param/Value/lib_Camp_E0C5A537"), false);
}

void libCamp_gf_TS_UpdateTransitionVars () {
}

void libCamp_gf_TS_OpenCampaignBank () {
    // Implementation
    BankLoad(libCamp_gv_tS_BankName, 1);
}

void libCamp_gf_TS_OpenMissionBanks () {
    int auto020360CC_i;

    // Variable Declarations
    string lv_bankName;
    int lv_indexMission;
    bool lv_bankExist;
    bool lv_saveMissionBank;
    int lv_branchAltMission;

    // Variable Initialization
    lv_bankName = "";

    // Implementation
    auto020360CC_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto020360CC_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto020360CC_i];
        if ((libCamp_gv_tS_MissionBanks[(lv_indexMission)] == null)) {
            lv_bankName = libCamp_gf_TS_MissionBankName(lv_indexMission);
            lv_bankExist = BankExists(lv_bankName, 1);
            if ((lv_indexMission == libCamp_gv_tS_CurrentMap)) {
                BankLoad(lv_bankName, 1);
                libCamp_gv_tS_MissionBanks[(lv_indexMission)] = BankLastCreated();
                if (((GameIsTransitionMap() == false) || (libCamp_gv_tSX_IsSimulation == true) || (libCamp_gv_tSX_IsVictoryPlayAgain == true)) && (lv_bankExist == true)) {
                    libCamp_gf_TS_LoadTransitionVars(BankLastCreated(), true);
                }
                else {
                    libCamp_gf_TS_SaveTransitionVars(BankLastCreated(), false, false, false, 1);
                    lv_saveMissionBank = true;
                }
            }
            else {
                if ((lv_bankExist == true)) {
                    BankLoad(lv_bankName, 1);
                    libCamp_gv_tS_MissionBanks[(lv_indexMission)] = BankLastCreated();
                }
                else {
                }
            }
        }
        else {
        }
        auto020360CC_i = auto020360CC_i + 1;
    }
    if ((lv_saveMissionBank == true)) {
        lv_branchAltMission = 0;
        if ((libCamp_gv_tS_CurrentMap == 6)) {
            lv_branchAltMission = 7;
        }
        else if ((libCamp_gv_tS_CurrentMap == 7)) {
            lv_branchAltMission = 6;
        }
        else if ((libCamp_gv_tS_CurrentMap == 10)) {
            lv_branchAltMission = 11;
        }
        else if ((libCamp_gv_tS_CurrentMap == 11)) {
            lv_branchAltMission = 10;
        }
        else if ((libCamp_gv_tS_CurrentMap == 27)) {
            lv_branchAltMission = 28;
        }
        else if ((libCamp_gv_tS_CurrentMap == 28)) {
            lv_branchAltMission = 27;
        }
        if ((lv_branchAltMission != 0)) {
            if ((libCamp_gv_tS_MissionBanks[(lv_branchAltMission)] == null)) {
                lv_bankName = libCamp_gf_TS_MissionBankName(lv_branchAltMission);
                BankLoad(lv_bankName, 1);
                libCamp_gv_tS_MissionBanks[(lv_branchAltMission)] = BankLastCreated();
            }
            else {
            }
            libCamp_gf_TS_SaveTransitionVars(libCamp_gv_tS_MissionBanks[(lv_branchAltMission)], false, false, false, 1);
        }
        else {
        }
    }
    else {
    }
}

void libCamp_gf_TS_SaveMissionBanks () {
    int auto6A939711_i;

    // Variable Declarations
    int lv_indexMission;

    // Variable Initialization

    // Implementation
    auto6A939711_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto6A939711_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto6A939711_i];
        if ((libCamp_gv_tS_MissionBanks[(lv_indexMission)] != null)) {
            BankSave(libCamp_gv_tS_MissionBanks[(lv_indexMission)]);
        }
        else {
        }
        auto6A939711_i = auto6A939711_i + 1;
    }
}

void libCamp_gf_CreateStoryModeTransitionSave (text lp_name, text lp_transition) {
    // Variable Declarations
    text lv_name;

    // Variable Initialization
    lv_name = StringExternal("Param/Value/lib_Camp_42548FC0");

    // Implementation
    if ((libCamp_gv_tS_CurrentMap == 0)) {
        return ;
    }
    else {
    }
    GameSetTransitionMap(("Campaign/" + libCamp_gv_tS_MapFile[(31)]));
    GameSaveCreate(lp_name, lp_transition, "", true);
}

void libCamp_gf_SaveArcadeGameData () {
    // Variable Declarations
    string lv_sectionName;

    // Variable Initialization
    lv_sectionName = "";

    // Implementation
    libCamp_gf_TS_OpenCampaignBank();
    lv_sectionName = libCamp_gf_TS_BankSectionName("ArcadeGame");
    ConversationDataSaveStateValues("ArcadeGameVariables", BankLastCreated(), lv_sectionName);
    BankSave(BankLastCreated());
}

void libCamp_gf_TS_PrepareNextMissionPreloading (int lp_victoryStatus) {
    // Implementation
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_815693E7") + libCamp_gf_MissionName(libCamp_gv_tS_CurrentMap)), false);
    libCamp_gf_TS_PrepareNextMissionRooms(lp_victoryStatus);
    libCamp_gf_TS_PrepareNextMissionActors(lp_victoryStatus);
}

void libCamp_gf_TS_PrepareNextMissionRooms (int lp_victoryStatus) {
    // Variable Declarations
    int lv_mapID;
    string lv_image;
    text lv_epilogue;

    // Variable Initialization

    // Implementation
    if ((libCamp_gf_TS_NextMissionLocation(lp_victoryStatus) == 1)) {
        libCamp_gf_TS_PrepareRoomPreloading(1);
        return ;
    }
    else {
    }
    if ((libCamp_gf_TS_NextMissionLocation(lp_victoryStatus) == 2)) {
        libCamp_gf_TS_PrepareRoomPreloading(2);
        libCamp_gf_TS_PrepareRoomPreloading(5);
        libCamp_gf_TS_PrepareRoomPreloading(3);
        libCamp_gf_TS_PrepareRoomPreloading(4);
        if ((libCamp_gv_tS_CurrentMap == 18) && (lp_victoryStatus == c_gameOverVictory)) {
            libCamp_gf_TS_PrepareRoomPreloading(7);
        }
        else {
        }
        return ;
    }
    else {
    }
    if ((libCamp_gf_TS_NextMissionLocation(lp_victoryStatus) == 9)) {
        libCamp_gf_TS_PrepareRoomPreloading(2);
        libCamp_gf_TS_PrepareRoomPreloading(8);
        libCamp_gf_TS_PrepareRoomPreloading(9);
        return ;
    }
    else {
    }
    if ((libCamp_gf_TS_NextMissionLocation(lp_victoryStatus) == 6)) {
        libCamp_gf_TS_PrepareRoomPreloading(6);
        return ;
    }
    else {
    }
}

void libCamp_gf_TS_PrepareNextMissionActors (int lp_victoryStatus) {
    // Variable Declarations
    int lv_mapID;
    string lv_image;
    text lv_epilogue;

    // Variable Initialization

    // Implementation
    if ((libCamp_gf_TS_NextMissionLocation(lp_victoryStatus) == 1)) {
        libCamp_gf_TS_PrepareActorPreloading(14);
        libCamp_gf_TS_PrepareActorPreloading(1);
        if ((libCamp_gf_MissionStatusCheck(1, 2) == true)) {
            libCamp_gf_TS_PrepareActorPreloading(18);
        }
        else {
        }
        return ;
    }
    else {
    }
    if ((libCamp_gf_TS_NextMissionLocation(lp_victoryStatus) == 2)) {
        libCamp_gf_TS_PrepareActorPreloading(3);
        libCamp_gf_TS_PrepareActorPreloading(4);
        libCamp_gf_TS_PrepareActorPreloading(5);
        libCamp_gf_TS_PrepareActorPreloading(6);
        libCamp_gf_TS_PrepareActorPreloading(8);
        libCamp_gf_TS_PrepareActorPreloading(10);
        libCamp_gf_TS_PrepareActorPreloading(11);
        libCamp_gf_TS_PrepareActorPreloading(13);
        libCamp_gf_TS_PrepareActorPreloading(7);
        libCamp_gf_TS_PrepareActorPreloading(16);
        libCamp_gf_TS_PrepareActorPreloading(22);
        if ((libCamp_gv_tS_CurrentMap == 18) && (lp_victoryStatus == c_gameOverVictory)) {
            libCamp_gf_TS_PrepareActorPreloading(23);
        }
        else {
        }
        if ((libCamp_gf_MissionStatusCheck(13, 2) == true)) {
            libCamp_gf_TS_PrepareActorPreloading(2);
        }
        else {
        }
        if ((libCamp_gf_MissionStatusCheck(4, 2) == true) && (libCamp_gf_MissionStatusCheck(6, 2) == false) && (libCamp_gf_MissionStatusCheck(7, 2) == false)) {
            libCamp_gf_TS_PrepareActorPreloading(9);
        }
        else {
        }
        libCamp_gf_TS_PrepareActorPreloading(12);
        libCamp_gf_TS_PrepareActorPreloading(14);
        if ((libCamp_gf_MissionStatusCheck(8, 2) == true) && (libCamp_gf_MissionStatusCheck(11, 2) == false)) {
            libCamp_gf_TS_PrepareActorPreloading(17);
        }
        else {
        }
        libCamp_gf_TS_PrepareActorPreloading(18);
        return ;
    }
    else {
    }
    if ((libCamp_gf_TS_NextMissionLocation(lp_victoryStatus) == 9)) {
        libCamp_gf_TS_PrepareActorPreloading(15);
        libCamp_gf_TS_PrepareActorPreloading(19);
        return ;
    }
    else {
    }
    if ((libCamp_gf_TS_NextMissionLocation(lp_victoryStatus) == 6)) {
        libCamp_gf_TS_PrepareActorPreloading(15);
        libCamp_gf_TS_PrepareActorPreloading(18);
        if ((libCamp_gf_MissionStatusCheck(27, 2) == false) && (libCamp_gf_MissionStatusCheck(28, 2) == false)) {
            libCamp_gf_TS_PrepareActorPreloading(20);
        }
        else {
            libCamp_gf_TS_PrepareActorPreloading(21);
        }
        return ;
    }
    else {
    }
}

void libCamp_gf_TS_PrepareRoomPreloading (int lp_room) {
    int autoA87DC2EE_ae;
    int autoA87DC2EE_ai;

    // Variable Declarations
    int lv_roomIndex;
    string lv_resourceString;
    string lv_item;
    int lv_index;
    int lv_unitType;

    // Variable Initialization
    lv_resourceString = "";
    lv_item = "";

    // Implementation
    lv_roomIndex = (lp_room);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_BD608365") + IntToText((lp_room))), false);
    autoA87DC2EE_ae = libCamp_gv_tS_StoryRoomUnitTypeCount[lv_roomIndex];
    autoA87DC2EE_ai = 1;
    lv_index = 1;
    for ( ; ( (autoA87DC2EE_ai >= 0 && lv_index <= autoA87DC2EE_ae) || (autoA87DC2EE_ai <= 0 && lv_index >= autoA87DC2EE_ae) ) ; lv_index += autoA87DC2EE_ai ) {
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_ABAC52DD") + StringToText((libCamp_gv_tS_StoryRoomUnitTypes[lv_roomIndex][lv_index]))), false);
        libNtve_gf_PreloadUnit(libCamp_gv_tS_StoryRoomUnitTypes[lv_roomIndex][lv_index], true);
    }
}

void libCamp_gf_TS_PrepareActorPreloading (int lp_actor) {
    // Implementation
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_4F00CC43") + StringToText((libCamp_gv_tS_StoryActorUnitTypes[(lp_actor)]))), false);
    libNtve_gf_PreloadUnit(libCamp_gv_tS_StoryActorUnitTypes[(lp_actor)], true);
}

int libCamp_gf_TS_NextMissionLocation (int lp_victoryStatus) {
    // Implementation
    if ((libCamp_gv_tSX_IsSimulation == true)) {
        return 2;
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(3, 2) == false)) {
        return 1;
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(3, 2) == true) && (libCamp_gf_MissionStatusCheck(26, 2) == false) && (!(((libCamp_gv_tS_CurrentMap == 20) && (lp_victoryStatus == c_gameOverVictory))))) {
        return 2;
    }
    else {
    }
    if ((libCamp_gv_tS_CurrentMap == 20) && (lp_victoryStatus == c_gameOverVictory)) {
        return 9;
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(26, 2) == true)) {
        return 6;
    }
    else {
    }
    return 0;
}

void libCamp_gf_TS_InitializeStoryRoomSingle (int lp_room, string lp_roomUnitString) {
    // Variable Declarations
    int lv_roomIndex;
    string lv_item;
    int lv_index;
    int lv_unitType;

    // Variable Initialization
    lv_item = "";

    // Implementation
    lv_roomIndex = (lp_room);
    libCamp_gv_tS_StoryRoomUnitTypeCount[lv_roomIndex] = 0;
    while (true) {
        libCamp_gv_tS_StoryRoomUnitTypeCount[lv_roomIndex] += 1;
        lv_item = StringWord(lp_roomUnitString, libCamp_gv_tS_StoryRoomUnitTypeCount[lv_roomIndex]);
        if ((lv_item == null)) {
            libCamp_gv_tS_StoryRoomUnitTypeCount[lv_roomIndex] -= 1;
            break;
        }
        else {
        }
        libCamp_gv_tS_StoryRoomUnitTypes[lv_roomIndex][libCamp_gv_tS_StoryRoomUnitTypeCount[lv_roomIndex]] = UnitTypeFromString(lv_item);
    }
}

void libCamp_gf_TS_InitializeStoryRooms () {
    // Implementation
    libCamp_gf_TS_InitializeStoryRoomSingle(5, "SMHyperionArmoryStage1SwannCameras SMHyperionArmoryStage1Set SMHyperionArmoryStage1TechnologyConsoleHS SMHyperionArmoryStage1ExitHS SMHyperionArmoryStage1SimulatorHS SMHyperionArmoryViking");
    libCamp_gf_TS_InitializeStoryRoomSingle(2, "SMHyperionBridgeStage1WindowHS SMHyperionBridgeStage1HansonCameras SMHyperionBridgeStage1CantinaHS SMHyperionBridgeStage1CenterConsoleHS SMHyperionBridgeHolomap SMHyperionBridgeStage1HornerCameras SMHyperionBridgeStage1BattleReportsHS SMHyperionBridgeStage1TychusCameras SMHyperionBridgeStage1BattleCommandHS SMHyperionBridgeStage1Set2 SMHyperionBridgeStage1ToshCameras SMHyperionBridgeStage1Set SMBridgePlanetSpace");
    libCamp_gf_TS_InitializeStoryRoomSingle(3, "SMHyperionCantinaStage1Progress3HS SMHyperionCantinaStage1ExitHS SMHyperionCantinaPoster2HS SMHyperionCantinaMercComputerHS SMHyperionCantinaBadgeHS SMHyperionCantinaStage1Progress4HS SMHyperionCantinaStage1JukeboxHS SMHyperionCantinaPoster3HS SMHyperionCantinaHydraClawsHS SMHyperionCantinaStage1Progress2HS SMHyperionCantinaPoster4HS SMHyperionCantinaStage1Progress6HS SMHyperionCantinaPoster1HS SMHyperionCantinaStage1ArcadeGameHS SMHyperionCantinaStage1Progress5HS SMHyperionCantinaStage1Progress1HS SMHyperionCantinaProgressFrame SMHyperionCantinaProps SMHyperionCantinaPoster5HS SMHyperionCantinaStage1TVHS SMHyperionCantinaTychusCameras SMHyperionCantinaYbarraCameras SMHyperionCantinaToshCameras SMHyperionCantinaStage1Set2 SMHyperionCantinaStage1StaircaseHS SMHyperionCantinaStage1Set");
    libCamp_gf_TS_InitializeStoryRoomSingle(6, "SMCharBattlezoneSet3 SMCharBattlezoneSet SMCharBattlezoneArtifactHS SMCharBattlezoneSet2 SMCharBattlezoneBriefcaseHS SMCharBattlezoneRadioHS SMCharBattlezoneDropshipHS");
    libCamp_gf_TS_InitializeStoryRoomSingle(7, "SMHyperionCorridorSet");
    libCamp_gf_TS_InitializeStoryRoomSingle(8, "SMMarine03 SMMarine03 SMMarine03 SMTerran06bProps SMMarine03 SMValerianFlagshipCorridorsSet4 SMValerianFlagshipCorridorsSet2 SMValerianFlagshipCorridorsSet3 SMValerianFlagshipCorridorsSet");
    libCamp_gf_TS_InitializeStoryRoomSingle(4, "SMHyperionMedLabStage1Set2 SMHyperionMedLabStage1DoorHS SMHyperionLabAdjutantCameras SMHyperionMedLabStage1Set SMHyperionMedLabStage1SetLights SMHyperionLabArtifactBaseHS SMHyperionLabArtifactPart1HS SMHyperionMedLabStage1CrystalHS SMHyperionLabCowinCameras SMHyperionMedLabStage1ConsoleHS SMHyperionLabHansonCameras SMHyperionLabArtifactPart3HS SMHyperionLabArtifactPart4HS SMHyperionLabArtifactPart2HS");
    libCamp_gf_TS_InitializeStoryRoomSingle(1, "SMMarSaraBarCorkboardItem6HS SMMarSaraBarCorkboardItem2HS SMMarSaraBarCorkboardItem7HS SMMarSaraBarCorkboardItem3HS SMMarSaraBarBadgeHS SMMarSaraBarCorkboardItem5HS SMMarSaraBarHydraliskSkullHS SMMarSaraBarCorkboardItem1HS SMMarSaraBarCorkboardItem8HS SMMarSaraBarCorkboardItem4HS SMMarSaraBarCorkboardBackground SMMarSaraBarSet2 SMMarSaraBarTVHS SMMarSaraBarTychusCameras SMMarSaraBarStarmapHS SMMarSaraBarProps SMMarSaraBarSet SMMarSaraBarJukeboxHS");
    libCamp_gf_TS_InitializeStoryRoomSingle(9, "SMValerianObservatorySet2 SMValerianObservatoryPaintingHS SMValerianObservatorySet3 SMValerianObservatoryProps SMValerianObservatorySet SMValerianObservatoryStarmap");
}

void libCamp_gf_TS_InitializeStoryActorSingle (int lp_actor, string lp_unitType) {
    // Variable Declarations
    int lv_actorIndex;

    // Variable Initialization

    // Implementation
    lv_actorIndex = (lp_actor);
    libCamp_gv_tS_StoryActorUnitTypes[lv_actorIndex] = lp_unitType;
}

void libCamp_gf_TS_InitializeStoryActors () {
    // Implementation
    libCamp_gf_TS_InitializeStoryActorSingle(1, "SMAdjutantHologram");
    libCamp_gf_TS_InitializeStoryActorSingle(2, "SMAdjutant");
    libCamp_gf_TS_InitializeStoryActorSingle(3, "SMAnnabelle");
    libCamp_gf_TS_InitializeStoryActorSingle(4, "SMBralik");
    libCamp_gf_TS_InitializeStoryActorSingle(5, "SMCade");
    libCamp_gf_TS_InitializeStoryActorSingle(6, "SMCooper");
    libCamp_gf_TS_InitializeStoryActorSingle(8, "SMEarl");
    libCamp_gf_TS_InitializeStoryActorSingle(10, "SMHall");
    libCamp_gf_TS_InitializeStoryActorSingle(9, "SMCivilian");
    libCamp_gf_TS_InitializeStoryActorSingle(11, "SMHill");
    libCamp_gf_TS_InitializeStoryActorSingle(12, "SMFirstOfficer");
    libCamp_gf_TS_InitializeStoryActorSingle(13, "SMKachinsky");
    libCamp_gf_TS_InitializeStoryActorSingle(14, "SMRaynorCommander");
    libCamp_gf_TS_InitializeStoryActorSingle(15, "SMRaynorMarine");
    libCamp_gf_TS_InitializeStoryActorSingle(7, "SMStetmann");
    libCamp_gf_TS_InitializeStoryActorSingle(16, "SMHyperionArmorer");
    libCamp_gf_TS_InitializeStoryActorSingle(17, "SMBountyHunter");
    libCamp_gf_TS_InitializeStoryActorSingle(18, "SMMarine01");
    libCamp_gf_TS_InitializeStoryActorSingle(19, "SMValerianMengsk");
    libCamp_gf_TS_InitializeStoryActorSingle(20, "SMMarine02");
    libCamp_gf_TS_InitializeStoryActorSingle(21, "SMMarine02AOD");
    libCamp_gf_TS_InitializeStoryActorSingle(22, "SMYbarra");
    libCamp_gf_TS_InitializeStoryActorSingle(23, "SMZeratul");
}

void libCamp_gf_TS_InitializeStoryModeLoadingImages () {
    // Implementation
    libCamp_gv_tS_LoadingImageCountMarSara = 0;
    libCamp_gv_tSX_LoadingImageCurrentMarSara = 0;
    libCamp_gv_tS_LoadingImageCountMarSara += 1;
    libCamp_gv_tS_LoadingImagesMarSara[libCamp_gv_tS_LoadingImageCountMarSara] = "Assets\\Textures\\loading-marsarabar.dds";
    libCamp_gv_tS_LoadingImageCountHyperion = 0;
    libCamp_gv_tSX_LoadingImageCurrentHyperion = 0;
    libCamp_gv_tS_LoadingImageCountHyperion += 1;
    libCamp_gv_tS_LoadingImagesHyperion[libCamp_gv_tS_LoadingImageCountHyperion] = "Assets\\Textures\\loading-hyperion1.dds";
    libCamp_gv_tS_LoadingImageCountHyperion += 1;
    libCamp_gv_tS_LoadingImagesHyperion[libCamp_gv_tS_LoadingImageCountHyperion] = "Assets\\Textures\\loading-hyperion2.dds";
    libCamp_gv_tS_LoadingImageCountHyperion += 1;
    libCamp_gv_tS_LoadingImagesHyperion[libCamp_gv_tS_LoadingImageCountHyperion] = "Assets\\Textures\\loading-hyperion3.dds";
    libCamp_gv_tS_LoadingImageCountHyperion += 1;
    libCamp_gv_tS_LoadingImagesHyperion[libCamp_gv_tS_LoadingImageCountHyperion] = "Assets\\Textures\\loading-hyperion4.dds";
    libCamp_gv_tS_LoadingImageCountHyperion += 1;
    libCamp_gv_tS_LoadingImagesHyperion[libCamp_gv_tS_LoadingImageCountHyperion] = "Assets\\Textures\\loading-hyperion5.dds";
    libCamp_gv_tS_LoadingImageCountHyperion += 1;
    libCamp_gv_tS_LoadingImagesHyperion[libCamp_gv_tS_LoadingImageCountHyperion] = "Assets\\Textures\\loading-hyperion6.dds";
    libCamp_gv_tS_LoadingImageCountHyperion += 1;
    libCamp_gv_tS_LoadingImagesHyperion[libCamp_gv_tS_LoadingImageCountHyperion] = "Assets\\Textures\\loading-hyperion7.dds";
    libCamp_gv_tS_LoadingImageCountHyperion += 1;
    libCamp_gv_tS_LoadingImagesHyperion[libCamp_gv_tS_LoadingImageCountHyperion] = "Assets\\Textures\\loading-hyperion8.dds";
    libCamp_gv_tS_LoadingImageCountLab = 0;
    libCamp_gv_tSX_LoadingImageCurrentLab = 0;
    libCamp_gv_tS_LoadingImageCountLab += 1;
    libCamp_gv_tS_LoadingImagesLab[libCamp_gv_tS_LoadingImageCountLab] = "Assets\\Textures\\loading-hyperionlab.dds";
    libCamp_gv_tS_LoadingImageCountCantina = 0;
    libCamp_gv_tSX_LoadingImageCurrentCantina = 0;
    libCamp_gv_tS_LoadingImageCountCantina += 1;
    libCamp_gv_tS_LoadingImagesCantina[libCamp_gv_tS_LoadingImageCountCantina] = "Assets\\Textures\\loading-hyperioncantina.dds";
    libCamp_gv_tS_LoadingImageCountArmory = 0;
    libCamp_gv_tSX_LoadingImageCurrentArmory = 0;
    libCamp_gv_tS_LoadingImageCountArmory += 1;
    libCamp_gv_tS_LoadingImagesArmory[libCamp_gv_tS_LoadingImageCountArmory] = "Assets\\Textures\\loading-hyperionarmory.dds";
    libCamp_gv_tS_LoadingImageCountChar = 0;
    libCamp_gv_tSX_LoadingImageCurrentChar = 0;
    libCamp_gv_tS_LoadingImageCountChar += 1;
    libCamp_gv_tS_LoadingImagesChar[libCamp_gv_tS_LoadingImageCountChar] = "Assets\\Textures\\loading-charbattlezone.dds";
}

void libCamp_gf_CP_SetCampaignCompleted (bool lp_completed) {
    // Implementation
    libCamp_gv_cPX_CampaignCompleted = true;
    libCamp_gf_CP_SaveVars();
}

void libCamp_gf_CP_LoadVars () {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    libCamp_gv_cPX_CampaignCompleted = false;
    BankLoad(libCamp_gv_cPC_BANKNAME, 1);
    if ((BankLastCreated() == null)) {
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_A79E298B") + StringToText(libCamp_gv_cPC_BANKNAME)), false);
        return ;
    }
    else {
    }
    libCamp_gv_cP_Bank = BankLastCreated();
    if ((BankSectionExists(BankLastCreated(), ("CampaignCompleted")) == true)) {
        libCamp_gv_cPX_CampaignCompleted = BankValueGetAsFlag(BankLastCreated(), ("CampaignCompleted"), "1");
    }
    else {
    }
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_B9F18CA1") + libNtve_gf_ConvertBooleanToText(libCamp_gv_cPX_CampaignCompleted)), false);
}

void libCamp_gf_CP_SaveVars () {
    // Implementation
    BankValueSetFromFlag(libCamp_gv_cP_Bank, ("CampaignCompleted"), "1", libCamp_gv_cPX_CampaignCompleted);
    BankValueSetFromFlag(libCamp_gv_cP_Bank, ("CampaignCompleted"), "2", libCamp_gv_cPX_CampaignCompleted);
    BankSave(libCamp_gv_cP_Bank);
}

bool libCamp_gf_CampaignCompleted () {
    // Implementation
    return libCamp_gv_cPX_CampaignCompleted;
}

void libCamp_gf_CreateCampaignTutorial (text lp_title, text lp_description, string lp_icon, string lp_movie) {
    // Implementation
    HelpPanelAddTutorial(PlayerGroupAll(), lp_title, lp_description, lp_icon, lp_movie, true);
    if ((libCamp_gf_TS_Tutorial_AlreadyExisted(lp_movie) == true)) {
        return ;
    }
    else {
    }
    libCamp_gf_TS_Tutorial_AddToHistory(lp_title, lp_description, lp_icon, lp_movie);
}

string libCamp_gf_TS_Tutorial_ConvertMovieToString (string lp_movie) {
    // Implementation
    return lp_movie;
}

string libCamp_gf_TS_Tutorial_ConvertImageToString (string lp_image) {
    // Implementation
    return lp_image;
}

string libCamp_gf_TS_Tutorial_ConvertStringToMovie (string lp_string) {
    // Implementation
    return lp_string;
}

string libCamp_gf_TS_Tutorial_ConvertStringToImage (string lp_string) {
    // Implementation
    return lp_string;
}

bool libCamp_gf_TS_Tutorial_AlreadyExisted (string lp_movie) {
    int auto4E78CFE5_ae;
    int auto4E78CFE5_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    auto4E78CFE5_ae = libCamp_gv_tSC_Tutorial_HistoryMaxCount;
    auto4E78CFE5_ai = 1;
    lv_index = 1;
    for ( ; ( (auto4E78CFE5_ai >= 0 && lv_index <= auto4E78CFE5_ae) || (auto4E78CFE5_ai <= 0 && lv_index >= auto4E78CFE5_ae) ) ; lv_index += auto4E78CFE5_ai ) {
        if ((libCamp_gv_tSX_Tutorial_HistoryMovie[lv_index] == lp_movie)) {
            return true;
        }
        else {
        }
    }
    return false;
}

void libCamp_gf_TS_Tutorial_AddToHistory (text lp_title, text lp_description, string lp_icon, string lp_movie) {
    // Implementation
    if (((libCamp_gv_tSX_Tutorial_HistoryCount == libCamp_gv_tSC_Tutorial_HistoryMaxCount) || (libCamp_gf_TS_Tutorial_AlreadyExisted(lp_movie) == true))) {
        return ;
    }
    else {
    }
    libCamp_gv_tSX_Tutorial_HistoryCount += 1;
    libCamp_gv_tSX_Tutorial_HistoryTitle[libCamp_gv_tSX_Tutorial_HistoryCount] = lp_title;
    libCamp_gv_tSX_Tutorial_HistoryDescription[libCamp_gv_tSX_Tutorial_HistoryCount] = lp_description;
    libCamp_gv_tSX_Tutorial_HistoryIcon[libCamp_gv_tSX_Tutorial_HistoryCount] = lp_icon;
    libCamp_gv_tSX_Tutorial_HistoryMovie[libCamp_gv_tSX_Tutorial_HistoryCount] = lp_movie;
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_E8F0AA76") + libCamp_gv_tSX_Tutorial_HistoryTitle[libCamp_gv_tSX_Tutorial_HistoryCount]), false);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_1A3EB474") + StringToText(libCamp_gf_TS_Tutorial_ConvertImageToString(libCamp_gv_tSX_Tutorial_HistoryIcon[libCamp_gv_tSX_Tutorial_HistoryCount]))), false);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_AE8EC1E2") + StringToText(libCamp_gf_TS_Tutorial_ConvertMovieToString(libCamp_gv_tSX_Tutorial_HistoryMovie[libCamp_gv_tSX_Tutorial_HistoryCount]))), false);
}

void libCamp_gf_TS_Tutorial_ResetHistory () {
    // Implementation
    libCamp_gv_tSX_Tutorial_HistoryCount = 0;
}

void libCamp_gf_TS_Tutorial_RestoreHistoryToUI () {
    int auto7E6D0CC3_ae;
    int auto7E6D0CC3_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    if ((((libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 1) == false) && (libCamp_gv_tS_CurrentMap != 31)) || (libCamp_gv_tS_CurrentMap == 1) || (libCamp_gv_tS_CurrentMap == 2))) {
        return ;
    }
    else {
    }
    auto7E6D0CC3_ae = libCamp_gv_tSX_Tutorial_HistoryCount;
    auto7E6D0CC3_ai = 1;
    lv_index = 1;
    for ( ; ( (auto7E6D0CC3_ai >= 0 && lv_index <= auto7E6D0CC3_ae) || (auto7E6D0CC3_ai <= 0 && lv_index >= auto7E6D0CC3_ae) ) ; lv_index += auto7E6D0CC3_ai ) {
        HelpPanelAddTutorial(PlayerGroupAll(), libCamp_gv_tSX_Tutorial_HistoryTitle[lv_index], libCamp_gv_tSX_Tutorial_HistoryDescription[lv_index], libCamp_gv_tSX_Tutorial_HistoryIcon[lv_index], libCamp_gv_tSX_Tutorial_HistoryMovie[lv_index], false);
    }
}

void libCamp_gf_HideStoryUI (bool lp_showHide, bool lp_includeTip) {
    // Implementation
    if ((lp_showHide == false)) {
        if ((libCamp_gv_tS_StoryUIVisibilityCounter >= 20)) {
            return ;
        }
        else {
        }
        libCamp_gv_tS_StoryUIVisibilityCounter += 1;
        if ((UIFrameVisible(1, c_syncFrameTypeMenuBar) == true)) {
            libCamp_gv_tS_StoryUIVisibility_Menu[libCamp_gv_tS_StoryUIVisibilityCounter] = true;
        }
        else {
            libCamp_gv_tS_StoryUIVisibility_Menu[libCamp_gv_tS_StoryUIVisibilityCounter] = false;
        }
        if ((UIFrameVisible(1, c_syncFrameTypeCashPanel) == true)) {
            libCamp_gv_tS_StoryUIVisibility_Cash[libCamp_gv_tS_StoryUIVisibilityCounter] = true;
        }
        else {
            libCamp_gv_tS_StoryUIVisibility_Cash[libCamp_gv_tS_StoryUIVisibilityCounter] = false;
        }
        if ((libCamp_gf_RoomChangePanelIsVisible() == true)) {
            libCamp_gv_tS_StoryUIVisibility_RoomChange[libCamp_gv_tS_StoryUIVisibilityCounter] = true;
        }
        else {
            libCamp_gv_tS_StoryUIVisibility_RoomChange[libCamp_gv_tS_StoryUIVisibilityCounter] = false;
        }
        if ((UIFrameVisible(1, c_syncFrameTypeTipAlertPanel) == true)) {
            libCamp_gv_tS_StoryUIVisibility_Tip[libCamp_gv_tS_StoryUIVisibilityCounter] = true;
        }
        else {
            libCamp_gv_tS_StoryUIVisibility_Tip[libCamp_gv_tS_StoryUIVisibilityCounter] = false;
        }
        UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeMenuBar, false);
        UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeCashPanel, false);
        UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeCharacterSheetButton, false);
        libCamp_gf_HideRoomChangePanel(false);
        UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeTipAlertPanel, false);
    }
    else {
        if ((libCamp_gv_tS_StoryUIVisibilityCounter == 0)) {
            return ;
        }
        else {
        }
        UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeMenuBar, libCamp_gv_tS_StoryUIVisibility_Menu[libCamp_gv_tS_StoryUIVisibilityCounter]);
        UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeCashPanel, libCamp_gv_tS_StoryUIVisibility_Cash[libCamp_gv_tS_StoryUIVisibilityCounter]);
        libCamp_gf_HideRoomChangePanel(libCamp_gv_tS_StoryUIVisibility_RoomChange[libCamp_gv_tS_StoryUIVisibilityCounter]);
        UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeTipAlertPanel, libCamp_gv_tS_StoryUIVisibility_Tip[libCamp_gv_tS_StoryUIVisibilityCounter]);
        libCamp_gv_tS_StoryUIVisibilityCounter -= 1;
    }
}

void libCamp_gf_DisplayCampaignVictoryScoreScreen (int lp_mission) {
    // Variable Declarations
    text lv_upgradeAvailable;
    int lv_indexAchievement;
    int lv_unlockedTech;
    int lv_subGroupEnabledIndex;
    int lv_indexObjective;
    int lv_rewardsEarned;

    // Variable Initialization

    // Implementation
    GameCheatAllow(c_gameCheatProgress, false);
    UISetWorldVisible(PlayerGroupAll(), false);
    libNtve_gf_HideGameUI(false, PlayerGroupAll());
    UISetCursorVisible(PlayerGroupAll(), true);
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeBattleUI, true);
    UIClearMessages(PlayerGroupAll(), c_messageAreaAll);
    TransmissionClearAll();
    ConversationDataStop();
    SoundStopAllTriggerSounds(false);
    libCamp_gf_SetAllSoundChannelVolumesCampaign(3);
    libCamp_gf_PrepareForStoryMode(c_gameOverVictory, libCamp_gf_TS_CampaignDifficulty());
    if (((libCamp_gv_tSX_IsSimulation == false) || (libCamp_gv_tS_Horner05sSimulationBeforeCompleted == true))) {
        libCamp_gf_TS_UpdateCampaignScreen(lp_mission);
    }
    else {
    }
    libCamp_gf_CreateStoryModeTransitionSave((libCamp_gf_MissionName(lp_mission) + StringExternal("Param/Value/lib_Camp_D67253F3")), StringExternal("Param/Value/lib_Camp_02066A54"));
    VictoryPanelSetMissionTimeTitle(StringExternal("Param/Value/lib_Camp_E100AD56"));
    VictoryPanelSetBackgroundFilePath(libCamp_gf_TS_SetVictoryScreenBackground(lp_mission));
    VictoryPanelSetSummaryBackgroundFilePath(libCamp_gf_MissionLoadingScreenImage(lp_mission));
    if ((lp_mission == 25)) {
        VictoryPanelSetVictoryText(StringExternal("Param/Value/lib_Camp_F0633C82"));
    }
    else {
        VictoryPanelSetVictoryText(StringExternal("Param/Value/lib_Camp_2D326347"));
    }
    VictoryPanelSetMissionTimeText(libCamp_gf_FormatTimeCampaign(libCamp_gv_tS_MissionCompleteTime));
    if ((libCamp_gf_MissionReward(lp_mission) > 0)) {
        VictoryPanelSetRewardTitle(StringExternal("Param/Value/lib_Camp_C2E2CE7E"));
        VictoryPanelSetRewardCredits(libCamp_gf_MissionReward(lp_mission));
    }
    else {
        VictoryPanelSetRewardTitle(StringExternal("Param/Value/lib_Camp_390C1405"));
    }
    VictoryPanelSetAchievementsTitle(StringExternal("Param/Value/lib_Camp_3E550281"));
    VictoryPanelSetMissionTitle(StringExternal("Param/Value/lib_Camp_F4B8B451"));
    VictoryPanelSetMissionText(libCamp_gf_MissionNameInUpperCase(lp_mission));
    VictoryPanelSetStatisticsTitle(StringExternal("Param/Value/lib_Camp_7CDCEFA9"));
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeVictoryPanel, true);
    if ((libCamp_gv_tSX_IsSimulation == true)) {
        libCamp_gf_TS_OpenCampaignBank();
        libCamp_gf_TS_LoadTransitionVars(BankLastCreated(), true);
    }
    else {
    }
    libCamp_gf_TS_CheckAchievementUnlocking();
}

string libCamp_gf_TS_SetVictoryScreenBackground (int lp_map) {
    int auto566A4A78_val;

    // Implementation
    auto566A4A78_val = lp_map;
    if (auto566A4A78_val == 4) {
        return "Assets\\Textures\\ui_scorescreen_splash_thanson01.dds";
    }
    else if (auto566A4A78_val == 5) {
        return "Assets\\Textures\\ui_scorescreen_splash_thanson02.dds";
    }
    else if (auto566A4A78_val == 6) {
        return "Assets\\Textures\\ui_scorescreen_splash_thanson03a.dds";
    }
    else if (auto566A4A78_val == 7) {
        return "Assets\\Textures\\ui_scorescreen_splash_thanson03b.dds";
    }
    else if (auto566A4A78_val == 12) {
        return "Assets\\Textures\\ui_scorescreen_splash_thorner01.dds";
    }
    else if (auto566A4A78_val == 13) {
        return "Assets\\Textures\\ui_scorescreen_splash_thorner02.dds";
    }
    else if (auto566A4A78_val == 14) {
        return "Assets\\Textures\\ui_scorescreen_splash_thorner03.dds";
    }
    else if (auto566A4A78_val == 15) {
        return "Assets\\Textures\\ui_scorescreen_splash_thorner04.dds";
    }
    else if (auto566A4A78_val == 16) {
        return "Assets\\Textures\\ui_scorescreen_splash_thorner05s.dds";
    }
    else if (auto566A4A78_val == 1) {
        return "Assets\\Textures\\ui_scorescreen_splash_traynor01.dds";
    }
    else if (auto566A4A78_val == 2) {
        return "Assets\\Textures\\ui_scorescreen_splash_traynor02.dds";
    }
    else if (auto566A4A78_val == 3) {
        return "Assets\\Textures\\ui_scorescreen_splash_traynor03.dds";
    }
    else if (auto566A4A78_val == 8) {
        return "Assets\\Textures\\ui_scorescreen_splash_ttosh01.dds";
    }
    else if (auto566A4A78_val == 9) {
        return "Assets\\Textures\\ui_scorescreen_splash_ttosh02.dds";
    }
    else if (auto566A4A78_val == 10) {
        return "Assets\\Textures\\ui_scorescreen_splash_ttosh03a.dds";
    }
    else if (auto566A4A78_val == 11) {
        return "Assets\\Textures\\ui_scorescreen_splash_ttosh03b.dds";
    }
    else if (auto566A4A78_val == 17) {
        return "Assets\\Textures\\ui_scorescreen_splash_ttychus01.dds";
    }
    else if (auto566A4A78_val == 18) {
        return "Assets\\Textures\\ui_scorescreen_splash_ttychus02.dds";
    }
    else if (auto566A4A78_val == 19) {
        return "Assets\\Textures\\ui_scorescreen_splash_ttychus03.dds";
    }
    else if (auto566A4A78_val == 20) {
        return "Assets\\Textures\\ui_scorescreen_splash_ttychus04.dds";
    }
    else if (auto566A4A78_val == 21) {
        return "Assets\\Textures\\ui_scorescreen_splash_ttychus05.dds";
    }
    else if (auto566A4A78_val == 26) {
        return "Assets\\Textures\\ui_scorescreen_splash_tvalerian01.dds";
    }
    else if (auto566A4A78_val == 27) {
        return "Assets\\Textures\\ui_scorescreen_splash_tvalerian02a.dds";
    }
    else if (auto566A4A78_val == 28) {
        return "Assets\\Textures\\ui_scorescreen_splash_tvalerian02b.dds";
    }
    else if (auto566A4A78_val == 29) {
        return "Assets\\Textures\\ui_scorescreen_splash_tvalerian03.dds";
    }
    else if (auto566A4A78_val == 22) {
        return "Assets\\Textures\\ui_scorescreen_splash_tzeratul01.dds";
    }
    else if (auto566A4A78_val == 23) {
        return "Assets\\Textures\\ui_scorescreen_splash_tzeratul02.dds";
    }
    else if (auto566A4A78_val == 24) {
        return "Assets\\Textures\\ui_scorescreen_splash_tzeratul03.dds";
    }
    else if (auto566A4A78_val == 25) {
        return "Assets\\Textures\\ui_scorescreen_splash_tzeratul04.dds";
    }
    else {
        return "Assets\\Textures\\ui_scorescreen_splash_thanson01.dds";
    }
}

void libCamp_gf_TS_UpdateCampaignScreen (int lp_mission) {
    // Variable Declarations
    const string lv_campaignID = "WingsOfLiberty";
    text lv_body;

    // Variable Initialization

    // Implementation
    if ((lp_mission == 0)) {
        return ;
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(29, 2) == true)) {
        lv_body = (StringExternal("Param/Value/lib_Camp_8BB9EC51") + StringExternal("Param/Value/lib_Camp_4963E425") + StringExternal("Param/Value/lib_Camp_FAD183E6") + ConversationDataStateText(libCamp_gf_TS_MapConvoID(lp_mission), "Loading Screen Text") + StringExternal("Param/Value/lib_Camp_A998EBD1") + StringExternal("Param/Value/lib_Camp_4D8E2A14") + IntToText(libCamp_gf_NumberOfMissions(3)) + StringExternal("Param/Value/lib_Camp_EDBD02C1") + StringExternal("Param/Value/lib_Camp_3CD91EF8") + DifficultyNameCampaign(libCamp_gf_TS_CampaignDifficulty()));
        CampaignProgressSetImageFilePath(PlayerGroupAll(), lv_campaignID, "Assets\\Textures\\ui_bnet_singleplayer_complete_bg.dds");
    }
    else {
        lv_body = (StringExternal("Param/Value/lib_Camp_3B2B1EC4") + libCamp_gf_MissionNameInUpperCase(lp_mission) + StringExternal("Param/Value/lib_Camp_25ED2E6B") + ConversationDataStateText(libCamp_gf_TS_MapConvoID(lp_mission), "Loading Screen Text") + StringExternal("Param/Value/lib_Camp_7B263EC6") + StringExternal("Param/Value/lib_Camp_19D34994") + IntToText(libCamp_gf_NumberOfMissions(3)) + StringExternal("Param/Value/lib_Camp_3EEC58DF") + StringExternal("Param/Value/lib_Camp_A047780C") + DifficultyNameCampaign(libCamp_gf_TS_CampaignDifficulty()));
        CampaignProgressSetImageFilePath(PlayerGroupAll(), lv_campaignID, libCamp_gf_MissionLoadingScreenImage(lp_mission));
    }
    CampaignProgressSetText(PlayerGroupAll(), lv_campaignID, lv_body);
    CampaignProgressSetCampaignFinished(PlayerGroupAll(), lv_campaignID, libCamp_gf_MissionStatusCheck(29, 2));
}

void libCamp_gf_TS_CampaignVictory () {
    // Implementation
    UISetWorldVisible(PlayerGroupAll(), false);
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeVictoryPanel, false);
    UISetCursorVisible(PlayerGroupAll(), false);
    SoundtrackDefault(PlayerGroupAll(), c_soundtrackCategoryMusic, null, c_soundtrackCueAny, c_soundtrackIndexAny);
    SoundtrackDefault(PlayerGroupAll(), c_soundtrackCategoryAmbience, null, c_soundtrackCueAny, c_soundtrackIndexAny);
    SoundtrackStop(PlayerGroupAll(), c_soundtrackCategoryMusic, true);
    SoundtrackStop(PlayerGroupAll(), c_soundtrackCategoryAmbience, true);
    SoundStopAllTriggerSounds(true);
    TransmissionClearAll();
    libNtve_gf_SetAllSoundChannelVolumes(0, PlayerGroupAll(), 0.0);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryAmbient, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryDoodad, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryFlames, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryCombat, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryVoice, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategorySpell, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategorySPieces, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategorySEmitters, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategorySAmbient, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryReady, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryMovement, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryMission, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryGather, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryFoley, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryDialogue, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryDeath, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryAlert, true);
    SoundChannelMute(PlayerGroupAll(), c_soundCategoryBuild, true);
    UISetCursorVisible(PlayerGroupAll(), false);
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeBattleUI, false);
    libCamp_gv_tS_EndCinematicFinished = false;
    TriggerExecute(libCamp_gt_TS_EndCinematic, true, true);
    if ((libCamp_gv_tS_EndCinematicFinished == false)) {
        TransmissionClearAll();
    }
    else {
    }
    UISetCursorVisible(PlayerGroupAll(), true);
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeBattleUI, true);
    UISetMode(PlayerGroupAll(), c_uiModeFullscreen, c_transitionDurationImmediate);
    TriggerExecute(libCamp_gt_TS_EndCredits, true, true);
    TriggerDebugOutput(1, StringExternal("Param/Value/lib_Camp_20FE0674"), false);
    CinematicFade(false, 0.5, c_fadeStyleNormal, Color(0.00, 0.00, 0.00), 0.0, true);
    if ((libCamp_gv_tSX_IsSimulation == false)) {
        GameSetNextMap("");
    }
    else {
    }
    GameOver(1, c_gameOverVictory, false, false);
}

bool libCamp_gf_CampaignDebugModeIsOn (string lp_mode) {
    // Implementation
    return GameIsDebugOptionSet((lp_mode), 1);
}

void libCamp_gf_TS_DebugProgressInitMissionPath () {
    // Implementation
    libCamp_gf_TS_DebugProgressInitMissionPathEarly();
    libCamp_gf_TS_DebugProgressInitMissionPathAverage();
    libCamp_gf_TS_DebugProgressInitMissionPathLate();
}

void libCamp_gf_TS_DebugProgressInitMissionPathEarly () {
    int autoFCDE22D4_i;
    int autoB7DB84CF_i;

    // Variable Declarations
    string lv_pathString;
    int lv_indexMissionCurrent;
    int lv_indexMissionRequired;
    int lv_indexString;

    // Variable Initialization
    lv_pathString = "";

    // Implementation
    lv_pathString = " ";
    lv_indexString = 0;
    autoFCDE22D4_i = libCamp_gv_TSC_MISSION_FIRST;
    while (autoFCDE22D4_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMissionCurrent = libCamp_gv_tS_MapID[autoFCDE22D4_i];
        autoB7DB84CF_i = libCamp_gv_TSC_MISSION_FIRST;
        while (autoB7DB84CF_i <= libCamp_gv_TSC_MISSION_LAST) {
            lv_indexMissionRequired = libCamp_gv_tS_MapID[autoB7DB84CF_i];
            lv_indexString += 1;
            libCamp_gv_tS_DebugProgressMissionPathEarly[(lv_indexMissionCurrent)][(lv_indexMissionRequired)] = (StringSub(lv_pathString, lv_indexString, lv_indexString) == "1");
            autoB7DB84CF_i = autoB7DB84CF_i + 1;
        }
        autoFCDE22D4_i = autoFCDE22D4_i + 1;
    }
}

void libCamp_gf_TS_DebugProgressInitMissionPathAverage () {
    int auto9348939E_i;
    int auto0273F2C3_i;

    // Variable Declarations
    string lv_pathString;
    const int lv_type = 2;
    int lv_indexMissionCurrent;
    int lv_indexMissionRequired;
    int lv_indexString;

    // Variable Initialization
    lv_pathString = "";

    // Implementation
    lv_pathString = " ";
    lv_indexString = 0;
    auto9348939E_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto9348939E_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMissionCurrent = libCamp_gv_tS_MapID[auto9348939E_i];
        auto0273F2C3_i = libCamp_gv_TSC_MISSION_FIRST;
        while (auto0273F2C3_i <= libCamp_gv_TSC_MISSION_LAST) {
            lv_indexMissionRequired = libCamp_gv_tS_MapID[auto0273F2C3_i];
            lv_indexString += 1;
            libCamp_gv_tS_DebugProgressMissionPathAverage[(lv_indexMissionCurrent)][(lv_indexMissionRequired)] = (StringSub(lv_pathString, lv_indexString, lv_indexString) == "1");
            auto0273F2C3_i = auto0273F2C3_i + 1;
        }
        auto9348939E_i = auto9348939E_i + 1;
    }
}

void libCamp_gf_TS_DebugProgressInitMissionPathLate () {
    int autoCC8B7F76_i;
    int autoBE2F9D4A_i;

    // Variable Declarations
    string lv_pathString;
    const int lv_type = 3;
    int lv_indexMissionCurrent;
    int lv_indexMissionRequired;
    int lv_indexString;

    // Variable Initialization
    lv_pathString = "";

    // Implementation
    lv_pathString = " ";
    lv_indexString = 0;
    autoCC8B7F76_i = libCamp_gv_TSC_MISSION_FIRST;
    while (autoCC8B7F76_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMissionCurrent = libCamp_gv_tS_MapID[autoCC8B7F76_i];
        autoBE2F9D4A_i = libCamp_gv_TSC_MISSION_FIRST;
        while (autoBE2F9D4A_i <= libCamp_gv_TSC_MISSION_LAST) {
            lv_indexMissionRequired = libCamp_gv_tS_MapID[autoBE2F9D4A_i];
            lv_indexString += 1;
            libCamp_gv_tS_DebugProgressMissionPathLate[(lv_indexMissionCurrent)][(lv_indexMissionRequired)] = (StringSub(lv_pathString, lv_indexString, lv_indexString) == "1");
            autoBE2F9D4A_i = autoBE2F9D4A_i + 1;
        }
        autoCC8B7F76_i = autoCC8B7F76_i + 1;
    }
}

void libCamp_gf_TS_DebugProgressMissionPathRequireCopy (int lp_by, int lp_required, int lp_type) {
    int auto5459578B_val;
    int auto2F1509A4_i;
    int autoC46C954B_i;
    int autoD0B44184_i;

    // Variable Declarations
    int lv_indexMission;

    // Variable Initialization

    // Implementation
    auto5459578B_val = lp_type;
    if (auto5459578B_val == 1) {
        auto2F1509A4_i = libCamp_gv_TSC_MISSION_FIRST;
        while (auto2F1509A4_i <= libCamp_gv_TSC_MISSION_LAST) {
            lv_indexMission = libCamp_gv_tS_MapID[auto2F1509A4_i];
            libCamp_gv_tS_DebugProgressMissionPathEarly[(lp_by)][(lv_indexMission)] = libCamp_gv_tS_DebugProgressMissionPathEarly[(lp_required)][(lv_indexMission)];
            auto2F1509A4_i = auto2F1509A4_i + 1;
        }
        libCamp_gv_tS_DebugProgressMissionPathEarly[(lp_by)][(lp_required)] = true;
    }
    else if (auto5459578B_val == 2) {
        autoC46C954B_i = libCamp_gv_TSC_MISSION_FIRST;
        while (autoC46C954B_i <= libCamp_gv_TSC_MISSION_LAST) {
            lv_indexMission = libCamp_gv_tS_MapID[autoC46C954B_i];
            libCamp_gv_tS_DebugProgressMissionPathAverage[(lp_by)][(lv_indexMission)] = libCamp_gv_tS_DebugProgressMissionPathAverage[(lp_required)][(lv_indexMission)];
            autoC46C954B_i = autoC46C954B_i + 1;
        }
        libCamp_gv_tS_DebugProgressMissionPathAverage[(lp_by)][(lp_required)] = true;
    }
    else if (auto5459578B_val == 3) {
        autoD0B44184_i = libCamp_gv_TSC_MISSION_FIRST;
        while (autoD0B44184_i <= libCamp_gv_TSC_MISSION_LAST) {
            lv_indexMission = libCamp_gv_tS_MapID[autoD0B44184_i];
            libCamp_gv_tS_DebugProgressMissionPathLate[(lp_by)][(lv_indexMission)] = libCamp_gv_tS_DebugProgressMissionPathLate[(lp_required)][(lv_indexMission)];
            autoD0B44184_i = autoD0B44184_i + 1;
        }
        libCamp_gv_tS_DebugProgressMissionPathLate[(lp_by)][(lp_required)] = true;
    }
    else {
    }
}

void libCamp_gf_TS_DebugProgressMissionPathRequireSet (int lp_by, int lp_required, int lp_type) {
    int autoF2AEA1C0_val;

    // Implementation
    autoF2AEA1C0_val = lp_type;
    if (autoF2AEA1C0_val == 1) {
        libCamp_gv_tS_DebugProgressMissionPathEarly[(lp_by)][(lp_required)] = true;
    }
    else if (autoF2AEA1C0_val == 2) {
        libCamp_gv_tS_DebugProgressMissionPathAverage[(lp_by)][(lp_required)] = true;
    }
    else if (autoF2AEA1C0_val == 3) {
        libCamp_gv_tS_DebugProgressMissionPathLate[(lp_by)][(lp_required)] = true;
    }
    else {
    }
}

void libCamp_gf_TS_DebugProgressAddMissionButton (int lp_mission, fixed lp_col, fixed lp_row) {
    int auto4921DE78_val;

    // Variable Declarations
    int lv_missionIndex;
    int lv_xX;
    int lv_yY;
    int lv_width;
    int lv_height;
    int lv_marginX;
    int lv_marginY;
    int lv_index;

    // Variable Initialization

    // Implementation
    lv_missionIndex = (lp_mission);
    lv_xX = FixedToInt((((lp_col - 1.0) * 285.0) + 40.0));
    lv_yY = FixedToInt((((lp_row - 1.0) * 70.0) + 35.0));
    lv_width = 290;
    lv_height = 75;
    lv_marginX = 15;
    lv_marginY = 10;
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
    libNtve_gf_SetDialogItemHandle(DialogControlLastCreated(), ("WoL_DebugProgress_MissionButton" + IntToString(lv_missionIndex)), PlayerGroupAll());
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_width, lv_height);
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, lv_xX, lv_yY);
    DialogControlSetPropertyAsText(DialogControlLastCreated(), c_triggerControlPropertyText, PlayerGroupAll(), libCamp_gv_tS_MapProgressCheatName[(lp_mission)]);
    libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), Color(0.00, 100.00, 0.00), PlayerGroupAll());
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelMission", PlayerGroupAll());
    libCamp_gv_tS_DebugProgressMissionButtons[lv_missionIndex] = DialogControlLastCreated();
    if ((lp_mission == 16)) {
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
        libNtve_gf_SetDialogItemHandle(DialogControlLastCreated(), "WoL_DebugProgress_UnlockSecretButton", PlayerGroupAll());
        libCamp_gv_tS_DebugProgressMissionButtonUnlockSecret = DialogControlLastCreated();
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 120, lv_height);
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, (lv_xX + (lv_width - 8)), (lv_yY - (lv_height / 2)));
        DialogControlSetPropertyAsText(DialogControlLastCreated(), c_triggerControlPropertyText, PlayerGroupAll(), StringExternal("Param/Value/lib_Camp_FF7E2E63"));
        libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabelUnlock", PlayerGroupAll());
    }
    else {
    }
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
    DialogControlSetPropertyAsText(DialogControlLastCreated(), c_triggerControlPropertyText, PlayerGroupAll(), StringExternal("Param/Value/lib_Camp_20D82A0E"));
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), (lv_width - (lv_marginX * 2)), (lv_height - (lv_marginY * 2)));
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabelProgress", PlayerGroupAll());
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, (lv_xX + lv_marginX), (lv_yY + lv_marginY));
    libCamp_gv_tS_DebugProgressMissionLabelsStates[lv_missionIndex] = DialogControlLastCreated();
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
    DialogControlSetPropertyAsText(DialogControlLastCreated(), c_triggerControlPropertyText, PlayerGroupAll(), StringExternal("Param/Value/lib_Camp_F84D3B64"));
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), (lv_width - (lv_marginX * 2)), (lv_height - (lv_marginY * 2)));
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabelUnit", PlayerGroupAll());
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, (lv_xX + lv_marginX), (lv_yY + lv_marginY));
    libCamp_gv_tS_DebugProgressMissionLabelsUnits[lv_missionIndex] = DialogControlLastCreated();
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
    DialogControlSetPropertyAsText(DialogControlLastCreated(), c_triggerControlPropertyText, PlayerGroupAll(), StringExternal("Param/Value/lib_Camp_479797C8"));
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), (lv_width - (lv_marginX * 2)), (lv_height - (lv_marginY * 2)));
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabelCredits", PlayerGroupAll());
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, (lv_xX + lv_marginX), (lv_yY + lv_marginY));
    libCamp_gv_tS_DebugProgressMissionLabelsCredits[lv_missionIndex] = DialogControlLastCreated();
    lv_width = 300;
    lv_height = 60;
    auto4921DE78_val = lp_mission;
    if (auto4921DE78_val == 12) {
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_width, lv_height);
        libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabelRequirement", PlayerGroupAll());
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, (lv_xX + lv_marginX), (lv_yY - lv_height));
        libCamp_gv_tS_DebugProgressMissionLabelsRequirement[lv_missionIndex] = DialogControlLastCreated();
    }
    else if (auto4921DE78_val == 6) {
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_width, lv_height);
        libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabelRequirement", PlayerGroupAll());
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, (lv_xX + lv_marginX), (lv_yY - lv_height));
        libCamp_gv_tS_DebugProgressMissionLabelsRequirement[lv_missionIndex] = DialogControlLastCreated();
    }
    else if (auto4921DE78_val == 22) {
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_width, lv_height);
        libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabelRequirement", PlayerGroupAll());
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, (lv_xX + lv_marginX), (lv_yY - lv_height));
        libCamp_gv_tS_DebugProgressMissionLabelsRequirement[lv_missionIndex] = DialogControlLastCreated();
    }
    else if (auto4921DE78_val == 8) {
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_width, lv_height);
        libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabelRequirement", PlayerGroupAll());
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, (lv_xX + lv_marginX), (lv_yY - lv_height));
        libCamp_gv_tS_DebugProgressMissionLabelsRequirement[lv_missionIndex] = DialogControlLastCreated();
    }
    else if (auto4921DE78_val == 10) {
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_width, lv_height);
        libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabelRequirement", PlayerGroupAll());
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, (lv_xX + lv_marginX), (lv_yY - lv_height));
        libCamp_gv_tS_DebugProgressMissionLabelsRequirement[lv_missionIndex] = DialogControlLastCreated();
    }
    else if (auto4921DE78_val == 18) {
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_width, lv_height);
        libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabelRequirement", PlayerGroupAll());
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, (lv_xX + lv_marginX), (lv_yY - lv_height));
        libCamp_gv_tS_DebugProgressMissionLabelsRequirement[lv_missionIndex] = DialogControlLastCreated();
    }
    else if (auto4921DE78_val == 19) {
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_width, lv_height);
        libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabelRequirement", PlayerGroupAll());
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, (lv_xX + lv_marginX), (lv_yY - lv_height));
        libCamp_gv_tS_DebugProgressMissionLabelsRequirement[lv_missionIndex] = DialogControlLastCreated();
    }
    else if (auto4921DE78_val == 20) {
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lv_width, lv_height);
        libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabelRequirement", PlayerGroupAll());
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, (lv_xX + lv_marginX), (lv_yY - lv_height));
        libCamp_gv_tS_DebugProgressMissionLabelsRequirement[lv_missionIndex] = DialogControlLastCreated();
    }
    else {
    }
}

void libCamp_gf_TS_DebugProgressCreateDialog () {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    if ((libCamp_gv_tS_DebugProgressDialog != c_invalidDialogId)) {
        return ;
    }
    else {
    }
    DialogCreate(1500, 1100, c_anchorCenter, 0, 0, true);
    DialogSetPosition(DialogLastCreated(), c_anchorCenter, 0, 0);
    libCamp_gv_tS_DebugProgressDialog = DialogLastCreated();
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeImage);
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 272, 60);
    libCamp_gv_tS_DebugProgressImageCurrent = DialogControlLastCreated();
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeImage);
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 137, 37);
    libCamp_gv_tS_DebugProgressImageOK = DialogControlLastCreated();
    libCamp_gf_TS_DebugProgressAddMissionButton(1, 3.0, 1.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(2, 3.0, 2.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(3, 3.0, 3.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(4, 2.0, 3.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(5, 2.0, 4.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(6, 2.0, 6.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(7, 2.0, 7.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(8, 5.0, 4.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(9, 5.0, 5.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(10, 5.0, 7.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(11, 5.0, 8.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(12, 1.0, 5.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(13, 1.0, 6.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(14, 1.0, 7.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(15, 1.0, 8.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(16, 1.0, 9.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(17, 4.0, 3.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(18, 4.0, 5.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(19, 4.0, 7.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(20, 4.0, 9.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(21, 4.0, 10.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(22, 3.0, 6.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(23, 3.0, 7.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(24, 3.0, 8.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(25, 3.0, 9.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(26, 3.0, 11.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(27, 3.0, 12.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(28, 3.0, 13.0);
    libCamp_gf_TS_DebugProgressAddMissionButton(29, 3.0, 14.0);
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
    libNtve_gf_SetDialogItemHandle(DialogControlLastCreated(), "WoL_DebugProgress_OkButton", PlayerGroupAll());
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 150, 50);
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorBottomRight, 190, 30);
    DialogControlSetPropertyAsText(DialogControlLastCreated(), c_triggerControlPropertyText, PlayerGroupAll(), StringExternal("Param/Value/lib_Camp_D890E79E"));
    libCamp_gv_tS_DebugProgressButtonOK = DialogControlLastCreated();
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 280, 50);
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorBottomRight, 50, 50);
    DialogControlSetPropertyAsText(DialogControlLastCreated(), c_triggerControlPropertyText, PlayerGroupAll(), StringExternal("Param/Value/lib_Camp_9F117278"));
    libCamp_gv_tS_DebugProgressLabelWarning = DialogControlLastCreated();
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
    libNtve_gf_SetDialogItemHandle(DialogControlLastCreated(), "WoL_DebugProgress_CancelButton", PlayerGroupAll());
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 150, 50);
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorBottomRight, 40, 30);
    DialogControlSetPropertyAsText(DialogControlLastCreated(), c_triggerControlPropertyText, PlayerGroupAll(), StringExternal("Param/Value/lib_Camp_21B35898"));
    libCamp_gv_tS_DebugProgressButtonCancel = DialogControlLastCreated();
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
    libNtve_gf_SetDialogItemHandle(DialogControlLastCreated(), "WoL_DebugProgress_ResetButton", PlayerGroupAll());
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 150, 50);
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorBottomLeft, 40, 30);
    DialogControlSetPropertyAsText(DialogControlLastCreated(), c_triggerControlPropertyText, PlayerGroupAll(), StringExternal("Param/Value/lib_Camp_8245BB9F"));
    libCamp_gv_tS_DebugProgressButtonReset = DialogControlLastCreated();
    if ((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true) && (GameIsOnline() == false) && (libCamp_gf_CampaignDebugModeIsOn("NoBattleNet") == true)) {
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
        libNtve_gf_SetDialogItemHandle(DialogControlLastCreated(), "WoL_DebugProgress_LaunchMissionButton", PlayerGroupAll());
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 220, 50);
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorBottomRight, 370, 30);
        DialogControlSetPropertyAsText(DialogControlLastCreated(), c_triggerControlPropertyText, PlayerGroupAll(), StringExternal("Param/Value/lib_Camp_F317CBE3"));
        libCamp_gv_tS_DebugProgressButtonLaunchMission = DialogControlLastCreated();
        TriggerEnable(libCamp_gt_TS_DebugProgressLaunchMissionPopup, true);
    }
    else {
    }
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 400, 200);
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, 50, 50);
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugProgressPanelLabel", PlayerGroupAll());
    libCamp_gv_tS_DebugProgressLabelsCompleted = DialogControlLastCreated();
}

text libCamp_gf_TS_DebugProgressFormatRequirementsCount (int lp_missionCount, text lp_extraText, bool lp_met) {
    // Variable Declarations
    text lv_ret;

    // Variable Initialization
    lv_ret = StringExternal("Param/Value/lib_Camp_16FC97F9");

    // Implementation
    lv_ret = StringExternal("Param/Value/lib_Camp_72A7B778");
    if ((lp_met == true)) {
        lv_ret = (lv_ret + StringExternal("Param/Value/lib_Camp_45C6AF7D"));
    }
    else {
        lv_ret = (lv_ret + StringExternal("Param/Value/lib_Camp_80A79E72"));
    }
    lv_ret = (lv_ret + StringExternal("Param/Value/lib_Camp_FB2EF017") + IntToText(lp_missionCount) + StringExternal("Param/Value/lib_Camp_A804326C") + lp_extraText + StringExternal("Param/Value/lib_Camp_739BC18B"));
    return lv_ret;
}

text libCamp_gf_TS_DebugProgressFormatRequirementsMission (int lp_mission, bool lp_met) {
    // Variable Declarations
    text lv_ret;

    // Variable Initialization
    lv_ret = StringExternal("Param/Value/lib_Camp_A14DA386");

    // Implementation
    lv_ret = StringExternal("Param/Value/lib_Camp_D069BCDA");
    if ((lp_met == true)) {
        lv_ret = (lv_ret + StringExternal("Param/Value/lib_Camp_D0FB1E02"));
    }
    else {
        lv_ret = (lv_ret + StringExternal("Param/Value/lib_Camp_C8C7C10D"));
    }
    lv_ret = (lv_ret + StringExternal("Param/Value/lib_Camp_EB0E27D8") + libCamp_gv_tS_MapProgressCheatName[(lp_mission)] + StringExternal("Param/Value/lib_Camp_1EBA7A08"));
    return lv_ret;
}

text libCamp_gf_TS_DebugProgressFormatMissionUnitUnlocked (int lp_mission) {
    int auto24C06F3B_val;

    // Variable Declarations
    int lv_missionIndex;
    int lv_subgroupUnlocked1;
    int lv_subgroupUnlocked2;
    string lv_unitType;
    int lv_index;
    text lv_label;

    // Variable Initialization
    lv_label = StringExternal("Param/Value/lib_Camp_A48DAF40");

    // Implementation
    lv_label = StringExternal("Param/Value/lib_Camp_89E28539");
    lv_missionIndex = (lp_mission);
    lv_subgroupUnlocked1 = libCamp_gf_MissionUnlockedTechSubgorup(lp_mission, 1);
    if ((lv_subgroupUnlocked1 == 0)) {
        lv_label = StringExternal("Param/Value/lib_Camp_5E92E8B0");
    }
    else {
        lv_unitType = libCamp_gf_StoryTechGroupUnitType(lv_subgroupUnlocked1);
        lv_label = UnitTypeGetName(lv_unitType);
        lv_subgroupUnlocked2 = libCamp_gf_MissionUnlockedTechSubgorup(lp_mission, 2);
        if ((lv_subgroupUnlocked2 != 0)) {
            lv_label = (lv_label + StringExternal("Param/Value/lib_Camp_18D1F682"));
        }
        else {
        }
    }
    auto24C06F3B_val = libCamp_gf_MissionStatus(lp_mission);
    if (auto24C06F3B_val == 1) {
        lv_label = (StringExternal("Param/Value/lib_Camp_85CED5C8") + lv_label + StringExternal("Param/Value/lib_Camp_F55FBED5"));
    }
    else if (auto24C06F3B_val == 2) {
        lv_label = (StringExternal("Param/Value/lib_Camp_245535C8") + lv_label + StringExternal("Param/Value/lib_Camp_6C98C561"));
    }
    else if (auto24C06F3B_val == 0) {
        lv_label = (StringExternal("Param/Value/lib_Camp_7987D84F") + lv_label + StringExternal("Param/Value/lib_Camp_068B808D"));
    }
    else {
    }
    return lv_label;
}

text libCamp_gf_TS_DebugProgressFormatMissionCredits (int lp_mission) {
    int auto99F4FDB0_val;

    // Variable Declarations
    text lv_label;

    // Variable Initialization
    lv_label = StringExternal("Param/Value/lib_Camp_C179CA0A");

    // Implementation
    lv_label = StringExternal("Param/Value/lib_Camp_05CFD3A1");
    lv_label = libCamp_gf_FormatCredits(libCamp_gf_MissionReward(lp_mission), true);
    auto99F4FDB0_val = libCamp_gf_MissionStatus(lp_mission);
    if (auto99F4FDB0_val == 1) {
        lv_label = (StringExternal("Param/Value/lib_Camp_A3E9888F") + lv_label + StringExternal("Param/Value/lib_Camp_99045681"));
    }
    else if (auto99F4FDB0_val == 2) {
        lv_label = (StringExternal("Param/Value/lib_Camp_1227BCB1") + lv_label + StringExternal("Param/Value/lib_Camp_1A94B1C4"));
    }
    else if (auto99F4FDB0_val == 0) {
        lv_label = (StringExternal("Param/Value/lib_Camp_4F1F7787") + lv_label + StringExternal("Param/Value/lib_Camp_6A2207E8"));
    }
    else {
    }
    return lv_label;
}

void libCamp_gf_TS_DebugProgressUpdateDialog () {
    int auto7C149CB2_i;
    int auto3DA6F6FF_val;
    int autoBFBF4BE5_val;
    int autoC67F577C_i;

    // Variable Declarations
    int lv_indexMission;
    int lv_completed;
    int lv_credits;

    // Variable Initialization

    // Implementation
    if ((libCamp_gv_tS_DebugProgressCurrentMission == 0)) {
        DialogControlSetVisible(libCamp_gv_tS_DebugProgressImageCurrent, PlayerGroupAll(), false);
        DialogControlSetVisible(libCamp_gv_tS_DebugProgressImageOK, PlayerGroupAll(), false);
    }
    else {
        DialogControlSetVisible(libCamp_gv_tS_DebugProgressImageCurrent, PlayerGroupAll(), true);
        DialogControlSetVisible(libCamp_gv_tS_DebugProgressImageOK, PlayerGroupAll(), true);
    }
    auto7C149CB2_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto7C149CB2_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto7C149CB2_i];
        if ((libCamp_gv_tS_DebugProgressMissionLabelsStates[(lv_indexMission)] != c_invalidDialogControlId)) {
            if ((libCamp_gv_tS_DebugProgressCurrentMission == lv_indexMission)) {
                DialogControlSetPositionRelative(libCamp_gv_tS_DebugProgressImageCurrent, PlayerGroupAll(), c_anchorCenter, libCamp_gv_tS_DebugProgressMissionButtons[(lv_indexMission)], c_anchorCenter, 0, 0);
                DialogControlSetPositionRelative(libCamp_gv_tS_DebugProgressImageOK, PlayerGroupAll(), c_anchorCenter, libCamp_gv_tS_DebugProgressButtonOK, c_anchorCenter, 0, 0);
                auto3DA6F6FF_val = libCamp_gf_MissionStatus(libCamp_gf_TS_MapIDFromIndex(lv_indexMission));
                if (auto3DA6F6FF_val == 0) {
                    libNtve_gf_SetDialogItemColor(libCamp_gv_tS_DebugProgressImageCurrent, ColorWithAlpha(100.00, 0.00, 0.00, 49.80), PlayerGroupAll());
                    libNtve_gf_SetDialogItemColor(libCamp_gv_tS_DebugProgressImageOK, ColorWithAlpha(100.00, 0.00, 0.00, 49.80), PlayerGroupAll());
                    DialogControlSetVisible(libCamp_gv_tS_DebugProgressLabelWarning, PlayerGroupAll(), true);
                    libNtve_gf_SetDialogItemText(libCamp_gv_tS_DebugProgressLabelWarning, StringExternal("Param/Value/lib_Camp_2D52D070"), PlayerGroupAll());
                }
                else if (auto3DA6F6FF_val == 1) {
                    libNtve_gf_SetDialogItemColor(libCamp_gv_tS_DebugProgressImageCurrent, ColorWithAlpha(0.00, 100.00, 0.00, 49.80), PlayerGroupAll());
                    libNtve_gf_SetDialogItemColor(libCamp_gv_tS_DebugProgressImageOK, ColorWithAlpha(0.00, 100.00, 0.00, 49.80), PlayerGroupAll());
                    DialogControlSetVisible(libCamp_gv_tS_DebugProgressLabelWarning, PlayerGroupAll(), false);
                }
                else if (auto3DA6F6FF_val == 2) {
                    libNtve_gf_SetDialogItemColor(libCamp_gv_tS_DebugProgressImageCurrent, ColorWithAlpha(100.00, 100.00, 0.00, 49.80), PlayerGroupAll());
                    libNtve_gf_SetDialogItemColor(libCamp_gv_tS_DebugProgressImageOK, ColorWithAlpha(100.00, 100.00, 0.00, 49.80), PlayerGroupAll());
                    DialogControlSetVisible(libCamp_gv_tS_DebugProgressLabelWarning, PlayerGroupAll(), true);
                    libNtve_gf_SetDialogItemText(libCamp_gv_tS_DebugProgressLabelWarning, StringExternal("Param/Value/lib_Camp_9D65649A"), PlayerGroupAll());
                }
                else {
                }
            }
            else {
            }
            autoBFBF4BE5_val = libCamp_gf_MissionStatus(lv_indexMission);
            if (autoBFBF4BE5_val == 0) {
                DialogControlSetEnabled(libCamp_gv_tS_DebugProgressMissionButtons[(lv_indexMission)], PlayerGroupAll(), false);
                DialogControlSetEnabled(libCamp_gv_tS_DebugProgressMissionLabelsStates[(lv_indexMission)], PlayerGroupAll(), false);
                DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionLabelsStates[(lv_indexMission)], c_triggerControlPropertyText, PlayerGroupAll(), StringExternal("Param/Value/lib_Camp_09B9FD33"));
                DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionButtons[(lv_indexMission)], c_triggerControlPropertyText, PlayerGroupAll(), (StringExternal("Param/Value/lib_Camp_ADE1D5F7") + libCamp_gv_tS_MapProgressCheatName[(lv_indexMission)] + StringExternal("Param/Value/lib_Camp_E24C37DB")));
            }
            else if (autoBFBF4BE5_val == 1) {
                DialogControlSetEnabled(libCamp_gv_tS_DebugProgressMissionButtons[lv_indexMission], PlayerGroupAll(), true);
                DialogControlSetEnabled(libCamp_gv_tS_DebugProgressMissionLabelsStates[lv_indexMission], PlayerGroupAll(), true);
                DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionLabelsStates[lv_indexMission], c_triggerControlPropertyText, PlayerGroupAll(), (StringExternal("Param/Value/lib_Camp_163C4B6E") + IntToText(libCamp_gf_MissionStatusAge(libCamp_gf_TS_MapIDFromIndex(lv_indexMission), 1)) + StringExternal("Param/Value/lib_Camp_979A20A5")));
                DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionButtons[lv_indexMission], c_triggerControlPropertyText, PlayerGroupAll(), (libCamp_gv_tS_MapProgressCheatName[(lv_indexMission)]));
            }
            else if (autoBFBF4BE5_val == 2) {
                DialogControlSetEnabled(libCamp_gv_tS_DebugProgressMissionButtons[lv_indexMission], PlayerGroupAll(), false);
                DialogControlSetEnabled(libCamp_gv_tS_DebugProgressMissionLabelsStates[lv_indexMission], PlayerGroupAll(), false);
                DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionLabelsStates[lv_indexMission], c_triggerControlPropertyText, PlayerGroupAll(), (StringExternal("Param/Value/lib_Camp_A8BD2109") + IntToText(libCamp_gf_MissionStatusAge(libCamp_gf_TS_MapIDFromIndex(lv_indexMission), 2)) + StringExternal("Param/Value/lib_Camp_0D41C8F1")));
                DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionButtons[lv_indexMission], c_triggerControlPropertyText, PlayerGroupAll(), (StringExternal("Param/Value/lib_Camp_6F4D8C3A") + libCamp_gv_tS_MapProgressCheatName[(lv_indexMission)] + StringExternal("Param/Value/lib_Camp_0BFF5F4A")));
            }
            else {
            }
            libNtve_gf_SetDialogItemText(libCamp_gv_tS_DebugProgressMissionLabelsUnits[lv_indexMission], libCamp_gf_TS_DebugProgressFormatMissionUnitUnlocked(libCamp_gf_TS_MapIDFromIndex(lv_indexMission)), PlayerGroupAll());
            libNtve_gf_SetDialogItemText(libCamp_gv_tS_DebugProgressMissionLabelsCredits[lv_indexMission], libCamp_gf_TS_DebugProgressFormatMissionCredits(libCamp_gf_TS_MapIDFromIndex(lv_indexMission)), PlayerGroupAll());
        }
        else {
        }
        auto7C149CB2_i = auto7C149CB2_i + 1;
    }
    autoC67F577C_i = libCamp_gv_TSC_MISSION_FIRST;
    while (autoC67F577C_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[autoC67F577C_i];
        if ((libCamp_gf_MissionStatusCheck(lv_indexMission, 2) == true)) {
            lv_completed += 1;
            lv_credits += libCamp_gf_MissionReward(lv_indexMission);
        }
        else {
        }
        autoC67F577C_i = autoC67F577C_i + 1;
    }
    libNtve_gf_SetDialogItemText(libCamp_gv_tS_DebugProgressLabelsCompleted, (StringExternal("Param/Value/lib_Camp_7316F447") + IntToText(lv_completed) + StringExternal("Param/Value/lib_Camp_75004B96") + libCamp_gf_FormatCredits(lv_credits, true)), PlayerGroupAll());
    if ((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true)) {
        TriggerEnable(libCamp_gt_TS_DebugProgressLaunchMission, true);
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(15, 2) == true) && (libCamp_gf_MissionStatusCheck(16, 0) == true)) {
        DialogControlSetEnabled(libCamp_gv_tS_DebugProgressMissionButtonUnlockSecret, PlayerGroupAll(), true);
    }
    else {
        DialogControlSetEnabled(libCamp_gv_tS_DebugProgressMissionButtonUnlockSecret, PlayerGroupAll(), false);
    }
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionLabelsRequirement[(8)], c_triggerControlPropertyText, PlayerGroupAll(), libCamp_gf_TS_DebugProgressFormatRequirementsCount(4, StringExternal("Param/Value/lib_Camp_001A6497"), (lv_completed >= 4)));
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionLabelsRequirement[(10)], c_triggerControlPropertyText, PlayerGroupAll(), libCamp_gf_TS_DebugProgressFormatRequirementsCount(13, (StringExternal("Param/Value/lib_Camp_CD739472") + libCamp_gv_tS_MapProgressCheatName[(9)] + StringExternal("Param/Value/lib_Camp_4A251AEB")), ((libCamp_gf_CountMissions(2) >= 13) || (libCamp_gf_MissionStatusAge(9, 2) > 2))));
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionLabelsRequirement[(12)], c_triggerControlPropertyText, PlayerGroupAll(), libCamp_gf_TS_DebugProgressFormatRequirementsCount(6, StringExternal("Param/Value/lib_Camp_6ACDCED8"), (lv_completed >= 6)));
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionLabelsRequirement[(6)], c_triggerControlPropertyText, PlayerGroupAll(), libCamp_gf_TS_DebugProgressFormatRequirementsCount(12, (StringExternal("Param/Value/lib_Camp_C951D8B3") + libCamp_gv_tS_MapProgressCheatName[(5)] + StringExternal("Param/Value/lib_Camp_907BEAC2")), ((libCamp_gf_CountMissions(2) >= 12) || (libCamp_gf_MissionStatusAge(5, 2) > 2))));
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionLabelsRequirement[(22)], c_triggerControlPropertyText, PlayerGroupAll(), libCamp_gf_TS_DebugProgressFormatRequirementsMission(18, libCamp_gf_MissionStatusCheck(18, 2)));
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionLabelsRequirement[(18)], c_triggerControlPropertyText, PlayerGroupAll(), libCamp_gf_TS_DebugProgressFormatRequirementsCount(8, StringExternal("Param/Value/lib_Camp_14D945D7"), (lv_completed >= 8)));
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionLabelsRequirement[(19)], c_triggerControlPropertyText, PlayerGroupAll(), libCamp_gf_TS_DebugProgressFormatRequirementsCount(11, StringExternal("Param/Value/lib_Camp_A58FF9D7"), (lv_completed >= 11)));
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugProgressMissionLabelsRequirement[(20)], c_triggerControlPropertyText, PlayerGroupAll(), libCamp_gf_TS_DebugProgressFormatRequirementsCount(14, StringExternal("Param/Value/lib_Camp_1B12E743"), (lv_completed >= 14)));
}

void libCamp_gf_TS_DebugProgressDisplayDialog (int lp_currentMission, trigger lp_oKCallback, trigger lp_cancelCallback) {
    // Variable Declarations
    int lv_indexMission;

    // Variable Initialization

    // Implementation
    if ((libCamp_gv_tS_DebugProgressDialogOpened == true)) {
        return ;
    }
    else {
    }
    UISetWorldVisible(PlayerGroupAll(), false);
    libCamp_gf_HideStoryUI(false, true);
    UISetCursorVisible(PlayerGroupAll(), true);
    libCamp_gv_tS_DebugProgressDialogOpened = true;
    libCamp_gv_tS_DebugProgressCurrentMission = lp_currentMission;
    libCamp_gv_tS_DebugProgressExitCallbackOK = lp_oKCallback;
    libCamp_gv_tS_DebugProgressExitCallbackCancel = lp_cancelCallback;
    libCamp_gv_tS_DebugProgressLastMission = libCamp_gf_LastSuccessfulMission();
    libCamp_gv_tS_DebugProgressLastCreditMission = 0;
    libCamp_gf_TS_DebugProgressSaveStates();
    libCamp_gf_TS_DebugProgressCreateDialog();
    libCamp_gf_TS_DebugProgressUpdateDialog();
    DialogSetVisible(libCamp_gv_tS_DebugProgressDialog, PlayerGroupAll(), true);
}

void libCamp_gf_TS_DebugProgressSaveStates () {
    // Implementation
    BankLoad("TDebugProgress", 1);
    libCamp_gv_tS_DebugProgressBank = BankLastCreated();
    libCamp_gf_TS_SaveTransitionVars(BankLastCreated(), libCamp_gv_tSX_IsSimulation, libCamp_gv_tSX_IsVictoryPlayAgain, false, 0);
}

void libCamp_gf_TS_DebugProgressRestoreStates () {
    // Implementation
    if ((libCamp_gv_tS_DebugProgressBank == null)) {
        return ;
    }
    else {
    }
    libCamp_gf_TS_LoadTransitionVars(libCamp_gv_tS_DebugProgressBank, false);
    BankRemove(libCamp_gv_tS_DebugProgressBank);
    libCamp_gv_tS_DebugProgressBank = null;
}

void libCamp_gf_TS_DebugProgressMissionDialogShow () {
    int auto88A05213_ae;
    int auto88A05213_ai;
    int autoCC6F9482_i;
    int auto837EA1E9_ae;
    int auto837EA1E9_ai;

    // Variable Declarations
    int lv_indexMission;
    int lv_index;
    int lv_missionCount;
    const int lv_c_WIDTH = 290;
    const int lv_c_BUFFER = 5;

    // Variable Initialization

    // Implementation
    auto88A05213_ae = 5;
    auto88A05213_ai = 1;
    lv_index = 1;
    for ( ; ( (auto88A05213_ai >= 0 && lv_index <= auto88A05213_ae) || (auto88A05213_ai <= 0 && lv_index >= auto88A05213_ae) ) ; lv_index += auto88A05213_ai ) {
        libCamp_gv_tS_DebugProgressMissionOptions[lv_index] = 0;
    }
    lv_index = 0;
    DialogCreate(1500, 420, c_anchorCenter, 0, 0, true);
    libCamp_gv_tS_DebugProgressMissionLaunchDialog = DialogLastCreated();
    autoCC6F9482_i = libCamp_gv_TSC_MISSION_FIRST;
    while (autoCC6F9482_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[autoCC6F9482_i];
        if ((libCamp_gf_MissionStatusCheck(lv_indexMission, 1) == true)) {
            lv_index += 1;
            libNtve_gf_CreateDialogItemButton(DialogLastCreated(), lv_c_WIDTH, 100, c_anchorTopLeft, 50, 50, StringExternal("Param/Value/lib_Camp_E550D41C"), libCamp_gf_MissionName(lv_indexMission), "");
            libCamp_gv_tS_DebugProgressMissionLaunchButtons[lv_index] = DialogControlLastCreated();
            libCamp_gv_tS_DebugProgressMissionOptions[lv_index] = lv_indexMission;
        }
        else {
        }
        autoCC6F9482_i = autoCC6F9482_i + 1;
    }
    lv_missionCount = lv_index;
    libNtve_gf_CreateDialogItemLabel(DialogLastCreated(), 400, 50, c_anchorTopLeft, 50, 50, StringExternal("Param/Value/lib_Camp_116FA9E9"), Color(100,100,100), false, 2.0);
    auto837EA1E9_ae = lv_missionCount;
    auto837EA1E9_ai = 1;
    lv_index = 1;
    for ( ; ( (auto837EA1E9_ai >= 0 && lv_index <= auto837EA1E9_ae) || (auto837EA1E9_ai <= 0 && lv_index >= auto837EA1E9_ae) ) ; lv_index += auto837EA1E9_ai ) {
        DialogControlSetPosition(libCamp_gv_tS_DebugProgressMissionLaunchButtons[lv_index], PlayerGroupAll(), c_anchorBottomLeft, ((lv_c_WIDTH+lv_c_BUFFER)*ModI((lv_index-1), 4)+lv_c_BUFFER+30), (30+((lv_index/5)*100)));
    }
    libNtve_gf_CreateDialogItemButton(DialogLastCreated(), 150, 50, c_anchorBottomRight, 20, 20, StringExternal("Param/Value/lib_Camp_6F3399DC"), StringExternal("Param/Value/lib_Camp_55E536B7"), "");
    libCamp_gv_tS_DebugProgressMissionLaunchCancel = DialogControlLastCreated();
    DialogSetVisible(libCamp_gv_tS_DebugProgressDialog, PlayerGroupAll(), false);
    DialogSetVisible(libCamp_gv_tS_DebugProgressMissionLaunchDialog, PlayerGroupAll(), true);
    TriggerEnable(libCamp_gt_TS_DebugProgressLaunchMission, true);
}

int libCamp_gf_TS_DebugBuyTechNumberOfUnitsUnlocked () {
    int auto8B8005B5_ae;
    int auto8B8005B5_ai;

    // Variable Declarations
    int lv_techSubgroupIndex;
    int lv_count;

    // Variable Initialization

    // Implementation
    lv_count = 0;
    auto8B8005B5_ae = libCamp_gv_TSC_TECHCATEGORY_LAST;
    auto8B8005B5_ai = 1;
    lv_techSubgroupIndex = libCamp_gv_TSC_TECHGROUP_FIRST;
    for ( ; ( (auto8B8005B5_ai >= 0 && lv_techSubgroupIndex <= auto8B8005B5_ae) || (auto8B8005B5_ai <= 0 && lv_techSubgroupIndex >= auto8B8005B5_ae) ) ; lv_techSubgroupIndex += auto8B8005B5_ai ) {
        if ((libCamp_gv_tS_TechGroupState[lv_techSubgroupIndex] == c_purchaseCategoryStateEnabled)) {
            lv_count += 1;
        }
        else {
        }
    }
    return lv_count;
}

void libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl (int lp_type, int lp_anchor, int lp_offsetX, int lp_offsetY, int lp_width, int lp_height, text lp_label) {
    // Implementation
    DialogControlCreate(DialogLastCreated(), lp_type);
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), lp_width, lp_height);
    DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), lp_anchor, lp_offsetX, lp_offsetY);
    DialogControlSetPropertyAsText(DialogControlLastCreated(), c_triggerControlPropertyText, PlayerGroupAll(), lp_label);
}

void libCamp_gf_TS_DebugBuyTechCreateDialog () {
    // Implementation
    if ((libCamp_gv_tS_DebugBuyTechDialog != c_invalidDialogId)) {
        return ;
    }
    else {
    }
    libCamp_gv_tS_DebugBuyTechTotalCredits = (libCamp_gf_StoryCredits() + (libCamp_gf_CostofPurchasedTech() + libCamp_gf_CostofPurchasedMerc()));
    if ((libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 1) == true)) {
        libCamp_gf_TS_DebugBuyTechCreateDialogMission();
    }
    else if ((libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 2) == true)) {
        libCamp_gf_TS_DebugBuyTechCreateDialogStory();
    }
}

void libCamp_gf_TS_DebugBuyTechCreateDialogMission () {
    // Implementation
    DialogCreate(900, 600, c_anchorCenter, 0, 0, true);
    DialogSetPosition(DialogLastCreated(), c_anchorCenter, 0, 0);
    libCamp_gv_tS_DebugBuyTechDialog = DialogLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 250, 60, 500, 50, StringExternal("Param/Value/lib_Camp_B384F9B3"));
    libCamp_gv_tS_DebugBuyTechTitleUnitCredits = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorTopLeft, 50, 100, 200, 100, StringExternal("Param/Value/lib_Camp_64650F88"));
    libCamp_gv_tS_DebugBuyTechButtonUnitsUnlock = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorTopLeft, 250, 100, 200, 50, StringExternal("Param/Value/lib_Camp_FB867E9B"));
    libCamp_gv_tS_DebugBuyTechButtonUnitsUnlockAll = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorTopLeft, 250, 150, 200, 50, StringExternal("Param/Value/lib_Camp_041EA691"));
    libCamp_gv_tS_DebugBuyTechButtonUnitsReset = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 480, 105, 350, 30, StringExternal("Param/Value/lib_Camp_AB48D9DD"));
    libCamp_gv_tS_DebugBuyTechLabelUnitsUnlocked = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 480, 130, 350, 30, StringExternal("Param/Value/lib_Camp_FA895517"));
    libCamp_gv_tS_DebugBuyTechLabelCreditsEarned = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 480, 170, 350, 30, StringExternal("Param/Value/lib_Camp_B28AA2AB"));
    libCamp_gv_tS_DebugBuyTechLabelMissionNotUnlocked = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 480, 170, 350, 30, StringExternal("Param/Value/lib_Camp_3FF2D61A"));
    libCamp_gv_tS_DebugBuyTechLabelMissionExtraSelected = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 300, 260, 500, 50, StringExternal("Param/Value/lib_Camp_5573176B"));
    libCamp_gv_tS_DebugBuyTechTitleUpgrades = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorTopLeft, 50, 300, 200, 100, StringExternal("Param/Value/lib_Camp_4E464245"));
    libCamp_gv_tS_DebugBuyTechButtonUpgradeBuy = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorTopLeft, 250, 300, 200, 50, StringExternal("Param/Value/lib_Camp_939FFD8F"));
    libCamp_gv_tS_DebugBuyTechButtonUpgradeBuyAll = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorTopLeft, 250, 350, 200, 50, StringExternal("Param/Value/lib_Camp_552FDB1B"));
    libCamp_gv_tS_DebugBuyTechButtonUpgradeReset = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorTopLeft, 250, 400, 200, 50, StringExternal("Param/Value/lib_Camp_1DD0E0F5"));
    libCamp_gv_tS_DebugBuyTechButtonCreditsIncrease = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 480, 305, 350, 30, StringExternal("Param/Value/lib_Camp_A1E733DF"));
    libCamp_gv_tS_DebugBuyTechLabelUpgradeBought = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 480, 330, 350, 30, StringExternal("Param/Value/lib_Camp_2A7AC5BE"));
    libCamp_gv_tS_DebugBuyTechLabelCreditsSpent = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 480, 380, 350, 30, StringExternal("Param/Value/lib_Camp_4D8FC6AF"));
    libCamp_gv_tS_DebugBuyTechLabelUpgradeAvailable = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 480, 405, 350, 30, StringExternal("Param/Value/lib_Camp_E9DAA4D0"));
    libCamp_gv_tS_DebugBuyTechLabelCreditsAvailable = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorBottomRight, 40, 40, 350, 70, StringExternal("Param/Value/lib_Camp_B5560CD3"));
    libCamp_gv_tS_DebugBuyTechButtonSave = DialogControlLastCreated();
}

void libCamp_gf_TS_DebugBuyTechCreateDialogStory () {
    // Implementation
    DialogCreate(800, 400, c_anchorCenter, 0, 0, true);
    DialogSetPosition(DialogLastCreated(), c_anchorCenter, 0, 0);
    libCamp_gv_tS_DebugBuyTechDialog = DialogLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 300, 60, 500, 50, StringExternal("Param/Value/lib_Camp_B5287B7F"));
    libCamp_gv_tS_DebugBuyTechTitleUpgrades = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorTopLeft, 50, 100, 200, 100, StringExternal("Param/Value/lib_Camp_A9957943"));
    libCamp_gv_tS_DebugBuyTechButtonUpgradeBuy = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorTopLeft, 250, 100, 200, 50, StringExternal("Param/Value/lib_Camp_793E97CE"));
    libCamp_gv_tS_DebugBuyTechButtonUpgradeBuyAll = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorTopLeft, 250, 150, 200, 50, StringExternal("Param/Value/lib_Camp_8D19CE7A"));
    libCamp_gv_tS_DebugBuyTechButtonUpgradeReset = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorTopLeft, 270, 200, 180, 50, StringExternal("Param/Value/lib_Camp_BFA2748F"));
    libCamp_gv_tS_DebugBuyTechButtonCreditsIncrease = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 480, 105, 350, 30, StringExternal("Param/Value/lib_Camp_2CF89A50"));
    libCamp_gv_tS_DebugBuyTechLabelUpgradeBought = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 480, 130, 350, 30, StringExternal("Param/Value/lib_Camp_67B1B353"));
    libCamp_gv_tS_DebugBuyTechLabelCreditsSpent = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 480, 180, 350, 30, StringExternal("Param/Value/lib_Camp_082B7F1F"));
    libCamp_gv_tS_DebugBuyTechLabelUpgradeAvailable = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeLabel, c_anchorTopLeft, 480, 205, 350, 30, StringExternal("Param/Value/lib_Camp_61D57DFB"));
    libCamp_gv_tS_DebugBuyTechLabelCreditsAvailable = DialogControlLastCreated();
    libCamp_gf_TS_DebugBuyTechAddPositionedDialogControl(c_triggerControlTypeButton, c_anchorBottomRight, 40, 40, 350, 70, StringExternal("Param/Value/lib_Camp_C54F5C50"));
    libCamp_gv_tS_DebugBuyTechButtonSave = DialogControlLastCreated();
}

void libCamp_gf_TS_DebugBuyTechUpdateCredits () {
    // Variable Declarations
    int lv_creditsAvailable;
    int lv_creditsSpent;

    // Variable Initialization

    // Implementation
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_4D11FCE3") + IntToText(libCamp_gf_CostofPurchasedTech())), false);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_B5F18FFA") + IntToText(libCamp_gf_CostofPurchasedMerc())), false);
    lv_creditsSpent = (libCamp_gf_CostofPurchasedTech() + libCamp_gf_CostofPurchasedMerc());
    lv_creditsAvailable = (libCamp_gv_tS_DebugBuyTechTotalCredits - lv_creditsSpent);
    libCamp_gf_SetStoryCredits(lv_creditsAvailable);
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugBuyTechLabelUnitsUnlocked, c_triggerControlPropertyText, PlayerGroupAll(), (StringExternal("Param/Value/lib_Camp_87D0B175") + IntToText(libCamp_gf_TS_DebugBuyTechNumberOfUnitsUnlocked()) + StringExternal("Param/Value/lib_Camp_26A45FC8")));
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugBuyTechLabelCreditsEarned, c_triggerControlPropertyText, PlayerGroupAll(), (StringExternal("Param/Value/lib_Camp_7F0C387C") + libCamp_gf_FormatCredits(libCamp_gv_tS_DebugBuyTechTotalCredits, false) + StringExternal("Param/Value/lib_Camp_46AC1DC8")));
    DialogControlSetVisible(libCamp_gv_tS_DebugBuyTechLabelMissionNotUnlocked, PlayerGroupAll(), false);
    DialogControlSetVisible(libCamp_gv_tS_DebugBuyTechLabelMissionExtraSelected, PlayerGroupAll(), false);
    if ((libCamp_gf_MissionStatusCheck(libCamp_gv_tS_CurrentMap, 0) == true)) {
        DialogControlSetVisible(libCamp_gv_tS_DebugBuyTechLabelMissionNotUnlocked, PlayerGroupAll(), true);
    }
    else {
    }
    if ((libCamp_gf_MissionStatusCheck(libCamp_gv_tS_CurrentMap, 2) == true)) {
        DialogControlSetVisible(libCamp_gv_tS_DebugBuyTechLabelMissionExtraSelected, PlayerGroupAll(), true);
    }
    else {
    }
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugBuyTechLabelUpgradeBought, c_triggerControlPropertyText, PlayerGroupAll(), (StringExternal("Param/Value/lib_Camp_596DCEBD") + IntToText(libCamp_gf_NumberofPurchasedTech()) + StringExternal("Param/Value/lib_Camp_C05FB34B")));
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugBuyTechLabelCreditsSpent, c_triggerControlPropertyText, PlayerGroupAll(), (StringExternal("Param/Value/lib_Camp_95FB1DC9") + libCamp_gf_FormatCredits(lv_creditsSpent, false) + StringExternal("Param/Value/lib_Camp_08E5D829")));
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugBuyTechLabelUpgradeAvailable, c_triggerControlPropertyText, PlayerGroupAll(), (StringExternal("Param/Value/lib_Camp_E601B257") + IntToText(libCamp_gf_NumberofAvailableTech()) + StringExternal("Param/Value/lib_Camp_F93E0AD5")));
    DialogControlSetPropertyAsText(libCamp_gv_tS_DebugBuyTechLabelCreditsAvailable, c_triggerControlPropertyText, PlayerGroupAll(), (StringExternal("Param/Value/lib_Camp_3E36B965") + libCamp_gf_FormatCredits(lv_creditsAvailable, false) + StringExternal("Param/Value/lib_Camp_03C54107")));
}

void libCamp_gf_TS_DebugBuyTechUnitsUnlockAll () {
    int autoEA756BD1_i;

    // Variable Declarations
    int lv_indexMission;

    // Variable Initialization

    // Implementation
    libCamp_gf_TS_DefaultTransitionVars(false, false, true, false);
    libCamp_gf_UpdateMissionFlow();
    libCamp_gv_tS_DebugBuyTechTotalCredits = 0;
    autoEA756BD1_i = libCamp_gv_TSC_MISSION_FIRST;
    while (autoEA756BD1_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[autoEA756BD1_i];
        libCamp_gf_TS_CompleteMission(lv_indexMission);
        libCamp_gv_tS_DebugBuyTechTotalCredits += libCamp_gf_MissionReward(lv_indexMission);
        autoEA756BD1_i = autoEA756BD1_i + 1;
    }
    libCamp_gf_TS_UpdateTechStates();
    libCamp_gf_TS_DebugBuyTechUpdateCredits();
    libCamp_gf_TS_DebugBuyTechSaveMissionBank(libCamp_gv_tS_CurrentMap);
    libCamp_gf_ApplyCampaignTech(1);
}

void libCamp_gf_TS_DebugBuyTechUnitsReset () {
    // Implementation
    libCamp_gf_TS_DefaultTransitionVars(false, false, true, false);
    libCamp_gf_UpdateMissionFlow();
    libCamp_gv_tS_DebugBuyTechTotalCredits = 0;
    libCamp_gf_TS_UpdateTechStates();
    libCamp_gf_TS_DebugBuyTechUpdateCredits();
    libCamp_gf_TS_DebugBuyTechSaveMissionBank(libCamp_gv_tS_CurrentMap);
    libCamp_gf_ApplyCampaignTech(1);
}

void libCamp_gf_TS_DebugBuyTechUpgradesBuyAll () {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    libCamp_gf_TS_BuyAllTech();
    libCamp_gf_TS_DebugBuyTechUpdateCredits();
    libCamp_gf_TS_DebugBuyTechSaveMissionBank(libCamp_gv_tS_CurrentMap);
    libCamp_gf_ApplyCampaignTech(1);
}

void libCamp_gf_TS_DebugBuyTechUpgradesReset () {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Implementation
    libCamp_gf_TS_ResetTechData();
    libCamp_gf_TS_DebugBuyTechUpdateCredits();
    libCamp_gf_TS_DebugBuyTechSaveMissionBank(libCamp_gv_tS_CurrentMap);
    libCamp_gf_ApplyCampaignTech(1);
}

void libCamp_gf_TS_DebugBuyTechSaveMissionBank (int lp_mission) {
    // Variable Declarations
    string lv_bankName;

    // Variable Initialization
    lv_bankName = "";

    // Implementation
    if ((lp_mission == 31)) {
        libCamp_gf_TS_SaveAllTransitionData(false, false, false);
        return ;
    }
    else {
    }
    if ((libCamp_gf_MapTypeCheck(lp_mission, 1) == false)) {
        return ;
    }
    else {
    }
    lv_bankName = libCamp_gf_TS_MissionBankName(lp_mission);
    BankLoad(lv_bankName, 1);
    libCamp_gf_TS_SaveTransitionVars(BankLastCreated(), false, false, false, 1);
    libCamp_gf_TS_SaveTransitionVars(BankLastCreated(), false, false, false, 2);
    BankSave(BankLastCreated());
}

void libCamp_gf_TS_DebugBuyTechInitPurchasableShortcut () {
    // Implementation
    libCamp_gf_TS_DebugBuyTechInitPurchasableEarly();
    libCamp_gf_TS_DebugBuyTechInitPurchasableAverage();
    libCamp_gf_TS_DebugBuyTechInitPurchasableLate();
}

void libCamp_gf_TS_DebugBuyTechInitPurchasableEarly () {
    int autoF4A57F40_i;
    int auto9F46E8A4_i;
    int autoCB97E23C_ae;
    int autoCB97E23C_ai;

    // Variable Declarations
    int lv_indexMission;
    int lv_indexMerc;
    int lv_indexTech;
    int lv_indexString;
    string lv_secretString;

    // Variable Initialization
    lv_secretString = "";

    // Implementation
    lv_secretString = " ";
    lv_secretString = (lv_secretString + " ");
    lv_indexString = 0;
    autoF4A57F40_i = libCamp_gv_TSC_MISSION_FIRST;
    while (autoF4A57F40_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[autoF4A57F40_i];
        auto9F46E8A4_i = libCamp_gv_TSC_MERC_FIRST;
        while (auto9F46E8A4_i <= libCamp_gv_TSC_MERC_LAST) {
            lv_indexMerc = libCamp_gv_tS_MercID[auto9F46E8A4_i];
            lv_indexString += 1;
            libCamp_gv_tS_DebugBuyTechMercEarly[(lv_indexMission)][(lv_indexMerc)] = (StringSub(lv_secretString, lv_indexString, lv_indexString) == "1");
            auto9F46E8A4_i = auto9F46E8A4_i + 1;
        }
        autoCB97E23C_ae = libCamp_gv_TSC_TECH_LAST;
        autoCB97E23C_ai = 1;
        lv_indexTech = libCamp_gv_TSC_TECH_FIRST;
        for ( ; ( (autoCB97E23C_ai >= 0 && lv_indexTech <= autoCB97E23C_ae) || (autoCB97E23C_ai <= 0 && lv_indexTech >= autoCB97E23C_ae) ) ; lv_indexTech += autoCB97E23C_ai ) {
            lv_indexString += 1;
            libCamp_gv_tS_DebugBuyTechPurchasableEarly[(lv_indexMission)][lv_indexTech] = (StringSub(lv_secretString, lv_indexString, lv_indexString) == "1");
        }
        autoF4A57F40_i = autoF4A57F40_i + 1;
    }
}

void libCamp_gf_TS_DebugBuyTechInitPurchasableAverage () {
    int auto69EA1826_i;
    int auto4B4AE7FD_i;
    int autoC3EB3099_ae;
    int autoC3EB3099_ai;

    // Variable Declarations
    int lv_indexMission;
    int lv_indexMerc;
    int lv_indexTech;
    int lv_indexString;
    string lv_secretString;

    // Variable Initialization
    lv_secretString = "";

    // Implementation
    lv_secretString = " ";
    lv_secretString = (lv_secretString + " ");
    lv_indexString = 0;
    auto69EA1826_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto69EA1826_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto69EA1826_i];
        auto4B4AE7FD_i = libCamp_gv_TSC_MERC_FIRST;
        while (auto4B4AE7FD_i <= libCamp_gv_TSC_MERC_LAST) {
            lv_indexMerc = libCamp_gv_tS_MercID[auto4B4AE7FD_i];
            lv_indexString += 1;
            libCamp_gv_tS_DebugBuyTechMercAverage[(lv_indexMission)][(lv_indexMerc)] = (StringSub(lv_secretString, lv_indexString, lv_indexString) == "1");
            auto4B4AE7FD_i = auto4B4AE7FD_i + 1;
        }
        autoC3EB3099_ae = libCamp_gv_TSC_TECH_LAST;
        autoC3EB3099_ai = 1;
        lv_indexTech = libCamp_gv_TSC_TECH_FIRST;
        for ( ; ( (autoC3EB3099_ai >= 0 && lv_indexTech <= autoC3EB3099_ae) || (autoC3EB3099_ai <= 0 && lv_indexTech >= autoC3EB3099_ae) ) ; lv_indexTech += autoC3EB3099_ai ) {
            lv_indexString += 1;
            libCamp_gv_tS_DebugBuyTechPurchasableAverage[(lv_indexMission)][lv_indexTech] = (StringSub(lv_secretString, lv_indexString, lv_indexString) == "1");
        }
        auto69EA1826_i = auto69EA1826_i + 1;
    }
}

void libCamp_gf_TS_DebugBuyTechInitPurchasableLate () {
    int auto722F357B_i;
    int auto3A9D14E8_i;
    int auto081AA389_ae;
    int auto081AA389_ai;

    // Variable Declarations
    int lv_indexMission;
    int lv_indexMerc;
    int lv_indexTech;
    int lv_indexString;
    string lv_secretString;

    // Variable Initialization
    lv_secretString = "";

    // Implementation
    lv_secretString = " ";
    lv_secretString = (lv_secretString + " ");
    lv_indexString = 0;
    auto722F357B_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto722F357B_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto722F357B_i];
        auto3A9D14E8_i = libCamp_gv_TSC_MERC_FIRST;
        while (auto3A9D14E8_i <= libCamp_gv_TSC_MERC_LAST) {
            lv_indexMerc = libCamp_gv_tS_MercID[auto3A9D14E8_i];
            lv_indexString += 1;
            libCamp_gv_tS_DebugBuyTechMercLate[(lv_indexMission)][(lv_indexMerc)] = (StringSub(lv_secretString, lv_indexString, lv_indexString) == "1");
            auto3A9D14E8_i = auto3A9D14E8_i + 1;
        }
        auto081AA389_ae = libCamp_gv_TSC_TECH_LAST;
        auto081AA389_ai = 1;
        lv_indexTech = libCamp_gv_TSC_TECH_FIRST;
        for ( ; ( (auto081AA389_ai >= 0 && lv_indexTech <= auto081AA389_ae) || (auto081AA389_ai <= 0 && lv_indexTech >= auto081AA389_ae) ) ; lv_indexTech += auto081AA389_ai ) {
            lv_indexString += 1;
            libCamp_gv_tS_DebugBuyTechPurchasableLate[(lv_indexMission)][lv_indexTech] = (StringSub(lv_secretString, lv_indexString, lv_indexString) == "1");
        }
        auto722F357B_i = auto722F357B_i + 1;
    }
}

void libCamp_gf_TS_DebugBuyTechEarly () {
    int auto391CF171_i;

    // Variable Declarations
    int lv_index;
    int lv_indexMission;
    int lv_indexMerc;

    // Variable Initialization

    // Implementation
    libCamp_gf_TS_DefaultTransitionVars(false, false, true, false);
    libCamp_gf_UpdateMissionFlow();
    libCamp_gv_tS_DebugBuyTechTotalCredits = 0;
    auto391CF171_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto391CF171_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto391CF171_i];
        if ((libCamp_gv_tS_DebugProgressMissionPathEarly[(libCamp_gv_tS_CurrentMap)][(lv_indexMission)] == true)) {
            libCamp_gf_TS_CompleteMission(lv_indexMission);
            libCamp_gv_tS_DebugBuyTechTotalCredits += libCamp_gf_MissionReward(lv_indexMission);
        }
        else {
        }
        auto391CF171_i = auto391CF171_i + 1;
    }
    libCamp_gf_TS_UpdateTechStates();
    libCamp_gf_TS_DebugBuyTechUpdateCredits();
    libCamp_gf_TS_SaveAllTransitionData(false, false, false);
    libCamp_gf_ApplyCampaignTech(1);
}

void libCamp_gf_TS_DebugBuyTechAverage () {
    int auto13CE5715_i;

    // Variable Declarations
    int lv_index;
    int lv_indexMission;
    int lv_indexMerc;

    // Variable Initialization

    // Implementation
    libCamp_gf_TS_DefaultTransitionVars(false, false, true, false);
    libCamp_gf_UpdateMissionFlow();
    libCamp_gv_tS_DebugBuyTechTotalCredits = 0;
    auto13CE5715_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto13CE5715_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto13CE5715_i];
        if ((libCamp_gv_tS_DebugProgressMissionPathAverage[(libCamp_gv_tS_CurrentMap)][(lv_indexMission)] == true)) {
            libCamp_gf_TS_CompleteMission(lv_indexMission);
            libCamp_gv_tS_DebugBuyTechTotalCredits += libCamp_gf_MissionReward(lv_indexMission);
        }
        else {
        }
        auto13CE5715_i = auto13CE5715_i + 1;
    }
    libCamp_gf_TS_UpdateTechStates();
    libCamp_gf_TS_DebugBuyTechUpdateCredits();
    libCamp_gf_TS_SaveAllTransitionData(false, false, false);
    libCamp_gf_ApplyCampaignTech(1);
}

void libCamp_gf_TS_DebugBuyTechLate () {
    int auto74DB673A_i;

    // Variable Declarations
    int lv_index;
    int lv_indexMission;
    int lv_indexMerc;

    // Variable Initialization

    // Implementation
    libCamp_gf_TS_DefaultTransitionVars(false, false, true, false);
    libCamp_gf_UpdateMissionFlow();
    libCamp_gv_tS_DebugBuyTechTotalCredits = 0;
    auto74DB673A_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto74DB673A_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto74DB673A_i];
        if ((libCamp_gv_tS_DebugProgressMissionPathLate[(libCamp_gv_tS_CurrentMap)][(lv_indexMission)] == true)) {
            libCamp_gf_TS_CompleteMission(lv_indexMission);
            libCamp_gv_tS_DebugBuyTechTotalCredits += libCamp_gf_MissionReward(lv_indexMission);
        }
        else {
        }
        auto74DB673A_i = auto74DB673A_i + 1;
    }
    libCamp_gf_TS_UpdateTechStates();
    libCamp_gf_TS_DebugBuyTechUpdateCredits();
    libCamp_gf_TS_SaveAllTransitionData(false, false, false);
    libCamp_gf_ApplyCampaignTech(1);
}

void libCamp_gf_PurchaseStorymodeTech () {
    int autoAAC23FD3_val;

    // Implementation
    if ((GameIsTransitionMap() == true)) {
        return ;
    }
    else {
    }
    if (((libCamp_gv_tS_CurrentMap == 1) || (libCamp_gv_tS_CurrentMap == 2) || (libCamp_gv_tS_CurrentMap == 3) || (libCamp_gv_tS_CurrentMap == 22) || (libCamp_gv_tS_CurrentMap == 23) || (libCamp_gv_tS_CurrentMap == 24) || (libCamp_gv_tS_CurrentMap == 25))) {
        libCamp_gf_TS_DebugBuyTechAverage();
        TriggerExecute(libCamp_gv_tS_TechLimitsCallback, true, false);
        return ;
    }
    else {
    }
    autoAAC23FD3_val = libCamp_gv_tSX_DebugTechCheatOption;
    if (autoAAC23FD3_val == 1) {
        libCamp_gf_TS_DebugBuyTechEarly();
    }
    else if (autoAAC23FD3_val == 2) {
        libCamp_gf_TS_DebugBuyTechAverage();
    }
    else if (autoAAC23FD3_val == 3) {
        libCamp_gf_TS_DebugBuyTechLate();
    }
    else if (autoAAC23FD3_val == 4) {
        libCamp_gf_ApplyCampaignTech(1);
    }
    else {
        libCamp_gf_TS_DebugBuyTechAverage();
    }
    TriggerExecute(libCamp_gv_tS_TechLimitsCallback, true, false);
}

int libCamp_gf_TS_DebugConvertIntegerToTechCheatOption (int lp_option) {
    // Implementation
    return lp_option;
}

void libCamp_gf_TS_DebugSetTechCheatOption (int lp_option) {
    // Implementation
    libCamp_gv_tSX_DebugTechCheatOption = lp_option;
    libCamp_gf_TS_DebugUpdateTechCustomDialog();
}

void libCamp_gf_TS_DebugUpdateTechCustomDialog () {
    int auto03396B8F_val;

    // Implementation
    if ((libCamp_gv_tS_DebugTechCustomButton != c_invalidDialogControlId)) {
        auto03396B8F_val = libCamp_gv_tSX_DebugTechCheatOption;
        if (auto03396B8F_val == 1) {
            libNtve_gf_SetDialogItemText(libCamp_gv_tS_DebugTechCustomButton, StringExternal("Param/Value/lib_Camp_928A8863"), PlayerGroupAll());
        }
        else if (auto03396B8F_val == 2) {
            libNtve_gf_SetDialogItemText(libCamp_gv_tS_DebugTechCustomButton, StringExternal("Param/Value/lib_Camp_66A6F8CB"), PlayerGroupAll());
        }
        else if (auto03396B8F_val == 3) {
            libNtve_gf_SetDialogItemText(libCamp_gv_tS_DebugTechCustomButton, StringExternal("Param/Value/lib_Camp_3E978A0E"), PlayerGroupAll());
        }
        else {
            libNtve_gf_SetDialogItemText(libCamp_gv_tS_DebugTechCustomButton, StringExternal("Param/Value/lib_Camp_41D9C84B"), PlayerGroupAll());
        }
    }
    else {
    }
}

text libCamp_gf_TS_DebugBoolToText (bool lp_bool) {
    // Implementation
    if ((lp_bool == true)) {
        return StringExternal("Param/Value/lib_Camp_B74264BC");
    }
    else {
        return StringExternal("Param/Value/lib_Camp_F30C8360");
    }
}

void libCamp_gf_RegisterFootageRecording (trigger lp_callback) {
    // Implementation
    libCamp_gv_tS_FootageRecordingCallback = lp_callback;
    if ((GameIsTestMap(true) == true)) {
        libCamp_gf_TS_FootageRecording();
        ConsoleCommand("exit", true, true);
    }
    else {
    }
}

void libCamp_gf_TS_FootageRecording () {
    // Implementation
    if (((libCamp_gv_tS_FootageRecordingCallback == null) || (libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 1) == false))) {
        return ;
    }
    else {
    }
    TriggerExecute(libCamp_gv_tS_FootageRecordingCallback, true, true);
}

// Triggers
//--------------------------------------------------------------------------------------------------
// Trigger: _Zerg Drop Pod
//--------------------------------------------------------------------------------------------------
bool libCamp_gt__ZergDropPod_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gf__ZergDropPod(libCamp_gv__TP_DropPod_Location, libCamp_gv__TP_DropPod_Units);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt__ZergDropPod_Init () {
    libCamp_gt__ZergDropPod = TriggerCreate("libCamp_gt__ZergDropPod_Func");
    TriggerEnable(libCamp_gt__ZergDropPod, false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: _Terran Drop Pod
//--------------------------------------------------------------------------------------------------
bool libCamp_gt__TerranDropPod_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gf__TerranDropPod(libCamp_gv__TP_DropPod_Location, libCamp_gv__TP_DropPod_Units);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt__TerranDropPod_Init () {
    libCamp_gt__TerranDropPod = TriggerCreate("libCamp_gt__TerranDropPod_Func");
    TriggerEnable(libCamp_gt__TerranDropPod, false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_MissionVictoryCallbackBlockActionQueueOneMinute
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_MissionVictoryCallbackBlockActionQueueOneMinute_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    TriggerQueueEnter();
    libCamp_gv_tS_MissionVictoryActionQueyeEmpty = true;
    Wait(60.0, c_timeReal);
    TriggerQueueExit();
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_MissionVictoryCallbackBlockActionQueueOneMinute_Init () {
    libCamp_gt_TS_MissionVictoryCallbackBlockActionQueueOneMinute = TriggerCreate("libCamp_gt_TS_MissionVictoryCallbackBlockActionQueueOneMinute_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_MissionVictoryCallbackBlockActionQueue
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_MissionVictoryCallbackBlockActionQueue_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    TriggerQueueEnter();
    libCamp_gv_tS_MissionVictoryActionQueyeEmpty = true;
    while (true) {
        Wait(10.0, c_timeReal);
    }
    TriggerQueueExit();
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_MissionVictoryCallbackBlockActionQueue_Init () {
    libCamp_gt_TS_MissionVictoryCallbackBlockActionQueue = TriggerCreate("libCamp_gt_TS_MissionVictoryCallbackBlockActionQueue_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Abort Mission
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_AbortMission_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_gameOverType;

    // Variable Initialization
    lv_gameOverType = c_gameOverVictory;

    // Actions
    if (!runActions) {
        return true;
    }

    if ((libCamp_gv_tS_CurrentMap == 29) && (libCamp_gv_tSX_IsVictoryPlayAgain == true) && (libCamp_gv_tSX_IsSimulation == false)) {
        UISetWorldVisible(PlayerGroupAll(), false);
        libNtve_gf_HideGameUI(false, PlayerGroupAll());
        UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeBattleUI, true);
        UIClearMessages(PlayerGroupAll(), c_messageAreaAll);
        TransmissionClearAll();
        ConversationDataStop();
        SoundStopAllTriggerSounds(false);
        libCamp_gf_TS_CampaignVictory();
    }
    else {
        libCamp_gf_PrepareForStoryMode(c_gameOverDefeat, libCamp_gf_TS_CampaignDifficulty());
        GameOver(EventPlayer(), c_gameOverDefeat, false, false);
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_AbortMission_Init () {
    libCamp_gt_TS_AbortMission = TriggerCreate("libCamp_gt_TS_AbortMission_Func");
    TriggerAddEventAbortMission(libCamp_gt_TS_AbortMission, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: _CB_Chat Bubble Activated
//--------------------------------------------------------------------------------------------------
bool libCamp_gt__CB_ChatBubbleActivated_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gv__CB_TP_UNIT = EventUnit();
    libCamp_gv__CB_TP_PLAYER = EventPlayer();
    libCamp_gv__CB_TP_FORCED = false;
    TriggerExecute(libCamp_gt__CB_ActivateChatBubble, true, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt__CB_ChatBubbleActivated_Init () {
    libCamp_gt__CB_ChatBubbleActivated = TriggerCreate("libCamp_gt__CB_ChatBubbleActivated_Func");
    TriggerEnable(libCamp_gt__CB_ChatBubbleActivated, false);
    TriggerAddEventUnitSelected(libCamp_gt__CB_ChatBubbleActivated, null, c_playerAny, true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: _CB_Activate Chat Bubble
//--------------------------------------------------------------------------------------------------
bool libCamp_gt__CB_ActivateChatBubble_Func (bool testConds, bool runActions) {
    int auto441475D3_val;

    // Variable Declarations
    int lv_unitIndex;
    int lv_playerIndex;
    bool lv_forced;
    unitgroup lv_tempUnitGroup;
    unit lv_chatBubbleTarget;
    int lv_chatBubbleBackup;
    int lv_lineIndex;
    int lv_waitSoundID;
    fixed lv_waitDuration;

    // Variable Initialization
    lv_tempUnitGroup = UnitGroupEmpty();
    lv_chatBubbleBackup = c_textTagNone;

    // Actions
    if (!runActions) {
        return true;
    }

    lv_unitIndex = libCamp_gf__CB_Unit_GetIndex(libCamp_gv__CB_TP_UNIT);
    lv_playerIndex = libCamp_gv__CB_TP_PLAYER;
    lv_forced = libCamp_gv__CB_TP_FORCED;
    if ((lv_unitIndex <= 0)) {
        return true;
    }
    else {
    }
    if ((lv_playerIndex <= 0)) {
        return true;
    }
    else {
    }
    if (((libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_unitIndex][lv_playerIndex] <= 0) || (libCamp_gv__CB_Unit_LineCount[lv_unitIndex][lv_playerIndex] <= 0))) {
        return true;
    }
    else {
    }
    if ((lv_forced == false)) {
        if ((libCamp_gv__CB_Unit_ActivationPlayerGroup[lv_unitIndex] == null)) {
            return true;
        }
        else {
        }
        if ((PlayerGroupHasPlayer(libCamp_gv__CB_Unit_ActivationPlayerGroup[lv_unitIndex], lv_playerIndex) == false)) {
            return true;
        }
        else {
        }
    }
    else {
    }
    if ((libCamp_gv__CB_Unit_ActivationDistance[lv_unitIndex][lv_playerIndex] <= 0)) {
        lv_chatBubbleTarget = null;
    }
    else {
        lv_tempUnitGroup = UnitGroup(null, lv_playerIndex, RegionCircle(UnitGetPosition(libCamp_gv__CB_Unit[lv_unitIndex]), libCamp_gv__CB_Unit_ActivationDistance[lv_unitIndex][lv_playerIndex]), UnitFilter(0, 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile) | (1 << c_targetFilterDestructible) | (1 << c_targetFilterItem) | (1 << c_targetFilterUncommandable), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
        lv_chatBubbleTarget = libNtve_gf_ClosestUnitToPoint(UnitGetPosition(libCamp_gv__CB_Unit[lv_unitIndex]), lv_tempUnitGroup);
        if (((lv_forced == false) && (lv_chatBubbleTarget == null))) {
            return true;
        }
        else {
        }
    }
    libCamp_gf__CB_Current_Remove(lv_playerIndex);
    libCamp_gf__CB_Current_Create(lv_unitIndex, lv_playerIndex, lv_chatBubbleTarget);
    lv_chatBubbleBackup = libCamp_gv__CB_Current_ChatBubble[lv_playerIndex];
    lv_lineIndex = libCamp_gv__CB_UnitLine[libCamp_gf__CB_Unit_GetLineCurrentIndex(lv_unitIndex, lv_playerIndex)];
    if ((libCamp_gv__CB_Current_Sound[lv_playerIndex] == null)) {
        lv_waitDuration = 0.0;
        auto441475D3_val = libCamp_gv__CB_Line_DurationType[lv_lineIndex];
        if (auto441475D3_val == c_transmissionDurationAdd) {
            lv_waitDuration += libCamp_gv__CB_Line_Duration[lv_lineIndex];
        }
        else if (auto441475D3_val == c_transmissionDurationSet) {
            lv_waitDuration = libCamp_gv__CB_Line_Duration[lv_lineIndex];
        }
        else if (auto441475D3_val == c_transmissionDurationSub) {
            lv_waitDuration -= libCamp_gv__CB_Line_Duration[lv_lineIndex];
        }
        else {
        }
        lv_waitDuration = MaxF(lv_waitDuration, 0.0);
        Wait(lv_waitDuration, c_timeReal);
    }
    else {
        libCamp_gf__CB_StarWaitingSound(libCamp_gv__CB_Current_Sound[lv_playerIndex], libCamp_gv__CB_Line_Duration[lv_lineIndex], libCamp_gv__CB_Line_DurationType[lv_lineIndex]);
        lv_waitSoundID = libCamp_gf__CB_LastWaitSound();
        while (!((libCamp_gv__CB_WaitSoundDone[libCamp_gv__CB_WaitSoundID] == true))) {
            Wait(0.25, c_timeReal);
        }
    }
    if (((lv_unitIndex == libCamp_gv__CB_Current_UnitIndex[lv_playerIndex]) && (lv_chatBubbleBackup == libCamp_gv__CB_Current_ChatBubble[lv_playerIndex]))) {
        libCamp_gf__CB_Current_Remove(lv_playerIndex);
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt__CB_ActivateChatBubble_Init () {
    libCamp_gt__CB_ActivateChatBubble = TriggerCreate("libCamp_gt__CB_ActivateChatBubble_Func");
    TriggerEnable(libCamp_gt__CB_ActivateChatBubble, false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: _CB_Chat Bubble Unit Died
//--------------------------------------------------------------------------------------------------
bool libCamp_gt__CB_ChatBubbleUnitDied_Func (bool testConds, bool runActions) {
    int autoB41B135C_ae;
    int autoB41B135C_ai;

    // Variable Declarations
    int lv_unitIndex;
    int lv_playerIndex;

    // Variable Initialization

    // Actions
    if (!runActions) {
        return true;
    }

    lv_unitIndex = libCamp_gf__CB_Unit_GetIndex(EventUnit());
    if ((lv_unitIndex <= 0)) {
        return true;
    }
    else {
    }
    autoB41B135C_ae = libCamp_gv__CBC_PLAYERMAX;
    autoB41B135C_ai = 1;
    lv_playerIndex = 1;
    for ( ; ( (autoB41B135C_ai >= 0 && lv_playerIndex <= autoB41B135C_ae) || (autoB41B135C_ai <= 0 && lv_playerIndex >= autoB41B135C_ae) ) ; lv_playerIndex += autoB41B135C_ai ) {
        if ((libCamp_gv__CB_Current_UnitIndex[lv_playerIndex] == lv_unitIndex)) {
            libCamp_gf__CB_Current_Remove(lv_playerIndex);
        }
        else {
        }
        libCamp_gf_ClearAllChatBubbleLinesFromUnit(libCamp_gv__CB_Unit[lv_unitIndex], lv_playerIndex);
    }
    libCamp_gf__CB_Unit_RemoveByIndex(lv_unitIndex);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt__CB_ChatBubbleUnitDied_Init () {
    libCamp_gt__CB_ChatBubbleUnitDied = TriggerCreate("libCamp_gt__CB_ChatBubbleUnitDied_Func");
    TriggerEnable(libCamp_gt__CB_ChatBubbleUnitDied, false);
    TriggerAddEventUnitDied(libCamp_gt__CB_ChatBubbleUnitDied, null);
}

//--------------------------------------------------------------------------------------------------
// Trigger: _CB_ShowChatBubbleOnUnit
//--------------------------------------------------------------------------------------------------
bool libCamp_gt__CB_ShowChatBubbleOnUnit_Func (bool testConds, bool runActions) {
    int autoB23623D2_val;

    // Variable Declarations
    unit lv_p_Unit;
    int lv_p_Player;
    text lv_p_Text;
    soundlink lv_p_SoundLink;
    fixed lv_p_Duration;
    int lv_p_DurationType;
    int lv_p_TextTag;
    sound lv_sound;
    fixed lv_waitDuration;
    int lv_waitSoundID;

    // Variable Initialization
    lv_p_Text = StringExternal("Param/Value/lib_Camp_EEDAC34F");
    lv_p_SoundLink = SoundLink("EditorDefaultSound", -1);
    lv_p_DurationType = c_timerWindowNone;
    lv_p_TextTag = c_textTagNone;

    // Actions
    if (!runActions) {
        return true;
    }

    lv_p_Unit = libCamp_gv__CB_TP_UNIT;
    lv_p_Player = libCamp_gv__CB_TP_PLAYER;
    lv_p_Text = libCamp_gv__CB_TP_TEXT;
    lv_p_SoundLink = libCamp_gv__CB_TP_SOUNDLINK;
    lv_p_Duration = libCamp_gv__CB_TP_DURATION;
    lv_p_DurationType = libCamp_gv__CB_TP_DURATIONTYPE;
    lv_p_TextTag = libCamp_gv__CB_TP_TEXTTAG;
    TextTagAttachToUnit(lv_p_TextTag, lv_p_Unit, 2.5);
    TextTagSetAlignment(lv_p_TextTag, c_alignCenter, c_alignBottom);
    TextTagSetMaxSize(lv_p_TextTag, 25.0, 40.0);
    TextTagSetColor(lv_p_TextTag, c_textTagColorText, Color(0,0,0));
    TextTagSetTextShadow(lv_p_TextTag, false);
    TextTagSetTime(lv_p_TextTag, c_textTagTimeDuration, 360000.0);
    TextTagShowBackground(lv_p_TextTag, true);
    TextTagSetBackgroundBorderSize(lv_p_TextTag, 1.0, 1.0);
    TextTagSetColor(lv_p_TextTag, c_textTagColorBackground, Color(100,100,100));
    TextTagSetBackgroundImage(lv_p_TextTag, "Assets/Textures/border-tooltip-game.dds", true);
    TextTagShow(lv_p_TextTag, PlayerGroupSingle(lv_p_Player), true);
    if ((lv_p_SoundLink != null)) {
        SoundPlayOnUnit(lv_p_SoundLink, PlayerGroupSingle(lv_p_Player), lv_p_Unit, 0.0, 100.0, 0.0);
        lv_sound = SoundLastPlayed();
    }
    else {
        lv_waitDuration = 0.0;
        autoB23623D2_val = lv_p_DurationType;
        if (autoB23623D2_val == c_transmissionDurationAdd) {
            lv_waitDuration += lv_p_Duration;
        }
        else if (autoB23623D2_val == c_transmissionDurationSet) {
            lv_waitDuration = lv_p_Duration;
        }
        else if (autoB23623D2_val == c_transmissionDurationSub) {
            lv_waitDuration -= lv_p_Duration;
        }
        else {
        }
        lv_p_Duration = MaxF(lv_waitDuration, 0.0);
        lv_p_DurationType = c_transmissionDurationSet;
        lv_sound = null;
    }
    libCamp_gf__CB_StarWaitingSound(lv_sound, lv_p_Duration, lv_p_DurationType);
    lv_waitSoundID = libCamp_gf__CB_LastWaitSound();
    while (true) {
        if (((UnitIsAlive(lv_p_Unit) == false) || (libCamp_gv__CB_WaitSoundDone[lv_waitSoundID] == true))) {
            TextTagDestroy(lv_p_TextTag);
            SoundStop(lv_sound, false);
            break;
        }
        else {
        }
        Wait(0.25, c_timeReal);
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt__CB_ShowChatBubbleOnUnit_Init () {
    libCamp_gt__CB_ShowChatBubbleOnUnit = TriggerCreate("libCamp_gt__CB_ShowChatBubbleOnUnit_Func");
    TriggerEnable(libCamp_gt__CB_ShowChatBubbleOnUnit, false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: chat bubble debug
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_chatbubbledebug_Func (bool testConds, bool runActions) {
    int autoA127B73E_ae;
    int autoA127B73E_ai;

    // Variable Declarations
    unit lv_selectedUnit;
    int lv_unitIndex;
    int lv_index;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    lv_selectedUnit = UnitGroupUnit(UnitGroupSelected(1), 1);
    if ((lv_selectedUnit == null)) {
        return true;
    }
    else {
    }
    lv_unitIndex = libCamp_gf__CB_Unit_GetIndex(lv_selectedUnit);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_B3A6196F") + IntToText(lv_unitIndex)), true);
    if ((lv_unitIndex <= 0)) {
        return true;
    }
    else {
    }
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_98835FF7") + IntToText(libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_unitIndex][1])), true);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_2F4EA627") + IntToText(libCamp_gv__CB_Unit_LineCount[lv_unitIndex][1])), true);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_14718A43") + IntToText(libCamp_gv__CB_Unit_LineCurrent[lv_unitIndex][1])), true);
    if ((libCamp_gv__CB_Unit_LineCount[lv_unitIndex][1] > 0)) {
        autoA127B73E_ae = libCamp_gv__CB_Unit_LineCount[lv_unitIndex][1];
        autoA127B73E_ai = 1;
        lv_index = 1;
        for ( ; ( (autoA127B73E_ai >= 0 && lv_index <= autoA127B73E_ae) || (autoA127B73E_ai <= 0 && lv_index >= autoA127B73E_ae) ) ; lv_index += autoA127B73E_ai ) {
            TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_E9983B8B") + IntToText(lv_index) + StringExternal("Param/Value/lib_Camp_4D40FB0A") + libCamp_gv__CB_Line[libCamp_gv__CB_UnitLine[((libCamp_gv__CB_Unit_UnitLine_StartIndex[lv_unitIndex][1] + lv_index) - 1)]]), true);
        }
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_chatbubbledebug_Init () {
    libCamp_gt_chatbubbledebug = TriggerCreate("libCamp_gt_chatbubbledebug_Func");
    TriggerAddEventChatMessage(libCamp_gt_chatbubbledebug, 1, "-cb", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: _CB_WaitForSound
//--------------------------------------------------------------------------------------------------
bool libCamp_gt__CB_WaitForSound_Func (bool testConds, bool runActions) {
    int autoAB1FD6CC_val;

    // Variable Declarations
    sound lv_p_Sound;
    fixed lv_p_Duration;
    int lv_p_DurationType;
    int lv_p_WaitSoundID;

    // Variable Initialization
    lv_p_DurationType = c_timerWindowNone;

    // Actions
    if (!runActions) {
        return true;
    }

    lv_p_Sound = libCamp_gv__CB_TP_WAITSOUND;
    lv_p_Duration = libCamp_gv__CB_TP_WAITSOUND_DURATION;
    lv_p_DurationType = libCamp_gv__CB_TP_WAITSOUND_DURATIONTYPE;
    lv_p_WaitSoundID = libCamp_gv__CB_TP_WAITSOUND_ID;
    autoAB1FD6CC_val = lv_p_DurationType;
    if (autoAB1FD6CC_val == c_transmissionDurationAdd) {
        SoundWait(lv_p_Sound, 0.0, c_soundOffsetEnd);
        Wait(lv_p_Duration, c_timeReal);
    }
    else if (autoAB1FD6CC_val == c_transmissionDurationSet) {
        Wait(lv_p_Duration, c_timeReal);
    }
    else if (autoAB1FD6CC_val == c_transmissionDurationSub) {
        SoundWait(lv_p_Sound, lv_p_Duration, c_soundOffsetEnd);
    }
    else {
    }
    libCamp_gv__CB_WaitSoundDone[lv_p_WaitSoundID] = true;
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt__CB_WaitForSound_Init () {
    libCamp_gt__CB_WaitForSound = TriggerCreate("libCamp_gt__CB_WaitForSound_Func");
    TriggerEnable(libCamp_gt__CB_WaitForSound, false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: _MsgDlgButtonClicked
//--------------------------------------------------------------------------------------------------
bool libCamp_gt__MsgDlgButtonClicked_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((EventDialogControl() == libCamp_gv__MsgDlgButton))) {
            return false;
        }

        if (!((libCamp_gv__MsgDlgOpened == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    TriggerEnable(TriggerGetCurrent(), false);
    DialogSetVisible(libCamp_gv__MsgDlg, PlayerGroupAll(), false);
    libCamp_gv__MsgDlgOpened = false;
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt__MsgDlgButtonClicked_Init () {
    libCamp_gt__MsgDlgButtonClicked = TriggerCreate("libCamp_gt__MsgDlgButtonClicked_Func");
    TriggerEnable(libCamp_gt__MsgDlgButtonClicked, false);
    TriggerAddEventDialogControl(libCamp_gt__MsgDlgButtonClicked, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: ZS_CampaignTrialDialogQuitClicked
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_ZS_CampaignTrialDialogQuitClicked_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((EventDialogControl() == libCamp_gv_zS_CampaignTrialEndQuitButton))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gf_ZS_CloseCampaignTrialDialog();
    GameSetNextMap("");
    GameOver(1, c_gameOverVictory, false, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_ZS_CampaignTrialDialogQuitClicked_Init () {
    libCamp_gt_ZS_CampaignTrialDialogQuitClicked = TriggerCreate("libCamp_gt_ZS_CampaignTrialDialogQuitClicked_Func");
    TriggerEnable(libCamp_gt_ZS_CampaignTrialDialogQuitClicked, false);
    TriggerAddEventDialogControl(libCamp_gt_ZS_CampaignTrialDialogQuitClicked, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: ZS_CampaignTrialDialogUpgradeClicked
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_ZS_CampaignTrialDialogUpgradeClicked_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((EventDialogControl() == libCamp_gv_zS_CampaignTrialEndUpgradeButton))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    UILaunchNydusLink(PlayerGroupSingle(EventPlayer()), c_nydusLinkAccountTrialUpgrade);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_ZS_CampaignTrialDialogUpgradeClicked_Init () {
    libCamp_gt_ZS_CampaignTrialDialogUpgradeClicked = TriggerCreate("libCamp_gt_ZS_CampaignTrialDialogUpgradeClicked_Func");
    TriggerEnable(libCamp_gt_ZS_CampaignTrialDialogUpgradeClicked, false);
    TriggerAddEventDialogControl(libCamp_gt_ZS_CampaignTrialDialogUpgradeClicked, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_MercNewToAvailable
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_MercNewToAvailable_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((libCamp_gf_MercStatusCheck(libCamp_gv_tS_MercID[(MercenaryGetSelected(1))], 3) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gf_SetMercStatus(libCamp_gv_tS_MercID[(MercenaryGetSelected(1))], 1);
    MercenarySetState(MercenaryGetSelected(1), c_mercenaryStateEnabled);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_MercNewToAvailable_Init () {
    libCamp_gt_TS_MercNewToAvailable = TriggerCreate("libCamp_gt_TS_MercNewToAvailable_Func");
    TriggerAddEventMercenaryPanelSelectionChanged(libCamp_gt_TS_MercNewToAvailable, c_playerAny, c_invalidMercenaryId);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_MercUI - Purchase
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_MercUIPurchase_Func (bool testConds, bool runActions) {
    int auto2FC87EAD_i;
    int autoA5A32113_i;

    // Variable Declarations
    int lv_indexMerc;
    int lv_mercBought;

    // Variable Initialization

    // Actions
    if (!runActions) {
        return true;
    }

    lv_mercBought = 0;
    auto2FC87EAD_i = libCamp_gv_TSC_MERC_FIRST;
    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;
        }
        else {
        }
        auto2FC87EAD_i = auto2FC87EAD_i + 1;
    }
    if (((lv_mercBought == 0) || (libCamp_gf_MercCost(lv_mercBought) > libCamp_gf_StoryCredits()) || ((libCamp_gf_MercStatusCheck(lv_mercBought, 1) == false) && (libCamp_gf_MercStatusCheck(lv_mercBought, 3) == false)))) {
        return true;
    }
    else {
    }
    libCamp_gf_SetMercStatus(lv_mercBought, 2);
    libCamp_gf_SetStoryCredits((libCamp_gf_StoryCredits() - libCamp_gf_MercCost(lv_mercBought)));
    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");
    autoA5A32113_i = libCamp_gv_TSC_MERC_FIRST;
    while (autoA5A32113_i <= libCamp_gv_TSC_MERC_LAST) {
        lv_indexMerc = libCamp_gv_tS_MercID[autoA5A32113_i];
        if ((libCamp_gf_MercCost(lv_indexMerc) > libCamp_gf_StoryCredits()) && ((libCamp_gf_MercStatusCheck(lv_indexMerc, 1) == true) || (libCamp_gf_MercStatusCheck(lv_indexMerc, 3) == true))) {
            MercenarySetImageFilePath(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], libCamp_gv_tS_MercNoCreditImage[(lv_indexMerc)]);
            MercenarySetModelLink(libCamp_gv_tS_MercUIMercenaries[(lv_indexMerc)], "Invisible");
        }
        else {
        }
        autoA5A32113_i = autoA5A32113_i + 1;
    }
    if ((libCamp_gf_MercStatusCheck(2, 2) == true)) {
        AchievementTermQuantitySet(1, "TStory01_6_DevilDogs", 1);
    }
    else {
        AchievementTermQuantitySet(1, "TStory01_6_DevilDogs", 0);
    }
    if ((libCamp_gf_MercStatusCheck(3, 2) == true)) {
        AchievementTermQuantitySet(1, "TStory01_6_HammerSecurities", 1);
    }
    else {
        AchievementTermQuantitySet(1, "TStory01_6_HammerSecurities", 0);
    }
    if ((libCamp_gf_MercStatusCheck(4, 2) == true)) {
        AchievementTermQuantitySet(1, "TStory01_6_SpartanCompany", 1);
    }
    else {
        AchievementTermQuantitySet(1, "TStory01_6_SpartanCompany", 0);
    }
    if ((libCamp_gf_MercStatusCheck(5, 2) == true)) {
        AchievementTermQuantitySet(1, "TStory01_6_SiegeBreakers", 1);
    }
    else {
        AchievementTermQuantitySet(1, "TStory01_6_SiegeBreakers", 0);
    }
    if ((libCamp_gf_MercStatusCheck(6, 2) == true)) {
        AchievementTermQuantitySet(1, "TStory01_6_HelsAngels", 1);
    }
    else {
        AchievementTermQuantitySet(1, "TStory01_6_HelsAngels", 0);
    }
    if ((libCamp_gf_MercStatusCheck(7, 2) == true)) {
        AchievementTermQuantitySet(1, "TStory01_6_DuskWings", 1);
    }
    else {
        AchievementTermQuantitySet(1, "TStory01_6_DuskWings", 0);
    }
    if ((libCamp_gf_MercStatusCheck(8, 2) == true)) {
        AchievementTermQuantitySet(1, "TStory01_6_DukesRevenge", 1);
    }
    else {
        AchievementTermQuantitySet(1, "TStory01_6_DukesRevenge", 0);
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_MercUIPurchase_Init () {
    libCamp_gt_TS_MercUIPurchase = TriggerCreate("libCamp_gt_TS_MercUIPurchase_Func");
    TriggerAddEventMercenaryPanelPurchase(libCamp_gt_TS_MercUIPurchase, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_MercUI - Exit
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_MercUIExit_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeMercenaryPanel, false);
    if ((libCamp_gv_tS_MercUIExitCallback != null)) {
        TriggerExecute(libCamp_gv_tS_MercUIExitCallback, true, false);
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_MercUIExit_Init () {
    libCamp_gt_TS_MercUIExit = TriggerCreate("libCamp_gt_TS_MercUIExit_Func");
    TriggerAddEventMercenaryPanelExit(libCamp_gt_TS_MercUIExit, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_BattleReportMissionReplay
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_BattleReportMissionReplay_Func (bool testConds, bool runActions) {
    int auto4356EC72_i;

    // Variable Declarations
    int lv_indexMission;
    int lv_mission;
    int lv_selectedReport;

    // Variable Initialization
    lv_selectedReport = c_invalidBattleReportId;

    // Conditions
    if (testConds) {
        if (!((UIFrameVisible(1, c_syncFrameTypeBattleReportPanel) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    lv_mission = 0;
    lv_selectedReport = BattleReportPanelGetSelectedBattleReport(1);
    auto4356EC72_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto4356EC72_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto4356EC72_i];
        if ((libCamp_gv_tS_BattleReportMissions[(lv_indexMission)] == lv_selectedReport)) {
            lv_mission = lv_indexMission;
            break;
        }
        else {
        }
        auto4356EC72_i = auto4356EC72_i + 1;
    }
    if ((lv_mission == 0)) {
        return true;
    }
    else {
    }
    libCamp_gf_TS_BattleReportHide();
    libCamp_gf_LaunchMission(lv_mission, true, EventBattleReportPanelDifficultySelected());
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_BattleReportMissionReplay_Init () {
    libCamp_gt_TS_BattleReportMissionReplay = TriggerCreate("libCamp_gt_TS_BattleReportMissionReplay_Func");
    TriggerAddEventBattleReportPanelPlayMission(libCamp_gt_TS_BattleReportMissionReplay, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_BattleReportSceneReplay
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_BattleReportSceneReplay_Func (bool testConds, bool runActions) {
    int autoD7610F0E_i;

    // Variable Declarations
    int lv_indexScene;
    int lv_scene;
    int lv_selectedReport;

    // Variable Initialization
    lv_selectedReport = c_invalidBattleReportId;

    // Conditions
    if (testConds) {
        if (!((TriggerIsEnabled(TriggerGetCurrent()) == true))) {
            return false;
        }

        if (!((UIFrameVisible(1, c_syncFrameTypeBattleReportPanel) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    lv_scene = 0;
    lv_selectedReport = BattleReportPanelGetSelectedBattleReport(1);
    autoD7610F0E_i = libCamp_gv_TSC_SCENE_FIRST;
    while (autoD7610F0E_i <= libCamp_gv_TSC_SCENE_LAST) {
        lv_indexScene = libCamp_gv_tS_SceneIDs[autoD7610F0E_i];
        if ((libCamp_gv_tS_BattleReportScenes[(lv_indexScene)] == lv_selectedReport)) {
            lv_scene = lv_indexScene;
            break;
        }
        else {
        }
        autoD7610F0E_i = autoD7610F0E_i + 1;
    }
    if ((lv_scene == 0)) {
        return true;
    }
    else {
    }
    TriggerEnable(TriggerGetCurrent(), false);
    libCamp_gf_TS_BattleReportHide();
    if ((libCamp_gf_TS_GameFullyDownloaded() == false) && (lv_scene != 20) && (lv_scene != 18) && (lv_scene != 21) && (lv_scene != 19)) {
        UIShowCustomDialog(PlayerGroupAll(), 0, StringExternal("Param/Value/lib_Camp_EE77B639"), StringExternal("Param/Value/lib_Camp_6FCAE647"), true);
    }
    else {
        TriggerExecute(libCamp_gv_tS_SceneCallback[(lv_scene)], true, true);
        TriggerExecute(libCamp_gv_tS_BattleReportSceneFinishCallback, true, true);
    }
    TriggerEnable(TriggerGetCurrent(), true);
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeBattleReportPanel, true);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_BattleReportSceneReplay_Init () {
    libCamp_gt_TS_BattleReportSceneReplay = TriggerCreate("libCamp_gt_TS_BattleReportSceneReplay_Func");
    TriggerAddEventBattleReportPanelPlayScene(libCamp_gt_TS_BattleReportSceneReplay, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_BattleReportPanelLeave
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_BattleReportPanelLeave_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((UIFrameVisible(1, c_syncFrameTypeBattleReportPanel) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gf_TS_BattleReportHide();
    if ((libCamp_gv_tS_BattleReportPanelLeaveCallback != null)) {
        TriggerExecute(libCamp_gv_tS_BattleReportPanelLeaveCallback, true, false);
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_BattleReportPanelLeave_Init () {
    libCamp_gt_TS_BattleReportPanelLeave = TriggerCreate("libCamp_gt_TS_BattleReportPanelLeave_Func");
    TriggerAddEventBattleReportPanelExit(libCamp_gt_TS_BattleReportPanelLeave, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_ResearchUI - Purchase
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_ResearchUIPurchase_Func (bool testConds, bool runActions) {
    int auto5C40636D_i;
    int autoECD5905D_val;

    // Variable Declarations
    int lv_researchID;
    int lv_purchasedCountZerg;
    int lv_purchasedCountProt;
    int lv_indexResearch;

    // Variable Initialization

    // Actions
    if (!runActions) {
        return true;
    }

    lv_researchID = libCamp_gf_TS_ResearchUIResearchID(ResearchItemGetSelected(1));
    if ((lv_researchID == 0)) {
        return true;
    }
    else {
    }
    ResearchItemPurchase(ResearchItemGetSelected(1));
    libCamp_gf_SetStoryResearchPurchased(lv_researchID);
    libCamp_gf_TS_ResearchUIUpdate();
    libCamp_gf_TS_AddRecentResearch(lv_researchID);
    lv_purchasedCountZerg = 0;
    lv_purchasedCountProt = 0;
    auto5C40636D_i = libCamp_gv_TSC_RESEARCH_FIRST;
    while (auto5C40636D_i <= libCamp_gv_TSC_RESEARCH_LAST) {
        lv_indexResearch = libCamp_gv_tS_ResearchID[auto5C40636D_i];
        if ((libCamp_gf_StoryResearchStateCheck(lv_indexResearch, 2) == true)) {
            autoECD5905D_val = libCamp_gf_StoryResearchCategory(lv_indexResearch);
            if (autoECD5905D_val == 2) {
                lv_purchasedCountZerg += 1;
                libCamp_gf_TS_ResearchUIClearZergConfirmationText();
            }
            else if (autoECD5905D_val == 1) {
                lv_purchasedCountProt += 1;
                libCamp_gf_TS_ResearchUIClearProtossConfirmationText();
            }
            else {
            }
        }
        else {
        }
        auto5C40636D_i = auto5C40636D_i + 1;
    }
    AchievementTermQuantitySet(1, "TStory01_8", lv_purchasedCountProt);
    AchievementTermQuantitySet(1, "TStory01_7", lv_purchasedCountZerg);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_ResearchUIPurchase_Init () {
    libCamp_gt_TS_ResearchUIPurchase = TriggerCreate("libCamp_gt_TS_ResearchUIPurchase_Func");
    TriggerAddEventResearchPanelPurchase(libCamp_gt_TS_ResearchUIPurchase, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_ResearchUI - Exit
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_ResearchUIExit_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((libCamp_gv_tS_ResearchUIExitEnabled == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeResearchPanel, false);
    if ((libCamp_gv_tS_ResearchUIExitCallback != null)) {
        TriggerExecute(libCamp_gv_tS_ResearchUIExitCallback, true, false);
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_ResearchUIExit_Init () {
    libCamp_gt_TS_ResearchUIExit = TriggerCreate("libCamp_gt_TS_ResearchUIExit_Func");
    TriggerAddEventResearchPanelExit(libCamp_gt_TS_ResearchUIExit, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_RoomChange Button Response
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_RoomChangeButtonResponse_Func (bool testConds, bool runActions) {
    int auto94FF7B16_ae;
    int auto94FF7B16_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Actions
    if (!runActions) {
        return true;
    }

    auto94FF7B16_ae = libCamp_gv_tS_RoomChangeButtonCount;
    auto94FF7B16_ai = 1;
    lv_index = 1;
    for ( ; ( (auto94FF7B16_ai >= 0 && lv_index <= auto94FF7B16_ae) || (auto94FF7B16_ai <= 0 && lv_index >= auto94FF7B16_ae) ) ; lv_index += auto94FF7B16_ai ) {
        if ((libCamp_gv_tS_RoomChangeButtons[lv_index] == EventDialogControl()) && (libCamp_gv_tS_RoomChangeButtonCallbackClick[lv_index] != null)) {
            libCamp_gv_tS_RoomChangeButtonCurrent = lv_index;
            TriggerExecute(libCamp_gv_tS_RoomChangeButtonCallbackClick[lv_index], true, false);
            return true;
        }
        else {
        }
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_RoomChangeButtonResponse_Init () {
    libCamp_gt_TS_RoomChangeButtonResponse = TriggerCreate("libCamp_gt_TS_RoomChangeButtonResponse_Func");
    TriggerAddEventDialogControl(libCamp_gt_TS_RoomChangeButtonResponse, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS Tech Console Exit
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TSTechConsoleExit_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypePurchasePanel, false);
    libCamp_gf_HideStoryUI(true, false);
    libCamp_gf_ApplyCampaignTech(1);
    TriggerExecute(libCamp_gv_tS_TechExitCallback, true, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TSTechConsoleExit_Init () {
    libCamp_gt_TSTechConsoleExit = TriggerCreate("libCamp_gt_TSTechConsoleExit_Func");
    TriggerAddEventPurchaseExit(libCamp_gt_TSTechConsoleExit, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS Tech Item Selected
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TSTechItemSelected_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_tech;
    int lv_groupID;

    // Variable Initialization
    lv_tech = 9;
    lv_groupID = 5;

    // Actions
    if (!runActions) {
        return true;
    }

    if ((libCamp_gf_TechPurchasableTechID(PurchaseGetSelectedPurchaseItem(1)) != 0)) {
        lv_tech = libCamp_gf_TechPurchasableTechID(PurchaseGetSelectedPurchaseItem(1));
        lv_groupID = (libCamp_gv_tS_Tech_GroupID[(lv_tech)]);
        PurchaseGroupSetState(libCamp_gv_tS_TechGroup_UI[lv_groupID], c_purchaseGroupStateEnabled);
        if ((libCamp_gv_tSX_Tech_Status[(lv_tech)] == 4)) {
            libCamp_gv_tSX_Tech_Status[(lv_tech)] = 1;
        }
        else {
        }
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TSTechItemSelected_Init () {
    libCamp_gt_TSTechItemSelected = TriggerCreate("libCamp_gt_TSTechItemSelected_Func");
    TriggerAddEventSelectedPurchaseItemChanged(libCamp_gt_TSTechItemSelected, 1, c_invalidPurchaseItemId);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS Tech Category Selected
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TSTechCategorySelected_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_tech;

    // Variable Initialization
    lv_tech = c_invalidPurchaseCategoryId;

    // Actions
    if (!runActions) {
        return true;
    }

    lv_tech = PurchaseGetSelectedPurchaseCategory(1);
    PurchaseCategorySetState(PurchaseGetSelectedPurchaseCategory(1), c_purchaseCategoryStateEnabled);
    PurchaseCategorySetNameText(libCamp_gv_tS_TechCategory_UI[(lv_tech)], (libCamp_gv_tS_TechCategoryName[(lv_tech)] + StringExternal("Param/Value/lib_Camp_869B9456")));
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TSTechCategorySelected_Init () {
    libCamp_gt_TSTechCategorySelected = TriggerCreate("libCamp_gt_TSTechCategorySelected_Func");
    TriggerAddEventSelectedPurchaseCategoryChanged(libCamp_gt_TSTechCategorySelected, c_playerAny, c_invalidPurchaseCategoryId);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS Tech Console Purchase
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TSTechConsolePurchase_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_tech;

    // Variable Initialization

    // Actions
    if (!runActions) {
        return true;
    }

    lv_tech = libCamp_gf_TechPurchasableTechID(EventPurchaseMade());
    if ((lv_tech != 0) && (libCamp_gf_StoryCredits() >= libCamp_gf_StoryTechCost(lv_tech)) && ((libCamp_gv_tSX_Tech_Status[(lv_tech)] == 1) || (libCamp_gv_tSX_Tech_Status[(lv_tech)] == 4))) {
        libCamp_gv_tSX_Tech_Status[(lv_tech)] = 2;
        libCamp_gf_SetStoryCredits((libCamp_gf_StoryCredits() - libCamp_gf_StoryTechCost(lv_tech)));
        PlayerModifyPropertyInt(1, c_playerPropCredits, c_playerPropOperSetTo, libCamp_gf_StoryCredits());
        libCamp_gf_TS_AddRecentTech(lv_tech);
        PurchaseItemPurchase(libCamp_gv_tS_Tech_UI[(lv_tech)]);
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_D1E7DDD8") + IntToText(libCamp_gf_TS_StoryTechPurchasedCountInCategory(2))), false);
        AchievementTermQuantitySet(1, "TStory01_1", libCamp_gf_TS_StoryTechPurchasedCountInCategory(2));
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_E40FD404") + IntToText(libCamp_gf_TS_StoryTechPurchasedCountInCategory(3))), false);
        AchievementTermQuantitySet(1, "TStory01_2", libCamp_gf_TS_StoryTechPurchasedCountInCategory(3));
        AchievementTermQuantitySet(1, "TStory01_3", libCamp_gf_TS_StoryTechPurchasedCountInCategory(4));
        AchievementTermQuantitySet(1, "TStory01_4", libCamp_gf_TS_StoryTechPurchasedCountInCategory(1));
        AchievementTermQuantitySet(1, "TStory01_5", libCamp_gf_TS_StoryTechPurchasedCountInCategory(5));
    }
    else {
    }
    libCamp_gf_TS_UpdateTechVisuals();
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TSTechConsolePurchase_Init () {
    libCamp_gt_TSTechConsolePurchase = TriggerCreate("libCamp_gt_TSTechConsolePurchase_Func");
    TriggerAddEventPurchaseMade(libCamp_gt_TSTechConsolePurchase, c_playerAny, c_invalidPurchaseItemId);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Tech_CalldownSupplyDepot
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_Tech_CalldownSupplyDepot_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    UnitSetState(EventUnit(), c_unitStateSelectable, true);
    UnitSetState(EventUnit(), c_unitStateTargetable, true);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_Tech_CalldownSupplyDepot_Init () {
    libCamp_gt_TS_Tech_CalldownSupplyDepot = TriggerCreate("libCamp_gt_TS_Tech_CalldownSupplyDepot_Func");
    TriggerAddEventUnitAbility(libCamp_gt_TS_Tech_CalldownSupplyDepot, null, AbilityCommand("DropToSupplyDepot", 0), c_abilMorphStageUnitEnd, false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Debug_StartPerformanceLogging
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_Debug_StartPerformanceLogging_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    Wait(0.0625, c_timeGame);
    PerfTestStart((StringExternal("Param/Value/lib_Camp_B157F6F4") + libCamp_gf_MissionNameInUpperCase(libCamp_gv_debug_MapIDForPerfTest)));
    TriggerExecute(libCamp_gt_DebugPerfTestGetFps, true, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_Debug_StartPerformanceLogging_Init () {
    libCamp_gt_Debug_StartPerformanceLogging = TriggerCreate("libCamp_gt_Debug_StartPerformanceLogging_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: Debug_Preloading
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_Debug_Preloading_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gf_TS_PrepareNextMissionPreloading(c_gameOverVictory);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_Debug_Preloading_Init () {
    libCamp_gt_Debug_Preloading = TriggerCreate("libCamp_gt_Debug_Preloading_Func");
    TriggerAddEventChatMessage(libCamp_gt_Debug_Preloading, 1, "-preload", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Loading Done
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_LoadingDone_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    BankReload(libCamp_gv_cP_Bank);
    BankWait(libCamp_gv_cP_Bank);
    if ((BankSectionExists(libCamp_gv_cP_Bank, ("CampaignCompleted")) == true)) {
        libCamp_gv_cPX_CampaignCompleted = BankValueGetAsFlag(libCamp_gv_cP_Bank, ("CampaignCompleted"), "1");
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_LoadingDone_Init () {
    libCamp_gt_LoadingDone = TriggerCreate("libCamp_gt_LoadingDone_Func");
    TriggerAddEventLoadGameDone(libCamp_gt_LoadingDone);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_VSScreenContinue
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_VSScreenContinue_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    if ((libCamp_gf_ZS_TrialEnd() == true)) {
        UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeVictoryPanel, false);
        libCamp_gf_ZS_DisplayCampaignTrialDialog(true);
        return true;
    }
    else {
    }
    if ((libCamp_gv_tS_CurrentMap != 29)) {
        GameOver(1, c_gameOverVictory, false, false);
        return true;
    }
    else {
    }
    libCamp_gf_TS_CampaignVictory();
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_VSScreenContinue_Init () {
    libCamp_gt_TS_VSScreenContinue = TriggerCreate("libCamp_gt_TS_VSScreenContinue_Func");
    TriggerAddEventVictoryPanelExit(libCamp_gt_TS_VSScreenContinue, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_VSScreenPlayAgain
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_VSScreenPlayAgain_Func (bool testConds, bool runActions) {
    int auto42AB9A4D_val;

    // Variable Declarations
    bool lv_simulation;

    // Variable Initialization
    lv_simulation = true;

    // Actions
    if (!runActions) {
        return true;
    }

    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeVictoryPanel, false);
    if ((libCamp_gv_tSX_IsSimulation == true)) {
        lv_simulation = true;
    }
    else {
        lv_simulation = false;
    }
    auto42AB9A4D_val = EventVictoryPanelDifficultySelected();
    if (auto42AB9A4D_val == 4) {
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_DB6C2DA0") + StringExternal("Param/Value/lib_Camp_F6339396")), false);
    }
    else if (auto42AB9A4D_val == 3) {
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_1BDA09D1") + StringExternal("Param/Value/lib_Camp_986C743A")), false);
    }
    else if (auto42AB9A4D_val == 2) {
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_6A5CFFA7") + StringExternal("Param/Value/lib_Camp_DF18FDC2")), false);
    }
    else if (auto42AB9A4D_val == 1) {
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_ADAF62FC") + StringExternal("Param/Value/lib_Camp_C4B09664")), false);
    }
    else {
        TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_47326528") + StringExternal("Param/Value/lib_Camp_DFF24D64")), false);
    }
    libCamp_gf_PrepareForMission(libCamp_gv_tS_CurrentMap, lv_simulation, true, EventVictoryPanelDifficultySelected());
    GameOver(1, c_gameOverVictory, false, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_VSScreenPlayAgain_Init () {
    libCamp_gt_TS_VSScreenPlayAgain = TriggerCreate("libCamp_gt_TS_VSScreenPlayAgain_Func");
    TriggerAddEventVictoryPanelPlayMissionAgain(libCamp_gt_TS_VSScreenPlayAgain, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_EndCinematic
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_EndCinematic_Func (bool testConds, bool runActions) {
    // Variable Declarations
    transmissionsource lv_movieSource;

    // Variable Initialization
    lv_movieSource = TransmissionSource();

    // Actions
    if (!runActions) {
        return true;
    }

    TriggerSkippableBegin(PlayerGroupAll(), 0, null, true, false);
    lv_movieSource = TransmissionSourceFromMovie("Assets\\Textures\\cinematic_end.ogv", true);
    TransmissionSourceSetPauseAllowed(lv_movieSource, true);
    TransmissionSourceSetStreamingAllowed(lv_movieSource, true);
    TransmissionSend(PlayerGroupAll(), lv_movieSource, libNtve_gf_FullscreenPortrait(), "", null, null, null, 0.0, c_transmissionDurationAdd, false);
    TransmissionWait(TransmissionLastSent(), 2.5);
    libCamp_gv_tS_EndCinematicFinished = true;
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_EndCinematic_Init () {
    libCamp_gt_TS_EndCinematic = TriggerCreate("libCamp_gt_TS_EndCinematic_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_EndCredits
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_EndCredits_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    TriggerSkippableBegin(PlayerGroupAll(), 0, null, true, false);
    libCamp_gv_tS_EndCreditFinished = false;
    SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "Music_EndCreditsA2", c_soundtrackCueAny, c_soundtrackIndexAny, true);
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeCreditsPanel, true);
    TriggerEnable(libCamp_gt_TS_EndCreditsEnds, true);
    while (!((libCamp_gv_tS_EndCreditFinished == true))) {
        Wait(0.5, c_timeGame);
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_EndCredits_Init () {
    libCamp_gt_TS_EndCredits = TriggerCreate("libCamp_gt_TS_EndCredits_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_EndCreditsEnds
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_EndCreditsEnds_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gv_tS_EndCreditFinished = true;
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_EndCreditsEnds_Init () {
    libCamp_gt_TS_EndCreditsEnds = TriggerCreate("libCamp_gt_TS_EndCreditsEnds_Func");
    TriggerEnable(libCamp_gt_TS_EndCreditsEnds, false);
    TriggerAddEventGameCreditsFinished(libCamp_gt_TS_EndCreditsEnds, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_CheatUsed
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_CheatUsed_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == false))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gf_SetStoryState(1, 1);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_CheatUsed_Init () {
    libCamp_gt_TS_CheatUsed = TriggerCreate("libCamp_gt_TS_CheatUsed_Func");
    TriggerAddEventCheatUsed(libCamp_gt_TS_CheatUsed, c_playerAny, c_gameCheatAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_FlyingOutHouse
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_FlyingOutHouse_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    if ((libCamp_gf_StoryState(38) == 0)) {
        libCamp_gf_SetStoryState(38, 1);
        UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringExternal("Param/Value/lib_Camp_70578238"));
    }
    else {
        libCamp_gf_SetStoryState(38, 0);
        UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringExternal("Param/Value/lib_Camp_772C372A"));
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_FlyingOutHouse_Init () {
    libCamp_gt_TS_FlyingOutHouse = TriggerCreate("libCamp_gt_TS_FlyingOutHouse_Func");
    TriggerAddEventChatMessage(libCamp_gt_TS_FlyingOutHouse, c_playerAny, "OUTHOUSE", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_TerranUpTheNight
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_TerranUpTheNight_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((libCamp_gf_CurrentMap() != 31))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "EasterEggMusic_TerranUpTheNight", c_soundtrackCueAny, c_soundtrackIndexAny, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_TerranUpTheNight_Init () {
    libCamp_gt_TS_TerranUpTheNight = TriggerCreate("libCamp_gt_TS_TerranUpTheNight_Func");
    TriggerAddEventChatMessage(libCamp_gt_TS_TerranUpTheNight, c_playerAny, "OverEngineeredCodPiece", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Temp
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_Temp_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, (StringExternal("Param/Value/lib_Camp_10F3D464") + libNtve_gf_ConvertBooleanToText(libCamp_gf_MissionStatusCheck(11, 2))));
    UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, (StringExternal("Param/Value/lib_Camp_32E2A71E") + libNtve_gf_ConvertBooleanToText(libCamp_gf_MissionDifficultyCompleted(11, 2)) + StringExternal("Param/Value/lib_Camp_DF7D7CDC") + libNtve_gf_ConvertBooleanToText(libCamp_gf_MissionDifficultyCompleted(11, 3))));
    UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, (StringExternal("Param/Value/lib_Camp_2CB17DE1") + IntToText(libCamp_gf_MissionCompleteBestTime(11, 2)) + StringExternal("Param/Value/lib_Camp_5490B7E1") + IntToText(libCamp_gf_MissionCompleteBestTime(11, 3))));
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_Temp_Init () {
    libCamp_gt_TS_Temp = TriggerCreate("libCamp_gt_TS_Temp_Func");
    TriggerAddEventChatMessage(libCamp_gt_TS_Temp, c_playerAny, "-ts", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugProgress MissionButton
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugProgressMissionButton_Func (bool testConds, bool runActions) {
    int auto69BA44B8_i;

    // Variable Declarations
    int lv_indexMission;
    int lv_clickedMission;

    // Variable Initialization

    // Actions
    if (!runActions) {
        return true;
    }

    lv_clickedMission = 0;
    auto69BA44B8_i = libCamp_gv_TSC_MISSION_FIRST;
    while (auto69BA44B8_i <= libCamp_gv_TSC_MISSION_LAST) {
        lv_indexMission = libCamp_gv_tS_MapID[auto69BA44B8_i];
        if ((EventDialogControl() == libCamp_gv_tS_DebugProgressMissionButtons[(lv_indexMission)])) {
            lv_clickedMission = lv_indexMission;
        }
        else {
        }
        auto69BA44B8_i = auto69BA44B8_i + 1;
    }
    if ((lv_clickedMission == 0)) {
        return true;
    }
    else {
    }
    libCamp_gv_tS_DebugProgressLastMission = lv_clickedMission;
    libCamp_gf_TS_CompleteMission(libCamp_gv_tS_DebugProgressLastMission);
    libCamp_gf_TS_DebugProgressUpdateDialog();
    libCamp_gv_tS_DebugProgressLastCreditMission = libCamp_gv_tS_DebugProgressLastMission;
    libCamp_gf_SetStoryCredits((libCamp_gf_StoryCredits() + libCamp_gf_MissionReward(libCamp_gv_tS_DebugProgressLastCreditMission)));
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugProgressMissionButton_Init () {
    libCamp_gt_TS_DebugProgressMissionButton = TriggerCreate("libCamp_gt_TS_DebugProgressMissionButton_Func");
    TriggerAddEventDialogControl(libCamp_gt_TS_DebugProgressMissionButton, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugProgress UnlockSecretButton
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugProgressUnlockSecretButton_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((EventDialogControl() == libCamp_gv_tS_DebugProgressMissionButtonUnlockSecret))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gf_SetStoryState(27, 1);
    libCamp_gf_UpdateMissionFlow();
    libCamp_gf_TS_DebugProgressUpdateDialog();
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugProgressUnlockSecretButton_Init () {
    libCamp_gt_TS_DebugProgressUnlockSecretButton = TriggerCreate("libCamp_gt_TS_DebugProgressUnlockSecretButton_Func");
    TriggerAddEventDialogControl(libCamp_gt_TS_DebugProgressUnlockSecretButton, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugProgress Reset
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugProgressReset_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_index;
    int lv_achievementDisabledState;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((EventDialogControl() == libCamp_gv_tS_DebugProgressButtonReset))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gv_tS_DebugProgressResetUsed = true;
    libCamp_gv_tS_DebugProgressLastMission = 0;
    lv_achievementDisabledState = libCamp_gf_StoryState(1);
    libCamp_gf_TS_DefaultTransitionVars(true, true, true, true);
    libCamp_gf_SetStoryState(1, lv_achievementDisabledState);
    libCamp_gf_UpdateMissionFlow();
    libCamp_gf_TS_DebugProgressUpdateDialog();
    libCamp_gv_tS_DebugProgressLastCreditMission = 0;
    libCamp_gf_SetStoryCredits((0 - (libCamp_gf_CostofPurchasedTech() + libCamp_gf_CostofPurchasedMerc())));
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugProgressReset_Init () {
    libCamp_gt_TS_DebugProgressReset = TriggerCreate("libCamp_gt_TS_DebugProgressReset_Func");
    TriggerAddEventDialogControl(libCamp_gt_TS_DebugProgressReset, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugProgress Launch Mission
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugProgressLaunchMission_Func (bool testConds, bool runActions) {
    int autoF368A023_ae;
    int autoF368A023_ai;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    if ((EventDialogControl() == libCamp_gv_tS_DebugProgressMissionLaunchCancel)) {
        TriggerEnable(TriggerGetCurrent(), false);
        DialogDestroy(libCamp_gv_tS_DebugProgressMissionLaunchDialog);
        DialogSetVisible(libCamp_gv_tS_DebugProgressDialog, PlayerGroupAll(), true);
    }
    else {
    }
    autoF368A023_ae = 7;
    autoF368A023_ai = 1;
    lv_index = 1;
    for ( ; ( (autoF368A023_ai >= 0 && lv_index <= autoF368A023_ae) || (autoF368A023_ai <= 0 && lv_index >= autoF368A023_ae) ) ; lv_index += autoF368A023_ai ) {
        if ((libCamp_gv_tS_DebugProgressMissionOptions[lv_index] == 0)) {
            return true;
        }
        else {
        }
        if ((libCamp_gv_tS_DebugProgressMissionLaunchButtons[lv_index] == EventDialogControl())) {
            libCamp_gf_TS_SetLastSuccessfulMission(libCamp_gv_tS_DebugProgressLastMission);
            libCamp_gv_tS_DebugProgressCheating = true;
            libCamp_gv_tS_CurrentMap = 31;
            libCamp_gv_tS_DebugProgressLaunchingMission = true;
            libCamp_gf_PrepareForMission(libCamp_gv_tS_DebugProgressMissionOptions[lv_index], false, false, libCamp_gf_TS_CampaignDifficulty());
            GameOver(1, c_gameOverVictory, false, false);
        }
        else {
        }
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugProgressLaunchMission_Init () {
    libCamp_gt_TS_DebugProgressLaunchMission = TriggerCreate("libCamp_gt_TS_DebugProgressLaunchMission_Func");
    TriggerEnable(libCamp_gt_TS_DebugProgressLaunchMission, false);
    TriggerAddEventDialogControl(libCamp_gt_TS_DebugProgressLaunchMission, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugProgress Launch Mission Popup
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugProgressLaunchMissionPopup_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }

        if (!((EventDialogControl() == libCamp_gv_tS_DebugProgressButtonLaunchMission))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gf_TS_DebugProgressMissionDialogShow();
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugProgressLaunchMissionPopup_Init () {
    libCamp_gt_TS_DebugProgressLaunchMissionPopup = TriggerCreate("libCamp_gt_TS_DebugProgressLaunchMissionPopup_Func");
    TriggerEnable(libCamp_gt_TS_DebugProgressLaunchMissionPopup, false);
    TriggerAddEventDialogControl(libCamp_gt_TS_DebugProgressLaunchMissionPopup, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugProgress OK
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugProgressOK_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((EventDialogControl() == libCamp_gv_tS_DebugProgressButtonOK))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    DialogSetVisible(libCamp_gv_tS_DebugProgressDialog, PlayerGroupAll(), false);
    if ((libCamp_gv_tS_DebugProgressResetUsed == true)) {
        BankDeleteCampaignBanks(1, 0);
    }
    else {
    }
    libCamp_gv_tS_DebugProgressDialogOpened = false;
    UISetWorldVisible(PlayerGroupAll(), true);
    libCamp_gf_HideStoryUI(true, true);
    UISetCursorVisible(PlayerGroupAll(), false);
    if ((libCamp_gv_tS_DebugProgressExitCallbackOK != null)) {
        TriggerExecute(libCamp_gv_tS_DebugProgressExitCallbackOK, true, false);
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugProgressOK_Init () {
    libCamp_gt_TS_DebugProgressOK = TriggerCreate("libCamp_gt_TS_DebugProgressOK_Func");
    TriggerAddEventDialogControl(libCamp_gt_TS_DebugProgressOK, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugProgress Cancel
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugProgressCancel_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_indexMission;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((EventDialogControl() == libCamp_gv_tS_DebugProgressButtonCancel))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    DialogSetVisible(libCamp_gv_tS_DebugProgressDialog, PlayerGroupAll(), false);
    libCamp_gf_TS_DebugProgressRestoreStates();
    libCamp_gv_tS_DebugProgressDialogOpened = false;
    UISetWorldVisible(PlayerGroupAll(), true);
    libCamp_gf_HideStoryUI(true, true);
    GameCheatAllow(c_gameCheatProgress, true);
    GameCheatAllow(c_gameCheatTV, true);
    GameCheatAllow(c_gameCheatScene, true);
    UISetCursorVisible(PlayerGroupAll(), false);
    if ((libCamp_gv_tS_DebugProgressExitCallbackCancel != null)) {
        TriggerExecute(libCamp_gv_tS_DebugProgressExitCallbackCancel, true, false);
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugProgressCancel_Init () {
    libCamp_gt_TS_DebugProgressCancel = TriggerCreate("libCamp_gt_TS_DebugProgressCancel_Func");
    TriggerAddEventDialogControl(libCamp_gt_TS_DebugProgressCancel, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug PROGRESS
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugPROGRESS_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    GameCheatAllow(c_gameCheatProgress, false);
    GameCheatAllow(c_gameCheatTV, false);
    GameCheatAllow(c_gameCheatScene, false);
    libCamp_gv_tS_DebugProgressResetUsed = false;
    libCamp_gf_TS_DebugProgressDisplayDialog(0, libCamp_gt_TS_DebugProgressOKCallback, null);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugPROGRESS_Init () {
    libCamp_gt_TS_DebugPROGRESS = TriggerCreate("libCamp_gt_TS_DebugPROGRESS_Func");
    TriggerAddEventCheatUsed(libCamp_gt_TS_DebugPROGRESS, c_playerAny, c_gameCheatProgress);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug PROGRESS Develop
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugPROGRESSDevelop_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    TriggerExecute(libCamp_gt_TS_DebugPROGRESS, true, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugPROGRESSDevelop_Init () {
    libCamp_gt_TS_DebugPROGRESSDevelop = TriggerCreate("libCamp_gt_TS_DebugPROGRESSDevelop_Func");
    TriggerAddEventChatMessage(libCamp_gt_TS_DebugPROGRESSDevelop, c_playerAny, "PROGRESS", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugProgress OK Callback
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugProgressOKCallback_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    if ((libCamp_gv_tS_DebugProgressLastCreditMission != 0)) {
        libCamp_gf_SetStoryCredits((libCamp_gf_StoryCredits() - libCamp_gf_MissionReward(libCamp_gv_tS_DebugProgressLastCreditMission)));
    }
    else {
    }
    libCamp_gv_tS_DebugProgressCheating = true;
    libCamp_gv_tS_CurrentMap = libCamp_gv_tS_DebugProgressLastMission;
    libCamp_gf_PrepareForStoryMode(c_gameOverVictory, libCamp_gf_TS_CampaignDifficulty());
    GameOver(1, c_gameOverVictory, false, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugProgressOKCallback_Init () {
    libCamp_gt_TS_DebugProgressOKCallback = TriggerCreate("libCamp_gt_TS_DebugProgressOKCallback_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug Research Panel
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugResearchPanel_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    if ((UIFrameVisible(1, c_syncFrameTypeResearchPanel) == false)) {
        libNtve_gf_HideGameUI(false, PlayerGroupAll());
        UISetWorldVisible(PlayerGroupAll(), false);
        libCamp_gf_DisplayResearchPanel(libCamp_gt_TS_DebugResearchPanelExit);
    }
    else {
    }
    if ((libCamp_gv_tS_DebugResearchDialogProtoss == c_invalidDialogId)) {
        DialogCreate(400, 50, c_anchorTop, -500, 140, false);
        libCamp_gv_tS_DebugResearchDialogProtoss = DialogLastCreated();
        DialogSetImageVisible(DialogLastCreated(), false);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeImage);
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\white32.dds", PlayerGroupAll());
        libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), Color(0,0,0), PlayerGroupAll());
        libNtve_gf_SetDialogItemImageType2(DialogControlLastCreated(), true, PlayerGroupAll());
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 400, 50);
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, 0, 0);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
        libCamp_gv_tS_DebugResearchButtonProtossMinus = DialogControlLastCreated();
        libNtve_gf_SetDialogItemText(DialogControlLastCreated(), StringExternal("Param/Value/lib_Camp_F260CD9C"), PlayerGroupAll());
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 100, 50);
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normalpressed.dds", PlayerGroupAll());
        libNtve_gf_SetDialogItemImage2(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normaloverpressedover.dds", PlayerGroupAll());
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, 0, 0);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
        libCamp_gv_tS_DebugResearchButtonProtossReset = DialogControlLastCreated();
        libNtve_gf_SetDialogItemText(DialogControlLastCreated(), StringExternal("Param/Value/lib_Camp_6609B3BE"), PlayerGroupAll());
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 200, 50);
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normalpressed.dds", PlayerGroupAll());
        libNtve_gf_SetDialogItemImage2(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normaloverpressedover.dds", PlayerGroupAll());
        DialogControlSetPositionRelative(DialogControlLastCreated(), PlayerGroupAll(), c_anchorLeft, libCamp_gv_tS_DebugResearchButtonProtossMinus, c_anchorRight, 2, 0);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
        libCamp_gv_tS_DebugResearchButtonProtossPlus = DialogControlLastCreated();
        libNtve_gf_SetDialogItemText(DialogControlLastCreated(), StringExternal("Param/Value/lib_Camp_4C7B2591"), PlayerGroupAll());
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 100, 50);
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normalpressed.dds", PlayerGroupAll());
        libNtve_gf_SetDialogItemImage2(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normaloverpressedover.dds", PlayerGroupAll());
        DialogControlSetPositionRelative(DialogControlLastCreated(), PlayerGroupAll(), c_anchorLeft, libCamp_gv_tS_DebugResearchButtonProtossReset, c_anchorRight, 2, 0);
    }
    else {
    }
    if ((libCamp_gv_tS_DebugResearchDialogZerg == c_invalidDialogId)) {
        DialogCreate(400, 50, c_anchorTop, 500, 140, false);
        libCamp_gv_tS_DebugResearchDialogZerg = DialogLastCreated();
        DialogSetImageVisible(DialogLastCreated(), false);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeImage);
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\white32.dds", PlayerGroupAll());
        libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), Color(0,0,0), PlayerGroupAll());
        libNtve_gf_SetDialogItemImageType2(DialogControlLastCreated(), true, PlayerGroupAll());
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 400, 50);
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, 0, 0);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
        libCamp_gv_tS_DebugResearchButtonZergMinus = DialogControlLastCreated();
        libNtve_gf_SetDialogItemText(DialogControlLastCreated(), StringExternal("Param/Value/lib_Camp_85F6F7F5"), PlayerGroupAll());
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 100, 50);
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normalpressed.dds", PlayerGroupAll());
        libNtve_gf_SetDialogItemImage2(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normaloverpressedover.dds", PlayerGroupAll());
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorTopLeft, 0, 0);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
        libCamp_gv_tS_DebugResearchButtonZergReset = DialogControlLastCreated();
        libNtve_gf_SetDialogItemText(DialogControlLastCreated(), StringExternal("Param/Value/lib_Camp_AF461FBD"), PlayerGroupAll());
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 200, 50);
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normalpressed.dds", PlayerGroupAll());
        libNtve_gf_SetDialogItemImage2(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normaloverpressedover.dds", PlayerGroupAll());
        DialogControlSetPositionRelative(DialogControlLastCreated(), PlayerGroupAll(), c_anchorLeft, libCamp_gv_tS_DebugResearchButtonZergMinus, c_anchorRight, 2, 0);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
        libCamp_gv_tS_DebugResearchButtonZergPlus = DialogControlLastCreated();
        libNtve_gf_SetDialogItemText(DialogControlLastCreated(), StringExternal("Param/Value/lib_Camp_8417651E"), PlayerGroupAll());
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 100, 50);
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normalpressed.dds", PlayerGroupAll());
        libNtve_gf_SetDialogItemImage2(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normaloverpressedover.dds", PlayerGroupAll());
        DialogControlSetPositionRelative(DialogControlLastCreated(), PlayerGroupAll(), c_anchorLeft, libCamp_gv_tS_DebugResearchButtonZergReset, c_anchorRight, 2, 0);
    }
    else {
    }
    DialogSetVisible(libCamp_gv_tS_DebugResearchDialogProtoss, PlayerGroupAll(), true);
    DialogSetVisible(libCamp_gv_tS_DebugResearchDialogZerg, PlayerGroupAll(), true);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugResearchPanel_Init () {
    libCamp_gt_TS_DebugResearchPanel = TriggerCreate("libCamp_gt_TS_DebugResearchPanel_Func");
    TriggerAddEventChatMessage(libCamp_gt_TS_DebugResearchPanel, 1, "RESEARCHS", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug Research Panel Close Button Clicked
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugResearchPanelCloseButtonClicked_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    if ((libCamp_gv_tS_DebugResearchDialogProtoss != c_invalidDialogId)) {
        DialogSetVisible(libCamp_gv_tS_DebugResearchDialogProtoss, PlayerGroupAll(), false);
        DialogSetVisible(libCamp_gv_tS_DebugResearchDialogZerg, PlayerGroupAll(), false);
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugResearchPanelCloseButtonClicked_Init () {
    libCamp_gt_TS_DebugResearchPanelCloseButtonClicked = TriggerCreate("libCamp_gt_TS_DebugResearchPanelCloseButtonClicked_Func");
    TriggerAddEventResearchPanelExit(libCamp_gt_TS_DebugResearchPanelCloseButtonClicked, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug Research Panel Exit
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugResearchPanelExit_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    libNtve_gf_HideGameUI(true, PlayerGroupAll());
    UISetWorldVisible(PlayerGroupAll(), true);
    libCamp_gf_ApplyCampaignTech(1);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugResearchPanelExit_Init () {
    libCamp_gt_TS_DebugResearchPanelExit = TriggerCreate("libCamp_gt_TS_DebugResearchPanelExit_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug Research Panel Button Clicked
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugResearchPanelButtonClicked_Func (bool testConds, bool runActions) {
    int auto5BBED3FD_val;
    int auto772D70FF_i;
    int auto722B5253_i;

    // Variable Declarations
    int lv_indexResearch;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_6CEEBC62") + IntToText(libCamp_gv_tSX_DebugResearchLevel[(1)]) + StringExternal("Param/Value/lib_Camp_6B1A99D6") + IntToText(libCamp_gv_tSX_DebugResearchLevel[(2)])), false);
    auto5BBED3FD_val = EventDialogControl();
    if (auto5BBED3FD_val == libCamp_gv_tS_DebugResearchButtonProtossMinus) {
        libCamp_gv_tSX_DebugResearchLevel[(1)] = MaxI((libCamp_gv_tSX_DebugResearchLevel[(1)] - 1), -35);
    }
    else if (auto5BBED3FD_val == libCamp_gv_tS_DebugResearchButtonProtossReset) {
        libCamp_gv_tSX_DebugResearchLevel[(1)] = 0;
        auto772D70FF_i = libCamp_gv_TSC_RESEARCH_FIRST;
        while (auto772D70FF_i <= libCamp_gv_TSC_RESEARCH_LAST) {
            lv_indexResearch = libCamp_gv_tS_ResearchID[auto772D70FF_i];
            if ((libCamp_gf_StoryResearchCategory(lv_indexResearch) == 1)) {
                libCamp_gv_tSX_ResearchState[(lv_indexResearch)] = 1;
            }
            else {
            }
            auto772D70FF_i = auto772D70FF_i + 1;
        }
    }
    else if (auto5BBED3FD_val == libCamp_gv_tS_DebugResearchButtonProtossPlus) {
        libCamp_gv_tSX_DebugResearchLevel[(1)] = MinI((libCamp_gv_tSX_DebugResearchLevel[(1)] + 1), 35);
    }
    else if (auto5BBED3FD_val == libCamp_gv_tS_DebugResearchButtonZergMinus) {
        libCamp_gv_tSX_DebugResearchLevel[(2)] = MaxI((libCamp_gv_tSX_DebugResearchLevel[(2)] - 1), -35);
    }
    else if (auto5BBED3FD_val == libCamp_gv_tS_DebugResearchButtonZergReset) {
        libCamp_gv_tSX_DebugResearchLevel[(2)] = 0;
        auto722B5253_i = libCamp_gv_TSC_RESEARCH_FIRST;
        while (auto722B5253_i <= libCamp_gv_TSC_RESEARCH_LAST) {
            lv_indexResearch = libCamp_gv_tS_ResearchID[auto722B5253_i];
            if ((libCamp_gf_StoryResearchCategory(lv_indexResearch) == 2)) {
                libCamp_gv_tSX_ResearchState[(lv_indexResearch)] = 1;
            }
            else {
            }
            auto722B5253_i = auto722B5253_i + 1;
        }
    }
    else if (auto5BBED3FD_val == libCamp_gv_tS_DebugResearchButtonZergPlus) {
        libCamp_gv_tSX_DebugResearchLevel[(2)] = MinI((libCamp_gv_tSX_DebugResearchLevel[(2)] + 1), 35);
    }
    else {
        return true;
    }
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_52F95A57") + IntToText(libCamp_gv_tSX_DebugResearchLevel[(1)]) + StringExternal("Param/Value/lib_Camp_962BACEB") + IntToText(libCamp_gv_tSX_DebugResearchLevel[(2)])), false);
    libCamp_gf_TS_ResearchUIUpdate();
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugResearchPanelButtonClicked_Init () {
    libCamp_gt_TS_DebugResearchPanelButtonClicked = TriggerCreate("libCamp_gt_TS_DebugResearchPanelButtonClicked_Func");
    TriggerAddEventDialogControl(libCamp_gt_TS_DebugResearchPanelButtonClicked, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugResearchPoint
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugResearchPoint_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_oldValue;
    int lv_cat;

    // Variable Initialization
    lv_cat = 1;

    // Actions
    if (!runActions) {
        return true;
    }

    lv_cat = 1;
    libCamp_gv_tSX_DebugResearchLevel[(lv_cat)] = 0;
    libCamp_gv_tSX_DebugResearchLevel[(lv_cat)] = (libCamp_gf_StoryResearchPointCap(lv_cat) - libCamp_gf_StoryResearchPoints(lv_cat));
    lv_cat = 2;
    libCamp_gv_tSX_DebugResearchLevel[(lv_cat)] = 0;
    libCamp_gv_tSX_DebugResearchLevel[(lv_cat)] = (libCamp_gf_StoryResearchPointCap(lv_cat) - libCamp_gf_StoryResearchPoints(lv_cat));
    libCamp_gf_TS_ResearchUIUpdate();
    UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringExternal("Param/Value/lib_Camp_89D7C0D6"));
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugResearchPoint_Init () {
    libCamp_gt_TS_DebugResearchPoint = TriggerCreate("libCamp_gt_TS_DebugResearchPoint_Func");
    TriggerAddEventCheatUsed(libCamp_gt_TS_DebugResearchPoint, c_playerAny, c_gameCheatResearch);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug Mercenary Panel
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugMercenaryPanel_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    if ((UIFrameVisible(1, c_syncFrameTypeMercenaryPanel) == false)) {
        libNtve_gf_HideGameUI(false, PlayerGroupAll());
        UISetWorldVisible(PlayerGroupAll(), false);
        libCamp_gf_DisplayMercenaryPanel(libCamp_gt_TS_DebugMercenaryPanelExit);
    }
    else {
    }
    if ((libCamp_gv_tS_DebugMercenaryDialog == c_invalidDialogId)) {
        DialogCreate(400, 50, c_anchorBottomRight, 380, 100, false);
        libCamp_gv_tS_DebugMercenaryDialog = DialogLastCreated();
        DialogSetImageVisible(DialogLastCreated(), false);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
        libCamp_gv_tS_DebugMercenaryButtonCredits = DialogControlLastCreated();
        libNtve_gf_SetDialogItemText(DialogControlLastCreated(), StringExternal("Param/Value/lib_Camp_4DAD4AB1"), PlayerGroupAll());
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 200, 50);
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normalpressed.dds", PlayerGroupAll());
        libNtve_gf_SetDialogItemImage2(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normaloverpressedover.dds", PlayerGroupAll());
        DialogControlSetPosition(DialogControlLastCreated(), PlayerGroupAll(), c_anchorLeft, 0, 0);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
        libCamp_gv_tS_DebugMercenaryButtonReset = DialogControlLastCreated();
        libNtve_gf_SetDialogItemText(DialogControlLastCreated(), StringExternal("Param/Value/lib_Camp_5E4180C3"), PlayerGroupAll());
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 200, 50);
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normalpressed.dds", PlayerGroupAll());
        libNtve_gf_SetDialogItemImage2(DialogControlLastCreated(), "Assets\\Textures\\ui_techpurchase_techbutton_selected_normaloverpressedover.dds", PlayerGroupAll());
        DialogControlSetPositionRelative(DialogControlLastCreated(), PlayerGroupAll(), c_anchorLeft, libCamp_gv_tS_DebugMercenaryButtonCredits, c_anchorRight, 0, 0);
    }
    else {
    }
    DialogSetVisible(libCamp_gv_tS_DebugMercenaryDialog, PlayerGroupAll(), true);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugMercenaryPanel_Init () {
    libCamp_gt_TS_DebugMercenaryPanel = TriggerCreate("libCamp_gt_TS_DebugMercenaryPanel_Func");
    TriggerAddEventChatMessage(libCamp_gt_TS_DebugMercenaryPanel, 1, "MERCENARY", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug Mercenary Panel Close Button Clicked
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugMercenaryPanelCloseButtonClicked_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    if ((libCamp_gv_tS_DebugMercenaryDialog != c_invalidDialogId)) {
        DialogSetVisible(libCamp_gv_tS_DebugMercenaryDialog, PlayerGroupAll(), false);
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugMercenaryPanelCloseButtonClicked_Init () {
    libCamp_gt_TS_DebugMercenaryPanelCloseButtonClicked = TriggerCreate("libCamp_gt_TS_DebugMercenaryPanelCloseButtonClicked_Func");
    TriggerAddEventMercenaryPanelExit(libCamp_gt_TS_DebugMercenaryPanelCloseButtonClicked, c_playerAny);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug Mercenary Panel Exit
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugMercenaryPanelExit_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    libNtve_gf_HideGameUI(true, PlayerGroupAll());
    UISetWorldVisible(PlayerGroupAll(), true);
    libCamp_gf_TS_ApplyMercenaryTech(1);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugMercenaryPanelExit_Init () {
    libCamp_gt_TS_DebugMercenaryPanelExit = TriggerCreate("libCamp_gt_TS_DebugMercenaryPanelExit_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug Mercenary Panel Button Clicked
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugMercenaryPanelButtonClicked_Func (bool testConds, bool runActions) {
    int auto9FF9D173_val;
    int auto9A4B52FC_i;
    int auto1EF58E06_i;

    // Variable Declarations
    int lv_indexMerc;
    int lv_indexMission;
    int lv_credits;

    // Variable Initialization

    // Actions
    if (!runActions) {
        return true;
    }

    auto9FF9D173_val = EventDialogControl();
    if (auto9FF9D173_val == libCamp_gv_tS_DebugMercenaryButtonCredits) {
        libCamp_gf_SetStoryCredits((libCamp_gf_StoryCredits() + 1000000));
    }
    else if (auto9FF9D173_val == libCamp_gv_tS_DebugMercenaryButtonReset) {
        lv_credits = 0;
        auto9A4B52FC_i = libCamp_gv_TSC_MISSION_FIRST;
        while (auto9A4B52FC_i <= libCamp_gv_TSC_MISSION_LAST) {
            lv_indexMission = libCamp_gv_tS_MapID[auto9A4B52FC_i];
            if ((libCamp_gf_MissionStatusCheck(lv_indexMission, 2) == true)) {
                lv_credits += libCamp_gf_MissionReward(lv_indexMission);
            }
            else {
            }
            auto9A4B52FC_i = auto9A4B52FC_i + 1;
        }
        libCamp_gf_SetStoryCredits((lv_credits - libCamp_gf_CostofPurchasedTech()));
        auto1EF58E06_i = libCamp_gv_TSC_MERC_FIRST;
        while (auto1EF58E06_i <= libCamp_gv_TSC_MERC_LAST) {
            lv_indexMerc = libCamp_gv_tS_MercID[auto1EF58E06_i];
            libCamp_gf_SetMercStatus(lv_indexMerc, 0);
            auto1EF58E06_i = auto1EF58E06_i + 1;
        }
        libCamp_gf_TS_UpdateMercStatus();
    }
    else {
        return true;
    }
    libCamp_gf_TS_MercUIUpdateUI();
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugMercenaryPanelButtonClicked_Init () {
    libCamp_gt_TS_DebugMercenaryPanelButtonClicked = TriggerCreate("libCamp_gt_TS_DebugMercenaryPanelButtonClicked_Func");
    TriggerAddEventDialogControl(libCamp_gt_TS_DebugMercenaryPanelButtonClicked, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugBuyTech Button Clicked
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugBuyTechButtonClicked_Func (bool testConds, bool runActions) {
    int auto072E8CC2_val;

    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Actions
    if (!runActions) {
        return true;
    }

    auto072E8CC2_val = EventDialogControl();
    if (auto072E8CC2_val == libCamp_gv_tS_DebugBuyTechButtonUnitsUnlock) {
        libCamp_gf_TS_DebugSetTechCheatOption(4);
        DialogSetVisible(libCamp_gv_tS_DebugBuyTechDialog, PlayerGroupAll(), false);
        libCamp_gf_TS_DebugProgressDisplayDialog(libCamp_gv_tS_CurrentMap, libCamp_gt_TS_DebugBuyTechConsoleExit, libCamp_gt_TS_DebugBuyTechConsoleExit);
    }
    else if (auto072E8CC2_val == libCamp_gv_tS_DebugBuyTechButtonUnitsUnlockAll) {
        libCamp_gf_TS_DebugSetTechCheatOption(4);
        libCamp_gf_TS_DebugBuyTechUnitsUnlockAll();
    }
    else if (auto072E8CC2_val == libCamp_gv_tS_DebugBuyTechButtonUnitsReset) {
        libCamp_gf_TS_DebugSetTechCheatOption(4);
        libCamp_gf_TS_DebugBuyTechUnitsReset();
    }
    else if (auto072E8CC2_val == libCamp_gv_tS_DebugBuyTechButtonUpgradeBuy) {
        libCamp_gf_TS_DebugSetTechCheatOption(4);
        DialogSetVisible(libCamp_gv_tS_DebugBuyTechDialog, PlayerGroupAll(), false);
        libCamp_gf_DisplayTechConsole(libCamp_gt_TS_DebugBuyTechConsoleExit);
    }
    else if (auto072E8CC2_val == libCamp_gv_tS_DebugBuyTechButtonUpgradeBuyAll) {
        libCamp_gf_TS_DebugSetTechCheatOption(4);
        libCamp_gf_TS_DebugBuyTechUpgradesBuyAll();
    }
    else if (auto072E8CC2_val == libCamp_gv_tS_DebugBuyTechButtonUpgradeReset) {
        libCamp_gf_TS_DebugSetTechCheatOption(4);
        libCamp_gf_TS_DebugBuyTechUpgradesReset();
    }
    else if (auto072E8CC2_val == libCamp_gv_tS_DebugBuyTechButtonCreditsIncrease) {
        libCamp_gf_TS_DebugSetTechCheatOption(4);
        libCamp_gv_tS_DebugBuyTechTotalCredits += 100000000;
        libCamp_gf_TS_DebugBuyTechUpdateCredits();
    }
    else if (auto072E8CC2_val == libCamp_gv_tS_DebugBuyTechButtonEarly) {
        libCamp_gf_TS_DebugSetTechCheatOption(1);
        libCamp_gf_TS_DebugBuyTechEarly();
    }
    else if (auto072E8CC2_val == libCamp_gv_tS_DebugBuyTechButtonAverage) {
        libCamp_gf_TS_DebugSetTechCheatOption(2);
        libCamp_gf_TS_DebugBuyTechAverage();
    }
    else if (auto072E8CC2_val == libCamp_gv_tS_DebugBuyTechButtonLate) {
        libCamp_gf_TS_DebugSetTechCheatOption(3);
        libCamp_gf_TS_DebugBuyTechLate();
    }
    else if (auto072E8CC2_val == libCamp_gv_tS_DebugBuyTechButtonSave) {
        libCamp_gv_tS_DebugBuyTechActive = false;
    }
    else {
        return true;
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugBuyTechButtonClicked_Init () {
    libCamp_gt_TS_DebugBuyTechButtonClicked = TriggerCreate("libCamp_gt_TS_DebugBuyTechButtonClicked_Func");
    TriggerAddEventDialogControl(libCamp_gt_TS_DebugBuyTechButtonClicked, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugBuyTech Console Exit
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugBuyTechConsoleExit_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gv_tS_DebugBuyTechTotalCredits = (libCamp_gf_StoryCredits() + (libCamp_gf_CostofPurchasedTech() + libCamp_gf_CostofPurchasedMerc()));
    libCamp_gf_TS_DebugBuyTechUpdateCredits();
    libCamp_gf_TS_DebugBuyTechSaveMissionBank(libCamp_gv_tS_CurrentMap);
    libCamp_gf_ApplyCampaignTech(1);
    DialogSetVisible(libCamp_gv_tS_DebugBuyTechDialog, PlayerGroupAll(), true);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugBuyTechConsoleExit_Init () {
    libCamp_gt_TS_DebugBuyTechConsoleExit = TriggerCreate("libCamp_gt_TS_DebugBuyTechConsoleExit_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: Debug BUYTECH
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_DebugBUYTECH_Func (bool testConds, bool runActions) {
    // Variable Declarations
    bool lv_screenModeChanged;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((libCamp_gv_tS_DebugBuyTechActive == false))) {
            return false;
        }

        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    if (((libCamp_gv_tS_CurrentMap == 0) || ((libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 1) == false) && (libCamp_gf_MapTypeCheck(libCamp_gv_tS_CurrentMap, 2) == false)))) {
        return true;
    }
    else {
    }
    libCamp_gv_tS_DebugBuyTechActive = true;
    lv_screenModeChanged = false;
    if ((libCamp_gv_tS_InStoryMode == false)) {
        UISetMode(PlayerGroupAll(), c_uiModeFullscreen, c_transitionDurationImmediate);
        lv_screenModeChanged = true;
    }
    else {
    }
    libCamp_gf_TS_DebugBuyTechCreateDialog();
    libCamp_gf_TS_DebugBuyTechUpdateCredits();
    DialogSetVisible(libCamp_gv_tS_DebugBuyTechDialog, PlayerGroupAll(), true);
    while (!((libCamp_gv_tS_DebugBuyTechActive == false))) {
        Wait(0.5, c_timeReal);
    }
    DialogSetVisible(libCamp_gv_tS_DebugBuyTechDialog, PlayerGroupAll(), false);
    libCamp_gf_TS_DebugBuyTechSaveMissionBank(libCamp_gv_tS_CurrentMap);
    if ((lv_screenModeChanged == true)) {
        UISetMode(PlayerGroupAll(), c_uiModeConsole, c_transitionDurationImmediate);
    }
    else {
    }
    libCamp_gf_ApplyCampaignTech(1);
    libCamp_gf_TS_DebugBuyTechUpdateCredits();
    TriggerExecute(libCamp_gv_tS_TechLimitsCallback, true, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_DebugBUYTECH_Init () {
    libCamp_gt_DebugBUYTECH = TriggerCreate("libCamp_gt_DebugBUYTECH_Func");
    TriggerAddEventChatMessage(libCamp_gt_DebugBUYTECH, 1, "TECH", false);
    TriggerAddEventChatMessage(libCamp_gt_DebugBUYTECH, 1, "BUYTECH", false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Debug Display Tech Custom Button
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_DebugDisplayTechCustomButton_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    if ((libCamp_gv_tS_DebugTechCustomDialog == c_invalidDialogId)) {
        DialogCreate(200, 50, c_anchorBottom, 0, 250, false);
        libCamp_gv_tS_DebugTechCustomDialog = DialogLastCreated();
        DialogSetImageVisible(DialogLastCreated(), false);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypeButton);
        libCamp_gv_tS_DebugTechCustomButton = DialogControlLastCreated();
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 200, 50);
        libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "DebugTechPanelLabel", PlayerGroupAll());
    }
    else {
    }
    libCamp_gf_TS_DebugUpdateTechCustomDialog();
    DialogSetVisible(libCamp_gv_tS_DebugTechCustomDialog, PlayerGroupAll(), true);
    Wait(10.0, c_timeReal);
    TriggerExecute(libCamp_gt_DebugHideTechCustomButton, true, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_DebugDisplayTechCustomButton_Init () {
    libCamp_gt_DebugDisplayTechCustomButton = TriggerCreate("libCamp_gt_DebugDisplayTechCustomButton_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: Debug Hide Tech Custom Button
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_DebugHideTechCustomButton_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    if ((libCamp_gv_tS_DebugTechCustomDialog != c_invalidDialogId)) {
        DialogDestroy(libCamp_gv_tS_DebugTechCustomDialog);
        libCamp_gv_tS_DebugTechCustomDialog = c_invalidDialogId;
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_DebugHideTechCustomButton_Init () {
    libCamp_gt_DebugHideTechCustomButton = TriggerCreate("libCamp_gt_DebugHideTechCustomButton_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: Debug Tech Custom Button Clicked
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_DebugTechCustomButtonClicked_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((EventDialogControl() == libCamp_gv_tS_DebugTechCustomButton))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    TriggerExecute(libCamp_gt_DebugBUYTECH, true, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_DebugTechCustomButtonClicked_Init () {
    libCamp_gt_DebugTechCustomButtonClicked = TriggerCreate("libCamp_gt_DebugTechCustomButtonClicked_Func");
    TriggerAddEventDialogControl(libCamp_gt_DebugTechCustomButtonClicked, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Debug CREDITS
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_DebugCREDITS_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_amount;

    // Variable Initialization

    // Actions
    if (!runActions) {
        return true;
    }

    lv_amount = 5000000;
    libCamp_gf_SetStoryCredits((libCamp_gf_StoryCredits() + lv_amount));
    PlayerModifyPropertyInt(1, c_playerPropCredits, c_playerPropOperSetTo, libCamp_gf_StoryCredits());
    if ((UIFrameVisible(1, c_syncFrameTypePurchasePanel) == true)) {
        libCamp_gf_TS_UpdateTechVisuals();
    }
    else {
    }
    UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringExternal("Param/Value/lib_Camp_1A857692"));
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_DebugCREDITS_Init () {
    libCamp_gt_DebugCREDITS = TriggerCreate("libCamp_gt_DebugCREDITS_Func");
    TriggerAddEventCheatUsed(libCamp_gt_DebugCREDITS, c_playerAny, c_gameCheatCredits);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Debug DIFFICULTY
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_DebugDIFFICULTY_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, DifficultyNameCampaign(PlayerDifficulty(EventPlayer())));
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_DebugDIFFICULTY_Init () {
    libCamp_gt_DebugDIFFICULTY = TriggerCreate("libCamp_gt_DebugDIFFICULTY_Func");
    TriggerAddEventChatMessage(libCamp_gt_DebugDIFFICULTY, 1, "DIFFICULTY", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug XDATA
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugXDATA_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_index;
    text lv_text;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    lv_text = (StringExternal("Param/Value/lib_Camp_E7771DE3") + IntToText(libCamp_gv_tSX_LastMap) + StringExternal("Param/Value/lib_Camp_4891A158") + IntToText(libCamp_gv_tSX_LastMission) + StringExternal("Param/Value/lib_Camp_B16FBD4F") + IntToText((libCamp_gf_LastSuccessfulMission())) + StringExternal("Param/Value/lib_Camp_5C04FF39") + IntToText((libCamp_gv_tS_CurrentMap)) + StringExternal("Param/Value/lib_Camp_20FCD55E") + libNtve_gf_ConvertBooleanToText(libCamp_gv_tSX_IsSimulation) + StringExternal("Param/Value/lib_Camp_531286D9") + libNtve_gf_ConvertBooleanToText(libCamp_gv_tSX_IsVictoryPlayAgain) + StringExternal("Param/Value/lib_Camp_5B65EC60"));
    TriggerDebugOutput(1, lv_text, true);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugXDATA_Init () {
    libCamp_gt_TS_DebugXDATA = TriggerCreate("libCamp_gt_TS_DebugXDATA_Func");
    TriggerAddEventChatMessage(libCamp_gt_TS_DebugXDATA, 1, "XDATA", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug XDEFAULT
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugXDEFAULT_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_index;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gf_TS_DefaultTransitionVars(true, true, true, true);
    TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_AC7AA0BF") + IntToText(libCamp_gf_MissionStatusAge(1, 1))), true);
    libCamp_gf_TS_SaveAllTransitionData(false, false, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugXDEFAULT_Init () {
    libCamp_gt_TS_DebugXDEFAULT = TriggerCreate("libCamp_gt_TS_DebugXDEFAULT_Func");
    TriggerAddEventChatMessage(libCamp_gt_TS_DebugXDEFAULT, 1, "XDEFAULT", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_Debug XLOAD
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugXLOAD_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_index;
    text lv_text;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gf_TS_LoadAllTransitionData(31);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugXLOAD_Init () {
    libCamp_gt_TS_DebugXLOAD = TriggerCreate("libCamp_gt_TS_DebugXLOAD_Func");
    TriggerAddEventChatMessage(libCamp_gt_TS_DebugXLOAD, 1, "XLOAD", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_FootageRecording
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_FootageRecording_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    if ((libCamp_gv_tS_FootageRecordingCallback != null)) {
        TriggerExecute(libCamp_gt_DebugHideTechCustomButton, true, false);
        libCamp_gf_TS_FootageRecording();
    }
    else {
        UIDisplayMessage(PlayerGroupAll(), c_messageAreaError, StringExternal("Param/Value/lib_Camp_E9EC57DB"));
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_FootageRecording_Init () {
    libCamp_gt_TS_FootageRecording = TriggerCreate("libCamp_gt_TS_FootageRecording_Func");
    TriggerAddEventChatMessage(libCamp_gt_TS_FootageRecording, 1, "INTRO", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugVictorySequence
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugVictorySequence_Func (bool testConds, bool runActions) {
    // Variable Declarations
    trigger lv_cineTrigger;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    lv_cineTrigger = TriggerCreate("gt_VictoryQ_Func");;
    libCamp_gf_RunMissionVictorySequence(lv_cineTrigger);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugVictorySequence_Init () {
    libCamp_gt_TS_DebugVictorySequence = TriggerCreate("libCamp_gt_TS_DebugVictorySequence_Func");
    TriggerAddEventChatMessage(libCamp_gt_TS_DebugVictorySequence, 1, "VictoryS", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: TS_DebugVictoryScoreScreen
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_TS_DebugVictoryScoreScreen_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    libCamp_gf_DisplayCampaignVictoryScoreScreen(3);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_TS_DebugVictoryScoreScreen_Init () {
    libCamp_gt_TS_DebugVictoryScoreScreen = TriggerCreate("libCamp_gt_TS_DebugVictoryScoreScreen_Func");
    TriggerAddEventChatMessage(libCamp_gt_TS_DebugVictoryScoreScreen, 1, "vss", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Debug - PerfTestGetFps
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_DebugPerfTestGetFps_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }

        if (!((TriggerGetExecCount(TriggerGetCurrent()) == 0))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    while (true) {
        PerfTestGetFPS();
        Wait(0.5, c_timeGame);
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_DebugPerfTestGetFps_Init () {
    libCamp_gt_DebugPerfTestGetFps = TriggerCreate("libCamp_gt_DebugPerfTestGetFps_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: Debug STARTFPS
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_DebugSTARTFPS_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    TriggerExecute(libCamp_gt_DebugPerfTestGetFps, true, false);
    PerfTestStart(StringToText(EventChatMessage(false)));
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_DebugSTARTFPS_Init () {
    libCamp_gt_DebugSTARTFPS = TriggerCreate("libCamp_gt_DebugSTARTFPS_Func");
    TriggerAddEventChatMessage(libCamp_gt_DebugSTARTFPS, c_playerAny, "STARTFPS", false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Debug STOPFPS
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_DebugSTOPFPS_Func (bool testConds, bool runActions) {
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

    // Actions
    if (!runActions) {
        return true;
    }

    PerfTestStop();
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_DebugSTOPFPS_Init () {
    libCamp_gt_DebugSTOPFPS = TriggerCreate("libCamp_gt_DebugSTOPFPS_Func");
    TriggerAddEventChatMessage(libCamp_gt_DebugSTOPFPS, c_playerAny, "STOPFPS", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Start Tension Music
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_StartTensionMusic_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "JukeboxTrack00", c_soundtrackCueAny, c_soundtrackIndexAny, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_StartTensionMusic_Init () {
    libCamp_gt_StartTensionMusic = TriggerCreate("libCamp_gt_StartTensionMusic_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: Stop Tension Music
//--------------------------------------------------------------------------------------------------
bool libCamp_gt_StopTensionMusic_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, libCamp_gv_mapMusicTrack, c_soundtrackCueAny, c_soundtrackIndexAny, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libCamp_gt_StopTensionMusic_Init () {
    libCamp_gt_StopTensionMusic = TriggerCreate("libCamp_gt_StopTensionMusic_Func");
}

void libCamp_InitTriggers () {
    libCamp_gt__ZergDropPod_Init();
    libCamp_gt__TerranDropPod_Init();
    libCamp_gt_TS_MissionVictoryCallbackBlockActionQueueOneMinute_Init();
    libCamp_gt_TS_MissionVictoryCallbackBlockActionQueue_Init();
    libCamp_gt_TS_AbortMission_Init();
    libCamp_gt__CB_ChatBubbleActivated_Init();
    libCamp_gt__CB_ActivateChatBubble_Init();
    libCamp_gt__CB_ChatBubbleUnitDied_Init();
    libCamp_gt__CB_ShowChatBubbleOnUnit_Init();
    libCamp_gt_chatbubbledebug_Init();
    libCamp_gt__CB_WaitForSound_Init();
    libCamp_gt__MsgDlgButtonClicked_Init();
    libCamp_gt_ZS_CampaignTrialDialogQuitClicked_Init();
    libCamp_gt_ZS_CampaignTrialDialogUpgradeClicked_Init();
    libCamp_gt_TS_MercNewToAvailable_Init();
    libCamp_gt_TS_MercUIPurchase_Init();
    libCamp_gt_TS_MercUIExit_Init();
    libCamp_gt_TS_BattleReportMissionReplay_Init();
    libCamp_gt_TS_BattleReportSceneReplay_Init();
    libCamp_gt_TS_BattleReportPanelLeave_Init();
    libCamp_gt_TS_ResearchUIPurchase_Init();
    libCamp_gt_TS_ResearchUIExit_Init();
    libCamp_gt_TS_RoomChangeButtonResponse_Init();
    libCamp_gt_TSTechConsoleExit_Init();
    libCamp_gt_TSTechItemSelected_Init();
    libCamp_gt_TSTechCategorySelected_Init();
    libCamp_gt_TSTechConsolePurchase_Init();
    libCamp_gt_TS_Tech_CalldownSupplyDepot_Init();
    libCamp_gt_Debug_StartPerformanceLogging_Init();
    libCamp_gt_Debug_Preloading_Init();
    libCamp_gt_LoadingDone_Init();
    libCamp_gt_TS_VSScreenContinue_Init();
    libCamp_gt_TS_VSScreenPlayAgain_Init();
    libCamp_gt_TS_EndCinematic_Init();
    libCamp_gt_TS_EndCredits_Init();
    libCamp_gt_TS_EndCreditsEnds_Init();
    libCamp_gt_TS_CheatUsed_Init();
    libCamp_gt_TS_FlyingOutHouse_Init();
    libCamp_gt_TS_TerranUpTheNight_Init();
    libCamp_gt_TS_Temp_Init();
    libCamp_gt_TS_DebugProgressMissionButton_Init();
    libCamp_gt_TS_DebugProgressUnlockSecretButton_Init();
    libCamp_gt_TS_DebugProgressReset_Init();
    libCamp_gt_TS_DebugProgressLaunchMission_Init();
    libCamp_gt_TS_DebugProgressLaunchMissionPopup_Init();
    libCamp_gt_TS_DebugProgressOK_Init();
    libCamp_gt_TS_DebugProgressCancel_Init();
    libCamp_gt_TS_DebugPROGRESS_Init();
    libCamp_gt_TS_DebugPROGRESSDevelop_Init();
    libCamp_gt_TS_DebugProgressOKCallback_Init();
    libCamp_gt_TS_DebugResearchPanel_Init();
    libCamp_gt_TS_DebugResearchPanelCloseButtonClicked_Init();
    libCamp_gt_TS_DebugResearchPanelExit_Init();
    libCamp_gt_TS_DebugResearchPanelButtonClicked_Init();
    libCamp_gt_TS_DebugResearchPoint_Init();
    libCamp_gt_TS_DebugMercenaryPanel_Init();
    libCamp_gt_TS_DebugMercenaryPanelCloseButtonClicked_Init();
    libCamp_gt_TS_DebugMercenaryPanelExit_Init();
    libCamp_gt_TS_DebugMercenaryPanelButtonClicked_Init();
    libCamp_gt_TS_DebugBuyTechButtonClicked_Init();
    libCamp_gt_TS_DebugBuyTechConsoleExit_Init();
    libCamp_gt_DebugBUYTECH_Init();
    libCamp_gt_DebugDisplayTechCustomButton_Init();
    libCamp_gt_DebugHideTechCustomButton_Init();
    libCamp_gt_DebugTechCustomButtonClicked_Init();
    libCamp_gt_DebugCREDITS_Init();
    libCamp_gt_DebugDIFFICULTY_Init();
    libCamp_gt_TS_DebugXDATA_Init();
    libCamp_gt_TS_DebugXDEFAULT_Init();
    libCamp_gt_TS_DebugXLOAD_Init();
    libCamp_gt_TS_FootageRecording_Init();
    libCamp_gt_TS_DebugVictorySequence_Init();
    libCamp_gt_TS_DebugVictoryScoreScreen_Init();
    libCamp_gt_DebugPerfTestGetFps_Init();
    libCamp_gt_DebugSTARTFPS_Init();
    libCamp_gt_DebugSTOPFPS_Init();
    libCamp_gt_StartTensionMusic_Init();
    libCamp_gt_StopTensionMusic_Init();
}

//--------------------------------------------------------------------------------------------------
// Library Initialization
//--------------------------------------------------------------------------------------------------
bool libCamp_InitLib_completed = false;

void libCamp_InitLib () {
    if (libCamp_InitLib_completed) {
        return;
    }

    libCamp_InitVariables();
    libCamp_InitTriggers();

    libCamp_InitLib_completed = true;
}

