mods/heroesmapmods/battlegroundmapmods/warheadjunction.stormmod/base.stormdata/libmsc2.galaxy

libmsc2.galaxy
include "TriggerLibs/NativeLib"
include "TriggerLibs/HeroesLib"
include "TriggerLibs/GameLib"
include "TriggerLibs/MapMechanicsLib"
include "TriggerLibs/UILib"
include "TriggerLibs/SoundLib"

include "LibMSC2_h"

//--------------------------------------------------------------------------------------------------
// Library: Warhead Junction
//--------------------------------------------------------------------------------------------------
// External Library Initialization
void libMSC2_InitLibraries () {
    libNtve_InitVariables();
    libCore_InitVariables();
    libGame_InitVariables();
    libMapM_InitVariables();
    libUIUI_InitVariables();
    libSond_InitVariables();
}

// Variable Initialization
bool libMSC2_InitVariables_completed = false;

void libMSC2_InitVariables () {
    int init_i;
    int init_j;
    int init_i1;

    if (libMSC2_InitVariables_completed) {
        return;
    }

    libMSC2_InitVariables_completed = true;

    libMSC2_gv_mMSC2NukePickupRange_C = 2.0;
    libMSC2_gv_mMSC2EventState = libMSC2_ge_MMSC2EventStates_NoEvent;
    libMSC2_gv_mMSC2ThreeWarheadsSpawn = true;
    libMSC2_gv_mMSC2TerrazineMainEventTimer = TimerCreate();
    libMSC2_gv_mMSC2BuiltWarheadsActive = UnitGroupEmpty();
    for (init_i = 0; init_i <= libMSC2_gv_mMSC2BuiltWarheadsCountMax_C; init_i += 1) {
        libMSC2_gv_mMSC2BuiltWarheadsWarningPing[init_i] = c_invalidPingId;
    }
    for (init_i = 0; init_i <= libCore_gv_bALMaxPlayers; init_i += 1) {
        for (init_j = 0; init_j <= 2; init_j += 1) {
            libMSC2_gv_mMSC2NukeCalldownPiing[init_i][init_j] = c_invalidPingId;
        }
    }
    libMSC2_gv_mMSC2WarheadEventFirstTime = true;
    libMSC2_gv_mMSC2WarheadPickupReminderDelay_C = 20.0;
    libMSC2_gv_mMSC2BuiltWarheadReminderTimer = TimerCreate();
    libMSC2_gv_mMSC2ObjectivePreviewTimer = TimerCreate();
    libMSC2_gv_mMSC2ObjectivePreviewDelay_C = 30.0;
    libMSC2_gv_mMSC2NukeDamageScalingTimer = TimerCreate();
    libMSC2_gv_mMSC2DroppedWarheadReminderTimer = TimerCreate();
    libMSC2_gv_mMSC2DroppedWarheadsGroup = UnitGroupEmpty();
    libMSC2_gv_mMSC2VOPlayingdelete = PlayerGroupEmpty();
    libMSC2_gv_mMSC2VOSoundPlaying = PlayerGroupEmpty();
    libMSC2_gv_mMSC2UIPanel.lv_capturePointsPanel = c_invalidDialogControlId;
    libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeFrame = c_invalidDialogControlId;
    libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeNameLabel = c_invalidDialogControlId;
    libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeTimeLabel = c_invalidDialogControlId;
    libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeQuantityLabel = c_invalidDialogControlId;
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeFrame[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel2[init_i1] = c_invalidDialogControlId;
    }
    libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseFrame = c_invalidDialogControlId;
    libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseInfoLabel = c_invalidDialogControlId;
    libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel = c_invalidDialogControlId;
    libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel2 = c_invalidDialogControlId;
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxPlayersOnATeam; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel3[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxPlayersOnATeam; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel4[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxPlayersOnATeam; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel5[init_i1] = c_invalidDialogControlId;
    }
    libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeam = c_invalidDialogControlId;
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxPlayersOnATeam; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeamPlayerIconBorders[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxPlayersOnATeam; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeamPlayerIcons[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxPlayersOnATeam; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeamPlayerTimer[init_i1] = c_invalidDialogControlId;
    }
    libMSC2_gv_mMSC2UIPanel.lv_NukeFrameEnemyTeam = c_invalidDialogControlId;
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxPlayersOnATeam; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_NukeFrameEnemyTeamPlayerIconBorders[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxPlayersOnATeam; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_NukeFrameEnemyTeamPlayerIcons[init_i1] = c_invalidDialogControlId;
    }
    libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeam2 = c_invalidDialogControlId;
    libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeam3 = c_invalidDialogControlId;
    libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeam4 = c_invalidDialogControlId;
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_backgroundImageBlueLeft[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_backgroundImageBlueRight[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_backgroundImageRedLeft[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_backgroundImageRedRight[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageBlueLeft[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageBlueRight[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageRedLeft[init_i1] = c_invalidDialogControlId;
    }
    for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
        libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageRedRight[init_i1] = c_invalidDialogControlId;
    }
}

// Presets
// Functions
void libMSC2_gf_MMSC2AddWarheadSpawnLocation (int lp_lane, doodad lp_leftCanisterPointDoodad, point lp_leftCannisterPoint, doodad lp_middleCanisterPointDoodad, point lp_middleCanisterPoint, doodad lp_rightCanisterPointDoodad, point lp_rightCannisterPoint) {
    // Automatic Variable Declarations
    // Implementation
    libMSC2_gv_mMSC2WarheadData[lp_lane].lv_leftCanisterDoodad = lp_leftCanisterPointDoodad;
    libMSC2_gv_mMSC2WarheadData[lp_lane].lv_leftCanisterPoint = lp_leftCannisterPoint;
    libMSC2_gv_mMSC2WarheadData[lp_lane].lv_middleCanisterDoodad = lp_middleCanisterPointDoodad;
    libMSC2_gv_mMSC2WarheadData[lp_lane].lv_middleCanisterPoint = lp_middleCanisterPoint;
    libMSC2_gv_mMSC2WarheadData[lp_lane].lv_rightCanisterDoodad = lp_rightCanisterPointDoodad;
    libMSC2_gv_mMSC2WarheadData[lp_lane].lv_rightCanisterPoint = lp_rightCannisterPoint;
}

int libMSC2_gf_MMSC2DetermineDoubleWarheadSpawnLane () {
    // Variable Declarations
    playergroup lv_terrazineLaneGroup;

    // Automatic Variable Declarations
    // Variable Initialization
    lv_terrazineLaneGroup = PlayerGroupEmpty();

    // Implementation
    PlayerGroupAdd(lv_terrazineLaneGroup, 1);
    PlayerGroupAdd(lv_terrazineLaneGroup, 2);
    PlayerGroupAdd(lv_terrazineLaneGroup, 3);
    if ((libMSC2_gv_mMSC2ThreeWarheadsSpawn == true)) {
        PlayerGroupRemove(lv_terrazineLaneGroup, libMSC2_gv_mMSC2LastDoubleWarheadLane);
    }
    else {
        PlayerGroupRemove(lv_terrazineLaneGroup, libMSC2_gv_mMSC2LastEmptyWarheadLane);
    }
    return PlayerGroupPlayer(lv_terrazineLaneGroup, RandomInt(1, PlayerGroupCount(lv_terrazineLaneGroup)));
}

int libMSC2_gf_MMSC2CountofNukesForPlayer (int lp_playerIndex) {
    // Variable Declarations
    unit lv_heroUnit;
    int lv_nukeCount;

    // Automatic Variable Declarations
    unitgroup auto538D59A7_g;
    int auto538D59A7_u;

    // Variable Initialization

    // Implementation
    auto538D59A7_g = libGame_gv_players[lp_playerIndex].lv_heroUnitGroup;
    auto538D59A7_u = UnitGroupCount(auto538D59A7_g, c_unitCountAll);
    for (;; auto538D59A7_u -= 1) {
        lv_heroUnit = UnitGroupUnitFromEnd(auto538D59A7_g, auto538D59A7_u);
        if (lv_heroUnit == null) { break; }
        if ((UnitHasBehavior2(lv_heroUnit, "HasMapMechanicTargetAbility") == true) && (UnitTestState(lv_heroUnit, c_unitStateHallucination) == false)) {
            lv_nukeCount += 1;
        }

    }
    return lv_nukeCount;
}

void libMSC2_gf_MMSC2WarningStarts (int lp_specialLane) {
    // Variable Declarations
    int lv_itLane;
    int lv_itPlayer;

    // Automatic Variable Declarations
    int autoF2A0A299_ae;
    const int autoF2A0A299_ai = 1;

    // Variable Initialization

    // Implementation
    libMSC2_gf_MMSC2ClearCanisterSpawningSignals();
    SoundPlayForPlayer(SoundLink("UI_Game_Ping_Warhead_Nukes_Warning", -1), c_maxPlayers, PlayerGroupAll(), 100.0, 0.0);
    libSond_gf_SoundtrackApplyNewDefaultSoundtrackForPlayerGroup("MX_WarheadJunction_EventSpawning", libCore_gv_allHeroPlayersPlusObserver);
    autoF2A0A299_ae = libGame_gv_laneCount;
    lv_itLane = 1;
    for ( ; ( (autoF2A0A299_ai >= 0 && lv_itLane <= autoF2A0A299_ae) || (autoF2A0A299_ai < 0 && lv_itLane >= autoF2A0A299_ae) ) ; lv_itLane += autoF2A0A299_ai ) {
        if ((lv_itLane == lp_specialLane)) {
            if ((libMSC2_gv_mMSC2ThreeWarheadsSpawn == true)) {
                libMSC2_gf_MMSC2CreateCanisterSpawningSignal(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_leftCanisterPoint);
                libMSC2_gf_MMSC2CreateCanisterSpawningSignal(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_rightCanisterPoint);
                libMSC2_gf_MMSC2CanisterPlaformPlayBirthAnimations(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_leftCanisterDoodad);
                libMSC2_gf_MMSC2CanisterPlaformPlayBirthAnimations(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_rightCanisterDoodad);
            }

        }
        else {
            if ((libMSC2_gv_mMSC2ThreeWarheadsSpawn == true)) {
                if ((ModI(libMSC2_gv_mMSC2EventTracker, 2) == 1)) {
                    if ((ModI(lv_itLane, 2) == 1)) {
                        libMSC2_gf_MMSC2CreateCanisterSpawningSignal(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_middleCanisterPoint);
                        libMSC2_gf_MMSC2CanisterPlaformPlayBirthAnimations(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_middleCanisterDoodad);
                    }

                }
                else {
                    if ((ModI(lv_itLane, 2) == 1)) {
                    }
                    else {
                        libMSC2_gf_MMSC2CreateCanisterSpawningSignal(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_middleCanisterPoint);
                        libMSC2_gf_MMSC2CanisterPlaformPlayBirthAnimations(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_middleCanisterDoodad);
                    }
                }
            }
            else {
                libMSC2_gf_MMSC2CreateCanisterSpawningSignal(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_middleCanisterPoint);
                libMSC2_gf_MMSC2CanisterPlaformPlayBirthAnimations(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_middleCanisterDoodad);
            }
        }
    }
}

void libMSC2_gf_MMSC2SetupandStartPreview (int lp_specialLane) {
    // Variable Declarations
    int lv_itLane;
    int lv_itPlayer;

    // Automatic Variable Declarations
    int auto901C1127_ae;
    const int auto901C1127_ai = 1;

    // Variable Initialization

    // Implementation
    auto901C1127_ae = libGame_gv_laneCount;
    lv_itLane = 1;
    for ( ; ( (auto901C1127_ai >= 0 && lv_itLane <= auto901C1127_ae) || (auto901C1127_ai < 0 && lv_itLane >= auto901C1127_ae) ) ; lv_itLane += auto901C1127_ai ) {
        if ((lv_itLane == lp_specialLane)) {
            if ((libMSC2_gv_mMSC2ThreeWarheadsSpawn == true)) {
                libMSC2_gf_MMSC2CreateCanisterPreview(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_leftCanisterPoint);
                libMSC2_gf_MMSC2CreateCanisterPreview(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_rightCanisterPoint);
            }

        }
        else {
            if ((libMSC2_gv_mMSC2ThreeWarheadsSpawn == true)) {
                if ((ModI(libMSC2_gv_mMSC2EventTracker, 2) == 1)) {
                    if ((ModI(lv_itLane, 2) == 1)) {
                        libMSC2_gf_MMSC2CreateCanisterPreview(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_middleCanisterPoint);
                    }

                }
                else {
                    if ((ModI(lv_itLane, 2) == 1)) {
                    }
                    else {
                        libMSC2_gf_MMSC2CreateCanisterPreview(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_middleCanisterPoint);
                    }
                }
            }
            else {
                libMSC2_gf_MMSC2CreateCanisterPreview(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_middleCanisterPoint);
            }
        }
    }
}

void libMSC2_gf_MMSC2CreateCanisterPreview (point lp_location) {
    // Automatic Variable Declarations
    // Implementation
    libNtve_gf_CreateUnitsWithDefaultFacing(1, "NukeTargetMinimapPreviewIconUnit", 0, 0, lp_location, null);
    libMSC2_gv_mMSC2BuiltWarheadsWarningEffectCount += 1;
    libMSC2_gv_mMSC2BuiltWarheadsPreviewUnits[libMSC2_gv_mMSC2BuiltWarheadsWarningEffectCount] = UnitLastCreated();
}

void libMSC2_gf_MMSC2CreateCanisterSpawningSignal (point lp_location) {
    // Variable Declarations
    fixed lv_pingDuration_C;
    int lv_itPlayer;

    // Automatic Variable Declarations
    // Variable Initialization
    lv_pingDuration_C = (libMSC2_gv_mMSC2EventWarningDelayGasCanister_C - 1.0);

    // Implementation
    if ((libMSC2_gv_mMSC2BuiltWarheadsWarningEffectCount >= libMSC2_gv_mMSC2BuiltWarheadsCountMax_C)) {
        return ;
    }

    libNtve_gf_CreateModelAtPoint("RavenLordTributeWarning", lp_location);
    ActorSend(libNtve_gf_ActorLastCreated(), "SetScaleAbsolute 0.500000");
    ActorSend(libNtve_gf_ActorLastCreated(), "SetVisibility");
    libMSC2_gv_mMSC2BuiltWarheadsWarningEffectCount += 1;
    libMSC2_gv_mMSC2BuiltWarheadsWarningEffect[libMSC2_gv_mMSC2BuiltWarheadsWarningEffectCount] = libNtve_gf_ActorLastCreated();
    VisRevealerCreate(libCore_gv_cOMPUTER_TeamOrder, RegionCircle(lp_location, 4.0));
    libMSC2_gv_mMSC2BuiltWarheadsRevealer[libMSC2_gv_mMSC2BuiltWarheadsWarningEffectCount][1] = VisRevealerLastCreated();
    VisRevealerCreate(libCore_gv_cOMPUTER_TeamChaos, RegionCircle(lp_location, 4.0));
    libMSC2_gv_mMSC2BuiltWarheadsRevealer[libMSC2_gv_mMSC2BuiltWarheadsWarningEffectCount][2] = VisRevealerLastCreated();
    libCore_gf_CreateMinimapPingStorm(PlayerGroupAll(), "StormWarning", lp_location, libCore_gv_cOLORNeutralColor, lv_pingDuration_C);
    PingSetScale(PingLastCreated(), 0.4);
    libMSC2_gv_mMSC2BuiltWarheadsWarningPing[libMSC2_gv_mMSC2BuiltWarheadsWarningEffectCount] = PingLastCreated();
    AddPointOfInterest(lp_location, libMSC2_gv_mMSC2NukePickupRange_C, libMSC2_gv_mMSC2EventWarningDelayGasCanister_C, "Harvest", libNtve_ge_GoalTeam_Both, 0);
}

void libMSC2_gf_MMSC2ClearCanisterSpawningSignals () {
    // Variable Declarations
    int lv_itIndex;
    int lv_itPlayer;

    // Automatic Variable Declarations
    int auto450CE7E6_ae;
    const int auto450CE7E6_ai = 1;

    // Variable Initialization

    // Implementation
    auto450CE7E6_ae = libMSC2_gv_mMSC2BuiltWarheadsWarningEffectCount;
    lv_itIndex = 1;
    for ( ; ( (auto450CE7E6_ai >= 0 && lv_itIndex <= auto450CE7E6_ae) || (auto450CE7E6_ai < 0 && lv_itIndex >= auto450CE7E6_ae) ) ; lv_itIndex += auto450CE7E6_ai ) {
        if ((libMSC2_gv_mMSC2BuiltWarheadsWarningEffect[lv_itIndex] != null)) {
            libNtve_gf_KillModel(libMSC2_gv_mMSC2BuiltWarheadsWarningEffect[lv_itIndex]);
            libMSC2_gv_mMSC2BuiltWarheadsWarningEffect[lv_itIndex] = null;
        }

        if ((libMSC2_gv_mMSC2BuiltWarheadsWarningPing[lv_itIndex] != c_invalidPingId)) {
            PingDestroy(libMSC2_gv_mMSC2BuiltWarheadsWarningPing[lv_itIndex]);
            libMSC2_gv_mMSC2BuiltWarheadsWarningPing[lv_itIndex] = c_invalidPingId;
        }

    }
    libMSC2_gv_mMSC2BuiltWarheadsWarningEffectCount = 0;
}

void libMSC2_gf_MMSC2ClearWarheadPreviews () {
    // Variable Declarations
    int lv_itIndex;
    int lv_itPlayer;

    // Automatic Variable Declarations
    int auto1367A629_ae;
    const int auto1367A629_ai = 1;

    // Variable Initialization

    // Implementation
    auto1367A629_ae = libMSC2_gv_mMSC2BuiltWarheadsWarningEffectCount;
    lv_itIndex = 1;
    for ( ; ( (auto1367A629_ai >= 0 && lv_itIndex <= auto1367A629_ae) || (auto1367A629_ai < 0 && lv_itIndex >= auto1367A629_ae) ) ; lv_itIndex += auto1367A629_ai ) {
        if ((libMSC2_gv_mMSC2BuiltWarheadsPreviewUnits[lv_itIndex] != null)) {
            UnitKill(libMSC2_gv_mMSC2BuiltWarheadsPreviewUnits[lv_itIndex]);
            libMSC2_gv_mMSC2BuiltWarheadsPreviewUnits[lv_itIndex] = null;
        }

    }
}

void libMSC2_gf_MMSC2SpawnNukeCanisters (int lp_specialSpawnLane) {
    // Variable Declarations
    int lv_itLane;
    int lv_warheadsSpawned;

    // Automatic Variable Declarations
    int auto1B0D1057_ae;
    const int auto1B0D1057_ai = 1;

    // Variable Initialization

    // Implementation
    auto1B0D1057_ae = libGame_gv_laneCount;
    lv_itLane = 1;
    for ( ; ( (auto1B0D1057_ai >= 0 && lv_itLane <= auto1B0D1057_ae) || (auto1B0D1057_ai < 0 && lv_itLane >= auto1B0D1057_ae) ) ; lv_itLane += auto1B0D1057_ai ) {
        if ((lv_itLane == lp_specialSpawnLane)) {
            if ((libMSC2_gv_mMSC2ThreeWarheadsSpawn == true)) {
                libMSC2_gf_MMSC2BuiltWarheadSpawned(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_leftCanisterPoint, libMSC2_gv_mMSC2TerrazineReward_C);
                libMSC2_gf_MMSC2BuiltWarheadSpawned(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_rightCanisterPoint, libMSC2_gv_mMSC2TerrazineReward_C);
                lv_warheadsSpawned = (lv_warheadsSpawned + 2);
            }

        }
        else {
            if ((libMSC2_gv_mMSC2ThreeWarheadsSpawn == true)) {
                if ((ModI(libMSC2_gv_mMSC2EventTracker, 2) == 1)) {
                    if ((ModI(lv_itLane, 2) == 1)) {
                        libMSC2_gf_MMSC2BuiltWarheadSpawned(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_middleCanisterPoint, libMSC2_gv_mMSC2TerrazineReward_C);
                        lv_warheadsSpawned = (lv_warheadsSpawned + 1);
                    }

                }
                else {
                    if ((ModI(lv_itLane, 2) == 1)) {
                    }
                    else {
                        libMSC2_gf_MMSC2BuiltWarheadSpawned(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_middleCanisterPoint, libMSC2_gv_mMSC2TerrazineReward_C);
                        lv_warheadsSpawned = (lv_warheadsSpawned + 1);
                    }
                }
            }
            else {
                libMSC2_gf_MMSC2BuiltWarheadSpawned(libMSC2_gv_mMSC2WarheadData[lv_itLane].lv_middleCanisterPoint, libMSC2_gv_mMSC2TerrazineReward_C);
                lv_warheadsSpawned = (lv_warheadsSpawned + 1);
            }
        }
    }
    SoundPlayForPlayer(SoundLink("UI_Game_Ping_Warhead_Nukes_Ready", -1), c_maxPlayers, PlayerGroupAll(), 100.0, 0.0);
    libMSC2_gf_MMSC2UpdateNukeTextTagsForPlayers();
    TimerStart(libMSC2_gv_mMSC2BuiltWarheadReminderTimer, libMSC2_gv_mMSC2WarheadPickupReminderDelay_C, false, c_timeGame);
    StatEventCreate("WarheadJunctionNukesSpawned");
    StatEventAddDataFixed(StatEventLastCreated(), "GameTime", libUIUI_gf_HeroesGameTime());
    StatEventAddDataInt(StatEventLastCreated(), "NukeSpawnedCount", lv_warheadsSpawned);
    StatEventSend(StatEventLastCreated());
}

trigger auto_libMSC2_gf_MMSC2NukeButtonStartFlashingForPlayer_Trigger = null;
int auto_libMSC2_gf_MMSC2NukeButtonStartFlashingForPlayer_lp_player;

void libMSC2_gf_MMSC2NukeButtonStartFlashingForPlayer (int lp_player) {
    auto_libMSC2_gf_MMSC2NukeButtonStartFlashingForPlayer_lp_player = lp_player;

    if (auto_libMSC2_gf_MMSC2NukeButtonStartFlashingForPlayer_Trigger == null) {
        auto_libMSC2_gf_MMSC2NukeButtonStartFlashingForPlayer_Trigger = TriggerCreate("auto_libMSC2_gf_MMSC2NukeButtonStartFlashingForPlayer_TriggerFunc");
    }

    TriggerExecute(auto_libMSC2_gf_MMSC2NukeButtonStartFlashingForPlayer_Trigger, false, false);
}

bool auto_libMSC2_gf_MMSC2NukeButtonStartFlashingForPlayer_TriggerFunc (bool testConds, bool runActions) {
    int lp_player = auto_libMSC2_gf_MMSC2NukeButtonStartFlashingForPlayer_lp_player;

    // Variable Declarations
    int lv_itPlayer;
    int lv_player;
    playergroup lv_nukePlayerGroup;

    // Automatic Variable Declarations
    playergroup auto29EB8D88_g;

    // Variable Initialization
    lv_nukePlayerGroup = PlayerGroupEmpty();

    // Implementation
    UISetButtonFaceHighlighted(PlayerGroupSingle(lp_player), "MapMechanicNuke", true);
    while (true) {
        auto29EB8D88_g = lv_nukePlayerGroup;
        lv_itPlayer = -1;
        while (true) {
            	lv_itPlayer = PlayerGroupNextPlayer(auto29EB8D88_g, lv_itPlayer);
            	if (lv_itPlayer<0) { break; }
            	if ((libMSC2_gf_MMSC2CountofNukesForPlayer(lv_itPlayer) == 0)) {
                UISetButtonFaceHighlighted(libCore_gv_playerGroupFromPlayer[lv_itPlayer], "MapMechanicNuke", false);
                PlayerGroupRemove(lv_nukePlayerGroup, lv_itPlayer);
            }

        }
        if ((PlayerGroupCount(lv_nukePlayerGroup) == 0)) {
            return true;
        }

        Wait(0.5, c_timeGame);
    }
    return true;
}

trigger auto_libMSC2_gf_MMSC2NukeButtonStopFlashingForPlayer_Trigger = null;
int auto_libMSC2_gf_MMSC2NukeButtonStopFlashingForPlayer_lp_player;

void libMSC2_gf_MMSC2NukeButtonStopFlashingForPlayer (int lp_player) {
    auto_libMSC2_gf_MMSC2NukeButtonStopFlashingForPlayer_lp_player = lp_player;

    if (auto_libMSC2_gf_MMSC2NukeButtonStopFlashingForPlayer_Trigger == null) {
        auto_libMSC2_gf_MMSC2NukeButtonStopFlashingForPlayer_Trigger = TriggerCreate("auto_libMSC2_gf_MMSC2NukeButtonStopFlashingForPlayer_TriggerFunc");
    }

    TriggerExecute(auto_libMSC2_gf_MMSC2NukeButtonStopFlashingForPlayer_Trigger, false, false);
}

bool auto_libMSC2_gf_MMSC2NukeButtonStopFlashingForPlayer_TriggerFunc (bool testConds, bool runActions) {
    int lp_player = auto_libMSC2_gf_MMSC2NukeButtonStopFlashingForPlayer_lp_player;

    // Automatic Variable Declarations
    // Implementation
    UISetButtonFaceHighlighted(libCore_gv_playerGroupFromPlayer[lp_player], "MapMechanicNuke", false);
    return true;
}

void libMSC2_gf_MMSC2BuiltWarheadSpawned (point lp_canisterSpawnLocation, int lp_gasAmount) {
    // Variable Declarations
    string lv_canisterType;
    text lv_tooltipText;
    int lv_playerIndex;
    unit lv_spawnedWarhead;

    // Automatic Variable Declarations
    const int auto1EF1ABC4_ae = libCore_gv_bALMaxPlayers;
    const int auto1EF1ABC4_ai = 1;

    // Variable Initialization
    lv_canisterType = "WarheadSingle";
    lv_tooltipText = TextExpressionAssemble("Param/Expression/lib_MSC2_0162F03E");

    // Implementation
    SoundtrackStopCurrent(libCore_gv_allHeroPlayersPlusObserver, c_soundtrackCategoryMusic, true);
    libSond_gf_SoundtrackPlayMapSoundtrackAsDefaultSoundtrackForAllPlayers();
    libNtve_gf_CreateUnitsAtPoint2(1, lv_canisterType, c_unitCreateIgnorePlacement, libCore_gv_cOMPUTER_Neutral, lp_canisterSpawnLocation, null);
    lv_spawnedWarhead = UnitLastCreated();
    libNtve_gf_SendActorMessageToUnit(lv_spawnedWarhead, "Signal Reveal");
    UnitGroupAdd(libMSC2_gv_mMSC2BuiltWarheadsActive, lv_spawnedWarhead);
    libMSC2_gv_mMSC2BuiltWarheads[UnitGroupCount(libMSC2_gv_mMSC2BuiltWarheadsActive, c_unitCountAlive)] = lv_spawnedWarhead;
    RemovePointOfInterest(lp_canisterSpawnLocation, "Harvest", libNtve_ge_GoalTeam_Both);
    AddUnitOfInterest(lv_spawnedWarhead, libMSC2_gv_mMSC2NukePickupRange_C, 0.0, "Harvest", libNtve_ge_GoalTeam_Both, 0);
    TextTagCreate(lv_tooltipText, 24, UnitGetPosition(lv_spawnedWarhead), 2.0, true, true, PlayerGroupAll());
    libCore_gf_StoreTextTagForUnit(lv_spawnedWarhead, 1, TextTagLastCreated());
    TextTagAttachToUnit(TextTagLastCreated(), lv_spawnedWarhead, 4.0);
    libCore_gf_CreateMinimapPingStorm(PlayerGroupAll(), "StormAlertSilent", lp_canisterSpawnLocation, ColorWithAlpha(0,0,0,0), 4.0);
    PingSetScale(PingLastCreated(), 0.6);
    lv_playerIndex = 1;
    for ( ; ( (auto1EF1ABC4_ai >= 0 && lv_playerIndex <= auto1EF1ABC4_ae) || (auto1EF1ABC4_ai < 0 && lv_playerIndex >= auto1EF1ABC4_ae) ) ; lv_playerIndex += auto1EF1ABC4_ai ) {
        libNtve_gf_ShareVisionofUnit(lv_spawnedWarhead, true, lv_playerIndex);
    }
}

void libMSC2_gf_MMTodAddWaygate (int lp_waygateIndex, unit lp_waygateUnit, unit lp_topEntrance, unit lp_bottomEntrance) {
    // Automatic Variable Declarations
    // Implementation
    if (((lp_waygateUnit == null) || (lp_topEntrance == null) || (lp_bottomEntrance == null))) {
        TriggerDebugOutput(1, StringExternal("Param/Value/lib_MSC2_6202B8D5"), true);
    }

    if ((lp_waygateIndex > libMSC2_gv_mMFieldofSlaughterWaygateMaxCount_C)) {
        TextExpressionSetToken("Param/Expression/lib_MSC2_3695B24F", "A", IntToText(libMSC2_gv_mMFieldofSlaughterWaygateMaxCount_C));
        TriggerDebugOutput(1, TextExpressionAssemble("Param/Expression/lib_MSC2_3695B24F"), true);
        return ;
    }

    libMSC2_gv_mMToDWaygates[lp_waygateIndex].lv_topWaygate = lp_topEntrance;
    libNtve_gf_CreateUnitsWithDefaultFacing(1, "WaygateEntranceMinimapIconActor", c_unitCreateIgnorePlacement, libCore_gv_cOMPUTER_TeamOrder, UnitGetPosition(lp_topEntrance), null);
    libNtve_gf_CreateUnitsWithDefaultFacing(1, "WaygateEntranceMinimapIconActor", c_unitCreateIgnorePlacement, libCore_gv_cOMPUTER_TeamChaos, UnitGetPosition(lp_topEntrance), null);
    libMSC2_gv_mMToDWaygates[lp_waygateIndex].lv_bottomWaygate = lp_bottomEntrance;
    libNtve_gf_CreateUnitsWithDefaultFacing(1, "WaygateEntranceMinimapIconActor", c_unitCreateIgnorePlacement, libCore_gv_cOMPUTER_TeamOrder, UnitGetPosition(lp_bottomEntrance), null);
    libNtve_gf_CreateUnitsWithDefaultFacing(1, "WaygateEntranceMinimapIconActor", c_unitCreateIgnorePlacement, libCore_gv_cOMPUTER_TeamChaos, UnitGetPosition(lp_bottomEntrance), null);
}

void libMSC2_gf_MMToDActivateWaygates () {
    // Variable Declarations
    int lv_itWaygate;

    // Automatic Variable Declarations
    const int auto8005C6A1_ae = libMSC2_gv_mMFieldofSlaughterWaygateMaxCount_C;
    const int auto8005C6A1_ai = 1;
    const int auto22A05D4D_ae = libMSC2_gv_mMFieldofSlaughterWaygateMaxCount_C;
    const int auto22A05D4D_ai = 1;

    // Variable Initialization

    // Implementation
    lv_itWaygate = 1;
    for ( ; ( (auto8005C6A1_ai >= 0 && lv_itWaygate <= auto8005C6A1_ae) || (auto8005C6A1_ai < 0 && lv_itWaygate >= auto8005C6A1_ae) ) ; lv_itWaygate += auto8005C6A1_ai ) {
        if (true) {
            libNtve_gf_SendActorMessageToUnit(libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_topWaygate, "Signal EntranceActive");
            libNtve_gf_SendActorMessageToUnit(libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_bottomWaygate, "Signal EntranceActive");
        }

    }
    libCore_gf_CreateMinimapPingStorm(libGame_gv_teams[libGame_gv_teamOrderIndex_C].lv_teamPlayerGroupNoNPCPlayers, "StormAlert", UnitGetPosition(libMSC2_gv_mMToDWaygates[1].lv_topWaygate), ColorWithAlpha(100.00, 100.00, 0.00, 0.00), 4.5);
    libCore_gf_CreateMinimapPingStorm(libGame_gv_teams[libGame_gv_teamOrderIndex_C].lv_teamPlayerGroupNoNPCPlayers, "StormAlert", UnitGetPosition(libMSC2_gv_mMToDWaygates[1].lv_bottomWaygate), ColorWithAlpha(100.00, 100.00, 0.00, 0.00), 4.5);
    libCore_gf_CreateMinimapPingStorm(libGame_gv_teams[libGame_gv_teamChaosIndex_C].lv_teamPlayerGroupNoNPCPlayers, "StormAlert", UnitGetPosition(libMSC2_gv_mMToDWaygates[1].lv_bottomWaygate), ColorWithAlpha(100.00, 100.00, 0.00, 0.00), 4.5);
    libCore_gf_CreateMinimapPingStorm(libGame_gv_teams[libGame_gv_teamChaosIndex_C].lv_teamPlayerGroupNoNPCPlayers, "StormAlert", UnitGetPosition(libMSC2_gv_mMToDWaygates[1].lv_topWaygate), ColorWithAlpha(100.00, 100.00, 0.00, 0.00), 4.5);
    Wait(3.5, c_timeGame);
    lv_itWaygate = 1;
    for ( ; ( (auto22A05D4D_ai >= 0 && lv_itWaygate <= auto22A05D4D_ae) || (auto22A05D4D_ai < 0 && lv_itWaygate >= auto22A05D4D_ae) ) ; lv_itWaygate += auto22A05D4D_ai ) {
        if (true) {
            UnitSetState(libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_topWaygate, c_unitStateHighlightable, true);
            UnitSetState(libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_topWaygate, c_unitStateTargetable, true);
            UnitBehaviorAdd(libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_topWaygate, "MacguffinActivated", libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_topWaygate, 1);
            UnitBehaviorRemove(libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_topWaygate, "UnitCannotBePinged", 1);
            UnitSetState(libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_bottomWaygate, c_unitStateHighlightable, true);
            UnitSetState(libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_bottomWaygate, c_unitStateTargetable, true);
            UnitBehaviorAdd(libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_bottomWaygate, "MacguffinActivated", libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_bottomWaygate, 1);
            UnitBehaviorRemove(libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_bottomWaygate, "UnitCannotBePinged", 1);
            AIAddPortal(libCore_gv_cOMPUTER_TeamOrder, libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_topWaygate, libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_bottomWaygate, 2.0, 0.0, "CaptureMacGuffinTwo", null);
            AIAddPortal(libCore_gv_cOMPUTER_TeamChaos, libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_bottomWaygate, libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_topWaygate, 2.0, 0.0, "CaptureMacGuffinTwo", null);
        }

    }
    TextTagCreate(StringExternal("Param/Value/lib_MSC2_738BDC22"), 20, UnitGetPosition(libMSC2_gv_mMToDWaygates[1].lv_topWaygate), 1.0, true, false, libCore_gv_allHeroPlayersPlusObserver);
    TextTagShow(TextTagLastCreated(), libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], false);
    TextTagCreate(StringExternal("Param/Value/lib_MSC2_2EC773A5"), 20, UnitGetPosition(libMSC2_gv_mMToDWaygates[1].lv_bottomWaygate), 1.0, true, false, libCore_gv_allHeroPlayersPlusObserver);
    TextTagShow(TextTagLastCreated(), libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], false);
    Wait(1.5, c_timeGame);
}

int libMSC2_gf_MMSC2NukeCountforTeam (int lp_team) {
    // Variable Declarations
    int lv_itPlayer;
    int lv_count;

    // Automatic Variable Declarations
    playergroup auto45FA20BC_g;

    // Variable Initialization

    // Implementation
    auto45FA20BC_g = libGame_gf_PlayersOnTeamHeroes(lp_team, false);
    lv_itPlayer = -1;
    while (true) {
        	lv_itPlayer = PlayerGroupNextPlayer(auto45FA20BC_g, lv_itPlayer);
        	if (lv_itPlayer<0) { break; }
        	lv_count += libMSC2_gf_MMSC2CountofNukesForPlayer(lv_itPlayer);
    }
    return lv_count;
}

void libMSC2_gf_MMSC2UpdateNukeTextTagsForPlayers () {
    // Variable Declarations
    int lv_itPlayer;

    // Automatic Variable Declarations
    int auto67C561B1_ae;

    // Variable Initialization

    // Implementation
    auto67C561B1_ae = libCore_gv_bALMaxPlayers;
    lv_itPlayer = 1;
    for ( ; lv_itPlayer <= auto67C561B1_ae ; lv_itPlayer += 1 ) {
        if ((libMSC2_gf_MMSC2CountofNukesForPlayer(lv_itPlayer) > 0)) {
            libMSC2_gf_MMSC2ShowHideNukeTextTagsForPlayer(false, lv_itPlayer);
        }

    }
}

void libMSC2_gf_MMSC2ShowHideNukeTextTagsForPlayer (bool lp_showHide, int lp_player) {
    // Variable Declarations
    unit lv_itUnit;

    // Automatic Variable Declarations
    unitgroup autoD415EA51_g;
    int autoD415EA51_u;

    // Variable Initialization

    // Implementation
    autoD415EA51_g = libMSC2_gv_mMSC2BuiltWarheadsActive;
    autoD415EA51_u = UnitGroupCount(autoD415EA51_g, c_unitCountAll);
    for (;; autoD415EA51_u -= 1) {
        lv_itUnit = UnitGroupUnitFromEnd(autoD415EA51_g, autoD415EA51_u);
        if (lv_itUnit == null) { break; }
        TextTagShow(libCore_gf_TextTagStoredForUnit(lv_itUnit, 1), PlayerGroupSingle(lp_player), lp_showHide);
    }
}

void libMSC2_gf_MMSC2NukeDamageScalingOnPickup (int lp_playerIndex) {
    // Variable Declarations
    int lv_damageScalesForAlignment;

    // Automatic Variable Declarations
    // Variable Initialization

    // Implementation
    lv_damageScalesForAlignment = (libMSC2_gv_mMSC2NukeDamageScalesNeeded - libMSC2_gv_mMSC2NukeDamageScalesDone[lp_playerIndex]);
    CatalogFieldValueModify(c_gameCatalogEffect, "NukeOuterImpactDamage", "Amount", lp_playerIndex, FixedToString((70.0 * lv_damageScalesForAlignment), c_fixedPrecisionAny), c_upgradeOperationAdd);
    CatalogFieldValueModify(c_gameCatalogEffect, "NukeOuterImpactDamageStructure", "Amount", lp_playerIndex, FixedToString((70.0 * lv_damageScalesForAlignment), c_fixedPrecisionAny), c_upgradeOperationAdd);
    CatalogFieldValueModify(c_gameCatalogEffect, "NukeStructureBurnPeriodicDamage", "Amount", lp_playerIndex, FixedToString((4.8 * lv_damageScalesForAlignment), c_fixedPrecisionAny), c_upgradeOperationAdd);
    libMSC2_gv_mMSC2NukeDamageScalesDone[lp_playerIndex] += lv_damageScalesForAlignment;
}

trigger auto_libMSC2_gf_MMSC2ArmNukeForUnit_Trigger = null;
unit auto_libMSC2_gf_MMSC2ArmNukeForUnit_lp_unit;

void libMSC2_gf_MMSC2ArmNukeForUnit (unit lp_unit) {
    auto_libMSC2_gf_MMSC2ArmNukeForUnit_lp_unit = lp_unit;

    if (auto_libMSC2_gf_MMSC2ArmNukeForUnit_Trigger == null) {
        auto_libMSC2_gf_MMSC2ArmNukeForUnit_Trigger = TriggerCreate("auto_libMSC2_gf_MMSC2ArmNukeForUnit_TriggerFunc");
    }

    TriggerExecute(auto_libMSC2_gf_MMSC2ArmNukeForUnit_Trigger, false, false);
}

bool auto_libMSC2_gf_MMSC2ArmNukeForUnit_TriggerFunc (bool testConds, bool runActions) {
    unit lp_unit = auto_libMSC2_gf_MMSC2ArmNukeForUnit_lp_unit;

    // Variable Declarations
    int lv_player;
    int lv_allyTeam;
    int lv_enemyTeam;
    unit lv_varUnit;

    // Automatic Variable Declarations
    // Variable Initialization

    // Implementation
    lv_player = UnitGetOwner(lp_unit);
    if ((UnitFilterMatch(lp_unit, lv_player, UnitFilter(0, (1 << (c_targetFilterHallucination - 32)), 0, 0)) == true)) {
        lv_varUnit = libGame_gv_players[lv_player].lv_heroUnit;
    }
    else {
        lv_varUnit = lp_unit;
    }
    lv_allyTeam = libGame_gf_TeamNumberOfPlayer(lv_player);
    lv_enemyTeam = libGame_gf_EnemyTeam(lv_allyTeam);
    UnitBehaviorAdd(lv_varUnit, "HasMapMechanicTargetAbility", lv_varUnit, 1);
    UnitModifyCooldown(lv_varUnit, "Abil/MapMechanicNuke", libMSC2_gv_mMSC2NukeArmingDuration_C, c_cooldownOperationMax);
    UnitModifyCooldown(lv_varUnit, "Abil/MapMechanicAbilityTarget", libMSC2_gv_mMSC2NukeArmingDuration_C, c_cooldownOperationMax);
    libMSC2_gf_MMSC2ShowHideNukeTextTagsForPlayer(false, lv_player);
    libMSC2_gf_MMSC2NukeButtonStartFlashingForPlayer(lv_player);
    libMSC2_gf_MMSC2NukeDamageScalingOnPickup(lv_player);
    libGame_gf_ScoreValuesReportIntegerValueAndLog(lv_player, "CarriedMechanic", 1);
    libMSC2_gv_mMSC2_Nuke_Info.lv_playerNukeStateChanged[lv_player] = true;
    libNtve_gf_SendActorMessageToUnit(libMSC2_gv_nukeSiloUnit[lv_allyTeam], "Signal Activate");
    if ((libMSC2_gv_mMSC2_Nuke_Info.lv_teamHasNukes[lv_allyTeam] == true)) {
        libMSC2_gf_MMSC2UIEnableNukeUIStateForPlayer(lv_player);
    }
    else {
        libMSC2_gv_mMSC2_Nuke_Info.lv_teamHasNukes[lv_allyTeam] = true;
        libMSC2_gf_MMSC2UIEnableNukeUIStateForPlayer(lv_player);
    }
    return true;
}

void libMSC2_gf_MMSC2PlayerUsesNuke (unit lp_unit) {
    // Variable Declarations
    int lv_nukesi;
    int lv_player;
    playergroup lv_allyPlayerGroup;
    playergroup lv_enemyPlayerGroup;
    int lv_allyTeam;
    int lv_enemyTeam;

    // Automatic Variable Declarations
    unitgroup auto0D10A15E_g;
    int auto0D10A15E_u;
    unit auto0D10A15E_var;
    int autoF6C2C763_val;

    // Variable Initialization
    lv_allyPlayerGroup = PlayerGroupEmpty();
    lv_enemyPlayerGroup = PlayerGroupEmpty();

    // Implementation
    lv_player = UnitGetOwner(lp_unit);
    lv_allyTeam = libGame_gf_TeamNumberOfPlayer(lv_player);
    lv_allyPlayerGroup = GameAttributePlayersForTeam(lv_allyTeam);
    PlayerGroupRemove(lv_allyPlayerGroup, lv_player);
    lv_enemyTeam = libGame_gf_EnemyTeam(lv_allyTeam);
    lv_enemyPlayerGroup = GameAttributePlayersForTeam(lv_enemyTeam);
    libMSC2_gf_MMSC2TransmissionPlayerFiresNuke(lv_player);
    libGame_gf_ScoreValuesReportIntegerValueAndLog(lv_player, "CarriedMechanic", 0);
    libMSC2_gv_mMSC2_Nuke_Info.lv_playerNukeStateChanged[lv_player] = true;
    if ((UnitGetType(libGame_gv_players[lv_player].lv_heroUnit) == "HeroLostVikingsController")) {
        auto0D10A15E_g = libGame_gv_players[lv_player].lv_heroUnitGroup;
        auto0D10A15E_u = UnitGroupCount(auto0D10A15E_g, c_unitCountAll);
        for (;; auto0D10A15E_u -= 1) {
            auto0D10A15E_var = UnitGroupUnitFromEnd(auto0D10A15E_g, auto0D10A15E_u);
            if (auto0D10A15E_var == null) { break; }
            if ((UnitBehaviorCount(auto0D10A15E_var, "HasMapMechanicTargetAbility") == 1)) {
                lv_nukesi += 1;
            }
        }
    }
    if ((lv_nukesi == 0)) {
        libNtve_gf_SetUpgradeLevelForPlayer(lv_player, "DisplayLockedMapMechanicAbility", 1);
    }

    libMSC2_gf_MMSC2UIDisableNukeUIStateForPlayer(lv_player);
    libMSC2_gf_MMSC2NukeButtonStopFlashingForPlayer(lv_player);
    libMSC2_gf_MMSC2ShowHideNukeTextTagsForPlayer(true, lv_player);
    autoF6C2C763_val = lv_allyTeam;
    if (autoF6C2C763_val == libGame_gv_teamOrderIndex_C) {
        libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel[lv_allyTeam], IntToText(libMSC2_gf_MMSC2NukeCountforTeam(lv_allyTeam)), PlayerGroupAll());
    }
    else if (autoF6C2C763_val == libGame_gv_teamChaosIndex_C) {
        libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel2[lv_allyTeam], IntToText(libMSC2_gf_MMSC2NukeCountforTeam(lv_allyTeam)), PlayerGroupAll());
    }
    else {
    }
    if ((libMSC2_gf_MMSC2NukeCountforTeam(lv_allyTeam) == 0)) {
        libMSC2_gv_mMSC2_Nuke_Info.lv_teamHasNukes[lv_allyTeam] = false;
        libNtve_gf_SendActorMessageToUnit(libMSC2_gv_nukeSiloUnit[lv_allyTeam], "Signal Deactivate");
    }

    StatEventCreate("WarheadJunctionNukeFired");
    StatEventAddDataFixed(StatEventLastCreated(), "GameTime", libUIUI_gf_HeroesGameTime());
    StatEventAddDataInt(StatEventLastCreated(), "OwningTeam", lv_allyTeam);
    StatEventSend(StatEventLastCreated());
}

void libMSC2_gf_MMSC2CanisterPlaformPlayBirthAnimations (doodad lp_doodad) {
    // Automatic Variable Declarations
    // Implementation
    if ((TimerGetRemaining(libMSC2_gv_mMSC2TerrazineMainEventTimer) > 5.0)) {
        ActorSend(ActorFromDoodad(lp_doodad), "Signal SpawnNukeTimer");
    }
    else {
        ActorSend(ActorFromDoodad(lp_doodad), "Signal SpawnNuke");
    }
}

trigger auto_libMSC2_gf_MMSC2CanisterEventDone_Trigger = null;

void libMSC2_gf_MMSC2CanisterEventDone () {
    if (auto_libMSC2_gf_MMSC2CanisterEventDone_Trigger == null) {
        auto_libMSC2_gf_MMSC2CanisterEventDone_Trigger = TriggerCreate("auto_libMSC2_gf_MMSC2CanisterEventDone_TriggerFunc");
    }

    TriggerExecute(auto_libMSC2_gf_MMSC2CanisterEventDone_Trigger, false, false);
}

bool auto_libMSC2_gf_MMSC2CanisterEventDone_TriggerFunc (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_iLane;

    // Automatic Variable Declarations
    const int autoE982A65E_ae = 3;
    const int autoE982A65E_ai = 1;

    // Variable Initialization

    // Implementation
    Wait(3.5, c_timeGame);
    lv_iLane = 1;
    for ( ; ( (autoE982A65E_ai >= 0 && lv_iLane <= autoE982A65E_ae) || (autoE982A65E_ai < 0 && lv_iLane >= autoE982A65E_ae) ) ; lv_iLane += autoE982A65E_ai ) {
        if ((libMSC2_gv_mMSC2WarheadData[lv_iLane].lv_leftCanisterDoodad != null)) {
            ActorSend(ActorFromDoodad(libMSC2_gv_mMSC2WarheadData[lv_iLane].lv_leftCanisterDoodad), "Signal EventDone");
        }

        if ((libMSC2_gv_mMSC2WarheadData[lv_iLane].lv_rightCanisterDoodad != null)) {
            ActorSend(ActorFromDoodad(libMSC2_gv_mMSC2WarheadData[lv_iLane].lv_rightCanisterDoodad), "Signal EventDone");
        }

        if ((libMSC2_gv_mMSC2WarheadData[lv_iLane].lv_middleCanisterDoodad != null)) {
            ActorSend(ActorFromDoodad(libMSC2_gv_mMSC2WarheadData[lv_iLane].lv_middleCanisterDoodad), "Signal EventDone");
        }

    }
    return true;
}

trigger auto_libMSC2_gf_MMSC2PlayVOSoundforPlayer_Trigger = null;
soundlink auto_libMSC2_gf_MMSC2PlayVOSoundforPlayer_lp_vOSound;
int auto_libMSC2_gf_MMSC2PlayVOSoundforPlayer_lp_player;

void libMSC2_gf_MMSC2PlayVOSoundforPlayer (soundlink lp_vOSound, int lp_player) {
    auto_libMSC2_gf_MMSC2PlayVOSoundforPlayer_lp_vOSound = lp_vOSound;
    auto_libMSC2_gf_MMSC2PlayVOSoundforPlayer_lp_player = lp_player;

    if (auto_libMSC2_gf_MMSC2PlayVOSoundforPlayer_Trigger == null) {
        auto_libMSC2_gf_MMSC2PlayVOSoundforPlayer_Trigger = TriggerCreate("auto_libMSC2_gf_MMSC2PlayVOSoundforPlayer_TriggerFunc");
    }

    TriggerExecute(auto_libMSC2_gf_MMSC2PlayVOSoundforPlayer_Trigger, false, false);
}

bool auto_libMSC2_gf_MMSC2PlayVOSoundforPlayer_TriggerFunc (bool testConds, bool runActions) {
    soundlink lp_vOSound = auto_libMSC2_gf_MMSC2PlayVOSoundforPlayer_lp_vOSound;
    int lp_player = auto_libMSC2_gf_MMSC2PlayVOSoundforPlayer_lp_player;

    // Automatic Variable Declarations
    // Implementation
    if (((libGame_gv_gameOver == true) || (libMSC2_gv_mMSC2GlobalConversationPlaying == true) || (PlayerGroupHasPlayer(libMSC2_gv_mMSC2VOSoundPlaying, lp_player) == true))) {
        return true;
    }

    PlayerGroupAdd(libMSC2_gv_mMSC2VOSoundPlaying, lp_player);
    SoundPlayForPlayer(lp_vOSound, c_maxPlayers, PlayerGroupSingle(lp_player), 100.0, 0.0);
    SoundWait(SoundLastPlayed(), 0.0, c_soundOffsetEnd);
    PlayerGroupRemove(libMSC2_gv_mMSC2VOSoundPlaying, lp_player);
    return true;
}

trigger auto_libMSC2_gf_MMSC2TransmissionWarheadSpawnWarningQ_Trigger = null;

void libMSC2_gf_MMSC2TransmissionWarheadSpawnWarningQ () {
    if (auto_libMSC2_gf_MMSC2TransmissionWarheadSpawnWarningQ_Trigger == null) {
        auto_libMSC2_gf_MMSC2TransmissionWarheadSpawnWarningQ_Trigger = TriggerCreate("auto_libMSC2_gf_MMSC2TransmissionWarheadSpawnWarningQ_TriggerFunc");
    }

    TriggerExecute(auto_libMSC2_gf_MMSC2TransmissionWarheadSpawnWarningQ_Trigger, false, false);
}

bool auto_libMSC2_gf_MMSC2TransmissionWarheadSpawnWarningQ_TriggerFunc (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Implementation
    if ((libGame_gv_gameOver == true)) {
        return true;
    }

    TriggerQueueEnter();
    libMSC2_gv_mMSC2GlobalConversationPlaying = true;
    while (!((PlayerGroupCount(libMSC2_gv_mMSC2VOSoundPlaying) == 0))) {
        Wait(0.125, c_timeGame);
    }
    UserDataResetType("MapVOEvent");
    UserDataSetInt("MapVOEvent", "Uranium Warning", "Value", 1, 1);
    ConversationDataRun("NukeVO", PlayerGroupAll(), c_conversationSkipNone, false);
    libCore_gf_WaitForConversationToFinish();
    libMSC2_gv_mMSC2GlobalConversationPlaying = false;
    TriggerQueueExit();
    return true;
}

trigger auto_libMSC2_gf_MMSC2TransmissionWarheadsSpawnedQ_Trigger = null;

void libMSC2_gf_MMSC2TransmissionWarheadsSpawnedQ () {
    if (auto_libMSC2_gf_MMSC2TransmissionWarheadsSpawnedQ_Trigger == null) {
        auto_libMSC2_gf_MMSC2TransmissionWarheadsSpawnedQ_Trigger = TriggerCreate("auto_libMSC2_gf_MMSC2TransmissionWarheadsSpawnedQ_TriggerFunc");
    }

    TriggerExecute(auto_libMSC2_gf_MMSC2TransmissionWarheadsSpawnedQ_Trigger, false, false);
}

bool auto_libMSC2_gf_MMSC2TransmissionWarheadsSpawnedQ_TriggerFunc (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Implementation
    Wait(0.85, c_timeGame);
    if ((libGame_gv_gameOver == true)) {
        return true;
    }

    TriggerQueueEnter();
    libMSC2_gv_mMSC2GlobalConversationPlaying = true;
    while (!((PlayerGroupCount(libMSC2_gv_mMSC2VOSoundPlaying) == 0))) {
        Wait(0.125, c_timeGame);
    }
    UserDataResetType("MapVOEvent");
    UserDataSetInt("MapVOEvent", "Uranium Spawned", "Value", 1, 1);
    ConversationDataRun("NukeVO", PlayerGroupAll(), c_conversationSkipNone, false);
    libCore_gf_WaitForConversationToFinish();
    libMSC2_gv_mMSC2GlobalConversationPlaying = false;
    TriggerQueueExit();
    return true;
}

trigger auto_libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke_Trigger = null;
int auto_libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke_lp_player;

void libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke (int lp_player) {
    auto_libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke_lp_player = lp_player;

    if (auto_libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke_Trigger == null) {
        auto_libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke_Trigger = TriggerCreate("auto_libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke_TriggerFunc");
    }

    TriggerExecute(auto_libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke_Trigger, false, false);
}

bool auto_libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke_TriggerFunc (bool testConds, bool runActions) {
    int lp_player = auto_libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke_lp_player;

    // Variable Declarations
    int lv_randomInt;

    // Automatic Variable Declarations
    int auto0968BB4A_val;

    // Variable Initialization

    // Implementation
    if (((libGame_gv_gameOver == true) || (libMSC2_gv_mMSC2GlobalConversationPlaying == true) || (PlayerGroupHasPlayer(libMSC2_gv_mMSC2VOSoundPlaying, lp_player) == true))) {
        return true;
    }

    lv_randomInt = RandomInt(1, 3);
    auto0968BB4A_val = lv_randomInt;
    if (auto0968BB4A_val == 1) {
        libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_091", -1), lp_player);
    }
    else if (auto0968BB4A_val == 2) {
        libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_092", -1), lp_player);
    }
    else if (auto0968BB4A_val == 3) {
        libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_093", -1), lp_player);
    }
    else {
    }
    return true;
}

trigger auto_libMSC2_gf_MMSC2TransmissionPlayerNukeReady_Trigger = null;
int auto_libMSC2_gf_MMSC2TransmissionPlayerNukeReady_lp_player;

void libMSC2_gf_MMSC2TransmissionPlayerNukeReady (int lp_player) {
    auto_libMSC2_gf_MMSC2TransmissionPlayerNukeReady_lp_player = lp_player;

    if (auto_libMSC2_gf_MMSC2TransmissionPlayerNukeReady_Trigger == null) {
        auto_libMSC2_gf_MMSC2TransmissionPlayerNukeReady_Trigger = TriggerCreate("auto_libMSC2_gf_MMSC2TransmissionPlayerNukeReady_TriggerFunc");
    }

    TriggerExecute(auto_libMSC2_gf_MMSC2TransmissionPlayerNukeReady_Trigger, false, false);
}

bool auto_libMSC2_gf_MMSC2TransmissionPlayerNukeReady_TriggerFunc (bool testConds, bool runActions) {
    int lp_player = auto_libMSC2_gf_MMSC2TransmissionPlayerNukeReady_lp_player;

    // Variable Declarations
    int lv_randomInt;

    // Automatic Variable Declarations
    int autoB021BBC9_val;

    // Variable Initialization

    // Implementation
    if (((libGame_gv_gameOver == true) || (libMSC2_gv_mMSC2GlobalConversationPlaying == true) || (PlayerGroupHasPlayer(libMSC2_gv_mMSC2VOSoundPlaying, lp_player) == true))) {
        return true;
    }

    lv_randomInt = RandomInt(1, 3);
    autoB021BBC9_val = lv_randomInt;
    if (autoB021BBC9_val == 1) {
        libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_094", -1), lp_player);
    }
    else if (autoB021BBC9_val == 2) {
        libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_095", -1), lp_player);
    }
    else if (autoB021BBC9_val == 3) {
        libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_096", -1), lp_player);
    }
    else {
    }
    return true;
}

trigger auto_libMSC2_gf_MMSC2TransmissionPlayerFiresNuke_Trigger = null;
int auto_libMSC2_gf_MMSC2TransmissionPlayerFiresNuke_lp_player;

void libMSC2_gf_MMSC2TransmissionPlayerFiresNuke (int lp_player) {
    auto_libMSC2_gf_MMSC2TransmissionPlayerFiresNuke_lp_player = lp_player;

    if (auto_libMSC2_gf_MMSC2TransmissionPlayerFiresNuke_Trigger == null) {
        auto_libMSC2_gf_MMSC2TransmissionPlayerFiresNuke_Trigger = TriggerCreate("auto_libMSC2_gf_MMSC2TransmissionPlayerFiresNuke_TriggerFunc");
    }

    TriggerExecute(auto_libMSC2_gf_MMSC2TransmissionPlayerFiresNuke_Trigger, false, false);
}

bool auto_libMSC2_gf_MMSC2TransmissionPlayerFiresNuke_TriggerFunc (bool testConds, bool runActions) {
    int lp_player = auto_libMSC2_gf_MMSC2TransmissionPlayerFiresNuke_lp_player;

    // Variable Declarations
    int lv_team;
    int lv_enemyTeam;
    int lv_itPlayer;
    playergroup lv_groupOrder;
    playergroup lv_groupChaos;
    playergroup lv_groupEnemies;
    playergroup lv_observers;
    playergroup lv_listeningPlayers;
    int lv_randomInt;

    // Automatic Variable Declarations
    int autoF561B23D_val;
    playergroup auto6C8DC4A2_g;
    int auto77E832DC_val;
    playergroup auto449A52E7_g;
    int autoBDBF9CA4_val;
    int auto9764D223_val;

    // Variable Initialization
    lv_groupOrder = PlayerGroupEmpty();
    lv_groupChaos = PlayerGroupEmpty();
    lv_groupEnemies = PlayerGroupEmpty();
    lv_observers = PlayerGroupEmpty();
    lv_listeningPlayers = PlayerGroupEmpty();

    // Implementation
    if (((libGame_gv_gameOver == true) || (libMSC2_gv_mMSC2GlobalConversationPlaying == true))) {
        return true;
    }

    lv_team = libGame_gf_TeamNumberOfPlayer(lp_player);
    lv_enemyTeam = libGame_gf_EnemyTeam(lv_team);
    lv_groupEnemies = libGame_gf_PlayersOnTeamHeroes(lv_enemyTeam, false);
    lv_observers = libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer];
    if ((PlayerGroupHasPlayer(libMSC2_gv_mMSC2VOSoundPlaying, lp_player) == false)) {
        lv_randomInt = RandomInt(1, 4);
        autoF561B23D_val = lv_randomInt;
        if (autoF561B23D_val == 1) {
            libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_144", -1), lp_player);
        }
        else if (autoF561B23D_val == 2) {
            libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_145", -1), lp_player);
        }
        else if (autoF561B23D_val == 3) {
            libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_146", -1), lp_player);
        }
        else if (autoF561B23D_val == 4) {
            libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_147", -1), lp_player);
        }
        else {
        }
    }

    auto6C8DC4A2_g = lv_groupEnemies;
    lv_itPlayer = -1;
    while (true) {
        	lv_itPlayer = PlayerGroupNextPlayer(auto6C8DC4A2_g, lv_itPlayer);
        	if (lv_itPlayer<0) { break; }
        	if ((PlayerGroupHasPlayer(libMSC2_gv_mMSC2VOSoundPlaying, lv_itPlayer) == false)) {
            lv_randomInt = RandomInt(1, 4);
            auto77E832DC_val = lv_randomInt;
            if (auto77E832DC_val == 1) {
                libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_097", -1), lv_itPlayer);
            }
            else if (auto77E832DC_val == 2) {
                libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_098", -1), lv_itPlayer);
            }
            else if (auto77E832DC_val == 3) {
                libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_099", -1), lv_itPlayer);
            }
            else if (auto77E832DC_val == 4) {
                libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_100", -1), lv_itPlayer);
            }
            else {
            }
        }

    }
    auto449A52E7_g = lv_observers;
    lv_itPlayer = -1;
    while (true) {
        	lv_itPlayer = PlayerGroupNextPlayer(auto449A52E7_g, lv_itPlayer);
        	if (lv_itPlayer<0) { break; }
        	if ((PlayerGroupHasPlayer(libMSC2_gv_mMSC2VOSoundPlaying, lv_itPlayer) == false)) {
            lv_randomInt = RandomInt(1, 2);
            if ((lv_team == libGame_gv_teamOrderIndex_C)) {
                auto9764D223_val = lv_randomInt;
                if (auto9764D223_val == 1) {
                    libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_121", -1), lv_itPlayer);
                }
                else if (auto9764D223_val == 2) {
                    libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_122", -1), lv_itPlayer);
                }
                else {
                }
            }
            else {
                autoBDBF9CA4_val = lv_randomInt;
                if (autoBDBF9CA4_val == 1) {
                    libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_125", -1), lv_itPlayer);
                }
                else if (autoBDBF9CA4_val == 2) {
                    libMSC2_gf_MMSC2PlayVOSoundforPlayer(SoundLink("NukeVO_Adjutant_126", -1), lv_itPlayer);
                }
                else {
                }
            }
        }

    }
    return true;
}

trigger auto_libMSC2_gf_MMSC2TransmissionAllNukesCollectedQ_Trigger = null;

void libMSC2_gf_MMSC2TransmissionAllNukesCollectedQ () {
    if (auto_libMSC2_gf_MMSC2TransmissionAllNukesCollectedQ_Trigger == null) {
        auto_libMSC2_gf_MMSC2TransmissionAllNukesCollectedQ_Trigger = TriggerCreate("auto_libMSC2_gf_MMSC2TransmissionAllNukesCollectedQ_TriggerFunc");
    }

    TriggerExecute(auto_libMSC2_gf_MMSC2TransmissionAllNukesCollectedQ_Trigger, false, false);
}

bool auto_libMSC2_gf_MMSC2TransmissionAllNukesCollectedQ_TriggerFunc (bool testConds, bool runActions) {
    // Variable Declarations
    playergroup lv_groupOrder;
    playergroup lv_groupChaos;
    playergroup lv_observers;

    // Automatic Variable Declarations
    // Variable Initialization
    lv_groupOrder = PlayerGroupEmpty();
    lv_groupChaos = PlayerGroupEmpty();
    lv_observers = PlayerGroupEmpty();

    // Implementation
    if ((libGame_gv_gameOver == true)) {
        return true;
    }

    TriggerQueueEnter();
    libMSC2_gv_mMSC2GlobalConversationPlaying = true;
    while (!((PlayerGroupCount(libMSC2_gv_mMSC2VOSoundPlaying) == 0))) {
        Wait(0.125, c_timeGame);
    }
    UserDataResetType("MapVOEvent");
    UserDataSetInt("MapVOEvent", "Nuke Collected - All", "Value", 1, 1);
    ConversationDataRun("NukeVO", PlayerGroupAll(), c_conversationSkipNone, false);
    libCore_gf_WaitForConversationToFinish();
    libMSC2_gv_mMSC2GlobalConversationPlaying = false;
    TriggerQueueExit();
    return true;
}

void libMSC2_gf_MMSC2UIInit (int lp_parentPanel) {
    int init_i;

    // Variable Declarations
    int[6] lv_panels;
    int lv_currentPanelLayer;
    int lv_enemyTeam;
    int lv_itTeam;
    int lv_itPlayerNukeUI;
    int lv_itNukeImageIndex;
    int lv_itPlayerNuke;
    int lv_iNukePlayerSlot;

    // Automatic Variable Declarations
    const int auto2B82C4EA_ae = libCore_gv_bALMaxTeams;
    const int auto2B82C4EA_ai = 1;
    int auto7EB89CF5_val;
    int autoBD30C97A_val;
    int autoA9B5E424_val;
    int auto930AC329_ae;
    int auto2F789A31_ae;

    // Variable Initialization
    for (init_i = 0; init_i <= 5; init_i += 1) {
        lv_panels[init_i] = c_invalidDialogControlId;
    }

    // Implementation
    DialogControlSetAnimationState(libUIUI_gv_uIGameUIHandles.lv_gameUIContainer, PlayerGroupAll(), "SingleStackCarryBehavior", "True");
    DialogControlCreateInPanelFromTemplate(lp_parentPanel, c_triggerControlTypePanel, "SCMap2/SC2Panel");
    lv_currentPanelLayer += 1;
    lv_panels[lv_currentPanelLayer] = DialogControlLastCreated();
    libMSC2_gv_mMSC2UIPanel.lv_capturePointsPanel = DialogControlLastCreated();
    DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypePanel, "TerrazineEruptionFrame");
    DialogControlSetVisible(DialogControlLastCreated(), PlayerGroupAll(), false);
    lv_currentPanelLayer += 1;
    lv_panels[lv_currentPanelLayer] = DialogControlLastCreated();
    libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeFrame = DialogControlLastCreated();
    DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeLabel, "EruptionInfoLabel");
    libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeNameLabel = DialogControlLastCreated();
    DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeLabel, "EruptionTimerLabel");
    libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeTimeLabel = DialogControlLastCreated();
    DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeLabel, "EruptionQuantityLabel");
    libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeQuantityLabel = DialogControlLastCreated();
    lv_currentPanelLayer -= 1;
    DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypePanel, "TerrazineBuffFrame");
    DialogControlSetVisible(DialogControlLastCreated(), PlayerGroupAll(), false);
    lv_currentPanelLayer += 1;
    lv_panels[lv_currentPanelLayer] = DialogControlLastCreated();
    libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseFrame = DialogControlLastCreated();
    DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeLabel, "BuffInfoLabel");
    libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseInfoLabel = DialogControlLastCreated();
    DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeLabel, "BuffTimerLabel");
    libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel = DialogControlLastCreated();
    DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeImage, "TimerImage");
    DialogControlHookup(DialogControlLastCreated(), c_triggerControlTypeImage, "TimerImageSmall");
    libNtve_gf_SetDialogItemAcceptMouse(DialogControlLastCreated(), true, PlayerGroupAll());
    libNtve_gf_SetDialogItemTooltip(DialogControlLastCreated(), StringToText(""), PlayerGroupAll());
    lv_currentPanelLayer -= 1;
    lv_itTeam = 1;
    for ( ; ( (auto2B82C4EA_ai >= 0 && lv_itTeam <= auto2B82C4EA_ae) || (auto2B82C4EA_ai < 0 && lv_itTeam >= auto2B82C4EA_ae) ) ; lv_itTeam += auto2B82C4EA_ai ) {
        lv_enemyTeam = (3 - lv_itTeam);
        auto7EB89CF5_val = lv_itTeam;
        if (auto7EB89CF5_val == libGame_gv_teamOrderIndex_C) {
            DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypePanel, "Team1TerrazineFrame");
        }
        else if (auto7EB89CF5_val == libGame_gv_teamChaosIndex_C) {
            DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypePanel, "Team2TerrazineFrame");
        }
        else {
        }
        lv_currentPanelLayer += 1;
        lv_panels[lv_currentPanelLayer] = DialogControlLastCreated();
        libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeFrame[lv_itTeam] = DialogControlLastCreated();
        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeImage, "BackgroundBlue");
        libMSC2_gv_mMSC2UIPanel.lv_backgroundImageBlueLeft[lv_itTeam] = DialogControlLastCreated();
        if ((lv_itTeam == libGame_gv_teamChaosIndex_C)) {
            DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_backgroundImageBlueLeft[1], libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], true);
        }

        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeImage, "TerrazineIconBlue");
        libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageBlueLeft[lv_itTeam] = DialogControlLastCreated();
        if ((lv_itTeam == libGame_gv_teamChaosIndex_C)) {
            DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageBlueLeft[1], libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], true);
        }

        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeImage, "BackgroundRed");
        libMSC2_gv_mMSC2UIPanel.lv_backgroundImageRedLeft[lv_itTeam] = DialogControlLastCreated();
        if ((lv_itTeam == libGame_gv_teamOrderIndex_C)) {
            DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_backgroundImageRedLeft[1], libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], false);
        }

        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeImage, "TerrazineIconRed");
        libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageRedLeft[lv_itTeam] = DialogControlLastCreated();
        if ((lv_itTeam == libGame_gv_teamOrderIndex_C)) {
            DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageRedLeft[1], libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], false);
        }

        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeLabel, "TerrazineCounter");
        libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel[lv_itTeam] = DialogControlLastCreated();
        autoBD30C97A_val = lv_itTeam;
        if (autoBD30C97A_val == libGame_gv_teamOrderIndex_C) {
            libNtve_gf_SetDialogItemStyle(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel[1], "Storm_MapMechanic_MechanicCounterRight_Blue", libGame_gv_teams[libGame_gv_teamOrderIndex_C].lv_teamPlayerGroupNoNPCPlayers);
            libNtve_gf_SetDialogItemStyle(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel[1], "Storm_MapMechanic_MechanicCounterRight_Blue", libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer]);
        }
        else if (autoBD30C97A_val == libGame_gv_teamChaosIndex_C) {
            libNtve_gf_SetDialogItemStyle(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel[2], "Storm_MapMechanic_MechanicCounterRight_Red", libGame_gv_teams[libGame_gv_teamChaosIndex_C].lv_teamPlayerGroupNoNPCPlayers);
        }
        else {
        }
        lv_currentPanelLayer -= 1;
        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypePanel, "Team2TerrazineFrame");
        lv_currentPanelLayer += 1;
        lv_panels[lv_currentPanelLayer] = DialogControlLastCreated();
        libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeFrame[lv_itTeam] = DialogControlLastCreated();
        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeImage, "BackgroundBlue");
        libMSC2_gv_mMSC2UIPanel.lv_backgroundImageBlueRight[lv_itTeam] = DialogControlLastCreated();
        if ((lv_itTeam == libGame_gv_teamChaosIndex_C)) {
            DialogControlSetVisible(DialogControlLastCreated(), libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], false);
        }

        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeImage, "TerrazineIconBlue");
        libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageBlueRight[lv_itTeam] = DialogControlLastCreated();
        if ((lv_itTeam == libGame_gv_teamChaosIndex_C)) {
            DialogControlSetVisible(DialogControlLastCreated(), libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], false);
        }

        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeImage, "BackgroundRed");
        libMSC2_gv_mMSC2UIPanel.lv_backgroundImageRedRight[lv_itTeam] = DialogControlLastCreated();
        if ((lv_itTeam == libGame_gv_teamOrderIndex_C)) {
            DialogControlSetVisible(DialogControlLastCreated(), libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], true);
        }

        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeImage, "TerrazineIconRed");
        libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageRedRight[lv_itTeam] = DialogControlLastCreated();
        if ((lv_itTeam == libGame_gv_teamOrderIndex_C)) {
            DialogControlSetVisible(DialogControlLastCreated(), libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], true);
        }

        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeLabel, "TerrazineCounter");
        libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel2[lv_itTeam] = DialogControlLastCreated();
        autoA9B5E424_val = lv_itTeam;
        if (autoA9B5E424_val == libGame_gv_teamOrderIndex_C) {
            libNtve_gf_SetDialogItemStyle(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel2[1], "Storm_MapMechanic_MechanicCounterLeft_Red", libGame_gv_teams[libGame_gv_teamOrderIndex_C].lv_teamPlayerGroupNoNPCPlayers);
            libNtve_gf_SetDialogItemStyle(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel2[1], "Storm_MapMechanic_MechanicCounterLeft_Red", libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer]);
        }
        else if (autoA9B5E424_val == libGame_gv_teamChaosIndex_C) {
            libNtve_gf_SetDialogItemStyle(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel2[2], "Storm_MapMechanic_MechanicCounterLeft_Blue", libGame_gv_teams[libGame_gv_teamChaosIndex_C].lv_teamPlayerGroupNoNPCPlayers);
        }
        else {
        }
        lv_currentPanelLayer -= 1;
    }
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_backgroundImageBlueLeft[1], libGame_gv_teams[libGame_gv_teamOrderIndex_C].lv_teamPlayerGroupNoNPCPlayers, true);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_backgroundImageBlueLeft[2], libGame_gv_teams[libGame_gv_teamChaosIndex_C].lv_teamPlayerGroupNoNPCPlayers, false);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageBlueLeft[1], libGame_gv_teams[libGame_gv_teamOrderIndex_C].lv_teamPlayerGroupNoNPCPlayers, true);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageBlueLeft[2], libGame_gv_teams[libGame_gv_teamChaosIndex_C].lv_teamPlayerGroupNoNPCPlayers, false);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_backgroundImageRedLeft[1], libGame_gv_teams[libGame_gv_teamOrderIndex_C].lv_teamPlayerGroupNoNPCPlayers, false);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_backgroundImageRedLeft[2], libGame_gv_teams[libGame_gv_teamChaosIndex_C].lv_teamPlayerGroupNoNPCPlayers, true);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageRedLeft[1], libGame_gv_teams[libGame_gv_teamOrderIndex_C].lv_teamPlayerGroupNoNPCPlayers, false);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageRedLeft[2], libGame_gv_teams[libGame_gv_teamChaosIndex_C].lv_teamPlayerGroupNoNPCPlayers, true);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_backgroundImageBlueRight[1], libGame_gv_teams[libGame_gv_teamOrderIndex_C].lv_teamPlayerGroupNoNPCPlayers, false);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_backgroundImageBlueRight[2], libGame_gv_teams[libGame_gv_teamChaosIndex_C].lv_teamPlayerGroupNoNPCPlayers, true);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageBlueRight[1], libGame_gv_teams[libGame_gv_teamOrderIndex_C].lv_teamPlayerGroupNoNPCPlayers, false);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageBlueRight[2], libGame_gv_teams[libGame_gv_teamChaosIndex_C].lv_teamPlayerGroupNoNPCPlayers, true);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_backgroundImageRedRight[1], libGame_gv_teams[libGame_gv_teamOrderIndex_C].lv_teamPlayerGroupNoNPCPlayers, true);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_backgroundImageRedRight[2], libGame_gv_teams[libGame_gv_teamChaosIndex_C].lv_teamPlayerGroupNoNPCPlayers, false);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageRedRight[1], libGame_gv_teams[libGame_gv_teamOrderIndex_C].lv_teamPlayerGroupNoNPCPlayers, true);
    DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_nukeIconImageRedRight[2], libGame_gv_teams[libGame_gv_teamChaosIndex_C].lv_teamPlayerGroupNoNPCPlayers, false);

    DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypePanel, "NukeSiloFrame");
    DialogControlSetVisible(DialogControlLastCreated(), PlayerGroupAll(), false);
    lv_currentPanelLayer += 1;
    lv_panels[lv_currentPanelLayer] = DialogControlLastCreated();
    libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeam = DialogControlLastCreated();
    auto930AC329_ae = libCore_gv_bALMaxPlayersOnATeam;
    lv_iNukePlayerSlot = 1;
    for ( ; lv_iNukePlayerSlot <= auto930AC329_ae ; lv_iNukePlayerSlot += 1 ) {
        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeImage, libNtve_gf_ConvertStringToUILayoutFrameName(("Nuke" + IntToString(lv_iNukePlayerSlot))));
        libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeamPlayerIconBorders[lv_iNukePlayerSlot] = DialogControlLastCreated();
        libNtve_gf_SetDialogItemColor(libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeamPlayerIconBorders[lv_iNukePlayerSlot], Color(0.00, 100.00, 0.00), PlayerGroupSingle(libCore_gf_GetPlayerIDfromTeamSlot(lv_iNukePlayerSlot, 1)));
        libNtve_gf_SetDialogItemColor(libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeamPlayerIconBorders[lv_iNukePlayerSlot], Color(0.00, 100.00, 0.00), PlayerGroupSingle(libCore_gf_GetPlayerIDfromTeamSlot(lv_iNukePlayerSlot, 2)));
        DialogControlSetEnabled(DialogControlLastCreated(), libCore_gv_allHeroPlayersPlusObserver, false);
        DialogControlHookup(DialogControlLastCreated(), c_triggerControlTypeImage, libNtve_gf_ConvertStringToUILayoutFrameName(("CarrierIcon")));
        libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeamPlayerIcons[lv_iNukePlayerSlot] = DialogControlLastCreated();
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\blank.dds", libCore_gv_allHeroPlayersPlusObserver);
        DialogControlSetEnabled(DialogControlLastCreated(), libCore_gv_allHeroPlayersPlusObserver, false);
        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeLabel, libNtve_gf_ConvertStringToUILayoutFrameName(("CarrierTimer" + IntToString(lv_iNukePlayerSlot))));
        libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeamPlayerTimer[lv_iNukePlayerSlot] = DialogControlLastCreated();
        DialogControlSetVisible(DialogControlLastCreated(), PlayerGroupAll(), false);
    }
    lv_currentPanelLayer -= 1;
    DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypePanel, "NukeSiloFrame2");
    DialogControlSetVisible(DialogControlLastCreated(), PlayerGroupAll(), false);
    lv_currentPanelLayer += 1;
    lv_panels[lv_currentPanelLayer] = DialogControlLastCreated();
    libMSC2_gv_mMSC2UIPanel.lv_NukeFrameEnemyTeam = DialogControlLastCreated();
    auto2F789A31_ae = libCore_gv_bALMaxPlayersOnATeam;
    lv_iNukePlayerSlot = 1;
    for ( ; lv_iNukePlayerSlot <= auto2F789A31_ae ; lv_iNukePlayerSlot += 1 ) {
        DialogControlHookup(lv_panels[lv_currentPanelLayer], c_triggerControlTypeImage, libNtve_gf_ConvertStringToUILayoutFrameName(("Nuke" + IntToString(lv_iNukePlayerSlot))));
        libMSC2_gv_mMSC2UIPanel.lv_NukeFrameEnemyTeamPlayerIconBorders[lv_iNukePlayerSlot] = DialogControlLastCreated();
        DialogControlSetEnabled(DialogControlLastCreated(), libCore_gv_allHeroPlayersPlusObserver, false);
        DialogControlHookup(DialogControlLastCreated(), c_triggerControlTypeImage, libNtve_gf_ConvertStringToUILayoutFrameName(("CarrierIcon")));
        libMSC2_gv_mMSC2UIPanel.lv_NukeFrameEnemyTeamPlayerIcons[lv_iNukePlayerSlot] = DialogControlLastCreated();
        libNtve_gf_SetDialogItemImage(DialogControlLastCreated(), "Assets\\Textures\\blank.dds", libCore_gv_allHeroPlayersPlusObserver);
        DialogControlSetEnabled(DialogControlLastCreated(), libCore_gv_allHeroPlayersPlusObserver, false);
    }
    lv_currentPanelLayer -= 1;
}

