//////////////////////////////////////////////////////////////////////////////// // Created By: Jason Glenn // Created On: 7/08/10 //////////////////////////////////////////////////////////////////////////////// //Cutscene script, plays when the player starts the module via a generic trigger placed at the player's spawn. void main() { //Creates character variables by getting the character's tags object oSelphi = GetObjectByTag("JG_Selphi"); object oWren = GetObjectByTag("JG_Wren"); object oTarget = GetObjectByTag("JG_Target"); object oPC = GetFirstPC(); //Creates waypoint variable object oWP_Wren = GetObjectByTag("JG_Wren_WP1"); object oWP_Selphi = GetObjectByTag("JG_Selphi_WP1"); object oWP_Selphi2 = GetObjectByTag("JG_Selphi_WPCut"); object oWP_PC = GetObjectByTag("JG_PC_WP1"); object oWP_Wren2 = GetObjectByTag("JG_Wren_WP2"); //Trap effect effect eFireball = EffectVisualEffect(VFX_FNF_FIREBALL); //Delay variable float fd = 0.0; //The intro sequence. if (GetIsPC(oPC)) { //Disables the hud and starts cinematic mode. SetCutsceneMode(oPC, TRUE); //Sets the camera. DelayCommand ((fd+=0.5), AssignCommand(oPC, SetCameraFacing(10.0f, 10.0f, 50.0f, CAMERA_TRANSITION_TYPE_SNAP))); //Takes away player control. SetCommandable(FALSE,oPC); //The party walks towards the initial waypoints. DelayCommand ((fd+=0.0), AssignCommand(oWren, ActionForceFollowObject(oWP_Wren))); DelayCommand ((fd+=0.1), AssignCommand(oSelphi, ActionForceFollowObject(oWP_Selphi))); DelayCommand ((fd+=0.3), AssignCommand(oPC, ActionForceFollowObject(oWP_PC))); //Stops the NPC's from walking by clearing their actions DelayCommand ((fd+=3.0), AssignCommand(oWren, ClearAllActions())); DelayCommand ((fd+=3.0), AssignCommand(oSelphi, ClearAllActions())); DelayCommand ((fd+=3.0), AssignCommand(oPC, ClearAllActions())); //Plays sound and text for Wren. DelayCommand ((fd+=0.1), AssignCommand(oWren, PlaySound ("vs_faldom_look"))); DelayCommand ((fd+=0.1), AssignCommand(oWren, ActionSpeakString("Wait, hold on!"))); //Reveals trap by using an explosion effect. DelayCommand ((fd+=2.0), AssignCommand(oTarget, ActionSpeakString("*Thud*"))); DelayCommand ((fd+=0.2), AssignCommand(oTarget, ApplyEffectToObject(DURATION_TYPE_INSTANT ,eFireball , oTarget))); //Party talks about the trap. DelayCommand ((fd+=3.0), AssignCommand(oWren, ActionSpeakString("Aha, a trap!"))); DelayCommand ((fd+=3.0), AssignCommand(oSelphi, ActionSpeakString("Can you disable it?"))); DelayCommand ((fd+=5.0), AssignCommand(oWren, ActionSpeakString("Maybe, I will test the mechanism."))); DelayCommand ((fd+=3.0), AssignCommand(oWren, ActionSpeakString("Selphi, lend me a hand."))); DelayCommand ((fd+=2.0), AssignCommand(oSelphi, PlaySound ("vs_favhen2f_good"))); //Selphi moves next to Wren DelayCommand ((fd+=3.0), AssignCommand(oSelphi, ActionForceFollowObject(oWP_Selphi2))); DelayCommand ((fd+=2.0), AssignCommand(oSelphi, ClearAllActions())); //Slephi asks the player to look around DelayCommand ((fd+=2.0), AssignCommand(oSelphi, ActionSpeakString("Maybe you should have a look around while we handle this."))); //Idle animations DelayCommand ((fd+=2.0), AssignCommand(oSelphi, ActionPlayAnimation(ANIMATION_LOOPING_GET_MID, 0.3, 60.0))); DelayCommand ((fd+=0.0), AssignCommand(oWren, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 0.3, 60.0))); //Ends the cutscene DelayCommand ((fd+=2.0), SetCommandable(TRUE, oPC)); DelayCommand ((fd+=2.0), SetCutsceneMode(oPC, FALSE)); DelayCommand ((fd+=3.0), AssignCommand(oPC, ClearAllActions())); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // Created By: Jason Glenn // Created On: 7/10/10 //////////////////////////////////////////////////////////////////////////////// //Sets the trigger to where the cutscene can only be activated once void main() { //Checks to see if the cutscene has started and if it has not than it starts the cutscene if(GetIsPC(GetEnteringObject()) && GetLocalInt(GetObjectByTag("JG_Cutscene_TR1"), "iCutscene_Started") == FALSE) { //marginal delay to make sure the player has loaded first before playing the cutscene DelayCommand(0.1, ExecuteScript("jg_cutscene_1_1", OBJECT_SELF)); //Makes the cutscene only play once by setting the iCutscene_Started Int to true SetLocalInt(GetObjectByTag("JG_Cutscene_TR1"), "iCutscene_Started", TRUE); } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // Created By: Jason Glenn // Created On: 7/14/10 //////////////////////////////////////////////////////////////////////////////// //Puzzle script, this script controls the on and off states for the left lever. void main() { //Creates waypoint variable object oWP1 = GetWaypointByTag("JG_Puzzle_WP1"); //Creates object variables object oTrap1 = GetObjectByTag("JG_Trap_Path1"); object oLever1 = GetObjectByTag("JG_Lever_1"); object oTrapLever1 = GetObjectByTag("JG_Trap_Lever1"); //Creates player variable object oPC = GetFirstPC(); //Creates fire variables object oLight1 = GetObjectByTag("x3_plc_flame001"); object oLight2 = GetObjectByTag("x3_plc_flame002"); object oLight3 = GetObjectByTag("x3_plc_flame003"); object oFlame1 = GetObjectByTag("JG_Puzzle_Flame"); //Creates variables to hold the on and off states of a lever. int nOn1 = GetLocalInt(OBJECT_SELF, "LEVER_BOOL1"); //If the lever turns on this code will execute. if(nOn1 == TRUE) { //Plays the lever animation ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE); //Creates a fire object within the area CreateObject(OBJECT_TYPE_PLACEABLE,"x3_plc_flame001",GetLocation(oWP1), TRUE); //Assigns the fire object a variable object oLight1 = GetObjectByTag("x3_plc_flame001"); //Clears the trap's state so that the SetTrapActive command works properly SetTrapDetectedBy(oTrapLever1, oPC, FALSE); //Sets the trap to active so that the newly created fire object kills the player with fire SetTrapActive(oTrapLever1, TRUE); //Changes the state of the lever so that when the player activates the lever again it turns both the fire and trap objects off SetLocalInt(OBJECT_SELF, "LEVER_BOOL1", FALSE); //Plays burning sound DelayCommand ((0.2),AssignCommand(oLever1, PlaySound ("sim_pulsfire"))); } //If the lever turns off this code will execute. if(nOn1 == FALSE) { //Plays the lever animation PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE); //Sees if there is a fire object created within the area object oLight1 = GetObjectByTag("x3_plc_flame001"); //Destroys the flame object when the lever is off DestroyObject(oLight1); //Clears the trap's state so that the SetTrapActive command works properly SetTrapDetectedBy(oTrapLever1, oPC, FALSE); //Disables the trap SetTrapActive(oTrapLever1, FALSE); //Flame extinguish sound DelayCommand ((0.2),AssignCommand(oLever1, PlaySound ("sim_magsuper"))); //Changes the state of the lever so that when the player activates the lever again it turns both the fire and trap objects on SetLocalInt(OBJECT_SELF, "LEVER_BOOL1", TRUE); } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // Created By: Jason Glenn // Created On: 7/14/10 //////////////////////////////////////////////////////////////////////////////// //Puzzle script, checks to see if all flame objects are absent or present void main() { //Sets trap variables object oTrap1 = GetObjectByTag("JG_Trap_Path1"); object oTrapFinal = GetObjectByTag("JG_Trap_Puzzle_Finished"); //Sets waypoiny variables object oWP4 = GetWaypointByTag("JG_Puzzle_WP4"); object oWP5 = GetWaypointByTag("JG_Puzzle_WP5"); object oWP6 = GetWaypointByTag("JG_Puzzle_WP6"); object oWP7 = GetWaypointByTag("JG_Puzzle_WP7"); object oSelphiWP = GetWaypointByTag("JG_Event_Selphi_1"); object oWrenWP = GetWaypointByTag("JG_Event_Wren_1"); //Assigns variables to the characters object oPC = GetFirstPC(); object oSelphi = GetObjectByTag("JG_Selphi"); object oWren = GetObjectByTag("JG_Wren"); //Creates object variables object oLight1 = GetObjectByTag("x3_plc_flame001"); object oLight2 = GetObjectByTag("x3_plc_flame002"); object oLight3 = GetObjectByTag("x3_plc_flame003"); object oFlame1 = GetObjectByTag("JG_Puzzle_Flame"); object oTrapFlame1 = GetObjectByTag ("Flame_Trap_1"); object oTrapFlame2 = GetObjectByTag ("Flame_Trap_2"); object oTrapFlame3 = GetObjectByTag ("Flame_Trap_3"); object oTrapFlame4 = GetObjectByTag ("Flame_Trap_4"); object oTrapFlame5 = GetObjectByTag ("Flame_Trap_5"); //Checks to see if at least three flame objects are present if(GetIsObjectValid(oLight1) == TRUE) { if((GetIsObjectValid(oLight2) || GetIsObjectValid(oFlame1) == TRUE)) { if(GetIsObjectValid(oLight3) == TRUE) { //Text cue that the puzzle is solved AssignCommand(oPC, ActionSpeakString("*You hear the sounds of clicks and screeches coming from further within the tomb.*")); //Clears the trap's state so that the SetTrapActive command works properly SetTrapDetectedBy(oTrapFinal, oPC, FALSE); //Disables the main trap SetTrapDisabled(oTrap1); //Sets the trap to active so that the newly created fire object kills the player with fire SetTrapActive(oTrapFinal, TRUE); //Lots more fire objects CreateObject(OBJECT_TYPE_PLACEABLE,"x3_plc_flame001",GetLocation(oWP4), TRUE); CreateObject(OBJECT_TYPE_PLACEABLE,"x3_plc_flame001",GetLocation(oWP5), TRUE); CreateObject(OBJECT_TYPE_PLACEABLE,"x3_plc_flame001",GetLocation(oWP6), TRUE); CreateObject(OBJECT_TYPE_PLACEABLE,"x3_plc_flame001",GetLocation(oWP7), TRUE); //Sound cue that the puzzle is solved AssignCommand(oPC, PlaySound ("sim_healdead")); //Stops the NPC's idle animations by clearing their actions AssignCommand(oSelphi, ClearAllActions()); AssignCommand(oWren, ClearAllActions()); //Moves NPCs to next area DelayCommand((0.5),AssignCommand(oSelphi, ActionForceMoveToObject (oSelphiWP))); DelayCommand((0.5),AssignCommand(oWren, ActionForceMoveToObject (oWrenWP))); //Visual cue that the puzzle is solved DestroyObject(oTrapFlame1); DestroyObject(oTrapFlame2); DestroyObject(oTrapFlame3); DestroyObject(oTrapFlame4); DestroyObject(oTrapFlame5); DelayCommand ((5.5), DestroyObject(oFlame1)); } } } //Checks to see if all flame objects are extinguished if(GetIsObjectValid(oLight1) == FALSE) { if((GetIsObjectValid(oLight2) == FALSE) && (GetIsObjectValid(oFlame1) == FALSE)) { if(GetIsObjectValid(oLight3) == FALSE) { //Clears the trap's state so that the SetTrapActive command works properly SetTrapDetectedBy(oTrapFinal, oPC, FALSE); //Disables the last trap so the player can walk within the fire area when all flames are out SetTrapActive(oTrapFinal, FALSE); } } } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // Created By: Jason Glenn // Created On: 7/16/10 /////////////////////////////////////////////////////////////////////////////// //Starts the final event/conversation. void main() { //Creates character variables by getting the character's tags object oSelphi = GetObjectByTag("JG_Selphi"); object oWren = GetObjectByTag("JG_Wren"); object oPC = GetFirstPC(); //Creates waypoint variables object oWPE_Wren = GetObjectByTag("JG_Event_Wren_1"); object oWPE_Selphi = GetObjectByTag("JG_Event_Selphi_1"); //Clears NPC actions AssignCommand(oSelphi, ClearAllActions()); AssignCommand(oWren, ClearAllActions()); //Starts the conversation. ActionStartConversation (oPC, "jg_conversation", FALSE, FALSE); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // Created By: Jason Glenn // Created On: 7/16/10 //////////////////////////////////////////////////////////////////////////////// //Conversation script, plays with the "Stand Back" line. Causes Selphi to cast magic. void main() { //Creates object variables. object oSelphi = GetObjectByTag("JG_Selphi"); object oJewel = GetObjectByTag("JG_Jewel"); //Selphi casts magic at the jewel. DelayCommand((0.2), AssignCommand(oSelphi, ActionCastFakeSpellAtObject(SPELL_BIGBYS_GRASPING_HAND , oJewel))); //Makes the jewel disappears DelayCommand((3.0), DestroyObject (oJewel)); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////