//////////////////////////////////////////////////////////////////////////////// /* Script Type: Conversation Action Script Description: Runs cutscene 4 at the finish of the second dialogue branch in conversation file "Ericson" This script contains 2 of 3 possible endings for the module Note: If the player attacked the urchins earlier, the cutscene will continue in safehs_trg_urch Related Scripts: warehs_urc_attack warehs_plc_brdth safehs_trg_urch */ //////////////////////////////////////////////////////////////////////////////// #include "x2_inc_cutscene" #include "x0_i0_position" #include "inc_common_funcs" void RunCutscene4(object oEricson, object oPC, object oSarah, object oPCCopy); void CutSetCameraHeight(float fDelay, object oPC, float fHeight, int iShift = TRUE); void CallSetCameraHeight(int nCutscene, object oPC, float fHeight); void CutCreateUrchin(float fDelay, object oPC, object oEricson, int iShift = TRUE); void CallCreateUrchin(int nCutscene, object oPC, object oEricson); void CutRemoveAllEffects(float fDelay, object oPC, int iShift = TRUE); void CallRemoveAllEffects(int nCutscene, object oPC); void main() { object oEricson = GetObjectByTag("Ericson"); object oPC = GetPCSpeaker(); object oSarah = GetObjectByTag("Sarah"); object oPCCopy; BlackScreen(oPC); // If the player did not abort cutscene 3 if (!(GetLocalInt(oPC, "cs3Skipped") == TRUE)) { CutResetActiveObjectsForCutscene(3); CutDisableCutscene(3, 0.0, 0.0, RESTORE_TYPE_NONE); SetCommandable(FALSE, oPC); DelayCommand(1.0, RunCutscene4(oEricson, oPC, oSarah, oPCCopy)); // delay cutscene 4 to give time for cutscene 3 disable } // If the player did abort cutscene 3 else { RunCutscene4(oEricson, oPC, oSarah, oPCCopy); } } void RunCutscene4(object oEricson, object oPC, object oSarah, object oPCCopy) { SetCommandable(TRUE, oPC); // These effects need to be removed manually after CutDisableCutscene (use RemoveAllEffects helper function) ApplyCutEffects(oPC); NightToDay(oPC, 20.0); oPCCopy = CutCreatePCCopy(oPC, GetLocation(GetWaypointByTag("wp_cs3_pc2")), "pcCopy"); CutSetActiveCutscene(4, CUT_DELAY_TYPE_CONSTANT); CutSetActiveCutsceneForObject(oPC, 4, TRUE); CutSetActiveCutsceneForObject(oEricson, 4); CutSetActiveCutsceneForObject(oPCCopy, 4); CutSetActiveCutsceneForObject(oSarah, 4); CutSetCutsceneMode(0.0, oPC, TRUE, FALSE, TRUE, FALSE); // Unlock Camera as locked by safehs_trg_cs3_1 or cs3 abort LockCameraDirection(oPC, FALSE); LockCameraDistance(oPC, FALSE); LockCameraPitch(oPC, FALSE); /* Part One */ // Other Commands CutSetCameraHeight(0.3, oPC, 1.5); CutClearAllActions(0.5, oEricson, TRUE); CutFadeFromBlack(0.55, oPC, FADE_SPEED_MEDIUM); // Camera Settings CutSetCamera(1.7, oPC, CAMERA_MODE_TOP_DOWN, 168.0, 4.0, 63.0, CAMERA_TRANSITION_TYPE_MEDIUM); CutSetCamera(8.8, oPC, CAMERA_MODE_TOP_DOWN, 182.0, 2.7, 67.0, CAMERA_TRANSITION_TYPE_MEDIUM); CutSetCamera(16.85, oPC, CAMERA_MODE_TOP_DOWN, 35.0, 3.75, 89.0, CAMERA_TRANSITION_TYPE_SLOW); CutSetCamera(43.5, oPC, CAMERA_MODE_TOP_DOWN, 110.0, 4.5, 80.0, CAMERA_TRANSITION_TYPE_SLOW); CutSetCamera(73.1, oPC, CAMERA_MODE_TOP_DOWN, 120.0, 7.15, 41.0, CAMERA_TRANSITION_TYPE_SLOW); // Conversation Facings CutSetFacingPoint(0.4, oPCCopy, "Ericson"); CutSetFacingPoint(0.9, oPCCopy, "Ericson"); CutSetFacingPoint(1.6, oEricson, "pcCopy"); // SpeakStrings CutSpeakString(3.1, oPCCopy, " ...!"); CutSpeakString(5.6, oPCCopy, "Who are you?!"); CutSpeakString(8.6, oEricson, "My name is Ericson. I'm an undercover operative working for the city's police"); CutSpeakString(20.35, oPCCopy, "Undercover? Then your clothes...?"); CutSpeakString(23.85, oEricson, "Are those of the Assassins' Assembly."); CutSpeakString(28.35, oEricson, "We believe it was formed around six years ago, not long after the attempt on your life was made."); CutSpeakString(37.85, oPCCopy, "Why have I never heard of you before? Or this Assassin's Assembly for that matter?"); CutSpeakString(46.85, oEricson, "Well actually, do you recall the incident with Councilman Harris?"); CutSpeakString(53.85, oEricson, "And the threat made on Mr. Chambers of the Merchants Guild?"); CutSpeakString(59.35, oPCCopy, "Oh... I see... So it was you I was working with on those two cases. I never got to see you in person."); CutSpeakString(71.6, oEricson, "Yes. Unhappily, the Assassins' spy network is rather extensive."); CutSpeakString(77.6, oEricson, "This is also why I couldn't just bring Sarah to the station to--"); // Animations CutPlayAnimation(5.7, oPCCopy, ANIMATION_LOOPING_TALK_NORMAL, 3.0); CutPlayAnimation(8.7, oEricson, ANIMATION_LOOPING_TALK_NORMAL, 11.2); CutPlayAnimation(20.45, oPCCopy, ANIMATION_LOOPING_TALK_NORMAL, 3.0); CutPlayAnimation(23.95, oEricson, ANIMATION_LOOPING_TALK_NORMAL, 12.5); CutPlayAnimation(37.95, oPCCopy, ANIMATION_LOOPING_TALK_NORMAL, 9.0); CutPlayAnimation(46.95, oEricson, ANIMATION_LOOPING_TALK_NORMAL, 10.2); CutPlayAnimation(59.45, oPCCopy, ANIMATION_LOOPING_TALK_NORMAL, 12.0); CutPlayAnimation(71.7, oEricson, ANIMATION_LOOPING_TALK_NORMAL, 10.5); /* End Part One */ /* Part Two */ // The second half of cutscene 4 depends on whether the player killed the // urchins earlier at the warehouse or not // Ending 1 if (GetLocalInt(oPC, "attackedUrchins") == TRUE) { //CutCreateUrchin(71.5, oPC); CutSetMusic(80.5, oPC, 52); CutCreateUrchin(80.6, oPC, oEricson); // Important //CutActionMoveToObject(80.6, GetObjectByTag("cs3_urchin"), oEricson, TRUE); // Trigger safehs_trg_urch } // Ending 2 else { // Camera Settings CutSetCamera(85.8, oPC, CAMERA_MODE_TOP_DOWN, 91.0, 5.25, 67.0, CAMERA_TRANSITION_TYPE_SLOW); CutSetCamera(105.4, oPC, CAMERA_MODE_TOP_DOWN, 91.0, 5.05, 77.0, CAMERA_TRANSITION_TYPE_VERY_SLOW); CutSetCamera(125.4, oPC, CAMERA_MODE_TOP_DOWN, 100.0, 6.3, 77.0, CAMERA_TRANSITION_TYPE_VERY_SLOW); CutSetCamera(204.55, oPC, CAMERA_MODE_TOP_DOWN, 95.0, 6.3, 77.0, CAMERA_TRANSITION_TYPE_CRAWL); CutSetCamera(208.05, oPC, CAMERA_MODE_TOP_DOWN, 88.0, 60.0, 89.0, CAMERA_TRANSITION_TYPE_SLOW); // Facing Settings CutSetFacingPoint(83.2, oSarah, "pcCopy"); CutSetFacingPoint(83.9, oPCCopy, "Sarah"); CutSetFacingPoint(155.5, oPCCopy, "Ericson"); CutSetFacingPoint(206.85, oPCCopy, "Sarah"); // MoveTos CutActionMoveToObject(83.0, oSarah, oPCCopy, FALSE); //CutActionMoveToObject(85.1, oPCCopy, oSarah, TRUE); // SpeakStrings if (GetGender(oPC) == GENDER_MALE) { CutSpeakString(83.1, oSarah, "Daddy! Daddy!"); } else { CutSpeakString(83.1, oSarah, "Mommy! Mommy!"); } CutSpeakString(85.6, oPCCopy, "Thank God you're alright! What happened? Where did you go?"); CutSpeakString(91.45, oSarah, "Well... I was trying to get the book from the shelf! But it fell! And I fell! And I got a bloody nose!"); CutSpeakString(102.2, oPCCopy, "The bookshelf!?!"); CutSpeakString(103.3, oEricson, "Huh-haah!"); CutSpeakString(105.3, oSarah, "Uh huh! And I got scared of all the blood and you were late, so I went out to look for you!"); CutSpeakString(115.3, oPCCopy, "Oh Sarah!"); CutSpeakString(119.3, oSarah, "And I got lost and couldn't go back and got scareder and scareder!"); CutSpeakString(125.3, oSarah, "But... and this really nice man came and found and rescued me!"); CutSpeakString(133.8, oPCCopy, "Oh Darling! Sarah, don't you dare run out like that again! What would I do if I lost you?"); if (GetGender(oPC) == GENDER_MALE) { CutSpeakString(143.7, oSarah, "I'm Sorry, Daddy!"); } else { CutSpeakString(143.7, oSarah, "I'm Sorry, Mommy!"); } CutSpeakString(147.2, oPCCopy, "Well, it's alright, Sarah. I'm sorry I left you alone, too."); CutSpeakString(155.7, oPCCopy, "Sir, I am truly, dearly sorry. It seems I couldn't have been more wrong! Please! Accept my deepest apologies."); CutSpeakString(167.3, oEricson, "No, no! Not at all! Afterall, I'd probably be dead already if you hadn't helped in those two cases!"); CutSpeakString(179.45, oPCCopy, "Still, I am greatly indebted to you. We must get in touch again."); CutSpeakString(187.45, oPCCopy, "I am sure that, together, we can smash apart this Assassin's Assembly."); CutSpeakString(194.45, oEricson, "Oh, very happily, to be sure! I will try to reach you as soon as I am able."); CutSpeakString(204.45, oPCCopy, "Well then..."); CutSpeakString(206.95, oPCCopy, "Sarah, let's go home!"); // Animations CutPlayAnimation(83.3, oSarah, ANIMATION_FIREFORGET_GREETING, 1.0); CutPlayAnimation(85.3, oPCCopy, ANIMATION_LOOPING_TALK_PLEADING, 3.0); CutPlayAnimation(91.55, oSarah, ANIMATION_LOOPING_TALK_NORMAL, 9.0); CutPlayAnimation(102.3, oPCCopy, ANIMATION_LOOPING_CONJURE2, 1.0); CutPlayAnimation(103.2, oEricson, ANIMATION_LOOPING_TALK_LAUGHING, 0.7); CutPlayAnimation(105.4, oSarah, ANIMATION_LOOPING_TALK_NORMAL, 9.0); CutPlayAnimation(115.4, oPCCopy, ANIMATION_LOOPING_PAUSE_TIRED, 3.75); CutPlayAnimation(119.4, oSarah, ANIMATION_LOOPING_TALK_NORMAL, 14.0); CutPlayAnimation(129.05, oEricson, ANIMATION_FIREFORGET_BOW, 1.0); CutPlayAnimation(133.9, oPCCopy, ANIMATION_LOOPING_TALK_PLEADING, 3.0); CutPlayAnimation(143.8, oSarah, ANIMATION_LOOPING_TALK_PLEADING, 2.0); CutPlayAnimation(147.3, oPCCopy, ANIMATION_LOOPING_TALK_NORMAL, 6.5); CutPlayAnimation(155.8, oPCCopy, ANIMATION_LOOPING_TALK_NORMAL, 9.5); CutPlayAnimation(167.4, oEricson, ANIMATION_FIREFORGET_GREETING, 1.0); CutPlayAnimation(178.95, oPCCopy, ANIMATION_LOOPING_TALK_PLEADING, 2.0); CutPlayAnimation(193.55, oEricson, ANIMATION_LOOPING_LISTEN, 1.5); CutPlayAnimation(200.0, oSarah, ANIMATION_LOOPING_PAUSE, 7.0); // to cancel idle animations CutPlayAnimation(208.95, oSarah, ANIMATION_FIREFORGET_VICTORY1, 1.0); // Other Commands CutRemoveAllEffects(80.5, oSarah); // Immobilize must be removed for Sarah to move properly CutSetMusic(81.0, oPC, 51); CutPlaySound(208.85, oSarah, "vs_nchildf1_vict"); CutFadeToBlack(211.35, oPC); DelayCommand(212.35, EndGame("")); } /* End Part Two */ } void CutSetCameraHeight(float fDelay, object oPC, float fHeight, int iShift = TRUE) { int nCutscene = GetActiveCutsceneNum(); fDelay = CutCalculateCurrentDelay(fDelay, nCutscene); DelayCommand(fDelay, DelayCommand(GetShift(oPC, iShift), CallSetCameraHeight(nCutscene, oPC, fHeight))); } void CallSetCameraHeight(int nCutscene, object oPC, float fHeight) { if(nCutscene == GetLocalInt(oPC, "nCutsceneNumber")) { SetCameraHeight(oPC, fHeight); } } void CutCreateUrchin(float fDelay, object oPC, object oEricson, int iShift = TRUE) { int nCutscene = GetActiveCutsceneNum(); fDelay = CutCalculateCurrentDelay(fDelay, nCutscene); DelayCommand(fDelay, DelayCommand(GetShift(oPC, iShift), CallCreateUrchin(nCutscene, oPC, oEricson))); } // Create Urchin and move to Ericson void CallCreateUrchin(int nCutscene, object oPC, object oEricson) { if(nCutscene == GetLocalInt(oPC, "nCutsceneNumber")) { object oUrchin = CreateObject(OBJECT_TYPE_CREATURE, "StreetUrchin", GetLocation(GetWaypointByTag("wp_cs3_blessington1")), FALSE, "cs3_urchin"); CutSetActiveCutsceneForObject(oUrchin, 4); effect eGhost = EffectCutsceneGhost(); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, oUrchin); CutActionMoveToObject(0.0, oUrchin, oEricson, TRUE); } } // This helper function is needed as the effects to be removed have been created // outside the cutscene funtionality void CutRemoveAllEffects(float fDelay, object oPC, int iShift = TRUE) { int nCutscene = GetActiveCutsceneNum(); fDelay = CutCalculateCurrentDelay(fDelay, nCutscene); DelayCommand(fDelay, DelayCommand(GetShift(oPC, iShift), CallRemoveAllEffects(nCutscene, oPC))); } void CallRemoveAllEffects(int nCutscene, object oPC) { if(nCutscene == GetLocalInt(oPC, "nCutsceneNumber")) { RemoveAllEffects(oPC); } }