void libMSC2_gf_MMSC2UISetMode (int lp_mode) {
    // Variable Declarations
    int lv_cursedTeam;
    int lv_enemyTeam;

    // Automatic Variable Declarations
    int auto72E8562F_val;

    // Variable Initialization

    // Implementation
    auto72E8562F_val = lp_mode;
    if (auto72E8562F_val == libMSC2_ge_MMSC2UIModes_NoEvent) {
        DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeFrame, PlayerGroupAll(), false);
        DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseFrame, PlayerGroupAll(), false);
    }
    else if (auto72E8562F_val == libMSC2_ge_MMSC2UIModes_CanisterWarning) {
        DialogControlSendAnimationEvent(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeQuantityLabel, PlayerGroupAll(), "MoveAnchor");
        DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeQuantityLabel, PlayerGroupAll(), false);
        libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeNameLabel, StringExternal("Param/Value/lib_MSC2_3C95646A"), PlayerGroupAll());
        DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeTimeLabel, PlayerGroupAll(), true);
        DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeFrame, PlayerGroupAll(), true);
        DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseFrame, PlayerGroupAll(), false);
    }
    else if (auto72E8562F_val == libMSC2_ge_MMSC2UIModes_NukesActive) {
        libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeNameLabel, StringExternal("Param/Value/lib_MSC2_696D42C5"), PlayerGroupAll());
        DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeTimeLabel, PlayerGroupAll(), true);
        DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeFrame, PlayerGroupAll(), true);
        DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseFrame, PlayerGroupAll(), false);
    }
    else {
    }
}

