//********************************************************************************* module mc2_15: integer; const #include_ "misconst.abi" #include_ "sndconst.abi" type var #include_ "sndvar.abi" static boolean Objective_0_Decided; static integer ScenarioResult; eternal boolean ExitTimerSet; static integer VictoryLevel; char[40] dstring; eternal real gametime; static real nextsecond; integer x; integer y; Position aPoint; static Position startP; eternal boolean PlayerForceDead; eternal boolean ClanForceDead; eternal boolean AlliedForceDead; eternal boolean GeneralAlarm; eternal boolean Flag1; eternal boolean Flag2; eternal boolean Flag3; eternal boolean Flag4; eternal boolean Flag5; eternal boolean Flag6; eternal boolean Flag7; eternal boolean Flag8; eternal boolean Flag9; eternal boolean Flag10; static boolean PlayPASound; static boolean PlayGASound; eternal integer GeneralAlarmCounter; boolean PerimeterBreach; static boolean startCam; static boolean endCam; static real velTime; static real zoomFOV; static real startFOV; static integer camObject; //*******************************************NEW eternal boolean TurretBase_Attacked; eternal boolean SupplyBase_Attacked; eternal integer TCB_Escort_1, TCB_Escort_2; eternal integer TCB_AreaTriggered; static real timerdelay, timerdelay1, timerdelay2, timerdelay3, timerDelay4; eternal boolean LegionAttacked; static boolean PlayLegionVO, PlayLegionVO_Check; static boolean playOpeningVO, PlayOpeningVO_Check; static boolean RebelVO, rebelHelpVO; static boolean RebelThankVO, RebelThankVO_Check; static boolean RebelDestroySensor, RebelDestroySensor_Check; static boolean BlowSensorGrid; eternal boolean AttackGrid; static boolean RebelBeenDestroy, RebelBeenDestroy_Check; eternal boolean RebelAliveCheck; eternal boolean OperativeVo; static boolean OperativeVo_Check; static boolean banditRunAway_Check; eternal boolean banditRunAway; static boolean GoodWorkVo, GoodWorkVO_Check; static integer numUnits, i; static integer[128] moverList; static worldposition unitPosition; //--------------------------------------- // MUSIC STUFF eternal boolean AttackMusicTrigger1; eternal boolean AttackMusicTrigger2; eternal boolean AttackMusicTrigger3; static real StartMusicTimer; static boolean StartMusicCheck; static boolean StartCheck; static integer SensorPlayCount; static boolean PlayCountCheck; //------------------------------------------------------------------ // Init Function (automatically run first time through) //------------------------------------------------------------------ function init; var real[3] worldLoc; integer[2] cellLoc; integer moverID; WorldPosition moverPos; code #include_ "sndinit.abi" ScenarioResult = PLAYING; PlayerForceDead = FALSE; ClanForceDead = FALSE; AlliedForceDead = FALSE; ExitTimerSet = FALSE; VictoryLevel = 0; // New Scheme NextSecond = 1.0; GeneralAlarmCounter = -1; GeneralAlarm = FALSE; Flag1 = FALSE; Flag2 = FALSE; Flag3 = FALSE; Flag4 = FALSE; Flag5 = FALSE; Flag6 = FALSE; Flag7 = FALSE; Flag8 = FALSE; Flag9 = FALSE; Flag10 = FALSE; PlayPASound = FALSE; PlayGASound = FALSE; Objective_0_Decided = FALSE; startCam = FALSE; endCam = FALSE; velTime = 0; zoomFOV = 75.0; startFOV = 75.0; camObject = -1; //************************************ TurretBase_Attacked = False; SupplyBase_Attacked = False; TCB_Escort_1 = 141696; TCB_Escort_2 = 141696; LegionAttacked = False; PlayLegionVO = False; PlayLegionVO_Check = False; PlayOpeningVO_Check = False; PlayOpeningVO = False; RebelVO = False; PlayOpeningVO = False; RebelThankVO = False; RebelThankVO_Check = False; RebelDestroySensor_Check = False; RebelDestroySensor = False; RebelBeenDestroy = False; RebelBeenDestroy_Check = False; BlowSensorGrid = False; RebelAliveCheck = True; OperativeVo = False; //Used to play Liao Operative VO OperativeVo_Check = False; AttackGrid = False; //Tell Unit to blow sensor grid banditRunAway = false; //used to tell the bandits to run away of the map banditRunAway_Check = False; GoodWorkVo = False; //Used to Play good Job VO; GoodWorkVo_Check = False; numUnits = getUnitMates(91, moverList); i = 0; //--------------------------------------- // MUSIC STUFF AttackMusicTrigger1 = FALSE; AttackMusicTrigger2 = FALSE; AttackMusicTrigger3 = FALSE; StartMusicCheck = FALSE; StartCheck = FALSE; PlayCountCheck = FALSE; //************************************ //West most Land Bridge worldLoc[0] = 2240.000; worldLoc[1] = 2496.000; worldLoc[2] = 0.0; convertCoords(0, worldLoc, cellLoc); TCB_AreaTriggered = addTriggerArea(cellLoc[0] - 15, cellLoc[1] - 15, cellLoc[0] + 15, cellLoc[1] + 15, 1, 1); endfunction; //------------------------------------------------------------------ // Main Code //------------------------------------------------------------------ code //--------------------------------------------------- Mission 15 Stuff //******************************************************* // Tac play Opening VO if ((getTime > 4) AND (Not RebelVO)) then RebelVO = True; playWave("data\sound\mc2_15_0.wav", -1); //Rebel calling for Help endif; //******************************************************* //Rebel Call for Help if ((getTime > 42) AND (Not PlayOpeningVO )) then PlayOpeningVO = True; playWave("data\sound\mc2_15_6.wav", -1); //Rebel calling for Help endif; //******************************************************* // Play Legion VO if (LegionAttacked) then if (Not PlayLegionVO_Check) then timerDelay2 = getTime + 4; //Wait 8 secs before playing VO PlayLegionVO_Check = True; else if ((getTime > timerDelay2) AND (Not PlayLegionVO )) then PlayLegionVO = True; playWave("data\sound\mc2_15_5.wav", -1); //Steiner Dude Talking about Legion Tank endif; endif; endif; //******************************************************* // Play Rebel Has been killed if (Not RebelAliveCheck) then if (Not RebelBeenDestroy_Check) then timerDelay = getTime + 4; //Wait 8 secs before playing VO RebelBeenDestroy_Check = True; RebelThankVO = True; else if ((getTime > timerDelay) AND (Not RebelBeenDestroy )) then RebelBeenDestroy = True; // playWave("data\sound\mc2_15_1.wav", -1); //Steiner Dude Talking about Legion Tank endif; endif; endif; //******************************************************* // Thank You Rebel Thanks VO if ((checkObjectiveStatus(6) == 1)) then if (Not RebelThankVO_Check) then timerDelay = getTime + 4; //Wait 8 secs before playing VO RebelThankVO_Check = True; RebelBeenDestroy = True; else if ((getTime > timerDelay) AND (Not RebelThankVO)) then RebelThankVO = True; BlowSensorGrid = True; playWave("data\sound\mc2_15_3.wav", -1); //Steiner Dude Talking about Legion Tank endif; endif; endif; //******************************************************* // Flag Telling bandits to runAway if (RebelThankVO) then if (Not RebelThankVO_Check) then timerDelay4 = getTime + 10; //Wait 8 secs before playing VO RebelThankVO_Check = True; else if ((getTime > timerDelay4) AND (Not banditRunAway)) then banditRunAway = True; endif; endif; endif; //******************************************************* //Hack to make Bandits Disappear getObjectPosition(moverList[i], unitPosition); if (unitPosition[1] < -7200) then objectRemove(moverList[i]); endif; if (i == numUnits - 1) then i = 0; else i = i + 1; endif; //******************************************************* // Play destroy Sensor Vo if (BlowSensorGrid) then if (Not RebelDestroySensor_Check) then timerDelay3 = getTime + 60; //Wait 8 secs before playing VO RebelDestroySensor_Check = True; else if (getTime > timerDelay3 - 4) then if ((ObjectStatus(76991) == 0)) Then SetObjectDamage(76991, 100); AttackGrid = True; endif; endif; if (attackGrid) then if ((getTime > timerDelay3) AND (Not RebelDestroySensor)) then RebelDestroySensor = True; playWave("data\sound\mc2_15_4.wav", -1); //Rebel Blow Up Sensor endif; endif; endif; endif; //******************************************************* // Liao Operative if ((checkObjectiveStatus(5) == 1)) then if (Not OperativeVo_Check) then timerDelay1 = getTime + 6; //Wait 8 secs before playing VO OperativeVo_Check = True; else if ((getTime > timerDelay1) AND (Not OperativeVo)) then OperativeVo = True; playWave("data\sound\mc2_15_2.wav", -1); //Rebel Blow Up Sensor endif; endif; endif; //******************************************************* //Liao Say you do good stuff if ((checkObjectiveStatus(0) == 1) AND (checkObjectiveStatus(1) == 1)) then if (Not GoodWorkVo_Check) then timerDelay1 = getTime + 6; //Wait 8 secs before playing VO GoodWorkVo_Check = True; else if ((getTime > timerDelay1) AND (Not GoodWorkVo)) then GoodWorkVo = True; // playWave("data\sound\mc2_15_1.wav", -1); //Rebel Blow Up Sensor endif; endif; endif; //---------------------------------------------------- Mission 15 Stuff End //------------------------------------------------------------- //MUSIC CODE // Generic Music Selection code based on mission events. // if (getMissionWon) then playDigitalMusic(MissionWonTune0); playingMissionResultTune = true; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = false; playingAmbientTune = false; playingSensorTune = false; playingCombatTune = false; endif; if (getMissionLost) then playDigitalMusic(MissionLostTune0); playingMissionResultTune = true; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = false; playingAmbientTune = false; playingSensorTune = false; playingCombatTune = false; endif; if (checkObjectiveStatus (1) == 1) AND (NOT PlayCountCheck) then PlayCountCheck = TRUE; SensorPlayCount = 1; endif; if (not playMissionStartTune) then if (getSensorsActive and ((getCurrentMusicId == -1) or (playingCombatTune and not getPlayerInCombat) or (playingAmbientTune))) then if (random(100) < 1) then if (SensorPlayCount < 3) then SensorPlayCount = SensorPlayCount + 1; mcprint (SensorPlayCount); playDigitalMusic(SensorTune2); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = true; playingCombatTune = false; playingAmbientTune = false; playingSensorTune = true; else // if (NOT playingCombatTune) then playDigitalMusic(AmbientTune3); mcprint ("Playing Ambient Tune Sensorstyle"); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = true; playingCombatTune = false; playingAmbientTune = false; playingSensorTune = true; endif; endif; endif; if (NOT getSensorsActive and ((getCurrentMusicId == -1) or (playingCombatTune and not getPlayerInCombat) or (playingSensorTune))) then playDigitalMusic(AmbientTune3); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = true; playingAmbientTune = true; playingSensorTune = false; playingCombatTune = false; endif; endif; if (NOT (checkObjectiveStatus(0) == 1)) then // if ((NOT (checkObjectiveStatus(2) == 1)) AND (NOT (checkObjectiveStatus(3) == 1)) AND (NOT (checkObjectiveStatus(4) == 1))) then if (getPlayerInCombat and ((getCurrentMusicId == -1) or playingNONCombatTune)) then if (AttackMusicTrigger1) then mcprint ("Playing Random Combat Tune"); playDigitalMusic(CombatTune0 + Random(NumCombatTunes)); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = false; playingCombatTune = true; playingAmbientTune = false; playingSensorTune = false; endif; endif; endif; //ALWAYS play mission start tune if we just started if (playMissionStartTune and (gametime > 1)) then if (NOT StartCheck) then playDigitalMusic(MissionStartTune7); StartMusicTimer = getTime + 117; //Setting Timer //playMissionStartTune = true; StartCheck = TRUE; else if (Not StartMusicCheck) and (getTime > StartMusicTimer) then StartMusicCheck = TRUE; playMissionStartTune = false; endif; endif; endif; //------------------------------------------------ // Debug Window Game Clock Second Counter // Note: This is used by some included functions. //------------------------------------------------ gametime = gettime; If (gametime >= nextsecond) Then nextsecond = gametime + 1; If (GeneralAlarm) then GeneralAlarmCounter = GeneralAlarmCounter + 1; endif; // dstring = "Gametime: "; // concat(dstring,gametime); // Print (dstring); endif; if ((PlayGASound) and (NextSecond == gametime + 1)) then playSoundEffect(GENERAL_ALARM_SOUND); endif; if (PlayPASound) then playSoundEffect(PERIMETER_ALARM_SOUND); endif; PerimeterBreach = FALSE; return (ScenarioResult); endmodule. //******************************************************************