void libMSC2_gf_MMSC2UIUpdateNukeStateInitForPlayer (int lp_player) {
    // Variable Declarations
    int lv_nukeTeam;
    int lv_itImageIndex;
    int lv_itPlayerNuke;
    string lv_heroUnitType;

    // Automatic Variable Declarations
    const int auto304DD256_ae = libCore_gv_bALMaxPlayersOnATeam;
    const int auto304DD256_ai = 1;

    // Variable Initialization
    lv_heroUnitType = "";

    // Implementation
    if ((libGame_gf_TeamNumberIsValid(lv_nukeTeam) == false)) {
        return ;
    }

    lv_itImageIndex = 1;
    for ( ; ( (auto304DD256_ai >= 0 && lv_itImageIndex <= auto304DD256_ae) || (auto304DD256_ai < 0 && lv_itImageIndex >= auto304DD256_ae) ) ; lv_itImageIndex += auto304DD256_ai ) {
        lv_itPlayerNuke = libMSC2_gv_mMSC2UINukeSiloPlayers[lp_player][lv_nukeTeam][lv_itImageIndex];
        if (((lv_itPlayerNuke <= 0) || (lv_itPlayerNuke > libCore_gv_bALMaxPlayers))) {
            DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel3[lv_itImageIndex], PlayerGroupAll(), false);
            continue;
        }

        DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel3[lv_itImageIndex], PlayerGroupAll(), true);
        lv_heroUnitType = (libGame_gv_players[lv_itPlayerNuke].lv_heroData.lv_unitType);
        libNtve_gf_SetDialogItemImage(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel5[lv_itImageIndex], (CatalogFieldValueGet(c_gameCatalogActor, lv_heroUnitType, "MinimapIcon", c_playerAny)), libCore_gv_playerGroupFromPlayer[lp_player]);
        if (((PlayerGroupHasPlayer(libGame_gf_PlayersOnTeamHeroes(lv_nukeTeam, false), lp_player) == true) || ((lp_player == libCore_gv_oBSERVER_ObserverUIPlayer) && (lv_nukeTeam == libGame_gv_teamOrderIndex_C)))) {
            libNtve_gf_SetDialogItemColor(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel4[lv_itImageIndex], Color(0.00, 100.00, 0.00), libCore_gv_playerGroupFromPlayer[lp_player]);
        }
        else {
            libNtve_gf_SetDialogItemColor(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel4[lv_itImageIndex], libCore_gv_cOLOREnemyColor, libCore_gv_playerGroupFromPlayer[lp_player]);
        }
    }
}

void libMSC2_gf_MMSC2UIUpdateNukeStateForPlayer (int lp_player) {
    // Variable Declarations
    int lv_nukeTeam;
    int lv_itImageIndex;
    int lv_itPlayerNuke;
    string lv_heroUnitType;

    // Automatic Variable Declarations
    const int autoCED81254_ae = libCore_gv_bALMaxPlayersOnATeam;
    const int autoCED81254_ai = 1;

    // Variable Initialization
    lv_heroUnitType = "";

    // Implementation
    if ((libGame_gf_TeamNumberIsValid(lv_nukeTeam) == false)) {
        return ;
    }

    lv_itImageIndex = 1;
    for ( ; ( (autoCED81254_ai >= 0 && lv_itImageIndex <= autoCED81254_ae) || (autoCED81254_ai < 0 && lv_itImageIndex >= autoCED81254_ae) ) ; lv_itImageIndex += autoCED81254_ai ) {
        lv_itPlayerNuke = libMSC2_gv_mMSC2UINukeSiloPlayers[lp_player][lv_nukeTeam][lv_itImageIndex];
        if (((lv_itPlayerNuke <= 0) || (lv_itPlayerNuke > libCore_gv_bALMaxPlayers))) {
            continue;
        }

        if ((libMSC2_gf_MMSC2CountofNukesForPlayer(lp_player) > 0)) {
            libNtve_gf_SetDialogItemImage(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel3[lv_itImageIndex], "Assets\\Textures\\storm_temp_btn-ability-terran-nuclearstrike-color.dds", libCore_gv_playerGroupFromPlayer[lp_player]);
            libNtve_gf_SetDialogItemColor(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel3[lv_itImageIndex], Color(100.00, 100.00, 100.00), libCore_gv_playerGroupFromPlayer[lp_player]);
        }
        else {
            libNtve_gf_SetDialogItemImage(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel3[lv_itImageIndex], "Assets\\Textures\\storm_temp_btn-ability-terran-nuclearstrike.dds", libCore_gv_playerGroupFromPlayer[lp_player]);
            libNtve_gf_SetDialogItemColor(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtCurseTimerLabel3[lv_itImageIndex], Color(75.29, 75.29, 75.29), libCore_gv_playerGroupFromPlayer[lp_player]);
        }
    }
}

void libMSC2_gf_MMSC2UISetEruptionWarningTime (int lp_remainingSeconds) {
    // Automatic Variable Declarations
    // Implementation
    libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeTimeLabel, TextTimeFormat(StringToText("<mintotal/>:<sec2/>"), lp_remainingSeconds), PlayerGroupAll());
}

void libMSC2_gf_MMSC2UIEnableNukeUIStateForPlayer (int lp_player) {
    // Variable Declarations
    int lv_allyTeam;
    int lv_enemyTeam;
    int lv_slot;

    // Automatic Variable Declarations
    // Variable Initialization

    // Implementation
    lv_slot = libGame_gv_players[lp_player].lv_rosterSlot;
    lv_allyTeam = libGame_gf_TeamNumberOfPlayer(lp_player);
    if ((libGame_gv_players[lp_player].lv_rosterSlot > 5)) {
        lv_slot = (libGame_gv_players[lp_player].lv_rosterSlot - 5);
    }

    lv_enemyTeam = libGame_gf_EnemyTeam(lv_allyTeam);
    DialogControlSetEnabled(libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeamPlayerIcons[lv_slot], libGame_gf_PlayersOnTeamHeroes(lv_allyTeam, false), true);
    DialogControlSetEnabled(libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeamPlayerIconBorders[lv_slot], libGame_gf_PlayersOnTeamHeroes(lv_allyTeam, false), true);
    DialogControlSetEnabled(libMSC2_gv_mMSC2UIPanel.lv_NukeFrameEnemyTeamPlayerIcons[lv_slot], libGame_gf_PlayersOnTeamHeroes(lv_enemyTeam, false), true);
    DialogControlSetEnabled(libMSC2_gv_mMSC2UIPanel.lv_NukeFrameEnemyTeamPlayerIconBorders[lv_slot], libGame_gf_PlayersOnTeamHeroes(lv_enemyTeam, false), true);
}

void libMSC2_gf_MMSC2UIDisableNukeUIStateForPlayer (int lp_player) {
    // Variable Declarations
    int lv_allyTeam;
    int lv_enemyTeam;
    int lv_slot;

    // Automatic Variable Declarations
    // Variable Initialization

    // Implementation
    lv_slot = libGame_gv_players[lp_player].lv_rosterSlot;
    lv_allyTeam = libGame_gf_TeamNumberOfPlayer(lp_player);
    lv_enemyTeam = libGame_gf_EnemyTeam(lv_allyTeam);
    if ((libGame_gv_players[lp_player].lv_rosterSlot > 5)) {
        lv_slot = (libGame_gv_players[lp_player].lv_rosterSlot - 5);
    }

    DialogControlSetEnabled(libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeamPlayerIcons[lv_slot], libGame_gf_PlayersOnTeamHeroes(lv_allyTeam, false), false);
    DialogControlSetEnabled(libMSC2_gv_mMSC2UIPanel.lv_NukeFrameAllyTeamPlayerIconBorders[lv_slot], libGame_gf_PlayersOnTeamHeroes(lv_allyTeam, false), false);
    DialogControlSetEnabled(libMSC2_gv_mMSC2UIPanel.lv_NukeFrameEnemyTeamPlayerIcons[lv_slot], libGame_gf_PlayersOnTeamHeroes(lv_enemyTeam, false), false);
    DialogControlSetEnabled(libMSC2_gv_mMSC2UIPanel.lv_NukeFrameEnemyTeamPlayerIconBorders[lv_slot], libGame_gf_PlayersOnTeamHeroes(lv_enemyTeam, false), false);
}

void libMSC2_gf_MMSC2UIUpdateNukeCountForTeam (int lp_count, int lp_team) {
    // Automatic Variable Declarations
    // Implementation
    libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel[lp_team], IntToText(libMSC2_gf_MMSC2NukeCountforTeam(lp_team)), PlayerGroupAll());
}

// Triggers
//--------------------------------------------------------------------------------------------------
// Trigger: #Include Warhead Junction
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_IncludeWarheadJunction_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_IncludeWarheadJunction_Init () {
    libMSC2_gt_IncludeWarheadJunction = TriggerCreate("libMSC2_gt_IncludeWarheadJunction_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Init
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2Init_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_itTempleIndex;
    int lv_itPlayer;

    // Automatic Variable Declarations
    playergroup autoF90BEC4C_g;
    playergroup auto8DE2AF8D_g;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((libGame_gf_MapMechanicInitializationMechanicType() == libMSC2_gv_mMSC2MechanicName_C))) {
            return false;
        }
    }

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

    ActorSend(libMapM_gv_mapMechanicControllerActor, "Signal MM1Off");
    TriggerExecute(libMSC2_gt_InitNukeSilos, true, false);
    libUIUI_gf_UIEnableMapMechanicButtonAllPlayers(true);
    autoF90BEC4C_g = libGame_gf_PlayersOnTeamHeroes(libGame_gv_teamOrderIndex_C, false);
    lv_itPlayer = -1;
    while (true) {
        	lv_itPlayer = PlayerGroupNextPlayer(autoF90BEC4C_g, lv_itPlayer);
        	if (lv_itPlayer<0) { break; }
        	TechTreeUpgradeAddLevel(lv_itPlayer, "IsOrderPlayer", 1);
    }
    auto8DE2AF8D_g = libGame_gf_PlayersOnTeamHeroes(libGame_gv_teamChaosIndex_C, false);
    lv_itPlayer = -1;
    while (true) {
        	lv_itPlayer = PlayerGroupNextPlayer(auto8DE2AF8D_g, lv_itPlayer);
        	if (lv_itPlayer<0) { break; }
        	TechTreeUpgradeAddLevel(lv_itPlayer, "IsChaosPlayer", 1);
    }
    libGame_gf_SendMapSpecificAwardInitializeEventwithUserData(null, "Generic Instance");
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2Init_Init () {
    libMSC2_gt_MMSC2Init = TriggerCreate("libMSC2_gt_MMSC2Init_Func");
    libGame_gf_MapMechanicInitialization(libMSC2_gt_MMSC2Init);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Initialize Ping Data
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2InitializePingData_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Actions
    if (!runActions) {
        return true;
    }

    libUIUI_gf_PingCreateNewPingTarget("SlimeBossDefender", false, StringExternal("Param/Value/lib_MSC2_53939EF3"), StringExternal("Param/Value/lib_MSC2_5633745D"), StringExternal("Param/Value/lib_MSC2_60CAAF90"), SoundLink("UI_Game_Ping_Attack", -1), SoundLink("UI_Game_Ping_Attack", -1));
    libUIUI_gf_PingSetHumanAISourceHeroVOForPingTarget(libUIUI_gf_PingLastCreatedPingTarget(), libCore_ge_HeroVOEvents_PingAttackMercCamp, libCore_ge_HeroVOEvents_AIMercCapture);
    libUIUI_gf_PingCreateNewPingTarget("SlimeBossPodlingDefender", false, StringExternal("Param/Value/lib_MSC2_0B790D50"), StringExternal("Param/Value/lib_MSC2_AB16673E"), StringExternal("Param/Value/lib_MSC2_BFD8415A"), SoundLink("UI_Game_Ping_Attack", -1), SoundLink("UI_Game_Ping_Attack", -1));
    libUIUI_gf_PingSetHumanAISourceHeroVOForPingTarget(libUIUI_gf_PingLastCreatedPingTarget(), libCore_ge_HeroVOEvents_PingAttackMercCamp, libCore_ge_HeroVOEvents_AIMercCapture);
    libUIUI_gf_PingCreateNewPingTarget("SlimeBossLaner", false, null, StringExternal("Param/Value/lib_MSC2_5FB25289"), StringExternal("Param/Value/lib_MSC2_8E57D195"), SoundLink("UI_Game_Ping_Attack", -1), SoundLink("UI_Game_Ping_Attack", -1));
    libUIUI_gf_PingSetAllyEnemyTargetHeroVOForPingTarget(libUIUI_gf_PingLastCreatedPingTarget(), libCore_ge_HeroVOEvents_PingAttackHere, libCore_ge_HeroVOEvents_PingAttackHere);
    libUIUI_gf_PingCreateNewPingTarget("SlimeBossPodlingLaner", false, null, StringExternal("Param/Value/lib_MSC2_13ABDFE1"), StringExternal("Param/Value/lib_MSC2_3C4CE2DE"), SoundLink("UI_Game_Ping_Attack", -1), SoundLink("UI_Game_Ping_Attack", -1));
    libUIUI_gf_PingSetAllyEnemyTargetHeroVOForPingTarget(libUIUI_gf_PingLastCreatedPingTarget(), libCore_ge_HeroVOEvents_PingAttackHere, libCore_ge_HeroVOEvents_PingAttackHere);
    libUIUI_gf_PingCreateNewPingTarget("WarheadDropped", false, StringExternal("Param/Value/lib_MSC2_E25218A7"), StringExternal("Param/Value/lib_MSC2_980C7878"), StringExternal("Param/Value/lib_MSC2_C838B986"), SoundLink("UI_Game_Ping_General", -1), SoundLink("UI_Game_Ping_General", -1));
    libUIUI_gf_PingCreateNewPingTarget("WarheadSingle", false, StringExternal("Param/Value/lib_MSC2_D074B31F"), StringExternal("Param/Value/lib_MSC2_045F9DFB"), StringExternal("Param/Value/lib_MSC2_FE9CBBFF"), SoundLink("UI_Game_Ping_General", -1), SoundLink("UI_Game_Ping_General", -1));
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2InitializePingData_Init () {
    libMSC2_gt_MMSC2InitializePingData = TriggerCreate("libMSC2_gt_MMSC2InitializePingData_Func");
    libGame_gf_MapMechanicInitialization(libMSC2_gt_MMSC2InitializePingData);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Gates Opened
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2GatesOpened_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Conditions
    if (testConds) {
        if (!((libMapM_gv_mMMapMechanicDisabled == false))) {
            return false;
        }
    }

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

    libMSC2_gv_mMSC2EventState = libMSC2_ge_MMSC2EventStates_NoEvent;
    TimerStart(libMSC2_gv_mMSC2TerrazineMainEventTimer, libMSC2_gv_mMSC2FirstEventDelay_C, false, c_timeGame);
    TimerStart(libMSC2_gv_mMSC2NukeDamageScalingTimer, libMSC2_gv_mMSC2NukeDamageScalingDelay_C, false, c_timeGame);
    TriggerExecute(libMSC2_gt_MMSC2MainThread, true, false);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2GatesOpened_Init () {
    libMSC2_gt_MMSC2GatesOpened = TriggerCreate("libMSC2_gt_MMSC2GatesOpened_Func");
    TriggerAddEventTimer(libMSC2_gt_MMSC2GatesOpened, libGame_gv_openTheGatesTimer);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Main Thread
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2MainThread_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Conditions
    if (testConds) {
        if (!((TriggerIsEnabled(TriggerGetCurrent()) == true))) {
            return false;
        }
    }

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

    libMSC2_gv_mMSC2SpecialSpawnLane = libMSC2_gf_MMSC2DetermineDoubleWarheadSpawnLane();
    TimerStart(libMSC2_gv_mMSC2ObjectivePreviewTimer, libMSC2_gv_mMSC2ObjectivePreviewDelay_C, false, c_timeGame);
    TriggerEnable(TriggerGetCurrent(), false);
    libNtve_gf_WaitForTimer(libMSC2_gv_mMSC2TerrazineMainEventTimer, libMSC2_gv_mMSC2EventWarningDelayGasCanister_C, false);
    TriggerExecute(libMSC2_gt_MMSC2UIHandler, true, false);
    while (true) {
        libMSC2_gv_mMSC2EventState = libMSC2_ge_MMSC2EventStates_CanisterWarning;
        libMSC2_gf_MMSC2TransmissionWarheadSpawnWarningQ();
        libMSC2_gf_MMSC2WarningStarts(libMSC2_gv_mMSC2SpecialSpawnLane);
        libNtve_gf_WaitForTimer(libMSC2_gv_mMSC2TerrazineMainEventTimer, 0.0, false);
        libMSC2_gf_MMSC2ClearWarheadPreviews();
        libMSC2_gf_MMSC2ClearCanisterSpawningSignals();
        libMSC2_gv_mMSC2EventState = libMSC2_ge_MMSC2EventStates_NukesActive;
        libMSC2_gf_MMSC2SpawnNukeCanisters(libMSC2_gv_mMSC2SpecialSpawnLane);
        if ((libMSC2_gv_mMSC2ThreeWarheadsSpawn == true)) {
            libMSC2_gv_mMSC2LastDoubleWarheadLane = libMSC2_gv_mMSC2SpecialSpawnLane;
        }
        else {
            libMSC2_gv_mMSC2LastEmptyWarheadLane = libMSC2_gv_mMSC2SpecialSpawnLane;
        }
        libMSC2_gv_mMSC2WarheadEventFirstTime = false;
        libMSC2_gf_MMSC2TransmissionWarheadsSpawnedQ();
        while (!((UnitGroupCount(libMSC2_gv_mMSC2BuiltWarheadsActive, c_unitCountAlive) == 0))) {
            Wait(0.25, c_timeGame);
        }
        libMSC2_gv_mMSC2EventTracker = (libMSC2_gv_mMSC2EventTracker + 1);
        TimerStart(libMSC2_gv_mMSC2TerrazineMainEventTimer, (libMSC2_gv_mMSC2RepeatEventDelay_C + libMSC2_gv_mMSC2EventWarningDelayGasCanister_C + libMSC2_gv_mMSC2NukeExpireDuration_C), false, c_timeGame);
        if ((libMSC2_gv_mMSC2EventTracker == 3)) {
            libMSC2_gv_mMSC2ThreeWarheadsSpawn = true;
        }
        else {
            libMSC2_gv_mMSC2ThreeWarheadsSpawn = false;
        }
        libMSC2_gv_mMSC2EventState = libMSC2_ge_MMSC2EventStates_NoEvent;
        libMSC2_gv_mMSC2SpecialSpawnLane = libMSC2_gf_MMSC2DetermineDoubleWarheadSpawnLane();
        TimerStart(libMSC2_gv_mMSC2ObjectivePreviewTimer, libMSC2_gv_mMSC2ObjectivePreviewDelay_C, false, c_timeGame);
        libNtve_gf_WaitForTimer(libMSC2_gv_mMSC2TerrazineMainEventTimer, libMSC2_gv_mMSC2EventWarningDelayGasCanister_C, false);
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2MainThread_Init () {
    libMSC2_gt_MMSC2MainThread = TriggerCreate("libMSC2_gt_MMSC2MainThread_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 - Objective Preview Timer Expires
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2ObjectivePreviewTimerExpires_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Actions
    if (!runActions) {
        return true;
    }

    libMSC2_gf_MMSC2SetupandStartPreview(libMSC2_gv_mMSC2SpecialSpawnLane);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2ObjectivePreviewTimerExpires_Init () {
    libMSC2_gt_MMSC2ObjectivePreviewTimerExpires = TriggerCreate("libMSC2_gt_MMSC2ObjectivePreviewTimerExpires_Func");
    TriggerAddEventTimer(libMSC2_gt_MMSC2ObjectivePreviewTimerExpires, libMSC2_gv_mMSC2ObjectivePreviewTimer);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Activate Waygates
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2ActivateWaygates_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Actions
    if (!runActions) {
        return true;
    }

    Wait(2.0, c_timeGame);
    libMSC2_gf_MMToDActivateWaygates();
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2ActivateWaygates_Init () {
    libMSC2_gt_MMSC2ActivateWaygates = TriggerCreate("libMSC2_gt_MMSC2ActivateWaygates_Func");
    TriggerAddEventTimer(libMSC2_gt_MMSC2ActivateWaygates, libGame_gv_openTheGatesTimer);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMToD Entered Waygate
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMToDEnteredWaygate_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_computerTeam;
    unit lv_hero;
    point lv_heroPreTeleportPosition;
    unit lv_waygateEntrance;
    int lv_itWaygate;
    int lv_player;
    string lv_mountCooldownLink;
    int lv_teleportingUnitTypeIndex;
    unit lv_teleportingUnit;

    // Automatic Variable Declarations
    const int auto2D8F4586_ae = libMSC2_gv_mMFieldofSlaughterWaygateMaxCount_C;
    const int auto2D8F4586_ai = 1;
    unit auto6BD862A7_val;

    // Variable Initialization
    lv_hero = EventPlayerEffectUsedUnit(c_effectUnitCaster);
    lv_heroPreTeleportPosition = UnitGetPosition(lv_hero);
    lv_waygateEntrance = EventPlayerEffectUsedUnit(c_effectUnitTarget);
    lv_player = UnitGetOwner(lv_hero);
    lv_mountCooldownLink = "";

    // Conditions
    if (testConds) {
        if (!((libGame_gf_UnitIsHero(lv_hero) == true))) {
            return false;
        }

        if (!((UnitGetType(lv_waygateEntrance) == "WaygateEntrance"))) {
            return false;
        }
    }

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

    if ((libGame_gf_TeamNumberOfPlayer(UnitGetOwner(lv_hero)) == 1)) {
        lv_computerTeam = libCore_gv_cOMPUTER_TeamOrder;
    }
    else {
        lv_computerTeam = libCore_gv_cOMPUTER_TeamChaos;
    }
    UnitCreateEffectPoint(lv_hero, "TeleportVisualDummyEffect", UnitGetPosition(lv_hero));
    UnitIssueOrder(lv_hero, Order(AbilityCommand("stop", 0)), c_orderQueueReplace);
    libNtve_gf_MakeUnitUncommandable(lv_hero, true);
    libNtve_gf_SendActorMessageToUnit(lv_hero, "Signal InvisibleModel");
    UnitSetState(lv_hero, c_unitStateTargetable, false);
    UnitBehaviorAdd(lv_hero, "WaygateUnstoppable", lv_hero, 1);
    if ((libGame_gv_players[lv_player].lv_remountHeroAfterTeleport == true)) {
        libGame_gf_ApplyMountBehaviorToHero(lv_hero);
        lv_mountCooldownLink = CatalogFieldValueGet(c_gameCatalogAbil, "Mount", "Cost[" + IntToString(0) + "].Cooldown.Link", lv_player);
        libNtve_gf_UnitRemoveCooldown(lv_hero, lv_mountCooldownLink);
        libNtve_gf_PlayerRemoveCooldown(lv_player, lv_mountCooldownLink);
    }

    lv_itWaygate = 1;
    for ( ; ( (auto2D8F4586_ai >= 0 && lv_itWaygate <= auto2D8F4586_ae) || (auto2D8F4586_ai < 0 && lv_itWaygate >= auto2D8F4586_ae) ) ; lv_itWaygate += auto2D8F4586_ai ) {
        if (((lv_waygateEntrance == libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_topWaygate) || (lv_waygateEntrance == libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_bottomWaygate))) {
            break;
        }

        if (((libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_topWaygate == null) || (libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_bottomWaygate == null))) {
            TriggerDebugOutput(1, StringExternal("Param/Value/lib_MSC2_99E787AE"), true);
            return true;
        }

    }
    if (true) {
        auto6BD862A7_val = lv_waygateEntrance;
        if (auto6BD862A7_val == libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_topWaygate) {
            UnitSetPosition(lv_hero, UnitGetPosition(libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_bottomWaygate), false);
        }
        else if (auto6BD862A7_val == libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_bottomWaygate) {
            UnitSetPosition(lv_hero, UnitGetPosition(libMSC2_gv_mMToDWaygates[lv_itWaygate].lv_topWaygate), false);
        }
        else {
        }
    }
    else {
        TriggerDebugOutput(1, StringExternal("Param/Value/lib_MSC2_099015DA"), true);
        return true;
    }
    UnitCreateEffectUnit(lv_hero, "UnderworldTeleport", lv_hero);
    if ((libGame_gv_gameOver == false) && (lv_hero == UnitGroupUnit(libGame_gv_players[lv_player].lv_cameraPlayerUnitGroupToFocusOn, 1))) {
        libGame_gf_CameraPanCameraForPlayerAndUpdateMapBoundsIfNecessary(lv_player, UnitGetPosition(lv_hero), 0.0, -1, 0.0, false);
    }

    SoundPlayOnUnitForPlayer(SoundLink("Event_Mines_EnterMinesEnd", -1), c_maxPlayers, PlayerGroupAll(), lv_hero, 0.0, 100.0, 0.0);
    Wait(0.125, c_timeGame);
    libNtve_gf_MakeUnitUncommandable(lv_hero, false);
    UnitSetState(lv_hero, c_unitStateTargetable, true);
    UnitBehaviorRemove(lv_hero, "WaygateUnstoppable", 1);
    UnitIssueOrder(lv_hero, Order(AbilityCommand("stop", 0)), c_orderQueueReplace);
    libNtve_gf_SendActorMessageToUnit(lv_hero, "Signal RestoreModel");
    PathSetSourceUnit(libGame_gv_players[lv_player].lv_pathDisplay, lv_hero);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMToDEnteredWaygate_Init () {
    libMSC2_gt_MMToDEnteredWaygate = TriggerCreate("libMSC2_gt_MMToDEnteredWaygate_Func");
    TriggerAddEventPlayerEffectUsed(libMSC2_gt_MMToDEnteredWaygate, c_playerAny, "CaptureMacGuffinTwoCastComplete");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Built Warhead Reminder Timer Expires
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2BuiltWarheadReminderTimerExpires_Func (bool testConds, bool runActions) {
    // Variable Declarations
    unit lv_itUnit;

    // Automatic Variable Declarations
    unitgroup auto2B76448B_g;
    int auto2B76448B_u;

    // Variable Initialization

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

    SoundPlayForPlayer(SoundLink("UI_Game_Ping_Reminder1", -1), c_maxPlayers, PlayerGroupAll(), 100.0, 0.0);
    auto2B76448B_g = libMSC2_gv_mMSC2BuiltWarheadsActive;
    auto2B76448B_u = UnitGroupCount(auto2B76448B_g, c_unitCountAll);
    for (;; auto2B76448B_u -= 1) {
        lv_itUnit = UnitGroupUnitFromEnd(auto2B76448B_g, auto2B76448B_u);
        if (lv_itUnit == null) { break; }
        libCore_gf_CreateMinimapPingStorm(PlayerGroupAll(), "StormAlertSilent", UnitGetPosition(lv_itUnit), ColorWithAlpha(0,0,0,0), 4.0);
        PingSetScale(PingLastCreated(), 0.6);
    }
    TimerStart(libMSC2_gv_mMSC2BuiltWarheadReminderTimer, libMSC2_gv_mMSC2WarheadPickupReminderDelay_C, false, c_timeGame);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2BuiltWarheadReminderTimerExpires_Init () {
    libMSC2_gt_MMSC2BuiltWarheadReminderTimerExpires = TriggerCreate("libMSC2_gt_MMSC2BuiltWarheadReminderTimerExpires_Func");
    TriggerAddEventTimer(libMSC2_gt_MMSC2BuiltWarheadReminderTimerExpires, libMSC2_gv_mMSC2BuiltWarheadReminderTimer);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Nuke Damage Scaling
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2NukeDamageScaling_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Actions
    if (!runActions) {
        return true;
    }

    libMSC2_gv_mMSC2NukeDamageScalesNeeded += 1;
    TimerStart(libMSC2_gv_mMSC2NukeDamageScalingTimer, libMSC2_gv_mMSC2NukeDamageScalingDelay_C, false, c_timeGame);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2NukeDamageScaling_Init () {
    libMSC2_gt_MMSC2NukeDamageScaling = TriggerCreate("libMSC2_gt_MMSC2NukeDamageScaling_Func");
    TriggerAddEventTimer(libMSC2_gt_MMSC2NukeDamageScaling, libMSC2_gv_mMSC2NukeDamageScalingTimer);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Built Warhead Channel Started
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2BuiltWarheadChannelStarted_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Conditions
    if (testConds) {
        if (!((UnitGetType(EventUnitTargetUnit()) == "WarheadSingle"))) {
            return false;
        }
    }

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

    if ((libNtve_gf_UnitGroupIsDead(libMSC2_gv_mMSC2BuiltWarheadsActive) == false)) {
        TimerStart(libMSC2_gv_mMSC2BuiltWarheadReminderTimer, libMSC2_gv_mMSC2WarheadPickupReminderDelay_C, false, c_timeGame);
    }

    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2BuiltWarheadChannelStarted_Init () {
    libMSC2_gt_MMSC2BuiltWarheadChannelStarted = TriggerCreate("libMSC2_gt_MMSC2BuiltWarheadChannelStarted_Func");
    TriggerAddEventUnitAbility(libMSC2_gt_MMSC2BuiltWarheadChannelStarted, null, AbilityCommand("CaptureMacGuffin", 0), c_abilEffectStageCast, false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Built Warhead Captured
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2BuiltWarheadCaptured_Func (bool testConds, bool runActions) {
    // Variable Declarations
    unit lv_itUnit;
    unit lv_casterUnit;
    int lv_team;
    point lv_heroLoc;
    point lv_canisterLoc;
    text lv_tagText;
    int lv_itCanister;

    // Automatic Variable Declarations
    unitgroup auto8F96E2CF_g;
    int auto8F96E2CF_u;
    const int auto075181E6_ae = libMSC2_gv_mMSC2BuiltWarheadsCountMax_C;
    const int auto075181E6_ai = 1;
    int auto41DFD837_val;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((EventPlayerEffectUsedUnitType(c_effectUnitTarget) == "WarheadSingle"))) {
            return false;
        }
    }

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

    auto8F96E2CF_g = libMSC2_gv_mMSC2BuiltWarheadsActive;
    auto8F96E2CF_u = UnitGroupCount(auto8F96E2CF_g, c_unitCountAll);
    for (;; auto8F96E2CF_u -= 1) {
        lv_itUnit = UnitGroupUnitFromEnd(auto8F96E2CF_g, auto8F96E2CF_u);
        if (lv_itUnit == null) { break; }
        if ((EventPlayerEffectUsedUnit(c_effectUnitTarget) == lv_itUnit)) {
            lv_casterUnit = EventPlayerEffectUsedUnit(c_effectUnitCaster);
            lv_team = libGame_gf_TeamNumberOfPlayer(UnitGetOwner(lv_casterUnit));
            if ((libGame_gf_TeamNumberIsValid(lv_team) == false)) {
                return true;
            }

            lv_heroLoc = UnitGetPosition(lv_casterUnit);
            lv_canisterLoc = UnitGetPosition(lv_itUnit);
            libCore_gf_SendActorMessageToDoodadsInRegion("Signal CanisterTaken", RegionCircle(lv_canisterLoc, 1.0), "Storm_Doodad_SCZion_CanisterSpawnSplat");
            lv_itCanister = 1;
            for ( ; ( (auto075181E6_ai >= 0 && lv_itCanister <= auto075181E6_ae) || (auto075181E6_ai < 0 && lv_itCanister >= auto075181E6_ae) ) ; lv_itCanister += auto075181E6_ai ) {
                if ((libMSC2_gv_mMSC2BuiltWarheads[lv_itCanister] == lv_itUnit)) {
                    VisRevealerDestroy(libMSC2_gv_mMSC2BuiltWarheadsRevealer[lv_itCanister][1]);
                    libMSC2_gv_mMSC2BuiltWarheadsRevealer[lv_itCanister][1] = null;
                    VisRevealerDestroy(libMSC2_gv_mMSC2BuiltWarheadsRevealer[lv_itCanister][2]);
                    libMSC2_gv_mMSC2BuiltWarheadsRevealer[lv_itCanister][2] = null;
                    break;
                }

            }
            UnitGroupRemove(libMSC2_gv_mMSC2BuiltWarheadsActive, lv_itUnit);
            RemoveUnitOfInterest(lv_itUnit, "Harvest", libNtve_ge_GoalTeam_Both);
            UnitKill(lv_itUnit);
            libMSC2_gf_MMSC2ArmNukeForUnit(lv_casterUnit);
            libNtve_gf_CreateUnitsWithDefaultFacing(1, "RegenGlobe", c_unitCreateIgnorePlacement, libGame_gf_ComputerPlayerInTeam(lv_team), PointWithOffset(lv_canisterLoc, 0.0, 0.0), null);
            libGame_gf_DropLootBannerinSconce(UnitGroupUnit(UnitGroup("LootBannerSconce", c_playerAny, RegionCircle(lv_canisterLoc, 7.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 1), 1), libGame_gv_players[UnitGetOwner(lv_casterUnit)].lv_lootContent.lv_loot_Banner.lv_bannerID, UnitGetOwner(lv_casterUnit), true);
            TextTagDestroy(libCore_gf_TextTagStoredForUnit(lv_itUnit, 1));
            SoundPlayForPlayer(SoundLink("Event_Warhead_CollectUranium_Enemy", -1), c_maxPlayers, GameAttributePlayersForTeam(libGame_gf_EnemyTeam(lv_team)), 100.0, 0.0);
            libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke(UnitGetOwner(EventPlayerEffectUsedUnit(c_effectUnitCaster)));
            auto41DFD837_val = lv_team;
            if (auto41DFD837_val == libGame_gv_teamOrderIndex_C) {
                libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel[lv_team], IntToText(libMSC2_gf_MMSC2NukeCountforTeam(lv_team)), PlayerGroupAll());
            }
            else if (auto41DFD837_val == libGame_gv_teamChaosIndex_C) {
                libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel2[lv_team], IntToText(libMSC2_gf_MMSC2NukeCountforTeam(lv_team)), PlayerGroupAll());
            }
            else {
            }
            break;
        }

    }
    if ((libNtve_gf_UnitGroupIsDead(libMSC2_gv_mMSC2BuiltWarheadsActive) == true)) {
        libMSC2_gf_MMSC2TransmissionAllNukesCollectedQ();
        libMSC2_gf_MMSC2CanisterEventDone();
        TimerPause(libMSC2_gv_mMSC2BuiltWarheadReminderTimer, true);
    }
    else {
        TimerStart(libMSC2_gv_mMSC2BuiltWarheadReminderTimer, libMSC2_gv_mMSC2WarheadPickupReminderDelay_C, false, c_timeGame);
    }
    StatEventCreate("WarheadJunctionNukeCollected");
    StatEventAddDataFixed(StatEventLastCreated(), "GameTime", libUIUI_gf_HeroesGameTime());
    StatEventAddDataInt(StatEventLastCreated(), "OwningTeam", lv_team);
    StatEventSend(StatEventLastCreated());
    Wait(libMSC2_gv_mMSC2NukeArmingDuration_C, c_timeGame);
    if ((UnitHasBehavior2(EventPlayerEffectUsedUnit(c_effectUnitCaster), "HasMapMechanicTargetAbility") == true)) {
        libMSC2_gf_MMSC2TransmissionPlayerNukeReady(UnitGetOwner(EventPlayerEffectUsedUnit(c_effectUnitCaster)));
    }

    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2BuiltWarheadCaptured_Init () {
    libMSC2_gt_MMSC2BuiltWarheadCaptured = TriggerCreate("libMSC2_gt_MMSC2BuiltWarheadCaptured_Func");
    TriggerAddEventPlayerEffectUsed(libMSC2_gt_MMSC2BuiltWarheadCaptured, c_playerAny, "CaptureMacGuffinCastComplete");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Nuke Channeling Ping
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2NukeChannelingPing_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_calldownPlayer;
    int lv_team;
    int lv_enemyTeam;
    point lv_target;

    // Automatic Variable Declarations
    int autoADA89900_val;

    // Variable Initialization

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

    lv_calldownPlayer = EventPlayerEffectUsedUnitOwner(c_effectPlayerCaster);
    if (((lv_calldownPlayer <= 0) || (lv_calldownPlayer > libCore_gv_bALMaxPlayers))) {
        return true;
    }

    lv_team = libGame_gf_TeamNumberOfPlayer(lv_calldownPlayer);
    lv_enemyTeam = libGame_gf_EnemyTeam(lv_team);
    lv_target = EventPlayerEffectUsedPoint(c_effectLocationTargetPoint);
    libCore_gf_CreateMinimapPingStorm(GameAttributePlayersForTeam(lv_team), "NukeLaunchPing", lv_target, libCore_gv_cOLORAllyColor, 5.0);
    if ((lv_team == libGame_gv_teamOrderIndex_C)) {
        libCore_gf_CreateMinimapPingStorm(libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], "NukeLaunchPing", lv_target, libCore_gv_cOLORAllyColor, 5.0);
    }

    libMSC2_gv_mMSC2NukeCalldownPiing[lv_calldownPlayer][lv_team] = PingLastCreated();
    libCore_gf_CreateMinimapPingStorm(GameAttributePlayersForTeam(lv_enemyTeam), "NukeLaunchPing", lv_target, libCore_gv_cOLOREnemyColor, 5.0);
    if ((lv_team == libGame_gv_teamChaosIndex_C)) {
        libCore_gf_CreateMinimapPingStorm(libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], "NukeLaunchPing", lv_target, libCore_gv_cOLOREnemyColor, 5.0);
    }

    libMSC2_gv_mMSC2NukeCalldownPiing[lv_calldownPlayer][lv_enemyTeam] = PingLastCreated();
    autoADA89900_val = lv_team;
    if (autoADA89900_val == libCore_gv_cOMPUTER_TeamOrder) {
        libCore_gf_CreateMinimapPingStorm(libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], "StormWarning", lv_target, libCore_gv_cOLORAllyColor, 2.5);
        libMSC2_gv_mMSC2NukeCalldownPiing[lv_calldownPlayer][0] = PingLastCreated();
    }
    else if (autoADA89900_val == libCore_gv_cOMPUTER_TeamChaos) {
        libCore_gf_CreateMinimapPingStorm(libCore_gv_playerGroupFromPlayer[libCore_gv_oBSERVER_ObserverUIPlayer], "StormWarning", lv_target, libCore_gv_cOLOREnemyColor, 2.5);
        libMSC2_gv_mMSC2NukeCalldownPiing[lv_calldownPlayer][0] = PingLastCreated();
    }
    else {
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2NukeChannelingPing_Init () {
    libMSC2_gt_MMSC2NukeChannelingPing = TriggerCreate("libMSC2_gt_MMSC2NukeChannelingPing_Func");
    TriggerAddEventPlayerEffectUsed(libMSC2_gt_MMSC2NukeChannelingPing, c_playerAny, "NukeInitialSet");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Nuke Canceling Ping
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2NukeCancelingPing_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_calldownPlayer;

    // Automatic Variable Declarations
    // Variable Initialization

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

    lv_calldownPlayer = EventPlayerEffectUsedUnitOwner(c_effectPlayerCaster);
    if (((lv_calldownPlayer <= 0) || (lv_calldownPlayer > libCore_gv_bALMaxPlayers))) {
        return true;
    }

    PingDestroy(libMSC2_gv_mMSC2NukeCalldownPiing[lv_calldownPlayer][0]);
    PingDestroy(libMSC2_gv_mMSC2NukeCalldownPiing[lv_calldownPlayer][1]);
    PingDestroy(libMSC2_gv_mMSC2NukeCalldownPiing[lv_calldownPlayer][2]);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2NukeCancelingPing_Init () {
    libMSC2_gt_MMSC2NukeCancelingPing = TriggerCreate("libMSC2_gt_MMSC2NukeCancelingPing_Func");
    TriggerAddEventPlayerEffectUsed(libMSC2_gt_MMSC2NukeCancelingPing, c_playerAny, "NukeMinimapIconKillDamage");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Nuke Interrupted
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2NukeInterrupted_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Actions
    if (!runActions) {
        return true;
    }

    UnitModifyCooldown(EventPlayerEffectUsedUnit(c_effectUnitCaster), "Abil/MapMechanicNuke", libMSC2_gv_mMSC2NukeInterruptDelay_C, c_cooldownOperationSet);
    UnitModifyCooldown(EventPlayerEffectUsedUnit(c_effectUnitCaster), "Abil/MapMechanicAbilityTarget", libMSC2_gv_mMSC2NukeInterruptDelay_C, c_cooldownOperationSet);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2NukeInterrupted_Init () {
    libMSC2_gt_MMSC2NukeInterrupted = TriggerCreate("libMSC2_gt_MMSC2NukeInterrupted_Func");
    TriggerAddEventPlayerEffectUsed(libMSC2_gt_MMSC2NukeInterrupted, c_playerAny, "NukeCCedCooldownModifyUnit");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Nuke Used
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2NukeUsed_Func (bool testConds, bool runActions) {
    // Variable Declarations
    unit lv_casterUnit;

    // Automatic Variable Declarations
    // Variable Initialization

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

    lv_casterUnit = EventPlayerEffectUsedUnit(c_effectUnitCaster);
    libNtve_gf_SendActorMessageToUnit(libMSC2_gv_nukeSiloUnit[libGame_gf_TeamNumberOfPlayer(UnitGetOwner(lv_casterUnit))], "Signal Launch");
    if (((UnitGetOwner(lv_casterUnit) <= 0) || (UnitGetOwner(lv_casterUnit) > libCore_gv_bALMaxPlayers))) {
    }
    else {
        libGame_gf_ScoreValuesReportIntegerValueAndLog(UnitGetOwner(lv_casterUnit), "CarriedMechanic", 0);
        libMSC2_gf_MMSC2PlayerUsesNuke(EventPlayerEffectUsedUnit(c_effectUnitCaster));
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2NukeUsed_Init () {
    libMSC2_gt_MMSC2NukeUsed = TriggerCreate("libMSC2_gt_MMSC2NukeUsed_Func");
    TriggerAddEventPlayerEffectUsed(libMSC2_gt_MMSC2NukeUsed, c_playerAny, "NukeDroppingSet");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Nuke Damage Dealt
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2NukeDamageDealt_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_damagingPlayer;
    fixed lv_damageAmount;

    // Automatic Variable Declarations
    // Variable Initialization
    lv_damagingPlayer = EventUnitDamageSourcePlayer();
    lv_damageAmount = EventUnitDamageAmount();

    // Conditions
    if (testConds) {
        if (!((lv_damagingPlayer > 0))) {
            return false;
        }

        if (!((lv_damagingPlayer <= libCore_gv_bALMaxPlayers))) {
            return false;
        }
    }

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

    libGame_gf_SendMapSpecificAwardEvent(lv_damagingPlayer, lv_damageAmount, true);
    libMSC2_gv_mMSC2NukeDamageDone[lv_damagingPlayer] += FixedToInt(lv_damageAmount);
    libGame_gf_ScoreValuesReportIntegerValueAndLog(lv_damagingPlayer, "NukeDamageDone", libMSC2_gv_mMSC2NukeDamageDone[lv_damagingPlayer]);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2NukeDamageDealt_Init () {
    libMSC2_gt_MMSC2NukeDamageDealt = TriggerCreate("libMSC2_gt_MMSC2NukeDamageDealt_Func");
    TriggerAddEventUnitDamaged(libMSC2_gt_MMSC2NukeDamageDealt, null, c_unitDamageTypeAny, c_unitDamageEither, "NukeOuterImpactDamage");
    TriggerAddEventUnitDamaged(libMSC2_gt_MMSC2NukeDamageDealt, null, c_unitDamageTypeAny, c_unitDamageEither, "NukeOuterImpactHeroDamage");
    TriggerAddEventUnitDamaged(libMSC2_gt_MMSC2NukeDamageDealt, null, c_unitDamageTypeAny, c_unitDamageEither, "NukeOuterImpactDamageStructure");
    TriggerAddEventUnitDamaged(libMSC2_gt_MMSC2NukeDamageDealt, null, c_unitDamageTypeAny, c_unitDamageEither, "NukeStructureBurnPeriodicDamage");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Player Dies with Nuke
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2PlayerDieswithNuke_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_player;
    unit lv_heroUnit;
    int lv_allyTeam;
    int lv_enemyTeam;

    // Automatic Variable Declarations
    int autoD9C5CF58_val;

    // Variable Initialization
    lv_player = libGame_gf_HeroKilledPlayer();
    lv_heroUnit = libGame_gf_HeroKilledUnit();
    lv_allyTeam = libGame_gf_TeamNumberOfPlayer(lv_player);
    lv_enemyTeam = libGame_gf_EnemyTeam(lv_allyTeam);

    // Conditions
    if (testConds) {
        if (!((UnitHasBehavior2(lv_heroUnit, "HasMapMechanicTargetAbility") == true))) {
            return false;
        }
    }

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

    UnitBehaviorRemove(lv_heroUnit, "HasMapMechanicTargetAbility", 1);
    libNtve_gf_CreateUnitsWithDefaultFacing(1, "WarheadDropped", 0, libCore_gv_cOMPUTER_Neutral, libGame_gf_HeroKilledLocation(), null);
    autoD9C5CF58_val = lv_allyTeam;
    if (autoD9C5CF58_val == libGame_gv_teamOrderIndex_C) {
        libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel[lv_allyTeam], IntToText(libMSC2_gf_MMSC2NukeCountforTeam(lv_allyTeam)), PlayerGroupAll());
    }
    else if (autoD9C5CF58_val == libGame_gv_teamChaosIndex_C) {
        libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel2[lv_allyTeam], IntToText(libMSC2_gf_MMSC2NukeCountforTeam(lv_allyTeam)), PlayerGroupAll());
    }
    else {
    }
    libGame_gf_ScoreValuesReportIntegerValueAndLog(lv_player, "CarriedMechanic", 0);
    libMSC2_gv_mMSC2_Nuke_Info.lv_playerNukeStateChanged[lv_player] = true;
    libNtve_gf_SetUpgradeLevelForPlayer(lv_player, "DisplayLockedMapMechanicAbility", 1);
    libMSC2_gf_MMSC2UIDisableNukeUIStateForPlayer(lv_player);
    libMSC2_gf_MMSC2NukeButtonStopFlashingForPlayer(lv_player);
    libMSC2_gf_MMSC2ShowHideNukeTextTagsForPlayer(true, lv_player);
    if ((libMSC2_gf_MMSC2NukeCountforTeam(lv_allyTeam) == 0)) {
        libMSC2_gv_mMSC2_Nuke_Info.lv_teamHasNukes[lv_allyTeam] = false;
        libNtve_gf_SendActorMessageToUnit(libMSC2_gv_nukeSiloUnit[lv_allyTeam], "Signal Deactivate");
    }

    StatEventCreate("WarheadJunctionNukeDropped");
    StatEventAddDataFixed(StatEventLastCreated(), "GameTime", libUIUI_gf_HeroesGameTime());
    StatEventAddDataInt(StatEventLastCreated(), "OwningTeam", lv_allyTeam);
    StatEventSend(StatEventLastCreated());
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2PlayerDieswithNuke_Init () {
    libMSC2_gt_MMSC2PlayerDieswithNuke = TriggerCreate("libMSC2_gt_MMSC2PlayerDieswithNuke_Func");
    libGame_gf_HeroKilled(libMSC2_gt_MMSC2PlayerDieswithNuke);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Reveal Nuke Caster
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2RevealNukeCaster_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Actions
    if (!runActions) {
        return true;
    }

    UnitBehaviorAdd(EventUnit(), "NukeRevealer", libGame_gv_teams[libGame_gf_EnemyTeamNumberOfPlayer(UnitGetOwner(EventUnit()))].lv_core, 1);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2RevealNukeCaster_Init () {
    libMSC2_gt_MMSC2RevealNukeCaster = TriggerCreate("libMSC2_gt_MMSC2RevealNukeCaster_Func");
    TriggerAddEventUnitBehaviorChange(libMSC2_gt_MMSC2RevealNukeCaster, null, "CallingDownNuke", c_unitBehaviorChangeCreate);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Dropped Warhead Spawned
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2DroppedWarheadSpawned_Func (bool testConds, bool runActions) {
    // Variable Declarations
    unit lv_warheadUnit;
    point lv_positionOfWarhead;
    text lv_tooltipText;
    int lv_playerIndex;

    // Automatic Variable Declarations
    const int auto8A47867E_ae = libCore_gv_bALMaxPlayers;
    const int auto8A47867E_ai = 1;

    // Variable Initialization
    lv_warheadUnit = EventPlayerEffectUsedUnit(c_effectUnitSource);
    lv_positionOfWarhead = UnitGetPosition(lv_warheadUnit);

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

    UnitGroupAdd(libMSC2_gv_mMSC2DroppedWarheadsGroup, lv_warheadUnit);
    AddUnitOfInterest(lv_warheadUnit, libMSC2_gv_mMSC2NukePickupRange_C, 0.0, "Harvest", libNtve_ge_GoalTeam_Both, 0);
    libCore_gf_CreateMinimapPingStorm(PlayerGroupAll(), "StormAlertSilent", lv_positionOfWarhead, ColorWithAlpha(0,0,0,0), 4.0);
    PingSetScale(PingLastCreated(), 0.6);
    lv_tooltipText = StringExternal("Param/Value/lib_MSC2_E1636F4D");
    TextTagCreate(lv_tooltipText, 24, lv_positionOfWarhead, 2.0, true, true, PlayerGroupAll());
    libCore_gf_StoreTextTagForUnit(lv_warheadUnit, 1, TextTagLastCreated());
    TextTagAttachToUnit(TextTagLastCreated(), lv_warheadUnit, 4.0);
    libMSC2_gf_MMSC2UpdateNukeTextTagsForPlayers();
    lv_playerIndex = 1;
    for ( ; ( (auto8A47867E_ai >= 0 && lv_playerIndex <= auto8A47867E_ae) || (auto8A47867E_ai < 0 && lv_playerIndex >= auto8A47867E_ae) ) ; lv_playerIndex += auto8A47867E_ai ) {
        libNtve_gf_ShareVisionofUnit(lv_warheadUnit, true, lv_playerIndex);
    }
    TimerStart(libMSC2_gv_mMSC2DroppedWarheadReminderTimer, libMSC2_gv_mMSC2WarheadPickupReminderDelay_C, false, c_timeGame);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2DroppedWarheadSpawned_Init () {
    libMSC2_gt_MMSC2DroppedWarheadSpawned = TriggerCreate("libMSC2_gt_MMSC2DroppedWarheadSpawned_Func");
    TriggerAddEventPlayerEffectUsed(libMSC2_gt_MMSC2DroppedWarheadSpawned, c_playerAny, "WarheadDroppedDummyEffect");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Dropped Warhead Channel Started
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2DroppedWarheadChannelStarted_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Conditions
    if (testConds) {
        if (!((UnitGetType(EventUnitTargetUnit()) == "WarheadDropped"))) {
            return false;
        }
    }

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

    if ((UnitGroupCount(libMSC2_gv_mMSC2DroppedWarheadsGroup, c_unitCountAlive) > 0)) {
        TimerStart(libMSC2_gv_mMSC2DroppedWarheadReminderTimer, libMSC2_gv_mMSC2WarheadPickupReminderDelay_C, false, c_timeGame);
    }

    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2DroppedWarheadChannelStarted_Init () {
    libMSC2_gt_MMSC2DroppedWarheadChannelStarted = TriggerCreate("libMSC2_gt_MMSC2DroppedWarheadChannelStarted_Func");
    TriggerAddEventUnitAbility(libMSC2_gt_MMSC2DroppedWarheadChannelStarted, null, AbilityCommand("CaptureMacGuffin", 0), c_abilEffectStageCast, false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Dropped Warhead Captured
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2DroppedWarheadCaptured_Func (bool testConds, bool runActions) {
    // Variable Declarations
    unit lv_warheadUnit;
    unit lv_casterUnit;
    int lv_team;
    point lv_heroLoc;
    point lv_canisterLoc;
    text lv_tagText;

    // Automatic Variable Declarations
    unitgroup autoFEFAF450_g;
    int autoFEFAF450_u;
    int auto64AB9075_val;

    // Variable Initialization

    // Conditions
    if (testConds) {
        if (!((EventPlayerEffectUsedUnitType(c_effectUnitTarget) == "WarheadDropped"))) {
            return false;
        }
    }

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

    autoFEFAF450_g = libMSC2_gv_mMSC2DroppedWarheadsGroup;
    autoFEFAF450_u = UnitGroupCount(autoFEFAF450_g, c_unitCountAll);
    for (;; autoFEFAF450_u -= 1) {
        lv_warheadUnit = UnitGroupUnitFromEnd(autoFEFAF450_g, autoFEFAF450_u);
        if (lv_warheadUnit == null) { break; }
        if ((EventPlayerEffectUsedUnit(c_effectUnitTarget) == lv_warheadUnit)) {
            lv_casterUnit = EventPlayerEffectUsedUnit(c_effectUnitCaster);
            lv_team = libGame_gf_TeamNumberOfPlayer(UnitGetOwner(lv_casterUnit));
            if ((libGame_gf_TeamNumberIsValid(lv_team) == false)) {
                return true;
            }

            lv_heroLoc = UnitGetPosition(lv_casterUnit);
            lv_canisterLoc = UnitGetPosition(lv_warheadUnit);
            UnitGroupRemove(libMSC2_gv_mMSC2DroppedWarheadsGroup, lv_warheadUnit);
            RemoveUnitOfInterest(lv_warheadUnit, "Harvest", libNtve_ge_GoalTeam_Both);
            UnitKill(lv_warheadUnit);
            libMSC2_gf_MMSC2ArmNukeForUnit(lv_casterUnit);
            TextTagDestroy(libCore_gf_TextTagStoredForUnit(lv_warheadUnit, 1));
            SoundPlayForPlayer(SoundLink("Event_Warhead_CollectUranium_Enemy", -1), c_maxPlayers, GameAttributePlayersForTeam(libGame_gf_EnemyTeam(lv_team)), 100.0, 0.0);
            libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke(UnitGetOwner(lv_casterUnit));
            auto64AB9075_val = lv_team;
            if (auto64AB9075_val == libGame_gv_teamOrderIndex_C) {
                libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel[lv_team], IntToText(libMSC2_gf_MMSC2NukeCountforTeam(lv_team)), PlayerGroupAll());
            }
            else if (auto64AB9075_val == libGame_gv_teamChaosIndex_C) {
                libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_ravenCourtTeamTributeCounterLabel2[lv_team], IntToText(libMSC2_gf_MMSC2NukeCountforTeam(lv_team)), PlayerGroupAll());
            }
            else {
            }
            break;
        }

    }
    if ((UnitGroupCount(libMSC2_gv_mMSC2DroppedWarheadsGroup, c_unitCountAlive) == 0)) {
        TimerPause(libMSC2_gv_mMSC2DroppedWarheadReminderTimer, true);
    }
    else {
        TimerStart(libMSC2_gv_mMSC2DroppedWarheadReminderTimer, libMSC2_gv_mMSC2WarheadPickupReminderDelay_C, false, c_timeGame);
    }
    Wait(libMSC2_gv_mMSC2NukeArmingDuration_C, c_timeGame);
    if ((UnitHasBehavior2(EventPlayerEffectUsedUnit(c_effectUnitCaster), "HasMapMechanicTargetAbility") == true)) {
        libMSC2_gf_MMSC2TransmissionPlayerNukeReady(UnitGetOwner(EventPlayerEffectUsedUnit(c_effectUnitCaster)));
    }

    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2DroppedWarheadCaptured_Init () {
    libMSC2_gt_MMSC2DroppedWarheadCaptured = TriggerCreate("libMSC2_gt_MMSC2DroppedWarheadCaptured_Func");
    TriggerAddEventPlayerEffectUsed(libMSC2_gt_MMSC2DroppedWarheadCaptured, c_playerAny, "CaptureMacGuffinCastComplete");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Dropped Warhead Reminder Timer Expired
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2DroppedWarheadReminderTimerExpired_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_unitIndex;
    unit lv_warheadUnit;

    // Automatic Variable Declarations
    unitgroup autoDDA95259_g;
    int autoDDA95259_u;

    // Variable Initialization

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

    SoundPlayForPlayer(SoundLink("UI_Game_Ping_Reminder1", -1), c_maxPlayers, PlayerGroupAll(), 100.0, 0.0);
    autoDDA95259_g = libMSC2_gv_mMSC2DroppedWarheadsGroup;
    autoDDA95259_u = UnitGroupCount(autoDDA95259_g, c_unitCountAll);
    for (;; autoDDA95259_u -= 1) {
        lv_warheadUnit = UnitGroupUnitFromEnd(autoDDA95259_g, autoDDA95259_u);
        if (lv_warheadUnit == null) { break; }
        libCore_gf_CreateMinimapPingStorm(PlayerGroupAll(), "StormAlertSilent", UnitGetPosition(lv_warheadUnit), ColorWithAlpha(0,0,0,0), 4.0);
        PingSetScale(PingLastCreated(), 0.6);
    }
    TimerStart(libMSC2_gv_mMSC2DroppedWarheadReminderTimer, libMSC2_gv_mMSC2WarheadPickupReminderDelay_C, false, c_timeGame);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2DroppedWarheadReminderTimerExpired_Init () {
    libMSC2_gt_MMSC2DroppedWarheadReminderTimerExpired = TriggerCreate("libMSC2_gt_MMSC2DroppedWarheadReminderTimerExpired_Func");
    TriggerAddEventTimer(libMSC2_gt_MMSC2DroppedWarheadReminderTimerExpired, libMSC2_gv_mMSC2DroppedWarheadReminderTimer);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Init Nuke Silos
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_InitNukeSilos_Func (bool testConds, bool runActions) {
    // Variable Declarations
    unitgroup lv_nukeSilos;
    unit lv_itUnit;

    // Automatic Variable Declarations
    unitgroup auto80E0D7A3_g;
    int auto80E0D7A3_u;

    // Variable Initialization
    lv_nukeSilos = UnitGroupEmpty();

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

    lv_nukeSilos = UnitGroup("MapMechanicNukeSilo", c_playerAny, null, UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
    auto80E0D7A3_g = lv_nukeSilos;
    auto80E0D7A3_u = UnitGroupCount(auto80E0D7A3_g, c_unitCountAll);
    for (;; auto80E0D7A3_u -= 1) {
        lv_itUnit = UnitGroupUnitFromEnd(auto80E0D7A3_g, auto80E0D7A3_u);
        if (lv_itUnit == null) { break; }
        if ((UnitGetOwner(lv_itUnit) == libCore_gv_cOMPUTER_TeamOrder)) {
            libMSC2_gv_nukeSiloUnit[libGame_gv_teamOrderIndex_C] = lv_itUnit;
            continue;
        }

        if ((UnitGetOwner(lv_itUnit) == libCore_gv_cOMPUTER_TeamChaos)) {
            libMSC2_gv_nukeSiloUnit[libGame_gv_teamChaosIndex_C] = lv_itUnit;
            continue;
        }

    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_InitNukeSilos_Init () {
    libMSC2_gt_InitNukeSilos = TriggerCreate("libMSC2_gt_InitNukeSilos_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Debug VOTest
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2DebugVOTest_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_player;

    // Automatic Variable Declarations
    // Variable Initialization

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

        if (!((StringCompare(StringWord(EventChatMessage(false), 1), EventChatMessage(true), c_stringNoCase) == 0))) {
            return false;
        }
    }

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

    lv_player = StringToInt(StringWord(EventChatMessage(false), 2));
    if ((lv_player == 0)) {
        TriggerDebugOutput(1, StringExternal("Param/Value/lib_MSC2_5E8BD6F6"), true);
        return true;
    }

    TextExpressionSetToken("Param/Expression/lib_MSC2_9F26C83F", "A", IntToText(lv_player));
    TriggerDebugOutput(1, TextExpressionAssemble("Param/Expression/lib_MSC2_9F26C83F"), true);
    libMSC2_gf_MMSC2TransmissionPlayerFiresNuke(lv_player);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2DebugVOTest_Init () {
    libMSC2_gt_MMSC2DebugVOTest = TriggerCreate("libMSC2_gt_MMSC2DebugVOTest_Func");
    TriggerAddEventChatMessage(libMSC2_gt_MMSC2DebugVOTest, c_playerAny, "VOTest", false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Debug VOCollect
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2DebugVOCollect_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_player;

    // Automatic Variable Declarations
    // Variable Initialization

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

        if (!((StringCompare(StringWord(EventChatMessage(false), 1), EventChatMessage(true), c_stringNoCase) == 0))) {
            return false;
        }
    }

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

    lv_player = StringToInt(StringWord(EventChatMessage(false), 2));
    if ((lv_player == 0)) {
        TriggerDebugOutput(1, StringExternal("Param/Value/lib_MSC2_78C7B008"), true);
        return true;
    }

    TextExpressionSetToken("Param/Expression/lib_MSC2_2DC6332A", "A", IntToText(lv_player));
    TriggerDebugOutput(1, TextExpressionAssemble("Param/Expression/lib_MSC2_2DC6332A"), true);
    libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke(lv_player);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2DebugVOCollect_Init () {
    libMSC2_gt_MMSC2DebugVOCollect = TriggerCreate("libMSC2_gt_MMSC2DebugVOCollect_Func");
    TriggerAddEventChatMessage(libMSC2_gt_MMSC2DebugVOCollect, c_playerAny, "VOCollect", false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Debug VOWarning
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2DebugVOWarning_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_player;

    // Automatic Variable Declarations
    // Variable Initialization

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

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

    TriggerDebugOutput(1, TextExpressionAssemble("Param/Expression/lib_MSC2_AC8062BA"), true);
    libMSC2_gf_MMSC2TransmissionWarheadSpawnWarningQ();
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2DebugVOWarning_Init () {
    libMSC2_gt_MMSC2DebugVOWarning = TriggerCreate("libMSC2_gt_MMSC2DebugVOWarning_Func");
    TriggerAddEventChatMessage(libMSC2_gt_MMSC2DebugVOWarning, c_playerAny, "VOWarning", false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Debug VOCheck
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2DebugVOCheck_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

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

    TriggerDebugOutput(1, StringExternal("Param/Value/lib_MSC2_FCC2DB33"), true);
    libMSC2_gf_MMSC2TransmissionPlayerNukeReady(1);
    Wait(0.5, c_timeGame);
    TriggerDebugOutput(1, StringExternal("Param/Value/lib_MSC2_55A376F8"), true);
    libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke(6);
    Wait(3.0, c_timeGame);
    TriggerDebugOutput(1, StringExternal("Param/Value/lib_MSC2_61E5ED95"), true);
    libMSC2_gf_MMSC2TransmissionPlayerFiresNuke(1);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2DebugVOCheck_Init () {
    libMSC2_gt_MMSC2DebugVOCheck = TriggerCreate("libMSC2_gt_MMSC2DebugVOCheck_Func");
    TriggerAddEventChatMessage(libMSC2_gt_MMSC2DebugVOCheck, c_playerAny, "VOCheck", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Debug VOCheck 2
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2DebugVOCheck2_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }
    }

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

    TriggerDebugOutput(1, StringExternal("Param/Value/lib_MSC2_2E2D42C8"), true);
    libMSC2_gf_MMSC2TransmissionPlayerNukeReady(6);
    Wait(0.5, c_timeGame);
    TriggerDebugOutput(1, StringExternal("Param/Value/lib_MSC2_17F89FC9"), true);
    libMSC2_gf_MMSC2TransmissionPlayerCollectsNuke(1);
    Wait(3.0, c_timeGame);
    TriggerDebugOutput(1, StringExternal("Param/Value/lib_MSC2_4DC2EDAB"), true);
    libMSC2_gf_MMSC2TransmissionPlayerFiresNuke(6);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2DebugVOCheck2_Init () {
    libMSC2_gt_MMSC2DebugVOCheck2 = TriggerCreate("libMSC2_gt_MMSC2DebugVOCheck2_Func");
    TriggerAddEventChatMessage(libMSC2_gt_MMSC2DebugVOCheck2, c_playerAny, "VOCheck2", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 UI Mod Initialize
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2UIModInitialize_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Actions
    if (!runActions) {
        return true;
    }

    libMSC2_gf_MMSC2UIInit(libUIUI_gv_mapMechanicsPanel.lv_mainPanel);
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2UIModInitialize_Init () {
    libMSC2_gt_MMSC2UIModInitialize = TriggerCreate("libMSC2_gt_MMSC2UIModInitialize_Func");
    libCore_gf_IncludeModInitialization(libMSC2_gt_MMSC2UIModInitialize);
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 UI Handler
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2UIHandler_Func (bool testConds, bool runActions) {
    // Variable Declarations
    int lv_state;
    int lv_lastState;

    // Automatic Variable Declarations
    // Variable Initialization

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

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

    DialogControlSendAnimationEvent(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeTimeLabel, PlayerGroupAll(), "MoveAnchor");
    TriggerEnable(TriggerGetCurrent(), false);
    while (true) {
        if ((libMSC2_gv_mMSC2EventState == libMSC2_ge_MMSC2EventStates_CanisterWarning)) {
            lv_state = libMSC2_ge_MMSC2UIModes_CanisterWarning;
            if ((lv_state != lv_lastState)) {
                libMSC2_gf_MMSC2UISetMode(libMSC2_ge_MMSC2UIModes_CanisterWarning);
            }

            libMSC2_gf_MMSC2UISetEruptionWarningTime(FixedToInt(TimerGetRemaining(libMSC2_gv_mMSC2TerrazineMainEventTimer)));
            lv_lastState = lv_state;
        }
        else if ((libNtve_gf_UnitGroupIsDead(libMSC2_gv_mMSC2BuiltWarheadsActive) == false)) {
            lv_state = libMSC2_ge_MMSC2UIModes_NukesActive;
            if ((lv_state != lv_lastState)) {
                libMSC2_gf_MMSC2UISetMode(libMSC2_ge_MMSC2UIModes_NukesActive);
            }

            DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeTimeLabel, PlayerGroupAll(), false);
            DialogControlSetVisible(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeQuantityLabel, PlayerGroupAll(), true);
            TextExpressionSetToken("Param/Expression/lib_MSC2_360C61A9", "A", IntToText(UnitGroupCount(libMSC2_gv_mMSC2BuiltWarheadsActive, c_unitCountAlive)));
            libNtve_gf_SetDialogItemText(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeQuantityLabel, TextExpressionAssemble("Param/Expression/lib_MSC2_360C61A9"), PlayerGroupAll());
            DialogControlSendAnimationEvent(libMSC2_gv_mMSC2UIPanel.lv_capturePointsTimerModeQuantityLabel, PlayerGroupAll(), "MoveAnchorBack");
            lv_lastState = lv_state;
        }
        else if (true) {
            lv_state = libMSC2_ge_MMSC2UIModes_NoEvent;
            if ((lv_state != lv_lastState)) {
                libMSC2_gf_MMSC2UISetMode(libMSC2_ge_MMSC2UIModes_NoEvent);
            }

            lv_lastState = lv_state;
        }
        Wait(0.25, c_timeGame);
    }
    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2UIHandler_Init () {
    libMSC2_gt_MMSC2UIHandler = TriggerCreate("libMSC2_gt_MMSC2UIHandler_Func");
}

//--------------------------------------------------------------------------------------------------
// Trigger: MMSC2 Debug EventStart
//--------------------------------------------------------------------------------------------------
bool libMSC2_gt_MMSC2DebugEventStart_Func (bool testConds, bool runActions) {
    // Automatic Variable Declarations
    // Conditions
    if (testConds) {
        if (!((GameCheatsEnabled(c_gameCheatCategoryDevelopment) == true))) {
            return false;
        }

        if (!((libMapM_gv_mMMapMechanicDisabled == false))) {
            return false;
        }
    }

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

    if ((TimerGetRemaining(libMSC2_gv_mMSC2TerrazineMainEventTimer) > libMSC2_gv_mMSC2EventWarningDelayGasCanister_C)) {
        TimerStart(libMSC2_gv_mMSC2ObjectivePreviewTimer, 0.0625, false, c_timeGame);
        Wait(0.125, c_timeGame);
        TimerStart(libMSC2_gv_mMSC2TerrazineMainEventTimer, libMSC2_gv_mMSC2EventWarningDelayGasCanister_C, false, c_timeGame);
    }

    return true;
}

//--------------------------------------------------------------------------------------------------
void libMSC2_gt_MMSC2DebugEventStart_Init () {
    libMSC2_gt_MMSC2DebugEventStart = TriggerCreate("libMSC2_gt_MMSC2DebugEventStart_Func");
    TriggerAddEventChatMessage(libMSC2_gt_MMSC2DebugEventStart, c_playerAny, "EVENTSTART", false);
}

void libMSC2_InitTriggers () {
    libMSC2_gt_IncludeWarheadJunction_Init();
    libMSC2_gt_MMSC2Init_Init();
    libMSC2_gt_MMSC2InitializePingData_Init();
    libMSC2_gt_MMSC2GatesOpened_Init();
    libMSC2_gt_MMSC2MainThread_Init();
    libMSC2_gt_MMSC2ObjectivePreviewTimerExpires_Init();
    libMSC2_gt_MMSC2ActivateWaygates_Init();
    libMSC2_gt_MMToDEnteredWaygate_Init();
    libMSC2_gt_MMSC2BuiltWarheadReminderTimerExpires_Init();
    libMSC2_gt_MMSC2NukeDamageScaling_Init();
    libMSC2_gt_MMSC2BuiltWarheadChannelStarted_Init();
    libMSC2_gt_MMSC2BuiltWarheadCaptured_Init();
    libMSC2_gt_MMSC2NukeChannelingPing_Init();
    libMSC2_gt_MMSC2NukeCancelingPing_Init();
    libMSC2_gt_MMSC2NukeInterrupted_Init();
    libMSC2_gt_MMSC2NukeUsed_Init();
    libMSC2_gt_MMSC2NukeDamageDealt_Init();
    libMSC2_gt_MMSC2PlayerDieswithNuke_Init();
    libMSC2_gt_MMSC2RevealNukeCaster_Init();
    libMSC2_gt_MMSC2DroppedWarheadSpawned_Init();
    libMSC2_gt_MMSC2DroppedWarheadChannelStarted_Init();
    libMSC2_gt_MMSC2DroppedWarheadCaptured_Init();
    libMSC2_gt_MMSC2DroppedWarheadReminderTimerExpired_Init();
    libMSC2_gt_InitNukeSilos_Init();
    libMSC2_gt_MMSC2DebugVOTest_Init();
    libMSC2_gt_MMSC2DebugVOCollect_Init();
    libMSC2_gt_MMSC2DebugVOWarning_Init();
    libMSC2_gt_MMSC2DebugVOCheck_Init();
    libMSC2_gt_MMSC2DebugVOCheck2_Init();
    libMSC2_gt_MMSC2UIModInitialize_Init();
    libMSC2_gt_MMSC2UIHandler_Init();
    libMSC2_gt_MMSC2DebugEventStart_Init();
}

//--------------------------------------------------------------------------------------------------
// Library Initialization
//--------------------------------------------------------------------------------------------------
bool libMSC2_InitLib_completed = false;

void libMSC2_InitLib () {
    if (libMSC2_InitLib_completed) {
        return;
    }

    libMSC2_InitLib_completed = true;

    libMSC2_InitLibraries();
    libMSC2_InitVariables();
    libMSC2_InitTriggers();
}