//+-----------------------------------------------------------------------------+ //¦ Author: Lawrence Kerr Date: 11/07/11 ¦ //¦-----------------------------------------------------------------------------¦ //¦ ¦ //¦ FBI5 ¦ //¦ ¦ //¦ The player must break into the chemical lab, un_pinteal the ¦ //¦ chemicals, and fight their way out. ¦ //¦ ¦ //+-----------------------------------------------------------------------------+ //Compile out Title Update changes to header functions. //Must be before includes. //CONST_INT USE_TU_CHANGES 0 // Removed by Kenneth R. CONST_INT NUM_COLUMNS 6//5 CONST_INT NUM_NODES_PER_COLUMN 8//10 CONST_INT NUM_ROWS NUM_NODES_PER_COLUMN - 1 CONST_INT NUM_NODES_PER_ROW NUM_COLUMNS + 1 CONST_INT RECORDING_ID_HELI_LAND 1 CONST_INT FINAL_CHECKPOINT 6 CONST_INT COLDROOM_CHECKPOINT 3 CONST_INT CHECKPOINT_START 0 CONST_INT CHECKPOINT_INTERIOR_START 1 CONST_INT CHECKPOINT_CHEMICALS 2 CONST_INT CHECKPOINT_FLY_HELI 3 CONST_INT MAX_SEC 30 CONST_INT MAX_ARMY 15 const_int total_number_of_security_guards 31 const_int total_number_of_scientists 7 const_int total_number_of_patrol_security_guards 3 const_int total_number_of_monkeys 17 const_int total_numer_of_grill_0_breaks 26 const_int total_number_of_doors 27 const_int MAX_SKIP_MENU_LENGTH 12 const_int total_number_of_security_guards_2 4 const_int total_number_of_pickups 3 const_int total_number_of_madrazzos_guard 2 const_int airport_end_cutscene_time 99950 const_float cut_through_limit 0.95 //1.05 USING "rage_builtins.sch" USING "globals.sch" USING "commands_audio.sch" USING "commands_camera.sch" USING "commands_clock.sch" USING "commands_debug.sch" USING "commands_entity.sch" USING "commands_graphics.sch" USING "commands_hud.sch" USING "commands_misc.sch" USING "commands_object.sch" USING "commands_pad.sch" USING "commands_ped.sch" USING "commands_player.sch" USING "commands_script.sch" USING "commands_streaming.sch" USING "commands_task.sch" USING "commands_vehicle.sch" USING "commands_interiors.sch" using "commands_recording.sch" USING "dialogue_public.sch" USING "flow_public_core_override.sch" USING "model_enums.sch" USING "script_player.sch" USING "selector_public.sch" USING "player_ped_public.sch" //USING "chemical_container_public.sch" USING "biotech_container_public.sch" USING "locates_public.sch" USING "replay_public.sch" USING "script_ped.sch" USING "script_heist.sch" USING "script_blips.sch" USING "mission_stat_public.sch" USING "cutscene_public.sch" USING "lineactivation.sch" using "commands_water.sch" USING "CompletionPercentage_public.sch" using "area_checks.sch" using "shared_hud_displays.sch" using "flow_public_GAME.sch" using "taxi_functions.sch" using "timelapse.sch" using "building_control_public.sch" using "emergency_call.sch" using "spline_cam_edit.sch" using "push_in_public.sch" #IF IS_DEBUG_BUILD USING "script_debug.sch" USING "select_mission_stage.sch" #ENDIF ENUM MISSION_STAGE STAGE_OPENING_CUTSCENE = 0, STAGE_GO_TO_PIPE, STAGE_DIVE_OUT_CUTSCENE, STAGE_SWIM_TO_PIPE, STAGE_PIPE_PREPARE_CUTSCENE, STAGE_CUT_PIPE, STAGE_PIPE_LEAVE_CUTSCENE, STAGE_SWIM_INTO_LAB, stage_get_out_of_water_mocap, STAGE_GET_TO_LIFT, STAGE_LIFT_CUTSCENE, STAGE_FIND_CHEMICALS, stage_chemicals_cutscene, stage_shootout, STAGE_LOAD_FRIDGE, STAGE_GET_FORKLIFT, STAGE_LOAD_FORKLIFT, STAGE_HOTSWAP_TO_CHOPPER, STAGE_LAND_CRATE, stage_collect_crate, stage_collect_crate_mocap, stage_fly_to_airport, stage_airport_mocap, stage_switch_to_trevor, stage_drop_off_patricia, STAGE_HOTSWAP_TO_FORKLIFT, STAGE_LOAD_CONTAINER_INTO_CRATE, STAGE_REVERSE_OUT_CRATE, stage_fuel_gun_fail, stage_underwater_fail, stage_shootout_fail, stage_helicopter_fail, stage_load_stage_selector_assets, stage_helicopter_recording_system ENDENUM ENUM FAILED_REASON FAILED_GENERIC = 0, FAILED_DESTROYED_BOAT, FAILED_DESTROYED_CHEMICALS, FAILED_DESTROYED_FORKLIFT, FAILED_DESTROYED_CHOPPER, FAILED_CREW_MEMBER_DIED, FAILED_CREW_DIED ENDENUM ENUM SECTION_STAGE SECTION_STAGE_SETUP = 0, SECTION_STAGE_RUNNING, SECTION_STAGE_CLEANUP, SECTION_STAGE_SKIP ENDENUM enum security_guard_ai_enum attack_phase_0 = 0, attack_phase_1, get_to_attack_phase_0, get_to_attack_phase_1, get_to_attack_phase_2, get_to_attack_phase_3, switch_to_will_advance, do_nothing endenum security_guard_ai_enum security_guard_ai_system_status[total_number_of_security_guards] enum mocap_or_ai_enum play_synched_scene = 0, use_ai, directly_into_cover_task_given endenum mocap_or_ai_enum steve_decision = play_synched_scene mocap_or_ai_enum dave_decision = play_synched_scene MISSION_STAGE e_mission_stage = STAGE_OPENING_CUTSCENE MISSION_STAGE e_skip_stage SECTION_STAGE e_section_stage = SECTION_STAGE_SETUP STRUCT WELDING_POINT FLOAT x, y ENDSTRUCT STRUCT WELDING_DATA VECTOR v_root_pos VECTOR v_wall_rot WELDING_POINT s_current_offset FLOAT f_sine_root_heading FLOAT f_cos_root_heading FLOAT f_sine_root_tilt FLOAT f_min_offset_x FLOAT f_max_offset_x FLOAT f_min_offset_y FLOAT f_max_offset_y FLOAT f_current_ptfx_rot OBJECT_INDEX obj_cursor ENDSTRUCT STRUCT WELDING_GRID_POINT FLOAT f_x_offset FLOAT f_y_offset FLOAT time BOOL b_has_been_hit ENDSTRUCT struct box_struct float x float y float width float height int r int g int b int a endstruct //STRUCT MISSION_VEHICLE // VEHICLE_INDEX veh // BLIP_INDEX blip // MODEL_NAMES model //ENDSTRUCT // STRUCT MISSION_OBJECT OBJECT_INDEX obj BLIP_INDEX blip MODEL_NAMES model ENDSTRUCT // //STRUCT BUDDY // PED_INDEX ped // BLIP_INDEX blip // STRING str_waypoint_lab // BOOL b_has_stopped // INT i_furthest_checkpoint // INT i_waypoint_timer // INT i_move_start_time_offset // VECTOR v_swim_dest // bool playback_paused //ENDSTRUCT STRUCT FAN_DATA OBJECT_INDEX obj VECTOR v_rot FLOAT f_rot_speed PTFX_ID i_ptfx int soundid ENDSTRUCT struct ped_structure ped_index ped model_names model blip_index blip vector pos vector rot vector run_to_pos float heading int health int accuracy int scene_id bool damaged_by_player bool allow_body_armour bool created bool was_stunned weapon_type weapon text_label name endstruct struct object_struct object_index obj blip_index blip model_names model vector pos vector offset_pos vector offset_pos_2 vector rot vector offset_rot float heading float scale float health string room_name int time bool been_created endstruct struct vehicle_struct vehicle_index veh model_names model blip_index blip vector pos float heading float speed float skip_time int health float engine_health float petrol_tank_health int colour int recording_number bool been_created endstruct struct decal DECAL_ID the_decal_id DECAL_RENDERSETTING_ID decal_texture_id vector pos vector direction vector side float width float height float fAlpha float life float wash_amount blip_index blip bool decal_removed endstruct ped_structure dave ped_structure steve ped_structure patrol_security_guard[total_number_of_patrol_security_guards] ped_structure security_guard[total_number_of_security_guards] ped_structure scientist[total_number_of_scientists] ped_structure monkey[total_number_of_monkeys] ped_structure patricia ped_structure security_guard_2[total_number_of_security_guards_2] ped_structure madrazzos_guard[2] object_struct steves_mask object_struct scuba_mike object_struct scuba_dave object_struct OxyTank_1 object_struct OxyTank_2 object_struct OxyTank_3 object_struct scuba_steve object_struct swag_bag object_struct security_card object_struct fridge object_struct crate object_struct fridge_pallet object_struct flare[4] object_struct chemicals object_struct nerve_agent object_struct nerve_agent_store object_struct clip_board object_struct pencil object_struct elevator_display[3] object_struct crate_door_left object_struct crate_door_right object_struct steve_badge object_struct monkey_sounds_object object_struct container_light vehicle_struct army_truck[3] //vehicle_struct forklift_truck vehicle_struct truck vehicle_struct trailer vehicle_struct trevors_truck vehicle_struct crate_veh vehicle_struct boat vehicle_struct helicopter WELDING_DATA s_welding_data WELDING_GRID_POINT s_welding_columns[NUM_COLUMNS][NUM_NODES_PER_COLUMN] WELDING_GRID_POINT s_welding_rows[NUM_ROWS][NUM_NODES_PER_ROW] MISSION_OBJECT s_grill_parts[2] FAN_DATA s_fans[3] LOCATES_HEADER_DATA locates_data decal blood //box_struct welding_box[2] BOOL b_is_skipping_in_progress = FALSE //BOOL b_allow_scuba_breath = TRUE BOOL b_ropes_created = FALSE BOOL b_ropes_attached = FALSE bool gun_fired = false BOOL bDoNewBlowtorchCam = TRUE bool stop_mission_fail_checks = false bool activate_welding_cam = false bool welding_gun_fuel_fail = false bool helicopter_stabilized = false bool render_underwater_tunnel_on_radar = false bool resume_dave_waypoint = false bool resume_steve_waypoint = false bool patrol_security_0_dropped_weapon = false bool alarm_fail = false bool alarm_time_stored = false bool steve_aiming_task_given[3] bool dave_aiming_task_given[3] bool stop_prcocessing_hover_system = false bool slow_dave_down_for_catch_up = false bool slow_steve_down_for_catch_up = false bool dave_combat_set = false bool steve_combat_set = false bool steve_cover_point_stolen = false bool dave_cover_point_stolen = false bool steve_refresh_task = false bool resume_lower_priority_conversation = false bool scientist_4_dead = false bool scientist_5_dead = false bool apply_steve_blood_decal = false bool allow_player_fired_weapon = true bool increase_pilot_skill = false bool attacked_madrazzos_guard_fail = false bool take_off_scuba_gear = false bool dave_water_spash_triggered = false bool steve_water_spash_triggered = false bool trevor_in_heli_hit_out_0 = false bool trevor_in_heli_transition_0 = false bool started_cutscene_as_michael = false bool boat_first_person_flash_completed = false bool airport_mocap_michael_in_0 = false bool cleanup_airport_cutscene = false INT i_cutscene_event = 0 INT i_desired_weld_route_top = 0 INT i_desired_weld_route_bottom = 0 INT i_desired_weld_route_left = 0 INT i_desired_weld_route_right = 0 INT i_current_break_ptfx INT i_triggered_text_hashes[50] INT sound_underwater_ambience = GET_SOUND_ID() int sound_underwater_rebreather = get_sound_id() INT i_sound_scuba_gear = GET_SOUND_ID() INT i_sound_torch_on = GET_SOUND_ID() INT i_sound_torch_cutting = GET_SOUND_ID() INT i_sound_gas_mask = GET_SOUND_ID() INT i_sound_swishing = GET_SOUND_ID() int lift_sound = get_sound_id() int monkey_sound[2] int crate_sound = get_sound_id() int flare_sound = get_sound_id() int woosh_sound_id = get_sound_id() INT iCurrentEvent = 0 int swim_to_lab_dialogue_status = 0 int get_to_lift_dialogue_status = 0 int steve_ai_system_status = 0 int dave_ai_system_status = 0 int scientist_0_ai_status = 0 int scientist_1_ai_status = 0 int patrol_security_guard_0_system_status = 0 int get_to_lift_master_flow_system_status = 0 int cut_pipe_setup_status = 0 int go_to_pipe_dialogue_status = 0 int chemicals_cutscene_status = 0 int get_chemicals_master_flow_system_status = 0 int original_time int elevator_0_system_status = 0 int elevator_1_system_status = 0 int dave_ai_system_1_status = 0 int steve_ai_system_1_status = 0 int dialogue_system_1_status = 0 int scientist_2_ai_system_status = 0 int scientist_3_ai_system_status = 0 int shootout_master_flow_system_status = 0 int patrol_security_guard_1_ai_system_status = 0 int patrol_security_guard_2_ai_system_status = 0 int scientist_4_ai_system_status = 0 int scientist_5_ai_system_status = 0 int metal_door_system_status = 0 int dialogue_time = 0 int hotswap_to_forklift_status = 0 int helicopter_hover_system_status = 0 int iPlayerMoveProg = 0 int boat_time = 0 int fail_time = 0 int steve_ai_system_2_status = 0 int dave_ai_system_2_status = 0 int dialogue_system_2_status = 0 int collect_crate_dialogue_system_status = 0 int get_to_pipe_running_status = 0 int steve_time int dave_time int open_door_with_security_card_cutscene_status = 0 int players_scene_id = -1 int open_lab_doors_status = 0 int load_fridge_status = 0 int monkey_sounds_system_status = 0 int monkey_time[2] int swim_to_lab_audio_event_system_status = 0 int shootout_audio_event_system_status = 0 int opening_cutscene_status = 0 int welding_dialogue_system_status = 0 int monkey_anim_status[total_number_of_monkeys] int helicopter_time = 0 int security_card_physics_system_status = 0 int alarm_time int pallet_time = 0 int collect_crate_mocap_status = 0 int fly_to_airport_master_flow_system_status = 0 int switch_to_trevor_system_status = 0 int drop_off_patricia_status = 0 int drop_off_patricia_dialogue_system_status = 0 int patrol_security_guard_0_time = 0 int DIVE_OUT_CUTSCENE_master_flow_system_status = 0 int get_to_chemicals_audio_event_system_status = 0 int fbi_5_door[total_number_of_doors] int fly_to_airport_dialogue_system_status = 0 int move_doors_14_and_15_system_status = 0 int dave_dialogue_time = 0 INT i_num_route_nodes_not_hit = 0 int scientist_time[total_number_of_scientists] int lift_cutscene_status = 0 int crate_land_cutscene_status = 0 int airport_mocap_status = 0 int michael_enter_boat_anim_system_status = 0 int dave_enter_boat_anim_system_status = 0 int steve_enter_boat_anim_system_status = 0 int fbi_5_int_tods_system_status = 0 int tods_original_time = 0 int tods_target_time = 0 int shootout_audio_scene_system_status = 0 int franklin_ai_system_status = 0 int get_out_of_water_mocap_status = 0 int steve_flash_light_time = 0 int swim_to_pipe_dialogue_system_status = 0 int dive_time = 0 int dive_into_water_help_text_system_status = 0 int madrazzos_guard_ai_system_status[total_number_of_madrazzos_guard] int patrol_security_guard_0_synchronized_scene_system_status = 0 int buddy_swimming_status[2] int switch_sound_time = 0 int first_person_flash_time = 0 FLOAT f_point_offset_speed = 0.0 FLOAT move_network_scaled_x FLOAT move_network_scaled_y float current_fuel_used = 0.0 FLOAT f_container_offset_x = 0.0 FLOAT f_container_offset_y = 0.0 FLOAT f_container_offset_z = -6.0 VECTOR v_container_offset = <> VECTOR v_cam_point_offset VECTOR v_cam_last_point_offset VECTOR v_pipe_pos_above_water = <<3947.8379, 3862.7820, 0.5207>> VECTOR v_pipe_pos_under_water = <<3833.91113, 3667.39355, -24.9>> VECTOR v_pipe_end_pos = <<3530.0913, 3705.8391, 19.9916>> VECTOR v_drop_crate_loc = <<3629.000, 3766.440, 27.535>> VECTOR v_boat_start_pos = << 3853.4600, 4455.4272, -0.2>> VECTOR v_grill_pos = <<3832.85, 3665.67, -23.0>> VECTOR v_cutting_anims_pos = <<3832.80, 3665.63, -24.14>> VECTOR v_grill_rot = <<0.0, 0.0, 150.0>> vector scene_pos vector scene_rot vector grill_0_ptfx_offset[total_numer_of_grill_0_breaks] vector security_card_target_pos vector security_card_target_rot //welding cameras //top left vector camera_a_pos = <<3835.930420,3668.514404,-22.056992>> //-22.156992 vector camera_a_rot = <<-6.091456,-6.360575,137.074509>> //top right vector camera_b_pos = <<3833.9595, 3669.7546, -22.2303>> //-22.5303 vector camera_b_rot = <<-1.2780, -6.6450, 160.2272>> //bottom left vector camera_c_pos = <<3835.9360, 3668.6597, -23.0126>> vector camera_c_rot = <<-6.0978, -6.3602, 140.4624>> //bottom right vector camera_d_pos = <<3834.2556, 3669.6697, -23.4697>> vector camera_d_rot = <<-1.2780, -6.6450, 160.2272>> vector helicopter_pos vector helicopter_target_pos STRING str_waypoint_swim = "chem_heist2_swim" string mission_failed_text vehicle_index players_last_vehicle PTFX_ID i_weld_ptfx ptfx_id i_bubble_ptfx PTFX_ID i_singe_ptfx PTFX_ID i_break_ptfx[40] PTFX_ID fxBubbles PTFX_ID idle_blue_flame_ptfx ptfx_id flare_ptfx[4] ptfx_id grill_0_ptfx[total_numer_of_grill_0_breaks] ptfx_id fridge_ptfx CAMERA_INDEX cam_cutscene CAMERA_INDEX cam_interp camera_index welding_cam camera_index camera_a camera_index camera_b //camera_index camera_c BLIP_INDEX blip_current_destination BLIP_INDEX blip_truck BLIP_INDEX lift_blip BLIP_INDEX blipLoadingBay blip_index outside_lift_blip blip_index cover_blip blip_index security_card_reader_blip ped_index temp_scientist OBJECT_INDEX obj_loading_boxes[5] OBJECT_INDEX obj_welding_tool object_index dave_weapon_obj object_index steve_weapon_obj object_index dave_lift_cutscene_weapon MODEL_NAMES model_trevor = GET_PLAYER_PED_MODEL(CHAR_TREVOR) MODEL_NAMES model_michael = GET_PLAYER_PED_MODEL(CHAR_MICHAEL) MODEL_NAMES model_welding_tool = PROP_CS_GASCUTTER_1 COVERPOINT_INDEX cover_point[38] GROUP_INDEX group_player_and_buddies ROPE_INDEX rope_chopper[4] vector rope_pos[4] INTERIOR_INSTANCE_INDEX interior_lab sequence_index seq text_label_23 dialogue_root text_label_23 specific_label //timelkapse variables structTimelapse sTimelapse SELECTOR_PED_STRUCT selector_ped SELECTOR_CAM_STRUCT selector_cam structPedsForConversation scripted_speech pickup_index fbi1_pickup[total_number_of_pickups] PUSH_IN_DATA push_in_camera //variables not to be initialised bool replay_active = false //*****************************************CUSTOM SWITCH CAM VARIABLES AND FUNCTIONS******************************************************* ENUM FIB5_SWITCH_CAM_STATE SWITCH_CAM_IDLE, SWITCH_CAM_REQUEST_ASSETS, SWITCH_CAM_SETUP_SPLINE_1, SWITCH_CAM_PLAYING_SPLINE_1, SWITCH_CAM_SHUTDOWN_SPLINE_1, SWITCH_CAM_CODE_CAM, SWITCH_CAM_SETUP_SPLINE_2, SWITCH_CAM_PLAYING_SPLINE_2, SWITCH_CAM_SHUTDOWN_SPLINE_2, SWITCH_CAM_RETURN_TO_GAMEPLAY ENDENUM FIB5_SWITCH_CAM_STATE eSwitchCamState = SWITCH_CAM_IDLE SWITCH_CAM_STRUCT scsSwitchCamToTrevorInHeli SWITCH_CAM_STRUCT scsSwitchCamMikeToTrevPatricia_Intro SWITCH_CAM_STRUCT scsSwitchCamMikeToTrevPatricia_Outro PED_INDEX MichaelPed OBJECT_INDEX oiMichaelSwitchCamLightRig #IF IS_DEBUG_BUILD //BOOL bSwitchCamDebugScenarioEnabled = TRUE //BOOL bResetDebugScenario = FALSE BOOL bDEBUG_WarpToMikeToTrevAndPatSwitch #ENDIF //FLOAT fSRLTime BOOL bPlayerControlGiven FLOAT fGameplayCamHeadingToTrevorInHeli = 0.0 FLOAT fGameplayCamPitchToTrevorInHeli = 0.0 float fMichaelToTrevor_EndSyncScenePhase = 0.82 float fMichaelToTrevor_StartDialogue = 0.733 BOOL bMikeToTrevor_MikeLinePlayed FLOAT fMikeToTrevor_MikeLineStartPhase = 0.02 BOOL bMikeToTrevor_TrevorLinePlayed FLOAT fMikeToTrevor_TrevorLineStartPhase = 0.32 FLOAT fMichealToTrevor_HeliRecStartTime_P1 = 7000 FLOAT fMikeToTrevHeli_StreamVolDist = 2500 VECTOR vMikeToTrevHeli_StreamVolPos = <<3144.0, 3535.7, 136.0>> VECTOR vMikeToTrevHeli_StreamVolDir = <<-1.8, -2.6, -0.04 >> FLOAT fMikeToTrevHeli_LOD_Level = 1.0 INT iSwitchCamMikeToTrev_WarpHeliNodeOffset = 3 STREAMVOL_ID sid_MichaelToTrevHeli_LowLODFrustrum BOOL bMichaelToTrevor_Rec_P2_Started VECTOR vMichaelToTrevor_MikeStartPos = <<3638.2, 3769.3, 28.5>> FLOAT fMichaelToTrevor_MikeStarHeading = 65.0 VECTOR vMichaelToTrevor_HeliTeleportPos = <<3133, 3531, 140>> VECTOR vMichaelToTrevor_HeliEndDestination = <<3615.000, 3791, 250>> FLOAT fMichaelToTrevor_HeliEndSpeed = 10.0 BOOL bSwitchCam_ControlReturnedEarly FLOAT fGameplayCamHeadingMikeToTrevAndPat = 0.0 FLOAT fGameplayCamPitchMikeToTrevAndPat = 0.0 INT iMikeToTrevAndPat_DialogueStartTime = 1400 BOOL bMikeToTrevAndPat_MusicStarted FLOAT fMikeToTrevAndPat_MusicStartPhase = 0.1 BOOL bMikeToTrevAndPat_TrevorsTruckInitialSetup BOOL bMikeToTrevAndPat_StartedCodeCamRecording BOOL bMikeToTrevAndPat_OpeningFlashPlayed //*******************************************WIDGETS********************************************************* #IF IS_DEBUG_BUILD MissionStageMenuTextStruct menu_stage_selector[MAX_SKIP_MENU_LENGTH] int menu_return_stage int launch_mission_stage_menu_status bool widget_reset_cutscene = false bool widget_create_object = false bool widget_vehicle_camera_active = false bool widget_reset_recording = false //bool widget_crate_detached = false bool widget_activate_ptfx = false int widget_blip_alpha int widget_main_mission_flow_status float widget_temp_width float widget_temp_height float widget_temp_depth float widget_angled_length float widget_heading float widget_fov = 45.00 float widget_blip_scale vector widget_offset_bl vector widget_offset_br vector widget_bl vector widget_br vector widget_object_pos vector widget_object_rot vector widget_object_pos_2 vector widget_object_rot_2 vector widget_cam_attach_offset vector widget_cam_point_offset vector widget_blip_pos vector player_root_bone_pos vector widget_ptfx_pos vector widget_ptfx_rot vector widget_card_pos vector widget_card_rot camera_index widget_camera ptfx_id widget_ptfx proc locate_widget() vector widget_player_pos widget_player_pos = GET_ENTITY_COORDS(player_ped_id()) IS_ENTITY_AT_COORD(player_ped_id(), widget_player_pos, <>, false, true) endproc proc angled_area_locate_widget() widget_bl = get_offset_from_entity_in_world_coords(player_ped_id(), widget_offset_bl) widget_br = get_offset_from_entity_in_world_coords(player_ped_id(), widget_offset_br) IS_ENTITY_IN_ANGLED_AREA(player_ped_id(), widget_bl, widget_br, widget_angled_length, false) if widget_offset_br.z > 0.0 SET_ENTITY_HEADING(player_ped_id(), widget_heading) endif endproc proc angled_area_locate_widget_entity(entity_index mission_entity) if does_entity_exist(mission_entity) widget_bl = get_offset_from_entity_in_world_coords(mission_entity, widget_offset_bl) widget_br = get_offset_from_entity_in_world_coords(mission_entity, widget_offset_br) IS_ENTITY_IN_ANGLED_AREA(mission_entity, widget_bl, widget_br, widget_angled_length, false, TRUE) // if widget_offset_br.z > 0.0 // SET_ENTITY_HEADING(player_ped_id(), widget_heading) // endif endif endproc proc attach_object_to_ped_and_move(ped_index the_ped, object_index &mission_obj) if DOES_ENTITY_EXIST(the_ped) if not is_ped_injured(the_ped) if DOES_ENTITY_EXIST(mission_obj) ATTACH_ENTITY_TO_ENTITY(mission_obj, the_ped, get_ped_bone_index(the_ped, BONETAG_R_CLAVICLE), widget_object_pos, widget_object_rot)//BONETAG_SPINE3 BONETAG_R_CLAVICLE endif endif endif endproc proc create_and_move_object(object_index &mission_obj) if DOES_ENTITY_EXIST(mission_obj) SET_ENTITY_COORDS_NO_OFFSET(mission_obj, widget_object_pos) SET_ENTITY_ROTATION(mission_obj, widget_object_rot) endif endproc proc create_and_move_object_2(object_index &mission_obj) if DOES_ENTITY_EXIST(mission_obj) SET_ENTITY_COORDS_NO_OFFSET(mission_obj, widget_object_pos_2) SET_ENTITY_ROTATION(mission_obj, widget_object_rot_2) endif endproc //vehicle_index proc attach_object_to_object_and_move(vehicle_index &parent_object, object_index &mission_obj) if DOES_ENTITY_EXIST(parent_object) if DOES_ENTITY_EXIST(mission_obj) ATTACH_ENTITY_TO_ENTITY(mission_obj, parent_object, -1, widget_object_pos_2, widget_object_rot_2) endif endif endproc proc camera_attached_to_vehicle_widget(vehicle_index &mission_veh) if widget_vehicle_camera_active if not does_cam_exist(widget_camera) widget_camera = create_cam("default_scripted_camera", false) ATTACH_CAM_TO_ENTITY(widget_camera, mission_veh, widget_cam_attach_offset) POINT_CAM_AT_ENTITY(widget_camera, mission_veh, widget_cam_point_offset) set_cam_active(widget_camera, true) render_script_cams(true, false) else ATTACH_CAM_TO_ENTITY(widget_camera, mission_veh, widget_cam_attach_offset) POINT_CAM_AT_ENTITY(widget_camera, mission_veh, widget_cam_point_offset) set_cam_fov(widget_camera, widget_fov) endif endif endproc proc draw_offset_marker_on_entity(entity_index mission_entity) if DOES_ENTITY_EXIST(mission_entity) if not is_entity_dead(mission_entity) DRAW_MARKER(MARKER_CYLINDER, get_offset_from_entity_in_world_coords(mission_entity, widget_object_pos), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>, <<0.1, 0.1, 0.1>>, 255, 0, 128, 178) endif endif endproc proc pfx_widget() if widget_activate_ptfx if does_particle_fx_looped_exist(widget_ptfx) STOP_PARTICLE_FX_LOOPED(widget_ptfx) endif //START_PARTICLE_FX_NON_LOOPED_AT_COORD("scr_fbi5_dry_ice", widget_ptfx_pos, widget_ptfx_rot) widget_ptfx = START_PARTICLE_FX_LOOPED_AT_COORD("scr_fbi5_dry_ice", widget_ptfx_pos, widget_ptfx_rot) widget_activate_ptfx = false endif endproc #endif //**************************************************WIDGETS************************************************** #IF IS_DEBUG_BUILD /// PURPOSE: /// Create the debug widgets for working with the scripted character switch cam. PROC CREATE_SWITCH_CAM_SCRIPT_SPECIFIC_WIDGETS() CDEBUG3LN(DEBUG_MISSION, "CREATE_SWITCH_CAM_SCRIPT_SPECIFIC_WIDGETS") SET_CURRENT_WIDGET_GROUP(scsSwitchCamToTrevorInHeli.wgidParent) START_WIDGET_GROUP("Custom Switch Cameras - Extra Tunables") START_WIDGET_GROUP("Michael To Trevor Heli") START_WIDGET_GROUP("Sync Scene Tuner") ADD_WIDGET_FLOAT_SLIDER("End Container Load Sync Scene", fMichaelToTrevor_EndSyncScenePhase, 0.0, 1.0, 0.1) ADD_WIDGET_FLOAT_SLIDER("Mike Container Cutscene Dialogue Phase", fMichaelToTrevor_StartDialogue, 0.0, 1.0, 0.05) ADD_WIDGET_FLOAT_SLIDER("Mike Switch Dialogue Phase", fMikeToTrevor_MikeLineStartPhase, 0.0, 1.0, 0.05) ADD_WIDGET_FLOAT_SLIDER("Trevor Switch Dialogue Phase", fMikeToTrevor_TrevorLineStartPhase, 0.0, 1.0, 0.05) ADD_WIDGET_FLOAT_SLIDER("Mike Start Heading", fMichaelToTrevor_MikeStarHeading, -180.0, 180.0, 1.0) ADD_WIDGET_VECTOR_SLIDER("Mike Start Position", vMichaelToTrevor_MikeStartPos, 0, 3800, 1.0) STOP_WIDGET_GROUP() START_WIDGET_GROUP("Stream Vol Tuner") ADD_WIDGET_FLOAT_SLIDER("Stream Vol Dist.", fMikeToTrevHeli_StreamVolDist, 0.0, 5000, 100.0) ADD_WIDGET_VECTOR_SLIDER("Stream Vol Loc", vMikeToTrevHeli_StreamVolPos, -10000, 10000, 100.0) ADD_WIDGET_VECTOR_SLIDER("Stream Vol Dir", vMikeToTrevHeli_StreamVolDir, -360, 360, 10.0) ADD_WIDGET_FLOAT_SLIDER("LOD level", fMikeToTrevHeli_LOD_Level, -1.0, 1.0, 0.1) STOP_WIDGET_GROUP() START_WIDGET_GROUP("Trevor Heli Gameplay Cam Tuner") ADD_WIDGET_FLOAT_SLIDER("Gameplay Cam Heading Trevor Heli", fGameplayCamHeadingToTrevorInHeli, -180.0, 180.0, 0.25) ADD_WIDGET_FLOAT_SLIDER("Gameplay Cam Pitch Trevor Heli", fGameplayCamPitchToTrevorInHeli, -180.0, 180.0, 0.25) STOP_WIDGET_GROUP() START_WIDGET_GROUP("Helicopter Tuner") ADD_WIDGET_FLOAT_SLIDER("Heli Recording Start Time", fMichealToTrevor_HeliRecStartTime_P1, 0, 200000, 500) ADD_WIDGET_VECTOR_SLIDER("Heli Teleport Position", vMichaelToTrevor_HeliTeleportPos, -10000, 10000, 10.0) ADD_WIDGET_FLOAT_SLIDER("Heli End Speed", fMichaelToTrevor_HeliEndSpeed, 0.0, 500.0, 10.0) ADD_WIDGET_VECTOR_SLIDER("Heli End AI Task Destination", vMichaelToTrevor_HeliEndDestination, -10000, 10000, 10.0) ADD_WIDGET_INT_SLIDER("Teleport Heli Node", iSwitchCamMikeToTrev_WarpHeliNodeOffset, 0, 10, 1) STOP_WIDGET_GROUP() STOP_WIDGET_GROUP() START_WIDGET_GROUP("Michael To Trevor and Patricia") ADD_WIDGET_BOOL("Warp To Switch", bDEBUG_WarpToMikeToTrevAndPatSwitch) ADD_WIDGET_INT_SLIDER("Dialogue Start Time", iMikeToTrevAndPat_DialogueStartTime, 0, 10000, 500) ADD_WIDGET_FLOAT_SLIDER("Music Start Phase", fMikeToTrevAndPat_MusicStartPhase, 0.0, 1.0, 0.1) STOP_WIDGET_GROUP() STOP_WIDGET_GROUP() ENDPROC #ENDIF #IF IS_DEBUG_BUILD WIDGET_GROUP_ID widget_debug FLOAT f_debug_fan_speed = 0.0 BOOL b_debug_start_recording = FALSE BOOL b_debug_alternate_weld = FALSE BOOL b_override_fans = FALSE bool widget_do_not_freeze_forklift = false PROC CREATE_WIDGETS() widget_debug = START_WIDGET_GROUP("Chemical Heist 2") ADD_WIDGET_BOOL("Enable alternate welding test", b_debug_alternate_weld) START_WIDGET_GROUP("Recordings") ADD_WIDGET_BOOL("Start recording", b_debug_start_recording) STOP_WIDGET_GROUP() START_WIDGET_GROUP("Underwater Fans") ADD_WIDGET_BOOL("Override fans", b_override_fans) ADD_WIDGET_FLOAT_SLIDER("Fan speed", f_debug_fan_speed, 0.0, 1.0, 0.001) STOP_WIDGET_GROUP() start_widget_group("locate widget") add_widget_float_slider("width", widget_temp_width, -3000.0, 3000.0, 0.1) add_widget_float_slider("depth", widget_temp_depth, -3000.0, 3000.0, 0.1) add_widget_float_slider("height", widget_temp_height, -3000.0, 3000.0, 0.1) stop_widget_group() start_widget_group("angled_area") add_widget_float_slider("left offset x", widget_offset_bl.x, -2000.0, 2000.0, 0.1) add_widget_float_slider("left offset y", widget_offset_bl.y, -2000.0, 2000.0, 0.1) add_widget_float_slider("left offset z", widget_offset_bl.z, -2000.0, 2000.0, 0.1) add_widget_float_slider("right offset x", widget_offset_br.x, -2000.0, 2000.0, 0.1) add_widget_float_slider("right offset y", widget_offset_br.y, -2000.0, 2000.0, 0.1) add_widget_float_slider("right offset z", widget_offset_br.z, -2000.0, 2000.0, 0.1) add_widget_float_slider("angled area length", widget_angled_length, -2000.0, 2000.0, 0.1) add_widget_float_slider("heading", widget_heading, -2000.0, 2000.0, 0.1) add_widget_float_read_only("widget_bl x", widget_bl.x) add_widget_float_read_only("widget_bl y", widget_bl.y) add_widget_float_read_only("widget_bl z", widget_bl.z) add_widget_float_read_only("widget_br x", widget_br.x) add_widget_float_read_only("widget_br y", widget_br.y) add_widget_float_read_only("widget_br z", widget_br.z) stop_widget_group() start_widget_group("object attach to ped widget") add_widget_float_slider("pos offset x", widget_object_pos.x, -3000.0, 3000.0, 0.01) add_widget_float_slider("pos offset y", widget_object_pos.y, -3000.0, 3000.0, 0.01) add_widget_float_slider("pos offset z", widget_object_pos.z, -3000.0, 3000.0, 0.01) add_widget_float_slider("rot offset x", widget_object_rot.x, -3000.0, 3000.0, 0.01) add_widget_float_slider("rot offset y", widget_object_rot.y, -3000.0, 3000.0, 0.01) add_widget_float_slider("rot offset z", widget_object_rot.z, -3000.0, 3000.0, 0.01) stop_widget_group() start_widget_group("reset cutscene widget") add_widget_bool("reset cutscene", widget_reset_cutscene) stop_widget_group() start_widget_group("object pos and rot widget") add_widget_float_slider("pos x", widget_object_pos.x, -4000.0, 4000.0, 0.01) add_widget_float_slider("pos y", widget_object_pos.y, -4000.0, 4000.0, 0.01) add_widget_float_slider("pos z", widget_object_pos.z, -4000.0, 4000.0, 0.01) add_widget_float_slider("rot x", widget_object_rot.x, -4000.0, 4000.0, 0.01) add_widget_float_slider("rot y", widget_object_rot.y, -4000.0, 4000.0, 0.01) add_widget_float_slider("rot z", widget_object_rot.z, -4000.0, 4000.0, 0.01) stop_widget_group() start_widget_group("object pos and rot widget 2") add_widget_float_slider("pos x", widget_object_pos_2.x, -3000.0, 3000.0, 0.01) add_widget_float_slider("pos y", widget_object_pos_2.y, -3000.0, 3000.0, 0.01) add_widget_float_slider("pos z", widget_object_pos_2.z, -3000.0, 3000.0, 0.01) add_widget_float_slider("rot x", widget_object_rot_2.x, -3000.0, 3000.0, 0.01) add_widget_float_slider("rot y", widget_object_rot_2.y, -3000.0, 3000.0, 0.01) add_widget_float_slider("rot z", widget_object_rot_2.z, -3000.0, 3000.0, 0.01) stop_widget_group() start_widget_group("attach object to object pos and rot widget") add_widget_float_slider("pos x", widget_object_pos_2.x, -3000.0, 3000.0, 0.01) add_widget_float_slider("pos y", widget_object_pos_2.y, -3000.0, 3000.0, 0.01) add_widget_float_slider("pos z", widget_object_pos_2.z, -3000.0, 3000.0, 0.01) add_widget_float_slider("rot x", widget_object_rot_2.x, -3000.0, 3000.0, 0.01) add_widget_float_slider("rot y", widget_object_rot_2.y, -3000.0, 3000.0, 0.01) add_widget_float_slider("rot z", widget_object_rot_2.z, -3000.0, 3000.0, 0.01) stop_widget_group() start_widget_group("create and move PICKUP inside interior") ADD_WIDGET_bool("create_object", widget_create_object) ADD_WIDGET_FLOAT_SLIDER("object pos x", widget_object_pos.x, -3000.0, 3000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("object pos y", widget_object_pos.y, -3000.0, 3000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("object pos z", widget_object_pos.z, -3000.0, 3000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("object rotation x", widget_object_rot.x, 0.0, 360.0, 0.1) ADD_WIDGET_FLOAT_SLIDER("object rotation y", widget_object_rot.y, 0.0, 360.0, 0.1) ADD_WIDGET_FLOAT_SLIDER("object rotation z", widget_object_rot.z, 0.0, 360.0, 0.1) stop_widget_group() start_widget_group("camaera attached to vehicle widget") add_widget_bool("create camera", widget_vehicle_camera_active) ADD_WIDGET_FLOAT_SLIDER("pos x", widget_cam_attach_offset.x, -3000.0, 3000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("pos y", widget_cam_attach_offset.y, -3000.0, 3000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("pos z", widget_cam_attach_offset.z, -3000.0, 3000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("point offset x", widget_cam_point_offset.x, -3000.0, 3000.0, 0.1) ADD_WIDGET_FLOAT_SLIDER("point offset y", widget_cam_point_offset.y, -3000.0, 3000.0, 0.1) ADD_WIDGET_FLOAT_SLIDER("point offset z", widget_cam_point_offset.z, -3000.0, 3000.0, 0.1) ADD_WIDGET_FLOAT_SLIDER("FOV", widget_fov, -3000.0, 3000.0, 0.1) stop_widget_group() start_widget_group("blip position, scale and alpha widget") ADD_WIDGET_FLOAT_SLIDER("pos x", widget_blip_pos.x, -4000.0, 4000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("pos y", widget_blip_pos.y, -4000.0, 4000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("pos z", widget_blip_pos.z, -4000.0, 4000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("scale", widget_blip_scale, -1.0, 40.0, 0.01) ADD_WIDGET_int_SLIDER("alpha", widget_blip_alpha, -1, 400, 1) stop_widget_group() start_widget_group("ptfx offset from attached welding gun") ADD_WIDGET_FLOAT_SLIDER("pos x", widget_object_pos.x, -4000.0, 4000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("pos y", widget_object_pos.y, -4000.0, 4000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("pos z", widget_object_pos.z, -4000.0, 4000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("pos x", widget_object_rot.x, -4000.0, 4000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("pos y", widget_object_rot.y, -4000.0, 4000.0, 0.01) ADD_WIDGET_FLOAT_SLIDER("pos z", widget_object_rot.z, -4000.0, 4000.0, 0.01) stop_widget_group() start_widget_group("welding gun DATA") add_widget_float_read_only("Move network X", move_network_scaled_x) add_widget_float_read_only("Move network Y", move_network_scaled_y) ADD_WIDGET_vector_SLIDER("PLAYER SKELETON POS", player_root_bone_pos, -4000.0, 4000.0, 0.01) stop_widget_group() start_widget_group("widget_do_not_freeze_forklift") add_widget_bool("click to not freeze forklift", widget_do_not_freeze_forklift) stop_widget_group() start_widget_group("buddies AI status") ADD_WIDGET_INT_READ_ONLY("dave_ai_system_status", dave_ai_system_status) ADD_WIDGET_INT_READ_ONLY("dave_ai_system_1_status", dave_ai_system_1_status) ADD_WIDGET_INT_READ_ONLY("dave_ai_system_2_status", dave_ai_system_2_status) ADD_WIDGET_INT_READ_ONLY("steve_ai_system_status", steve_ai_system_status) ADD_WIDGET_INT_READ_ONLY("steve_ai_system_1_status", steve_ai_system_1_status) ADD_WIDGET_INT_READ_ONLY("steve_ai_system_2_status", steve_ai_system_2_status) stop_widget_group() start_widget_group("Status widgets") ADD_WIDGET_INT_READ_ONLY("swim_to_lab_dialogue_status", swim_to_lab_dialogue_status) ADD_WIDGET_INT_READ_ONLY("scientist_0_ai_status", scientist_0_ai_status) ADD_WIDGET_INT_READ_ONLY("scientist_1_ai_status", scientist_1_ai_status) ADD_WIDGET_INT_READ_ONLY("scientist_2_ai_system_status", scientist_2_ai_system_status) ADD_WIDGET_INT_READ_ONLY("scientist_3_ai_system_status", scientist_3_ai_system_status) ADD_WIDGET_INT_READ_ONLY("scientist_4_ai_system_status", scientist_4_ai_system_status) ADD_WIDGET_INT_READ_ONLY("scientist_5_ai_system_status", scientist_5_ai_system_status) ADD_WIDGET_INT_READ_ONLY("widget_main_mission_flow_status", widget_main_mission_flow_status) stop_widget_group() start_widget_group("draw_offset_marker_on_entity") add_widget_float_slider("vehicle offset pos", widget_object_pos.x, -2000.0, 2000.0, 0.1) add_widget_float_slider("vehicle offset pos", widget_object_pos.y, -2000.0, 2000.0, 0.1) add_widget_float_slider("vehicle offset pos", widget_object_pos.z, -2000.0, 2000.0, 0.1) stop_widget_group() start_widget_group("reset recording widget") add_widget_bool("reset recording", widget_reset_recording) stop_widget_group() start_WIDGET_GROUP("activate ptfx") add_widget_bool("toggle ptfx", widget_activate_ptfx) add_widget_float_slider("widget_ptfx_pos x", widget_ptfx_pos.x, -4000.0, 4000.0, 0.1) add_widget_float_slider("widget_ptfx_pos y", widget_ptfx_pos.y, -4000.0, 4000.0, 0.1) add_widget_float_slider("widget_ptfx_pos z", widget_ptfx_pos.z, -4000.0, 4000.0, 0.1) add_widget_float_slider("widget_ptfx_rot x", widget_ptfx_rot.x, -4000.0, 4000.0, 0.1) add_widget_float_slider("widget_ptfx_rot y", widget_ptfx_rot.y, -4000.0, 4000.0, 0.1) add_widget_float_slider("widget_ptfx_rot z", widget_ptfx_rot.z, -4000.0, 4000.0, 0.1) stop_widget_group() start_widget_group("security card widgets") ADD_WIDGET_float_READ_ONLY("pos x", widget_card_pos.x) ADD_WIDGET_float_READ_ONLY("pos y", widget_card_pos.y) ADD_WIDGET_float_READ_ONLY("pos z", widget_card_pos.z) ADD_WIDGET_float_READ_ONLY("rot x", widget_card_rot.x) ADD_WIDGET_float_READ_ONLY("rot y", widget_card_rot.y) ADD_WIDGET_float_READ_ONLY("rot z", widget_card_rot.z) stop_widget_group() // start_widget_group("welding box 0") // add_widget_float_slider("pos x", welding_box[0].x, 0.0, 3000.0, 0.01) // add_widget_float_slider("pos y", welding_box[0].y, 0.0, 3000.0, 0.01) // add_widget_float_slider("width", welding_box[0].width, 0.0, 3000.0, 0.01) // add_widget_float_slider("height", welding_box[0].height, 0.0, 3000.0, 0.01) // // add_widget_int_slider("r", welding_box[0].r, 0, 255, 1) // add_widget_int_slider("g", welding_box[0].g, 0, 255, 1) // add_widget_int_slider("b", welding_box[0].b, 0, 255, 1) // add_widget_int_slider("a", welding_box[0].a, 0, 255, 1) // // stop_widget_group() // // start_widget_group("welding box 1") // add_widget_float_slider("pos x", welding_box[1].x, 0.0, 3000.0, 0.01) // add_widget_float_slider("pos y", welding_box[1].y, 0.0, 3000.0, 0.01) // add_widget_float_slider("width", welding_box[1].width, 0.0, 3000.0, 0.01) // add_widget_float_slider("height", welding_box[1].height, 0.0, 3000.0, 0.01) // // add_widget_int_slider("r", welding_box[1].r, 0, 255, 1) // add_widget_int_slider("g", welding_box[1].g, 0, 255, 1) // add_widget_int_slider("b", welding_box[1].b, 0, 255, 1) // add_widget_int_slider("a", welding_box[1].a, 0, 255, 1) // // stop_widget_group() // CREATE_SPLINE_CAM_WIDGETS(scsSwitchCamMikeToTrevPatricia_Intro, "Mike", "", widget_debug) // CREATE_SPLINE_CAM_WIDGETS(scsSwitchCamMikeToTrevPatricia_Outro, "Trev and Pat", "", widget_debug) // CREATE_SPLINE_CAM_WIDGETS(scsSwitchCamToTrevorInHeli, "Mike", "Trev", widget_debug) // CREATE_SWITCH_CAM_SCRIPT_SPECIFIC_WIDGETS() STOP_WIDGET_GROUP() ENDPROC PROC DESTROY_WIDGETS() IF DOES_WIDGET_GROUP_EXIST(widget_debug) DELETE_WIDGET_GROUP(widget_debug) ENDIF ENDPROC PROC GIVE_NAME_TO_PED(PED_INDEX ped, INT index, STRING sName) TEXT_LABEL t1 IF NOT IS_ENTITY_DEAD(ped) t1 = "" t1 += sName t1+= " " t1 += index SET_PED_NAME_DEBUG(ped, t1) ENDIF ENDPROC #ENDIF ///*****************************************LAWRENCE FUNCTIONS**************************************************** //*****************************************PUBLIC FUNCTIONS****************************************************** proc disable_dispatch_services() enable_dispatch_service(dt_fire_department, false) enable_dispatch_service(dt_police_automobile, false) enable_dispatch_service(dt_police_helicopter, false) enable_dispatch_service(dt_ambulance_department, false) endproc proc enable_dispatch_services() enable_dispatch_service(dt_fire_department, true) enable_dispatch_service(dt_police_automobile, true) enable_dispatch_service(dt_police_helicopter, true) enable_dispatch_service(dt_ambulance_department, true) endproc func bool start_new_cutscene_no_fade(bool clear_players_tasks = true, bool hide_weapon_for_cutscene = true, bool kill_conversation_line_immediately = true, bool ignore_can_player_start_cutscene = false) if can_player_start_cutscene() or ignore_can_player_start_cutscene SPECIAL_ABILITY_DEACTIVATE(player_id()) SET_SCRIPTS_SAFE_FOR_CUTSCENE(true) clear_help() clear_prints() if kill_conversation_line_immediately KILL_FACE_TO_FACE_CONVERSATION_DO_NOT_FINISH_LAST_LINE() else kill_any_conversation() endif display_hud(false) display_radar(false) set_widescreen_borders(true, 500) if clear_players_tasks set_player_control(player_id(), false, spc_clear_tasks) else set_player_control(player_id(), false) endif if hide_weapon_for_cutscene hide_ped_weapon_for_scripted_cutscene(player_ped_id(), true) else hide_ped_weapon_for_scripted_cutscene(player_ped_id(), false) endif disable_dispatch_services() return true endif return false endfunc proc end_cutscene(bool clear_tasks = true, float interp_heading = 0.0, float interp_pitch = 0.0, bool enable_emergency_services = true, int fade_time = DEFAULT_FADE_TIME) SET_SCRIPTS_SAFE_FOR_CUTSCENE(false) clear_prints() clear_help() KILL_FACE_TO_FACE_CONVERSATION_DO_NOT_FINISH_LAST_LINE() display_hud(true) display_radar(true) set_widescreen_borders(false, 500) if is_player_playing(player_id()) render_script_cams(false, false) set_gameplay_cam_relative_heading(interp_heading) set_gameplay_cam_relative_pitch(interp_pitch) if clear_tasks clear_ped_tasks(player_ped_id()) endif set_player_control(player_id(), true) hide_ped_weapon_for_scripted_cutscene(player_ped_id(), false) endif if enable_emergency_services enable_dispatch_services() else disable_dispatch_services() endif // if mission_car_marked // mark_vehicle_as_no_longer_needed(current_car) // mission_car_marked = false // endif //allow_emergency_services(true) do_screen_fade_in(fade_time) endproc proc end_cutscene_no_fade(bool clear_tasks = true, bool update_game_camera = true, bool interpolate_behind_player = false, float interp_heading = 0.0, float interp_pitch = 0.0, int interp_to_game_time = 3000, bool enable_emergency_services = true, bool clear_the_prints = true, bool kill_conversation = true, bool destroy_script_cams = true, bool allow_radar_hud = true) INFORM_MISSION_STATS_SYSTEM_OF_INengine_CUTSCENE_END() SET_SCRIPTS_SAFE_FOR_CUTSCENE(false) if clear_the_prints clear_prints() endif clear_help() if kill_conversation kill_face_to_face_conversation() endif if allow_radar_hud display_hud(true) display_radar(true) set_widescreen_borders(false, 500) endif if is_player_playing(player_id()) if destroy_script_cams destroy_all_cams() endif if update_game_camera if interpolate_behind_player render_script_cams(false, true, interp_to_game_time) set_gameplay_cam_relative_heading(interp_heading) set_gameplay_cam_relative_pitch(interp_pitch) else render_script_cams(false, false) set_gameplay_cam_relative_heading(interp_heading) set_gameplay_cam_relative_pitch(interp_pitch) endif endif if clear_tasks clear_ped_tasks(player_ped_id()) endif enable_special_ability(player_id(), true) hide_ped_weapon_for_scripted_cutscene(player_ped_id(), false) set_player_control(player_id(), true) endif if enable_emergency_services enable_dispatch_services() else disable_dispatch_services() endif endproc func bool mission_ped_injured(ped_index &this_ped) if DOES_ENTITY_EXIST(this_ped) return is_ped_injured(this_ped) endif return false endfunc func bool mission_vehicle_injured(vehicle_index &this_vehicle) if DOES_ENTITY_EXIST(this_vehicle) if not is_vehicle_driveable(this_vehicle) return true endif endif return false endfunc func bool ped_structure_are_all_enemies_dead(ped_structure &enemy_array[], bool set_ped_no_longer_needed = true, bool set_model_no_longer_needed = false) int peds_dead int i for i = 0 to (count_of(enemy_array) - 1) if DOES_ENTITY_EXIST(enemy_array[i].ped) if is_ped_injured(enemy_array[i].ped) if set_ped_no_longer_needed SET_PED_AS_NO_LONGER_NEEDED(enemy_array[i].ped) endif if set_model_no_longer_needed set_model_as_no_longer_needed(enemy_array[i].model) endif if does_blip_exist(enemy_array[i].blip) REMOVE_BLIP(enemy_array[i].blip) endif printstring("ped_structure_are_all_enemies_dead called") printnl() peds_dead ++ endif else if enemy_array[i].created peds_dead ++ endif endif endfor if peds_dead = count_of(enemy_array) return TRUE endif return FALSE endfunc //*****call this function underneath ped_structure_are_all_enemies_dead func bool ped_structure_are_specific_number_enemies_dead(ped_structure &enemy_array[], int number_of_dead_peds) int peds_dead = 0 int i for i = 0 to count_of(enemy_array) - 1 if enemy_array[i].created if is_ped_injured(enemy_array[i].ped) peds_dead++ endif endif endfor if peds_dead >= number_of_dead_peds return TRUE endif return FALSE endfunc func int ped_structure_get_total_number_of_enemies_dead(ped_structure &enemy_array[]) int peds_dead = 0 int i for i = 0 to count_of(enemy_array) - 1 if enemy_array[i].created if is_ped_injured(enemy_array[i].ped) peds_dead++ endif endif endfor return peds_dead endfunc func bool has_player_antagonised_ped(ped_index &mission_ped, float distance, bool distance_check_on = true) if not is_ped_injured(mission_ped) if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(mission_ped)) < distance //if has_char_spotted_char(this_ped, player_char_id()) if CAN_PED_SEE_HATED_PED(mission_ped, PLAYER_PED_ID()) IF IS_ped_ARMED(PLAYER_ped_ID(), WF_INCLUDE_MELEE|WF_INCLUDE_PROJECTILE|WF_INCLUDE_GUN) if IS_PLAYER_TARGETTING_ENTITY(player_id(), mission_ped) return TRUE endif if is_player_free_aiming_at_entity(player_id(), mission_ped) return TRUE endif endif endif if is_ped_shooting(player_ped_id()) return true endif endif if is_bullet_in_area(get_entity_coords(mission_ped), 4.0) return true endif if distance_check_on if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(mission_ped)) < 1.5 return true endif endif endif return FALSE endfunc func bool move_door(model_names door_model, vector door_pos, bool open_door = true, bool door_opens_to_right = true, float door_speed = 1.0) if DOES_OBJECT_OF_TYPE_EXIST_AT_COORDS(door_pos, 1.0, door_model, true) bool door_lock_state float door_ratio GET_STATE_OF_CLOSEST_DOOR_OF_TYPE(door_model, door_pos, door_lock_state, door_ratio) if open_door if door_opens_to_right door_ratio += get_frame_time() * door_speed if door_ratio >= 1.0 door_ratio = 1.0 endif else door_ratio -= get_frame_time() * door_speed if door_ratio <= -1.0 door_ratio = -1.0 endif endif endif set_state_of_closest_door_of_type(door_model, door_pos, true, door_ratio) if door_opens_to_right if door_ratio >= 1.0 return true endif else if door_ratio <= -1.0 return true endif endif endif return false endfunc func bool move_doors(model_names left_door_model, vector left_door_pos, model_names right_door_model, vector right_door_pos, bool open_doors = true, float door_speed = 1.0) if DOES_OBJECT_OF_TYPE_EXIST_AT_COORDS(left_door_pos, 1.0, left_door_model, true) and DOES_OBJECT_OF_TYPE_EXIST_AT_COORDS(right_door_pos, 1.0, right_door_model, true) float left_door_ratio float right_door_ratio bool left_lock_state bool right_lock_state GET_STATE_OF_CLOSEST_DOOR_OF_TYPE(left_door_model, left_door_pos, left_lock_state, left_door_ratio) GET_STATE_OF_CLOSEST_DOOR_OF_TYPE(right_door_model, right_door_pos, right_lock_state, right_door_ratio) if open_doors left_door_ratio -= get_frame_time() * door_speed if left_door_ratio <= -1.0 left_door_ratio = -1.0 endif right_door_ratio += get_frame_time() * door_speed if right_door_ratio >= 1.0 right_door_ratio = 1.0 endif if (left_door_ratio = -1.0) and (right_door_ratio = 1.0) return true endif else left_door_ratio += get_frame_time() * door_speed if left_door_ratio >= 0.0 left_door_ratio = 0.0 endif right_door_ratio -= get_frame_time() * door_speed if right_door_ratio <= 0.0 right_door_ratio = 0.0 endif if (left_door_ratio = 0.0) and (right_door_ratio = 0.0) return true endif endif set_state_of_closest_door_of_type(left_door_model, left_door_pos, true, left_door_ratio) set_state_of_closest_door_of_type(right_door_model, right_door_pos, true, right_door_ratio) endif return false endfunc func bool move_door_with_new_door_system(int door_hash, bool open_door = true, float door_speed = 1.0) float door_ratio if DOOR_SYSTEM_GET_IS_PHYSICS_LOADED(door_hash) door_ratio = DOOR_SYSTEM_GET_OPEN_RATIO(door_hash) if open_door door_ratio += get_frame_time() * door_speed if door_ratio >= 1.0 door_ratio = 1.0 endif DOOR_SYSTEM_SET_OPEN_RATIO(door_hash, door_ratio, false, false) DOOR_SYSTEM_SET_DOOR_STATE(door_hash, DOORSTATE_force_locked_this_frame, false, true) if door_ratio = 1.0 // if play_move_door_sound // // endif return true else // if play_move_door_sound // // endif endif else door_ratio -= get_frame_time() * door_speed if door_ratio <= 0.0 door_ratio = 0.0 endif DOOR_SYSTEM_SET_OPEN_RATIO(door_hash, door_ratio, false, false) DOOR_SYSTEM_SET_DOOR_STATE(door_hash, DOORSTATE_force_locked_this_frame, false, true) if door_ratio = 0.0 return true endif endif endif return false endfunc func bool move_doors_with_new_door_system(int left_door_hash, int right_door_hash, bool open_door = true, float door_speed = 1.0) float left_door_ratio float right_door_ratio printstring("door 0") printnl() if DOOR_SYSTEM_GET_IS_PHYSICS_LOADED(left_door_hash) and DOOR_SYSTEM_GET_IS_PHYSICS_LOADED(right_door_hash) printstring("door 1") printnl() left_door_ratio = DOOR_SYSTEM_GET_OPEN_RATIO(left_door_hash) right_door_ratio = DOOR_SYSTEM_GET_OPEN_RATIO(right_door_hash) if open_door left_door_ratio -= get_frame_time() * door_speed if left_door_ratio <= -1.0 left_door_ratio = -1.0 endif right_door_ratio += get_frame_time() * door_speed if right_door_ratio >= 1.0 right_door_ratio = 1.0 endif DOOR_SYSTEM_SET_OPEN_RATIO(left_door_hash, left_door_ratio, false, false) DOOR_SYSTEM_SET_DOOR_STATE(left_door_hash, DOORSTATE_force_locked_this_frame, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(right_door_hash, right_door_ratio, false, false) DOOR_SYSTEM_SET_DOOR_STATE(right_door_hash, DOORSTATE_force_locked_this_frame, false, true) if (left_door_ratio = -1.0) and (right_door_ratio = 1.0) return true endif else printstring("door 2") printnl() left_door_ratio += get_frame_time() * door_speed if left_door_ratio >= 0.0 left_door_ratio = 0.0 endif right_door_ratio -= get_frame_time() * door_speed if right_door_ratio <= 0.0 right_door_ratio = 0.0 endif DOOR_SYSTEM_SET_OPEN_RATIO(left_door_hash, left_door_ratio, false, false) DOOR_SYSTEM_SET_DOOR_STATE(left_door_hash, DOORSTATE_force_locked_this_frame, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(right_door_hash, right_door_ratio, false, false) DOOR_SYSTEM_SET_DOOR_STATE(right_door_hash, DOORSTATE_force_locked_this_frame, false, true) if (left_door_ratio = 0.0) and (right_door_ratio = 0.0) return true endif endif endif return false endfunc func bool get_current_player_vehicle(vehicle_index &test_car) if is_ped_sitting_in_any_vehicle(player_ped_id()) test_car = get_players_last_vehicle() if DOES_ENTITY_EXIST(test_car) if is_vehicle_driveable(test_car) return true endif endif endif return false endfunc PROC STOP_PLAYER_vehicle() VEHICLE_INDEX player_car if get_current_player_vehicle(player_car) FLOAT player_car_speed SET_PLAYER_CONTROL(PLAYER_ID(), FALSE) SET_ENTITY_PROOFS(player_car, true, true, true, true, true) player_car_speed = GET_ENTITY_SPEED(player_car) WHILE player_car_speed > 5.0 printfloat(player_car_speed) printnl() WAIT(0) if not IS_ENTITY_DEAD(player_car) player_car_speed = GET_ENTITY_SPEED(player_car) endif ENDWHILE SET_ENTITY_PROOFS(player_car, false, false, false, false, false) SET_PLAYER_CONTROL(PLAYER_ID(), TRUE) ENDIF ENDPROC func bool has_ped_task_finished_2(ped_index ped, script_task_name taskname = script_task_perform_sequence, int sequence_progress = -2, bool use_seq = true) scripttaskstatus status status = get_script_task_status(ped, taskname) if use_seq if status = finished_task or status = dormant_task or get_sequence_progress(ped) = sequence_progress return true endif else if status = finished_task or status = dormant_task return true endif endif return false endfunc //The players group does not include the player himself. RELGROUPHASH_PLAYER is the player REL_GROUP_HASH player_group REL_GROUP_HASH enemy_group REL_GROUP_HASH scientist_group rel_group_hash security_guard_2_group proc add_relationship_groups() ADD_RELATIONSHIP_GROUP("players group", player_group) ADD_RELATIONSHIP_GROUP("enemy group", enemy_group) ADD_RELATIONSHIP_GROUP("scientist_group", scientist_group) ADD_RELATIONSHIP_GROUP("security_guard_2", security_guard_2_group) endproc proc setup_relationship_contact(ped_index &this_ped, bool block_temporary_events = false) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_LIKE, player_group, RELGROUPHASH_PLAYER) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_LIKE, RELGROUPHASH_PLAYER, player_group) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_HATE, RELGROUPHASH_PLAYER, enemy_group) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_HATE, player_group, enemy_group) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_HATE, enemy_group, RELGROUPHASH_PLAYER) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_HATE, enemy_group, player_group) if DOES_ENTITY_EXIST(this_ped) if NOT is_ped_injured(this_ped) SET_PED_RELATIONSHIP_GROUP_HASH(this_ped, player_group) SET_PED_TARGET_LOSS_RESPONSE(this_ped, tlr_never_lose_target) set_ped_combat_attributes(this_ped, CA_DISABLE_PINNED_DOWN, true) set_ped_combat_attributes(this_ped, CA_DISABLE_PIN_DOWN_OTHERS, true) if block_temporary_events set_blocking_of_non_temporary_events(this_ped, true) else set_blocking_of_non_temporary_events(this_ped, false) endif endif endif endproc proc setup_relationship_enemy(ped_index &this_ped, bool block_temporary_events = false) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_LIKE, player_group, RELGROUPHASH_PLAYER) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_LIKE, RELGROUPHASH_PLAYER, player_group) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_HATE, RELGROUPHASH_PLAYER, enemy_group) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_HATE, player_group, enemy_group) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_HATE, enemy_group, RELGROUPHASH_PLAYER) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_HATE, enemy_group, player_group) if DOES_ENTITY_EXIST(this_ped) if NOT is_ped_injured(this_ped) SET_ped_RELATIONSHIP_GROUP_hash(this_ped, enemy_group) SET_PED_COMBAT_ATTRIBUTES(this_ped, CA_USE_VEHICLE, false) SET_PED_COMBAT_ATTRIBUTES(this_ped, CA_MOVE_TO_LOCATION_BEFORE_COVER_SEARCH, TRUE) SET_PED_TARGET_LOSS_RESPONSE(this_ped, tlr_never_lose_target) set_entity_is_target_priority(this_ped, true) if block_temporary_events set_blocking_of_non_temporary_events(this_ped, true) else set_blocking_of_non_temporary_events(this_ped, false) endif endif endif endproc proc setup_relationship_scientist(ped_index this_ped) if DOES_ENTITY_EXIST(this_ped) if NOT is_ped_injured(this_ped) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_LIKE, scientist_group, RELGROUPHASH_PLAYER) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_LIKE, RELGROUPHASH_PLAYER, scientist_group) SET_ped_RELATIONSHIP_GROUP_hash(this_ped, scientist_group) set_blocking_of_non_temporary_events(this_ped, true) endif endif endproc proc setup_relationship_security_guard_2(ped_index this_ped) if DOES_ENTITY_EXIST(this_ped) if NOT is_ped_injured(this_ped) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_HATE, security_guard_2_group, RELGROUPHASH_PLAYER) SET_RELATIONSHIP_between_groups(ACQUAINTANCE_TYPE_PED_HATE, RELGROUPHASH_PLAYER, security_guard_2_group) SET_ped_RELATIONSHIP_GROUP_hash(this_ped, security_guard_2_group) SET_PED_COMBAT_ATTRIBUTES(this_ped, CA_USE_VEHICLE, false) SET_PED_COMBAT_ATTRIBUTES(this_ped, CA_MOVE_TO_LOCATION_BEFORE_COVER_SEARCH, TRUE) SET_PED_TARGET_LOSS_RESPONSE(this_ped, tlr_never_lose_target) set_entity_is_target_priority(this_ped, true) set_blocking_of_non_temporary_events(this_ped, false) endif endif endproc proc setup_buddy_attributes(ped_structure &mission_buddy) set_entity_health(mission_buddy.ped, mission_buddy.health) set_ped_dies_when_injured(mission_buddy.ped, false) set_ped_can_be_targetted(mission_buddy.ped, false) set_ped_suffers_critical_hits(mission_buddy.ped, false) set_ped_can_evasive_dive(mission_buddy.ped, false) set_entity_is_target_priority(mission_buddy.ped, false) set_ped_keep_task(mission_buddy.ped, true) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_KeepRelationshipGroupAfterCleanUp, true) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_WillFlyThroughWindscreen, false) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_RunFromFiresAndExplosions, FALSE) set_ped_config_flag(mission_buddy.ped, PCF_CanActivateRagdollWhenVehicleUpsideDown, true) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_DisableExplosionReactions, true) set_ped_can_ragdoll(mission_buddy.ped, false) SET_PED_CAN_LOSE_PROPS_ON_DAMAGE(mission_buddy.ped, false, PF_CAN_LOSE_PROPS_ON_DAMAGE) set_ped_name_debug(mission_buddy.ped, mission_buddy.name) give_weapon_to_ped(mission_buddy.ped, mission_buddy.weapon, infinite_ammo, false) //don't want weapon to force into peds hands during get into boat anims set_ped_seeing_range(mission_buddy.ped, 250.00) set_ped_hearing_range(mission_buddy.ped, 250.00) set_ped_id_range(mission_buddy.ped, 250.00) endproc proc setup_player_ped_buddy_attributes(ped_index mission_ped, bool block_interaction_with_the_cops = false) set_ped_dies_when_injured(mission_ped, false) set_ped_can_be_targetted(mission_ped, false) set_ped_suffers_critical_hits(mission_ped, false) set_ped_can_evasive_dive(mission_ped, false) set_entity_is_target_priority(mission_ped, false) set_ped_can_ragdoll(mission_ped, false) set_ped_seeing_range(mission_ped, 250.00) set_ped_hearing_range(mission_ped, 250.00) set_ped_id_range(mission_ped, 250.00) SET_PED_CONFIG_FLAG(mission_ped, PCF_KeepRelationshipGroupAfterCleanUp, true) SET_PED_CONFIG_FLAG(mission_ped, PCF_WillFlyThroughWindscreen, false) SET_PED_CONFIG_FLAG(mission_ped, PCF_RunFromFiresAndExplosions, FALSE) SET_PED_CONFIG_FLAG(mission_ped, PCF_DisableExplosionReactions, true) SET_PED_CONFIG_FLAG(mission_ped, PCF_DisableHurt, true) if block_interaction_with_the_cops SET_PED_CONFIG_FLAG(mission_ped, PCF_OnlyAttackLawIfPlayerIsWanted, true) SET_PED_CONFIG_FLAG(mission_ped, PCF_CannotBeTargeted, true) endif endproc proc setup_enemy_attributes(ped_structure &enemy) set_ped_dies_when_injured(enemy.ped, true) set_ped_as_enemy(enemy.ped, true) set_entity_is_target_priority(enemy.ped, true) set_ped_keep_task(enemy.ped, true) SET_PED_CONFIG_FLAG(enemy.ped, PCF_KeepRelationshipGroupAfterCleanUp, true) SET_PED_MONEY(enemy.ped, 0) enemy.blip = create_blip_for_ped(enemy.ped, true) give_weapon_to_ped(enemy.ped, enemy.weapon, infinite_ammo, true) set_entity_health(enemy.ped, enemy.health) set_ped_max_health(enemy.ped, enemy.health) if enemy.damaged_by_player set_entity_only_damaged_by_player(enemy.ped, true) endif if enemy.allow_body_armour add_armour_to_ped(enemy.ped, 100) endif set_ped_name_debug(enemy.ped, enemy.name) set_ped_seeing_range(enemy.ped, 250.00) set_ped_hearing_range(enemy.ped, 250.00) set_ped_id_range(enemy.ped, 250.00) set_ped_can_evasive_dive(enemy.ped, true) set_ped_accuracy(enemy.ped, enemy.accuracy) ADD_DEADPOOL_TRIGGER(enemy.ped, FBI5_KILLS) INFORM_MISSION_STATS_OF_HEADSHOT_WATCH_ENTITY(enemy.ped) endproc proc setup_enemy(ped_structure &enemy, bool override_lod_multiplier = false) clear_area(enemy.pos, 2.0, true) enemy.ped = create_ped(pedtype_mission, enemy.model, enemy.pos, enemy.heading) set_ped_random_component_variation(enemy.ped) SET_PED_RANDOM_PROPS(enemy.ped) if enemy.model = S_M_Y_Marine_03 IF (GET_PED_DRAWABLE_VARIATION(enemy.ped, PED_COMP_HAIR) = 3) or (GET_PED_DRAWABLE_VARIATION(enemy.ped, PED_COMP_HAIR) = 2) set_entity_proofs(enemy.ped, false, false, false, false, false, false, false, true) endif endif //SET_PED_RANDOM_PROPS() set_ped_dies_when_injured(enemy.ped, true) set_ped_as_enemy(enemy.ped, true) set_entity_is_target_priority(enemy.ped, true) set_ped_keep_task(enemy.ped, true) SET_PED_CONFIG_FLAG(enemy.ped, PCF_KeepRelationshipGroupAfterCleanUp, true) SET_PED_MONEY(enemy.ped, 0) give_weapon_to_ped(enemy.ped, enemy.weapon, infinite_ammo, true) SET_ENTITY_HEALTH(enemy.ped, enemy.health) set_ped_max_health(enemy.ped, enemy.health) if enemy.damaged_by_player SET_ENTITY_ONLY_DAMAGED_BY_PLAYER(enemy.ped, true) endif if enemy.allow_body_armour add_armour_to_ped(enemy.ped, 100) endif set_ped_name_debug(enemy.ped, enemy.name) set_ped_seeing_range(enemy.ped, 250.00) set_ped_hearing_range(enemy.ped, 250.00) set_ped_id_range(enemy.ped, 250.00) enemy.blip = CREATE_BLIP_FOR_PED(enemy.ped, true) set_blip_display(enemy.blip, DISPLAY_BLIP) set_ped_can_evasive_dive(enemy.ped, true) setup_relationship_enemy(enemy.ped, true) set_ped_accuracy(enemy.ped, enemy.accuracy) if override_lod_multiplier SET_PED_LOD_MULTIPLIER(enemy.ped, 3.0) endif ADD_DEADPOOL_TRIGGER(enemy.ped, FBI5_KILLS) INFORM_MISSION_STATS_OF_HEADSHOT_WATCH_ENTITY(enemy.ped) enemy.created = true endproc proc setup_buddy(ped_structure &mission_buddy) clear_area(mission_buddy.pos, 4.0, true) mission_buddy.ped = create_ped(pedtype_mission, mission_buddy.model, mission_buddy.pos, mission_buddy.heading) set_entity_health(mission_buddy.ped, mission_buddy.health) set_ped_dies_when_injured(mission_buddy.ped, false) set_ped_can_be_targetted(mission_buddy.ped, false) set_ped_suffers_critical_hits(mission_buddy.ped, false) set_ped_can_evasive_dive(mission_buddy.ped, false) set_entity_is_target_priority(mission_buddy.ped, false) set_ped_can_ragdoll(mission_buddy.ped, false) set_ped_keep_task(mission_buddy.ped, true) SET_PED_MONEY(mission_buddy.ped, 0) stop_ped_speaking(mission_buddy.ped, true) SET_PED_CAN_LOSE_PROPS_ON_DAMAGE(mission_buddy.ped, false, PF_CAN_LOSE_PROPS_ON_DAMAGE) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_KeepRelationshipGroupAfterCleanUp, true) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_RunFromFiresAndExplosions, FALSE) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_DisableExplosionReactions, true) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_WillFlyThroughWindscreen, false) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_DisableHurt, true) SET_PED_ENABLE_WEAPON_BLOCKING(mission_buddy.ped, true) give_weapon_to_ped(mission_buddy.ped, mission_buddy.weapon, infinite_ammo, false) set_ped_seeing_range(mission_buddy.ped, 250.00) set_ped_hearing_range(mission_buddy.ped, 250.00) set_ped_id_range(mission_buddy.ped, 250.00) setup_relationship_contact(mission_buddy.ped, true) set_ped_name_debug(mission_buddy.ped, mission_buddy.name) endproc proc setup_buddy_inside_vehicle(ped_structure &mission_buddy, vehicle_index &miss_vehicle, vehicle_seat veh_seat) clear_area(mission_buddy.pos, 4.0, true) mission_buddy.ped = create_ped_inside_vehicle(miss_vehicle, pedtype_mission, mission_buddy.model, veh_seat) set_entity_health(mission_buddy.ped, mission_buddy.health) set_ped_dies_when_injured(mission_buddy.ped, false) set_ped_can_be_targetted(mission_buddy.ped, false) set_ped_suffers_critical_hits(mission_buddy.ped, false) set_ped_can_evasive_dive(mission_buddy.ped, false) set_entity_is_target_priority(mission_buddy.ped, false) set_ped_can_ragdoll(mission_buddy.ped, false) set_ped_keep_task(mission_buddy.ped, true) SET_PED_MONEY(mission_buddy.ped, 0) stop_ped_speaking(mission_buddy.ped, true) SET_PED_CAN_LOSE_PROPS_ON_DAMAGE(mission_buddy.ped, false, PF_CAN_LOSE_PROPS_ON_DAMAGE) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_KeepRelationshipGroupAfterCleanUp, true) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_RunFromFiresAndExplosions, FALSE) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_DisableExplosionReactions, true) SET_PED_CONFIG_FLAG(mission_buddy.ped, PCF_DisableHurt, true) give_weapon_to_ped(mission_buddy.ped, mission_buddy.weapon, infinite_ammo, false, false) SET_PED_ENABLE_WEAPON_BLOCKING(mission_buddy.ped, true) set_ped_seeing_range(mission_buddy.ped, 250.00) set_ped_hearing_range(mission_buddy.ped, 250.00) set_ped_id_range(mission_buddy.ped, 250.00) setup_relationship_contact(mission_buddy.ped, true) set_ped_name_debug(mission_buddy.ped, mission_buddy.name) endproc proc setup_enemy_in_vehicle(ped_structure &enemy, vehicle_index &mission_veh, vehicle_seat veh_seat = vs_driver, bool override_lod_multiplier = false) //clear_area(enemy.pos, 2.0, true) enemy.ped = create_ped_inside_vehicle(mission_veh, pedtype_mission, enemy.model, veh_seat) set_ped_random_component_variation(enemy.ped) //SET_PED_RANDOM_PROPS() set_ped_dies_when_injured(enemy.ped, true) set_ped_as_enemy(enemy.ped, true) set_entity_is_target_priority(enemy.ped, true) set_ped_keep_task(enemy.ped, true) SET_PED_MONEY(enemy.ped, 0) give_weapon_to_ped(enemy.ped, enemy.weapon, infinite_ammo, true) set_current_ped_weapon(enemy.ped, enemy.weapon, true) SET_ENTITY_HEALTH(enemy.ped, enemy.health) set_ped_max_health(enemy.ped, enemy.health) if enemy.model = S_M_Y_Marine_03 IF (GET_PED_DRAWABLE_VARIATION(enemy.ped, PED_COMP_HAIR) = 3) or (GET_PED_DRAWABLE_VARIATION(enemy.ped, PED_COMP_HAIR) = 2) set_entity_proofs(enemy.ped, false, false, false, false, false, false, false, true) endif endif if enemy.damaged_by_player SET_ENTITY_ONLY_DAMAGED_BY_PLAYER(enemy.ped, true) endif if enemy.allow_body_armour add_armour_to_ped(enemy.ped, 100) endif enemy.created = true set_ped_name_debug(enemy.ped, enemy.name) set_ped_hearing_range(enemy.ped, 250.00) enemy.blip = CREATE_BLIP_FOR_PED(enemy.ped, true) set_blip_display(enemy.blip, DISPLAY_BLIP) set_ped_can_evasive_dive(enemy.ped, true) setup_relationship_enemy(enemy.ped, true) set_ped_accuracy(enemy.ped, enemy.accuracy) if override_lod_multiplier SET_PED_LOD_MULTIPLIER(enemy.ped, 2.0) endif endproc proc alter_buddy_setup(ped_index miss_buddy) set_ped_dies_when_injured(miss_buddy, true) set_ped_can_be_targetted(miss_buddy, true) set_ped_suffers_critical_hits(miss_buddy, true) set_entity_is_target_priority(miss_buddy, true) set_ped_keep_task(miss_buddy, false) set_ped_can_ragdoll(miss_buddy, true) setup_relationship_scientist(miss_buddy) endproc func bool lk_timer(int &start_time, int time) int current_time current_time = get_game_timer() if ((current_time - start_time) > time) return true endif return false endfunc func bool has_ped_been_harmed(ped_index &miss_ped, int &original_health) int current_health if DOES_ENTITY_EXIST(miss_ped) if not is_ped_injured(miss_ped) current_health = GET_ENTITY_HEALTH(miss_ped) if HAS_ENTITY_BEEN_DAMAGED_BY_ENTITY(miss_ped , player_ped_id()) or (current_health < original_health) or is_ped_responding_to_event(miss_ped, EVENT_DAMAGE) return true endif else return true endif endif return false endfunc struct quaternion float x float y float z float w endstruct func quaternion build_quaternion_from_euler_angles(float fPitch, float fRoll, float fHeading) quaternion quat float fltPitch2 float fltYaw2 float fltRoll2 fltPitch2 = fPitch * 0.5 fltYaw2 = fRoll * 0.5 fltRoll2 = fHeading * 0.5 float cosY2 = Cos(fltYaw2) float sinY2 = Sin(fltYaw2) float cosP2 = Cos(fltPitch2) float sinP2 = Sin(fltPitch2) float cosR2 = Cos(fltRoll2) float sinR2 = Sin(fltRoll2) Quat.x = cosR2 * sinP2 * cosY2 + sinR2 * cosP2 * sinY2 Quat.y = cosR2 * cosP2 * sinY2 - sinR2 * sinP2 * cosY2 Quat.y *= -1.0 Quat.z = sinR2 * cosP2 * cosY2 - cosR2 * sinP2 * sinY2 Quat.w = cosR2 * cosP2 * cosY2 + sinR2 * sinP2 * sinY2 return quat endfunc BOOL bHasSlideBeenInitialised INT iRemainingTime VECTOR vCarVelocity FUNC BOOL SLIDE_CAR_TO_POSITION_AND_ROTATION(VEHICLE_INDEX CarID, INT iTimeToSlide, VECTOR vTargetPosition, VECTOR vTargetRotation, FLOAT fZOffsetCorrection = 0.0) VECTOR pos VECTOR rot VECTOR vPos VECTOR vRot VECTOR vVel quaternion quat FLOAT fFrameTime IF NOT (bHasSlideBeenInitialised) iRemainingTime = iTimeToSlide bHasSlideBeenInitialised = TRUE IF IS_VEHICLE_DRIVEABLE(CarID) vCarVelocity = GET_ENTITY_SPEED_VECTOR(CarID) ENDIF ENDIF // if time goes below zero we are near enough there. IF (iRemainingTime <= 0) bHasSlideBeenInitialised = FALSE RETURN(TRUE) ENDIF IF IS_VEHICLE_DRIVEABLE(CarID) fFrameTime = GET_FRAME_TIME() // get car current pos and rot pos = GET_ENTITY_COORDS(CarID) rot.x = GET_ENTITY_PITCH(CarID) rot.y = GET_ENTITY_ROLL(CarID ) rot.z = GET_ENTITY_HEADING(CarID ) // update the stored car velocity. vVel = <<0.0, 0.0, 0.0>> - vCarVelocity vVel /= (TO_FLOAT(iRemainingTime) /1000.0) / fFrameTime vCarVelocity += vVel // update the pos with the velocity pos += (vCarVelocity * fFrameTime) // get vec from current to target vPos = vTargetPosition - pos vRot = vTargetRotation - rot //-- Figure out if it's quicker rotating clockwise or anti-clockwise IF vRot.z < 0.0 vRot.z += 360.0 ENDIF IF vRot.z > (vTargetRotation.z + 180.0) vRot.z -= 360.0 ENDIF VECTOR vRotNorm = NORMALISE_VECTOR(vRot) VECTOR vPosNorm = NORMALISE_VECTOR(vPos) // resize vectors to proper length, taking the frame time into account //get speed via v = d/t d = VMAG(vPos) t = TO_FLOAT(iRemainingTime)) * (fFrameTime * 1000.0) [time converted into miliseconds] vPosNorm *= (VMAG(vPos) / TO_FLOAT(iRemainingTime)) * (fFrameTime * 1000.0) vRotNorm *= (VMAG(vRot) / TO_FLOAT(iRemainingTime)) * (fFrameTime * 1000.0) // calculate new position and rotation pos += vPosNorm rot += vRotNorm // set the car position / rotation quat = BUILD_QUATERNION_FROM_EULER_ANGLES(rot.x, rot.y, rot.z) pos.z += fZOffsetCorrection SET_ENTITY_COORDS_NO_OFFSET(CarID, pos) SET_ENTITY_QUATERNION(CarID, quat.x, quat.y, quat.z, quat.w) // update the remaining time iRemainingTime -= ROUND(fFrameTime * 1000.0) ENDIF RETURN(FALSE) ENDFUNC func bool are_vectors_alomost_equal(vector vector_a, vector vector_b, vector unit_vector_x_multiplier) //vec b is the target vector //vec a is the current positon of the object //unit_vector_x_multiplier is the unitvector * frame time * multiplier vector vector_ba vector future_vector vector_ba = vector_b - vector_a printstring("vector ba magnitude: ") printfloat(vmag(vector_ba)) printnl() future_vector = (vector_b - (vector_a + unit_vector_x_multiplier)) printstring("future vector magnitude: ") printfloat(vmag(future_vector)) printnl() if (vmag(vector_ba) < 0.2) return true endif future_vector = (vector_b - (vector_a + unit_vector_x_multiplier)) if vmag(vector_ba) < 20 //added for rocket launcher swerve function if (vmag(future_vector) > vmag(vector_ba)) return true endif endif return false endfunc func bool is_ped_within_range_of_target_heading(ped_index miss_ped, float target_heading, float heading_range) float heading_dif heading_dif = (target_heading - get_entity_heading(miss_ped)) if heading_dif > 180 heading_dif -= 360 endif if heading_dif < -180 heading_dif += 360 endif if absf(heading_dif) <= heading_range return true endif return false endfunc func bool can_set_exit_state_for_player() switch get_current_player_ped_enum() case char_michael if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("michael", GET_PLAYER_PED_MODEL(char_michael)) return true endif break case char_franklin if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("franklin", GET_PLAYER_PED_MODEL(char_franklin)) return true endif break case char_trevor if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("trevor", GET_PLAYER_PED_MODEL(char_trevor)) return true endif break endswitch return false endfunc func bool is_vehicle_stuck_every_check(vehicle_index &vehicle) if DOES_ENTITY_EXIST(vehicle) if is_vehicle_driveable(vehicle) if is_vehicle_stuck_timer_up(vehicle, VEH_STUCK_ON_ROOF, ROOF_TIME) or is_vehicle_stuck_timer_up(vehicle, VEH_STUCK_JAMMED, JAMMED_TIME) or is_vehicle_stuck_timer_up(vehicle, VEH_STUCK_HUNG_UP, HUNG_UP_TIME) or is_vehicle_stuck_timer_up(vehicle, VEH_STUCK_ON_SIDE, SIDE_TIME) return true endif endif endif return false endfunc func bool is_player_in_cover_pos(vector cover_pos, float distance_check, bool player_in_cover_check = true) if vdist(cover_pos, get_entity_coords(player_ped_id())) < distance_check if is_entity_at_coord(player_ped_id(), cover_pos, <<1.0, 1.0, 2.0>>) if player_in_cover_check if is_ped_in_cover(player_ped_id()) return true endif endif else return true endif endif return false endfunc func bool is_ped_inside_interior(ped_index miss_ped, vector interior_pos, string interior_name) interior_instance_index interior interior_instance_index mission_ped_interior interior = get_interior_at_coords_with_type(interior_pos, interior_name) mission_ped_interior = GET_INTERIOR_FROM_ENTITY(miss_ped) if not (mission_ped_interior = null) if (mission_ped_interior = interior) return true endif endif return false endfunc /// PURPOSE: /// Checks if the player is currently hanging around where the given ped is trying to get to. This is useful for checking if peds /// playing synced scenes need to break into AI due to the player getting in the way. /// PARAMS: /// ped - The ped moving towards the destination. /// v_destination - The destination /// f_max_dist_before_check - The ped must be within this distance of the destination before we start checking what the player is doing. /// b_player_must_be_in_cover - If TRUE then the player must be in cover for them to be considered in the way. FUNC BOOL IS_PLAYER_STEALING_PEDS_DESTINATION(PED_INDEX ped, VECTOR destination, FLOAT distance_check, BOOL player_must_be_in_cover = true) IF NOT IS_PED_INJURED(ped) VECTOR player_pos = GET_ENTITY_COORDS(PLAYER_PED_ID()) VECTOR ped_pos = GET_ENTITY_COORDS(ped) FLOAT dist_from_ped_to_dest = VDIST(ped_pos, destination) FLOAT dist_from_player_to_dest = VDIST(player_pos, destination) IF dist_from_ped_to_dest < distance_check IF dist_from_player_to_dest < dist_from_ped_to_dest and is_entity_at_coord(player_ped_id(), destination, <<2.5, 2.5, 2.0>>) //dist_from_player_to_dest < 1.5 IF player_must_be_in_cover IF IS_PED_IN_COVER(PLAYER_PED_ID()) RETURN TRUE ENDIF ELSE RETURN TRUE ENDIF ENDIF ENDIF ENDIF RETURN FALSE ENDFUNC FUNC BOOL TRANSITION_FROM_MOCAP_TO_COVER_THEN_COMBAT(PED_INDEX &ped, INT &i_synced_scene, INT &i_timer, VECTOR v_cover_pos, vector attack_pos, float attack_sphere, FLOAT f_phase_to_switch = 1.0, FLOAT f_blend_duration = 0.5, BOOL b_force_cover_direction = FALSE, BOOL b_cover_direction_is_left = FALSE, coverpoint_index ped_cover_point = null) IF NOT IS_PED_INJURED(ped) IF IS_SYNCHRONIZED_SCENE_RUNNING(i_synced_scene) IF GET_SYNCHRONIZED_SCENE_PHASE(i_synced_scene) >= f_phase_to_switch STOP_SYNCHRONIZED_ENTITY_ANIM(ped, NORMAL_BLEND_OUT, TRUE) i_synced_scene = -1 OPEN_SEQUENCE_TASK(seq) TASK_PUT_PED_DIRECTLY_INTO_COVER(NULL, v_cover_pos, 1000, FALSE, f_blend_duration, b_force_cover_direction, b_cover_direction_is_left, ped_cover_point) TASK_SET_SPHERE_DEFENSIVE_AREA(null, attack_pos, attack_sphere) TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(NULL, FALSE) TASK_COMBAT_HATED_TARGETS_AROUND_PED(NULL, 100.0) CLOSE_SEQUENCE_TASK(seq) TASK_PERFORM_SEQUENCE(ped, seq) CLEAR_SEQUENCE_TASK(seq) IF b_force_cover_direction SET_PED_CONFIG_FLAG(ped, PCF_BlockPedFromTurningInCover, TRUE) ENDIF i_timer = GET_GAME_TIMER() ENDIF ELSE IF GET_GAME_TIMER() - i_timer > 1500 SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, false) set_ped_sphere_defensive_area(ped, attack_pos, attack_sphere) IF GET_SCRIPT_TASK_STATUS(ped, SCRIPT_TASK_COMBAT_HATED_TARGETS_AROUND_PED) != PERFORMING_TASK //clear_ped_tasks(ped) TASK_COMBAT_HATED_TARGETS_AROUND_PED(ped, 100.0) ENDIF return true ENDIF ENDIF ENDIF return false ENDFUNC func bool TRANSITION_FROM_MOCAP_TO_COMBAT(PED_INDEX &ped, INT &i_synced_scene, vector attack_pos, float attack_sphere, FLOAT f_phase_to_switch = 1.0) IF NOT IS_PED_INJURED(ped) IF IS_SYNCHRONIZED_SCENE_RUNNING(i_synced_scene) AND GET_SYNCHRONIZED_SCENE_PHASE(i_synced_scene) >= f_phase_to_switch STOP_SYNCHRONIZED_ENTITY_ANIM(ped, NORMAL_BLEND_OUT, TRUE) i_synced_scene = -1 SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, FALSE) set_ped_sphere_defensive_area(ped, attack_pos, attack_sphere) TASK_COMBAT_HATED_TARGETS_AROUND_PED(ped, 200.00) return true ENDIF ENDIF return false endfunc func bool is_ped_in_cover_or_running_cover_tasks(ped_index &ped) IF NOT IS_PED_IN_COVER(ped) AND NOT IS_PED_GOING_INTO_COVER(ped) AND GET_SCRIPT_TASK_STATUS(ped, SCRIPT_TASK_PUT_PED_DIRECTLY_INTO_COVER) != PERFORMING_TASK and GET_SCRIPT_TASK_STATUS(ped, SCRIPT_TASK_SEEK_COVER_TO_COVER_POINT) != PERFORMING_TASK and GET_SCRIPT_TASK_STATUS(ped, SCRIPT_TASK_SEEK_COVER_TO_COORDS) != performing_task return false endif return true endfunc func bool TRANSITION_FROM_MOCAP_TO_COVER(PED_INDEX &ped, INT &synced_scene_id, INT &timer, VECTOR cover_pos, FLOAT scene_phase = 1.0, FLOAT blend_duration = 0.5, BOOL force_cover_direction = FALSE, BOOL cover_direction_is_left = FALSE, coverpoint_index ped_cover_point = null) IF NOT IS_PED_INJURED(ped) IF IS_SYNCHRONIZED_SCENE_RUNNING(synced_scene_id) if GET_SYNCHRONIZED_SCENE_PHASE(synced_scene_id) >= scene_phase STOP_SYNCHRONIZED_ENTITY_ANIM(ped, NORMAL_BLEND_OUT, TRUE) synced_scene_id = -1 SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, TRUE) TASK_PUT_PED_DIRECTLY_INTO_COVER(ped, cover_pos, -1, FALSE, blend_duration, force_cover_direction, cover_direction_is_left, ped_cover_point) timer = GET_GAME_TIMER() endif else if lk_timer(timer, 1500) //if is_ped_in_cover(ped) return true //endif endif endif ENDIF return false ENDFUNC proc remove_player_from_cover_when_buddy_playing_synched_scene(ped_index &ped, INT &synced_scene_id, VECTOR cover_pos, FLOAT scene_phase = 0.95) IF NOT IS_PED_INJURED(ped) IF IS_SYNCHRONIZED_SCENE_RUNNING(synced_scene_id) AND GET_SYNCHRONIZED_SCENE_PHASE(synced_scene_id) >= scene_phase if is_player_in_cover_pos(cover_pos) if get_script_task_status(player_ped_id(), SCRIPT_TASK_EXIT_COVER) != performing_task task_exit_cover(player_ped_id(), idle_cover_exit, get_entity_coords(player_ped_id())) endif endif endif endif endproc //FUNC BOOL PUT_PED_INTO_COVER_FOR_MOCAP(PED_INDEX &ped, INT &i_timer, VECTOR v_cover_pos, FLOAT f_blend_duration = 0.0, // BOOL b_force_cover_direction = FALSE, BOOL b_force_face_left = FALSE) //vector cover_from_pos = <<0.0, 0.0, 0.0>> coverpoint_index cover_point = null, // // IF NOT IS_PED_INJURED(ped) // IF NOT IS_PED_IN_COVER(ped, TRUE) // i_timer = 0 // // IF NOT IS_PED_IN_COVER(ped) // AND NOT IS_PED_GOING_INTO_COVER(ped) // AND GET_SCRIPT_TASK_STATUS(ped, SCRIPT_TASK_PUT_PED_DIRECTLY_INTO_COVER) != PERFORMING_TASK // and GET_SCRIPT_TASK_STATUS(ped, SCRIPT_TASK_SEEK_COVER_TO_COVER_POINT) != PERFORMING_TASK // and GET_SCRIPT_TASK_STATUS(ped, SCRIPT_TASK_SEEK_COVER_TO_COORDS) != performing_task // // clear_ped_tasks(ped) // // SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, TRUE) // // TASK_PUT_PED_DIRECTLY_INTO_COVER(ped, v_cover_pos, -1, FALSE, f_blend_duration, b_force_cover_direction, b_force_face_left) // // ENDIF // // ELIF i_timer = 0 // // i_timer = GET_GAME_TIMER() // // ELIF GET_GAME_TIMER() - i_timer > 1000 // SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, TRUE) // RETURN TRUE // ENDIF // ENDIF // // RETURN FALSE //ENDFUNC FUNC BOOL PUT_PED_INTO_COVER_FOR_MOCAP(mocap_or_ai_enum &ped_decision, PED_INDEX &ped, INT &i_timer, VECTOR v_cover_pos, coverpoint_index ped_cover_point, vector cover_from_pos, float blend_duration = 0.5) //vector cover_from_pos = <<0.0, 0.0, 0.0>> coverpoint_index cover_point = null, IF NOT IS_PED_INJURED(ped) IF NOT IS_PED_IN_COVER(ped, TRUE) or not is_entity_at_coord(ped, v_cover_pos, <<1.5, 1.5, 2.0>>) ped_cover_point = ped_cover_point cover_from_pos = cover_from_pos i_timer = 0 if IS_PLAYER_STEALING_PEDS_DESTINATION(ped, v_cover_pos, 2, false)//4 SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, TRUE) ped_decision = use_ai return true endif //MUST always ensure the player is given a task / seq to get within if is_entity_at_coord(ped, v_cover_pos, <<1.5, 1.5, 2.0>>) IF NOT IS_PED_IN_COVER(ped) AND NOT IS_PED_GOING_INTO_COVER(ped) AND GET_SCRIPT_TASK_STATUS(ped, SCRIPT_TASK_PUT_PED_DIRECTLY_INTO_COVER) != PERFORMING_TASK and GET_SCRIPT_TASK_STATUS(ped, SCRIPT_TASK_SEEK_COVER_TO_COVER_POINT) != PERFORMING_TASK and GET_SCRIPT_TASK_STATUS(ped, SCRIPT_TASK_SEEK_COVER_TO_COORDS) != performing_task //clear_ped_tasks(ped) SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, TRUE) TASK_PUT_PED_DIRECTLY_INTO_COVER(ped, v_cover_pos, -1, FALSE, blend_duration, false, false, ped_cover_point, true) //script_assert("test 1") ENDIF else if get_script_task_status(ped, SCRIPT_TASK_FOLLOW_NAV_MESH_TO_COORD) != performing_task SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, TRUE) task_follow_nav_mesh_to_coord(ped, v_cover_pos, pedmove_run, -1, 0.2) //script_assert("test 3") endif endif ELIF i_timer = 0 i_timer = GET_GAME_TIMER() ELIF GET_GAME_TIMER() - i_timer > 1000 SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, TRUE) ped_decision = play_synched_scene RETURN TRUE ENDIF ENDIF RETURN FALSE ENDFUNC PROC TRANSITION_FROM_MOCAP_TO_AIM(PED_INDEX &ped, INT &i_synced_scene, vector aim_from_pos, VECTOR v_aim_pos, ped_index aim_ped = null, FLOAT f_phase_to_switch = 1.0, bool instant_blend_to_aim = true) IF NOT IS_PED_INJURED(ped) IF IS_SYNCHRONIZED_SCENE_RUNNING(i_synced_scene) if GET_SYNCHRONIZED_SCENE_PHASE(i_synced_scene) >= f_phase_to_switch STOP_SYNCHRONIZED_ENTITY_ANIM(ped, NORMAL_BLEND_OUT, TRUE) i_synced_scene = -1 if does_entity_exist(aim_ped) if not is_ped_injured(aim_ped) TASK_AIM_GUN_AT_entity(ped, aim_ped, -1, instant_blend_to_aim) endif else TASK_AIM_GUN_AT_COORD(ped, v_aim_pos, -1, instant_blend_to_aim) endif force_ped_motion_state(ped, MS_AIMING) SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, true) endif else aim_from_pos = aim_from_pos if not is_entity_at_coord(ped, aim_from_pos, <<0.5, 0.5, 1.6>>)//0.1 if has_ped_task_finished_2(ped, script_task_perform_sequence, 1) if does_entity_exist(aim_ped) if not is_ped_injured(aim_ped) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, aim_from_pos, pedmove_walk, -1, 0.05, ENAV_STOP_EXACTLY) TASK_AIM_GUN_AT_entity(null, aim_ped, -1, instant_blend_to_aim) close_sequence_task(seq) task_perform_sequence(ped, seq) clear_sequence_task(seq) else open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, aim_from_pos, pedmove_walk, -1, 0.05, ENAV_STOP_EXACTLY) task_aim_gun_at_coord(null, v_aim_pos, -1, instant_blend_to_aim) close_sequence_task(seq) task_perform_sequence(ped, seq) clear_sequence_task(seq) endif else open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, aim_from_pos, pedmove_walk, -1, 0.05, ENAV_STOP_EXACTLY) task_aim_gun_at_coord(null, v_aim_pos, -1, instant_blend_to_aim) close_sequence_task(seq) task_perform_sequence(ped, seq) clear_sequence_task(seq) endif endif endif ENDIF ENDIF ENDPROC func bool HAVE_ALL_STREAMING_REQUESTS_COMPLETED_FOR_PED(ped_index miss_ped) if does_entity_exist(miss_ped) if not is_ped_injured(miss_ped) if HAVE_ALL_STREAMING_REQUESTS_COMPLETED(miss_ped) return true endif endif endif return false endfunc func bool is_ped_in_same_vehicle_as_player(ped_index &mission_ped_0) vehicle_index miss_vehicle if get_current_player_vehicle(miss_vehicle) if not is_ped_injured(mission_ped_0) if is_ped_sitting_in_vehicle(mission_ped_0, miss_vehicle) return true endif endif endif return false endfunc func bool allow_dialogue_to_trigger(blip_index target_blip, ped_index buddy_ped_1 = null, ped_index buddy_ped_2 = null) if does_blip_exist(target_blip) if does_entity_exist(buddy_ped_1) and does_entity_exist(buddy_ped_2) if not is_ped_injured(buddy_ped_1) and not is_ped_injured(buddy_ped_2) if (is_ped_in_same_vehicle_as_player(buddy_ped_1) and is_ped_in_same_vehicle_as_player(buddy_ped_2)) or ((is_ped_on_foot(player_ped_id()) and is_ped_on_foot(buddy_ped_1)) and (is_ped_on_foot(player_ped_id()) and is_ped_on_foot(buddy_ped_2))) if not is_calling_any_contact() return true endif endif endif endif if does_entity_exist(buddy_ped_1) if not is_ped_injured(buddy_ped_1) if is_ped_in_same_vehicle_as_player(buddy_ped_1) or (is_ped_on_foot(player_ped_id()) and is_ped_on_foot(buddy_ped_1)) if not is_calling_any_contact() return true endif endif endif endif if does_entity_exist(buddy_ped_2) if not is_ped_injured(buddy_ped_2) if is_ped_in_same_vehicle_as_player(buddy_ped_2) or (is_ped_on_foot(player_ped_id()) and is_ped_on_foot(buddy_ped_2)) if not is_calling_any_contact() return true endif endif endif endif if not does_entity_exist(buddy_ped_1) and not does_entity_exist(buddy_ped_2) return true endif endif return false endfunc //PURPOSE: //obtains the lower priority dialogue data before a higher priority conversation overwrites the lower conversation. //Must be called every frame whilst getting ready to trigger higher conversation. only needed when you have //2 priority only needed when you have 2 priority conversation levels which can clash. e.g. medium and low. proc get_dialogue_data_for_future_resumption() //if not obtain_dialogue_data if IS_ANY_CONVERSATION_ONGOING_OR_QUEUED() if not resume_lower_priority_conversation //stops stored dialogue labels being overwritten dialogue_root = GET_CURRENTLY_PLAYING_STANDARD_CONVERSATION_ROOT() specific_label = GET_STANDARD_CONVERSATION_LABEL_FOR_FUTURE_RESUMPTION() if not are_strings_equal(dialogue_root, "null") and not are_strings_equal(specific_label, "null") resume_lower_priority_conversation = true endif printstring(dialogue_root) printnl() printstring(specific_label) printnl() endif //script_assert("store label") else printstring("family 4 - no conversation ongoing") printnl() endif //obtain_dialogue_data = true //endif endproc proc set_players_last_vehicle_to_vehicle_gen(vector car_pos, float car_heading) vehicle_index players_last_car players_last_car = GET_PLAYERS_LAST_VEHICLE() if does_entity_exist(players_last_car) if is_vehicle_driveable(players_last_car) SET_MISSION_VEHICLE_GEN_VEHICLE(players_last_car, car_pos, car_heading) endif endif endproc //Purpose: //Will pause a conversation when the target blip does not exist. e.g. the player has left the vehicle or ran away from the buddy //In the event where you want to play a specific line when you leave the car etc then DONT USE THIS and do something //specific - see dialogue example in lawrence_gta5_sdk - (bottom of file) func bool dialogue_monitoring_system(blip_index target_blip, ped_index buddy_ped_1 = null, ped_index buddy_ped_2 = null, bool allow_pause_conversation = true) // if does_blip_exist(target_blip) // and (is_ped_in_same_vehicle_as_player(buddy_ped) or (is_ped_on_foot(player_ped_id()) and is_ped_on_foot(buddy_ped))) if allow_dialogue_to_trigger(target_blip, buddy_ped_1, buddy_ped_2) if IS_FACE_TO_FACE_CONVERSATION_PAUSED() PAUSE_FACE_TO_FACE_CONVERSATION(false) endif if resume_lower_priority_conversation //dialogue_paused if not is_any_text_being_displayed(locates_data) //and not lazlow_chase_cam_active if create_conversation_from_specific_line(scripted_speech, "fbi5aAU", dialogue_root, specific_label, CONV_PRIORITY_LOW) resume_lower_priority_conversation = false endif endif endif if not is_any_text_being_displayed(locates_data) and not resume_lower_priority_conversation return true endif else if IS_ANY_CONVERSATION_ONGOING_OR_QUEUED() //RESUME_INTERRUPT_CONVERSATION(false) if allow_pause_conversation if not IS_FACE_TO_FACE_CONVERSATION_PAUSED() PAUSE_FACE_TO_FACE_CONVERSATION(true) if is_calling_any_contact() get_dialogue_data_for_future_resumption() endif endif endif endif printstring("dialogue_monitoring_system TEST 1") printnl() // if is_calling_any_contact() // get_dialogue_data_for_future_resumption() // endif //store car conversation data using function //trigger get back in vehicle dialogue. endif return false endfunc func bool is_forklift_forks_in_pallet_node(vehicle_index &mission_forklift, object_index &mission_pallet) if does_entity_exist(mission_forklift) and does_entity_exist(mission_pallet) if is_vehicle_driveable(mission_forklift) int i vector forklift_point_0 = get_offset_from_entity_in_world_coords(mission_forklift, <<-0.400, 2.050, -0.700>>) vector forklift_point_1 = get_offset_from_entity_in_world_coords(mission_forklift, <<0.400, 2.050, 0.00>>) vector pallet_node[4] pallet_node[0] = get_offset_from_entity_in_world_coords(mission_pallet, <<0.0, 0.7, 0.0>>) pallet_node[1] = get_offset_from_entity_in_world_coords(mission_pallet, <<0.7, 0.0, 0.0>>) pallet_node[2] = get_offset_from_entity_in_world_coords(mission_pallet, <<0.0, -0.7, 0.0>>) pallet_node[3] = get_offset_from_entity_in_world_coords(mission_pallet, <<-0.7, 0.0, 0.0>>) for i = 0 to count_of(pallet_node) - 1 //draw_marker(MARKER_CYLINDER, pallet_node[i], <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>, <<0.1, 0.1, 0.1>>, 255, 0, 128, 178) if is_point_in_angled_area(pallet_node[i], forklift_point_0, forklift_point_1, 0.2) return true endif endfor endif endif return false endfunc proc repostion_players_last_vehicle(vehicle_index &mission_veh, vector area_pos_check, vector area_dimensions, vector veh_pos, float veh_heading) mission_veh = get_players_last_vehicle() if does_entity_exist(mission_veh) if is_vehicle_driveable(mission_veh) if not is_big_vehicle(mission_veh) if not (get_entity_model(mission_veh) = taxi) if is_entity_at_coord(mission_veh, area_pos_check, area_dimensions) if not is_entity_a_mission_entity(mission_veh) set_entity_as_mission_entity(mission_veh) endif if not is_vehicle_in_players_garage(mission_veh, get_current_player_ped_enum(), false) clear_area(veh_pos, 10.0, true) set_entity_coords(mission_veh, veh_pos) set_entity_heading(mission_veh, veh_heading) set_vehicle_on_ground_properly(mission_veh) endif endif endif endif endif endif endproc proc setup_vehicle_proofs(vehicle_index &this_vehicle) if does_entity_exist(this_vehicle) if is_vehicle_driveable(this_vehicle) if get_entity_health(this_vehicle) < 500 set_entity_health(this_vehicle, 500) endif if get_vehicle_engine_health(this_vehicle) < 500 set_vehicle_engine_health(this_vehicle, 500.00) endif if get_vehicle_petrol_tank_health(this_vehicle) < 500.00 set_vehicle_petrol_tank_health(this_vehicle, 500.00) endif set_entity_proofs(this_vehicle, true, true, true, true, true) endif endif endproc proc restore_vehicle_health(vehicle_index &mission_veh) if does_entity_exist(mission_veh) if is_vehicle_driveable(mission_veh) if get_entity_health(mission_veh) < 500 set_entity_health(mission_veh, 500) endif if get_vehicle_engine_health(mission_veh) < 500 set_vehicle_engine_health(mission_veh, 500.00) endif if get_vehicle_petrol_tank_health(mission_veh) < 500.00 set_vehicle_petrol_tank_health(mission_veh, 500.00) endif endif endif endproc proc deactivate_vehicle_proofs(vehicle_index &this_vehicle) if does_entity_exist(this_vehicle) if is_vehicle_driveable(this_vehicle) set_entity_proofs(this_vehicle, false, false, false, false, false) restore_vehicle_health(this_vehicle) endif endif endproc //****************************************************************************************************************** //Rotation round the x axis - Lawrence Kerr and Big Dave Watson. FUNC VECTOR ROTATE_VECTOR_ABOUT_X_AXIS(VECTOR vToRotate, FLOAT fRotAmount) VECTOR vReturn vReturn.z = ( vToRotate.z * COS(fRotAmount)) + (vToRotate.y * SIN(fRotAmount)) vReturn.y = ( vToRotate.y * COS(fRotAmount)) - (vToRotate.z * SIN(fRotAmount)) vReturn.x= vToRotate.x RETURN vReturn ENDFUNC // PURPOSE: Returns True if the specified time has passed FUNC BOOL HAS_DW_TIME_PASSED(INT iStartTimer, INT iTimeToCheck) // INPUT PARAMS: iStartTimer This is considered time = 0 // iTimeToCheck The time since iStartTimer being tested for // RETURN VALUE BOOL TRUE if time iTimeToCheck has passed since time iStartTimer // NOTE: Requires iStartTimer to have been set before the fn is called INT iTempTime IF iStartTimer > 0 iTempTime = GET_GAME_TIMER() IF iTempTime - iStartTimer > iTimeToCheck RETURN TRUE ENDIF ENDIF RETURN FALSE ENDFUNC //PURPOSE: Determine if the ped passed has finished their sequence if CHECK_FOR_FINISHED, or if they have got as far as this_prg otherwise FUNC BOOL HAS_PED_PROCESSED_SEQ(PED_INDEX this_ped, BOOL CHECK_FOR_FINISHED = TRUE, INT this_prg = 0) SCRIPTTASKSTATUS task_status INT seq_prog IF NOT IS_ENTITY_DEAD(this_ped) task_status = GET_SCRIPT_TASK_STATUS (this_ped, SCRIPT_TASK_PERFORM_SEQUENCE) IF CHECK_FOR_FINISHED IF task_status = FINISHED_TASK RETURN TRUE ELSE // DW_PRINTI(ENUM_TO_INT(task_status), "task_status....") RETURN FALSE ENDIF ELSE IF task_status = PERFORMING_TASK seq_prog = GET_SEQUENCE_PROGRESS(this_ped) IF seq_prog > this_prg RETURN TRUE ENDIF ENDIF ENDIF ENDIF RETURN FALSE ENDFUNC FUNC BOOL IS_PED_IN_SPECIFIC_ROOM(PED_INDEX pedInRoom, vector interior_pos, string room_name) INTERIOR_INSTANCE_INDEX interior INTERIOR_INSTANCE_INDEX interiorEntity INT iEntityRoomHashKey INT iRoomHashKey IF DOES_ENTITY_EXIST(pedInRoom) interior = get_interior_at_coords(interior_pos) interiorEntity = GET_INTERIOR_FROM_ENTITY(pedInRoom) IF NOT (interior = NULL) IF (interior = interiorEntity) iEntityRoomHashKey = GET_KEY_FOR_ENTITY_IN_ROOM(pedInRoom) iRoomHashKey = get_hash_key(room_name) IF (iEntityRoomHashKey != 0) IF iEntityRoomHashKey = iRoomHashKey return true ENDIF ENDIF ENDIF ENDIF ENDIF RETURN FALSE ENDFUNC FUNC BOOL IS_POINT_VISIBLE_TO_PLAYER(VECTOR vPos, FLOAT fRadius = 1.0, FLOAT fDistance = 100.0) VECTOR PlayerPos VECTOR vec IF NOT IS_SCREEN_FADED_OUT() IF IS_SPHERE_VISIBLE(vPos, fRadius) IF IS_PLAYER_PLAYING(PLAYER_ID()) PlayerPos = GET_ENTITY_COORDS(PLAYER_PED_ID()) // check dist to edge of sphere, if it is less than fDist then it is visible // vec from player to point vec = PlayerPos - vPos // dist from player to edge of sphere IF ((VMAG(vec) - fRadius) < fDistance) RETURN(TRUE) ENDIF ENDIF ENDIF ENDIF RETURN(FALSE) ENDFUNC proc setup_tazor_kill_for_ped(ped_structure &miss_ped) if not is_ped_injured(miss_ped.ped) set_ped_config_flag(miss_ped.ped, PCF_DisableBloodPoolCreation, true) if is_synchronized_scene_running(miss_ped.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(miss_ped.ped, normal_blend_in, true) endif SET_ENTITY_HEALTH(miss_ped.ped, 1) miss_ped.was_stunned = TRUE endif endproc FUNC BOOL HAS_PED_BEEN_TAZERED_BY_PED(PED_INDEX pedToTazer, PED_INDEX pedWithTazer) IF NOT IS_ENTITY_DEAD(pedToTazer) IF NOT IS_ENTITY_DEAD(pedWithTazer) WEAPON_TYPE wPed IF GET_CURRENT_PED_WEAPON(pedWithTazer, wPed) IF wPed = WEAPONTYPE_STUNGUN if HAS_ENTITY_BEEN_DAMAGED_BY_WEAPON(pedToTazer, WEAPONTYPE_STUNGUN) and HAS_ENTITY_BEEN_DAMAGED_BY_ENTITY(pedToTazer, pedWithTazer) RETURN TRUE ENDIF ENDIF ENDIF ENDIF ENDIF RETURN FALSE ENDFUNC FUNC VECTOR CONVERT_ROTATION_TO_DIRECTION_VECTOR(VECTOR v_rot) RETURN <<-SIN(v_rot.z) * COS(v_rot.x), COS(v_rot.z) * COS(v_rot.x), SIN(v_rot.x)>> ENDFUNC PROC DO_SAFE_FADE_OUT() IF NOT IS_SCREEN_FADED_OUT() DO_SCREEN_FADE_OUT(500) WHILE NOT IS_SCREEN_FADED_OUT() WAIT(0) ENDWHILE ENDIF ENDPROC /// PURPOSE: /// Fades the screen in, if it isn't already faded in and the script isn't currently p-skipping (the screen has to remain faded out in this case) PROC DO_SAFE_FADE_IN(BOOL b_force_fade = FALSE) IF NOT b_is_skipping_in_progress OR b_force_fade IF NOT IS_SCREEN_FADED_IN() do_screen_fade_in(DEFAULT_FADE_TIME) // WHILE NOT IS_SCREEN_FADED_IN() // WAIT(0) // ENDWHILE ENDIF ENDIF ENDPROC /// PURPOSE: /// Sorts the triggered label array such that all the empty elements are at the end. PROC REMOVE_LABEL_ARRAY_SPACES() INT i = 0 REPEAT (COUNT_OF(i_triggered_text_hashes) - 1) i IF i_triggered_text_hashes[i] = 0 IF i_triggered_text_hashes[i+1] != 0 i_triggered_text_hashes[i] = i_triggered_text_hashes[i+1] i_triggered_text_hashes[i+1] = 0 ENDIF ENDIF ENDREPEAT ENDPROC /// PURPOSE: /// Finds the array index of a particular triggered label, or -1 if the label hasn't been added. FUNC INT GET_LABEL_INDEX(INT i_label_hash) INT i = 0 REPEAT COUNT_OF(i_triggered_text_hashes) i IF i_triggered_text_hashes[i] = 0 //We've reached the end of the filled section of the array, no need to continue. RETURN -1 ELIF i_triggered_text_hashes[i] = i_label_hash RETURN i ENDIF ENDREPEAT RETURN -1 ENDFUNC /// PURPOSE: /// Returns TRUE if the given label has been triggered. FUNC BOOL HAS_LABEL_BEEN_TRIGGERED(STRING str_label) RETURN (GET_LABEL_INDEX(GET_HASH_KEY(str_label)) != -1) ENDFUNC /// PURPOSE: /// Adds/removes a text label to/from the list of labels that have been triggered. PROC SET_LABEL_AS_TRIGGERED(STRING str_label, BOOL b_trigger) INT i_hash = GET_HASH_KEY(str_label) INT i = 0 IF b_trigger BOOL b_added = FALSE WHILE NOT b_added AND i < COUNT_OF(i_triggered_text_hashes) IF i_triggered_text_hashes[i] = i_hash //The label is already in the array, don't add it again. b_added = TRUE ELIF i_triggered_text_hashes[i] = 0 i_triggered_text_hashes[i] = i_hash b_added = TRUE ENDIF i++ ENDWHILE #IF IS_DEBUG_BUILD IF NOT b_added SCRIPT_ASSERT("SET_LABEL_AS_TRIGGERED: Failed to add label, array is full.") ENDIF #ENDIF ELSE INT i_index = GET_LABEL_INDEX(i_hash) IF i_index != -1 i_triggered_text_hashes[i_index] = 0 REMOVE_LABEL_ARRAY_SPACES() ENDIF ENDIF ENDPROC PROC CLEAR_TRIGGERED_LABELS() INT i = 0 REPEAT COUNT_OF(i_triggered_text_hashes) i i_triggered_text_hashes[i] = 0 ENDREPEAT ENDPROC proc remove_player_ped_props(ped_index mission_ped, bool head_prop = true, bool eyes_prop = true, bool ears_prop = true) if head_prop set_ped_comp_item_current_sp(mission_ped, COMP_TYPE_PROPS, PROPS_HEAD_NONE, false) endif if eyes_prop set_ped_comp_item_current_sp(mission_ped, COMP_TYPE_PROPS, PROPS_EYES_NONE, false) endif if ears_prop set_ped_comp_item_current_sp(mission_ped, COMP_TYPE_PROPS, PROPS_EARS_NONE, false) endif endproc /// PURPOSE: /// Converges a value towards a given destination, by adding/removing a given amount. PROC CONVERGE_VALUE(FLOAT &val, FLOAT desired_val, FLOAT amount_to_converge) IF val != desired_val FLOAT converge_amount_this_frame = (amount_to_converge * 30.0) * GET_FRAME_TIME() IF val - desired_val > converge_amount_this_frame val -= converge_amount_this_frame ELIF val - desired_val < -converge_amount_this_frame val += converge_amount_this_frame ELSE val = desired_val ENDIF ENDIF ENDPROC /// PURPOSE: /// Moves the cam's rotation randomly according to the given parameters. PROC SHAKE_CAM_ROTATION(CAMERA_INDEX cam, VECTOR origin, FLOAT min_offset, FLOAT max_offset, FLOAT min_speed, FLOAT max_speed, BOOL b_rotate_y = FALSE) IF v_cam_last_point_offset.x = v_cam_point_offset.x v_cam_point_offset.x = GET_RANDOM_FLOAT_IN_RANGE(min_offset, max_offset) IF b_rotate_y v_cam_point_offset.y = GET_RANDOM_FLOAT_IN_RANGE(min_offset, max_offset) ENDIF v_cam_point_offset.z = GET_RANDOM_FLOAT_IN_RANGE(min_offset, max_offset) f_point_offset_speed = GET_RANDOM_FLOAT_IN_RANGE(min_speed, max_speed) ELSE //The speed ratio is used to scale speed so that every axis reaches its target at the same moment. FLOAT f_speed_ratio VECTOR v_diff = <> IF v_diff.x > v_diff.y AND v_diff.x > v_diff.z f_speed_ratio = f_point_offset_speed / v_diff.x ELIF v_diff.y > v_diff.z f_speed_ratio = f_point_offset_speed / v_diff.y ELSE f_speed_ratio = f_point_offset_speed / v_diff.z ENDIF IF f_speed_ratio > 1.0 f_speed_ratio = 1.0 ENDIF CONVERGE_VALUE(v_cam_last_point_offset.x, v_cam_point_offset.x, f_point_offset_speed) IF b_rotate_y CONVERGE_VALUE(v_cam_last_point_offset.y, v_cam_point_offset.y, f_speed_ratio * v_diff.y) ENDIF CONVERGE_VALUE(v_cam_last_point_offset.z, v_cam_point_offset.z, f_speed_ratio * v_diff.z) ENDIF SET_CAM_ROT(cam, origin + v_cam_last_point_offset) ENDPROC PROC SETUP_SPLINE_CAM_NODE_ARRAY_TREVOR_IN_HELI(SWITCH_CAM_STRUCT &thisSwitchCam, PED_INDEX piMichael, VEHICLE_INDEX viChopper) CDEBUG3LN(DEBUG_MISSION, "SETUP_SPLINE_CAM_NODE_ARRAY_TREVOR_IN_HELI") IF NOT thisSwitchCam.bInitialized //--- Start of Cam Data --- thisSwitchCam.nodes[0].SwitchCamType = SWITCH_CAM_OLD_SYSTEM thisSwitchCam.nodes[0].iForceCamPointAtEntityIndex = -1 thisSwitchCam.nodes[0].bIsGameplayCamCopy = FALSE thisSwitchCam.nodes[0].iNodeTime = 0 thisSwitchCam.nodes[0].vNodePos = <<0.5813, -1.5117, 0.2259>> thisSwitchCam.nodes[0].vWorldPosLookAt = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[0].fNodeOffsetDist = 0.0000 thisSwitchCam.nodes[0].fNodeVerticleOffset = 0.0000 thisSwitchCam.nodes[0].bAttachToOriginPed = FALSE thisSwitchCam.nodes[0].vNodeDir = <<8.1669, -0.0057, 88.7337>> thisSwitchCam.nodes[0].bPointAtEntity = FALSE thisSwitchCam.nodes[0].bPointAtOffsetIsRelative = FALSE thisSwitchCam.nodes[0].bAttachOffsetIsRelative = TRUE thisSwitchCam.nodes[0].fNodeFOV = 35.0000 thisSwitchCam.nodes[0].vClonedNodeOffset = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[0].iNodeToClone = 0 thisSwitchCam.nodes[0].NodeTimePostFX_Type = NO_EFFECT thisSwitchCam.nodes[0].fNodeTimePostFXBlendTime = 0.0000 thisSwitchCam.nodes[0].fNodeTimePostFXTimeOffset = 0.0000 thisSwitchCam.nodes[0].fNodeMotionBlur = 0.0000 thisSwitchCam.nodes[0].NodeCamShakeType = CAM_SHAKE_DEFAULT thisSwitchCam.nodes[0].fNodeCamShake = 0.2000 thisSwitchCam.nodes[0].iCamEaseType = 0 thisSwitchCam.nodes[0].fCamEaseScaler = 0.0000 thisSwitchCam.nodes[0].fCamNodeVelocityScale = 0.0000 thisSwitchCam.nodes[0].bCamEaseForceLinear = TRUE thisSwitchCam.nodes[0].bCamEaseForceLevel = FALSE thisSwitchCam.nodes[0].fTimeScale = 1.0000 thisSwitchCam.nodes[0].iTimeScaleEaseType = 0 thisSwitchCam.nodes[0].fTimeScaleEaseScaler = 0.0000 thisSwitchCam.nodes[0].bFlashEnabled = FALSE thisSwitchCam.nodes[0].SCFE_FlashEffectUsed = SCFE_CODE_FLASH thisSwitchCam.nodes[0].fMinExposure = 0.0000 thisSwitchCam.nodes[0].fMaxExposure = 0.0000 thisSwitchCam.nodes[0].iRampUpDuration = 0 thisSwitchCam.nodes[0].iRampDownDuration = 0 thisSwitchCam.nodes[0].iHoldDuration = 0 thisSwitchCam.nodes[0].fFlashNodePhaseOffset = 0.0000 thisSwitchCam.nodes[0].bIsLowDetailNode = FALSE thisSwitchCam.nodes[0].bUseCustomDOF = FALSE thisSwitchCam.nodes[0].NodeDOF_Info.fDOF_NearDOF = 0.0000 thisSwitchCam.nodes[0].NodeDOF_Info.fDOF_FarDOF = 0.0000 thisSwitchCam.nodes[0].NodeDOF_Info.fDOF_EffectStrength = 0.0000 thisSwitchCam.nodes[1].SwitchCamType = SWITCH_CAM_OLD_SYSTEM thisSwitchCam.nodes[1].iForceCamPointAtEntityIndex = -1 thisSwitchCam.nodes[1].bIsGameplayCamCopy = FALSE thisSwitchCam.nodes[1].iNodeTime = 3000 thisSwitchCam.nodes[1].vNodePos = <<0.4612, -1.1291, 0.2359>> thisSwitchCam.nodes[1].vWorldPosLookAt = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[1].fNodeOffsetDist = 0.0000 thisSwitchCam.nodes[1].fNodeVerticleOffset = 0.0000 thisSwitchCam.nodes[1].bAttachToOriginPed = FALSE thisSwitchCam.nodes[1].vNodeDir = <<12.7694, -0.0056, 87.5351>> thisSwitchCam.nodes[1].bPointAtEntity = FALSE thisSwitchCam.nodes[1].bPointAtOffsetIsRelative = FALSE thisSwitchCam.nodes[1].bAttachOffsetIsRelative = TRUE thisSwitchCam.nodes[1].fNodeFOV = 35.0000 thisSwitchCam.nodes[1].vClonedNodeOffset = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[1].iNodeToClone = 0 thisSwitchCam.nodes[1].NodeTimePostFX_Type = NO_EFFECT thisSwitchCam.nodes[1].fNodeTimePostFXBlendTime = 0.0000 thisSwitchCam.nodes[1].fNodeTimePostFXTimeOffset = 0.0000 thisSwitchCam.nodes[1].fNodeMotionBlur = 0.0000 thisSwitchCam.nodes[1].NodeCamShakeType = CAM_SHAKE_DEFAULT thisSwitchCam.nodes[1].fNodeCamShake = 0.0000 thisSwitchCam.nodes[1].iCamEaseType = 2 thisSwitchCam.nodes[1].fCamEaseScaler = 0.8000 thisSwitchCam.nodes[1].fCamNodeVelocityScale = 0.0000 thisSwitchCam.nodes[1].bCamEaseForceLinear = TRUE thisSwitchCam.nodes[1].bCamEaseForceLevel = FALSE thisSwitchCam.nodes[1].fTimeScale = 1.0000 thisSwitchCam.nodes[1].iTimeScaleEaseType = 0 thisSwitchCam.nodes[1].fTimeScaleEaseScaler = 0.0000 thisSwitchCam.nodes[1].bFlashEnabled = TRUE thisSwitchCam.nodes[1].SCFE_FlashEffectUsed = SCFE_SwitchShortMichaelIn thisSwitchCam.nodes[1].fMinExposure = 0.0000 thisSwitchCam.nodes[1].fMaxExposure = 0.0000 thisSwitchCam.nodes[1].iRampUpDuration = 0 thisSwitchCam.nodes[1].iRampDownDuration = 0 thisSwitchCam.nodes[1].iHoldDuration = 0 thisSwitchCam.nodes[1].fFlashNodePhaseOffset = 0.9800 thisSwitchCam.nodes[1].bIsLowDetailNode = FALSE thisSwitchCam.nodes[1].bUseCustomDOF = FALSE thisSwitchCam.nodes[1].NodeDOF_Info.fDOF_NearDOF = 0.0000 thisSwitchCam.nodes[1].NodeDOF_Info.fDOF_FarDOF = 0.0000 thisSwitchCam.nodes[1].NodeDOF_Info.fDOF_EffectStrength = 0.0000 thisSwitchCam.nodes[2].SwitchCamType = SWITCH_CAM_OLD_SYSTEM thisSwitchCam.nodes[2].iForceCamPointAtEntityIndex = -1 thisSwitchCam.nodes[2].bIsGameplayCamCopy = FALSE thisSwitchCam.nodes[2].iNodeTime = 600 thisSwitchCam.nodes[2].vNodePos = <<1.0248, -2.1924, 5.3185>> thisSwitchCam.nodes[2].vWorldPosLookAt = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[2].fNodeOffsetDist = 0.0000 thisSwitchCam.nodes[2].fNodeVerticleOffset = 0.0000 thisSwitchCam.nodes[2].bAttachToOriginPed = FALSE thisSwitchCam.nodes[2].vNodeDir = <<12.7693, -0.0056, 87.5347>> thisSwitchCam.nodes[2].bPointAtEntity = FALSE thisSwitchCam.nodes[2].bPointAtOffsetIsRelative = FALSE thisSwitchCam.nodes[2].bAttachOffsetIsRelative = TRUE thisSwitchCam.nodes[2].fNodeFOV = 35.0000 thisSwitchCam.nodes[2].vClonedNodeOffset = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[2].iNodeToClone = 0 thisSwitchCam.nodes[2].NodeTimePostFX_Type = NO_EFFECT thisSwitchCam.nodes[2].fNodeTimePostFXBlendTime = 0.0000 thisSwitchCam.nodes[2].fNodeTimePostFXTimeOffset = 0.0000 thisSwitchCam.nodes[2].fNodeMotionBlur = 1.0000 thisSwitchCam.nodes[2].NodeCamShakeType = CAM_SHAKE_DEFAULT thisSwitchCam.nodes[2].fNodeCamShake = 0.0000 thisSwitchCam.nodes[2].iCamEaseType = 0 thisSwitchCam.nodes[2].fCamEaseScaler = 0.0000 thisSwitchCam.nodes[2].fCamNodeVelocityScale = 0.0000 thisSwitchCam.nodes[2].bCamEaseForceLinear = TRUE thisSwitchCam.nodes[2].bCamEaseForceLevel = FALSE thisSwitchCam.nodes[2].fTimeScale = 1.0000 thisSwitchCam.nodes[2].iTimeScaleEaseType = 0 thisSwitchCam.nodes[2].fTimeScaleEaseScaler = 0.0000 thisSwitchCam.nodes[2].bFlashEnabled = TRUE thisSwitchCam.nodes[2].SCFE_FlashEffectUsed = SCFE_SwitchShortTrevorMid thisSwitchCam.nodes[2].fMinExposure = 200.0000 thisSwitchCam.nodes[2].fMaxExposure = 200.0000 thisSwitchCam.nodes[2].iRampUpDuration = 50 thisSwitchCam.nodes[2].iRampDownDuration = 50 thisSwitchCam.nodes[2].iHoldDuration = 100 thisSwitchCam.nodes[2].fFlashNodePhaseOffset = 0.3000 thisSwitchCam.nodes[2].bIsLowDetailNode = FALSE thisSwitchCam.nodes[2].bUseCustomDOF = FALSE thisSwitchCam.nodes[2].NodeDOF_Info.fDOF_NearDOF = 0.0000 thisSwitchCam.nodes[2].NodeDOF_Info.fDOF_FarDOF = 0.0000 thisSwitchCam.nodes[2].NodeDOF_Info.fDOF_EffectStrength = 0.0000 thisSwitchCam.nodes[3].bIsCamCutNode = TRUE thisSwitchCam.nodes[4].SwitchCamType = SWITCH_CAM_WORLD_POS thisSwitchCam.nodes[4].iForceCamPointAtEntityIndex = -1 thisSwitchCam.nodes[4].bIsGameplayCamCopy = FALSE thisSwitchCam.nodes[4].iNodeTime = 0 thisSwitchCam.nodes[4].vNodePos = <<3144.2681, 3543.2239, 130.6581>> thisSwitchCam.nodes[4].vWorldPosLookAt = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[4].fNodeOffsetDist = 0.0000 thisSwitchCam.nodes[4].fNodeVerticleOffset = 0.0000 thisSwitchCam.nodes[4].bAttachToOriginPed = FALSE thisSwitchCam.nodes[4].vNodeDir = <<-0.0635, 0.0025, 144.5912>> thisSwitchCam.nodes[4].bPointAtEntity = FALSE thisSwitchCam.nodes[4].bPointAtOffsetIsRelative = FALSE thisSwitchCam.nodes[4].bAttachOffsetIsRelative = FALSE thisSwitchCam.nodes[4].fNodeFOV = 40.0000 thisSwitchCam.nodes[4].vClonedNodeOffset = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[4].iNodeToClone = 0 thisSwitchCam.nodes[4].NodeTimePostFX_Type = NO_EFFECT thisSwitchCam.nodes[4].fNodeTimePostFXBlendTime = 1.0000 thisSwitchCam.nodes[4].fNodeTimePostFXTimeOffset = 0.0000 thisSwitchCam.nodes[4].fNodeMotionBlur = 1.0000 thisSwitchCam.nodes[4].NodeCamShakeType = CAM_SHAKE_DEFAULT thisSwitchCam.nodes[4].fNodeCamShake = 0.2000 thisSwitchCam.nodes[4].iCamEaseType = 1 thisSwitchCam.nodes[4].fCamEaseScaler = 1.0000 thisSwitchCam.nodes[4].fCamNodeVelocityScale = 0.0000 thisSwitchCam.nodes[4].bCamEaseForceLinear = FALSE thisSwitchCam.nodes[4].bCamEaseForceLevel = FALSE thisSwitchCam.nodes[4].fTimeScale = 1.0000 thisSwitchCam.nodes[4].iTimeScaleEaseType = 0 thisSwitchCam.nodes[4].fTimeScaleEaseScaler = 0.0000 thisSwitchCam.nodes[4].bFlashEnabled = FALSE thisSwitchCam.nodes[4].SCFE_FlashEffectUsed = SCFE_CODE_FLASH thisSwitchCam.nodes[4].fMinExposure = 0.0000 thisSwitchCam.nodes[4].fMaxExposure = 0.0000 thisSwitchCam.nodes[4].iRampUpDuration = 0 thisSwitchCam.nodes[4].iRampDownDuration = 0 thisSwitchCam.nodes[4].iHoldDuration = 0 thisSwitchCam.nodes[4].fFlashNodePhaseOffset = 0.0000 thisSwitchCam.nodes[4].bIsLowDetailNode = FALSE thisSwitchCam.nodes[4].bUseCustomDOF = FALSE thisSwitchCam.nodes[4].NodeDOF_Info.fDOF_NearDOF = 0.0000 thisSwitchCam.nodes[4].NodeDOF_Info.fDOF_FarDOF = 0.0000 thisSwitchCam.nodes[4].NodeDOF_Info.fDOF_EffectStrength = 0.0000 thisSwitchCam.nodes[5].SwitchCamType = SWITCH_ENTITY_ATTACHED_CAM thisSwitchCam.nodes[5].iForceCamPointAtEntityIndex = -1 thisSwitchCam.nodes[5].bIsGameplayCamCopy = FALSE thisSwitchCam.nodes[5].iNodeTime = 600 thisSwitchCam.nodes[5].vNodePos = <<-1.8852, 8.0075, 0.8190>> thisSwitchCam.nodes[5].vWorldPosLookAt = <<3266.8721, 3652.5234, 128.6665>> thisSwitchCam.nodes[5].fNodeOffsetDist = 0.0000 thisSwitchCam.nodes[5].fNodeVerticleOffset = 0.0000 thisSwitchCam.nodes[5].bAttachToOriginPed = FALSE thisSwitchCam.nodes[5].vNodeDir = <<1.8536, 0.9823, 0.7829>> thisSwitchCam.nodes[5].bPointAtEntity = TRUE thisSwitchCam.nodes[5].bPointAtOffsetIsRelative = TRUE thisSwitchCam.nodes[5].bAttachOffsetIsRelative = TRUE thisSwitchCam.nodes[5].fNodeFOV = 40.0000 thisSwitchCam.nodes[5].vClonedNodeOffset = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[5].iNodeToClone = 0 thisSwitchCam.nodes[5].NodeTimePostFX_Type = NO_EFFECT thisSwitchCam.nodes[5].fNodeTimePostFXBlendTime = 0.0000 thisSwitchCam.nodes[5].fNodeTimePostFXTimeOffset = 0.0000 thisSwitchCam.nodes[5].fNodeMotionBlur = 1.0000 thisSwitchCam.nodes[5].NodeCamShakeType = CAM_SHAKE_DEFAULT thisSwitchCam.nodes[5].fNodeCamShake = 0.2000 thisSwitchCam.nodes[5].iCamEaseType = 0 thisSwitchCam.nodes[5].fCamEaseScaler = 0.0000 thisSwitchCam.nodes[5].fCamNodeVelocityScale = 0.0000 thisSwitchCam.nodes[5].bCamEaseForceLinear = TRUE thisSwitchCam.nodes[5].bCamEaseForceLevel = FALSE thisSwitchCam.nodes[5].fTimeScale = 1.0000 thisSwitchCam.nodes[5].iTimeScaleEaseType = 0 thisSwitchCam.nodes[5].fTimeScaleEaseScaler = 0.0000 thisSwitchCam.nodes[5].bFlashEnabled = FALSE thisSwitchCam.nodes[5].SCFE_FlashEffectUsed = SCFE_CODE_FLASH thisSwitchCam.nodes[5].fMinExposure = 0.0000 thisSwitchCam.nodes[5].fMaxExposure = 0.0000 thisSwitchCam.nodes[5].iRampUpDuration = 0 thisSwitchCam.nodes[5].iRampDownDuration = 0 thisSwitchCam.nodes[5].iHoldDuration = 0 thisSwitchCam.nodes[5].fFlashNodePhaseOffset = 0.0000 thisSwitchCam.nodes[5].bIsLowDetailNode = FALSE thisSwitchCam.nodes[5].bUseCustomDOF = FALSE thisSwitchCam.nodes[5].NodeDOF_Info.fDOF_NearDOF = 0.0000 thisSwitchCam.nodes[5].NodeDOF_Info.fDOF_FarDOF = 0.0000 thisSwitchCam.nodes[5].NodeDOF_Info.fDOF_EffectStrength = 0.0000 thisSwitchCam.nodes[6].SwitchCamType = SWITCH_ENTITY_ATTACHED_CAM thisSwitchCam.nodes[6].iForceCamPointAtEntityIndex = -1 thisSwitchCam.nodes[6].bIsGameplayCamCopy = FALSE thisSwitchCam.nodes[6].iNodeTime = 5400 thisSwitchCam.nodes[6].vNodePos = <<-2.1424, 6.7358, 0.9655>> thisSwitchCam.nodes[6].vWorldPosLookAt = <<3309.9128, 3688.8252, 130.9899>> thisSwitchCam.nodes[6].fNodeOffsetDist = 0.0000 thisSwitchCam.nodes[6].fNodeVerticleOffset = 0.0000 thisSwitchCam.nodes[6].bAttachToOriginPed = FALSE thisSwitchCam.nodes[6].vNodeDir = <<2.2436, 4.5885, -0.0129>> thisSwitchCam.nodes[6].bPointAtEntity = TRUE thisSwitchCam.nodes[6].bPointAtOffsetIsRelative = TRUE thisSwitchCam.nodes[6].bAttachOffsetIsRelative = TRUE thisSwitchCam.nodes[6].fNodeFOV = 40.0000 thisSwitchCam.nodes[6].vClonedNodeOffset = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[6].iNodeToClone = 0 thisSwitchCam.nodes[6].NodeTimePostFX_Type = NO_EFFECT thisSwitchCam.nodes[6].fNodeTimePostFXBlendTime = 0.0000 thisSwitchCam.nodes[6].fNodeTimePostFXTimeOffset = 0.0000 thisSwitchCam.nodes[6].fNodeMotionBlur = 0.0000 thisSwitchCam.nodes[6].NodeCamShakeType = CAM_SHAKE_DEFAULT thisSwitchCam.nodes[6].fNodeCamShake = 0.2000 thisSwitchCam.nodes[6].iCamEaseType = 0 thisSwitchCam.nodes[6].fCamEaseScaler = 0.0000 thisSwitchCam.nodes[6].fCamNodeVelocityScale = 0.0000 thisSwitchCam.nodes[6].bCamEaseForceLinear = TRUE thisSwitchCam.nodes[6].bCamEaseForceLevel = FALSE thisSwitchCam.nodes[6].fTimeScale = 1.0000 thisSwitchCam.nodes[6].iTimeScaleEaseType = 0 thisSwitchCam.nodes[6].fTimeScaleEaseScaler = 0.0000 thisSwitchCam.nodes[6].bFlashEnabled = FALSE thisSwitchCam.nodes[6].SCFE_FlashEffectUsed = SCFE_CODE_FLASH thisSwitchCam.nodes[6].fMinExposure = 0.0000 thisSwitchCam.nodes[6].fMaxExposure = 0.0000 thisSwitchCam.nodes[6].iRampUpDuration = 0 thisSwitchCam.nodes[6].iRampDownDuration = 0 thisSwitchCam.nodes[6].iHoldDuration = 0 thisSwitchCam.nodes[6].fFlashNodePhaseOffset = 0.0000 thisSwitchCam.nodes[6].bIsLowDetailNode = FALSE thisSwitchCam.nodes[6].bUseCustomDOF = FALSE thisSwitchCam.nodes[6].NodeDOF_Info.fDOF_NearDOF = 0.0000 thisSwitchCam.nodes[6].NodeDOF_Info.fDOF_FarDOF = 0.0000 thisSwitchCam.nodes[6].NodeDOF_Info.fDOF_EffectStrength = 0.0000 thisSwitchCam.nodes[7].bIsCamCutNode = TRUE thisSwitchCam.nodes[8].SwitchCamType = SWITCH_CAM_OLD_SYSTEM thisSwitchCam.nodes[8].iForceCamPointAtEntityIndex = -1 thisSwitchCam.nodes[8].bIsGameplayCamCopy = FALSE thisSwitchCam.nodes[8].iNodeTime = 0 thisSwitchCam.nodes[8].vNodePos = <<-2.0911, -15.2659, 5.0184>> thisSwitchCam.nodes[8].vWorldPosLookAt = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[8].fNodeOffsetDist = 0.0000 thisSwitchCam.nodes[8].fNodeVerticleOffset = 0.0000 thisSwitchCam.nodes[8].bAttachToOriginPed = FALSE thisSwitchCam.nodes[8].vNodeDir = <<-1.6486, 0.0799, 0.1005>> thisSwitchCam.nodes[8].bPointAtEntity = TRUE thisSwitchCam.nodes[8].bPointAtOffsetIsRelative = TRUE thisSwitchCam.nodes[8].bAttachOffsetIsRelative = TRUE thisSwitchCam.nodes[8].fNodeFOV = 50.0000 thisSwitchCam.nodes[8].vClonedNodeOffset = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[8].iNodeToClone = 0 thisSwitchCam.nodes[8].NodeTimePostFX_Type = NO_EFFECT thisSwitchCam.nodes[8].fNodeTimePostFXBlendTime = 0.0000 thisSwitchCam.nodes[8].fNodeTimePostFXTimeOffset = 0.0000 thisSwitchCam.nodes[8].fNodeMotionBlur = 0.0000 thisSwitchCam.nodes[8].NodeCamShakeType = CAM_SHAKE_DEFAULT thisSwitchCam.nodes[8].fNodeCamShake = 0.2000 thisSwitchCam.nodes[8].iCamEaseType = 0 thisSwitchCam.nodes[8].fCamEaseScaler = 0.0000 thisSwitchCam.nodes[8].fCamNodeVelocityScale = 0.0000 thisSwitchCam.nodes[8].bCamEaseForceLinear = FALSE thisSwitchCam.nodes[8].bCamEaseForceLevel = FALSE thisSwitchCam.nodes[8].fTimeScale = 1.0000 thisSwitchCam.nodes[8].iTimeScaleEaseType = 0 thisSwitchCam.nodes[8].fTimeScaleEaseScaler = 0.0000 thisSwitchCam.nodes[8].bFlashEnabled = FALSE thisSwitchCam.nodes[8].SCFE_FlashEffectUsed = SCFE_CODE_FLASH thisSwitchCam.nodes[8].fMinExposure = 0.0000 thisSwitchCam.nodes[8].fMaxExposure = 0.0000 thisSwitchCam.nodes[8].iRampUpDuration = 0 thisSwitchCam.nodes[8].iRampDownDuration = 0 thisSwitchCam.nodes[8].iHoldDuration = 0 thisSwitchCam.nodes[8].fFlashNodePhaseOffset = 0.0000 thisSwitchCam.nodes[8].bIsLowDetailNode = FALSE thisSwitchCam.nodes[8].bUseCustomDOF = FALSE thisSwitchCam.nodes[8].NodeDOF_Info.fDOF_NearDOF = 0.0000 thisSwitchCam.nodes[8].NodeDOF_Info.fDOF_FarDOF = 0.0000 thisSwitchCam.nodes[8].NodeDOF_Info.fDOF_EffectStrength = 0.0000 thisSwitchCam.nodes[9].SwitchCamType = SWITCH_CAM_OLD_SYSTEM thisSwitchCam.nodes[9].iForceCamPointAtEntityIndex = -1 thisSwitchCam.nodes[9].bIsGameplayCamCopy = TRUE thisSwitchCam.nodes[9].iNodeTime = 1000 thisSwitchCam.nodes[9].vNodePos = <<-3.3166, -22.2314, -0.3705>> thisSwitchCam.nodes[9].vWorldPosLookAt = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[9].fNodeOffsetDist = 0.0000 thisSwitchCam.nodes[9].fNodeVerticleOffset = 0.0000 thisSwitchCam.nodes[9].bAttachToOriginPed = FALSE thisSwitchCam.nodes[9].vNodeDir = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[9].bPointAtEntity = TRUE thisSwitchCam.nodes[9].bPointAtOffsetIsRelative = TRUE thisSwitchCam.nodes[9].bAttachOffsetIsRelative = TRUE thisSwitchCam.nodes[9].fNodeFOV = 40.0000 thisSwitchCam.nodes[9].vClonedNodeOffset = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[9].iNodeToClone = 0 thisSwitchCam.nodes[9].NodeTimePostFX_Type = NO_EFFECT thisSwitchCam.nodes[9].fNodeTimePostFXBlendTime = 0.0000 thisSwitchCam.nodes[9].fNodeTimePostFXTimeOffset = 0.0000 thisSwitchCam.nodes[9].fNodeMotionBlur = 0.0000 thisSwitchCam.nodes[9].NodeCamShakeType = CAM_SHAKE_DEFAULT thisSwitchCam.nodes[9].fNodeCamShake = 0.2000 thisSwitchCam.nodes[9].iCamEaseType = 0 thisSwitchCam.nodes[9].fCamEaseScaler = 1.0000 thisSwitchCam.nodes[9].fCamNodeVelocityScale = 0.0000 thisSwitchCam.nodes[9].bCamEaseForceLinear = FALSE thisSwitchCam.nodes[9].bCamEaseForceLevel = FALSE thisSwitchCam.nodes[9].fTimeScale = 1.0000 thisSwitchCam.nodes[9].iTimeScaleEaseType = 0 thisSwitchCam.nodes[9].fTimeScaleEaseScaler = 0.0000 thisSwitchCam.nodes[9].bFlashEnabled = FALSE thisSwitchCam.nodes[9].SCFE_FlashEffectUsed = SCFE_CODE_FLASH thisSwitchCam.nodes[9].fMinExposure = 0.0000 thisSwitchCam.nodes[9].fMaxExposure = 0.0000 thisSwitchCam.nodes[9].iRampUpDuration = 0 thisSwitchCam.nodes[9].iRampDownDuration = 0 thisSwitchCam.nodes[9].iHoldDuration = 0 thisSwitchCam.nodes[9].fFlashNodePhaseOffset = 0.0000 thisSwitchCam.nodes[9].bIsLowDetailNode = FALSE thisSwitchCam.nodes[9].bUseCustomDOF = FALSE thisSwitchCam.nodes[9].NodeDOF_Info.fDOF_NearDOF = 0.0000 thisSwitchCam.nodes[9].NodeDOF_Info.fDOF_FarDOF = 0.0000 thisSwitchCam.nodes[9].NodeDOF_Info.fDOF_EffectStrength = 0.0000 thisSwitchCam.iNumNodes = 10 thisSwitchCam.iCamSwitchFocusNode = 3 thisSwitchCam.fSwitchSoundAudioStartPhase = -1.0//0.3000 thisSwitchCam.fSwitchSoundAudioEndPhase = -1.0//0.3500 thisSwitchCam.bSwitchSoundPlayOpeningPulse = TRUE thisSwitchCam.bSwitchSoundPlayMoveLoop = TRUE thisSwitchCam.bSwitchSoundPlayExitPulse = TRUE thisSwitchCam.bSplineNoSmoothing = FALSE thisSwitchCam.bAddGameplayCamAsLastNode = FALSE thisSwitchCam.iGameplayNodeBlendDuration = 0 //--- End of Cam Data --- thisSwitchCam.strOutputStructName = "thisSwitchCam" thisSwitchCam.strOutputFileName = "CameraInfo_FIB5_MichaelToTrevorInHeli.txt" thisSwitchCam.strXMLFileName = "CameraInfo_FIB5_MichaelToTrevorInHeli.xml" thisSwitchCam.bInitialized = TRUE ENDIF thisSwitchCam.piPeds[0] = piMichael thisSwitchCam.viVehicles[1] = viChopper ENDPROC proc HANDLE_SWITCH_CAM_TO_TREVOR_IN_HELI_cleanup(SWITCH_CAM_STRUCT &thisSwitchCam) IF NOT bSwitchCam_ControlReturnedEarly RENDER_SCRIPT_CAMS(FALSE, FALSE) IF DOES_CAM_EXIST(thisSwitchCam.ciSpline) SET_CAM_ACTIVE(thisSwitchCam.ciSpline, FALSE) DESTROY_CAM(thisSwitchCam.ciSpline) ENDIF ENDIF IF DOES_SWITCH_CAM_EXIST(thisSwitchCam) DESTROY_SWITCH_CAM(thisSwitchCam) ENDIF IF NOT bPlayerControlGiven SET_PLAYER_CONTROL(PLAYER_ID(), TRUE) DISPLAY_RADAR(TRUE) DISPLAY_HUD(TRUE) bPlayerControlGiven = TRUE ENDIF SETTIMERA(0) thisSwitchCam.bIsSplineCamFinishedPlaying = TRUE selector_cam.brun = FALSE SET_PLAYER_CONTROL(PLAYER_ID(), TRUE) CLEAR_PED_TASKS(PLAYER_PED_ID()) SET_GAME_PAUSES_FOR_STREAMING(TRUE) STREAMVOL_DELETE(sid_MichaelToTrevHeli_LowLODFrustrum) eSwitchCamState = SWITCH_CAM_IDLE CLEAR_FOCUS() if is_vehicle_driveable(helicopter.veh) SET_ENTITY_VELOCITY(helicopter.veh, (GET_ENTITY_VELOCITY(helicopter.veh)* 0.3)) //[MF] To smooth the helicopter as we transition to gameplay endif FREEZE_ENTITY_POSITION(MichaelPed, FALSE) REMOVE_ANIM_DICT("MISSFBI5IG_33") REMOVE_ANIM_DICT("missswitch") endproc /// PURPOSE: /// Handle the playback of the switch cam. The will setup, play, shut down and cleanup the switch cam spline /// PARAMS: /// thisSwitchCam - Switch camera to playback /// bReturnTrueOnce - If you only want this function to return TRUE once upon completion. Set to FALSE to have this function to return true every time this is called once the camera is finished playback. /// RETURNS: /// TRUE when camera is complete, FALSE if playback is still active, or if the camera has completed playback and bReturnTrueOnce is set to TRUE. FUNC BOOL HANDLE_SWITCH_CAM_TO_TREVOR_IN_HELI(SWITCH_CAM_STRUCT &thisSwitchCam, BOOL bReturnTrueOnce = TRUE) INT iCurrentNode SWITCH eSwitchCamState CASE SWITCH_CAM_IDLE CDEBUG3LN(DEBUG_MISSION, "eSwitchCamState = SWITCH_CAM_IDLE") BREAK CASE SWITCH_CAM_REQUEST_ASSETS add_ped_for_dialogue(scripted_speech, 2, null, "trevor")//trevor does not exist at this point. CDEBUG3LN(DEBUG_MISSION, "eSwitchCamState = SWITCH_CAM_REQUEST_ASSETS") IF NOT STREAMVOL_IS_VALID(sid_MichaelToTrevHeli_LowLODFrustrum) PRINTLN("Pre Requesting mountain geo for helicopter") sid_MichaelToTrevHeli_LowLODFrustrum = STREAMVOL_CREATE_FRUSTUM(vMikeToTrevHeli_StreamVolPos, vMikeToTrevHeli_StreamVolDir, fMikeToTrevHeli_StreamVolDist, FLAG_MAPDATA, STREAMVOL_LOD_FLAG_LOW) ENDIF // PREFETCH_SRL("fib5_mike_to_frank") // SET_SRL_LONG_JUMP_MODE(TRUE) // SET_SRL_FORCE_PRESTREAM(SRL_PRESTREAM_FORCE_ON) REQUEST_ANIM_DICT("MISSFBI5IG_33") REQUEST_ANIM_DICT("missswitch") BREAK CASE SWITCH_CAM_SETUP_SPLINE_1 CDEBUG3LN(DEBUG_MISSION, "eSwitchCamState = SWITCH_CAM_SETUP_SPLINE_1") REQUEST_MODEL(helicopter.model) REQUEST_MODEL(model_trevor) request_model(flare[0].model) request_vehicle_recording(007, "lkfbi5a") REQUEST_ANIM_DICT("MISSFBI5IG_33") REQUEST_ANIM_DICT("missswitch") request_ptfx_asset() MichaelPed = PLAYER_PED_ID() DISPLAY_RADAR(FALSE) DISPLAY_HUD(FALSE) // PREFETCH_SRL("fib5_mike_to_frank") if has_model_loaded(helicopter.model) and has_model_loaded(model_trevor) and has_model_loaded(flare[0].model) and has_vehicle_recording_been_loaded(007, "lkfbi5a") and HAS_ANIM_DICT_LOADED("MISSFBI5IG_33") AND HAS_ANIM_DICT_LOADED("missswitch") and HAS_PTFX_ASSET_LOADED() // and IS_SRL_LOADED() //[MF] Creating Helicopter for switch cam. IF NOT DOES_ENTITY_EXIST(helicopter.veh) helicopter.veh = CREATE_VEHICLE(helicopter.model, get_position_of_vehicle_recording_at_time(007, 100, "lkfbi5a"), 301.8604) START_PLAYBACK_RECORDED_VEHICLE(helicopter.veh, 007, "lkfbi5a") ENDIF IF IS_PLAYBACK_GOING_ON_FOR_VEHICLE(helicopter.veh) skip_time_in_playback_recorded_vehicle(helicopter.veh, fMichealToTrevor_HeliRecStartTime_P1) SET_PLAYBACK_SPEED(helicopter.veh, 0.1) WAIT(0)//[MF] To fix helicopter popping on screen ENDIF SETUP_SPLINE_CAM_NODE_ARRAY_TREVOR_IN_HELI(thisSwitchCam, MichaelPed, helicopter.veh) DESTROY_ALL_CAMS() CREATE_SPLINE_CAM(thisSwitchCam) SET_CAM_ACTIVE(thisSwitchCam.ciSpline, TRUE) RENDER_SCRIPT_CAMS(TRUE, FALSE) SETTIMERB(0) SET_PLAYER_CONTROL(PLAYER_ID(), FALSE) SET_GAME_PAUSES_FOR_STREAMING(FALSE) selector_cam.bPedSwitched = FALSE bPlayerControlGiven = FALSE selector_cam.bOKToSwitchPed = TRUE bMichaelToTrevor_Rec_P2_Started = FALSE bSwitchCam_ControlReturnedEarly = FALSE bMikeToTrevor_MikeLinePlayed = FALSE bMikeToTrevor_TrevorLinePlayed = FALSE SET_ENTITY_COORDS_NO_OFFSET(MichaelPed, vMichaelToTrevor_MikeStartPos) SET_ENTITY_HEADING(MichaelPed, fMichaelToTrevor_MikeStarHeading) TASK_PLAY_ANIM(MichaelPed, "MISSFBI5IG_33", "mid_mission_switch_separate_player0", INSTANT_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_HOLD_LAST_FRAME) FORCE_PED_AI_AND_ANIMATION_UPDATE(MichaelPed) eSwitchCamState = SWITCH_CAM_PLAYING_SPLINE_1 // SET_SRL_READAHEAD_TIMES(6, 6, 6, 6) // BEGIN_SRL() // fSRLTime = 0 // SET_SRL_TIME(fSRLTime) ENDIF BREAK CASE SWITCH_CAM_PLAYING_SPLINE_1 CDEBUG3LN(DEBUG_MISSION, "eSwitchCamState = SWITCH_CAM_PLAYING_SPLINE_1") CDEBUG3LN(DEBUG_MISSION, GET_CAM_SPLINE_PHASE(thisSwitchCam.ciSpline)) iCurrentNode = UPDATE_SPLINE_CAM(thisSwitchCam) float switch_cam_phase switch_cam_phase = GET_CAM_SPLINE_PHASE(thisSwitchCam.ciSpline) #if is_debug_build printstring("switch_cam_phase = ") printfloat(switch_cam_phase) printnl() #endif SET_FOCUS_POS_AND_VEL(GET_FINAL_RENDERED_CAM_COORD(), (<<0.0, 0.0, 0.0>>)) IF NOT STREAMVOL_IS_VALID(sid_MichaelToTrevHeli_LowLODFrustrum) PRINTLN("Requesting mountain geo for helicopter") sid_MichaelToTrevHeli_LowLODFrustrum = STREAMVOL_CREATE_FRUSTUM(vMikeToTrevHeli_StreamVolPos, vMikeToTrevHeli_StreamVolDir, fMikeToTrevHeli_StreamVolDist, FLAG_MAPDATA) ENDIF IF IS_CAM_ACTIVE(thisSwitchCam.ciSpline) IF iCurrentNode >= thisSwitchCam.iCamSwitchFocusNode SET_GAMEPLAY_CAM_RELATIVE_HEADING(fGameplayCamHeadingToTrevorInHeli) SET_GAMEPLAY_CAM_RELATIVE_PITCH(fGameplayCamPitchToTrevorInHeli) ENDIF IF NOT bMikeToTrevor_MikeLinePlayed IF GET_CAM_SPLINE_PHASE(thisSwitchCam.ciSpline) >= fMikeToTrevor_MikeLineStartPhase ADD_PED_FOR_DIALOGUE(scripted_speech, 0, player_ped_id(), "michael") add_ped_for_dialogue(scripted_speech, 2, selector_ped.pedID[SELECTOR_PED_TREVOR], "trevor") IF PLAY_SINGLE_LINE_FROM_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_switch", "fbi5a_switch_3", CONV_PRIORITY_HIGH) PRINTLN("Playing Mike Switch Cam Dialogue") collect_crate_dialogue_system_status = 1 bMikeToTrevor_MikeLinePlayed = TRUE ENDIF ENDIF ENDIF IF NOT bMikeToTrevor_TrevorLinePlayed IF GET_CAM_SPLINE_PHASE(thisSwitchCam.ciSpline) >= fMikeToTrevor_TrevorLineStartPhase ADD_PED_FOR_DIALOGUE(scripted_speech, 0, selector_ped.pedID[SELECTOR_PED_MICHAEL], "michael") add_ped_for_dialogue(scripted_speech, 2, player_ped_id(), "trevor") IF CREATE_CONVERSATION_FROM_SPECIFIC_LINE(scripted_speech, "fbi5aAU", "fbi5a_switch", "fbi5a_switch_5", CONV_PRIORITY_HIGH) PRINTLN("Playing Trevor Switch Cam Dialogue") collect_crate_dialogue_system_status = 1 bMikeToTrevor_TrevorLinePlayed = TRUE ENDIF ENDIF ENDIF //[MF] Overriding the LOD scale when we're moving to the chopper so we reduce the memory load so art can stream in properly IF fMikeToTrevHeli_LOD_Level > 0 OVERRIDE_LODSCALE_THIS_FRAME(fMikeToTrevHeli_LOD_Level) ENDIF IF iCurrentNode >= iSwitchCamMikeToTrev_WarpHeliNodeOffset IF IS_PLAYBACK_GOING_ON_FOR_VEHICLE(helicopter.veh) STOP_PLAYBACK_RECORDED_VEHICLE(helicopter.veh) SET_ENTITY_COORDS(helicopter.veh, vMichaelToTrevor_HeliTeleportPos, TRUE, TRUE) SET_ENTITY_ROTATION(helicopter.veh, <<0.0, 0.0, -63.5>>) ENDIF ENDIF IF NOT bMichaelToTrevor_Rec_P2_Started IF selector_cam.bPedSwitched TASK_HELI_MISSION(PLAYER_PED_ID(), helicopter.veh, NULL, NULL, vMichaelToTrevor_HeliEndDestination, MISSION_GOTO, fMichaelToTrevor_HeliEndSpeed, 3.0, -1, 20, -1) TASK_PLAY_ANIM(PLAYER_PED_ID(), "missswitch", "mid_mission_inside_helicopter_trevor", DEFAULT, DEFAULT, DEFAULT, AF_SECONDARY) FREEZE_ENTITY_POSITION(MichaelPed, TRUE) SET_ENTITY_VELOCITY(helicopter.veh, <<7.895117, 4.266795, 1.696478>>) //[MF] Helicopters velocity during AI mission. This removes some rocking behavior observed on closeup of Trevor. bMichaelToTrevor_Rec_P2_Started = TRUE ENDIF ENDIF //sound fx for switches if not trevor_in_heli_hit_out_0 if switch_cam_phase >= 0.286 PLAY_SOUND_FRONTEND(-1, "Hit_Out", "PLAYER_SWITCH_CUSTOM_SOUNDSET") switch_sound_time = get_game_timer() trevor_in_heli_hit_out_0 = true endif else if not trevor_in_heli_transition_0 if lk_timer(switch_sound_time, 200) PLAY_SOUND_FRONTEND(woosh_sound_id, "Short_Transition_In", "PLAYER_SWITCH_CUSTOM_SOUNDSET") trevor_in_heli_transition_0 = true endif endif endif // if get_cam_view_mode_for_context(cam_view_mode_context_in_vehicle) = cam_view_mode_first_person // printstring("cam_view_mode_first_person") // printnl() // else // printstring("NOT cam_view_mode_first_person") // printnl() // endif // cam_view_mode // printstring("cam view mode context = ") // printint(enum_to_int(get_cam_view_mode_for_context(cam_view_mode_context_in_vehicle))) // printnl() //GET_CAM_ACTIVE_VIEW_MODE_CONTEXT() if get_cam_view_mode_for_context(CAM_VIEW_MODE_CONTEXT_IN_HELI) = cam_view_mode_first_person IF GET_CAM_SPLINE_PHASE(thisSwitchCam.ciSpline) >= 0.80//0.9 FILL_PUSH_IN_DATA(push_in_camera, helicopter.veh, char_trevor, 0.75, push_in_interp_time, push_in_cut_time, push_in_postfx_time, push_in_speed_up_time)//, 400, 0.5)//, 200, push_in_speed_up_proportion) SET_PUSH_IN_DIRECTION_MODIFIER(push_in_camera, <<10, 0.0, 0.0>>) HANDLE_PUSH_IN(push_in_camera, true, true, true, false, false) eSwitchCamState = SWITCH_CAM_RETURN_TO_GAMEPLAY endif else //[MF] Once cam is at the end, reset the gameplay cam positon and advance to next state. IF GET_CAM_SPLINE_PHASE(thisSwitchCam.ciSpline) >= 1.00 CDEBUG3LN(DEBUG_MISSION, "eSwitchCamState = SWITCH_CAM_RETURN_TO_GAMEPLAY") SET_GAMEPLAY_CAM_RELATIVE_HEADING(fGameplayCamHeadingToTrevorInHeli) SET_GAMEPLAY_CAM_RELATIVE_PITCH(fGameplayCamPitchToTrevorInHeli) RENDER_SCRIPT_CAMS(FALSE, FALSE) eSwitchCamState = SWITCH_CAM_RETURN_TO_GAMEPLAY ENDIF endif ENDIF BREAK CASE SWITCH_CAM_RETURN_TO_GAMEPLAY SET_TIME_SCALE(1.0) if get_cam_view_mode_for_context(CAM_VIEW_MODE_CONTEXT_IN_HELI) = cam_view_mode_first_person if HANDLE_PUSH_IN(push_in_camera, true, true, true, false, false) HANDLE_SWITCH_CAM_TO_TREVOR_IN_HELI_cleanup(thisSwitchCam) RETURN TRUE endif else HANDLE_SWITCH_CAM_TO_TREVOR_IN_HELI_cleanup(thisSwitchCam) return true endif BREAK ENDSWITCH IF bReturnTrueOnce RETURN FALSE ELSE RETURN thisSwitchCam.bIsSplineCamFinishedPlaying ENDIF ENDFUNC PROC SETUP_SPLINE_CAM_NODE_ARRAY_MIKE_TO_TREV_AND_PAT_INTRO(SWITCH_CAM_STRUCT &thisSwitchCam, PED_INDEX &piSwitchMike) CDEBUG3LN(DEBUG_MISSION, "SETUP_SPLINE_CAM_NODE_ARRAY_MIKE_TO_TREV_AND_PAT_INTRO") IF NOT thisSwitchCam.bInitialized //--- Start of Cam Data --- thisSwitchCam.nodes[0].SwitchCamType = SWITCH_CAM_WORLD_POS thisSwitchCam.nodes[0].iForceCamPointAtEntityIndex = -1 thisSwitchCam.nodes[0].bIsGameplayCamCopy = FALSE thisSwitchCam.nodes[0].iNodeTime = 0 thisSwitchCam.nodes[0].vNodePos = <<1734.592529,3299.893311,89.064713>>//<<1734.330444,3296.325439,41.530323>> thisSwitchCam.nodes[0].vWorldPosLookAt = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[0].fNodeOffsetDist = 0.0000 thisSwitchCam.nodes[0].fNodeVerticleOffset = 0.0000 thisSwitchCam.nodes[0].bAttachToOriginPed = FALSE thisSwitchCam.nodes[0].vNodeDir = <<-89.501099,-0.000000,172.649887>>//<<-2.167928,-0.000759,-1.912953>> thisSwitchCam.nodes[0].bPointAtEntity = FALSE thisSwitchCam.nodes[0].bPointAtOffsetIsRelative = FALSE thisSwitchCam.nodes[0].bAttachOffsetIsRelative = FALSE thisSwitchCam.nodes[0].fNodeFOV = 40.5//32.000000 thisSwitchCam.nodes[0].vClonedNodeOffset = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[0].iNodeToClone = 0 thisSwitchCam.nodes[0].NodeTimePostFX_Type = NO_EFFECT thisSwitchCam.nodes[0].fNodeTimePostFXBlendTime = 0.0000 thisSwitchCam.nodes[0].fNodeTimePostFXTimeOffset = 0.0000 thisSwitchCam.nodes[0].fNodeMotionBlur = 0.0000 thisSwitchCam.nodes[0].NodeCamShakeType = CAM_SHAKE_DEFAULT thisSwitchCam.nodes[0].fNodeCamShake = 0.0000 thisSwitchCam.nodes[0].iCamEaseType = 0 thisSwitchCam.nodes[0].fCamEaseScaler = 0.0000 thisSwitchCam.nodes[0].fCamNodeVelocityScale = 0.0000 thisSwitchCam.nodes[0].bCamEaseForceLinear = FALSE thisSwitchCam.nodes[0].bCamEaseForceLevel = FALSE thisSwitchCam.nodes[0].fTimeScale = 1.0000 thisSwitchCam.nodes[0].iTimeScaleEaseType = 0 thisSwitchCam.nodes[0].fTimeScaleEaseScaler = 0.0000 thisSwitchCam.nodes[0].bFlashEnabled = FALSE thisSwitchCam.nodes[0].SCFE_FlashEffectUsed = SCFE_CODE_FLASH thisSwitchCam.nodes[0].fMinExposure = 0.0000 thisSwitchCam.nodes[0].fMaxExposure = 0.0000 thisSwitchCam.nodes[0].iRampUpDuration = 0 thisSwitchCam.nodes[0].iRampDownDuration = 0 thisSwitchCam.nodes[0].iHoldDuration = 0 thisSwitchCam.nodes[0].fFlashNodePhaseOffset = 0.0000 thisSwitchCam.nodes[0].bIsLowDetailNode = FALSE thisSwitchCam.nodes[0].bUseCustomDOF = FALSE thisSwitchCam.nodes[0].NodeDOF_Info.fDOF_NearDOF = 0.0000 thisSwitchCam.nodes[0].NodeDOF_Info.fDOF_FarDOF = 0.0000 thisSwitchCam.nodes[0].NodeDOF_Info.fDOF_EffectStrength = 0.0000 thisSwitchCam.nodes[1].SwitchCamType = SWITCH_CAM_WORLD_POS thisSwitchCam.nodes[1].iForceCamPointAtEntityIndex = -1 thisSwitchCam.nodes[1].bIsGameplayCamCopy = FALSE thisSwitchCam.nodes[1].iNodeTime = 50 //50 100 1500 thisSwitchCam.nodes[1].vNodePos = <<1734.592529,3299.893311,89.064713>>//<<1734.330444,3296.325439,41.530323>> thisSwitchCam.nodes[1].vWorldPosLookAt = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[1].fNodeOffsetDist = 0.0000 thisSwitchCam.nodes[1].fNodeVerticleOffset = 0.0000 thisSwitchCam.nodes[1].bAttachToOriginPed = FALSE thisSwitchCam.nodes[1].vNodeDir = <<-89.501099,-0.000000,172.649887>>//<<-2.167928,-0.000759,-1.912953>> thisSwitchCam.nodes[1].bPointAtEntity = FALSE thisSwitchCam.nodes[1].bPointAtOffsetIsRelative = FALSE thisSwitchCam.nodes[1].bAttachOffsetIsRelative = FALSE thisSwitchCam.nodes[1].fNodeFOV = 40.5//32.00 thisSwitchCam.nodes[1].vClonedNodeOffset = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[1].iNodeToClone = 0 thisSwitchCam.nodes[1].NodeTimePostFX_Type = NO_EFFECT thisSwitchCam.nodes[1].fNodeTimePostFXBlendTime = 2.0000 thisSwitchCam.nodes[1].fNodeTimePostFXTimeOffset = 0.0000 thisSwitchCam.nodes[1].fNodeMotionBlur = 0.1000 thisSwitchCam.nodes[1].NodeCamShakeType = CAM_SHAKE_DEFAULT thisSwitchCam.nodes[1].fNodeCamShake = 0.0000 thisSwitchCam.nodes[1].iCamEaseType = 0 thisSwitchCam.nodes[1].fCamEaseScaler = 0.0000 thisSwitchCam.nodes[1].fCamNodeVelocityScale = -0.1520 thisSwitchCam.nodes[1].bCamEaseForceLinear = FALSE thisSwitchCam.nodes[1].bCamEaseForceLevel = FALSE thisSwitchCam.nodes[1].fTimeScale = 1.0000 thisSwitchCam.nodes[1].iTimeScaleEaseType = 0 thisSwitchCam.nodes[1].fTimeScaleEaseScaler = 0.0000 thisSwitchCam.nodes[1].bFlashEnabled = FALSE thisSwitchCam.nodes[1].SCFE_FlashEffectUsed = SCFE_CODE_FLASH thisSwitchCam.nodes[1].fMinExposure = 0.0000 thisSwitchCam.nodes[1].fMaxExposure = 0.0000 thisSwitchCam.nodes[1].iRampUpDuration = 0 thisSwitchCam.nodes[1].iRampDownDuration = 0 thisSwitchCam.nodes[1].iHoldDuration = 0 thisSwitchCam.nodes[1].fFlashNodePhaseOffset = 0.0000 thisSwitchCam.nodes[1].bIsLowDetailNode = FALSE thisSwitchCam.nodes[1].bUseCustomDOF = FALSE thisSwitchCam.nodes[1].NodeDOF_Info.fDOF_NearDOF = 0.0000 thisSwitchCam.nodes[1].NodeDOF_Info.fDOF_FarDOF = 0.0000 thisSwitchCam.nodes[1].NodeDOF_Info.fDOF_EffectStrength = 0.0000 thisSwitchCam.iNumNodes = 2 //4 thisSwitchCam.iCamSwitchFocusNode = 0 thisSwitchCam.fSwitchSoundAudioStartPhase = 0.0000 thisSwitchCam.fSwitchSoundAudioEndPhase = 0.9000 thisSwitchCam.bSwitchSoundPlayOpeningPulse = TRUE thisSwitchCam.bSwitchSoundPlayMoveLoop = FALSE thisSwitchCam.bSwitchSoundPlayExitPulse = FALSE thisSwitchCam.bSplineNoSmoothing = TRUE thisSwitchCam.bAddGameplayCamAsLastNode = FALSE thisSwitchCam.iGameplayNodeBlendDuration = 0 //--- End of Cam Data --- thisSwitchCam.strOutputStructName = "thisSwitchCam" thisSwitchCam.strOutputFileName = "CameraInfo_FIB5_MikeToTrevAndPat_intro.txt" thisSwitchCam.strXMLFileName = "CameraInfo_FIB5_MikeToTrevAndPat_intro.xml" thisSwitchCam.bInitialized = TRUE ENDIF thisSwitchCam.piPeds[0] = piSwitchMike ENDPROC PROC SETUP_SPLINE_CAM_NODE_ARRAY_MIKE_TO_TREV_AND_PAT_OUTRO(SWITCH_CAM_STRUCT &thisSwitchCam, VEHICLE_INDEX &viTrevTruck) CDEBUG3LN(DEBUG_MISSION, "SETUP_SPLINE_CAM_NODE_ARRAY_MIKE_TO_TREV_AND_PAT_OUTRO") IF NOT thisSwitchCam.bInitialized //if get_cam_view_mode_for_context(cam_view_mode_context_in_vehicle) = cam_view_mode_first_person thisSwitchCam.nodes[0].SwitchCamType = SWITCH_CAM_OLD_SYSTEM thisSwitchCam.nodes[0].iForceCamPointAtEntityIndex = -1 thisSwitchCam.nodes[0].bIsGameplayCamCopy = FALSE thisSwitchCam.nodes[0].iNodeTime = 0//1500 thisSwitchCam.nodes[0].vNodePos = <<-1.0331, 1.8431, 0.6208>> thisSwitchCam.nodes[0].vWorldPosLookAt = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[0].fNodeOffsetDist = 0.0000 thisSwitchCam.nodes[0].fNodeVerticleOffset = 0.0000 thisSwitchCam.nodes[0].bAttachToOriginPed = FALSE thisSwitchCam.nodes[0].vNodeDir = <<0.6586, -0.6345, 0.6419>> thisSwitchCam.nodes[0].bPointAtEntity = TRUE thisSwitchCam.nodes[0].bPointAtOffsetIsRelative = TRUE thisSwitchCam.nodes[0].bAttachOffsetIsRelative = TRUE thisSwitchCam.nodes[0].fNodeFOV = 50.0000 thisSwitchCam.nodes[0].NodeTimePostFX_Type = NO_EFFECT thisSwitchCam.nodes[0].fNodeTimePostFXBlendTime = 0.0000 thisSwitchCam.nodes[0].fNodeTimePostFXTimeOffset = 0.0000 thisSwitchCam.nodes[0].fNodeMotionBlur = 0.0000 thisSwitchCam.nodes[0].NodeCamShakeType = CAM_SHAKE_DEFAULT thisSwitchCam.nodes[0].fNodeCamShake = 0.0000 thisSwitchCam.nodes[0].iCamEaseType = 0 thisSwitchCam.nodes[0].fCamEaseScaler = 0.0000 thisSwitchCam.nodes[0].fCamNodeVelocityScale = 0.0000 thisSwitchCam.nodes[0].bCamEaseForceLinear = FALSE thisSwitchCam.nodes[0].bCamEaseForceLevel = FALSE thisSwitchCam.nodes[0].fTimeScale = 1.0000 thisSwitchCam.nodes[0].iTimeScaleEaseType = 0 thisSwitchCam.nodes[0].fTimeScaleEaseScaler = 0.0000 thisSwitchCam.nodes[0].bFlashEnabled = FALSE thisSwitchCam.nodes[0].SCFE_FlashEffectUsed = SCFE_CODE_FLASH thisSwitchCam.nodes[0].fMinExposure = 0.0000 thisSwitchCam.nodes[0].fMaxExposure = 0.0000 thisSwitchCam.nodes[0].iRampUpDuration = 0 thisSwitchCam.nodes[0].iRampDownDuration = 0 thisSwitchCam.nodes[0].iHoldDuration = 0 thisSwitchCam.nodes[0].fFlashNodePhaseOffset = 0.0000 thisSwitchCam.nodes[0].bIsLowDetailNode = FALSE thisSwitchCam.nodes[0].bUseCustomDOF = FALSE thisSwitchCam.nodes[0].NodeDOF_Info.fDOF_NearDOF = 0.0000 thisSwitchCam.nodes[0].NodeDOF_Info.fDOF_FarDOF = 0.0000 thisSwitchCam.nodes[0].NodeDOF_Info.fDOF_EffectStrength = 0.0000 thisSwitchCam.nodes[1].SwitchCamType = SWITCH_CAM_OLD_SYSTEM thisSwitchCam.nodes[1].iForceCamPointAtEntityIndex = -1 thisSwitchCam.nodes[1].bIsGameplayCamCopy = FALSE thisSwitchCam.nodes[1].iNodeTime = 3500 thisSwitchCam.nodes[1].vNodePos = <<-0.7088, 1.7689, 0.6181>> thisSwitchCam.nodes[1].vWorldPosLookAt = <<0.0000, 0.0000, 0.0000>> thisSwitchCam.nodes[1].fNodeOffsetDist = 0.0000 thisSwitchCam.nodes[1].fNodeVerticleOffset = 0.0000 thisSwitchCam.nodes[1].bAttachToOriginPed = FALSE thisSwitchCam.nodes[1].vNodeDir = <<0.6635, -0.8934, 0.7898>> thisSwitchCam.nodes[1].bPointAtEntity = TRUE thisSwitchCam.nodes[1].bPointAtOffsetIsRelative = TRUE thisSwitchCam.nodes[1].bAttachOffsetIsRelative = TRUE thisSwitchCam.nodes[1].fNodeFOV = 50.0000 thisSwitchCam.nodes[1].NodeTimePostFX_Type = NO_EFFECT thisSwitchCam.nodes[1].fNodeTimePostFXBlendTime = 0.0000 thisSwitchCam.nodes[1].fNodeTimePostFXTimeOffset = 0.0000 thisSwitchCam.nodes[1].fNodeMotionBlur = 0.2000 thisSwitchCam.nodes[1].NodeCamShakeType = CAM_SHAKE_DEFAULT thisSwitchCam.nodes[1].fNodeCamShake = 0.0000 thisSwitchCam.nodes[1].iCamEaseType = 0 thisSwitchCam.nodes[1].fCamEaseScaler = 0.0000 thisSwitchCam.nodes[1].fCamNodeVelocityScale = -0.6520 thisSwitchCam.nodes[1].bCamEaseForceLinear = FALSE thisSwitchCam.nodes[1].bCamEaseForceLevel = FALSE thisSwitchCam.nodes[1].fTimeScale = 1.0000 thisSwitchCam.nodes[1].iTimeScaleEaseType = 0 thisSwitchCam.nodes[1].fTimeScaleEaseScaler = 0.0000 thisSwitchCam.nodes[1].bFlashEnabled = FALSE thisSwitchCam.nodes[1].SCFE_FlashEffectUsed = SCFE_CODE_FLASH thisSwitchCam.nodes[1].fMinExposure = 0.0000 thisSwitchCam.nodes[1].fMaxExposure = 0.0000 thisSwitchCam.nodes[1].iRampUpDuration = 0 thisSwitchCam.nodes[1].iRampDownDuration = 0 thisSwitchCam.nodes[1].iHoldDuration = 0 thisSwitchCam.nodes[1].fFlashNodePhaseOffset = 0.0000 thisSwitchCam.nodes[1].bIsLowDetailNode = FALSE thisSwitchCam.nodes[1].bUseCustomDOF = FALSE thisSwitchCam.nodes[1].NodeDOF_Info.fDOF_NearDOF = 0.0000 thisSwitchCam.nodes[1].NodeDOF_Info.fDOF_FarDOF = 0.0000 thisSwitchCam.nodes[1].NodeDOF_Info.fDOF_EffectStrength = 0.0000 thisSwitchCam.iNumNodes = 2 thisSwitchCam.iCamSwitchFocusNode = 0 thisSwitchCam.bSplineNoSmoothing = TRUE thisSwitchCam.bAddGameplayCamAsLastNode = FALSE thisSwitchCam.iGameplayNodeBlendDuration = 0 //endif //--- End of Cam Data --- thisSwitchCam.strOutputStructName = "thisSwitchCam" thisSwitchCam.strOutputFileName = "CameraInfo_FIB5_MikeToTrevAndPat_outro.txt" thisSwitchCam.strXMLFileName = "CameraInfo_FIB5_MikeToTrevAndPat_outro.xml" thisSwitchCam.bInitialized = TRUE ENDIF thisSwitchCam.viVehicles[0] = viTrevTruck ENDPROC FUNC BOOL PRELOAD_ASCENT_SHOT() CDEBUG3LN(DEBUG_MISSION, "PRELOAD_ASCENT_SHOT") RUN_SWITCH_CAM_FROM_PLAYER_TO_PED(selector_cam, DEFAULT, ENUM_TO_INT(SWITCH_FLAG_SKIP_INTRO | SWITCH_FLAG_PAUSE_BEFORE_ASCENT | SWITCH_FLAG_SKIP_OUTRO)) IF IS_SWITCH_READY_FOR_ASCENT() CDEBUG3LN(DEBUG_MISSION, "Ascent Shot Ready.") RETURN TRUE ENDIF CDEBUG3LN(DEBUG_MISSION, "Ascent Shot NOT READY!") RETURN FALSE ENDFUNC proc setup_entities_after_drop_off() int i remove_anim_dict("missfbi5ig_34") delete_ped(dave.ped) set_model_as_no_longer_needed(dave.model) delete_ped(selector_ped.pedID[selector_ped_franklin]) set_model_as_no_longer_needed(get_player_ped_model(char_franklin)) // if does_entity_exist(selector_ped.pedID[selector_ped_trevor]) // delete_ped(selector_ped.pedID[selector_ped_trevor]) // endif for i = 0 to count_of(rope_chopper) - 1 DELETE_ROPE(rope_chopper[i]) endfor delete_object(crate_door_left.obj) set_model_as_no_longer_needed(crate_door_left.model) delete_object(crate_door_right.obj) set_model_as_no_longer_needed(crate_door_right.model) delete_object(crate.obj) set_model_as_no_longer_needed(crate.model) delete_vehicle(helicopter.veh) set_model_as_no_longer_needed(helicopter.model) delete_vehicle(truck.veh) set_model_as_no_longer_needed(truck.model) delete_vehicle(trailer.veh) set_model_as_no_longer_needed(trailer.model) // if is_screen_faded_in() // end_cutscene_no_fade(false, FALSE, default, default, default, default, default, default, default, DeleteCams, false) // else // end_cutscene() // endif endproc FUNC BOOL HANDLE_SWITCH_CAM_MIKE_TO_TREV_AND_PAT(SWITCH_CAM_STRUCT &thisSwitchCam1, SWITCH_CAM_STRUCT &thisSwitchCam2) SWITCH eSwitchCamState CASE SWITCH_CAM_IDLE CDEBUG3LN(DEBUG_MISSION, "eSwitchCamState = SWITCH_CAM_IDLE") BREAK CASE SWITCH_CAM_REQUEST_ASSETS CDEBUG3LN(DEBUG_MISSION, "eSwitchCamState = SWITCH_CAM_REQUEST_ASSETS") REQUEST_MODEL(FIB_5_MCS_10_LIGHTRIG) request_model(trevors_truck.model) request_model(patricia.model) REQUEST_CLIP_SET("clipset@missfbi5_trevor_driving") request_vehicle_recording(trevors_truck.recording_number, "lkfbi5a") BREAK CASE SWITCH_CAM_SETUP_SPLINE_1 CDEBUG3LN(DEBUG_MISSION, "eSwitchCamState = SWITCH_CAM_SETUP_SPLINE1") MichaelPed = PLAYER_PED_ID() SETUP_SPLINE_CAM_NODE_ARRAY_MIKE_TO_TREV_AND_PAT_INTRO(thisSwitchCam1, MichaelPed) DESTROY_ALL_CAMS() CREATE_SPLINE_CAM(thisSwitchCam1) SET_PLAYER_CONTROL(PLAYER_ID(), FALSE) bPlayerControlGiven = FALSE bMikeToTrevAndPat_StartedCodeCamRecording = FALSE bMikeToTrevAndPat_OpeningFlashPlayed = FALSE IF NOT DOES_ENTITY_EXIST(oiMichaelSwitchCamLightRig) //oiMichaelSwitchCamLightRig = CREATE_OBJECT(FIB_5_MCS_10_LIGHTRIG, (<<1733.74219, 3297.11157, 0.0>>)) printstring("oiMichaelSwitchCamLightRig does not exist") printnl() else printstring("oiMichaelSwitchCamLightRig DOES exist") printnl() ENDIF ANIMPOSTFX_STOP_AND_FLUSH_REQUESTS("SwitchOpenMichaelIn") ANIMPOSTFX_PLAY("SwitchOpenNeutralFIB5", 0, false) ANIMPOSTFX_PLAY("SwitchOpenMichaelMid", 0, false) SET_CAM_ACTIVE(thisSwitchCam1.ciSpline, TRUE) RENDER_SCRIPT_CAMS(TRUE, FALSE) DISPLAY_RADAR(FALSE) DISPLAY_HUD(FALSE) SETTIMERB(0) drop_off_patricia_dialogue_system_status = -1 //[MF] Disabling Patricia's Dialogue bMikeToTrevAndPat_TrevorsTruckInitialSetup = FALSE eSwitchCamState = SWITCH_CAM_PLAYING_SPLINE_1 FALLTHRU CASE SWITCH_CAM_PLAYING_SPLINE_1 CDEBUG3LN(DEBUG_MISSION, "eSwitchCamState = SWITCH_CAM_PLAYING_SPLINE_1") IF IS_CAM_ACTIVE(thisSwitchCam1.ciSpline) DISPLAY_RADAR(FALSE) DISPLAY_HUD(FALSE) UPDATE_SPLINE_CAM(thisSwitchCam1) IF NOT bMikeToTrevAndPat_OpeningFlashPlayed bMikeToTrevAndPat_OpeningFlashPlayed = TRUE ENDIF //[MF] Setup Trevor's truck in it's initial position for the code switch cam IF NOT bMikeToTrevAndPat_TrevorsTruckInitialSetup IF DOES_ENTITY_EXIST(trevors_truck.veh) IF IS_PLAYBACK_GOING_ON_FOR_VEHICLE(trevors_truck.veh) STOP_PLAYBACK_RECORDED_VEHICLE(trevors_truck.veh) ENDIF IF NOT IS_PLAYBACK_GOING_ON_FOR_VEHICLE(trevors_truck.veh) start_playback_recorded_vehicle(trevors_truck.veh, trevors_truck.recording_number, "lkfbi5a") SKIP_TIME_IN_PLAYBACK_RECORDED_VEHICLE(trevors_truck.veh, 6500) force_playback_recorded_vehicle_update(trevors_truck.veh) set_playback_speed(trevors_truck.veh, 0.0) bMikeToTrevAndPat_TrevorsTruckInitialSetup = TRUE ENDIF ELSE PRINTLN("Trevor's truck does not exist yet...") ENDIF ENDIF IF GET_CAM_SPLINE_PHASE(thisSwitchCam1.ciSpline) >= 1.0 and not is_cutscene_active() printstring("spline phase 2 = ") printfloat(GET_CAM_SPLINE_PHASE(thisSwitchCam1.ciSpline)) printnl() eSwitchCamState = SWITCH_CAM_CODE_CAM ELSE RETURN FALSE ENDIF ENDIF BREAK CASE SWITCH_CAM_CODE_CAM CDEBUG3LN(DEBUG_MISSION, "eSwitchCamState = SWITCH_CAM_CODE_CAM") IF RUN_SWITCH_CAM_FROM_PLAYER_TO_PED(selector_cam, DEFAULT, ENUM_TO_INT(SWITCH_FLAG_SKIP_INTRO | SWITCH_FLAG_START_FROM_CAMPOS | SWITCH_FLAG_PAUSE_BEFORE_ASCENT | SWITCH_FLAG_SKIP_OUTRO)) ANIMPOSTFX_STOP_AND_FLUSH_REQUESTS("SwitchOpenMichaelIn") if (GET_PLAYER_SWITCH_STATE() < switch_state_jumpcut_ascent) ANIMPOSTFX_STOP_AND_FLUSH_REQUESTS("SwitchOpenNeutral") endif if not cleanup_airport_cutscene if (GET_PLAYER_SWITCH_STATE() >= SWITCH_STATE_JUMPCUT_DESCENT) or (not is_cutscene_active()) setup_entities_after_drop_off() #if is_debug_build printstring("delete cutscene entities") printnl() #endif cleanup_airport_cutscene = true endif endif IF GET_PLAYER_SWITCH_STATE() >= SWITCH_STATE_OUTRO_HOLD IF IS_PLAYBACK_GOING_ON_FOR_VEHICLE(trevors_truck.veh) STOP_PLAYBACK_RECORDED_VEHICLE(trevors_truck.veh) ENDIF IF NOT IS_PLAYBACK_GOING_ON_FOR_VEHICLE(trevors_truck.veh) IF NOT IS_ENTITY_DEAD(trevors_truck.veh) start_playback_recorded_vehicle(trevors_truck.veh, trevors_truck.recording_number, "lkfbi5a") SKIP_TIME_IN_PLAYBACK_RECORDED_VEHICLE(trevors_truck.veh, 6500) //[MF] Restore vehicle's speed for the exit of the switch set_playback_speed(trevors_truck.veh, 1.0) WAIT(0)//Allow one frame for Trevor's truck to reset it's position selector_cam.bSplineComplete = true RUN_SWITCH_CAM_FROM_PLAYER_TO_PED(selector_cam, DEFAULT, ENUM_TO_INT(SWITCH_FLAG_SKIP_INTRO | SWITCH_FLAG_PAUSE_BEFORE_ASCENT | SWITCH_FLAG_SKIP_OUTRO)) set_player_control(player_id(), false) eSwitchCamState = SWITCH_CAM_SETUP_SPLINE_2 ENDIF ENDIF ELSE ALLOW_PLAYER_SWITCH_ASCENT() CLEAR_AREA_OF_VEHICLES((<<217.5, 3269.8, 42.9>>), 230.0) IF NOT bMikeToTrevAndPat_StartedCodeCamRecording //[MF] Start Trevor's vehicle recording playback for the decent of the code cam. IF GET_PLAYER_SWITCH_STATE() = SWITCH_STATE_JUMPCUT_DESCENT IF IS_PLAYBACK_GOING_ON_FOR_VEHICLE(trevors_truck.veh) STOP_PLAYBACK_RECORDED_VEHICLE(trevors_truck.veh) ENDIF IF NOT IS_PLAYBACK_GOING_ON_FOR_VEHICLE(trevors_truck.veh) start_playback_recorded_vehicle(trevors_truck.veh, trevors_truck.recording_number, "lkfbi5a") set_playback_speed(trevors_truck.veh, 0.42) bMikeToTrevAndPat_StartedCodeCamRecording = TRUE ENDIF ENDIF ENDIF RETURN FALSE ENDIF ELSE RETURN FALSE ENDIF FALLTHRU CASE SWITCH_CAM_SETUP_SPLINE_2 CDEBUG3LN(DEBUG_MISSION, "eSwitchCamState = SWITCH_CAM_SETUP_SPLINE_2") SETUP_SPLINE_CAM_NODE_ARRAY_MIKE_TO_TREV_AND_PAT_OUTRO(thisSwitchCam2, trevors_truck.veh) CREATE_SPLINE_CAM(thisSwitchCam2) SET_SELECTOR_CAM_ACTIVE(FALSE) SET_CAM_ACTIVE(thisSwitchCam2.ciSpline, TRUE) RENDER_SCRIPT_CAMS(TRUE, FALSE) bMikeToTrevAndPat_MusicStarted = FALSE CLEAR_AREA_OF_VEHICLES((<<217.5, 3269.8, 42.9>>), 230.0) dialogue_time = get_game_timer() drop_off_patricia_dialogue_system_status = 0 SETTIMERB(0) DELETE_OBJECT(oiMichaelSwitchCamLightRig) SET_MODEL_AS_NO_LONGER_NEEDED(FIB_5_MCS_10_LIGHTRIG) eSwitchCamState = SWITCH_CAM_PLAYING_SPLINE_2 FALLTHRU CASE SWITCH_CAM_PLAYING_SPLINE_2 CDEBUG3LN(DEBUG_MISSION, "eSwitchCamState = SWITCH_CAM_PLAYING_SPLINE_2") UPDATE_SPLINE_CAM(thisSwitchCam2) CLEAR_AREA_OF_VEHICLES((<<217.5, 3269.8, 42.9>>), 230.0) SET_GAMEPLAY_CAM_RELATIVE_HEADING(fGameplayCamHeadingMikeToTrevAndPat) SET_GAMEPLAY_CAM_RELATIVE_PITCH(fGameplayCamPitchMikeToTrevAndPat) IF NOT bMikeToTrevAndPat_MusicStarted IF GET_CAM_SPLINE_NODE_PHASE(thisSwitchCam2.ciSpline) > fMikeToTrevAndPat_MusicStartPhase trigger_music_event("FBI5A_TREV_RADIO_FRTA") bMikeToTrevAndPat_MusicStarted = TRUE ENDIF ENDIF #if is_debug_build float cam_phase cam_phase = GET_CAM_SPLINE_PHASE(thisSwitchCam2.ciSpline) printstring("cam_phase = ") printfloat(cam_phase) printnl() #endif IF IS_CAM_ACTIVE(thisSwitchCam2.ciSpline) IF GET_CAM_SPLINE_PHASE(thisSwitchCam2.ciSpline) >= 1.00 if get_cam_view_mode_for_context(cam_view_mode_context_in_vehicle) = cam_view_mode_first_person FILL_PUSH_IN_DATA(push_in_camera, trevors_truck.veh, char_trevor, 0.75, push_in_interp_time, push_in_cut_time, push_in_postfx_time, push_in_speed_up_time) SET_PUSH_IN_DIRECTION_MODIFIER(push_in_camera, <<0.0, 0.0, -18.0>>) HANDLE_PUSH_IN(push_in_camera, true, true, true, false, false) endif SET_TIME_SCALE(1.0) eSwitchCamState = SWITCH_CAM_RETURN_TO_GAMEPLAY ENDIF ENDIF BREAK CASE SWITCH_CAM_RETURN_TO_GAMEPLAY if get_cam_view_mode_for_context(cam_view_mode_context_in_vehicle) = cam_view_mode_first_person if HANDLE_PUSH_IN(push_in_camera, true, true, true, false, false) SET_GAMEPLAY_CAM_RELATIVE_HEADING(fGameplayCamHeadingMikeToTrevAndPat) SET_GAMEPLAY_CAM_RELATIVE_PITCH(fGameplayCamPitchMikeToTrevAndPat) RENDER_SCRIPT_CAMS(FALSE, FALSE) SET_CAM_ACTIVE(thisSwitchCam2.ciSpline, FALSE) IF DOES_SWITCH_CAM_EXIST(scsSwitchCamMikeToTrevPatricia_Intro) DESTROY_SWITCH_CAM(scsSwitchCamMikeToTrevPatricia_Intro) ENDIF IF DOES_SWITCH_CAM_EXIST(scsSwitchCamMikeToTrevPatricia_Outro) DESTROY_SWITCH_CAM(scsSwitchCamMikeToTrevPatricia_Outro) ENDIF IF NOT bPlayerControlGiven SET_PLAYER_CONTROL(PLAYER_ID(), TRUE) DISPLAY_RADAR(TRUE) DISPLAY_HUD(TRUE) bPlayerControlGiven = TRUE ENDIF SETTIMERA(0) eSwitchCamState = SWITCH_CAM_IDLE RETURN TRUE endif else SET_GAMEPLAY_CAM_RELATIVE_HEADING(fGameplayCamHeadingMikeToTrevAndPat) SET_GAMEPLAY_CAM_RELATIVE_PITCH(fGameplayCamPitchMikeToTrevAndPat) RENDER_SCRIPT_CAMS(FALSE, FALSE) SET_CAM_ACTIVE(thisSwitchCam2.ciSpline, FALSE) IF DOES_SWITCH_CAM_EXIST(scsSwitchCamMikeToTrevPatricia_Intro) DESTROY_SWITCH_CAM(scsSwitchCamMikeToTrevPatricia_Intro) ENDIF IF DOES_SWITCH_CAM_EXIST(scsSwitchCamMikeToTrevPatricia_Outro) DESTROY_SWITCH_CAM(scsSwitchCamMikeToTrevPatricia_Outro) ENDIF IF NOT bPlayerControlGiven SET_PLAYER_CONTROL(PLAYER_ID(), TRUE) DISPLAY_RADAR(TRUE) DISPLAY_HUD(TRUE) bPlayerControlGiven = TRUE ENDIF SETTIMERA(0) eSwitchCamState = SWITCH_CAM_IDLE RETURN TRUE endif BREAK ENDSWITCH RETURN FALSE ENDFUNC //**********************************************PRIVATE FUNCTIONS************************************************ /// Test code for new welding: based on balance controls FLOAT f_weld_current_offset FLOAT f_weld_current_vel FLOAT f_weld_current_accel INT i_weld_force_change_timer PROC NEW_WELDING_TEST() CONST_FLOAT MAX_FORCE 60.0 CONST_FLOAT MAX_VEL 40.0 CONST_FLOAT MAX_OFFSET 50.0 CONST_FLOAT MAX_VEL_MULTIPLIER 3.0 IF i_weld_force_change_timer = 0 f_weld_current_accel = GET_RANDOM_FLOAT_IN_RANGE(-MAX_FORCE, MAX_FORCE) / 2.0 i_weld_force_change_timer = GET_GAME_TIMER() ELSE IF GET_GAME_TIMER() - i_weld_force_change_timer > 2000 i_weld_force_change_timer = 0 ENDIF ENDIF INT i_left_stick_x, i_left_stick_y, i_right_stick_x, i_right_stick_y GET_CONTROL_VALUE_OF_ANALOGUE_STICKS(i_left_stick_x, i_left_stick_y, i_right_stick_x, i_right_stick_y) FLOAT f_accel = (TO_FLOAT(i_left_stick_x) / 128.0) * MAX_FORCE FLOAT f_overall_accel = f_weld_current_accel + f_accel f_weld_current_vel = f_weld_current_vel +@ f_overall_accel IF f_weld_current_vel > MAX_VEL f_weld_current_vel = MAX_VEL ELIF f_weld_current_vel < -MAX_VEL f_weld_current_vel = -MAX_VEL ENDIF f_weld_current_offset = f_weld_current_offset +@ (f_weld_current_vel * (1.0 + (MAX_VEL_MULTIPLIER - (ABSF(f_weld_current_offset / MAX_OFFSET) * MAX_VEL_MULTIPLIER)))) IF f_weld_current_offset > MAX_OFFSET f_weld_current_offset = MAX_OFFSET f_weld_current_vel = 0.0 ELIF f_weld_current_offset < -MAX_OFFSET f_weld_current_offset = -MAX_OFFSET f_weld_current_vel = 0.0 ENDIF SET_WIDESCREEN_FORMAT(WIDESCREEN_FORMAT_CENTRE) DRAW_RECT(0.5, 0.25, 0.002, 0.02, 255, 255, 255, 255) DRAW_RECT(0.5 + ((f_weld_current_offset / MAX_OFFSET) * 0.1), 0.25, 0.004, 0.01, 255, 255, 255, 255) DRAW_RECT(0.6, 0.25, 0.002, 0.02, 255, 255, 255, 255) DRAW_RECT(0.4, 0.25, 0.002, 0.02, 255, 255, 255, 255) ENDPROC FUNC VECTOR CALCULATE_REAL_WELD_COORDS(WELDING_DATA &s_weld_data, FLOAT f_offset_x, FLOAT f_offset_y) VECTOR v_real_pos FLOAT f_forward_offset = f_offset_y * s_weld_data.f_sine_root_tilt v_real_pos.z = s_weld_data.v_root_pos.z + f_offset_y v_real_pos.x = s_weld_data.v_root_pos.x + (f_offset_x * s_weld_data.f_cos_root_heading) + (f_forward_offset * -s_weld_data.f_sine_root_heading) v_real_pos.y = s_weld_data.v_root_pos.y + (f_offset_x * s_weld_data.f_sine_root_heading) + (f_forward_offset * s_weld_data.f_cos_root_heading) RETURN v_real_pos ENDFUNC PROC DRAW_WELDING_GRID_LIGHT(WELDING_DATA &s_weld_data, WELDING_GRID_POINT &grid_point, BOOL b_is_row = FALSE) //Work out the position of the light in real terms VECTOR v_real_pos = CALCULATE_REAL_WELD_COORDS(s_weld_data, grid_point.f_x_offset, grid_point.f_y_offset) IF NOT b_is_row //Vertical bars are slightly further in v_real_pos = <> ENDIF IF NOT grid_point.b_has_been_hit DRAW_LIGHT_WITH_RANGE(v_real_pos, 0, 255, 0, 0.03, 100.0) ELSE //DRAW_LIGHT_WITH_RANGE(v_real_pos, 255, 32, 0, 0.2, 4.0)//removing for bug 1935832. This is now handled via the ptfx "scr_bio_grille_break" once the grill is broken ENDIF ENDPROC //- 0.005 PROC INITIALISE_GRID_WELDING_DATA(WELDING_DATA &s_weld_data, VECTOR v_root_pos, FLOAT f_wall_heading, FLOAT f_wall_tilt) //all grid ptfx are offset using these values CONST_FLOAT HEIGHT_BETWEEN_BARS 0.257 CONST_FLOAT WIDTH_BETWEEN_BARS 0.257 CONST_FLOAT BOTTOM_LEFT_CORNER_X -0.77 CONST_FLOAT BOTTOM_LEFT_CORNER_Y -0.98 FLOAT ROWS_START_OFFSET_X = BOTTOM_LEFT_CORNER_X FLOAT ROWS_START_OFFSET_Y = BOTTOM_LEFT_CORNER_Y + (HEIGHT_BETWEEN_BARS / 2) FLOAT COLUMNS_START_OFFSET_X = BOTTOM_LEFT_CORNER_X + (WIDTH_BETWEEN_BARS / 2) FLOAT COLUMNS_START_OFFSET_Y = BOTTOM_LEFT_CORNER_Y //Store the wall rotation s_weld_data.v_wall_rot.x = f_wall_tilt s_weld_data.v_wall_rot.z = f_wall_heading //Pre-calculate sine and cos values for the wall rotation, as we'll be using these a lot. s_weld_data.f_sine_root_heading = SIN(f_wall_heading) s_weld_data.f_cos_root_heading = COS(f_wall_heading) s_weld_data.f_sine_root_tilt = SIN(f_wall_tilt) s_weld_data.v_root_pos = v_root_pos /* IF bDoNewBlowtorchCam s_weld_data.s_current_offset.x = s_weld_data.f_min_offset_x s_weld_data.s_current_offset.y = 0.0 ELSE s_weld_data.s_current_offset.x = 0.0 s_weld_data.s_current_offset.y = 0.0 ENDIF */ //Set up all of the offsets for the grid, starting from the bottom left INT i = 0, j = 0 REPEAT NUM_COLUMNS i REPEAT NUM_NODES_PER_COLUMN j s_welding_columns[i][j].f_x_offset = COLUMNS_START_OFFSET_X + (WIDTH_BETWEEN_BARS * i) s_welding_columns[i][j].f_y_offset = COLUMNS_START_OFFSET_Y + (HEIGHT_BETWEEN_BARS * j) s_welding_columns[i][j].b_has_been_hit = FALSE ENDREPEAT ENDREPEAT REPEAT NUM_ROWS i REPEAT NUM_NODES_PER_ROW j s_welding_rows[i][j].f_x_offset = ROWS_START_OFFSET_X + (WIDTH_BETWEEN_BARS * j) s_welding_rows[i][j].f_y_offset = ROWS_START_OFFSET_Y + (HEIGHT_BETWEEN_BARS * i) s_welding_rows[i][j].b_has_been_hit = FALSE ENDREPEAT ENDREPEAT //Define the maximum bounds s_weld_data.f_min_offset_x = ROWS_START_OFFSET_X s_weld_data.f_max_offset_x = ROWS_START_OFFSET_X + (WIDTH_BETWEEN_BARS * (NUM_NODES_PER_ROW - 1)) s_weld_data.f_min_offset_y = COLUMNS_START_OFFSET_Y s_weld_data.f_max_offset_y = COLUMNS_START_OFFSET_Y + (HEIGHT_BETWEEN_BARS * (NUM_NODES_PER_COLUMN - 1)) IF bDoNewBlowtorchCam s_weld_data.s_current_offset.x = -0.59604//s_weld_data.f_min_offset_x s_weld_data.s_current_offset.y = 0.718505//s_weld_data.f_max_offset_y ELSE // s_weld_data.s_current_offset.x = 0.0 // s_weld_data.s_current_offset.y = 0.0 s_weld_data.s_current_offset.x = s_weld_data.f_min_offset_x s_weld_data.s_current_offset.y = s_weld_data.f_max_offset_y ENDIF //Define the square that will represent the desired route through the grid in order to complete the welding game //Currently set to be the maximum square possible i_desired_weld_route_top = 0 i_desired_weld_route_bottom = NUM_NODES_PER_COLUMN - 1 i_desired_weld_route_left = 0 i_desired_weld_route_right = NUM_NODES_PER_ROW - 1 ENDPROC PROC SET_WELDING_CAM_POS_AND_ROT(CAMERA_INDEX &camWeld, VECTOR vWeldCamPos, VECTOR vWeldCamRot, FLOAT fWeldCamFov = 18.7067) IF DOES_CAM_EXIST(camWeld) SET_CAM_COORD(camWeld, vWeldCamPos) SET_CAM_ROT(camWeld, vWeldCamRot) SET_CAM_FOV(camWeld, fWeldCamFov) ENDIF ENDPROC //CAMERA_INDEX camActive, camInactive //s_weld_data.obj_cursor //CAMERA_INDEX welding_cam //vector welding_cam_pos = <<3835.924805,3668.510498,-22.156725>> //PURPOSE: The welding camera works by focusing on the current "quadrant" of the grid being welded. This figures out which quadrant to point the cam at //PROC DO_CAMERA_FOR_WELDING(FLOAT fXoffset, FLOAT fYoffSet, WELDING_CAMERA_LOC_T &weldCUrrentCam) proc calculate_welding_camera_pos_and_rot() vector temp_cam_1_pos vector temp_cam_1_rot vector temp_cam_2_pos vector temp_cam_2_rot vector welding_cam_pos vector welding_cam_rot // printstring("move_network_scaled_x") // printfloat(move_network_scaled_x) // printnl() // // printstring("move_network_scaled_y") // printfloat(move_network_scaled_y) // printnl() temp_cam_1_pos = camera_a_pos +((camera_b_pos - camera_a_pos) * move_network_scaled_x) temp_cam_1_rot = camera_a_rot +((camera_b_rot - camera_a_rot) * move_network_scaled_x) temp_cam_2_pos = camera_c_pos +((camera_d_pos - camera_c_pos) * move_network_scaled_x) temp_cam_2_rot = camera_c_rot +((camera_d_rot - camera_c_rot) * move_network_scaled_x) // welding_cam_pos = temp_cam_1_pos + ((temp_cam_2_pos - temp_cam_1_pos) * move_network_scaled_y) // welding_cam_rot = temp_cam_1_rot + ((temp_cam_2_rot - temp_cam_1_rot) * move_network_scaled_y) //had to switch temp_cam_2_pos and temp_cam_1_pos because network anim y starts at 1.0 (top) instead of 0.0 welding_cam_pos = temp_cam_2_pos + ((temp_cam_1_pos - temp_cam_2_pos) * move_network_scaled_y) welding_cam_rot = temp_cam_2_rot + ((temp_cam_1_rot - temp_cam_2_rot) * move_network_scaled_y) set_cam_coord(welding_cam, welding_cam_pos) set_cam_rot(welding_cam, welding_cam_rot) set_cam_fov(welding_cam, 18.7067) endproc PROC welding_camera_system() if not does_cam_exist(welding_cam) if activate_welding_cam //Clean up any cam activity from cutscene IF DOES_CAM_EXIST(cam_cutscene) DESTROY_CAM(cam_cutscene) ENDIF //welding camera starts at top left welding_cam = create_cam_with_params("default_scripted_camera", camera_a_pos, camera_a_rot, 18.7067) calculate_welding_camera_pos_and_rot() set_cam_active(welding_cam, true) endif else // printstring("move network x =") // printfloat(move_network_scaled_x) // printnl() // // printstring("move network y =") // printfloat(move_network_scaled_y) // printnl() calculate_welding_camera_pos_and_rot() if (move_network_scaled_x > 0.631791 and move_network_scaled_x < 0.82510) and (move_network_scaled_y > 0.9222 and move_network_scaled_y < 1.0) if not does_cam_exist(camera_a) //camera_a = create_cam_with_params("default_scripted_camera", <<3834.694092,3667.570557,-22.386116>>, <<1.055299,-6.808122,130.962128>>, 18.706699, true) //camera_a = create_cam_with_params("default_scripted_camera", <<3831.560547,3662.433594,-22.501068>>,<<1.912483,-6.808122,-20.365707>>,18.048292, true) endif else if does_cam_exist(camera_a) destroy_cam(camera_a) endif endif if not is_cam_shaking(welding_cam) SHAKE_CAM(welding_cam, "HAND_SHAKE", 1.0) endif endif endproc //PURPOSE: new version of the welding minigame. Michaels arm moves the blow torch as you move the stick FUNC BOOL MANAGE_GRID_WELDING_V2(WELDING_DATA &s_weld_data) FLOAT f_welding_speed = 0.553 FLOAT f_mouse_welding_speed = 0.1 BOOL b_touching_bar = FALSE BOOL b_touching_row = FALSE INT i = 0 INT j = 0 INT i_hit_node_x = -1 INT i_hit_node_y = -1 ALLOW_ALTERNATIVE_SCRIPT_CONTROLS_LAYOUT(FRONTEND_CONTROL) if not welding_gun_fuel_fail IF IS_CONTROL_PRESSED(FRONTEND_CONTROL, INPUT_SCRIPT_RT) IF HAS_SOUND_FINISHED(i_sound_torch_on) PLAY_SOUND_FROM_ENTITY(i_sound_torch_on, "Torch", PLAYER_PED_ID(), "FBI_05_SOUNDS") ENDIF vector welding_gun_offset_from_grill = GET_OFFSET_FROM_ENTITY_GIVEN_WORLD_COORDS(s_grill_parts[1].obj, get_offset_from_entity_in_world_coords(obj_welding_tool, <<-0.344, 0.0, 0.093>>)) current_fuel_used += get_frame_time() // printstring("colums x") // printfloat(absf(welding_gun_offset_from_grill.x - s_welding_columns[5][0].f_x_offset)) // printnl() // // printstring("colums y") // printfloat(absf(welding_gun_offset_from_grill.z - s_welding_columns[0][7].f_y_offset)) // printnl() // // printstring("colums 0 x dif = ") // printfloat(absf(welding_gun_offset_from_grill.x - s_welding_columns[0][0].f_x_offset)) // printnl() // // printstring("colums 0 y dif on 0 = ") // printfloat(absf(welding_gun_offset_from_grill.z - s_welding_columns[0][0].f_y_offset)) // printnl() // // printstring("colums 0 y dif on 0 with + 0.1 = ") // printfloat(absf(welding_gun_offset_from_grill.z - (s_welding_columns[0][0].f_y_offset + 0.1))) // printnl() //Work out if any points on the grid are currently being hit REPEAT NUM_COLUMNS i //DRAW_MARKER(MARKER_CYLINDER, GET_OFFSET_FROM_ENTITY_in_world_coords(s_grill_parts[1].obj, <>), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>, <<0.1, 0.1, 0.1>>, 255, 0, 128, 178) //IF ABSF(s_weld_data.s_current_offset.x - s_welding_columns[i][0].f_x_offset) < 0.02 if absf(welding_gun_offset_from_grill.x - s_welding_columns[i][0].f_x_offset) < 0.03 //0.02 b_touching_bar = TRUE // printstring("test 0") // printnl() //b_touching_colums = true REPEAT NUM_NODES_PER_COLUMN j IF NOT s_welding_columns[i][j].b_has_been_hit //IF ABSF(s_weld_data.s_current_offset.y - s_welding_columns[i][j].f_y_offset) < 0.06 //0.03- //script_assert("check k") if absf(welding_gun_offset_from_grill.z - (s_welding_columns[i][j].f_y_offset + 0.1)) < 0.06 // 0.02 0.12 // printstring("absf < 0.06") // printnl() // // printfloat(absf(welding_gun_offset_from_grill.z - (s_welding_columns[i][j].f_y_offset + 0.1))) // printnl() s_welding_columns[i][j].time += get_frame_time() if s_welding_columns[i][j].time >= cut_through_limit //script_assert("cut colums") s_welding_columns[i][j].b_has_been_hit = TRUE i_hit_node_x = i i_hit_node_y = j if j = i_desired_weld_route_top or j = i_desired_weld_route_bottom play_sound_from_entity(-1, "Bar_Cut", player_ped_id(), "FBI_05_SOUNDS") endif // printstring("i = ") // printint(i) // printnl() // // printstring("j = ") // printint(j) // printnl() // // // script_assert("test 0") endif ENDIF ENDIF ENDREPEAT ENDIF ENDREPEAT REPEAT NUM_ROWS i //DRAW_MARKER(MARKER_CYLINDER, GET_OFFSET_FROM_ENTITY_in_world_coords(s_grill_parts[1].obj, <>), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>, <<0.1, 0.1, 0.1>>, 255, 0, 128, 178) // printfloat(s_welding_rows[1][0].f_y_offset) // printnl() //IF ABSF(s_weld_data.s_current_offset.y - s_welding_rows[i][0].f_y_offset) < 0.02 IF ABSF(welding_gun_offset_from_grill.z - (s_welding_rows[i][0].f_y_offset + 0.08)) < 0.02 //0.02 0.12 b_touching_bar = TRUE b_touching_row = TRUE // printstring("rows z") // printfloat(absf(welding_gun_offset_from_grill.z - s_welding_rows[0][0].f_y_offset)) // printnl() // // printstring("rows x") // printfloat(absf(welding_gun_offset_from_grill.x - s_welding_rows[0][2].f_x_offset)) // printnl() REPEAT NUM_NODES_PER_ROW j IF NOT s_welding_rows[i][j].b_has_been_hit //IF ABSF(s_weld_data.s_current_offset.x - s_welding_rows[i][j].f_x_offset) < 0.06 IF ABSF(welding_gun_offset_from_grill.x - s_welding_rows[i][j].f_x_offset) < 0.06 //0.12 0.06 // printstring("rows z") // printfloat(absf(welding_gun_offset_from_grill.z - s_welding_rows[i][0].f_y_offset)) // printnl() // // printstring("rows x") // printfloat(absf(welding_gun_offset_from_grill.x - s_welding_rows[i][j].f_x_offset)) // printnl() s_welding_rows[i][j].time += get_frame_time() if s_welding_rows[i][j].time >= cut_through_limit s_welding_rows[i][j].b_has_been_hit = TRUE i_hit_node_x = i i_hit_node_y = j if j = i_desired_weld_route_left or j = i_desired_weld_route_right play_sound_from_entity(-1, "Bar_Cut", player_ped_id(), "FBI_05_SOUNDS") endif endif ENDIF ENDIF ENDREPEAT ENDIF ENDREPEAT ELSE IF NOT HAS_SOUND_FINISHED(i_sound_torch_on) STOP_SOUND(i_sound_torch_on) ENDIF endif else IF NOT HAS_SOUND_FINISHED(i_sound_torch_on) STOP_SOUND(i_sound_torch_on) ENDIF endif //Handle the cursor INT i_left_stick_x, i_left_stick_y, i_right_stick_x, i_right_stick_y GET_CONTROL_VALUE_OF_ANALOGUE_STICKS_UNBOUND(i_left_stick_x, i_left_stick_y, i_right_stick_x, i_right_stick_y) //slows down welding movement by 91% // IF b_touching_bar // f_welding_speed /= 12.0 // ENDIF //removed inverted look for Les 972572 // IF IS_LOOK_INVERTED() // i_right_stick_y *= -1 // ENDIF // FLOAT f_vel_x f_vel_x = (i_right_stick_x / 128.0) * f_welding_speed // FLOAT f_vel_x f_vel_y = (-i_right_stick_y / 128.0) * f_welding_speed FLOAT f_vel_x FLOAT f_vel_y IF not IS_USING_KEYBOARD_AND_MOUSE(FRONTEND_CONTROL) if absi(i_right_stick_x) > 28 or absi(i_right_stick_y) > 28 f_vel_x = (i_right_stick_x / 128.0) * f_welding_speed * get_frame_time() f_vel_y = (-i_right_stick_y / 128.0) * f_welding_speed * get_frame_time() elif absi(i_left_stick_x) > 28 or absi(i_left_stick_y) > 28 f_vel_x = (i_left_stick_x / 128.0) * f_welding_speed * get_frame_time() f_vel_y = (-i_left_stick_y / 128.0) * f_welding_speed * get_frame_time() endif else // Adding back in support for both mouse and keyboard movement. // Keyboard if absi(i_left_stick_x) > 28 or absi(i_left_stick_y) > 28 f_vel_x = (i_left_stick_x / 128.0) * f_welding_speed * get_frame_time() f_vel_y = (-i_left_stick_y / 128.0) * f_welding_speed * get_frame_time() ELSE // Mouse FLOAT fMouseX, fMouseY fMouseX = GET_CONTROL_NORMAL(FRONTEND_CONTROL, INPUT_SCALED_LOOK_LR) fMouseY = GET_CONTROL_NORMAL(FRONTEND_CONTROL, INPUT_SCALED_LOOK_UD) f_vel_x = fMouseX * f_mouse_welding_speed f_vel_y = (-fMouseY) * f_mouse_welding_speed // Clamping this because if the mouse moves too fast it looks unrealistic. f_vel_x = CLAMP( f_vel_x, -0.02, 0.02) f_vel_y = CLAMP( f_vel_y, -0.02, 0.02) ENDIF endif s_weld_data.s_current_offset.x = clamp(s_weld_data.s_current_offset.x + f_vel_x, s_weld_data.f_min_offset_x, s_weld_data.f_max_offset_x) s_weld_data.s_current_offset.y = clamp(s_weld_data.s_current_offset.y + f_vel_y, s_weld_data.f_min_offset_y, s_weld_data.f_max_offset_y) VECTOR v_real_cursor_pos = CALCULATE_REAL_WELD_COORDS(s_weld_data, s_weld_data.s_current_offset.x, s_weld_data.s_current_offset.y) /* DW_PRINTV(CALCULATE_REAL_WELD_COORDS(s_weld_data, (s_weld_data.f_min_offset_x +((s_weld_data.f_max_offset_x - s_weld_data.f_min_offset_x)/ 2.0)), (s_weld_data.f_min_offset_y +((s_weld_data.f_max_offset_y - s_weld_data.f_min_offset_y) /2.0))), "Centre...") */ //-- Centre <<3832.896484, 3665.741943, -22.997499>> //--Deal with player Move network SWITCH iPlayerMoveProg case 0 IF IS_TASK_MOVE_NETWORK_ACTIVE(PLAYER_PED_ID()) IF IS_TASK_MOVE_NETWORK_READY_FOR_TRANSITION(PLAYER_PED_ID()) IF REQUEST_TASK_MOVE_NETWORK_STATE_TRANSITION(PLAYER_PED_ID(), "Cutting") iPlayerMoveProg++ ENDIF ENDIF endif break CASE 1 //-- Need to map s_weld_data.s_current_offset.x and s_weld_data.s_current_offset.y to values between (0, 1) //-- -0.757 << x << 0.763 //-- -0.97 << y << 0.815 FLOAT fXaxisRange FLOAT fYaxisRange FLOAT fTempX FLOAT fTempY IF IS_TASK_MOVE_NETWORK_READY_FOR_TRANSITION(PLAYER_PED_ID()) activate_welding_cam = true // CONST_FLOAT BOTTOM_LEFT_CORNER_X -0.77 // CONST_FLOAT BOTTOM_LEFT_CORNER_Y -0.98 //s_weld_data.s_current_offset.x ranges between -0.777 and 0.98 //fXaxisRange = 0.757 + 0.763 //fTempX = s_weld_data.s_current_offset.x + 0.757 fXaxisRange = 0.777 + 0.783 fTempX = s_weld_data.s_current_offset.x + 0.777 move_network_scaled_x = fTempX / fXaxisRange SET_TASK_MOVE_NETWORK_SIGNAL_FLOAT(PLAYER_PED_ID(), "x_axis", move_network_scaled_x) //s_weld_data.s_current_offset.x ranges between -0.98 and 0.825 //1.0 is the top of the y axis fYaxisRange = 0.98 + 0.825 fTempY = s_weld_data.s_current_offset.y + 0.98 move_network_scaled_y = fTempY / fYaxisRange SET_TASK_MOVE_NETWORK_SIGNAL_FLOAT(PLAYER_PED_ID(), "y_axis", move_network_scaled_y) ENDIF #IF IS_DEBUG_BUILD player_root_bone_pos = GET_WORLD_POSITION_OF_ENTITY_BONE(player_ped_id(), 0) #endif BREAK ENDSWITCH IF DOES_ENTITY_EXIST(s_weld_data.obj_cursor) SET_ENTITY_COORDS_NO_OFFSET(s_weld_data.obj_cursor, v_real_cursor_pos) set_entity_rotation(s_weld_data.obj_cursor, v_grill_rot) FREEZE_ENTITY_POSITION(s_weld_data.obj_cursor, TRUE) //DRAW_LIGHT_WITH_RANGE(GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(s_weld_data.obj_cursor, <<0.0, -0.05, 0.0>>), 255, 0, 0, 0.1, 250.0) ENDIF if not welding_gun_fuel_fail IF IS_CONTROL_PRESSED(FRONTEND_CONTROL, INPUT_SCRIPT_RT) if does_particle_fx_looped_exist(idle_blue_flame_ptfx) stop_particle_fx_looped(idle_blue_flame_ptfx) endif IF b_touching_bar if does_particle_fx_looped_exist(i_bubble_ptfx) stop_particle_fx_looped(i_bubble_ptfx) endif if not does_particle_fx_looped_exist(i_weld_ptfx) i_weld_ptfx = start_particle_fx_looped_on_entity("scr_bio_grille_cutting", obj_welding_tool, <<-0.344, 0.0, 0.093>>, <<0.0, 0.0, s_welding_data.v_wall_rot.z>>, 1.0) ELSE //Only update the rotation if the tool is moving, otherwise keep it at the last rotation IF f_vel_y != 0.0 OR f_vel_x != 0.0 //s_welding_data.f_current_ptfx_rot = 90.0 s_welding_data.f_current_ptfx_rot = 90.00 + ATAN2(-f_vel_y, f_vel_x) ENDIF IF HAS_SOUND_FINISHED(i_sound_torch_cutting) PLAY_SOUND_FROM_COORD(i_sound_torch_cutting, "Torch_Cut", v_real_cursor_pos, "FBI_05_SOUNDS") endif SET_PARTICLE_FX_LOOPED_OFFSETS(i_weld_ptfx, <<-0.344, 0.0, 0.093>>, <<0.0, s_welding_data.f_current_ptfx_rot, s_welding_data.v_wall_rot.z>>) ENDIF else //bubble particle effect when not welding metal bars if does_particle_fx_looped_exist(i_weld_ptfx) stop_particle_fx_looped(i_weld_ptfx) endif if not does_particle_fx_looped_exist(i_bubble_ptfx) i_bubble_ptfx = start_particle_fx_looped_on_entity("scr_bio_cutter_nozzle", obj_welding_tool, <<-0.344, 0.0, 0.093>>, <<0.0, 0.0, s_welding_data.v_wall_rot.z>>, 1.0) else SET_PARTICLE_FX_LOOPED_OFFSETS(i_bubble_ptfx, <<-0.344, 0.0, 0.093>>, <<0.0, 0.0, s_welding_data.v_wall_rot.z>>) endif endif ELSE if does_particle_fx_looped_exist(i_weld_ptfx) STOP_PARTICLE_FX_LOOPED(i_weld_ptfx) ENDIF if does_particle_fx_looped_exist(i_bubble_ptfx) STOP_PARTICLE_FX_LOOPED(i_bubble_ptfx) ENDIF //idle blue particle effect when not using weleding gun if not does_particle_fx_looped_exist(idle_blue_flame_ptfx) idle_blue_flame_ptfx = start_particle_fx_looped_on_entity("scr_bio_cutter_flame", obj_welding_tool, <<-0.344, 0.0, 0.093>>, <<0.0, 0.0, s_welding_data.v_wall_rot.z>>, 1.0) ELSE IF f_vel_y != 0.0 OR f_vel_x != 0.0 s_welding_data.f_current_ptfx_rot = 90.00 + ATAN2(-f_vel_y, f_vel_x) ENDIF SET_PARTICLE_FX_LOOPED_OFFSETS(idle_blue_flame_ptfx, <<-0.344, 0.0, 0.093>>, <<0.0, s_welding_data.f_current_ptfx_rot, s_welding_data.v_wall_rot.z>>) ENDIF ENDIF else if not has_sound_finished(i_sound_torch_cutting) stop_sound(i_sound_torch_cutting) endif if does_particle_fx_looped_exist(idle_blue_flame_ptfx) stop_particle_fx_looped(idle_blue_flame_ptfx) endif if does_particle_fx_looped_exist(i_bubble_ptfx) STOP_PARTICLE_FX_LOOPED(i_bubble_ptfx) ENDIF if does_particle_fx_looped_exist(i_weld_ptfx) STOP_PARTICLE_FX_LOOPED(i_weld_ptfx) ENDIF endif if not welding_gun_fuel_fail IF b_touching_bar vector welding_gun_end_of_nozzle_pos = get_offset_from_entity_in_world_coords(obj_welding_tool, <<-0.344, 0.0, 0.093>>) //draw_marker(MARKER_CYLINDER, v_real_cursor_pos, <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>, <<0.1, 0.1, 0.1>>, 255, 0, 128, 178) //draw_marker(MARKER_CYLINDER, welding_gun_end_of_nozzle_pos, <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>, <<0.1, 0.1, 0.1>>, 255, 0, 128, 178) if not does_particle_fx_looped_exist(i_singe_ptfx) IF b_touching_row //i_singe_ptfx = START_PARTICLE_FX_LOOPED_AT_COORD("scr_bio_grille_singed", v_real_cursor_pos, <<0.0, 0.0, s_welding_data.v_wall_rot.z>>) i_singe_ptfx = START_PARTICLE_FX_LOOPED_AT_COORD("scr_bio_grille_singed", welding_gun_end_of_nozzle_pos, <<0.0, 0.0, s_welding_data.v_wall_rot.z>>) ELSE //If on a column, the singe effect needs to be slightly further forward to match the bars //VECTOR v_pos = <> //VECTOR v_pos = <> //i_singe_ptfx = START_PARTICLE_FX_LOOPED_AT_COORD("scr_bio_grille_singed", v_pos, <<0.0, 0.0, s_welding_data.v_wall_rot.z>>) i_singe_ptfx = START_PARTICLE_FX_LOOPED_AT_COORD("scr_bio_grille_singed", welding_gun_end_of_nozzle_pos, <<0.0, 0.0, s_welding_data.v_wall_rot.z>>) ENDIF ELSE IF b_touching_row //SET_PARTICLE_FX_LOOPED_OFFSETS(i_singe_ptfx, v_real_cursor_pos, <<0.0, 0.0, s_welding_data.v_wall_rot.z>>) SET_PARTICLE_FX_LOOPED_OFFSETS(i_singe_ptfx, welding_gun_end_of_nozzle_pos, <<0.0, 0.0, s_welding_data.v_wall_rot.z>>) ELSE //VECTOR v_pos = <> //VECTOR v_pos = <> //SET_PARTICLE_FX_LOOPED_OFFSETS(i_singe_ptfx, v_pos, <<0.0, 0.0, s_welding_data.v_wall_rot.z>>) SET_PARTICLE_FX_LOOPED_OFFSETS(i_singe_ptfx, welding_gun_end_of_nozzle_pos, <<0.0, 0.0, s_welding_data.v_wall_rot.z>>) ENDIF ENDIF //If a pipe section was cut this frame, and that section is part of the defined route needed to complete the mission, draw a "break" effect on it. IF i_hit_node_x != -1 IF b_touching_row IF i_hit_node_y = i_desired_weld_route_left OR i_hit_node_y = i_desired_weld_route_right IF i_current_break_ptfx < COUNT_OF(i_break_ptfx) // VECTOR v_pos = GET_ENTITY_COORDS(s_grill_parts[1].obj) VECTOR v_ptfx_offset = <> i_break_ptfx[i_current_break_ptfx] = START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_bio_grille_break", s_grill_parts[1].obj, v_ptfx_offset, <<0.0, 0.0, 0.0>>) i_current_break_ptfx++ ENDIF ENDIF ELSE IF i_hit_node_y = i_desired_weld_route_top OR i_hit_node_y = i_desired_weld_route_bottom IF i_current_break_ptfx < COUNT_OF(i_break_ptfx) // VECTOR v_pos = GET_ENTITY_COORDS(s_grill_parts[1].obj) VECTOR v_ptfx_offset = <> i_break_ptfx[i_current_break_ptfx] = START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_bio_grille_break", s_grill_parts[1].obj, v_ptfx_offset, <<0.0, 90.0, 0.00>>) i_current_break_ptfx++ ENDIF ENDIF ENDIF ENDIF ELSE /* IF i_weld_ptfx != NULL STOP_PARTICLE_FX_LOOPED(i_weld_ptfx) i_weld_ptfx = NULL ENDIF */ if does_particle_fx_looped_exist(i_singe_ptfx) STOP_PARTICLE_FX_LOOPED(i_singe_ptfx) ENDIF IF NOT HAS_SOUND_FINISHED(i_sound_torch_cutting) STOP_SOUND(i_sound_torch_cutting) ENDIF ENDIF //Work out how many of the desired nodes have been hit: the 4 ints initialised earlier help to work out //which array indices make a square representing the desired route i_num_route_nodes_not_hit = 0 REPEAT NUM_COLUMNS i IF NOT s_welding_columns[i][i_desired_weld_route_top].b_has_been_hit i_num_route_nodes_not_hit++ ENDIF IF NOT s_welding_columns[i][i_desired_weld_route_bottom].b_has_been_hit i_num_route_nodes_not_hit++ ENDIF DRAW_WELDING_GRID_LIGHT(s_weld_data, s_welding_columns[i][i_desired_weld_route_top]) DRAW_WELDING_GRID_LIGHT(s_weld_data, s_welding_columns[i][i_desired_weld_route_bottom]) ENDREPEAT REPEAT NUM_ROWS i IF NOT s_welding_rows[i][i_desired_weld_route_left].b_has_been_hit i_num_route_nodes_not_hit++ ENDIF IF NOT s_welding_rows[i][i_desired_weld_route_right].b_has_been_hit i_num_route_nodes_not_hit++ ENDIF DRAW_WELDING_GRID_LIGHT(s_weld_data, s_welding_rows[i][i_desired_weld_route_left], TRUE) DRAW_WELDING_GRID_LIGHT(s_weld_data, s_welding_rows[i][i_desired_weld_route_right], TRUE) ENDREPEAT IF i_num_route_nodes_not_hit = 0 RETURN TRUE ENDIF endif #IF IS_DEBUG_BUILD IF b_debug_alternate_weld NEW_WELDING_TEST() ENDIF #ENDIF RETURN FALSE ENDFUNC /// PURPOSE: /// The grills covering the underwater pipe have to be added at any point before the welding minigame PROC MANAGE_GRILL_CREATION() s_grill_parts[0].model = PROP_CHEM_GRILL s_grill_parts[1].model = PROP_CHEM_GRILL_BIT IF NOT DOES_ENTITY_EXIST(s_grill_parts[0].obj) IF get_distance_between_coords(GET_ENTITY_COORDS(PLAYER_PED_ID()), v_grill_pos) < 40000.0 REQUEST_MODEL(s_grill_parts[0].model) REQUEST_MODEL(s_grill_parts[1].model) // REQUEST_COLLISION_FOR_MODEL(s_grill_parts[0].model) // and HAS_COLLISION_FOR_MODEL_LOADED(s_grill_parts[0].model) IF HAS_MODEL_LOADED(s_grill_parts[0].model) AND HAS_MODEL_LOADED(s_grill_parts[1].model) //Create the grill s_grill_parts[0].obj = CREATE_OBJECT_NO_OFFSET(s_grill_parts[0].model, v_grill_pos) s_grill_parts[1].obj = CREATE_OBJECT_NO_OFFSET(s_grill_parts[1].model, v_grill_pos) SET_ENTITY_ROTATION(s_grill_parts[0].obj, v_grill_rot) SET_ENTITY_ROTATION(s_grill_parts[1].obj, v_grill_rot) SET_MODEL_AS_NO_LONGER_NEEDED(s_grill_parts[0].model) SET_MODEL_AS_NO_LONGER_NEEDED(s_grill_parts[1].model) FREEZE_ENTITY_POSITION(s_grill_parts[0].obj, TRUE) FREEZE_ENTITY_POSITION(s_grill_parts[1].obj, TRUE) ENDIF ENDIF ENDIF ENDPROC //Handles the audio scene and effects while the player is underwater PROC MANAGE_UNDERWATER_AUDIO() IF e_mission_stage < stage_get_to_lift VECTOR v_game_cam_pos = GET_GAMEPLAY_CAM_COORD() IF ((IS_PED_SWIMMING_UNDER_WATER(player_ped_id())//or v_game_cam_pos.z < -1.0 //0.0 -0.5 OR (v_game_cam_pos.y < 3726.0 AND v_game_cam_pos.y > 3709.0 AND v_game_cam_pos.x > 3509.0 AND v_game_cam_pos.x < 3541.0 AND v_game_cam_pos.z < 17.5)) and (not take_off_scuba_gear)) DISABLE_CELLPHONE_CAMERA_APP_THIS_FRAME_ONLY() //player in tunnel if render_underwater_tunnel_on_radar SET_VARIABLE_ON_UNDER_WATER_STREAM("inTunnel", 1.0) else SET_VARIABLE_ON_UNDER_WATER_STREAM("inTunnel", 0.0) endif // IF NOT IS_AUDIO_SCENE_ACTIVE("BIOTECH_HEIST_UNDERWATER_SCENE") // START_AUDIO_SCENE("BIOTECH_HEIST_UNDERWATER_SCENE") // ENDIF IF HAS_SOUND_FINISHED(sound_underwater_ambience) PLAY_SOUND_FRONTEND(sound_underwater_ambience, "UW_Ambience") ENDIF //removed as it's being done in code // IF HAS_SOUND_FINISHED(sound_underwater_rebreather) // PLAY_SOUND_FRONTEND(sound_underwater_rebreather, "UW_Rebreather")// "FBI_05_RAID_FAN")//"UW_Rebreather") // ENDIF //These sounds shouldn't play once the player has taken off their scuba suit //IF e_mission_stage < STAGE_FIND_CHEMICALS FLOAT f_player_speed = GET_ENTITY_SPEED(PLAYER_PED_ID()) IF f_player_speed > 1.0 IF HAS_SOUND_FINISHED(i_sound_swishing) PLAY_SOUND_FROM_ENTITY(i_sound_swishing, "Foot_Swish", PLAYER_PED_ID(), "FBI_05_SOUNDS") SET_VARIABLE_ON_SOUND(i_sound_swishing, "SwimSpeed", (f_player_speed - 1.0) / 4.0) ELSE SET_VARIABLE_ON_SOUND(i_sound_swishing, "SwimSpeed", (f_player_speed - 1.0) / 4.0) ENDIF ELSE IF NOT HAS_SOUND_FINISHED(i_sound_swishing) STOP_SOUND(i_sound_swishing) ENDIF ENDIF // IF b_allow_scuba_breath //The are some special cases where scuba breathing shouldn't play // IF HAS_SOUND_FINISHED(i_sound_scuba_gear) // PLAY_SOUND_FRONTEND(i_sound_scuba_gear, "FBI_05_RAID_BREATH") // ENDIF // ENDIF //ENDIF ELSE // IF IS_AUDIO_SCENE_ACTIVE("BIOTECH_HEIST_UNDERWATER_SCENE") // STOP_AUDIO_SCENE("BIOTECH_HEIST_UNDERWATER_SCENE") // ENDIF IF NOT HAS_SOUND_FINISHED(sound_underwater_ambience) STOP_SOUND(sound_underwater_ambience) ENDIF IF NOT HAS_SOUND_FINISHED(sound_underwater_rebreather) STOP_SOUND(sound_underwater_rebreather) ENDIF IF NOT HAS_SOUND_FINISHED(i_sound_swishing) STOP_SOUND(i_sound_swishing) ENDIF IF NOT HAS_SOUND_FINISHED(i_sound_scuba_gear) STOP_SOUND(i_sound_scuba_gear) ENDIF ENDIF endif if is_ped_swimming_under_water(player_ped_id()) //DISABLE_CELLPHONE_CAMERA_APP_THIS_FRAME_ONLY() endif ENDPROC proc delete_all_scuba_gear() if does_entity_exist(steves_mask.obj) set_model_as_no_longer_needed(steves_mask.model) delete_object(steves_mask.obj) endif if does_entity_exist(scuba_mike.obj) set_model_as_no_longer_needed(scuba_mike.model) delete_object(scuba_mike.obj) endif if does_entity_exist(scuba_dave.obj) set_model_as_no_longer_needed(scuba_dave.model) delete_object(scuba_dave.obj) endif if does_entity_exist(OxyTank_1.obj) set_model_as_no_longer_needed(OxyTank_1.model) delete_object(OxyTank_1.obj) endif if does_entity_exist(OxyTank_2.obj) set_model_as_no_longer_needed(OxyTank_2.model) delete_object(OxyTank_2.obj) endif if does_entity_exist(OxyTank_3.obj) set_model_as_no_longer_needed(OxyTank_3.model) delete_object(OxyTank_3.obj) endif if does_entity_exist(scuba_steve.obj) set_model_as_no_longer_needed(scuba_steve.model) delete_object(scuba_steve.obj) endif if does_entity_exist(swag_bag.obj) set_model_as_no_longer_needed(swag_bag.model) delete_object(swag_bag.obj) endif endproc PROC REMOVE_ALL_BLIPS(bool remove_dave_and_steve_blips = false) int i if remove_dave_and_steve_blips if does_blip_exist(dave.blip) remove_blip(dave.blip) endif if does_blip_exist(steve.blip) remove_blip(steve.blip) endif endif IF DOES_BLIP_EXIST(blip_current_destination) REMOVE_BLIP(blip_current_destination) ENDIF IF DOES_BLIP_EXIST(boat.blip) REMOVE_BLIP(boat.blip) ENDIF IF DOES_BLIP_EXIST(truck.blip) REMOVE_BLIP(truck.blip) ENDIF IF DOES_BLIP_EXIST(fridge.blip) REMOVE_BLIP(fridge.blip) ENDIF IF DOES_BLIP_EXIST(crate.blip) REMOVE_BLIP(crate.blip) ENDIF IF DOES_BLIP_EXIST(helicopter.blip) REMOVE_BLIP(helicopter.blip) ENDIF IF DOES_BLIP_EXIST(chemicals.blip) REMOVE_BLIP(chemicals.blip) ENDIF IF DOES_BLIP_EXIST(blip_truck) REMOVE_BLIP(blip_truck) ENDIF IF DOES_BLIP_EXIST(lift_blip) REMOVE_BLIP(lift_blip) ENDIF IF DOES_BLIP_EXIST(outside_lift_blip) REMOVE_BLIP(outside_lift_blip) ENDIF if does_blip_exist(cover_blip) remove_blip(cover_blip) endif IF DOES_BLIP_EXIST(blipLoadingBay) REMOVE_BLIP(blipLoadingBay) ENDIF for i = 0 to count_of(security_guard) - 1 if does_blip_exist(security_guard[i].blip) remove_blip(security_guard[i].blip) endif endfor for i = 0 to count_of(scientist) - 1 if does_blip_exist(scientist[i].blip) remove_blip(scientist[i].blip) endif endfor for i = 0 to count_of(patrol_security_guard) - 1 if does_blip_exist(patrol_security_guard[i].blip) remove_blip(patrol_security_guard[i].blip) endif endfor ENDPROC PROC REMOVE_OBJECT(OBJECT_INDEX &obj, BOOL b_force_delete = FALSE) IF DOES_ENTITY_EXIST(obj) IF IS_ENTITY_ATTACHED(obj) DETACH_ENTITY(obj) ENDIF IF b_force_delete DELETE_OBJECT(obj) ELSE SET_OBJECT_AS_NO_LONGER_NEEDED(obj) ENDIF ENDIF ENDPROC PROC REMOVE_ALL_OBJECTS(BOOL b_force_delete = true) REMOVE_OBJECT(fridge_pallet.obj, b_force_delete) REMOVE_OBJECT(fridge.obj, b_force_delete) REMOVE_OBJECT(crate.obj, b_force_delete) REMOVE_OBJECT(s_welding_data.obj_cursor, TRUE) REMOVE_OBJECT(chemicals.obj, b_force_delete) remove_object(flare[0].obj, true) remove_object(flare[1].obj, true) remove_object(security_card.obj, true) INT i = 0 REPEAT COUNT_OF(s_fans) i REMOVE_OBJECT(s_fans[i].obj, TRUE) ENDREPEAT REPEAT COUNT_OF(s_grill_parts) i REMOVE_OBJECT(s_grill_parts[i].obj, b_force_delete) ENDREPEAT REPEAT COUNT_OF(obj_loading_boxes) i REMOVE_OBJECT(obj_loading_boxes[i], b_force_delete) ENDREPEAT for i = 0 to count_of(elevator_display) - 1 remove_object(elevator_display[i].obj, true) endfor REMOVE_OBJECT(obj_welding_tool, TRUE) REMOVE_OBJECT(steve_badge.obj, true) REMOVE_OBJECT(monkey_sounds_object.obj, true) delete_all_scuba_gear() REMOVE_OBJECT(container_light.obj, true) ENDPROC PROC REMOVE_PED(PED_INDEX &ped, BOOL b_force_delete = FALSE) IF DOES_ENTITY_EXIST(ped) IF NOT IS_PED_INJURED(ped) IF NOT IS_PED_IN_ANY_VEHICLE(ped) IF IS_ENTITY_ATTACHED(ped) DETACH_ENTITY(ped) ENDIF ENDIF ENDIF IF b_force_delete DELETE_PED(ped) ELSE SET_PED_AS_NO_LONGER_NEEDED(ped) ENDIF ENDIF ENDPROC PROC REMOVE_ALL_PEDS(BOOL b_force_delete = FALSE) int i REMOVE_PED(dave.ped, b_force_delete) REMOVE_PED(steve.ped, b_force_delete) remove_ped(selector_ped.pedID[selector_ped_michael], b_force_delete) remove_ped(selector_ped.pedID[selector_ped_franklin], b_force_delete) remove_ped(selector_ped.pedID[selector_ped_trevor], b_force_delete) for i = 0 to count_of(scientist) - 1 REMOVE_PED(scientist[i].ped, true) endfor for i = 0 to count_of(patrol_security_guard) - 1 REMOVE_PED(patrol_security_guard[i].ped, true) endfor for i = 0 to count_of(security_guard) - 1 REMOVE_PED(security_guard[i].ped, true) endfor for i = 0 to count_of(monkey) - 1 REMOVE_PED(monkey[i].ped, true) set_model_as_no_longer_needed(monkey[i].model) endfor remove_ped(patricia.ped, b_force_delete) for i = 0 to count_of(madrazzos_guard) - 1 REMOVE_PED(madrazzos_guard[i].ped, true) set_model_as_no_longer_needed(madrazzos_guard[i].model) endfor ENDPROC PROC REMOVE_VEHICLE(VEHICLE_INDEX &veh, BOOL b_force_delete = FALSE) IF DOES_ENTITY_EXIST(veh) IF IS_VEHICLE_DRIVEABLE(veh) IF IS_ENTITY_ATTACHED(veh) DETACH_ENTITY(veh) ENDIF ENDIF IF IS_ENTITY_A_MISSION_ENTITY(veh) AND DOES_ENTITY_BELONG_TO_THIS_SCRIPT(veh, false) if is_player_playing(player_id()) if is_vehicle_driveable(veh) if not is_ped_sitting_in_vehicle(player_ped_id(), veh) IF b_force_delete DELETE_VEHICLE(veh) ELSE SET_VEHICLE_AS_NO_LONGER_NEEDED(veh) ENDIF else SET_VEHICLE_AS_NO_LONGER_NEEDED(veh) endif else SET_VEHICLE_AS_NO_LONGER_NEEDED(veh) endif else SET_VEHICLE_AS_NO_LONGER_NEEDED(veh) //can't delete vehicle with player in it. Fail system requires player to be in car can't use clear_ped_tasks_immediaely() endif endif ENDIF ENDPROC PROC REMOVE_ALL_VEHICLES(BOOL b_force_delete = FALSE) int i REMOVE_VEHICLE(boat.veh, b_force_delete) REMOVE_VEHICLE(truck.veh, b_force_delete) REMOVE_VEHICLE(trailer.veh, b_force_delete) REMOVE_VEHICLE(helicopter.veh, b_force_delete) for i = 0 to count_of(army_truck) - 1 REMOVE_VEHICLE(army_truck[i].veh, b_force_delete) endfor REMOVE_VEHICLE(crate_veh.veh, b_force_delete) REMOVE_VEHICLE(trevors_truck.veh, b_force_delete) ENDPROC PROC REMOVE_ALL_CAMERAS() IF DOES_CAM_EXIST(cam_cutscene) DESTROY_CAM(cam_cutscene) ENDIF IF DOES_CAM_EXIST(cam_interp) DESTROY_CAM(cam_interp) ENDIF destroy_all_cams() RENDER_SCRIPT_CAMS(FALSE, FALSE) ENDPROC proc remove_all_anim_dicts() remove_anim_dict("missfbi1") remove_anim_dict("mini@biotech@blowtorch_str") remove_anim_dict("mini@biotech@blowtorch_def") request_anim_dict("SWIMMING@swim") remove_anim_dict("swimming@scuba") remove_anim_dict("missheistchem2") remove_anim_dict("missfbi5ig_2") //remove_anim_dict("missfbi5@trevor_driving") remove_CLIP_SET("clipset@missfbi5_trevor_driving") endproc proc remove_all_waypoints() IF GET_IS_WAYPOINT_RECORDING_LOADED(str_waypoint_swim) REMOVE_WAYPOINT_RECORDING(str_waypoint_swim) ENDIF IF GET_IS_WAYPOINT_RECORDING_LOADED("fbi5_steve_swim_lab") REMOVE_WAYPOINT_RECORDING("fbi5_steve_swim_lab") ENDIF endproc proc remove_all_sounds() IF IS_AUDIO_SCENE_ACTIVE("BIOTECH_HEIST_GASMASK_SCENE") STOP_AUDIO_SCENE("BIOTECH_HEIST_GASMASK_SCENE") ENDIF IF NOT HAS_SOUND_FINISHED(sound_underwater_ambience) STOP_SOUND(sound_underwater_ambience) ENDIF IF NOT HAS_SOUND_FINISHED(sound_underwater_rebreather) STOP_SOUND(sound_underwater_rebreather) ENDIF IF NOT HAS_SOUND_FINISHED(i_sound_scuba_gear) STOP_SOUND(i_sound_scuba_gear) ENDIF IF NOT HAS_SOUND_FINISHED(i_sound_torch_cutting) STOP_SOUND(i_sound_torch_cutting) ENDIF IF NOT HAS_SOUND_FINISHED(i_sound_torch_on) STOP_SOUND(i_sound_torch_on) ENDIF IF NOT HAS_SOUND_FINISHED(i_sound_gas_mask) STOP_SOUND(i_sound_gas_mask) ENDIF IF NOT HAS_SOUND_FINISHED(i_sound_swishing) STOP_SOUND(i_sound_swishing) ENDIF if not has_sound_finished(flare_sound) stop_sound(flare_sound) endif if not has_sound_finished(crate_sound) stop_sound(crate_sound) endif if not has_sound_finished(monkey_sound[0]) stop_sound(monkey_sound[0]) endif if not has_sound_finished(monkey_sound[1]) stop_sound(monkey_sound[1]) endif stop_stream() stop_alarm("FIB_05_BIOTECH_LAB_ALARMS", true) endproc proc remove_all_ptfx(bool remove_loaded_ptfx_asset = true) int i = 0 for i = 0 to count_of(s_fans) - 1 if does_particle_fx_looped_exist(s_fans[i].i_ptfx) REMOVE_PARTICLE_FX(s_fans[i].i_ptfx) endif endfor for i = 0 to count_of(i_break_ptfx) - 1 if does_particle_fx_looped_exist(i_break_ptfx[i]) REMOVE_PARTICLE_FX(i_break_ptfx[i]) ENDIF endfor for i = 0 to count_of(grill_0_ptfx) - 1 if does_particle_fx_looped_exist(grill_0_ptfx[i]) stop_particle_fx_looped(grill_0_ptfx[i]) endif endfor if does_particle_fx_looped_exist(i_weld_ptfx) REMOVE_PARTICLE_FX(i_weld_ptfx) ENDIF if does_particle_fx_looped_exist(i_bubble_ptfx) remove_particle_fx(i_bubble_ptfx) endif if does_particle_fx_looped_exist(i_singe_ptfx) REMOVE_PARTICLE_FX(i_singe_ptfx) ENDIF if does_particle_fx_looped_exist(idle_blue_flame_ptfx) stop_particle_fx_looped(idle_blue_flame_ptfx) endif for i = 0 to count_of(flare_ptfx) - 1 if does_particle_fx_looped_exist(flare_ptfx[i]) stop_particle_fx_looped(flare_ptfx[i]) endif endfor if does_particle_fx_looped_exist(fxBubbles) STOP_PARTICLE_FX_LOOPED(fxBubbles) ENDIF if does_particle_fx_looped_exist(fridge_ptfx) STOP_PARTICLE_FX_LOOPED(fridge_ptfx) endif if remove_loaded_ptfx_asset REMOVE_PTFX_ASSET() endif endproc proc initialise_mission_variables() #IF IS_DEBUG_BUILD menu_stage_selector[0].sTxtLabel = "GO_TO_PIPE" menu_stage_selector[1].sTxtLabel = "CUT_PIPE" menu_stage_selector[2].sTxtLabel = "SWIM_INTO_LAB" menu_stage_selector[3].sTxtLabel = "GET_TO_LIFT" menu_stage_selector[4].sTxtLabel = "GET_CHEMICALS" menu_stage_selector[5].sTxtLabel = "shootout" menu_stage_selector[6].sTxtLabel = "load chemicals into fridge" menu_stage_selector[7].sTxtLabel = "pickup crate in helicopter" menu_stage_selector[8].sTxtLabel = "fly to airport" menu_stage_selector[9].sTxtLabel = "drive with patricia" menu_stage_selector[10].sTxtLabel = "final mocap" #endif int i = 0 int j = 0 swim_to_lab_dialogue_status = 0 get_to_lift_master_flow_system_status = 0 elevator_0_system_status = 0 elevator_1_system_status = 0 get_to_lift_dialogue_status = 0 dialogue_system_1_status = 0 scientist_0_ai_status = 0 scientist_1_ai_status = 0 scientist_2_ai_system_status = 0 scientist_3_ai_system_status = 0 scientist_4_ai_system_status = 0 scientist_5_ai_system_status = 0 get_chemicals_master_flow_system_status = 0 shootout_master_flow_system_status = 0 patrol_security_guard_1_ai_system_status = 0 patrol_security_guard_2_ai_system_status = 0 scientist_5_ai_system_status = 0 metal_door_system_status = 0 hotswap_to_forklift_status = 0 hotswap_to_forklift_status = 0 helicopter_hover_system_status = 0 iPlayerMoveProg = 0 cut_pipe_setup_status = 0 go_to_pipe_dialogue_status = 0 chemicals_cutscene_status = 0 dave_ai_system_status = 0 steve_ai_system_status = 0 dave_ai_system_1_status = 0 steve_ai_system_1_status = 0 steve_ai_system_2_status = 0 dave_ai_system_2_status = 0 dialogue_system_2_status = 0 collect_crate_dialogue_system_status = 0 get_to_pipe_running_status = 0 open_door_with_security_card_cutscene_status = 0 open_lab_doors_status = 0 load_fridge_status = 0 monkey_sounds_system_status = 0 shootout_audio_event_system_status = 0 opening_cutscene_status = 0 welding_dialogue_system_status = 0 helicopter_time = 0 security_card_physics_system_status = 0 alarm_time = 0 pallet_time = 0 collect_crate_mocap_status = 0 fly_to_airport_master_flow_system_status = 0 switch_to_trevor_system_status = 0 drop_off_patricia_status = 0 drop_off_patricia_dialogue_system_status = 0 patrol_security_guard_0_time = 0 patrol_security_guard_0_system_status = 0 DIVE_OUT_CUTSCENE_master_flow_system_status = 0 get_to_chemicals_audio_event_system_status = 0 fly_to_airport_dialogue_system_status = 0 move_doors_14_and_15_system_status = 0 dave_dialogue_time = 0 i_num_route_nodes_not_hit = 0 lift_cutscene_status = 0 crate_land_cutscene_status = 0 airport_mocap_status = 0 michael_enter_boat_anim_system_status = 0 dave_enter_boat_anim_system_status = 0 steve_enter_boat_anim_system_status = 0 fbi_5_int_tods_system_status = 0 tods_original_time = 0 tods_target_time = 0 shootout_audio_scene_system_status = 0 franklin_ai_system_status = 0 get_out_of_water_mocap_status = 0 steve_flash_light_time = 0 swim_to_pipe_dialogue_system_status = 0 dive_time = 0 dive_into_water_help_text_system_status = 0 patrol_security_guard_0_synchronized_scene_system_status = 0 switch_sound_time = 0 first_person_flash_time = 0 boat_time = get_game_timer() current_fuel_used = 0.0 stop_mission_fail_checks = false gun_fired = false activate_welding_cam = false welding_gun_fuel_fail = false helicopter_stabilized = false resume_dave_waypoint = false resume_steve_waypoint = false patrol_security_0_dropped_weapon = false alarm_fail = false alarm_time_stored = false stop_prcocessing_hover_system = false slow_dave_down_for_catch_up = false slow_steve_down_for_catch_up = false dave_combat_set = false steve_combat_set = false resume_lower_priority_conversation = false apply_steve_blood_decal = false allow_player_fired_weapon = true increase_pilot_skill = false render_underwater_tunnel_on_radar = false attacked_madrazzos_guard_fail = false take_off_scuba_gear = false dave_water_spash_triggered = false steve_water_spash_triggered = false trevor_in_heli_hit_out_0 = false trevor_in_heli_transition_0 = false started_cutscene_as_michael = false boat_first_person_flash_completed = false airport_mocap_michael_in_0 = false cleanup_airport_cutscene = false steve_cover_point_stolen = false dave_cover_point_stolen = false steve_refresh_task = false scientist_4_dead = false scientist_5_dead = false //initialise switch mission variables back. selector_cam.bOKToSwitchPed = false selector_cam.bPedSwitched = false boat.model = DINGHY grill_0_ptfx_offset[0] = <<-0.760, -0.04, -0.78>> grill_0_ptfx_offset[1] = <<-0.8, -0.04, -0.52>> grill_0_ptfx_offset[2] = <<-0.7, -0.04, -0.25>> grill_0_ptfx_offset[3] = <<-0.74, -0.04, 0.0>> grill_0_ptfx_offset[4] = <<-0.74, -0.04, 0.26>> grill_0_ptfx_offset[5] = <<-0.78, -0.04, 0.54>> grill_0_ptfx_offset[6] = <<-0.76, -0.04, 0.78>> grill_0_ptfx_offset[7] = <<-0.64, -0.04, -0.86>> grill_0_ptfx_offset[8] = <<-0.64, -0.04, 0.94>> grill_0_ptfx_offset[9] = <<-0.39, -0.04, -0.86>> grill_0_ptfx_offset[10] = <<-0.64, -0.04, 0.94>> grill_0_ptfx_offset[11] = <<-0.12, -0.04, -0.920>> grill_0_ptfx_offset[12] = <<-0.12, -0.04, 1.02>> grill_0_ptfx_offset[13] = <<0.1, -0.04, -0.88>> grill_0_ptfx_offset[14] = <<0.1, -0.04, 0.95>> grill_0_ptfx_offset[15] = <<0.37, -0.04, -0.92>> grill_0_ptfx_offset[16] = <<0.37, -0.04, 0.95>> grill_0_ptfx_offset[17] = <<0.640, -0.04, -0.92>> grill_0_ptfx_offset[18] = <<0.640, -0.04, 0.94>> grill_0_ptfx_offset[19] = <<0.77, -0.04, -0.77>> grill_0_ptfx_offset[20] = <<0.73, -0.04, -0.5>> grill_0_ptfx_offset[21] = <<0.85, -0.04, -0.23>> grill_0_ptfx_offset[22] = <<0.85, -0.04, 0.03>> grill_0_ptfx_offset[23] = <<0.77, -0.04, 0.29>> grill_0_ptfx_offset[24] = <<0.81, -0.04, 0.5>> grill_0_ptfx_offset[25] = <<0.79, -0.04, 0.77>> flare[0].model = Prop_Flare_01 flare[1].model = Prop_Flare_01 flare[2].model = Prop_Flare_01 flare[3].model = Prop_Flare_01 steves_mask.model = p_s_scuba_mask_s steves_mask.pos = <<3530.450, 3705.500, 20.080>> steves_mask.rot = <<0.0, 90.0, 0.0>> scuba_mike.model = p_michael_scuba_mask_s scuba_mike.pos = <<3530.000, 3705.610, 20.096>> scuba_mike.rot = <<0.0, 90.000, 20.0>> scuba_dave.model = p_d_scuba_mask_s scuba_dave.pos = <<3531.180, 3707.080, 20.096>> scuba_dave.rot = <<0.0, 90.000, 40.000>> OxyTank_1.model = P_s_scuba_tank_s OxyTank_1.pos = <<3529.810, 3706.640, 20.073>> OxyTank_1.rot = <<270.000, 90.000, 0.0>> OxyTank_2.model = P_d_scuba_tank_s OxyTank_2.pos = <<3530.540, 3707.06, 20.136>> OxyTank_2.rot = <<270.00, 270.00, 0.0>> OxyTank_3.model = p_michael_scuba_tank_s OxyTank_3.pos = <<3529.210, 3705.480, 20.071>> OxyTank_3.rot = <<270.000, 2.000, 200.000>> scuba_steve.model = p_steve_scuba_hood_s scuba_steve.pos = <<3530.350, 3705.980, 20.100>> scuba_steve.rot = <<0.0, 90.000, 0.0>> swag_bag.model = p_ld_heist_bag_s_1 swag_bag.pos = <<3529.52, 3705.84, 19.9797>> swag_bag.rot = <<-16.8547, 13.5841, 1.81239>> chemicals.model = P_Chem_Vial_02b_s chemicals.pos = <<3560.53, 3672.64, 28.12>> chemicals.heading = 252.8533 nerve_agent.model = prop_cs_vial_01 nerve_agent_store.model = p_chem_vial_02b_s clip_board.model = P_CS_Clipboard pencil.model = prop_pencil_01 // welding_box[0].x = 0.07 // welding_box[0].y = 0.82 // welding_box[0].width = 0.02 // welding_box[0].height = 0.27 // welding_box[0].r = 135 // welding_box[0].g = 206 // welding_box[0].b = 255 // welding_box[0].a = 100 // // welding_box[1].x = 0.07 // welding_box[1].y = 0.82 // welding_box[1].width = 0.02 // welding_box[1].height = 0.27 // welding_box[1].r = 255 // welding_box[1].g = 0 // welding_box[1].b = 0 // welding_box[1].a = 200 elevator_display[0].model = V_ILev_BL_elevDis1 elevator_display[0].pos = <<3540.250, 3673.250, 22.457>> elevator_display[0].rot = <<0.0, 0.0, 351.320>> elevator_display[1].model = V_ILev_BL_elevDis2 elevator_display[1].pos = <<3540.250, 3673.250, 22.457>> elevator_display[1].rot = <<0.0, 0.0, 351.320>> elevator_display[2].model = V_ILev_BL_elevDis3 elevator_display[2].pos = <<3540.250, 3673.250, 22.457>> elevator_display[2].rot = <<0.0, 0.0, 351.320>> security_card.pos = <<3540.8794, 3674.3628, 19.9944>> security_card.model = P_LD_ID_CARD_002// P_LD_ID_CARD_01 P_LD_ID_CARD_002 dave.pos = <<3527.19, 3703.39, 19.9928>> dave.heading = 65.00 dave.run_to_pos = <<3834.781250, 3673.608154, -22.032242>> dave.model = get_npc_ped_model(char_dave) dave.weapon = WEAPONTYPE_CARBINERIFLE dave.health = 500 dave.name = "buddy dave" steve.pos = <<3524.19, 3702.99, 19.9928>> steve.heading = -110.00 steve.run_to_pos = <<3837.939941, 3670.398682, -21.249117>> steve.model = get_npc_ped_model(char_steve) steve.weapon = WEAPONTYPE_CARBINERIFLE steve.health = 500 steve.name = "buddy steve" scientist[0].pos = <<3524.77, 3699.09, 19.992>>//20.992 scientist[0].heading = -175.862152 scientist[0].run_to_pos = <<3524.8765, 3693.8721, 19.9854>> scientist[0].model = S_M_M_SCIENTIST_01 scientist[0].weapon = weapontype_unarmed scientist[0].health = 120 scientist[0].name = "scientist 0" scientist[1].pos = <<3540.5374, 3675.7593, 19.9944>> scientist[1].heading = 165.8220 scientist[1].run_to_pos = <<3539.8267, 3671.0000, 19.9944>> scientist[1].model = S_M_M_SCIENTIST_01 scientist[1].weapon = weapontype_unarmed scientist[1].health = 120 scientist[1].name = "scientist 1" scientist[2].pos = <<3536.9797, 3663.1023, 27.1230>> scientist[2].heading = 173.1075 scientist[2].model = S_M_M_SCIENTIST_01 scientist[2].weapon = weapontype_unarmed scientist[2].health = 120 scientist[2].name = "scientist 2" scientist[3].pos = <<3538.2834, 3663.7854, 27.1230>> scientist[3].heading = 183.00 scientist[3].model = S_M_M_SCIENTIST_01 scientist[3].weapon = weapontype_unarmed scientist[3].health = 120 scientist[3].name = "scientist 3" scientist[4].pos = <<3560.0432, 3671.9644, 27.1230>> scientist[4].heading = 353.3200 scientist[4].run_to_pos = <<3558.4578, 3669.7148, 27.1230>> scientist[4].model = S_M_M_SCIENTIST_01 scientist[4].weapon = weapontype_unarmed scientist[4].health = 120 scientist[4].name = "scientist 4" scientist[5].pos = <<3566.8088, 3686.5010, 27.1215>> scientist[5].heading = 190.00 scientist[5].run_to_pos = <<3556.4409, 3679.3994, 27.1230>> scientist[5].model = S_M_M_SCIENTIST_01 scientist[5].weapon = weapontype_unarmed scientist[5].health = 120 scientist[5].name = "scientist 5" scientist[6].pos = <<3540.8481, 3676.4458, 27.1213>> scientist[6].heading = 186.5477 scientist[6].model = S_M_M_SCIENTIST_01 scientist[6].weapon = weapontype_unarmed scientist[6].health = 120 patrol_security_guard[0].pos = <<3529.6760, 3672.9519, 19.9944>> patrol_security_guard[0].heading = 73.0071 patrol_security_guard[0].run_to_pos = <<3520.9, 3674.6, 19.9944>> patrol_security_guard[0].model = S_M_M_chemsec_01 patrol_security_guard[0].weapon = weapontype_pistol patrol_security_guard[0].health = 120 patrol_security_guard[1].pos = <<3550.0396, 3657.0144, 27.1232>> patrol_security_guard[1].heading = 172.4949 patrol_security_guard[1].run_to_pos = <<3527.2830, 3672.5750, 27.1230>> patrol_security_guard[1].model = S_M_M_chemsec_01 patrol_security_guard[1].weapon = weapontype_pistol patrol_security_guard[1].health = 110 patrol_security_guard[1].name = "PATROL guard 1" patrol_security_guard[2].pos = <<3550.1785, 3658.0042, 27.1232>> patrol_security_guard[2].heading = 162.00 patrol_security_guard[2].run_to_pos = <<3527.9856, 3674.2798, 27.1230>> patrol_security_guard[2].model = S_M_M_chemsec_01 patrol_security_guard[2].weapon = weapontype_pistol patrol_security_guard[2].health = 110 patrol_security_guard[2].name = "PATROL guard 2" security_guard[0].pos = <<3562.8367, 3694.0713, 28.1215>>//<<3564.4155, 3693.7666, 27.1230>> security_guard[0].heading = 160.3372 security_guard[0].run_to_pos = <<3564.4155, 3693.7666, 27.1230>> security_guard[0].model = S_M_M_chemsec_01 security_guard[0].weapon = weapontype_pistol security_guard[0].name = "guard 0" security_guard[0].health = 200 security_guard[0].accuracy = 10 //security_guard[0].damaged_by_player = true security_guard[1].pos = <<3573.3105, 3693.6379, 26.1217>> security_guard[1].heading = 139.3572 security_guard[1].run_to_pos = <<3567.2793, 3694.9150, 27.1217>>//<<3566.4856, 3694.1458, 27.1230>> security_guard[1].model = S_M_M_chemsec_01 security_guard[1].weapon = weapontype_pistol security_guard[1].name = "guard 1" security_guard[1].health = 200 security_guard[1].accuracy = 15 security_guard[2].pos = <<3575.7859, 3691.3340, 26.1239>> security_guard[2].heading = 74.2808 security_guard[2].run_to_pos = <<3575.7859, 3691.3340, 26.4239>> security_guard[2].model = S_M_M_chemsec_01 security_guard[2].weapon = weapontype_pistol security_guard[2].name = "guard 2" security_guard[2].health = 200 security_guard[2].accuracy = 10 //security_guard[2].damaged_by_player = true security_guard[3].pos = <<3580.6838, 3688.4028, 26.1239>> security_guard[3].heading = 79.1393 security_guard[3].run_to_pos = <<3576.5222, 3695.2253, 26.1239>> security_guard[3].model = S_M_M_chemsec_01 security_guard[3].weapon = weapontype_pistol security_guard[3].name = "guard 3" security_guard[3].health = 200 security_guard[3].accuracy = 15 security_guard[4].pos = <<3585.7605, 3683.3652, 26.6235>> security_guard[4].heading = 54.8469 security_guard[4].run_to_pos = <<3581.7512, 3692.3828, 26.1239>> security_guard[4].model = S_M_M_chemsec_01 security_guard[4].weapon = weapontype_pistol security_guard[4].name = "guard 4" security_guard[4].health = 200 security_guard[4].accuracy = 10 //security_guard[4].damaged_by_player = true security_guard[5].pos = <<3584.7634, 3686.6526, 26.6235>> security_guard[5].heading = 347.9796 security_guard[5].run_to_pos = <<3584.7634, 3686.6526, 26.6235>> security_guard[5].model = S_M_M_chemsec_01 security_guard[5].weapon = weapontype_pistol security_guard[5].name = "guard 5" security_guard[5].health = 200 security_guard[5].accuracy = 15 //security_guard[5].damaged_by_player = true security_guard[6].pos = <<3576.4822, 3689.4355, 26.1239>> security_guard[6].heading = 77.3190 security_guard[6].run_to_pos = <<3582.4668, 3694.6311, 26.1239>> security_guard[6].model = S_M_M_chemsec_01 security_guard[6].weapon = weapontype_pistol security_guard[6].name = "guard 6" security_guard[6].health = 200 security_guard[6].accuracy = 10 //security_guard[6].damaged_by_player = true security_guard[7].pos = <<3593.6277, 3686.5654, 26.6235>> security_guard[7].heading = 63 security_guard[7].run_to_pos = <<3590.6499, 3682.9634, 26.6235>> security_guard[7].model = S_M_M_chemsec_01 security_guard[7].weapon = weapontype_pistol security_guard[7].name = "guard 7" security_guard[7].health = 200 security_guard[7].accuracy = 15 security_guard[8].pos = <<3597.5288, 3688.2859, 27.8234>> security_guard[8].heading = 144.6111 security_guard[8].run_to_pos = <<3597.5288, 3688.2859, 27.8234>> security_guard[8].model = S_M_M_chemsec_01 security_guard[8].weapon = weapontype_pistol security_guard[8].name = "guard 8" security_guard[8].health = 200 security_guard[8].accuracy = 10 //security_guard[7].damaged_by_player = true security_guard[9].pos = <<3586.5173, 3702.8423, 27.9924>> security_guard[9].heading = 167.7553 security_guard[9].run_to_pos = <<3586.5540, 3694.6011, 27.8234>> security_guard[9].model = S_M_M_chemsec_01 security_guard[9].weapon = weapontype_pistol security_guard[9].name = "guard 9" security_guard[9].health = 200 security_guard[9].accuracy = 15 security_guard[10].pos = <<3587.9514, 3708.9248, 28.6908>> security_guard[10].heading = 229.3332 security_guard[10].run_to_pos = <<3587.9514, 3708.9248, 28.6908>> security_guard[10].model = S_M_M_chemsec_01 security_guard[10].weapon = weapontype_pistol security_guard[10].name = "guard 10" security_guard[10].health = 200 security_guard[10].accuracy = 10 //security_guard[10].damaged_by_player = true security_guard[11].pos = <<3589.8770, 3714.4609, 28.6897>> security_guard[11].heading = 208.1707 security_guard[11].run_to_pos = <<3594.0642, 3711.1917, 28.6897>> security_guard[11].model = S_M_M_chemsec_01 security_guard[11].weapon = weapontype_pistol security_guard[11].name = "guard 11" security_guard[11].health = 200 security_guard[11].accuracy = 15 security_guard[12].pos = <<3597.9236, 3722.3867, 28.6908>> security_guard[12].heading = 159.0877 security_guard[12].run_to_pos = <<3593.3491, 3713.9941, 28.6908>> security_guard[12].model = S_M_M_chemsec_01 security_guard[12].weapon = weapontype_pistol security_guard[12].name = "guard 12" security_guard[12].health = 200 security_guard[12].accuracy = 10 //security_guard[12].damaged_by_player = true security_guard[13].pos = <<3599.4976, 3724.4172, 28.6908>> security_guard[13].heading = 147.1120 security_guard[13].run_to_pos = <<3594.2302, 3711.4888, 28.6908>> security_guard[13].model = S_M_M_chemsec_01 security_guard[13].weapon = weapontype_pistol security_guard[13].name = "guard 13" security_guard[13].health = 200 security_guard[13].accuracy = 15 security_guard[14].pos = <<3589.7344, 3718.8298, 28.6908>> security_guard[14].heading = 167.9553 security_guard[14].run_to_pos = <<3594.0735, 3710.5874, 28.6908>> security_guard[14].model = S_M_M_chemsec_01 security_guard[14].weapon = weapontype_pistol security_guard[14].name = "guard 14" security_guard[14].health = 200 security_guard[14].accuracy = 10 //security_guard[14].damaged_by_player = true security_guard[15].pos = <<3600.8049, 3723.7505, 28.6908>> security_guard[15].heading = 129.4799 security_guard[15].run_to_pos = <<3593.5740, 3724.5588, 28.6908>> security_guard[15].model = S_M_M_chemsec_01 security_guard[15].weapon = weapontype_pistol security_guard[15].name = "guard 15" security_guard[15].health = 200 security_guard[15].accuracy = 15 security_guard[16].pos = <<3604.4436, 3721.4883, 28.6908>> security_guard[16].heading = 158.22 security_guard[16].run_to_pos = <<3597.08008, 3722.00757, 28.68960>> security_guard[16].model = S_M_M_chemsec_01 security_guard[16].weapon = weapontype_pistol security_guard[16].name = "guard 16" security_guard[16].health = 200 security_guard[16].accuracy = 10 //security_guard[16].damaged_by_player = true //loading bay security_guard[17].pos = <<3611.2488, 3732.3359, 27.6901>>//<<3613.4595, 3732.9265, 27.6917>> security_guard[17].heading = 175.1256 security_guard[17].run_to_pos = <<3619.8103, 3728.4971, 27.6917>> security_guard[17].model = S_M_M_chemsec_01 security_guard[17].weapon = WEAPONTYPE_PUMPSHOTGUN security_guard[17].name = "guard 17" security_guard[17].health = 200 security_guard[17].accuracy = 15 //security_guard[17].damaged_by_player = true security_guard[18].pos = <<3610.9238, 3726.0293, 28.6908>> security_guard[18].heading = 150.7710 security_guard[18].run_to_pos = <<3613.8496, 3733.4104, 27.6917>> security_guard[18].model = S_M_M_chemsec_01 security_guard[18].weapon = WEAPONTYPE_PUMPSHOTGUN security_guard[18].name = "guard 18" security_guard[18].health = 200 security_guard[18].accuracy = 10 //security_guard[18].damaged_by_player = true //first truck security_guard[19].pos = <<3624.3440, 3734.1987, 27.6917>> security_guard[19].heading = 150.7710 security_guard[19].run_to_pos = <<3624.3440, 3734.1987, 27.6917>> security_guard[19].model = S_M_Y_Marine_03 security_guard[19].weapon = WEAPONTYPE_CARBINERIFLE security_guard[19].name = "guard 19" security_guard[19].health = 200 security_guard[19].accuracy = 15 security_guard[20].pos = <<3612.8455, 3730.4431, 27.6917>> security_guard[20].heading = 150.7710 security_guard[20].run_to_pos = <<3623.7, 3739.14, 27.6917>> security_guard[20].model = S_M_Y_Marine_03 security_guard[20].weapon = weapontype_pistol security_guard[20].name = "guard 20" security_guard[20].health = 200 security_guard[20].accuracy = 10 //security_guard[20].damaged_by_player = true security_guard[21].pos = <<3619.8191, 3761.0786, 27.5154>> security_guard[21].heading = 175.1773 security_guard[21].run_to_pos = <<3619.8059, 3745.1394, 27.6921>> security_guard[21].model = S_M_Y_Marine_03 security_guard[21].weapon = WEAPONTYPE_CARBINERIFLE security_guard[21].name = "guard 21" security_guard[21].health = 200 security_guard[21].accuracy = 15 security_guard[22].pos = <<3621.5703, 3766.4048, 27.5154>> security_guard[22].heading = 174.0157 security_guard[22].run_to_pos = <<3609.00, 3739.27, 27.69>> security_guard[22].model = S_M_Y_Marine_03 security_guard[22].weapon = weapontype_pistol security_guard[22].name = "guard 22" security_guard[22].health = 200 security_guard[22].accuracy = 10 //security_guard[22].damaged_by_player = true security_guard[23].pos = <<3636.9309, 3761.5469, 27.5154>> security_guard[23].heading = 145.2723 security_guard[23].run_to_pos = <<3613.9329, 3726.1982, 27.6917>> security_guard[23].model = S_M_Y_Marine_03 security_guard[23].weapon = WEAPONTYPE_CARBINERIFLE security_guard[23].name = "guard 23" security_guard[23].health = 200 security_guard[23].accuracy = 15 //security_guard[23].damaged_by_player = true //second truck security_guard[24].pos = <<3613.2249, 3748.5920, 27.6895>> security_guard[24].heading = 188.1327 security_guard[24].run_to_pos = <<3615.6658, 3744.9868, 27.6917>> security_guard[24].model = S_M_Y_Marine_03 security_guard[24].weapon = WEAPONTYPE_CARBINERIFLE security_guard[24].name = "guard 24" security_guard[24].health = 200 security_guard[24].accuracy = 10 //security_guard[24].damaged_by_player = true security_guard[25].pos = <<3622.6030, 3744.0317, 27.6895>> security_guard[25].heading = 144.8152 security_guard[25].run_to_pos = <<3613.3887, 3734.7832, 27.6917>> security_guard[25].model = S_M_Y_Marine_03 security_guard[25].weapon = weapontype_pistol security_guard[25].name = "guard 25" security_guard[25].health = 200 security_guard[25].accuracy = 15 security_guard[26].pos = <<3613.7524, 3728.8669, 27.6917>> security_guard[26].heading = 151.6589 security_guard[26].run_to_pos = <<3627.78, 3738.47, 27.69>> security_guard[26].model = S_M_Y_Marine_03 security_guard[26].weapon = WEAPONTYPE_CARBINERIFLE security_guard[26].name = "guard 26" security_guard[26].health = 200 security_guard[26].accuracy = 10 //security_guard[26].damaged_by_player = true security_guard[27].pos = <<3611.3926, 3725.0183, 28.6908>> security_guard[27].heading = 151.6589 security_guard[27].run_to_pos = <<3611.3926, 3725.0183, 28.6908>> security_guard[27].model = S_M_Y_Marine_03 security_guard[27].weapon = WEAPONTYPE_CARBINERIFLE security_guard[27].name = "guard 27" security_guard[27].health = 200 security_guard[27].accuracy = 15 security_guard[27].damaged_by_player = true //third car security_guard[28].pos = <<3619.6719, 3728.5786, 27.6917>> security_guard[28].heading = 151.6589 security_guard[28].run_to_pos = <<3619.6719, 3728.5786, 27.6917>> security_guard[28].model = S_M_Y_Marine_03 security_guard[28].weapon = weapontype_pistol security_guard[28].name = "guard 28" security_guard[28].health = 200 security_guard[28].accuracy = 10 //security_guard[28].damaged_by_player = true security_guard[29].pos = <<3617.9541, 3737.7649, 27.6917>> security_guard[29].heading = 151.6589 security_guard[29].run_to_pos = <<3617.9541, 3737.7649, 27.6917>> security_guard[29].model = S_M_Y_Marine_03 security_guard[29].weapon = WEAPONTYPE_CARBINERIFLE security_guard[29].name = "guard 29" security_guard[29].health = 200 security_guard[29].accuracy = 15 security_guard[30].pos = <<3618.3313, 3727.0781, 27.6917>> security_guard[30].heading = 151.6589 security_guard[30].run_to_pos = <<3618.3313, 3727.0781, 27.6917>> security_guard[30].model = S_M_Y_Marine_03 security_guard[30].weapon = WEAPONTYPE_CARBINERIFLE security_guard[30].name = "guard 30" security_guard[30].health = 200 security_guard[30].accuracy = 10 //security_guard[30].damaged_by_player = true security_guard_2[0].model = cs_paper security_guard_2[0].pos = <<3620.2502, 3750.6943, 27.6897>> security_guard_2[0].heading = 332.3232 security_guard_2[0].run_to_pos = <<3620.2502, 3750.6943, 27.6897>> security_guard_2[0].model = S_M_Y_Marine_03 security_guard_2[0].weapon = WEAPONTYPE_pistol security_guard_2[0].name = "guard2 - 0" security_guard_2[0].health = 200 security_guard_2[0].accuracy = 10 security_guard_2[1].model = s_m_y_marine_02 security_guard_2[1].pos = <<3622.8577, 3753.4792, 27.5157>> security_guard_2[1].heading = 331.1759 security_guard_2[1].run_to_pos = <<3622.8577, 3753.4792, 27.5157>> security_guard_2[1].model = S_M_Y_Marine_03 security_guard_2[1].weapon = weapontype_assaultrifle security_guard_2[1].name = "guard2 1" security_guard_2[1].health = 200 security_guard_2[1].accuracy = 10 security_guard_2[2].model = s_m_y_marine_02 security_guard_2[2].pos = <<3625.5471, 3752.9734, 27.5157>> security_guard_2[2].heading = 351.0864 security_guard_2[2].run_to_pos = <<3625.5471, 3752.9734, 27.5157>> security_guard_2[2].model = S_M_Y_Marine_03 security_guard_2[2].weapon = weapontype_pistol security_guard_2[2].name = "guard2 2" security_guard_2[2].health = 200 security_guard_2[2].accuracy = 10 security_guard_2[3].model = s_m_y_marine_02 security_guard_2[3].pos = <<3628.5378, 3750.7869, 27.5157>> security_guard_2[3].heading = 344.9522 security_guard_2[3].run_to_pos = <<3628.5378, 3750.7869, 27.5157>> security_guard_2[3].model = S_M_Y_Marine_03 security_guard_2[3].weapon = weapontype_carbinerifle security_guard_2[3].name = "guard2 3" security_guard_2[3].health = 200 security_guard_2[3].accuracy = 10 army_truck[0].model = barracks army_truck[0].pos = <<3615.0320, 3799.1560, 28.5405>> army_truck[0].heading = 212.1782 army_truck[0].recording_number = 001 army_truck[1].model = crusader army_truck[1].pos = <<3600.7698, 3803.5815, 28.7849>> army_truck[1].heading = 247.7738 army_truck[1].recording_number = 002 army_truck[2].model = crusader army_truck[2].pos = <<3587.5354, 3809.0100, 29.0764>> army_truck[2].heading = 250.22 army_truck[2].recording_number = 003 truck.pos = <<1756.7319, 3271.8926, 40.2172>> truck.heading = 16.1635 truck.model = hauler truck.recording_number = 10 trailer.pos = <<1756.7319, 3271.8926, 45.2172>> trailer.heading = 16.1635 trailer.model = trflat trailer.recording_number = 11 crate_veh.model = hauler crate_veh.recording_number = 12 fridge_pallet.model = P_PALLET_02A_S fridge_pallet.pos = <<3638.326, 3771.813, 38.930>> fridge_pallet.heading = 0.0 //328.3112 fridge.model = PROP_BIOTECH_STORE fridge.pos = <<3638.326, 3771.813, 35.930>> //27.6920 fridge.heading = 340.000 helicopter.model = CARGOBOB2 crate.model = PROP_LD_CONTAINER crate.pos = <<3638.326, 3771.813, 28.930>> crate.heading = 340.00 container_light.model = Prop_LD_CONT_Light_01 container_light.pos = <<3638.326, 3771.813, 28.930>> container_light.heading = 340.00 monkey_sounds_object.pos = <<3592.6, 3714, 31.8>> monkey_sounds_object.model = PROP_LD_TEST_01 monkey[0].pos = <<3588.200, 3715.077, 28.980>> monkey[0].heading = -97.680 monkey[0].model = A_C_Rhesus monkey[0].weapon = weapontype_animal monkey[0].health = 110 monkey[0].name = "monkey 0" monkey[1].pos = <<3588.200, 3715.077, 30.495>> monkey[1].heading = -85.680 monkey[1].model = A_C_Rhesus monkey[1].weapon = weapontype_animal monkey[1].health = 110 monkey[1].name = "monkey 1" monkey[2].pos = << 3588.150, 3713.727, 30.495>> monkey[2].heading = -97.680 monkey[2].model = A_C_Rhesus monkey[2].weapon = weapontype_animal monkey[2].health = 110 monkey[2].name = "monkey 2" monkey[3].pos = << 3587.9, 3713.727, 28.980>> monkey[3].heading = -97.680 monkey[3].model = A_C_Rhesus monkey[3].weapon = weapontype_animal monkey[3].health = 110 monkey[3].name = "monkey 3" monkey[4].pos = <<3596.010, 3710.630, 28.980>> monkey[4].heading = 97.680 monkey[4].model = A_C_Rhesus monkey[4].weapon = weapontype_animal monkey[4].health = 110 monkey[4].name = "monkey 4" monkey[5].pos = <<3595.910, 3710.580, 30.495>> //30.33 30.23 monkey[5].heading = 85.680 monkey[5].model = A_C_Rhesus monkey[5].weapon = weapontype_animal monkey[5].health = 110 monkey[5].name = "monkey 5" monkey[6].pos = <<3597.260, 3716.730, 30.495>> monkey[6].heading = 97.680 monkey[6].model = A_C_Rhesus monkey[6].weapon = weapontype_animal monkey[6].health = 110 monkey[6].name = "monkey 6" monkey[7].pos = <<3597.260, 3716.730, 28.980>> monkey[7].heading = 85.680 monkey[7].model = A_C_Rhesus monkey[7].weapon = weapontype_animal monkey[7].health = 110 monkey[7].name = "monkey 7" monkey[8].pos = <<3588.780, 3717.470, 28.980>> monkey[8].heading = -97.680 monkey[8].model = A_C_Rhesus monkey[8].weapon = weapontype_animal monkey[8].health = 110 monkey[8].name = "monkey 8" monkey[9].pos = <<3591.450, 3725.020, 28.980>> monkey[9].heading = -109.0 monkey[9].model = A_C_Rhesus monkey[9].weapon = weapontype_animal monkey[9].health = 110 monkey[9].name = "monkey 9" monkey[10].pos = <<3593.000, 3727.170, 28.980>> monkey[10].heading = -133.000 monkey[10].model = A_C_Rhesus monkey[10].weapon = weapontype_animal monkey[10].health = 110 monkey[10].name = "monkey 10" monkey[11].pos = <<3593.000, 3727.170, 30.530>> monkey[11].heading = -133.000 monkey[11].model = A_C_Rhesus monkey[11].weapon = weapontype_animal monkey[11].health = 110 monkey[11].name = "monkey 11" monkey[12].pos = <<3593.700, 3728.220, 28.980>> monkey[12].heading = -133.000 monkey[12].model = A_C_Rhesus monkey[12].weapon = weapontype_animal monkey[12].health = 110 monkey[12].name = "monkey 12" monkey[13].pos = <<3596.720, 3721.040, 28.980>> monkey[13].heading = -41.000 monkey[13].model = A_C_Rhesus monkey[13].weapon = weapontype_animal monkey[13].health = 110 monkey[13].name = "monkey 13" monkey[14].pos = <<3596.820, 3721.090, 30.495>> monkey[14].heading = -41.000 monkey[14].model = A_C_Rhesus monkey[14].weapon = weapontype_animal monkey[14].health = 110 monkey[14].name = "monkey 14" monkey[15].pos = <<3597.770, 3720.190, 28.980>> monkey[15].heading = -18.00 monkey[15].model = A_C_Rhesus monkey[15].weapon = weapontype_animal monkey[15].health = 110 monkey[15].name = "monkey 15" monkey[16].pos = <<3588.230, 3710.2, 28.980>> monkey[16].heading = -96 monkey[16].model = A_C_Rhesus monkey[16].weapon = weapontype_animal monkey[16].health = 110 monkey[16].name = "monkey 16" crate_door_left.pos = <<3602.00, 3768.5, 33.00>> crate_door_left.model = PROP_LD_CONTAIN_DL2 crate_door_right.pos = <<3602.00, 3768.5, 35.00>> crate_door_right.model = PROP_LD_CONTAIN_DR2 steve_badge.model = PROP_FIB_BADGE steve_badge.pos = <<3622.69, 3749.85, 37.00>> blood.decal_texture_id = DECAL_RSID_BLOOD_DIRECTIONAL blood.pos = <<3622.20313, 3749.21484, 27.69010>> //47.43 blood.direction = <<0.0, 0.0, -1.0>> blood.side = normalise_vector(<<0.0, 1.0, 0.0>>) //heading blood.width = 0.3 blood.height = 0.3 blood.fAlpha = 1.0 blood.life = -1 blood.wash_amount = 0.3 blood.decal_removed = false trevors_truck.model = get_player_veh_model(char_trevor) trevors_truck.pos = <<233.0237, 3324.8171, 39.9775>> trevors_truck.heading = 159.5922 trevors_truck.recording_number = 005 madrazzos_guard[0].model = G_M_Y_PoloGoon_01 madrazzos_guard[0].pos = <<1382.6825, 1142.0864, 113.3342>> madrazzos_guard[0].heading = 74.6425 madrazzos_guard[0].health = 200 madrazzos_guard[0].weapon = WEAPONTYPE_pistol madrazzos_guard[0].name = "mad guard 0" madrazzos_guard[1].model = G_M_Y_PoloGoon_01 madrazzos_guard[1].pos = <<1384.9778, 1153.2777, 113.3342>> madrazzos_guard[1].heading = 104.8820 madrazzos_guard[1].health = 200 madrazzos_guard[1].weapon = WEAPONTYPE_pistol madrazzos_guard[1].name = "mad guard 1" patricia.model = get_npc_ped_model(CHAR_PATRICIA) patricia.health = 200 patricia.weapon = weapontype_unarmed for i = 0 to count_of(buddy_swimming_status) - 1 buddy_swimming_status[i] = 0 endfor for i = 0 to count_of(security_guard) - 1 security_guard_ai_system_status[i] = attack_phase_0 security_guard[i].created = false endfor for i = 0 to NUM_COLUMNS - 1 for j = 0 to NUM_NODES_PER_COLUMN - 1 s_welding_columns[i][j].time = 0.0 endfor endfor for i = 0 to NUM_ROWS - 1 for j = 0 to NUM_NODES_PER_ROW - 1 s_welding_rows[i][j].time = 0.0 endfor endfor for i = 0 to count_of(scientist) - 1 scientist[i].was_stunned = false scientist[i].created = false scientist_time[i] = 0 endfor for i = 0 to count_of(patrol_security_guard) - 1 patrol_security_guard[i].was_stunned = false patrol_security_guard[i].created = false endfor for i = 0 to count_of(monkey) - 1 monkey_anim_status[i] = 0 monkey[i].created = false endfor for i = 0 to count_of(dave_aiming_task_given) - 1 dave_aiming_task_given[i] = false endfor for i = 0 to count_of(steve_aiming_task_given) - 1 steve_aiming_task_given[i] = false endfor for i = 0 to count_of(monkey_sound) - 1 monkey_sound[i] = get_sound_id() endfor for i = 0 to count_of(madrazzos_guard) - 1 madrazzos_guard_ai_system_status[i] = 0 madrazzos_guard[i].created = false endfor // for i = 0 to count_of(dave_aiming_task_given) - 1 // dave_aiming_task_given[i] = false // endfor endproc proc delete_all_mission_assets_for_fail() clear_prints() CLEAR_HELP() KILL_ANY_CONVERSATION() SET_WANTED_LEVEL_MULTIPLIER(1.0) DISPLAY_RADAR(TRUE) DISPLAY_HUD(TRUE) SET_WIDESCREEN_BORDERS(FALSE, 0) //FORCE_RETICLE_MODE(hud_reticle_default) DISABLE_CELLPHONE(FALSE) IF IS_PLAYER_PLAYING(PLAYER_ID()) SET_PLAYER_CONTROL(PLAYER_ID(), TRUE) //CLEAR_PED_TASKS_IMMEDIATELY(PLAYER_PED_ID()) clear_ped_tasks(player_ped_id()) SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(PLAYER_PED_ID(), FALSE) FREEZE_ENTITY_POSITION(PLAYER_PED_ID(), FALSE) SET_ENTITY_VISIBLE(PLAYER_PED_ID(), TRUE) SET_ENTITY_INVINCIBLE(PLAYER_PED_ID(), FALSE) SET_ENTITY_PROOFS(PLAYER_PED_ID(), FALSE, FALSE, FALSE, FALSE, FALSE) SET_PED_CURRENT_WEAPON_VISIBLE(PLAYER_PED_ID(), TRUE) SET_PED_MAX_TIME_UNDERWATER(PLAYER_PED_ID(), -1.0) SET_PED_DIES_IN_WATER(PLAYER_PED_ID(), true) CLEAR_PED_SCUBA_GEAR_VARIATION(PLAYER_PED_ID()) ENDIF if is_valid_interior(interior_lab) UNPIN_INTERIOR(interior_lab) // script_assert("un pin") // wait(0) endif //Clean up audio // IF IS_AUDIO_SCENE_ACTIVE("BIOTECH_HEIST_UNDERWATER_SCENE") // STOP_AUDIO_SCENE("BIOTECH_HEIST_UNDERWATER_SCENE") // ENDIF DELETE_BIOTECH_ROPES(rope_chopper, b_ropes_created, b_ropes_attached) //Fix for following waypoint assert: clear tasks INT i = 0 if does_entity_exist(dave.ped) delete_ped(dave.ped) endif if does_entity_exist(steve.ped) delete_ped(steve.ped) endif for i = 0 to count_of(patrol_security_guard) - 1 if does_entity_exist(patrol_security_guard[i].ped) delete_ped(patrol_security_guard[i].ped) endif endfor for i = 0 to count_of(security_guard) - 1 if does_entity_exist(security_guard[i].ped) delete_ped(security_guard[i].ped) endif endfor for i = 0 to count_of(scientist) - 1 if does_entity_exist(scientist[i].ped) delete_ped(scientist[i].ped) endif endfor REPEAT COUNT_OF(cover_point) i REMOVE_COVER_POINT(cover_point[i]) ENDREPEAT REMOVE_ALL_BLIPS(true) REMOVE_ALL_CAMERAS() REMOVE_ALL_OBJECTS(true) REMOVE_ALL_PEDS(true) REMOVE_ALL_VEHICLES(true) remove_all_sounds() remove_all_ptfx() DOOR_SYSTEM_SET_OPEN_RATIO(ENUM_TO_INT(DOORHASH_CHEMICAL_FACTORY_L), 0.0, false, false) //1.0 DOOR_SYSTEM_SET_DOOR_STATE(ENUM_TO_INT(DOORHASH_CHEMICAL_FACTORY_L), DOORSTATE_force_locked_this_frame, false, true) // Inside right shutter door DOOR_SYSTEM_SET_OPEN_RATIO(ENUM_TO_INT(DOORHASH_CHEMICAL_FACTORY_R), 0.0, false, false) //1.0 DOOR_SYSTEM_SET_DOOR_STATE(ENUM_TO_INT(DOORHASH_CHEMICAL_FACTORY_R), DOORSTATE_force_locked_this_frame, false, true) REMOVE_PTFX_ASSET() destroy_all_cams() REMOVE_GROUP(group_player_and_buddies) RELEASE_AMBIENT_AUDIO_BANK() UNREGISTER_SCRIPT_WITH_AUDIO() endproc proc remove_all_one_shot_music_events() cancel_music_event("CUT_PIPE_START") cancel_music_event("CUT_PIPE_END") cancel_music_event("SWIM_UP") cancel_music_event("LIFT_EXIT") cancel_music_event("BLUE_DOOR") cancel_music_event("HELI_OS") TRIGGER_MUSIC_EVENT("debug_stop_oneshot") endproc proc remove_all_mission_doors() int i for i = 0 to count_of(fbi_5_door) - 1 if is_door_registered_with_system(fbi_5_door[i]) REMOVE_DOOR_FROM_SYSTEM(fbi_5_door[i]) endif endfor endproc PROC MISSION_CLEANUP() // clear help // reset hud // reset all global / public systems or anything set in mission setup // wanted level // player // interior // audio // remove / reset any assets not required at end of mission. // // // if you pass the mission all entites will have been deleted and released at the correct times during the misison. // If you fail the mission then all assets will need to be deleted on the same frame as mission cleanup // mission cleanup will remove / release all assets which are not needed once the mission ends that are global // to pass and fail. int i CLEAR_HELP() KILL_ANY_CONVERSATION() DISPLAY_RADAR(TRUE) DISPLAY_HUD(TRUE) SET_WIDESCREEN_BORDERS(FALSE, 0) SET_VEHICLE_POPULATION_BUDGET(3) // Cleanup PC scripted controls SHUTDOWN_PC_SCRIPTED_CONTROLS() DISABLE_CELLPHONE(FALSE) ALLOW_DIALOGUE_IN_WATER(false) DISABLE_TAXI_HAILING(false) RELEASE_SUPPRESSED_EMERGENCY_CALLS() SET_BUILDING_STATE(BUILDINGNAME_IPL_FIB5_UNDERWATER_GRATE, BUILDINGSTATE_NORMAL) SET_VEHICLE_POPULATION_BUDGET(3) SET_PED_POPULATION_BUDGET(3) //SET_INTERIOR_CAPPED(INTERIOR_V_LAB, true) SET_INTERIOR_CAPPED_ON_EXIT(INTERIOR_V_LAB, TRUE) // Inside left //remove_MODEL_HIDE(<< 3620.84, 3751.53, 27.69 >>, 1.0, v_ilev_bl_shutter2) //DOOR_SYSTEM_SET_HOLD_OPEN(ENUM_TO_INT(DOORHASH_CHEMICAL_FACTORY_L), false) // Inside right //remove_MODEL_HIDE(<< 3627.71, 3746.72, 27.69 >>, 1.0, v_ilev_bl_shutter2) //DOOR_SYSTEM_SET_HOLD_OPEN(ENUM_TO_INT(DOORHASH_CHEMICAL_FACTORY_R), false) SET_SCENARIO_GROUP_ENABLED("ALAMO_PLANES", true) set_scenario_group_enabled("LOST_BIKERS", true) fbi5a_perform_tods = false //resets time of day flag set_fake_wanted_level(0) set_max_wanted_level(6) set_create_random_cops(true) set_wanted_level_multiplier(1.0) IF IS_PLAYER_PLAYING(PLAYER_ID()) SET_PLAYER_CONTROL(PLAYER_ID(), TRUE) SET_PED_USING_ACTION_MODE(player_ped_id(), false) CLEAR_PED_TASKS(PLAYER_PED_ID()) SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(PLAYER_PED_ID(), FALSE) if not is_entity_attached(player_ped_id()) FREEZE_ENTITY_POSITION(PLAYER_PED_ID(), FALSE) endif SET_ENTITY_VISIBLE(PLAYER_PED_ID(), TRUE) SET_ENTITY_INVINCIBLE(PLAYER_PED_ID(), FALSE) SET_ENTITY_PROOFS(PLAYER_PED_ID(), FALSE, FALSE, FALSE, FALSE, FALSE) //SET_PED_CURRENT_WEAPON_VISIBLE(PLAYER_PED_ID(), TRUE) SET_PED_MAX_TIME_UNDERWATER(PLAYER_PED_ID(), -1.0) SET_PED_DIES_IN_WATER(PLAYER_PED_ID(), true) SET_ENABLE_SCUBA(player_ped_id(), false) SET_PED_CAN_HEAD_IK(player_ped_id(), true) RESET_PED_IN_VEHICLE_CONTEXT(player_ped_id()) ENDIF IF interior_lab != NULL IF IS_INTERIOR_READY(interior_lab) UNPIN_INTERIOR(interior_lab) interior_lab = NULL ENDIF ENDIF clear_mission_locate_stuff(locates_data) SET_AUDIO_SCRIPT_CLEANUP_TIME(5000) for i = 0 to count_of(flare) - 1 if does_entity_exist(flare[i].obj) if is_entity_attached(flare[i].obj) detach_entity(flare[i].obj) endif endif endfor remove_all_sounds() remove_all_one_shot_music_events() //TRIGGER_MUSIC_EVENT("debug_stop_oneshot") trigger_music_event("FBI5A_MISSION_FAIL") stop_stream() stop_alarm("FIB_05_BIOTECH_LAB_ALARMS", false) release_mission_audio_bank() RELEASE_AMBIENT_AUDIO_BANK() UNREGISTER_SCRIPT_WITH_AUDIO() remove_all_mission_doors() REPEAT COUNT_OF(cover_point) i REMOVE_COVER_POINT(cover_point[i]) ENDREPEAT TERMINATE_THIS_THREAD() ENDPROC PROC MISSION_PASSED() Mission_Flow_Mission_Passed() SET_PLAYER_HAS_CHANGE_CLOTHES_ON_MISSION(CHAR_MICHAEL) MISSION_CLEANUP() ENDPROC PROC MISSION_FAILED() // check if we need to respawn the player in a different position, // if so call MISSION_FLOW_SET_FAIL_WARP_LOCATION() + SET_REPLAY_DECLINED_VEHICLE_WARP_LOCATION here delete_all_mission_assets_for_fail() MISSION_CLEANUP() // must only take 1 frame and terminate the thread ENDPROC proc remove_all_mission_assets() // remove structure // // text // mocap // reseting systems // wanted level 3 // player // interior // locates header // dialogue label hashes // all remaining assets clear_prints() clear_help() kill_any_conversation() if IS_CUTSCENE_PLAYING() STOP_CUTSCENE() else REMOVE_CUTSCENE() endif while is_cutscene_active() wait(0) endwhile REMOVE_CUTSCENE() SET_VEHICLE_POPULATION_BUDGET(0) clear_player_wanted_level(player_id()) set_fake_wanted_level(0) set_max_wanted_level(5) set_create_random_cops(true) set_wanted_level_multiplier(1.0) IF IS_PLAYER_PLAYING(PLAYER_ID()) SET_PLAYER_CONTROL(PLAYER_ID(), TRUE) SET_PED_USING_ACTION_MODE(player_ped_id(), false) CLEAR_PED_TASKS_immediately(PLAYER_PED_ID()) SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(PLAYER_PED_ID(), FALSE) if not is_entity_attached(player_ped_id()) FREEZE_ENTITY_POSITION(PLAYER_PED_ID(), FALSE) endif SET_ENTITY_VISIBLE(PLAYER_PED_ID(), TRUE) SET_ENTITY_INVINCIBLE(PLAYER_PED_ID(), FALSE) SET_ENTITY_PROOFS(PLAYER_PED_ID(), FALSE, FALSE, FALSE, FALSE, FALSE) SET_PED_CURRENT_WEAPON_VISIBLE(PLAYER_PED_ID(), TRUE) SET_PED_MAX_TIME_UNDERWATER(PLAYER_PED_ID(), -1.0) SET_PED_DIES_IN_WATER(PLAYER_PED_ID(), true) SET_PED_CAN_HEAD_IK(player_ped_id(), true) RESET_PED_IN_VEHICLE_CONTEXT(player_ped_id()) ENDIF if is_valid_interior(interior_lab) UNPIN_INTERIOR(interior_lab) endif clear_mission_locate_stuff(locates_data) CLEAR_TRIGGERED_LABELS() DELETE_BIOTECH_ROPES(rope_chopper, b_ropes_created, b_ropes_attached) remove_all_ptfx() REMOVE_ALL_BLIPS(true) REMOVE_ALL_CAMERAS() REMOVE_ALL_OBJECTS(true) REMOVE_ALL_PEDS(true) REMOVE_ALL_VEHICLES(true) remove_all_anim_dicts() remove_all_waypoints() remove_all_mission_doors() RESET_PUSH_IN(push_in_camera) remove_all_sounds() remove_all_one_shot_music_events() //TRIGGER_MUSIC_EVENT("debug_stop_oneshot") trigger_music_event("FBI5A_MISSION_FAIL") stop_stream() stop_alarm("FIB_05_BIOTECH_LAB_ALARMS", true) CLEAR_AMBIENT_ZONE_LIST_STATE("FBI_05_MONKEYS") release_mission_audio_bank() RELEASE_AMBIENT_AUDIO_BANK() endproc PROC SKIP_TO_STAGE(MISSION_STAGE stage) DO_SAFE_FADE_OUT() e_skip_stage = stage b_is_skipping_in_progress = TRUE initialise_mission_variables() //add cleanup function rather that having it done in mission_cleanup() MISSION_CLEANUP() WHILE NOT SET_CURRENT_SELECTOR_PED(SELECTOR_PED_TREVOR, TRUE) //SET_CURRENT_PLAYER_PED(CHAR_TREVOR) WAIT(0) ENDWHILE ENDPROC proc kill_audio_events() //kill the music events from the previous stage. CANCEL_MUSIC_EVENT("FBI5A_CUT_PIPE_START") kills audio from //pipe prepare cutscene and cut pipe stages switch e_mission_stage case STAGE_CUT_PIPE //CANCEL_MUSIC_EVENT("FBI5A_CUT_PIPE_START") break case STAGE_SWIM_INTO_LAB CANCEL_MUSIC_EVENT("FBI5A_CUT_PIPE_END") CANCEL_MUSIC_EVENT("FBI5A_CUT_SWIM_UP") break case stage_chemicals_cutscene CANCEL_MUSIC_EVENT("FBI5A_LIFT_EXIT") break endswitch endproc /// PURPOSE: /// Runs alongside the normal mission flow, and J-skips through each stage until the desired stage is reached PROC MANAGE_SKIP() kill_audio_events() IF e_section_stage = SECTION_STAGE_RUNNING IF e_mission_stage >= e_skip_stage b_is_skipping_in_progress = FALSE DO_SAFE_FADE_IN() ELSE e_section_stage = SECTION_STAGE_SKIP ENDIF ELSE //If skipped last frame, change stage so the mission has a chance to update before skipping again. IF e_section_stage = SECTION_STAGE_SKIP e_section_stage = SECTION_STAGE_RUNNING ENDIF ENDIF ENDPROC proc setup_cover_points() //ambient non specific cover points for player to use add_cover_point(<<3532.14917, 3650.45532, 26.52156>>, 258.2819, covuse_walltoleft, COVHEIGHT_TOOHIGH, COVARC_180) //add_cover_point(<<3547.16284, 3647.56445, 27.12188>>, 44.7463, covuse_walltoleft, COVHEIGHT_TOOHIGH, COVARC_180) //add_cover_point(<<3547.95337, 3652.11816, 27.12188>>, 44.7463, covuse_walltoleft, COVHEIGHT_TOOHIGH, COVARC_180) //-- Big door in pool room, RHS cover_point[0] = ADD_COVER_POINT(<<3524.19, 3702.99, 19.9928>>, 160.3315, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //3524.3025, 3702.9524, 19.9933 //-- Big door in pool room, LHS cover_point[1] = ADD_COVER_POINT( << 3526.6172, 3703.1309, 20.0082 >>, 174.6343, COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //-- Lab_waste cover_point[2] = ADD_COVER_POINT( << 3527.0776, 3692.7668, 19.9934 >>, 176.2960, COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //-- Corner of corridor before lift corridor, cover_point[3] = ADD_COVER_POINT(<<3522.29, 3676.27, 19.99>>, 256.4286 , COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //3522.4153, 3676.2388, 19.9934 = original //-- Lift, LHS cover_point[4] = ADD_COVER_POINT( <<3538.1042, 3673.0571, 19.9934>>, 353.9565 , COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //--Lift RHS cover_point[5] = ADD_COVER_POINT(<<3542.04, 3672.22, 19.99>>, 357.22, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //original 3542.0784, 3672.3545, 19.9934 3.9190 //-- Ground floor, first silding doors after lift, LHS cover_point[6] = ADD_COVER_POINT(<<3533.59, 3671.0, 27.12>>, 161.92, COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //-- First room on ground floor, sliding doors, LHS cover_point[7] = ADD_COVER_POINT( << 3532.22, 3666.6399, 27.1238 >> , 263.1106 , COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //--End of Lab1 corridor, RHS //cover_point[8] = ADD_COVER_POINT(<<3528.18269, 3660.25269, 27.12186>>, 78.5709 , COVUSE_WALLTOBOTH, COVHEIGHT_TOOHIGH, COVARC_180) cover_point[8] = ADD_COVER_POINT(<<3528.2, 3660.16, 27.12186>>, 78.5709, COVUSE_WALLTOBOTH, COVHEIGHT_TOOHIGH, COVARC_180) //-- Room lab_monkey_test cover_point[9] = ADD_COVER_POINT(<< 3530.9761, 3652.0427, 26.5234 >>, 261.1276 , COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //--Cover lab2 corridor cover_point[10] = ADD_COVER_POINT( << 3549.8069, 3645.5792, 27.1238 >>, 351.9942 , COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //-- In Lab_Corridor, right //cover_point[11] = ADD_COVER_POINT( <<3557.29, 3667.28, 27.12>>, 348.3624 , COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) cover_point[11] = ADD_COVER_POINT(<<3557.22, 3667.36, 27.12>>, 348.3624 , COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //--Outside Lab with pickup, LHS cover_point[12] = ADD_COVER_POINT( << 3552.4348, 3664.7957, 27.1101 >>, 349.9132 , COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //--Lab hazmat exit sliding doors, LHS //cover_point[13] = ADD_COVER_POINT( << 3555.5054, 3681.2454, 27.1028 >>, 353.6884 , COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //-- Lab hazmat2 exit, LHS cover_point[14] = ADD_COVER_POINT( << 3564.6450, 3684.3240, 27.1191 >>,347.0667, COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180, true) //-- Lab hazmat2 exit, RHS cover_point[15] = ADD_COVER_POINT(<<3567.76709, 3683.84521, 27.12186 >>, 351.2092, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //-- hallway pre exit, RHS cover_point[16] = ADD_COVER_POINT(<<3582.73, 3694.03, 26.12>>, 258.3331, COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //-- guard near monkey crates cover_point[17] = ADD_COVER_POINT(<<3588.07, 3708.66, 28.69>>, 145.0301, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //-- Lab hallway, for enemy cover_point[18] = ADD_COVER_POINT( << 3586.9749, 3689.7522, 26.6234 >> , 54.4116, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //--Hallway post exit LHS //3583.6165, 3700.9426, 27.8228 cover_point[19] = ADD_COVER_POINT(<<3583.87, 3700.70, 27.82>>, 323.0040, COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //--Hallway post exit RHS cover_point[20] = ADD_COVER_POINT( << 3586.3740, 3698.9778, 27.8228 >>, 322.0010, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //-- AN1 Storage, for enemy cover_point[21] = ADD_COVER_POINT(<< 3593.9189, 3710.6401, 28.6907 >>, 177.4062, COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //-- AN1 Storage, for buddy, halfway through, RHS cover_point[22] = ADD_COVER_POINT( << 3595.4631, 3718.7578, 28.6907 >>, 350.4560, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //-- AN1 Storage, for buddy, halfway through, LHS cover_point[23] = ADD_COVER_POINT(<< 3591.2021, 3719.5081, 28.6907 >>, 354.7219, COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //--lbay pre01e for buddy, RHS cover_point[24] = ADD_COVER_POINT(<< 3600.9229, 3722.2178, 28.6907 >>, 141.8499, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //--lbay pre01e for buddy, LHS cover_point[25] = ADD_COVER_POINT(<< 3604.3132, 3719.8501, 28.6907 >>, 150.6626, COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //--Loading bay, crate for enemy //cover_point[26] = ADD_COVER_POINT(<< 3617.5933, 3733.8875, 27.6915 >>, 153.9880, COVUSE_WALLTOBOTH, COVHEIGHT_LOW, COVARC_180) //--Buddy 0 finish //cover_point[27] = ADD_COVER_POINT( << 3610.96, 3729.24, 28.69 >>, 332.1431, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) cover_point[27] = ADD_COVER_POINT(<<3610.86426, 3729.17578, 28.68974>>, 332.1431, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //-- Buddy 2 finish cover_point[28] = ADD_COVER_POINT( << 3611.9646, 3728.3008, 28.6907 >>, 319.0702, COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //-- Buddy 1 finish //cover_point[29] = ADD_COVER_POINT( << 3616.8525, 3731.6858, 27.6915 >>, 338.4365, COVUSE_WALLTOBOTH, COVHEIGHT_LOW, COVARC_180) //--Wait for security to come through doors cover_point[30] = ADD_COVER_POINT( <<3544.9697, 3643.0645, 27.1233 >>, 356.8625, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180, true) //-Wait for security to come through doors cover_point[31] = ADD_COVER_POINT(<<3548.15, 3642.55, 27.12>>, 348.00, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //DAVE ig 27 end cover pos cover_point[32] = ADD_COVER_POINT(<<3596.95, 3685.77, 26.62>>, 322.6418, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) //dave ig28 start cover pos cover_point[33] = ADD_COVER_POINT(<<3592.66, 3695.31, 27.82>>, 52.2978, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180) cover_point[34] = add_cover_point(<<3597.08008, 3722.00757, 28.68960>>, 151.2970, COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180) //dave cover_point[35] = add_cover_point(<<3609.98389, 3713.81763, 28.68960>>, 326.65, COVUSE_WALLTORIGHT, COVHEIGHT_LOW, COVARC_180) cover_point[36] = add_cover_point(<<3610.15820, 3722.65845, 28.68941>>, 325.800, COVUSE_WALLTOLEFT, COVHEIGHT_TOOHIGH, COVARC_180, true) //second cover point at scientist 4 lab. cover_point[37] = ADD_COVER_POINT(<<3558.43433, 3667.1, 27.12188>>, 348.3624, COVUSE_WALLTORIGHT, COVHEIGHT_TOOHIGH, COVARC_180, true) endproc proc setup_entities_for_start_of_mission() SET_MODEL_AS_NO_LONGER_NEEDED(boat.model) boat_time = get_game_timer() if does_entity_exist(players_last_vehicle) set_vehicle_as_no_longer_needed(players_last_vehicle) endif if not started_cutscene_as_michael if get_cam_view_mode_for_context(cam_view_mode_context_in_boat) != cam_view_mode_first_person ANIMPOSTFX_PLAY("SwitchSceneMichael", 0, FALSE) PLAY_SOUND_FRONTEND(-1, "Hit_1", "LONG_PLAYER_SWITCH_SOUNDS") endif endif endproc proc create_entities_for_start_of_mission() clear_area(v_boat_start_pos, 10000.00, true) boat.veh = CREATE_VEHICLE(boat.model, v_boat_start_pos, 266.1028) set_vehicle_colours(boat.veh, 0, 0) SET_VEHICLE_DIRT_LEVEL(boat.veh, 5.0) set_vehicle_extra(boat.veh, 3, true) SET_VEHICLE_ON_GROUND_PROPERLY(boat.veh) SET_MODEL_AS_NO_LONGER_NEEDED(boat.model) boat_time = get_game_timer() //setup for every script created vehicle if not (get_current_player_ped_enum() = char_michael) set_current_selector_ped(selector_ped_michael, false) endif set_ped_into_vehicle(player_ped_id(), boat.veh) force_ped_ai_and_animation_update(player_ped_id()) SET_VEH_RADIO_STATION(boat.veh, "OFF") ADD_PED_FOR_DIALOGUE(scripted_speech, 0, player_ped_id(), "michael") SET_PED_COMP_ITEM_CURRENT_SP(player_ped_id(), comp_type_outfit, OUTFIT_P0_SCUBA_WATER_NO_MASK, false) remove_player_ped_props(player_ped_id()) //SET_PED_PROP_INDEX(player_ped_id(), ANCHOR_EYES, 1, 0) SET_MODEL_AS_NO_LONGER_NEEDED(model_michael) SET_PED_MAX_TIME_UNDERWATER(PLAYER_PED_ID(), 100000000.00) SET_PED_DIES_IN_WATER(PLAYER_PED_ID(), FALSE) SET_ENABLE_SCUBA(player_ped_id(), true) setup_buddy_inside_vehicle(dave, boat.veh, VS_FRONT_RIGHT) set_ped_config_flag(dave.ped, PCF_GetOutBurningVehicle, false) force_ped_ai_and_animation_update(dave.ped) ADD_PED_FOR_DIALOGUE(scripted_speech, 3, dave.ped, "dave") SET_PED_MAX_TIME_UNDERWATER(dave.ped, 10000000.0) SET_PED_DIES_IN_WATER(dave.ped, FALSE) //GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) give_weapon_to_ped(dave.ped, weapontype_stungun, infinite_ammo, false) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAIR, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_FEET, 1, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL, 3, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_JBIB, 1, 0) set_enable_scuba(dave.ped, true) setup_buddy_inside_vehicle(steve, boat.veh, VS_BACK_LEFT) set_ped_config_flag(steve.ped, PCF_GetOutBurningVehicle, false) force_ped_ai_and_animation_update(steve.ped) ADD_PED_FOR_DIALOGUE(scripted_speech, 4, steve.ped, "steve") SET_PED_MAX_TIME_UNDERWATER(steve.ped, 10000000.0) SET_PED_DIES_IN_WATER(steve.ped, FALSE) //GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) give_weapon_to_ped(steve.ped, weapontype_stungun, infinite_ammo, false) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAIR, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_FEET, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_JBIB, 0, 0) set_enable_scuba(steve.ped, true) if does_entity_exist(players_last_vehicle) set_vehicle_as_no_longer_needed(players_last_vehicle) endif wait(0) while not HAVE_ALL_STREAMING_REQUESTS_COMPLETED(player_ped_id()) or (not is_ped_injured(dave.ped) and not HAVE_ALL_STREAMING_REQUESTS_COMPLETED(dave.ped)) or (not is_ped_injured(steve.ped) and not HAVE_ALL_STREAMING_REQUESTS_COMPLETED(steve.ped)) wait(0) endwhile i_cutscene_event = 0 endproc proc request_intro_fbi5_assets() REQUEST_MODEL(boat.model) REQUEST_MODEL(dave.model) REQUEST_MODEL(steve.model) REQUEST_MODEL(model_michael) //SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_FEET, 3, 0) //comp_item //ped_comp_type_enum //SET_PED_COMP_ITEM_CURRENT_SP(player_ped_id(), SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_FEET, 3, 0) request_anim_dict("missfbi5leadinoutfbi_5a_mcs_leadout") REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05_Chemical_Factory_01") REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05A_GRILL_CUTTING") REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\Underwater") endproc func bool has_intro_fbi5_assets_loaded() IF HAS_MODEL_LOADED(boat.model) AND HAS_MODEL_LOADED(dave.model) and has_model_loaded(steve.model) AND HAS_MODEL_LOADED(model_michael) and has_ped_preload_variation_data_finished(player_ped_id()) and has_anim_dict_loaded("missfbi5leadinoutfbi_5a_mcs_leadout") and REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05_Chemical_Factory_01") and REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05A_GRILL_CUTTING") and REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\Underwater") return true endif return false endfunc proc michael_enter_boat_anim_system() switch michael_enter_boat_anim_system_status case 0 request_anim_dict("missfbi5leadinoutfbi_5a_mcs_leadout") if has_anim_dict_loaded("missfbi5leadinoutfbi_5a_mcs_leadout") attach_entity_to_entity(player_ped_id(), boat.veh, GET_ENTITY_BONE_INDEX_BY_NAME(boat.veh, "seat_dside_f"), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) task_play_anim(player_ped_id(), "missfbi5leadinoutfbi_5a_mcs_leadout", "fbi_5a_mcs_leadout_mic", instant_blend_in, normal_blend_out, -1, af_hold_last_frame) force_ped_ai_and_animation_update(player_ped_id()) michael_enter_boat_anim_system_status++ endif break case 1 printstring("get_entity_anim_current_time = ") printfloat(get_entity_anim_current_time(player_ped_id(), "missfbi5leadinoutfbi_5a_mcs_leadout", "fbi_5a_mcs_leadout_mic")) printnl() if is_entity_playing_anim(player_ped_id(), "missfbi5leadinoutfbi_5a_mcs_leadout", "fbi_5a_mcs_leadout_mic") if get_entity_anim_current_time(player_ped_id(), "missfbi5leadinoutfbi_5a_mcs_leadout", "fbi_5a_mcs_leadout_mic") >= 1.0 clear_ped_tasks(player_ped_id()) //clear_ped_tasks_immediately(player_ped_id()) set_ped_component_variation(player_ped_id(), PED_COMP_FEET, 3, 0) set_ped_into_vehicle(player_ped_id(), boat.veh) force_ped_ai_and_animation_update(player_ped_id()) michael_enter_boat_anim_system_status++ endif endif break case 2 break endswitch endproc proc dave_enter_boat_anim_system() //set_ped_into_vehicle(player_ped_id(), boat.veh) switch dave_enter_boat_anim_system_status case 0 request_anim_dict("missfbi5leadinoutfbi_5a_mcs_leadout") if has_anim_dict_loaded("missfbi5leadinoutfbi_5a_mcs_leadout") attach_entity_to_entity(dave.ped, boat.veh, GET_ENTITY_BONE_INDEX_BY_NAME(boat.veh, "seat_pside_f"), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) task_play_anim(dave.ped, "missfbi5leadinoutfbi_5a_mcs_leadout", "fbi_5a_mcs_leadout_dave", instant_blend_in, normal_blend_out, -1, af_hold_last_frame) force_ped_ai_and_animation_update(dave.ped) dave_enter_boat_anim_system_status++ endif break case 1 if is_entity_playing_anim(dave.ped, "missfbi5leadinoutfbi_5a_mcs_leadout", "fbi_5a_mcs_leadout_dave") if get_entity_anim_current_time(dave.ped, "missfbi5leadinoutfbi_5a_mcs_leadout", "fbi_5a_mcs_leadout_dave") >= 1.0 clear_ped_tasks(dave.ped) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_FEET, 1, 0) set_ped_into_vehicle(dave.ped, boat.veh, VS_FRONT_RIGHT) force_ped_ai_and_animation_update(dave.ped) dave_enter_boat_anim_system_status++ endif endif break case 2 break endswitch endproc proc steve_enter_boat_anim_system() //set_ped_into_vehicle(player_ped_id(), boat.veh) switch steve_enter_boat_anim_system_status case 0 request_anim_dict("missfbi5leadinoutfbi_5a_mcs_leadout") if has_anim_dict_loaded("missfbi5leadinoutfbi_5a_mcs_leadout") attach_entity_to_entity(steve.ped, boat.veh, GET_ENTITY_BONE_INDEX_BY_NAME(boat.veh, "seat_dside_r"), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) task_play_anim(steve.ped, "missfbi5leadinoutfbi_5a_mcs_leadout", "fbi_5a_mcs_leadout_steve", instant_blend_in, normal_blend_out, -1, af_hold_last_frame) force_ped_ai_and_animation_update(steve.ped) steve_enter_boat_anim_system_status++ endif break case 1 if is_entity_playing_anim(steve.ped, "missfbi5leadinoutfbi_5a_mcs_leadout", "fbi_5a_mcs_leadout_steve") if get_entity_anim_current_time(steve.ped, "missfbi5leadinoutfbi_5a_mcs_leadout", "fbi_5a_mcs_leadout_steve") >= 1.0 clear_ped_tasks(steve.ped) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_FEET, 1, 0) set_ped_into_vehicle(steve.ped, boat.veh, VS_BACK_LEFT) force_ped_ai_and_animation_update(steve.ped) steve_enter_boat_anim_system_status++ endif endif break case 2 break endswitch endproc proc fbi_5_int_setup_dave_for_exit_state() //set_ped_into_vehicle(dave.ped, boat.veh, VS_FRONT_RIGHT) dave_enter_boat_anim_system() setup_buddy_attributes(dave) setup_relationship_contact(dave.ped, true) set_ped_config_flag(dave.ped, PCF_GetOutBurningVehicle, false) set_ped_can_ragdoll(dave.ped, true) set_ragdoll_blocking_flags(dave.ped, RBF_BULLET_IMPACT | RBF_PLAYER_IMPACT | RBF_EXPLOSION) SET_PED_MAX_TIME_UNDERWATER(dave.ped, 10000000.0) SET_PED_DIES_IN_WATER(dave.ped, FALSE) set_enable_scuba(dave.ped, true) //GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) give_weapon_to_ped(dave.ped, weapontype_stungun, infinite_ammo, false) // SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HEAD, 0, 0) // SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_BERD, 0, 0) // SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAIR, 2, 0) // SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TORSO, 2, 0) // SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_LEG, 1, 0) // SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAND, 0, 0) // SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_FEET, 1, 0) // SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TEETH, 0, 0) // SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL, 1, 0) // SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL2, 0, 0) // SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_DECL, 0, 0) // SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_JBIB, 0, 0) ADD_PED_FOR_DIALOGUE(scripted_speech, 3, dave.ped, "dave") //force_ped_ai_and_animation_update(dave.ped) endproc proc fbi_5_int_setup_steve_for_exit_state() //set_ped_into_vehicle(steve.ped, boat.veh, VS_BACK_LEFT) steve_enter_boat_anim_system() setup_buddy_attributes(steve) setup_relationship_contact(steve.ped, true) set_ped_config_flag(steve.ped, PCF_GetOutBurningVehicle, false) set_ped_can_ragdoll(steve.ped, true) set_ragdoll_blocking_flags(steve.ped, RBF_BULLET_IMPACT | RBF_PLAYER_IMPACT | RBF_EXPLOSION) SET_PED_MAX_TIME_UNDERWATER(steve.ped, 10000000.0) SET_PED_DIES_IN_WATER(steve.ped, FALSE) set_enable_scuba(steve.ped, true) //GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) give_weapon_to_ped(steve.ped, weapontype_stungun, infinite_ammo, false) // SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HEAD, 0, 0) // SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_BERD, 0, 0) // SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAIR, 1, 0) // SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TORSO, 2, 0) // SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_LEG, 1, 0) // SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAND, 0, 0) // SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_FEET, 1, 0) // SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TEETH, 0, 0) // SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL, 1, 0) // SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL2, 0, 0) // SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_DECL, 0, 0) // SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_JBIB, 0, 0) ADD_PED_FOR_DIALOGUE(scripted_speech, 4, steve.ped, "steve") //force_ped_ai_and_animation_update(steve.ped) endproc proc fbi_5_int_setup_player_for_exit_state() SET_VEH_RADIO_STATION(boat.veh, "OFF") michael_enter_boat_anim_system() //clear_all_ped_props(player_ped_id()) //SET_PED_PROP_INDEX(player_ped_id(), ANCHOR_EYES, 1, 0) SET_PED_MAX_TIME_UNDERWATER(PLAYER_PED_ID(), 100000000.00) SET_PED_DIES_IN_WATER(PLAYER_PED_ID(), FALSE) SET_ENABLE_SCUBA(player_ped_id(), true) //force_ped_ai_and_animation_update(player_ped_id()) ADD_PED_FOR_DIALOGUE(scripted_speech, 0, player_ped_id(), "michael") endproc proc fbi_5_int_exit_state_controller() IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("dave_fbi", dave.model)) dave.ped = GET_PED_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("dave_fbi", dave.model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("steve_fbi", steve.model)) steve.ped = GET_PED_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("steve_fbi", steve.model)) ENDIF printstring("get_cutscene_time() = ") printint(get_cutscene_time()) printnl() switch get_current_player_ped_enum() case char_michael if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("michael", GET_PLAYER_PED_MODEL(char_michael)) fbi_5_int_setup_player_for_exit_state() endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("dave_fbi", dave.model) fbi_5_int_setup_dave_for_exit_state() endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("steve_fbi", steve.model) fbi_5_int_setup_steve_for_exit_state() endif break case char_franklin if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("michael", GET_PLAYER_PED_MODEL(char_michael)) make_selector_ped_selection(selector_ped, selector_ped_michael) take_control_of_selector_ped(selector_ped, false, false) fbi_5_int_setup_player_for_exit_state() endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("dave_fbi", dave.model) fbi_5_int_setup_dave_for_exit_state() endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("steve_fbi", steve.model) fbi_5_int_setup_steve_for_exit_state() endif break case char_trevor if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("michael", GET_PLAYER_PED_MODEL(char_michael)) make_selector_ped_selection(selector_ped, selector_ped_michael) take_control_of_selector_ped(selector_ped, false, false) fbi_5_int_setup_player_for_exit_state() endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("dave_fbi", dave.model) fbi_5_int_setup_dave_for_exit_state() endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("steve_fbi", steve.model) fbi_5_int_setup_steve_for_exit_state() endif break endswitch if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("fbi_5_michaels_boat", boat.model) set_vehicle_on_ground_properly(boat.veh) printstring("CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY(fbi_5_michaels_boat, boat.model)") printnl() endif if CAN_SET_EXIT_STATE_FOR_CAMERA() camera_a = create_cam_with_params("default_scripted_camera", <<3848.034424,4455.513672,1.249479>>,<<5.454695,0.002196,-91.291603>>,50.019032) camera_b = create_cam_with_params("default_scripted_camera", <<3847.411133,4455.532715,1.201062>>,<<5.525096,0.002196,-90.664787>>,50.019032) set_cam_active(camera_a, true) set_cam_active_with_interp(camera_b, camera_a, 3000, graph_type_decel) render_script_cams(true, false) //set_player_control(player_id(), false) SET_CAM_CONTROLS_MINI_MAP_HEADING(camera_b, true) set_vehicle_on_ground_properly(boat.veh) force_entity_ai_and_animation_update(boat.veh) endif endproc func bool fbi_5_int_tods_system() printstring("fbi_5_int_tods_system_status = ") printint(fbi_5_int_tods_system_status) printnl() switch fbi_5_int_tods_system_status case 0 printstring("GET_CUTSCENE_CONCAT_SECTION_PLAYING()") printint(GET_CUTSCENE_CONCAT_SECTION_PLAYING()) printnl() if (GET_CUTSCENE_CONCAT_SECTION_PLAYING() + 1) >= 7 tods_original_time = get_game_timer() tods_target_time = tods_original_time + 4000 fbi_5_int_tods_system_status++ endif break case 1 float tods_scale tods_scale = ((to_float(get_game_timer()) - to_float(tods_original_time)) / (to_float(tods_target_time) - to_float(tods_original_time))) if tods_scale > 1.0 tods_scale = 1.0 endif if SKIP_TO_TIME_DURING_SPLINE_CAMERA(21, 0, "", "", sTimelapse, tods_scale) //manually cleanup assets instaed of calling SET_TODS_CUTSCENE_RUNNING(sTimelapse, FALSE, false, 0, true, false) IF IS_AUDIO_SCENE_ACTIVE("TOD_SHIFT_SCENE") STOP_SOUND(sTimelapse.iSplineStageSound) RELEASE_NAMED_SCRIPT_AUDIO_BANK("TIME_LAPSE") STOP_AUDIO_SCENE("TOD_SHIFT_SCENE") CPRINTLN(DEBUG_SYSTEM, " Audio scene \"TOD_SHIFT_SCENE\" active in ", GET_THIS_SCRIPT_NAME(), ".") ENDIF CASCADE_SHADOWS_SET_CASCADE_BOUNDS_SCALE(0.6) CASCADE_SHADOWS_ENABLE_ENTITY_TRACKER(FALSE) CASCADE_SHADOWS_ENABLE_FREEZER(FALSE) RELEASE_NAMED_SCRIPT_AUDIO_BANK("TIME_LAPSE") IF g_savedGlobals.sVehicleGenData.eMissionVehTimeStamp != INVALID_TIMEOFDAY g_savedGlobals.sVehicleGenData.eMissionVehTimeStamp = GET_CURRENT_TIMEOFDAY() ENDIF fbi_5_int_tods_system_status++ return true endif break case 2 //hard code clock time in skip only return true break endswitch return false endfunc PROC OPENING_CUTSCENE() IF e_section_stage = SECTION_STAGE_SETUP switch get_current_player_ped_enum() case char_michael request_cutscene("fbi_5_int") if has_cutscene_loaded() if does_entity_exist(g_sTriggerSceneAssets.veh[0]) boat.veh = g_sTriggerSceneAssets.veh[0] set_entity_as_mission_entity(boat.veh, true, true) register_entity_for_cutscene(boat.veh, "fbi_5_michaels_boat", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) //FBI_5_Michaels_boat REGISTER_ENTITY_FOR_CUTSCENE(NULL, "dave_fbi", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, dave.model) REGISTER_ENTITY_FOR_CUTSCENE(NULL, "steve_fbi", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, steve.model) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("Michael", PLAYER_PED_ID()) SET_STORED_PLAYER_PED_CUTSCENE_VARIATIONS(char_franklin, "franklin") SET_STORED_PLAYER_PED_CUTSCENE_VARIATIONS(char_trevor, "trevor") SET_SCRIPTS_SAFE_FOR_CUTSCENE(true) start_cutscene(CUTSCENE_SUPPRESS_FP_TRANSITION_FLASH) REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) started_cutscene_as_michael = true e_section_stage = SECTION_STAGE_RUNNING endif endif break case char_franklin request_cutscene("fbi_5_int") if has_cutscene_loaded() if does_entity_exist(g_sTriggerSceneAssets.ped[0]) and does_entity_exist(g_sTriggerSceneAssets.veh[0]) started_cutscene_as_michael = false selector_ped.pedID[selector_ped_michael] = g_sTriggerSceneAssets.ped[0] boat.veh = g_sTriggerSceneAssets.veh[0] set_entity_as_mission_entity(selector_ped.pedID[selector_ped_michael], true, true) set_entity_as_mission_entity(boat.veh, true, true) register_entity_for_cutscene(selector_ped.pedID[selector_ped_michael], "michael", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) register_entity_for_cutscene(boat.veh, "fbi_5_michaels_boat", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) REGISTER_ENTITY_FOR_CUTSCENE(NULL, "dave_fbi", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, dave.model) REGISTER_ENTITY_FOR_CUTSCENE(NULL, "steve_fbi", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, steve.model) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("franklin", PLAYER_PED_ID()) SET_STORED_PLAYER_PED_CUTSCENE_VARIATIONS(char_michael, "michael") SET_STORED_PLAYER_PED_CUTSCENE_VARIATIONS(char_trevor, "trevor") //SET_VEHICLE_USE_CUTSCENE_WHEEL_COMPRESSION(boat.veh) SET_SCRIPTS_SAFE_FOR_CUTSCENE(true) start_cutscene(CUTSCENE_SUPPRESS_FP_TRANSITION_FLASH) REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) e_section_stage = SECTION_STAGE_RUNNING endif endif break case char_trevor //REQUEST_CUTSCENE_WITH_PLAYBACK_LIST("fbi_5_int", cs_section_3 | cs_section_4 | cs_section_5 | cs_section_6 | cs_section_8) if has_cutscene_loaded() if does_entity_exist(g_sTriggerSceneAssets.ped[0]) and does_entity_exist(g_sTriggerSceneAssets.ped[1]) and does_entity_exist(g_sTriggerSceneAssets.veh[0]) started_cutscene_as_michael = false selector_ped.pedID[selector_ped_michael] = g_sTriggerSceneAssets.ped[0] selector_ped.pedID[selector_ped_franklin] = g_sTriggerSceneAssets.ped[1] boat.veh = g_sTriggerSceneAssets.veh[0] set_entity_as_mission_entity(selector_ped.pedID[selector_ped_michael], true, true) set_entity_as_mission_entity(selector_ped.pedID[selector_ped_franklin], true, true) set_entity_as_mission_entity(boat.veh, true, true) register_entity_for_cutscene(selector_ped.pedID[selector_ped_michael], "michael", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) register_entity_for_cutscene(selector_ped.pedID[selector_ped_franklin], "franklin", CU_ANIMATE_AND_DELETE_EXISTING_SCRIPT_ENTITY) register_entity_for_cutscene(boat.veh, "fbi_5_michaels_boat", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) //FBI_5_Michaels_boat REGISTER_ENTITY_FOR_CUTSCENE(NULL, "dave_fbi", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, dave.model) REGISTER_ENTITY_FOR_CUTSCENE(NULL, "steve_fbi", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, steve.model) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("trevor", PLAYER_PED_ID()) SET_STORED_PLAYER_PED_CUTSCENE_VARIATIONS(char_michael, "michael") SET_STORED_PLAYER_PED_CUTSCENE_VARIATIONS(char_franklin, "franklin") //franklin and michael //SET_VEHICLE_USE_CUTSCENE_WHEEL_COMPRESSION(boat.veh) SET_SCRIPTS_SAFE_FOR_CUTSCENE(true) start_cutscene(CUTSCENE_SUPPRESS_FP_TRANSITION_FLASH) REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) e_section_stage = SECTION_STAGE_RUNNING endif endif break endswitch // if DO_TIMELAPSE(SP_MISSION_FBI_5, sTimelapse) // // if has_cutscene_loaded() // // DISABLE_TAXI_HAILING(true) // // SET_SCRIPTS_SAFE_FOR_CUTSCENE(true) // // start_cutscene() // // e_section_stage = SECTION_STAGE_RUNNING // // endif // // endif endif if e_section_stage = SECTION_STAGE_RUNNING switch opening_cutscene_status case 0 if is_cutscene_playing() MISSION_FLOW_RELEASE_TRIGGER_SCENE_ASSETS(SP_MISSION_FBI_5) //SET_TODS_CUTSCENE_RUNNING(sTimelapse, FALSE) clear_area(<<3801.2, 4468.4, 5.8>>, 1000, true) //repostion_players_last_vehicle(players_last_vehicle, <<3801.2, 4468.4, 5.8>>, <<50.00, 50.00, 50.00>>, <<3767.1614, 4472.0337, 6.4168>>, 283.2421) RESOLVE_VEHICLES_INSIDE_ANGLED_AREA_WITH_SIZE_LIMIT(<<3826.161, 4438.815, -1.834>>, <<3826.161, 4490.416, 13.166>>, 84.300, <<3767.1614, 4472.0337, 6.4168>>, 283.2421, <<15.0, 15.0, 15.0>>, false) set_players_last_vehicle_to_vehicle_gen(<<3767.1614, 4472.0337, 6.4168>>, 283.2421) request_intro_fbi5_assets() opening_cutscene_status++ endif break case 1 if is_cutscene_active() // printstring("get_cutscene_time = ") // printint(get_cutscene_time()) // printnl() if not fbi5a_perform_tods if not WAS_CUTSCENE_SKIPPED() request_intro_fbi5_assets() fbi_5_int_exit_state_controller() else SET_CUTSCENE_FADE_VALUES(false, false, true, false) e_section_stage = SECTION_STAGE_cleanup endif else if not WAS_CUTSCENE_SKIPPED() request_intro_fbi5_assets() fbi_5_int_exit_state_controller() fbi_5_int_tods_system() else SET_CUTSCENE_FADE_VALUES(false, false, true, false) e_section_stage = SECTION_STAGE_cleanup endif endif else setup_entities_for_start_of_mission() // camera_a = create_cam_with_params("default_scripted_camera", <<3848.034424,4455.513672,1.249479>>,<<5.454695,0.002196,-91.291603>>,50.019032) // camera_b = create_cam_with_params("default_scripted_camera", <<3847.411133,4455.532715,1.201062>>,<<5.525096,0.002196,-90.664787>>,50.019032) // // set_cam_active(camera_a, true) // set_cam_active_with_interp(camera_b, camera_a, 1500, graph_type_decel) // // render_script_cams(true, false) REPLAY_RECORD_BACK_FOR_TIME(0.0, 10.0, REPLAY_IMPORTANCE_HIGHEST) REPLAY_STOP_EVENT() e_section_stage = SECTION_STAGE_SETUP e_mission_stage = STAGE_GO_TO_PIPE endif break endswitch ENDIF IF e_section_stage = SECTION_STAGE_SKIP REPLAY_CANCEL_EVENT() if is_cutscene_active() STOP_CUTSCENE() endif endif IF e_section_stage = SECTION_STAGE_cleanup if is_cutscene_active() request_intro_fbi5_assets() fbi_5_int_exit_state_controller() else if has_intro_fbi5_assets_loaded() setup_entities_for_start_of_mission() if fbi5a_perform_tods if fbi_5_int_tods_system_status < 2 //tods not complete yet //---- // SET_TODS_CUTSCENE_RUNNING(sTimelapse, FALSE, false, 0, true, false) //-- IF IS_AUDIO_SCENE_ACTIVE("TOD_SHIFT_SCENE") STOP_SOUND(sTimelapse.iSplineStageSound) RELEASE_NAMED_SCRIPT_AUDIO_BANK("TIME_LAPSE") STOP_AUDIO_SCENE("TOD_SHIFT_SCENE") CPRINTLN(DEBUG_SYSTEM, " Audio scene \"TOD_SHIFT_SCENE\" active in ", GET_THIS_SCRIPT_NAME(), ".") ENDIF CASCADE_SHADOWS_SET_CASCADE_BOUNDS_SCALE(0.6) CASCADE_SHADOWS_ENABLE_ENTITY_TRACKER(FALSE) CASCADE_SHADOWS_ENABLE_FREEZER(FALSE) RELEASE_NAMED_SCRIPT_AUDIO_BANK("TIME_LAPSE") IF g_savedGlobals.sVehicleGenData.eMissionVehTimeStamp != INVALID_TIMEOFDAY g_savedGlobals.sVehicleGenData.eMissionVehTimeStamp = GET_CURRENT_TIMEOFDAY() ENDIF set_clock_time(21, 0, 0) endif endif do_screen_fade_in(default_fade_time) REPLAY_STOP_EVENT() REPLAY_RECORD_BACK_FOR_TIME(0.0, 10.0, REPLAY_IMPORTANCE_HIGHEST) e_section_stage = SECTION_STAGE_SETUP e_mission_stage = STAGE_GO_TO_PIPE //---comment back in for crate drop cutscene. // delete_ped(dave.ped) // delete_ped(steve.ped) // clear_ped_tasks_immediately(player_ped_id()) // delete_vehicle(boat.veh) // e_mission_stage = stage_helicopter_recording_system endif endif ENDIF ENDPROC proc go_to_pipe_dialogue_system() switch go_to_pipe_dialogue_status case 0 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_go_0", conv_priority_medium) go_to_pipe_dialogue_status++ endif break case 1 if does_blip_exist(locates_data.LocationBlip) // if IS_FACE_TO_FACE_CONVERSATION_PAUSED() // PAUSE_FACE_TO_FACE_CONVERSATION(false) // script_assert("test 1") // endif if NOT is_any_text_being_displayed(locates_data, IAT_IGNORE_GOD_TEXT_IF_SUBTITLES_OFF) switch GET_FAILS_COUNT_WITHOUT_PROGRESS_FOR_THIS_MISSION_SCRIPT() case 0 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_bant1a", conv_priority_medium) go_to_pipe_dialogue_status++ endif break case 1 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_ban1v1", conv_priority_medium) go_to_pipe_dialogue_status++ endif break endswitch endif else // if not IS_FACE_TO_FACE_CONVERSATION_PAUSED() // PAUSE_FACE_TO_FACE_CONVERSATION(true) // //store current line of dialogue // script_assert("test 0") // endif endif break case 2 if dialogue_monitoring_system(locates_data.LocationBlip, dave.ped, steve.ped) go_to_pipe_dialogue_status++ endif break case 3 break endswitch endproc PROC GO_TO_PIPE() SET_PED_RESET_FLAG(player_ped_id(), PRF_DisableTakeOffScubaGear, true) IF e_section_stage = SECTION_STAGE_SETUP START_AUDIO_SCENE("FBI_5_DINGHY_TO_DIVE_POINT") trigger_music_event("FBI5A_MISSION_START_ST") SETTIMERA(0) i_cutscene_event = 0 first_person_flash_time = get_game_timer() go_to_pipe_dialogue_system() e_section_stage = SECTION_STAGE_RUNNING ENDIF IF e_section_stage = SECTION_STAGE_RUNNING switch get_to_pipe_running_status case 0 michael_enter_boat_anim_system() dave_enter_boat_anim_system() steve_enter_boat_anim_system() if does_cam_exist(camera_b) if not is_cam_interpolating(camera_b) and is_ped_sitting_in_vehicle(player_ped_id(), boat.veh) //must wait for player to be in vehicle otherwise catchup camera pops to in vehicle cam when ped is set into vehicle and is_follow_vehicle_cam_active()//fixes the issue where the player is first person on foot and third person in boat and the catch up cam jumps back for a frame. This happens because the camera update has not occured yet. The catch up thinks the ped is first person on foot. PRINTSTRING("END TIME = ") PRINTINT(GET_GAME_TIMER()) PRINTNL() SET_FIRST_PERSON_FLASH_EFFECT_VEHICLE_MODEL_NAME("DINGHY") //reset flag STOP_RENDERING_SCRIPT_CAMS_USING_CATCH_UP() end_cutscene_no_fade(false, false, false, 0, 0, 0, false) else if not boat_first_person_flash_completed if get_cam_view_mode_for_context(cam_view_mode_context_in_boat) = cam_view_mode_first_person //or ((get_cam_view_mode_for_context(cam_view_mode_context_on_foot) = cam_view_mode_first_person) and (not allow_independent_camera_modes)) // if ((independent camera) and (get_cam_view_mode_for_context(cam_view_mode_context_in_boat) = cam_view_mode_first_person)) // or ((not independent camera) and (get_cam_view_mode_for_context(cam_view_mode_context_on_foot) = cam_view_mode_first_person)) if lk_timer(first_person_flash_time, 2900) PRINTSTRING("START TIME = ") PRINTINT(GET_GAME_TIMER()) PRINTNL() if started_cutscene_as_michael ANIMPOSTFX_PLAY("CamPushInNeutral", 0, FALSE) else ANIMPOSTFX_PLAY("CamPushInMichael", 0, FALSE) endif PLAY_SOUND_FRONTEND(-1, "1st_Person_Transition", "PLAYER_SWITCH_CUSTOM_SOUNDSET") boat_first_person_flash_completed = true endif endif endif endif endif if is_ped_sitting_in_vehicle(player_ped_id(), boat.veh) and is_ped_sitting_in_vehicle(dave.ped, boat.veh) and is_ped_sitting_in_vehicle(steve.ped, boat.veh) and not does_cam_exist(camera_b) PRELOAD_PED_COMP(player_ped_id(), comp_type_outfit, OUTFIT_P0_SCUBA_WATER) PRELOAD_PED_COMP(player_ped_id(), comp_type_special, SPECIAL_P0_SCUBA_ACCS_1) SET_PED_PRELOAD_VARIATION_DATA(dave.ped, PED_COMP_SPECIAL, 1, 0) SET_PED_PRELOAD_PROP_DATA(steve.ped, ANCHOR_EYES, 1) remove_anim_dict("missfbi5leadinoutfbi_5a_mcs_leadout") get_to_pipe_running_status++ endif break case 1 #IF IS_DEBUG_BUILD dont_do_j_skip(locates_data) #ENDIF MANAGE_GRILL_CREATION() REQUEST_ANIM_DICT("missheistchem2") if IS_PLAYER_AT_LOCATION_WITH_BUDDIES_IN_VEHICLE(locates_data, v_pipe_pos_above_water, <<20.0, 20.0, 2.5>>, true, dave.ped, steve.ped, null, boat.veh, "GOTO_PIPE", "FBI5A_GOD_1", "FBI5A_GOD_2", "FBI5A_GOD_3", "FBI5A_GOD_0", "", "GOBACK_BOAT", false, true) //if start_new_cutscene_no_fade(false, true, false) if can_player_start_cutscene() and has_anim_dict_loaded("missheistchem2") kill_any_conversation() set_player_control(player_id(), false, spc_leave_camera_control_on) clear_mission_locate_stuff(locates_data) go_to_pipe_dialogue_status = 22 //sets the dialogue system to a do nothing state get_to_pipe_running_status++ endif endif go_to_pipe_dialogue_system() break case 2 if not has_label_been_triggered("fbi5a_b_cut0") if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_b_cut0", conv_priority_medium) set_label_as_triggered("fbi5a_b_cut0", true) endif endif else if not is_any_text_being_displayed(locates_data) //fix for the locate header turning ON set_ped_dies_in_water to false. clear_ped_tasks_immediately(dave.ped) SET_PED_DIES_IN_WATER(dave.PED, FALSE) scene_pos = <<0.0, 0.0, 0.0>> scene_rot = <<0.0, 0.0, 0.0>> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) task_synchronized_scene(dave.ped, dave.scene_id, "missheistchem2", "Boat_Dive_Exit_Front_Right", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_DONT_INTERRUPT | SYNCED_SCENE_DONT_INTERRUPT) ATTACH_SYNCHRONIZED_SCENE_TO_ENTITY(dave.scene_id, boat.veh, 0) clear_ped_tasks_immediately(steve.ped) SET_PED_DIES_IN_WATER(steve.ped, FALSE) scene_pos = <<0.0, 0.0, 0.0>> scene_rot = <<0.0, 0.0, 0.0>> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) task_synchronized_scene(steve.ped, steve.scene_id, "missheistchem2", "Boat_Dive_Exit_Rear_Left", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_DONT_INTERRUPT | SYNCED_SCENE_DONT_INTERRUPT) ATTACH_SYNCHRONIZED_SCENE_TO_ENTITY(steve.scene_id, boat.veh, 0) e_section_stage = SECTION_STAGE_CLEANUP endif endif break endswitch ENDIF IF e_section_stage = SECTION_STAGE_CLEANUP CLEAR_PRINTS() //REMOVE_ALL_BLIPS() e_mission_stage = STAGE_DIVE_OUT_CUTSCENE e_section_stage = SECTION_STAGE_SETUP ENDIF IF e_section_stage = SECTION_STAGE_SKIP IF IS_VEHICLE_DRIVEABLE(boat.veh) IF NOT IS_PED_IN_VEHICLE(PLAYER_PED_ID(), boat.veh) SET_PED_INTO_VEHICLE(PLAYER_PED_ID(), boat.veh) ENDIF SET_PED_COORDS_KEEP_VEHICLE(PLAYER_PED_ID(), v_pipe_pos_above_water) kill_any_conversation() clear_prints() set_label_as_triggered("fbi5a_b_cut0", true) get_to_pipe_running_status = 1 clear_mission_locate_stuff(locates_data) ENDIF ENDIF ENDPROC func bool DIVE_OUT_CUTSCENE_master_flow_system() // printstring("DIVE_OUT_CUTSCENE_master_flow_system_status: ") // printint(DIVE_OUT_CUTSCENE_master_flow_system_status) // printnl() switch DIVE_OUT_CUTSCENE_master_flow_system_status case 0 if IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) if GET_SYNCHRONIZED_SCENE_PHASE(players_scene_id) >= 1.0 scene_pos = <<0.0, 0.0, 0.0>> scene_rot = <<0.0, 0.0, 0.0>> players_scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) task_synchronized_scene(player_ped_id(), players_scene_id, "missheistchem2", "Boat_Dive_Idle_Player", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_BLEND_IN, AIK_USE_FP_ARM_LEFT) ATTACH_SYNCHRONIZED_SCENE_TO_ENTITY(players_scene_id, boat.veh, 0) SET_SYNCHRONIZED_SCENE_looped(players_scene_id, true) //set_player_control(player_id(), true) DIVE_OUT_CUTSCENE_master_flow_system_status++ endif endif break case 1 if not is_cam_interpolating(camera_b) print_help("fbi5a_help_2") START_AUDIO_SCENE("FBI_5_DIVE_IN_SYNC_SCENE") //STOP_RENDERING_SCRIPT_CAMS_USING_CATCH_UP() set_gameplay_cam_relative_heading(65)//70 set_gameplay_cam_relative_pitch(0) render_script_cams(false, true, 2000, true) destroy_all_cams() set_player_control(player_id(), false) DIVE_OUT_CUTSCENE_master_flow_system_status++ endif break case 2 SET_FOLLOW_CAM_IGNORE_ATTACH_PARENT_MOVEMENT_THIS_UPDATE() if not IS_INTERPOLATING_FROM_SCRIPT_CAMS() set_player_control(player_id(), false, spc_leave_camera_control_on) endif if IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) if is_disabled_control_just_pressed(PLAYER_CONTROL, INPUT_VEH_EXIT) if is_audio_scene_active("FBI_5_DIVE_IN_SYNC_SCENE") STOP_AUDIO_SCENE("FBI_5_DIVE_IN_SYNC_SCENE") endif START_AUDIO_SCENE("FBI_5_SWIM_TO_TUNNEL_ENTRANCE") REPLAY_RECORD_BACK_FOR_TIME(3.0,10.0, REPLAY_IMPORTANCE_HIGHEST) clear_help() scene_pos = <<0.0, 0.0, 0.0>> scene_rot = <<0.0, 0.0, 0.0>> players_scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) task_synchronized_scene(player_ped_id(), players_scene_id, "missheistchem2", "Boat_Dive_Exit_Player", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_BLEND_IN) //task_synchronized_scene(player_ped_id(), players_scene_id, "missheistchem2", "Boat_Dive_Exit_Player", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_DONT_INTERRUPT, rbf_none, instant_BLEND_IN) ATTACH_SYNCHRONIZED_SCENE_TO_ENTITY(players_scene_id, boat.veh, 0) DIVE_OUT_CUTSCENE_master_flow_system_status++ endif endif break case 3 if IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) if get_synchronized_scene_phase(players_scene_id) > 0.147 START_PARTICLE_FX_non_LOOPED_ON_entity("scr_fbi5_ped_water_splash", player_ped_id(), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) DIVE_OUT_CUTSCENE_master_flow_system_status++ endif endif break case 4 if IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) if get_synchronized_scene_phase(players_scene_id) > 0.48 START_PARTICLE_FX_non_LOOPED_ON_entity("water_splash_ped_bubbles", player_ped_id(), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) DIVE_OUT_CUTSCENE_master_flow_system_status++ endif endif break case 5 if not does_particle_fx_looped_exist(flare_ptfx[0]) if has_anim_event_fired(player_ped_id(), get_hash_key("FlareActivate")) flare[0].obj = create_object(flare[0].model, get_offset_from_entity_in_world_coords(player_ped_id(), <<0.0, 0.0, 1.0>>)) attach_entity_to_entity(flare[0].obj, player_ped_id(), get_ped_bone_index(player_ped_id(), BONETAG_PH_L_HAND), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) //play_sound_from_entity(flare_sound, "Flare", flare[1].obj, "FBI_05_SOUNDS") flare_ptfx[0] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[0].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) i_cutscene_event++ endif endif if IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) if GET_SYNCHRONIZED_SCENE_PHASE(players_scene_id) >= 0.95 trigger_music_event("FBI5A_DIVE_OUT_MA") detach_entity(flare[0].obj) //DETACH_SYNCHRONIZED_SCENE(players_scene_id) OPEN_SEQUENCE_TASK(seq) TASK_PLAY_ANIM(NULL, "SWIMMING@scuba", "dive_run", slow_BLEND_IN, walk_BLEND_OUT, 1000, AF_LOOPING | AF_NOT_INTERRUPTABLE | AF_FORCE_START) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) TASK_GO_STRAIGHT_TO_COORD(NULL, <<3923.0, 3834.8, -7.5>>, PEDMOVE_RUN, -1) CLOSE_SEQUENCE_TASK(seq) TASK_PERFORM_SEQUENCE(PLAYER_PED_ID(), seq) CLEAR_SEQUENCE_TASK(seq) //FORCE_PED_AI_AND_ANIMATION_UPDATE(PLAYER_PED_ID()) return true endif endif break endswitch return false endfunc PROC DIVE_OUT_CUTSCENE() //INT i = 0 SET_PED_RESET_FLAG(player_ped_id(), PRF_DisableTakeOffScubaGear, true) IF e_section_stage = SECTION_STAGE_SETUP DISABLE_TAXI_HAILING(true) DISABLE_CELLPHONE(true) VECTOR v_boat_pos = v_pipe_pos_above_water //<<3888.3308, 3732.9304, -0.0825>> FLOAT f_boat_heading = 140//126.00 IF IS_VEHICLE_DRIVEABLE(boat.veh) //SET_PLAYER_CONTROL(PLAYER_ID(), FALSE) request_model(flare[0].model) REQUEST_ANIM_DICT("missheistchem2") request_anim_dict("swimming@scuba") prepare_music_event("FBI5A_DIVE_OUT_MA") request_ptfx_asset() IF has_model_loaded(flare[0].model) and HAS_ANIM_DICT_LOADED("missheistchem2") and has_anim_dict_loaded("swimming@scuba") and has_ptfx_asset_loaded() AND CAN_PLAYER_START_CUTSCENE() clear_mission_locate_stuff(locates_data, true) if IS_AUDIO_SCENE_ACTIVE("FBI_5_DINGHY_TO_DIVE_POINT") STOP_AUDIO_SCENE("FBI_5_DINGHY_TO_DIVE_POINT") endif dave.blip = create_blip_for_ped(dave.ped) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL, 1, 0) steve.blip = create_blip_for_ped(steve.ped) SET_PED_PROP_INDEX(steve.ped, ANCHOR_EYES, 1) create_conversation(scripted_speech, "fbi5aAU", "Fbi5a_b_cut1", conv_priority_medium) SET_ENTITY_COORDS(boat.veh, v_boat_pos) SET_ENTITY_HEADING(boat.veh, f_boat_heading) set_vehicle_on_ground_properly(boat.veh) SET_BOAT_ANCHOR(boat.veh, true) set_vehicle_engine_on(boat.veh, false, false) clear_ped_tasks_immediately(player_ped_id()) scene_pos = <<0.0, 0.0, 0.0>> scene_rot = <<0.0, 0.0, 0.0>> players_scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) task_synchronized_scene(player_ped_id(), players_scene_id, "missheistchem2", "Boat_Dive_Enter_Player", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_DONT_INTERRUPT) ATTACH_SYNCHRONIZED_SCENE_TO_ENTITY(players_scene_id, boat.veh, 0) SET_PED_COMP_ITEM_CURRENT_SP(player_ped_id(), comp_type_outfit, OUTFIT_P0_SCUBA_WATER, false) SET_PED_COMP_ITEM_CURRENT_SP(player_ped_id(), comp_type_special, SPECIAL_P0_SCUBA_ACCS_1, false) camera_a = create_cam("default_scripted_camera", false) ATTACH_CAM_TO_ENTITY(camera_a, boat.veh, <<-2.160, -4.190, 2.550>>) POINT_CAM_AT_ENTITY(camera_a, boat.veh, <<17.400, 26.100, -1.500>>) set_cam_fov(camera_a, 45.00) camera_b = create_cam("default_scripted_camera", false) ATTACH_CAM_TO_ENTITY(camera_b, boat.veh, <<-2.160, -4.190, 1.660>>) POINT_CAM_AT_ENTITY(camera_b, boat.veh, <<17.400, 26.100, -1.500>>) set_cam_fov(camera_b, 45.00) set_cam_active(camera_a, true) set_cam_active_with_interp(camera_b, camera_a, 5000, graph_type_decel)//graph_type_linear) render_script_cams(true, false) SET_CAM_CONTROLS_MINI_MAP_HEADING(camera_b, true) REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) e_section_stage = SECTION_STAGE_RUNNING ENDIF ENDIF endif if e_section_stage = SECTION_STAGE_RUNNING MANAGE_GRILL_CREATION() if DIVE_OUT_CUTSCENE_master_flow_system() e_section_stage = SECTION_STAGE_CLEANUP endif if IS_SYNCHRONIZED_SCENE_RUNNING(dave.scene_id) if not dave_water_spash_triggered if get_synchronized_scene_phase(dave.scene_id) > 0.64 START_PARTICLE_FX_non_LOOPED_ON_entity("scr_fbi5_ped_water_splash", dave.ped, <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) dave_water_spash_triggered = true endif endif if GET_SYNCHRONIZED_SCENE_PHASE(dave.scene_id) >= 0.5 if (IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) and is_entity_playing_anim(player_ped_id(), "missheistchem2", "Boat_Dive_Exit_Player") and GET_SYNCHRONIZED_SCENE_PHASE(players_scene_id) >= 0.2) or not IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) clear_ped_tasks_immediately(dave.ped) set_entity_coords(dave.ped, <<3945.5, 3850.4, -3.0>>) set_entity_heading(dave.ped, 142.7378) open_sequence_task(seq) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) TASK_GO_STRAIGHT_TO_COORD(null, <<3844.3, 3679.2, -21.0>>, PEDMOVE_sprint, -1, default_navmesh_final_heading, 3.0) //TASK_GO_STRAIGHT_TO_COORD(null, dave.run_to_pos, PEDMOVE_sprint, -1, default_navmesh_final_heading, 5.0) //TASK_FOLLOW_WAYPOINT_RECORDING(null, "fbi5_dave_swim_grill", 0, EWAYPOINT_START_FROM_CLOSEST_POINT | EWAYPOINT_DO_NOT_RESPOND_TO_COLLISION_EVENTS | EWAYPOINT_USE_TIGHTER_TURN_SETTINGS)//| EWAYPOINT_NAVMESH_BACK_TO_WAYPOINT_IF_LEFT_ROUTE | EWAYPOINT_DO_NOT_RESPOND_TO_COLLISION_EVENTS | EWAYPOINT_START_TASK_EXACTSTOP) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) flare[2].obj = create_object(flare[2].model, get_offset_from_entity_in_world_coords(dave.ped, <<0.0, 0.0, 1.0>>)) attach_entity_to_entity(flare[2].obj, dave.ped, get_ped_bone_index(dave.ped, BONETAG_SPINE3), <<-0.060, -0.120, -0.165>>, <<0.0, 90.00, 345.00>>) flare_ptfx[2] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[2].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) force_ped_ai_and_animation_update(dave.ped) else //DETACH_SYNCHRONIZED_SCENE(steve.scene_id) //task_turn_ped_to_face_coord(dave.ped endif endif else // if (IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) // and is_entity_playing_anim(player_ped_id(), "missheistchem2", "Boat_Dive_Exit_Player") // and GET_SYNCHRONIZED_SCENE_PHASE(players_scene_id) >= 0.7) // or not IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) // // if has_ped_task_finished_2(dave.ped) // // open_sequence_task(seq) // TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) // TASK_GO_STRAIGHT_TO_COORD(null, dave.run_to_pos, PEDMOVE_sprint, -1) // close_sequence_task(seq) // task_perform_sequence(dave.ped, seq) // clear_sequence_task(seq) // // endif // // endif endif if IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) if not steve_water_spash_triggered if get_synchronized_scene_phase(steve.scene_id) > 0.68 START_PARTICLE_FX_non_LOOPED_ON_entity("scr_fbi5_ped_water_splash", steve.ped, <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) steve_water_spash_triggered = true endif endif if GET_SYNCHRONIZED_SCENE_PHASE(steve.scene_id) >= 0.5 if (IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) and is_entity_playing_anim(player_ped_id(), "missheistchem2", "Boat_Dive_Exit_Player") and GET_SYNCHRONIZED_SCENE_PHASE(players_scene_id) >= 0.35) or not IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) clear_ped_tasks_immediately(steve.ped) set_entity_coords(steve.ped, <<3946.3, 3864.1, -3.0>>) set_entity_heading(steve.ped, 142.7378) //DETACH_SYNCHRONIZED_SCENE(steve.scene_id) open_sequence_task(seq) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) TASK_GO_STRAIGHT_TO_COORD(null, steve.run_to_pos, PEDMOVE_sprint, -1, default_navmesh_final_heading, 5.0) //TASK_FOLLOW_WAYPOINT_RECORDING(null, "fbi5_steve_swim_grill", 0, EWAYPOINT_START_FROM_CLOSEST_POINT | EWAYPOINT_DO_NOT_RESPOND_TO_COLLISION_EVENTS | EWAYPOINT_USE_TIGHTER_TURN_SETTINGS, 108)//| EWAYPOINT_NAVMESH_BACK_TO_WAYPOINT_IF_LEFT_ROUTE | EWAYPOINT_DO_NOT_RESPOND_TO_COLLISION_EVENTS | EWAYPOINT_START_TASK_EXACTSTOP) //TASK_GO_STRAIGHT_TO_COORD(null, steve.run_to_pos, PEDMOVE_walk, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) flare[3].obj = create_object(flare[3].model, get_offset_from_entity_in_world_coords(steve.ped, <<0.0, 0.0, 1.0>>)) attach_entity_to_entity(flare[3].obj, steve.ped, get_ped_bone_index(steve.ped, BONETAG_R_CLAVICLE), <<-0.060, -0.120, -0.165>>, <<0.0, 90.00, 345.00>>) flare_ptfx[3] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[3].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) force_ped_ai_and_animation_update(steve.ped) else //DETACH_SYNCHRONIZED_SCENE(steve.scene_id) //task_turn_ped_to_face_coord(dave.ped endif endif else if (IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) and is_entity_playing_anim(player_ped_id(), "missheistchem2", "Boat_Dive_Exit_Player") and GET_SYNCHRONIZED_SCENE_PHASE(players_scene_id) >= 0.7) or not IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) if has_ped_task_finished_2(steve.ped) open_sequence_task(seq) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) TASK_GO_STRAIGHT_TO_COORD(null, steve.run_to_pos, PEDMOVE_sprint, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif endif ENDIF IF e_section_stage = SECTION_STAGE_CLEANUP REPLAY_STOP_EVENT() //REMOVE_ALL_BLIPS() CLEAR_PRINTS() REMOVE_ANIM_DICT("missheistchem2") SET_PLAYER_CONTROL(PLAYER_ID(), TRUE) //CLEAR_PED_TASKS(PLAYER_PED_ID()) //removed for bug 1030697 // SET_ENTITY_INVINCIBLE(dave.ped, true) // set_ped_can_ragdoll(dave.ped, false) // TASK_GO_STRAIGHT_TO_COORD(dave.ped, dave.run_to_pos, PEDMOVE_RUN, -1) // // SET_ENTITY_INVINCIBLE(steve.ped, true) // set_ped_can_ragdoll(steve.ped, false) // TASK_GO_STRAIGHT_TO_COORD(steve.ped, steve.run_to_pos, PEDMOVE_RUN, -1) FREEZE_ENTITY_POSITION(boat.veh, FALSE) SET_BOAT_ANCHOR(boat.veh, false) end_cutscene_no_fade(false, false, true, 0, 0, 2500, false) //50.00 -270 // DISPLAY_RADAR(TRUE) // DISPLAY_HUD(TRUE) // SET_WIDESCREEN_BORDERS(FALSE, 0) // // SET_SCRIPTS_SAFE_FOR_CUTSCENE(FALSE) //DO_SAFE_FADE_IN() //In case of skip SETTIMERB(0) i_cutscene_event = 0 e_mission_stage = STAGE_SWIM_TO_PIPE e_section_stage = SECTION_STAGE_SETUP ENDIF IF e_section_stage = SECTION_STAGE_SKIP DO_SAFE_FADE_OUT() //REMOVE_ALL_BLIPS() CLEAR_PRINTS() REMOVE_ANIM_DICT("missheistchem2") IF IS_VEHICLE_DRIVEABLE(boat.veh) FREEZE_ENTITY_POSITION(boat.veh, FALSE) SET_BOAT_ANCHOR(boat.veh, false) IF IS_ENTITY_ATTACHED_TO_ANY_VEHICLE(PLAYER_PED_ID()) DETACH_ENTITY(PLAYER_PED_ID()) ENDIF CLEAR_PED_TASKS_IMMEDIATELY(PLAYER_PED_ID()) SET_ENTITY_COORDS_NO_OFFSET(PLAYER_PED_ID(), <<3889.2126, 3730.9980, -4.00>>)//GET_ENTITY_COORDS(boat.veh) + <<-10.0, -10.0, -10.0>>) set_entity_heading(player_ped_id(), 135.25) OPEN_SEQUENCE_TASK(seq) TASK_PLAY_ANIM(NULL, "SWIMMING@scuba", "dive_run", instant_BLEND_IN, walk_BLEND_OUT, 1000, AF_LOOPING | AF_NOT_INTERRUPTABLE | AF_FORCE_START) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) TASK_GO_STRAIGHT_TO_COORD(NULL, <<3874.7502, 3717.2354, -6.5>>, PEDMOVE_RUN, -1) CLOSE_SEQUENCE_TASK(seq) TASK_PERFORM_SEQUENCE(PLAYER_PED_ID(), seq) CLEAR_SEQUENCE_TASK(seq) FORCE_PED_AI_AND_ANIMATION_UPDATE(PLAYER_PED_ID()) IF NOT IS_PED_INJURED(dave.ped) if not IS_PED_IN_ANY_VEHICLE(dave.ped) if not IS_PED_GETTING_INTO_A_VEHICLE(dave.ped) IF IS_ENTITY_ATTACHED_TO_ANY_VEHICLE(dave.ped) DETACH_ENTITY(dave.ped) endif endif ENDIF CLEAR_PED_TASKS_IMMEDIATELY(dave.ped) SET_ENTITY_COORDS_NO_OFFSET(dave.ped, <<3879.16, 3724.64, -11.5>>) set_entity_heading(dave.ped, 140.22) //SET_ENTITY_INVINCIBLE(dave.ped, true) set_ped_can_ragdoll(dave.ped, false) OPEN_SEQUENCE_TASK(SEQ) TASK_PLAY_ANIM(NULL,"SWIMMING@scuba", "dive_run", instant_BLEND_IN, normal_BLEND_OUT, 1500, af_looping) TASK_GO_STRAIGHT_TO_COORD(NULL, dave.run_to_pos, PEDMOVE_sprint, -1) CLOSE_SEQUENCE_TASK(SEQ) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) flare[2].obj = create_object(flare[2].model, get_offset_from_entity_in_world_coords(dave.ped, <<0.0, 0.0, 1.0>>)) attach_entity_to_entity(flare[2].obj, dave.ped, get_ped_bone_index(dave.ped, BONETAG_SPINE3), <<-0.060, -0.120, -0.165>>, <<0.0, 90.00, 345.00>>) flare_ptfx[2] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[2].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) force_ped_ai_and_animation_update(dave.ped) ENDIF IF NOT IS_PED_INJURED(steve.ped) if not IS_PED_IN_ANY_VEHICLE(steve.ped) if not IS_PED_GETTING_INTO_A_VEHICLE(steve.ped) IF IS_ENTITY_ATTACHED_TO_ANY_VEHICLE(steve.ped) DETACH_ENTITY(steve.ped) endif endif ENDIF CLEAR_PED_TASKS_IMMEDIATELY(steve.ped) SET_ENTITY_COORDS_NO_OFFSET(steve.ped, <<3876.22, 3717.27, -11.2>>) set_entity_heading(steve.ped, 149.7700) //SET_ENTITY_INVINCIBLE(steve.ped, true) set_ped_can_ragdoll(steve.ped, false) OPEN_SEQUENCE_TASK(SEQ) TASK_PLAY_ANIM(NULL, "SWIMMING@scuba", "dive_run", instant_BLEND_IN, normal_BLEND_OUT, 2000, af_looping) TASK_GO_STRAIGHT_TO_COORD(NULL, steve.run_to_pos, PEDMOVE_sprint, -1) CLOSE_SEQUENCE_TASK(SEQ) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) flare[3].obj = create_object(flare[3].model, get_offset_from_entity_in_world_coords(steve.ped, <<0.0, 0.0, 1.0>>)) attach_entity_to_entity(flare[3].obj, steve.ped, get_ped_bone_index(steve.ped, BONETAG_R_CLAVICLE), <<0.2, -0.09, -0.01>>, <<-10.0, 0.0, 0.0>>) flare_ptfx[3] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[3].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) force_ped_ai_and_animation_update(steve.ped) ENDIF i_cutscene_event = 0 e_mission_stage = STAGE_SWIM_TO_PIPE e_section_stage = SECTION_STAGE_SETUP end_cutscene(false, 0, 0, false) ENDIF ENDIF ENDPROC proc swim_to_pipe_dialogue_system() switch swim_to_pipe_dialogue_system_status case 0 if get_distance_between_coords(get_entity_coords(player_ped_id()), v_pipe_pos_under_water) < 100 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_grate", conv_priority_medium) swim_to_pipe_dialogue_system_status++ endif endif break case 1 break endswitch endproc proc dive_into_water_help_text_system() switch dive_into_water_help_text_system_status case 0 if IS_PED_SWIMMING_UNDER_WATER(player_ped_id()) dive_time = get_game_timer() dive_into_water_help_text_system_status++ endif break case 1 if not IS_PED_SWIMMING_UNDER_WATER(player_ped_id()) if lk_timer(dive_time, 15000) if get_cam_view_mode_for_context(cam_view_mode_context_on_foot) = cam_view_mode_first_person if not is_using_keyboard_and_mouse(player_control) if is_look_inverted() print_help("fbi5a_help_7") else print_help("fbi5a_help_6") endif else print_help("fbi5a_help_6") // B*2189459 - We don't need to check IS_MOUSE_LOOK_INVERTED and display fbi5a_help_7 if true, because the code handles changing the mouse move direction icon in the help text endif else print_help("fbi5a_help_5") endif dive_into_water_help_text_system_status++ endif else dive_time = get_game_timer() endif break case 2 if IS_PED_SWIMMING_UNDER_WATER(player_ped_id()) if is_this_help_message_being_displayed("fbi5a_help_5") or is_this_help_message_being_displayed("fbi5a_help_6") clear_help() endif dive_into_water_help_text_system_status++ endif break case 3 break endswitch endproc PROC SWIM_TO_PIPE() SET_PED_RESET_FLAG(player_ped_id(), PRF_DisableTakeOffScubaGear, true) IF e_section_stage = SECTION_STAGE_SETUP DO_SAFE_FADE_IN() MODEL_NAMES model_cursor = PROP_POOL_BALL_01 REQUEST_ANIM_DICT("mini@biotech@blowtorch_str") REQUEST_ANIM_DICT("mini@biotech@blowtorch_def") REQUEST_ANIM_DICT("missheistchem2") request_anim_dict("SWIMMING@swim") REQUEST_PTFX_ASSET() REQUEST_MODEL(model_cursor) REQUEST_MODEL(model_welding_tool) request_model(flare[0].model) REQUEST_WAYPOINT_RECORDING(str_waypoint_swim) request_waypoint_recording("fbi5_steve_swim_lab") prepare_music_event("FBI5A_CUT_PIPE_START") e_section_stage = SECTION_STAGE_RUNNING ENDIF IF e_section_stage = SECTION_STAGE_RUNNING dive_into_water_help_text_system() MANAGE_GRILL_CREATION() swim_to_pipe_dialogue_system() if IS_PLAYER_AT_ANGLED_AREA_ON_FOOT(locates_data, v_pipe_pos_under_water, <<3836.541, 3668.579, -24.876>>, <<3833.517, 3670.342, -21.276>>, 2.500000, true, "") e_section_stage = SECTION_STAGE_CLEANUP endif if get_script_task_status(player_ped_id(), script_task_perform_sequence) = performing_task int left_stick_x int left_stick_y int right_stick_x int right_stick_y int stick_dead_zone = 28 GET_CONTROL_VALUE_OF_ANALOGUE_STICKS(left_stick_x, left_stick_y, right_stick_x, right_stick_y) IF NOT IS_LOOK_INVERTED() right_stick_y *= -1 ENDIF // invert the vertical IF (left_stick_y > STICK_DEAD_ZONE) OR (left_stick_y < (STICK_DEAD_ZONE * -1)) or is_control_pressed(player_control, input_sprint) clear_ped_tasks(player_ped_id()) endif endif //forces underwater ai code task from overwrite script tasks bug 1019576 SET_PED_RESET_FLAG(dave.ped, PRF_AllowTasksIncompatibleWithMotion, true) SET_PED_RESET_FLAG(steve.ped, PRF_AllowTasksIncompatibleWithMotion, true) //Handle buddies swimming down to the pipe IF (IS_VEHICLE_DRIVEABLE(boat.veh) AND ABSF(GET_ENTITY_SPEED(boat.veh)) < 2.0) OR NOT IS_PED_IN_ANY_VEHICLE(PLAYER_PED_ID()) IF NOT IS_PED_INJURED(dave.ped) if IS_WAYPOINT_PLAYBACK_GOING_ON_FOR_PED(dave.ped) WAYPOINT_PLAYBACK_OVERRIDE_SPEED(dave.ped, 3.0) endif if not is_entity_at_coord(dave.ped, dave.run_to_pos, <<1.0, 1.0, 2.0>>) //1.5, 1.5, 2.0 IF has_ped_task_finished_2(dave.ped) clear_ped_tasks(dave.ped) SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(dave.ped, TRUE) // IF IS_PED_IN_GROUP(dave.ped) // REMOVE_PED_FROM_GROUP(dave.ped) // ENDIF open_sequence_task(seq) TASK_GO_STRAIGHT_TO_COORD(null, dave.run_to_pos, PEDMOVE_run, -1, 146.4602) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) ENDIF else if not is_ped_within_range_of_target_heading(dave.ped, 146.4602, 20.00) IF has_ped_task_finished_2(dave.ped) open_sequence_task(seq) task_achieve_heading(null, 146.4602) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif endif endif ENDIF IF NOT IS_PED_INJURED(steve.ped) if IS_WAYPOINT_PLAYBACK_GOING_ON_FOR_PED(steve.ped) WAYPOINT_PLAYBACK_OVERRIDE_SPEED(steve.ped, 3.0) endif if not is_entity_at_coord(steve.ped, steve.run_to_pos, <<1.0, 1.0, 2.0>>) //1.5, 1.5, 2.0 IF has_ped_task_finished_2(steve.ped) clear_ped_tasks(steve.ped) SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(steve.ped, TRUE) open_sequence_task(seq) TASK_GO_STRAIGHT_TO_COORD(null, steve.run_to_pos, PEDMOVE_run, -1, 146.4602) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) ENDIF else if not is_ped_within_range_of_target_heading(steve.ped, 146.4602, 20.0) IF has_ped_task_finished_2(steve.ped) open_sequence_task(seq) task_achieve_heading(null, 146.4602) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif endif ENDIF ENDIF ENDIF IF e_section_stage = SECTION_STAGE_CLEANUP if start_new_cutscene_no_fade() if is_audio_scene_active("FBI_5_SWIM_TO_TUNNEL_ENTRANCE") STOP_AUDIO_SCENE("FBI_5_SWIM_TO_TUNNEL_ENTRANCE") endif start_audio_scene("FBI_5_ENTER_TUNNEL_SYNC_SCENE") //flare player drops out of boat. if does_entity_exist(flare[0].obj) if does_particle_fx_looped_exist(flare_ptfx[0]) STOP_PARTICLE_FX_LOOPED(flare_ptfx[0]) endif delete_object(flare[0].obj) endif //REMOVE_ALL_BLIPS() CLEAR_PRINTS() CLEAR_HELP() e_mission_stage = STAGE_PIPE_PREPARE_CUTSCENE e_section_stage = SECTION_STAGE_SETUP endif ENDIF IF e_section_stage = SECTION_STAGE_SKIP SET_ENTITY_COORDS(PLAYER_PED_ID(), <<3834.7, 3668.7, -23.6>>) if not is_ped_injured(dave.ped) SET_ENTITY_COORDS(dave.ped, get_offset_from_entity_in_world_coords(player_ped_id(), <<-1.0, 0.0, 0.0>>)) endif if not is_ped_injured(steve.ped) SET_ENTITY_COORDS(steve.ped, get_offset_from_entity_in_world_coords(player_ped_id(), <<1.0, 0.0, 0.0>>)) endif ENDIF ENDPROC PROC PIPE_PREPARE_CUTSCENE_V2() SET_PED_RESET_FLAG(player_ped_id(), PRF_DisableTakeOffScubaGear, true) set_ped_can_leg_ik(player_ped_id(), false) VECTOR v_player_pos = <<3833.1644, 3666.9343, -22.9334>> VECTOR v_root_pos = <<3832.90, 3665.74, -22.92>> FLOAT f_wall_heading = 150.0 FLOAT f_wall_tilt = 0.0 IF e_section_stage = SECTION_STAGE_SETUP SET_PED_CAN_HEAD_IK(player_ped_id(), false) MODEL_NAMES model_cursor = PROP_POOL_BALL_01 REQUEST_ANIM_DICT("mini@biotech@blowtorch_str") REQUEST_ANIM_DICT("mini@biotech@blowtorch_def") REQUEST_ANIM_DICT("missheistchem2") request_anim_dict("SWIMMING@swim") REQUEST_PTFX_ASSET() REQUEST_MODEL(model_cursor) REQUEST_MODEL(model_welding_tool) request_model(flare[0].model) REQUEST_WAYPOINT_RECORDING(str_waypoint_swim) request_waypoint_recording("fbi5_steve_swim_lab") prepare_music_event("FBI5A_CUT_PIPE_START") MANAGE_GRILL_CREATION() IF HAS_ANIM_DICT_LOADED("mini@biotech@blowtorch_str") AND HAS_ANIM_DICT_LOADED("mini@biotech@blowtorch_def") AND HAS_ANIM_DICT_LOADED("SWIMMING@swim") AND HAS_ANIM_DICT_LOADED("missheistchem2") AND GET_IS_WAYPOINT_RECORDING_LOADED(str_waypoint_swim) and get_is_waypoint_recording_loaded("fbi5_steve_swim_lab") AND HAS_MODEL_LOADED(model_cursor) AND HAS_MODEL_LOADED(model_welding_tool) and has_model_loaded(flare[0].model) AND DOES_ENTITY_EXIST(s_grill_parts[0].obj) AND HAS_PTFX_ASSET_LOADED() and prepare_music_event("FBI5A_CUT_PIPE_START") clear_area(<<3832.896484, 3665.741943, -23.997499>>, 100, true) CLEAR_PED_TASKS_IMMEDIATELY(PLAYER_PED_ID()) SET_PLAYER_CONTROL(PLAYER_ID(), FALSE) // Centre of grid <<3832.896484, 3665.741943, -22.997499>> TASK_MOVE_NETWORK_ADVANCED_BY_NAME(PLAYER_PED_ID(), "minigame_BLOWTORCH", <<3832.896484, 3665.741943, -23.997499>>, <<0.0, 0.0, f_wall_heading>>) force_ped_ai_and_animation_update(player_ped_id()) //Attach welding tool to the player obj_welding_tool = CREATE_OBJECT(model_welding_tool, GET_ENTITY_COORDS(PLAYER_PED_ID())) ATTACH_ENTITY_TO_ENTITY(obj_welding_tool, PLAYER_PED_ID(), GET_PED_BONE_INDEX(PLAYER_PED_ID(), BONETAG_PH_R_HAND), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) //Initialise welding data INITIALISE_GRID_WELDING_DATA(s_welding_data, v_root_pos, f_wall_heading, f_wall_tilt) s_welding_data.obj_cursor = CREATE_OBJECT_NO_OFFSET(model_cursor, v_player_pos) SET_ENTITY_HEADING(s_welding_data.obj_cursor, s_welding_data.v_wall_rot.z) SET_ENTITY_VISIBLE(s_welding_data.obj_cursor, FALSE) SET_MODEL_AS_NO_LONGER_NEEDED(model_cursor) //Place the buddies around the player IF NOT IS_PED_INJURED(dave.ped) IF IS_PED_IN_GROUP(dave.ped) REMOVE_PED_FROM_GROUP(dave.ped) ENDIF CLEAR_PED_TASKS_IMMEDIATELY(dave.ped) SET_ENTITY_COORDS(dave.ped, <<3836.016846, 3674.119141, -22.730551>>) SET_ENTITY_HEADING(dave.ped, f_wall_heading - 25.0) SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(dave.ped, TRUE) FREEZE_ENTITY_POSITION(dave.ped, TRUE) SET_PED_DIES_IN_WATER(dave.ped, FALSE) TASK_PLAY_ANIM(dave.ped, "SWIMMING@swim", "dive_idle", INSTANT_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_LOOPING) force_ped_ai_and_animation_update(dave.ped) ENDIF IF NOT IS_PED_INJURED(steve.ped) IF IS_PED_IN_GROUP(steve.ped) REMOVE_PED_FROM_GROUP(steve.ped) ENDIF CLEAR_PED_TASKS_IMMEDIATELY(steve.ped) SET_ENTITY_COORDS(steve.ped, <<3837.997559, 3673.544922, -23.102510>>) SET_ENTITY_HEADING(steve.ped, f_wall_heading + 25.0) SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(steve.ped, TRUE) FREEZE_ENTITY_POSITION(steve.ped, TRUE) SET_PED_DIES_IN_WATER(steve.ped, FALSE) TASK_PLAY_ANIM(steve.ped, "SWIMMING@swim", "dive_idle", INSTANT_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_LOOPING) force_ped_ai_and_animation_update(steve.ped) ENDIF cam_cutscene = CREATE_CAM_WITH_PARAMS("DEFAULT_ANIMATED_CAMERA", <<3830.341309,3662.524902,-23.245972>>, <<1.871778,3.380538,-36.630383>>, 40.073723, TRUE) //PLAY_CAM_ANIM(cam_cutscene, "cam_into_cutting", "missheistchem2", v_cutting_anims_pos, <<0.0, 0.0, f_wall_heading>>) PLAY_CAM_ANIM(cam_cutscene, "cam_blowtorch_intro", "mini@biotech@blowtorch_def", v_cutting_anims_pos, <<0.0, 0.0, f_wall_heading>>) RENDER_SCRIPT_CAMS(TRUE, FALSE) DISPLAY_RADAR(FALSE) DISPLAY_HUD(FALSE) SET_WIDESCREEN_BORDERS(TRUE, 0) SETTIMERB(0) REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) original_time = get_game_timer() create_conversation(scripted_speech, "fbi5aAU", "fbi5a_weld", CONV_PRIORITY_medium) e_section_stage = SECTION_STAGE_RUNNING ENDIF ENDIF IF e_section_stage = SECTION_STAGE_RUNNING if IS_CUTSCENE_SKIP_BUTTON_JUST_PRESSED_WITH_DELAY() e_section_stage = SECTION_STAGE_SKIP ENDIF if not has_label_been_triggered("FBI5A_CUT_PIPE_START") //IF IS_ENTITY_PLAYING_ANIM(PLAYER_PED_ID(), "mini@biotech@blowtorch_def", "blowtorch_intro") //if GET_ENTITY_ANIM_CURRENT_TIME(PLAYER_PED_ID(), "mini@biotech@blowtorch_def", "blowtorch_intro") >= 0.70 if lk_timer(original_time, 4196) trigger_music_event("FBI5A_CUT_PIPE_START") set_label_as_triggered("FBI5A_CUT_PIPE_START", true) endif //endif endif IF IS_TASK_MOVE_NETWORK_ACTIVE(PLAYER_PED_ID()) IF GET_TASK_MOVE_NETWORK_EVENT(PLAYER_PED_ID(), "IntroFinished") e_section_stage = SECTION_STAGE_CLEANUP ENDIF ENDIF ENDIF IF e_section_stage = SECTION_STAGE_SKIP REPLAY_CANCEL_EVENT() DO_SAFE_FADE_OUT() // if not is_screen_faded_out() // // if not is_screen_fading_out() // do_screen_fade_out(500) // endif // // else // // endif //iPlayerMoveProg = 1 //REQUIRED FOR INSTANTLY SETTING THE STATE TO CUTTING********** //skip to end of anim IF IS_TASK_MOVE_NETWORK_ACTIVE(PLAYER_PED_ID()) IF not IS_TASK_MOVE_NETWORK_READY_FOR_TRANSITION(PLAYER_PED_ID()) SET_TASK_MOVE_NETWORK_SIGNAL_FLOAT(PLAYER_PED_ID(), "introphase", 0.99) endif endif CANCEL_MUSIC_EVENT("FBI5A_CUT_PIPE_START") TRIGGER_MUSIC_EVENT("debug_stop_oneshot") //script_assert("test 0") e_section_stage = SECTION_STAGE_CLEANUP ENDIF IF e_section_stage = SECTION_STAGE_CLEANUP REPLAY_STOP_EVENT() //Reposition the buddies in preparation for the outro IF NOT IS_PED_INJURED(dave.ped) SET_ENTITY_COORDS_NO_OFFSET(dave.ped, <<3834.434326, 3671.477295, -22.624361>>) SET_ENTITY_HEADING(dave.ped, 159.864258) ENDIF IF NOT IS_PED_INJURED(steve.ped) SET_ENTITY_COORDS_NO_OFFSET(steve.ped, <<3835.858643, 3673.410645, -21.817038>>) SET_ENTITY_HEADING(steve.ped, 153.541626) ENDIF dialogue_time = get_game_timer() i_cutscene_event = 0 e_mission_stage = STAGE_CUT_PIPE e_section_stage = SECTION_STAGE_SETUP ENDIF ENDPROC proc welding_gun_fuel_capacity_system() float gun_fuel_tank_capacity = 0 float fuel_used_percentage = 0 //draw_rect(welding_box[0].x, welding_box[0].y, welding_box[0].width, welding_box[0].height, welding_box[0].r, welding_box[0].g, welding_box[0].b, welding_box[0].a) gun_fuel_tank_capacity = (25 * cut_through_limit * 4.5)//25 points to cut * cut through time * 700% 7.0 fuel_used_percentage = ((gun_fuel_tank_capacity - current_fuel_used) / gun_fuel_tank_capacity) if fuel_used_percentage < 0.0 welding_gun_fuel_fail = true fuel_used_percentage = 0.0 endif //z // welding_box[1].height = welding_box[0].height * fuel_used_percentage // // welding_box[1].y = welding_box[0].y + ((welding_box[0].height - welding_box[1].height) / 2) // // draw_rect(welding_box[1].x, welding_box[1].y, welding_box[1].width, welding_box[1].height, welding_box[1].r, welding_box[1].g, welding_box[1].b, welding_box[1].a) // printstring("current fuel used: ") // printfloat(current_fuel_used) // printnl() // // printstring("current fuel used * 100: ") // printfloat(current_fuel_used * 100) // printnl() // // printstring("current fuel used * 100 ROUNDED: ") // printint(round(current_fuel_used * 100)) // printnl() draw_timer_hud(round(gun_fuel_tank_capacity - current_fuel_used), round(gun_fuel_tank_capacity), "GAS_METER") //draw_timer_hud(round((gun_fuel_tank_capacity - current_fuel_used) / gun_fuel_tank_capacity), 100, "GAS_METER") //DRAW_TIMER_HUD((max_fuel_limit-current_fuel), max_fuel_limit, "GAS_METER", INT FlashTime = 0, BOOL false) if fuel_used_percentage < 0.2 if not has_label_been_triggered("fbi5a_runout") if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_runout", conv_priority_medium) set_label_as_triggered("fbi5a_runout", true) endif endif endif endif endproc proc welding_dialogue_system() switch welding_dialogue_system_status case 0 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_weld1", conv_priority_medium) welding_dialogue_system_status++ endif break case 1 if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_gas", conv_priority_medium) original_time = get_game_timer() welding_dialogue_system_status++ endif endif break case 2 if lk_timer(original_time, 20000) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_weld1b", conv_priority_medium) welding_dialogue_system_status++ endif endif break case 3 if not is_any_text_being_displayed(locates_data) original_time = get_game_timer() endif break case 4 if lk_timer(original_time, 25000) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_weld1c", conv_priority_medium) welding_dialogue_system_status++ endif endif break case 5 break endswitch IF not IS_CONTROL_PRESSED(FRONTEND_CONTROL, INPUT_SCRIPT_RT) if not is_any_text_being_displayed(locates_data) if welding_dialogue_system_status > 1 if lk_timer(dialogue_time, 10000) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_stop", conv_priority_medium) dialogue_time = get_game_timer() endif endif endif endif else dialogue_time = get_game_timer() endif endproc PROC CUT_PIPE() INT i = 0 INT j = 0 SET_PED_RESET_FLAG(player_ped_id(), PRF_DisableTakeOffScubaGear, true) set_ped_can_leg_ik(player_ped_id(), false) IF e_section_stage = SECTION_STAGE_SETUP //SET_ENTITY_VISIBLE(s_welding_data.obj_cursor, TRUE) switch cut_pipe_setup_status case 0 //IF NOT b_is_skipping_in_progress //IF NOT IS_SCREEN_FADED_IN() if is_screen_faded_out() //IF GET_TASK_MOVE_NETWORK_EVENT(PLAYER_PED_ID(), "IntroFinished") if is_task_move_network_ready_for_transition(player_ped_id()) MANAGE_GRID_WELDING_V2(s_welding_data) if iPlayerMoveProg > 0 cut_pipe_setup_status++ endif endif else iNFORM_MISSION_STATS_SYSTEM_OF_TIME_WINDOW_OPEN(FBI5_BAR_CUT_TIME) //normal running stage e_section_stage = SECTION_STAGE_RUNNING endif // else // // //z skipping stage // e_section_stage = SECTION_STAGE_RUNNING // // endif break case 1 IF GET_TASK_MOVE_NETWORK_EVENT(PLAYER_PED_ID(), "readyforfadein") DO_SCREEN_FADE_IN(1000) INFORM_MISSION_STATS_SYSTEM_OF_TIME_WINDOW_OPEN(FBI5_BAR_CUT_TIME) e_section_stage = SECTION_STAGE_RUNNING endif break endswitch ENDIF IF e_section_stage = SECTION_STAGE_RUNNING IF NOT HAS_LABEL_BEEN_TRIGGERED("CUT_HELP") PRINT_HELP("CUT_HELP") SET_LABEL_AS_TRIGGERED("CUT_HELP", TRUE) SET_MULTIHEAD_SAFE(FALSE) //B* 2223734 ENDIF // IF NOT HAS_LABEL_BEEN_TRIGGERED("CUT_PIPE") // PRINT_NOW("CUT_PIPE", DEFAULT_GOD_TEXT_TIME, 0) // SET_LABEL_AS_TRIGGERED("CUT_PIPE", TRUE) // ENDIF IF MANAGE_GRID_WELDING_V2(s_welding_data) e_section_stage = SECTION_STAGE_CLEANUP ENDIF welding_camera_system() welding_gun_fuel_capacity_system() welding_dialogue_system() ENDIF IF e_section_stage = SECTION_STAGE_CLEANUP CLEAR_HELP() CLEAR_PRINTS() KILL_FACE_TO_FACE_CONVERSATION_DO_NOT_FINISH_LAST_LINE() if is_audio_scene_active("FBI_5_ENTER_TUNNEL_SYNC_SCENE") STOP_AUDIO_SCENE("FBI_5_ENTER_TUNNEL_SYNC_SCENE") endif start_audio_scene("FBI_5_CUT_THROUGH_GRATE") IF NOT HAS_SOUND_FINISHED(i_sound_torch_cutting) STOP_SOUND(i_sound_torch_cutting) ENDIF IF NOT HAS_SOUND_FINISHED(i_sound_torch_on) STOP_SOUND(i_sound_torch_on) ENDIF if DOES_PARTICLE_FX_LOOPED_EXIST(i_weld_ptfx) STOP_PARTICLE_FX_LOOPED(i_weld_ptfx) ENDIF IF DOES_PARTICLE_FX_LOOPED_EXIST(i_singe_ptfx) STOP_PARTICLE_FX_LOOPED(i_singe_ptfx) ENDIF IF DOES_ENTITY_EXIST(s_welding_data.obj_cursor) DELETE_OBJECT(s_welding_data.obj_cursor) ENDIF INFORM_MISSION_STATS_SYSTEM_OF_TIME_WINDOW_CLOSED() e_mission_stage = STAGE_PIPE_LEAVE_CUTSCENE e_section_stage = SECTION_STAGE_SETUP ENDIF IF e_section_stage = SECTION_STAGE_SKIP // REPEAT NUM_ROWS i // REPEAT NUM_NODES_PER_ROW j // s_welding_rows[i][j].b_has_been_hit = TRUE // ENDREPEAT // ENDREPEAT for i = 0 to NUM_ROWS - 1 for j = 0 to NUM_NODES_PER_ROW - 1 s_welding_rows[i][j].b_has_been_hit = TRUE endfor endfor // REPEAT NUM_COLUMNS i // REPEAT NUM_NODES_PER_COLUMN j // s_welding_columns[i][j].b_has_been_hit = TRUE // ENDREPEAT // ENDREPEAT for i = 0 to NUM_COLUMNS - 1 for j = 0 to NUM_NODES_PER_COLUMN - 1 s_welding_columns[i][j].b_has_been_hit = TRUE endfor endfor for i = 0 to NUM_ROWS - 1 if i = 0 OR i = i_desired_weld_route_right for j = 0 to i_desired_weld_route_right if not DOES_PARTICLE_FX_LOOPED_EXIST(i_break_ptfx[i_current_break_ptfx]) VECTOR v_ptfx_offset = <> i_break_ptfx[i_current_break_ptfx] = START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_bio_grille_break", s_grill_parts[1].obj, v_ptfx_offset, <<0.0, 0.0, 0.0>>) i_current_break_ptfx++ //script_assert("ptfx added") endif endfor endif endfor for i = 0 to NUM_COLUMNS - 1 if i = 0 OR i = 5//i_desired_weld_route_bottom for j = 0 to 5//i_desired_weld_route_bottom if not DOES_PARTICLE_FX_LOOPED_EXIST(i_break_ptfx[i_current_break_ptfx]) VECTOR v_ptfx_offset = <> i_break_ptfx[i_current_break_ptfx] = START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_bio_grille_break", s_grill_parts[1].obj, v_ptfx_offset, <<0.0, 0.0, 0.0>>) i_current_break_ptfx++ //script_assert("ptfx added 1") endif endfor endif endfor // IF i_hit_node_y = i_desired_weld_route_left OR i_hit_node_y = i_desired_weld_route_right // VECTOR v_ptfx_offset = <> // i_break_ptfx[i_current_break_ptfx] = START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_bio_grille_break", s_grill_parts[1].obj, v_ptfx_offset, <<0.0, 0.0, 0.0>>) // i_current_break_ptfx++ // ENDIF // ENDIF // ELSE // IF i_hit_node_y = i_desired_weld_route_top OR i_hit_node_y = i_desired_weld_route_bottom // IF i_current_break_ptfx < COUNT_OF(i_break_ptfx) // // VECTOR v_pos = GET_ENTITY_COORDS(s_grill_parts[1].obj) // VECTOR v_ptfx_offset = <> // i_break_ptfx[i_current_break_ptfx] = START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_bio_grille_break", s_grill_parts[1].obj, v_ptfx_offset, <<0.0, 90.0, 0.00>>) // i_current_break_ptfx++ // ENDIF // ENDIF // ENDIF ENDIF ENDPROC PROC PIPE_LEAVE_CUTSCENE() INT i = 0 printint(i_cutscene_event) printnl() set_ped_can_leg_ik(player_ped_id(), false) IF e_section_stage = SECTION_STAGE_SETUP if prepare_music_event("FBI5A_CUT_PIPE_END") and does_entity_have_physics(s_grill_parts[1].obj) SET_PED_CAN_HEAD_IK(player_ped_id(), true) for i = 0 to count_of(grill_0_ptfx) - 1 grill_0_ptfx[i] = START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_bio_grille_break", s_grill_parts[0].obj, grill_0_ptfx_offset[i], <<0.0, 90.0, 0.00>>) SET_PARTICLE_FX_LOOPED_EVOLUTION(grill_0_ptfx[i], "open", 1.0) endfor scene_pos = v_cutting_anims_pos scene_rot = <<0.0, 0.0, 150.0>> players_scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(player_ped_id(), players_scene_id, "mini@biotech@blowtorch_str", "blowtorch_success_outro", instant_BLEND_IN, INSTANT_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, instant_BLEND_IN) force_ped_ai_and_animation_update(PLAYER_PED_ID()) PLAY_SYNCHRONIZED_ENTITY_ANIM(s_grill_parts[1].obj, players_scene_id, "prop_grill_BLOWTORCH_SUCCESS_OUTRO", "mini@biotech@blowtorch_str", instant_BLEND_IN, instant_blend_out) FORCE_ENTITY_AI_AND_ANIMATION_UPDATE(s_grill_parts[1].obj) flare[1].obj = create_object(flare[1].model, get_offset_from_entity_in_world_coords(player_ped_id(), <<0.0, 0.0, 1.0>>)) attach_entity_to_entity(flare[1].obj, player_ped_id(), get_ped_bone_index(player_ped_id(), BONETAG_PH_L_HAND), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) IF DOES_CAM_EXIST(cam_cutscene) DESTROY_CAM(cam_cutscene) ENDIF IF DOES_CAM_EXIST(welding_cam) DESTROY_CAM(welding_cam) ENDIF cam_cutscene = CREATE_CAM("DEFAULT_ANIMATED_CAMERA", TRUE) //PLAY_CAM_ANIM(cam_cutscene, "cam_outof_cutting", "missheistchem2", v_cutting_anims_pos, <<0.0, 0.0, 150.0>>) PLAY_CAM_ANIM(cam_cutscene, "cam_blowtorch_success_outro", "mini@biotech@blowtorch_str", v_cutting_anims_pos, <<0.0, 0.0, 150.0>>) RENDER_SCRIPT_CAMS(TRUE, FALSE) DISPLAY_RADAR(FALSE) DISPLAY_HUD(FALSE) SET_WIDESCREEN_BORDERS(TRUE, 0) create_conversation(scripted_speech, "fbi5aAU", "fia5a_weld3", conv_priority_medium) REPLAY_RECORD_BACK_FOR_TIME(5.0, 0.0, REPLAY_IMPORTANCE_HIGHEST) // Disable custom PC controls SHUTDOWN_PC_SCRIPTED_CONTROLS() REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) e_section_stage = SECTION_STAGE_RUNNING endif ENDIF IF e_section_stage = SECTION_STAGE_RUNNING SWITCH i_cutscene_event CASE 0 if IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) if get_synchronized_scene_phase(players_scene_id) > 0.29 trigger_music_event("FBI5A_CUT_PIPE_END") SET_ENTITY_COLLISION(s_grill_parts[0].obj, FALSE) //Helps to stop the middle part occasionally getting stuck FREEZE_ENTITY_POSITION(s_grill_parts[1].obj, FALSE) SET_OBJECT_PHYSICS_PARAMS(s_grill_parts[1].obj, 1000.0, -1.0, <<-1.0, -1.0, -1.0>>, <<-1.0, -1.0, -1.0>>) APPLY_FORCE_TO_ENTITY(s_grill_parts[1].obj, APPLY_TYPE_FORCE, <<0.0, -0.5, 0.0>>, <<0.0, 0.0, -0.5>>, 0, FALSE, TRUE, TRUE) PLAY_SOUND_FROM_ENTITY(-1, "Grate_Release", PLAYER_PED_ID(), "FBI_05_SOUNDS") //Evolve the break ptfx REPEAT COUNT_OF(i_break_ptfx) i if does_particle_fx_looped_exist(i_break_ptfx[i]) SET_PARTICLE_FX_LOOPED_EVOLUTION(i_break_ptfx[i], "open", 1.0) ENDIF ENDREPEAT i_cutscene_event++ ENDIF ENDIF BREAK case 1 i_cutscene_event++ BREAK case 2 if not does_particle_fx_looped_exist(flare_ptfx[1]) //IF f_anim_time > 0.518 if has_anim_event_fired(player_ped_id(), get_hash_key("FlareActivate")) play_sound_from_entity(flare_sound, "Flare", flare[1].obj, "FBI_05_SOUNDS") flare_ptfx[1] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[1].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) i_cutscene_event++ endif endif break case 3 if IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) if get_synchronized_scene_phase(players_scene_id) > 0.76 START_PARTICLE_FX_NON_LOOPED_ON_PED_BONE("ped_talk_water", PLAYER_PED_ID(), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>, BONETAG_HEAD, 1.0) PLAY_SOUND_FROM_ENTITY(-1, "Speech_Bubble", PLAYER_PED_ID(), "FBI_05_SOUNDS") //b_allow_scuba_breath = FALSE IF NOT HAS_SOUND_FINISHED(i_sound_scuba_gear) STOP_SOUND(i_sound_scuba_gear) ENDIF SETTIMERB(0) if get_cam_view_mode_for_context(cam_view_mode_context_on_foot) = cam_view_mode_first_person ANIMPOSTFX_PLAY("CamPushInNeutral", 0, FALSE) PLAY_SOUND_FRONTEND(-1, "1st_Person_Transition", "PLAYER_SWITCH_CUSTOM_SOUNDSET") endif i_cutscene_event++ endif endif break CASE 4 if IS_SYNCHRONIZED_SCENE_RUNNING(players_scene_id) if get_synchronized_scene_phase(players_scene_id) > 0.83 detach_entity(flare[1].obj) original_time = get_game_timer() REMOVE_OBJECT(obj_welding_tool, TRUE) set_model_as_no_longer_needed(model_welding_tool) if does_particle_fx_looped_exist(idle_blue_flame_ptfx) stop_particle_fx_looped(idle_blue_flame_ptfx) endif if does_particle_fx_looped_exist(i_bubble_ptfx) stop_particle_fx_looped(i_bubble_ptfx) endif set_current_ped_weapon(player_ped_id(), weapontype_unarmed, true) open_sequence_task(seq) TASK_PLAY_ANIM(NULL, "swimming@scuba", "dive_run", instant_BLEND_IN, walk_BLEND_OUT, 1000, AF_LOOPING | AF_NOT_INTERRUPTABLE | AF_FORCE_START) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) //TASK_GO_STRAIGHT_TO_COORD(NULL, <<3826.8359, 3655.3850, -24.5750>>, PEDMOVE_RUN, -1) TASK_FOLLOW_WAYPOINT_RECORDING(null, str_waypoint_swim, 5, EWAYPOINT_USE_TIGHTER_TURN_SETTINGS, 20)//EWAYPOINT_default CLOSE_SEQUENCE_TASK(seq) TASK_PERFORM_SEQUENCE(PLAYER_PED_ID(), seq) CLEAR_SEQUENCE_TASK(seq) FORCE_PED_AI_AND_ANIMATION_UPDATE(PLAYER_PED_ID()) //b_allow_scuba_breath = TRUE SETTIMERB(0) IF NOT IS_PED_INJURED(dave.ped) freeze_entity_position(dave.ped, false) set_ped_can_ragdoll(dave.ped, false) set_entity_coords_no_offset(dave.ped, <<3828.9, 3659.2, -22.75>>) set_entity_heading(dave.ped, 147.00) int i_buddy_node WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT(str_waypoint_swim, GET_ENTITY_COORDS(dave.ped), i_buddy_node) i_buddy_node += 1 open_sequence_task(seq) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) TASK_FOLLOW_WAYPOINT_RECORDING(null, str_waypoint_swim, i_buddy_node, EWAYPOINT_START_FROM_CLOSEST_POINT | EWAYPOINT_DO_NOT_RESPOND_TO_COLLISION_EVENTS | EWAYPOINT_START_TASK_EXACTSTOP | EWAYPOINT_USE_TIGHTER_TURN_SETTINGS) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) FORCE_PED_AI_AND_ANIMATION_UPDATE(dave.ped) ENDIF if not is_ped_injured(steve.ped) freeze_entity_position(steve.ped, false) set_entity_coords_no_offset(steve.ped, <<3831.3, 3662.3, -22.75>>) set_entity_heading(steve.ped, 147.00) open_sequence_task(seq) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) TASK_FOLLOW_WAYPOINT_RECORDING(null, "fbi5_steve_swim_lab", 0, EWAYPOINT_START_FROM_CLOSEST_POINT | EWAYPOINT_DO_NOT_RESPOND_TO_COLLISION_EVENTS | EWAYPOINT_START_TASK_EXACTSTOP | EWAYPOINT_USE_TIGHTER_TURN_SETTINGS) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) FORCE_PED_AI_AND_ANIMATION_UPDATE(steve.ped) endif STOP_SYNCHRONIZED_ENTITY_ANIM(s_grill_parts[1].obj, instant_BLEND_OUT, true) SET_OBJECT_PHYSICS_PARAMS(s_grill_parts[1].obj, 1000.0, -1.0, <<-1.0, -1.0, -1.0>>, <<-1.0, -1.0, -1.0>>) set_entity_coords_no_offset(s_grill_parts[1].obj, <<3831.37, 3663, -24.3083>>) set_entity_rotation(s_grill_parts[1].obj, <<86.173, -15.3571, 149.922>>) freeze_entity_position(s_grill_parts[1].obj, true) flare[0].obj = create_object(flare[0].model, get_offset_from_entity_in_world_coords(player_ped_id(), <<0.0, 0.0, 1.0>>)) attach_entity_to_entity(flare[0].obj, player_ped_id(), get_ped_bone_index(player_ped_id(), BONETAG_SPINE3), <<-0.060, -0.120, -0.165>>, <<0.0, 90.00, 345.00>>) flare_ptfx[0] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[0].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) if get_cam_view_mode_for_context(cam_view_mode_context_on_foot) != cam_view_mode_first_person set_cam_active(cam_cutscene, false) destroy_cam(cam_cutscene) camera_a = create_cam_with_params("default_scripted_camera", <<3833.167969,3667.149658,-22.680361>>,<<-15.675879,3.090937,165.056198>>,45.012604) set_cam_active(camera_a, true) wait(0) endif e_section_stage = SECTION_STAGE_CLEANUP ENDIF ENDIF BREAK ENDSWITCH IF IS_CUTSCENE_SKIP_BUTTON_JUST_PRESSED_WITH_DELAY() REPLAY_CANCEL_EVENT() e_section_stage = SECTION_STAGE_SKIP ENDIF ENDIF IF e_section_stage = SECTION_STAGE_SKIP DO_SAFE_FADE_OUT() REMOVE_OBJECT(obj_welding_tool, TRUE) if does_particle_fx_looped_exist(idle_blue_flame_ptfx) stop_particle_fx_looped(idle_blue_flame_ptfx) endif if does_particle_fx_looped_exist(i_bubble_ptfx) stop_particle_fx_looped(i_bubble_ptfx) endif destroy_all_cams() SET_ENTITY_COLLISION(s_grill_parts[0].obj, FALSE) //Helps to stop the middle part occasionally getting stuck //FREEZE_ENTITY_POSITION(s_grill_parts[1].obj, FALSE) SET_OBJECT_PHYSICS_PARAMS(s_grill_parts[1].obj, 1000.0, -1.0, <<-1.0, -1.0, -1.0>>, <<-1.0, -1.0, -1.0>>) STOP_SYNCHRONIZED_ENTITY_ANIM(s_grill_parts[1].obj, instant_BLEND_OUT, true) set_entity_coords_no_offset(s_grill_parts[1].obj, <<3831.37, 3663, -24.3083>>) set_entity_rotation(s_grill_parts[1].obj, <<86.173, -15.3571, 149.922>>) freeze_entity_position(s_grill_parts[1].obj, true) set_current_ped_weapon(player_ped_id(), weapontype_unarmed, true) open_sequence_task(seq) TASK_PLAY_ANIM(NULL, "swimming@scuba", "dive_run", instant_BLEND_IN, walk_BLEND_OUT, 1000, AF_LOOPING | AF_NOT_INTERRUPTABLE | AF_FORCE_START) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) //TASK_GO_STRAIGHT_TO_COORD(NULL, <<3826.8359, 3655.3850, -24.5750>>, PEDMOVE_RUN, -1) TASK_FOLLOW_WAYPOINT_RECORDING(null, str_waypoint_swim, 5, EWAYPOINT_USE_TIGHTER_TURN_SETTINGS, 20) CLOSE_SEQUENCE_TASK(seq) TASK_PERFORM_SEQUENCE(PLAYER_PED_ID(), seq) CLEAR_SEQUENCE_TASK(seq) force_ped_ai_and_animation_update(player_ped_id(), true) //b_allow_scuba_breath = TRUE IF NOT IS_PED_INJURED(dave.ped) freeze_entity_position(dave.ped, false) set_ped_can_ragdoll(dave.ped, false) set_entity_coords_no_offset(dave.ped, <<3828.9, 3659.2, -22.75>>) set_entity_heading(dave.ped, 147.00) int i_buddy_node WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT(str_waypoint_swim, GET_ENTITY_COORDS(dave.ped), i_buddy_node) i_buddy_node += 1 open_sequence_task(seq) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) TASK_FOLLOW_WAYPOINT_RECORDING(null, str_waypoint_swim, i_buddy_node, EWAYPOINT_START_FROM_CLOSEST_POINT | EWAYPOINT_DO_NOT_RESPOND_TO_COLLISION_EVENTS | EWAYPOINT_START_TASK_EXACTSTOP | EWAYPOINT_USE_TIGHTER_TURN_SETTINGS) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) force_ped_ai_and_animation_update(dave.ped) ENDIF if not is_ped_injured(steve.ped) freeze_entity_position(steve.ped, false) set_ped_can_ragdoll(steve.ped, false) set_entity_coords_no_offset(steve.ped, <<3831.3, 3662.3, -22.75>>) set_entity_heading(steve.ped, 147.00) open_sequence_task(seq) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) TASK_FOLLOW_WAYPOINT_RECORDING(null, "fbi5_steve_swim_lab", 0, EWAYPOINT_START_FROM_CLOSEST_POINT | EWAYPOINT_DO_NOT_RESPOND_TO_COLLISION_EVENTS | EWAYPOINT_START_TASK_EXACTSTOP | EWAYPOINT_USE_TIGHTER_TURN_SETTINGS) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) FORCE_PED_AI_AND_ANIMATION_UPDATE(steve.ped) endif REPEAT COUNT_OF(i_break_ptfx) i IF does_particle_fx_looped_exist(i_break_ptfx[i]) SET_PARTICLE_FX_LOOPED_EVOLUTION(i_break_ptfx[i], "open", 1.0) ENDIF ENDREPEAT original_time = get_game_timer() //------ IF HAS_ANIM_DICT_LOADED("missheistchem2") REMOVE_ANIM_DICT("missheistchem2") ENDIF if HAS_ANIM_DICT_LOADED("swimming@swim") remove_anim_dict("swimming@swim") endif if not does_entity_exist(flare[0].obj) flare[0].obj = create_object(flare[0].model, get_offset_from_entity_in_world_coords(player_ped_id(), <<0.0, 0.0, 1.0>>)) attach_entity_to_entity(flare[0].obj, player_ped_id(), get_ped_bone_index(player_ped_id(), BONETAG_SPINE3), <<-0.060, -0.120, -0.165>>, <<0.0, 90.00, 345.00>>) flare_ptfx[0] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[0].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) endif if does_entity_exist(flare[1].obj) if is_entity_attached(flare[1].obj) detach_entity(flare[1].obj) endif set_entity_coords(flare[1].obj, <<3833.42969, 3667.79297, -24.66870>>) set_entity_dynamic(flare[1].obj, true) if not does_particle_fx_looped_exist(flare_ptfx[1]) flare_ptfx[1] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[1].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) endif else flare[1].obj = create_object(flare[1].model, <<3833.42969, 3667.79297, -24.66870>>) flare_ptfx[1] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[1].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) play_sound_from_entity(flare_sound, "Flare", flare[1].obj, "FBI_05_SOUNDS") endif if get_cam_view_mode_for_context(cam_view_mode_context_on_foot) != cam_view_mode_first_person camera_a = create_cam_with_params("default_scripted_camera", <<3833.167969,3667.149658,-22.680361>>,<<-15.675879,3.090937,165.056198>>,45.012604) set_cam_active(camera_a, true) wait(0) end_cutscene_no_fade(false, true, true, 0, 0, 2000, false) else end_cutscene_no_fade(false, true, false, 0, 0, 2000, false) endif printstring("first person test 2") printnl() REPLAY_STOP_EVENT() SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(1, "swim through tunnel") SETTIMERB(0) i_cutscene_event = 0 e_mission_stage = STAGE_SWIM_INTO_LAB e_section_stage = SECTION_STAGE_SETUP ENDIF IF e_section_stage = SECTION_STAGE_CLEANUP REPLAY_STOP_EVENT() IF HAS_ANIM_DICT_LOADED("missheistchem2") REMOVE_ANIM_DICT("missheistchem2") ENDIF if HAS_ANIM_DICT_LOADED("swimming@swim") remove_anim_dict("swimming@swim") endif if get_cam_view_mode_for_context(cam_view_mode_context_on_foot) = cam_view_mode_first_person end_cutscene_no_fade(false, true, false, 0, 0, 2000, false) else end_cutscene_no_fade(false, true, true, 0, 0, 2000, false) endif SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(1, "swim through tunnel") SETTIMERB(0) i_cutscene_event = 0 e_mission_stage = STAGE_SWIM_INTO_LAB e_section_stage = SECTION_STAGE_SETUP endif ENDPROC proc swim_to_lab_dialogue_system() //if has_player_left_tunnel switch swim_to_lab_dialogue_status case 0 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_tunl4b", CONV_PRIORITY_LOW) swim_to_lab_dialogue_status++ endif break case 1 if not is_any_text_being_displayed(locates_data) print_now("SWIM_PIPE", default_god_text_time, 1) swim_to_lab_dialogue_status++ endif break case 2 //if not is_any_text_being_displayed(locates_data, IAT_IGNORE_GOD_TEXT_IF_SUBTITLES_OFF) if dialogue_monitoring_system(blip_current_destination, dave.ped, steve.ped) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_bant3a", CONV_PRIORITY_LOW) swim_to_lab_dialogue_status++ endif endif break case 3 if dialogue_monitoring_system(blip_current_destination, dave.ped, steve.ped) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_bant4a", CONV_PRIORITY_low) swim_to_lab_dialogue_status++ endif endif break case 4 if dialogue_monitoring_system(blip_current_destination, dave.ped, steve.ped) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_bant5a", CONV_PRIORITY_low) swim_to_lab_dialogue_status++ endif endif break case 5 if dialogue_monitoring_system(blip_current_destination, dave.ped, steve.ped) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_bant6a", CONV_PRIORITY_low) swim_to_lab_dialogue_status++ endif endif break case 6 if is_entity_in_angled_area(player_ped_id(), <<3539.008, 3738.964, -11.785>>, <<3539.034, 3741.972, -8.693>>, 2.0) swim_to_lab_dialogue_status++ endif break case 7 if dialogue_monitoring_system(blip_current_destination, dave.ped, steve.ped) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_tunl3", CONV_PRIORITY_medium) swim_to_lab_dialogue_status++ endif endif break case 8 if is_entity_in_angled_area(player_ped_id(), <<3523.324, 3726.412, -11.181>>, <<3520.638, 3726.727, -8.085>>, 1.0) start_audio_scene("FBI_5_GET_TO_SURFACE") swim_to_lab_dialogue_status++ endif break case 9 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dsurf", CONV_PRIORITY_medium) swim_to_lab_dialogue_status++ endif break case 10 if get_distance_between_coords(get_entity_coords(player_ped_id()), v_pipe_end_pos) < 20 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_ladder", CONV_PRIORITY_medium) swim_to_lab_dialogue_status++ endif endif break case 11 break endswitch if swim_to_lab_dialogue_status < 7 if is_entity_in_angled_area(player_ped_id(), <<3539.008, 3738.964, -11.785>>, <<3539.034, 3741.972, -8.693>>, 2.0) //2.0 swim_to_lab_dialogue_status++ endif endif endproc proc fan_system() int i = 0 //Manage fans and fan particles IF DOES_ENTITY_EXIST(s_fans[0].obj) REQUEST_PTFX_ASSET() IF HAS_PTFX_ASSET_LOADED() // REPEAT COUNT_OF(s_fans) i // IF s_fans[i].i_ptfx = NULL // s_fans[i].i_ptfx = START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_bio_fan_bubbles", s_fans[i].obj, <<0.0, 0.0, 0.0>>, <<90.0, 0.0, 0.0>>, 1.0) // ELSE // //Rotate the fans // CONST_FLOAT MAX_SPEED 80.0 // // s_fans[i].f_rot_speed = 20.0 // // //Debug widget for checking how the particles relate to different fan speeds // #IF IS_DEBUG_BUILD // IF b_override_fans // s_fans[i].f_rot_speed = MAX_SPEED * f_debug_fan_speed // ENDIF // #ENDIF // // s_fans[i].v_rot.y += get_frame_time() * s_fans[i].f_rot_speed // SET_ENTITY_ROTATION(s_fans[i].obj, s_fans[i].v_rot) // //SET_PARTICLE_FX_LOOPED_EVOLUTION(s_fans[i].i_ptfx, "speed", s_fans[i].f_rot_speed / MAX_SPEED) // ENDIF // ENDREPEAT ENDIF ELSE MODEL_NAMES model_fan = PROP_LD_FAN_01 REQUEST_MODEL(model_fan) IF HAS_MODEL_LOADED(model_fan) s_fans[0].v_rot = <<0.0, 0.0, 37.5>> s_fans[0].obj = CREATE_OBJECT_NO_OFFSET(model_fan, <<3735.1, 3701.5, -17.2>>) s_fans[1].v_rot = <<0.0 ,0.0, 82.5>> s_fans[1].obj = CREATE_OBJECT_NO_OFFSET(model_fan, <<3686.6, 3726.7, -17.2>>) s_fans[2].v_rot = <<0.0, 0.0, 90.0>> s_fans[2].obj = CREATE_OBJECT_NO_OFFSET(model_fan, <<3537.1, 3740.5, -10.1>>) REPEAT COUNT_OF(s_fans) i FREEZE_ENTITY_POSITION(s_fans[i].obj, TRUE) SET_ENTITY_ROTATION(s_fans[i].obj, s_fans[i].v_rot) //play_sound_from_entity(s_fans[i].soundid, "Fan", s_fans[i].obj, "FBI_05_SOUNDS") s_fans[i].i_ptfx = NULL ENDREPEAT SET_MODEL_AS_NO_LONGER_NEEDED(model_fan) ENDIF ENDIF endproc proc vent_system() //-- Bubbles coming from vent - apply force IF IS_ENTITY_IN_ANGLED_AREA( PLAYER_PED_ID(), <<3790.574707,3657.133545,-19.301603>>, <<3790.886475,3659.817871,-16.314827>>, 1.500000) // DUMMY_REFERENCE_INT(iBubblesTimer) VECTOR vForceToApply, vTemp float force_multiplier = 0.5 vTemp = GET_ENTITY_ROTATION(PLAYER_PED_ID()) //-- When the ped swims through the vent, want to push the ped upwards, regardless of the peds orientation //-- When the x-axis of the swimming ped is 0 degrees , the unit force to be applied is <<0.0, 0.0, 1.0>> //-- As the x-axis rotates (i.e. the ped swimms up / down), need to rotate the force vector by //-- the new x-axis to get the new force vector (turns out it's -1.0 * (x-axis rotation)) //-- because the rot angle is 270 when swiming vForceToApply = NORMALISE_VECTOR(ROTATE_VECTOR_ABOUT_X_AXIS(<<0.0, 0.0, 1.0>>, (vTemp.x * -1.0))) APPLY_FORCE_TO_ENTITY(PLAYER_PED_ID(), APPLY_TYPE_IMPULSE, ((force_multiplier * vForceToApply)), <<0.0, 0.0, 0.0>>, 0, TRUE, TRUE, TRUE) // APPLY_FORCE_TO_ENTITY(PLAYER_PED_ID(), APPLY_TYPE_IMPULSE, ((fWdForceMultip*-1.0*vForceToApply)), <<0.0, 0.0, 0.0>>, 0, TRUE, TRUE, TRUE) // iBubblesTimer = GET_GAME_TIMER() ENDIF IF NOT IS_PED_INJURED(dave.ped) IF IS_ENTITY_IN_ANGLED_AREA(dave.ped, <<3790.574707,3657.133545,-19.301603>>, <<3790.886475,3659.817871,-16.314827>>, 1.500000) VECTOR vForceToApply, vTemp float force_multiplier = 0.5 vTemp = GET_ENTITY_ROTATION(dave.ped) vForceToApply = NORMALISE_VECTOR(ROTATE_VECTOR_ABOUT_X_AXIS(<<0.0, 0.0, 1.0>>, (vTemp.x * -1.0)))//vTemp.x * -1.0 APPLY_FORCE_TO_ENTITY(dave.ped, APPLY_TYPE_IMPULSE, ((force_multiplier * vForceToApply)), <<0.0, 0.0, 0.0>>, 0, TRUE, TRUE, TRUE) ENDIF ENDIF IF NOT IS_PED_INJURED(steve.ped) IF IS_ENTITY_IN_ANGLED_AREA( steve.ped, <<3790.574707,3657.133545,-19.301603>>, <<3790.886475,3659.817871,-16.314827>>, 1.500000) VECTOR vForceToApply, vTemp float force_multiplier = 0.5 vTemp = GET_ENTITY_ROTATION(steve.ped) vForceToApply = NORMALISE_VECTOR(ROTATE_VECTOR_ABOUT_X_AXIS(<<0.0, 0.0, 1.0>>, (vTemp.x * -1.0)))//vTemp.x * -1.0 APPLY_FORCE_TO_ENTITY(steve.ped, APPLY_TYPE_IMPULSE, ((force_multiplier * vForceToApply)), <<0.0, 0.0, 0.0>>, 0, TRUE, TRUE, TRUE) ENDIF ENDIF endproc func bool is_ped_at_fans(ped_index &miss_ped) if is_entity_in_angled_area(miss_ped, <<3733.507, 3700.567, -18.574>>, <<3736.335, 3702.797, -15.476>>, 4.0) or is_entity_in_angled_area(miss_ped, <<3686.204, 3724.993, -18.441>>, <<3686.704, 3728.562, -15.445>>, 4.0) or is_entity_in_angled_area(miss_ped, <<3536.661, 3738.657, -11.658>>, <<3536.597, 3741.957, -8.45>>, 4.0) return true endif return false endfunc func bool is_point_near_fans(vector point) if is_point_in_angled_area(point, <<3733.507, 3700.567, -18.574>>, <<3736.335, 3702.797, -15.476>>, 4.0) or is_point_in_angled_area(point, <<3686.204, 3724.993, -18.441>>, <<3686.704, 3728.562, -15.445>>, 4.0) or is_point_in_angled_area(point, <<3536.661, 3738.657, -11.658>>, <<3536.597, 3741.957, -8.45>>, 4.0) return true endif return false endfunc proc buddy_swimming_ai_system() int i int i_player_node int i_buddy_node int i_node_diff int i_warp_node ped_index buddy_ped VECTOR v_warp_pos int waypoint_target_node vector target_waypoint_pos string waypoint_string //forces underwater ai code task from overwrite script tasks bug 1019576 SET_PED_RESET_FLAG(dave.ped, PRF_AllowTasksIncompatibleWithMotion, true) SET_PED_RESET_FLAG(steve.ped, PRF_AllowTasksIncompatibleWithMotion, true) WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT(str_waypoint_swim, GET_ENTITY_COORDS(PLAYER_PED_ID()), i_player_node) for i = 0 to 1 if i = 0 buddy_ped = dave.ped waypoint_string = str_waypoint_swim waypoint_target_node = 363 elif i = 1 buddy_ped = steve.ped waypoint_string = "fbi5_steve_swim_lab" waypoint_target_node = 363 endif IF NOT IS_PED_INJURED(buddy_ped) switch buddy_swimming_status[i] case 0 //if not is_entity_in_angled_area(buddy_ped, <<3527.993, 3712.261, 14.697>>, <<3532.477, 3711.885, 19.797>>, 6.000) waypoint_recording_get_coord(waypoint_string, waypoint_target_node, target_waypoint_pos) if not is_entity_at_coord(buddy_ped, target_waypoint_pos, <<2.0, 2.0, 1.6>>) and not (IS_WAYPOINT_PLAYBACK_GOING_ON_FOR_PED(buddy_ped) and GET_PED_WAYPOINT_PROGRESS(buddy_ped) > waypoint_target_node) WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT(waypoint_string, GET_ENTITY_COORDS(buddy_ped), i_buddy_node) i_node_diff = i_player_node - i_buddy_node //resumes all the peds at the same time if i_node_diff >= -10 //-5 resume_dave_waypoint = true resume_steve_waypoint = true endif //If buddies can't get into the pipe, reposition them off-camera IF i_node_diff > 12 IF NOT IS_ENTITY_ON_SCREEN(buddy_ped) i_warp_node = i_player_node - (i * 2) - 4 WAYPOINT_RECORDING_GET_COORD(waypoint_string, i_warp_node, v_warp_pos) if not is_point_near_fans(v_warp_pos) IF NOT IS_SPHERE_VISIBLE(v_warp_pos, 3.0) SET_ENTITY_COORDS_NO_OFFSET(buddy_ped, v_warp_pos) SET_ENTITY_HEADING(buddy_ped, 180.0) TASK_FOLLOW_WAYPOINT_RECORDING(buddy_ped, waypoint_string, i_warp_node + 1, EWAYPOINT_START_FROM_CLOSEST_POINT | EWAYPOINT_DO_NOT_RESPOND_TO_COLLISION_EVENTS | EWAYPOINT_START_TASK_EXACTSTOP | EWAYPOINT_USE_TIGHTER_TURN_SETTINGS) #IF IS_DEBUG_BUILD PRINTSTRING("Chemical_heist2 - Warping buddy ") PRINTINT(i) PRINTSTRING(" to node ") PRINTINT(i_warp_node) PRINTNL() #ENDIF ENDIF endif ENDIF elif i_node_diff >= -10 //-5 // if IS_WAYPOINT_PLAYBACK_GOING_ON_FOR_PED(buddy_ped) // if WAYPOINT_PLAYBACK_GET_IS_PAUSED(buddy_ped) // // resume_dave_waypoint = true // // WAYPOINT_PLAYBACK_RESUME(buddy_ped, false) //,(i_buddy_node + 1) // //s_buddies[i].playback_paused = false // // if not is_any_text_being_displayed(locates_data) // create_conversation(scripted_speech, "fbi5aAU", "fbi5a_swim3", CONV_PRIORITY_medium) // endif // // resume_dave_waypoint = false // // endif // endif elif i_node_diff < -20 if buddy_ped = dave.ped if i_node_diff < -24 if IS_WAYPOINT_PLAYBACK_GOING_ON_FOR_PED(buddy_ped) if not is_ped_at_fans(buddy_ped) if not WAYPOINT_PLAYBACK_GET_IS_PAUSED(buddy_ped) WAYPOINT_PLAYBACK_PAUSE(buddy_ped, false) //s_buddies[i].playback_paused = true if not is_any_text_being_displayed(locates_data) create_conversation(scripted_speech, "fbi5aAU", "fbi5a_stop1", CONV_PRIORITY_medium) endif endif endif endif endif endif if buddy_ped = steve.ped if IS_WAYPOINT_PLAYBACK_GOING_ON_FOR_PED(buddy_ped) if not is_ped_at_fans(buddy_ped) if not WAYPOINT_PLAYBACK_GET_IS_PAUSED(buddy_ped) WAYPOINT_PLAYBACK_PAUSE(buddy_ped, false) //s_buddies[i].playback_paused = true if not is_any_text_being_displayed(locates_data) create_conversation(scripted_speech, "fbi5aAU", "fbi5a_stop2", CONV_PRIORITY_medium) endif endif endif endif endif ENDIF if buddy_ped = dave.ped if resume_dave_waypoint = true //if s_buddies[i].playback_paused if IS_WAYPOINT_PLAYBACK_GOING_ON_FOR_PED(buddy_ped) if WAYPOINT_PLAYBACK_GET_IS_PAUSED(buddy_ped) WAYPOINT_PLAYBACK_RESUME(buddy_ped, false) //,(i_buddy_node + 1) //s_buddies[i].playback_paused = false endif endif resume_dave_waypoint = false endif endif if buddy_ped = steve.ped if resume_steve_waypoint = true //if s_buddies[i].playback_paused if IS_WAYPOINT_PLAYBACK_GOING_ON_FOR_PED(buddy_ped) if WAYPOINT_PLAYBACK_GET_IS_PAUSED(buddy_ped) WAYPOINT_PLAYBACK_RESUME(buddy_ped, false) //s_buddies[i].playback_paused = false printstring("steve waypoint resumed") printnl() endif endif resume_steve_waypoint = false endif endif //Control their swim speed //IF i > 0 IF IS_WAYPOINT_PLAYBACK_GOING_ON_FOR_PED(buddy_ped) // IF i_node_diff < 2 // WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 2.0) // ELIF i_node_diff > 6 // WAYPOINT_PLAYBACK_USE_DEFAULT_SPEED(buddy_ped) // ENDIF if buddy_ped = dave.ped if i_node_diff >= -2 WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 2.0) slow_dave_down_for_catch_up = false else if i_node_diff <= -7 WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 1.0) slow_dave_down_for_catch_up = true else if not slow_dave_down_for_catch_up WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 2.0) else WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 1.0) endif endif endif endif if buddy_ped = steve.ped // if i_node_diff >= -2 // WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 3.0) // slow_steve_down_for_catch_up = false // else // if i_node_diff <= -7 // WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 2.0) // slow_steve_down_for_catch_up = true // else // if not slow_steve_down_for_catch_up // WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 3.0) // else // WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 2.0) // endif // // endif // // endif if i_node_diff >= -2 WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 2.0) slow_steve_down_for_catch_up = false else slow_steve_down_for_catch_up = slow_steve_down_for_catch_up if i_node_diff <= -7 WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 1.0) // slow_steve_down_for_catch_up = true // else // if not slow_steve_down_for_catch_up // WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 2.0) // else // WAYPOINT_PLAYBACK_OVERRIDE_SPEED(buddy_ped, 1.0) // endif endif endif endif endif //ENDIF else if buddy_ped = dave.ped open_sequence_task(seq) task_go_straight_to_coord(null, <<3531.2, 3717.17, 19.0>>, pedmove_run, -1) close_sequence_task(seq) task_perform_sequence(buddy_ped, seq) clear_sequence_task(seq) buddy_swimming_status[i] = 1 endif if buddy_ped = steve.ped open_sequence_task(seq) task_go_straight_to_coord(null, <<3528.4, 3715.4, 19.0>>, pedmove_run, -1) close_sequence_task(seq) task_perform_sequence(buddy_ped, seq) clear_sequence_task(seq) buddy_swimming_status[i] = 1 endif endif break case 1 switch i case 0 //dave if not is_entity_at_coord(buddy_ped, <<3531.2, 3717.17, 19.0>>, <<2.0, 2.0, 2.6>>) //2.6 if has_ped_task_finished_2(buddy_ped) open_sequence_task(seq) task_go_straight_to_coord(null, <<3531.2, 3717.17, 19.0>>, pedmove_run, -1) close_sequence_task(seq) task_perform_sequence(buddy_ped, seq) clear_sequence_task(seq) endif else if not is_ped_facing_ped(buddy_Ped, player_ped_id(), 40) if has_ped_task_finished_2(buddy_ped) if has_ped_task_finished_2(buddy_ped, SCRIPT_TASK_TURN_PED_TO_FACE_ENTITY, -2, false) task_turn_ped_to_face_entity(buddy_ped, player_ped_id()) endif endif endif endif break case 1 //steve if not is_entity_at_coord(buddy_ped, <<3528.4, 3715.4, 19.0>>, <<2.0, 2.0, 2.6>>) if has_ped_task_finished_2(buddy_ped) open_sequence_task(seq) task_go_straight_to_coord(null, <<3528.4, 3715.4, 19.0>>, pedmove_run, -1) close_sequence_task(seq) task_perform_sequence(buddy_ped, seq) clear_sequence_task(seq) endif else if not is_ped_facing_ped(buddy_Ped, player_ped_id(), 40) if has_ped_task_finished_2(buddy_ped) if has_ped_task_finished_2(buddy_ped, SCRIPT_TASK_TURN_PED_TO_FACE_ENTITY, -2, false) task_turn_ped_to_face_entity(buddy_ped, player_ped_id()) endif endif endif endif break endswitch break endswitch ENDIF endfor endproc proc interior_map_system() if is_entity_in_angled_area(player_ped_id(), <<3831.922, 3672.879, -25.393>>, <<3838.767, 3668.936, -20.793>>, 2.500) //or is_entity_in_angled_area(player_ped_id(), <<>>, <<>>, ) render_underwater_tunnel_on_radar = false endif if is_entity_in_angled_area(player_ped_id(), <<3831.749, 3667.262, -24.591>>, <<3834.689, 3665.554, -21.091>>, 6.400) //or is_entity_in_angled_area(player_ped_id(), <<>>,) render_underwater_tunnel_on_radar = true endif if render_underwater_tunnel_on_radar SET_RADAR_AS_INTERIOR_THIS_FRAME(-1594035265, 3650, 3700, 0) endif endproc proc swim_to_lab_audio_event_system() switch swim_to_lab_audio_event_system_status case 0 if IS_ENTITY_AT_COORD(player_ped_id(), <<3521.689209,3725.642334,-10.033022>>,<<1.500000,1.750000,2.00000>>) swim_to_lab_audio_event_system_status++ endif break case 1 if prepare_music_event("FBI5A_SWIM_UP") if not IS_ANY_CONVERSATION_ONGOING_OR_QUEUED() trigger_music_event("FBI5A_SWIM_UP") swim_to_lab_audio_event_system_status++ endif endif break endswitch endproc /// PURPOSE: force the room for the ped because the pool is to deep and a portal scan will fail wehn they /// get to the top proc setup_buddies_for_interior() //if not interior_forced_for_dave if is_ped_inside_interior(dave.ped, <<3532.1067, 3721.1770, 15.00>>, "v_lab") FORCE_ROOM_FOR_ENTITY(dave.ped, GET_INTERIOR_AT_COORDS_with_type(<<3532.1067, 3721.1770, 15.00>>, "v_lab"), get_hash_key("lab_poolroom")) //interior_forced_for_dave = true endif //endif //if not interior_forced_for_steve if is_ped_inside_interior(steve.ped, <<3532.1067, 3721.1770, 15.00>>, "v_lab") FORCE_ROOM_FOR_ENTITY(steve.ped, GET_INTERIOR_AT_COORDS_with_type(<<3532.1067, 3721.1770, 15.00>>, "v_lab"), get_hash_key("lab_poolroom")) //interior_forced_for_steve = true endif //endif endproc proc force_pool_room_for_player_system() if is_entity_in_angled_area(player_ped_id(), <<3516.791, 3718.336, 0.992>>, <<3533.594, 3715.161, 23.492>>, 16.300) FORCE_ROOM_FOR_ENTITY(player_ped_id(), GET_INTERIOR_AT_COORDS_with_type(<<3528.0, 3716.9, 19.22>>, "v_lab"), get_hash_key("lab_poolroom")) endif endproc PROC SWIM_TO_LAB() if not take_off_scuba_gear SET_PED_RESET_FLAG(player_ped_id(), PRF_DisableTakeOffScubaGear, true) endif set_ped_can_leg_ik(player_ped_id(), false) if IS_PED_SWIMMING_UNDER_WATER(player_ped_id()) SET_PED_MAX_MOVE_BLEND_RATIO(player_ped_id(), 2.0) endif IF e_section_stage = SECTION_STAGE_SETUP RELEASE_NAMED_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05_Chemical_Factory_01") RELEASE_NAMED_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05A_GRILL_CUTTING") if is_audio_scene_active("FBI_5_CUT_THROUGH_GRATE") STOP_AUDIO_SCENE("FBI_5_CUT_THROUGH_GRATE") endif start_audio_scene("FBI_5_SWIM_TO_TUNNEL_EXIT") SET_ENTITY_COLLISION(s_grill_parts[0].obj, TRUE) DO_SAFE_FADE_IN() //In case last cutscene was skipped fxBubbles = START_PARTICLE_FX_LOOPED_AT_COORD("scr_tunnel_vent_bubbles", << 3790.8879, 3658.5581, -19.0412 >>,<<0.0, 0.0, 0.0>>, 1.0) IF NOT DOES_BLIP_EXIST(blip_current_destination) blip_current_destination = ADD_BLIP_FOR_COORD(v_pipe_end_pos) ENDIF REPLAY_RECORD_BACK_FOR_TIME(3.0, 7.0, REPLAY_IMPORTANCE_HIGHEST) e_section_stage = SECTION_STAGE_RUNNING ENDIF IF e_section_stage = SECTION_STAGE_RUNNING mocap_streaming_system(<<3530.6719, 3708.6694, 20.0419>>, DEFAULT_CUTSCENE_LOAD_DIST, DEFAULT_CUTSCENE_UNLOAD_DIST, "FBI_5a_MCS_1") if CAN_REQUEST_ASSETS_FOR_CUTSCENE_ENTITY() SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("michael", PLAYER_PED_ID()) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("dave", dave.ped) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("steve", steve.ped) endif if not take_off_scuba_gear IF IS_ENTITY_IN_ANGLED_AREA(PLAYER_PED_ID(), <<3531.911, 3706.334, 19.992>>, <<3528.027, 3706.687, 22.992>>, 3.7)//3.2 SET_PED_DIES_IN_WATER(PLAYER_PED_id(), true) SET_PED_MAX_TIME_UNDERWATER(PLAYER_PED_ID(), -1) take_off_scuba_gear = true endif endif //IF IS_ENTITY_IN_ANGLED_AREA(PLAYER_PED_ID(), <<3527.993, 3712.261, 14.697>>, <<3532.477, 3711.885, 22.0>>, 7.000)//6.0 //IF IS_ENTITY_IN_ANGLED_AREA(PLAYER_PED_ID(), <<3528.184, 3707.006, 19.991>>, <<3531.871, 3706.690, 22.991>>, 3.2)//3.2 if does_blip_exist(blip_current_destination) if is_entity_in_angled_area(player_ped_id(), <<3531.911, 3706.334, 19.992>>, <<3528.027, 3706.687, 22.992>>, 1.0) or is_entity_in_angled_area(player_ped_id(), <<3528.667, 3707.503, 19.992>>, <<3525.471, 3707.759, 22.992>>, 4.8) //if has_cutscene_loaded() if HAS_CUTSCENE_LOADED_WITH_FAILSAFE() if start_new_cutscene_no_fade(false) e_section_stage = SECTION_STAGE_CLEANUP endif endif else if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped)) > 70.00 or get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped)) > 70.00 remove_blip(blip_current_destination) if not has_label_been_triggered("fbi5a_god_27") print_now("fbi5a_god_27", default_god_text_time, 1) set_label_as_triggered("fbi5a_god_27", true) endif endif endif else if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped)) < 50 or get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped)) < 50 if is_this_print_being_displayed("fbi5a_god_27") clear_this_print("fbi5a_god_27") endif IF NOT DOES_BLIP_EXIST(blip_current_destination) blip_current_destination = ADD_BLIP_FOR_COORD(v_pipe_end_pos) ENDIF endif ENDIF if get_script_task_status(player_ped_id(), script_task_perform_sequence) = performing_task int left_stick_x int left_stick_y int right_stick_x int right_stick_y int stick_dead_zone = 28 //(127 + 28) GET_CONTROL_VALUE_OF_ANALOGUE_STICKS(left_stick_x, left_stick_y, right_stick_x, right_stick_y) IF NOT IS_LOOK_INVERTED() right_stick_y *= -1 ENDIF // invert the vertical IF (left_stick_y > STICK_DEAD_ZONE) OR (left_stick_y < (STICK_DEAD_ZONE * -1)) or is_control_pressed(player_control, input_sprint) clear_ped_tasks(player_ped_id()) endif endif swim_to_lab_dialogue_system() fan_system() //applies a force to the player and buddies as they swim over the vent plus ptfx vent_system() buddy_swimming_ai_system() interior_map_system() swim_to_lab_audio_event_system() setup_buddies_for_interior() force_pool_room_for_player_system() if does_entity_exist(flare[1].obj) if get_distance_between_coords(get_entity_coords(flare[1].obj), get_entity_coords(player_ped_id())) > 30.0 if does_particle_fx_looped_exist(flare_ptfx[1]) stop_particle_fx_looped(flare_ptfx[1]) endif delete_object(flare[1].obj) endif endif //SET_PARTICLE_FX_LOOPED_OFFSETS(flare_ptfx[0], widget_object_pos, <<0.0, 0.0, 0.0>>) //attach_entity_to_entity(flare[0].obj, player_ped_id(), get_ped_bone_index(player_ped_id(), BONETAG_PH_R_HAND), widget_object_pos, widget_object_rot) ENDIF IF e_section_stage = SECTION_STAGE_CLEANUP CLEAR_PRINTS() remove_all_blips() SET_OBJECT_AS_NO_LONGER_NEEDED(s_grill_parts[0].obj) SET_OBJECT_AS_NO_LONGER_NEEDED(s_grill_parts[1].obj) SET_VEHICLE_AS_NO_LONGER_NEEDED(boat.veh) if does_particle_fx_looped_exist(fxBubbles) STOP_PARTICLE_FX_LOOPED(fxBubbles) ENDIF INT i = 0 REPEAT COUNT_OF(s_fans) i if does_particle_fx_looped_exist(s_fans[i].i_ptfx) REMOVE_PARTICLE_FX(s_fans[i].i_ptfx) ENDIF ENDREPEAT remove_all_ptfx(false) for i = 0 to count_of(s_fans) - 1 if does_entity_exist(s_fans[i].obj) delete_object(s_fans[i].obj) endif endfor IF NOT HAS_SOUND_FINISHED(sound_underwater_ambience) STOP_SOUND(sound_underwater_ambience) ENDIF IF NOT HAS_SOUND_FINISHED(sound_underwater_rebreather) STOP_SOUND(sound_underwater_rebreather) ENDIF IF NOT HAS_SOUND_FINISHED(i_sound_scuba_gear) STOP_SOUND(i_sound_scuba_gear) ENDIF if is_audio_scene_active("FBI_5_SWIM_TO_TUNNEL_EXIT") STOP_AUDIO_SCENE("FBI_5_SWIM_TO_TUNNEL_EXIT") endif if is_audio_scene_active("FBI_5_GET_TO_SURFACE") STOP_AUDIO_SCENE("FBI_5_GET_TO_SURFACE") endif e_mission_stage = stage_get_out_of_water_mocap//STAGE_FIND_CHEMICALS e_section_stage = SECTION_STAGE_SETUP ENDIF IF e_section_stage = SECTION_STAGE_SKIP interior_lab = GET_INTERIOR_AT_COORDS(v_pipe_end_pos) PIN_INTERIOR_IN_MEMORY(interior_lab) WHILE NOT IS_INTERIOR_READY(interior_lab) WAIT(0) ENDWHILE //SET_ENTITY_COORDS(PLAYER_PED_ID(), v_pipe_end_pos, FALSE) //SET_ENTITY_COORDS_no_offset(PLAYER_PED_ID(), <<3523.1, 3709.2, 19.99>>) SET_ENTITY_COORDS_no_offset(PLAYER_PED_ID(), <<3528.8076, 3716.4666, 17.5>>) SET_ENTITY_HEADING(PLAYER_PED_ID(), 165.0344) FORCE_ROOM_FOR_ENTITY(player_ped_id(), GET_INTERIOR_AT_COORDS_with_type(<<3532.1067, 3721.1770, 15.00>>, "v_lab"), get_hash_key("lab_poolroom")) if not is_ped_injured(dave.ped) SET_ENTITY_COORDS(dave.ped, get_offset_from_entity_in_world_coords(player_ped_id(), <<-1.0, 0.0, 0.0>>)) endif if not is_ped_injured(steve.ped) SET_ENTITY_COORDS(steve.ped, get_offset_from_entity_in_world_coords(player_ped_id(), <<1.0, 0.0, 0.0>>)) endif ENDIF ENDPROC proc manage_ped_hands_up_system(ped_index &miss_ped, vector target_pos) if not is_ped_ragdoll(miss_ped) and not IS_PED_DEAD_OR_DYING(miss_ped) if not is_entity_at_coord(miss_ped, target_pos, <<1.0, 1.0, 1.6>>) or not is_ped_facing_ped(miss_ped, player_ped_id(), 50.00) or not is_entity_playing_anim(miss_ped, "ped", "handsup_base") if not is_entity_playing_anim(miss_ped, "ped", "handsup_base") if not is_entity_playing_anim(miss_ped, "ped", "handsup") TASK_PLAY_ANIM(miss_ped, "ped", "handsup", NORMAL_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING) else if GET_ENTITY_ANIM_CURRENT_TIME(miss_ped, "ped", "handsup") > 0.99 TASK_PLAY_ANIM(miss_ped, "ped", "handsup_base", instant_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING) endif endif endif if has_ped_task_finished_2(miss_ped, script_task_perform_sequence)//, 2) // if not is_entity_playing_anim(miss_ped, "ped", "handsup_base") // TASK_PLAY_ANIM(miss_ped, "ped", "handsup", NORMAL_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING) // endif open_sequence_task(seq) //task_play_anim(null, "missheat", "Dazed_Guard_Loop", normal_blend_in, normal_blend_out, -1, AF_SECONDARY | AF_PRIORITY_HIGH | AF_UPPERBODY | AF_LOOPING) task_follow_nav_mesh_to_coord(null, target_pos, pedmove_walk, -1) task_turn_ped_to_face_entity(null, player_ped_id()) //task_play_anim(null, "ped", "handsup_base", normal_blend_in, normal_blend_out, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING) close_sequence_task(seq) task_perform_sequence(miss_ped, seq) clear_sequence_task(seq) endif endif else if is_entity_playing_anim(miss_ped, "ped", "handsup") STOP_ANIM_TASK(miss_ped, "ped", "handsup") endif if is_entity_playing_anim(miss_ped, "ped", "handsup_base") STOP_ANIM_TASK(miss_ped, "ped", "handsup_base") endif endif endproc //PURPOSE: Need to manually keep track of the scientist being stunned, for the stats PROC CHECK_FOR_scientists_BEING_STUNNED() INT i for i = 0 to count_of(scientist) - 1 IF NOT IS_PED_INJURED(scientist[i].ped) IF NOT scientist[i].was_stunned IF HAS_PED_BEEN_TAZERED_BY_PED(scientist[i].ped, PLAYER_PED_ID()) //INFORM_FBI_FIVE_STUN_GUN_USED() switch i case 0 SET_ENTITY_NO_COLLISION_ENTITY(scientist[i].ped, steve.ped, false) break endswitch set_ped_config_flag(scientist[i].ped, PCF_DisableBloodPoolCreation, true) if is_synchronized_scene_running(scientist[i].scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(scientist[i].ped, normal_blend_in, true) endif SET_ENTITY_HEALTH(scientist[i].ped, 1) //added for bug 363284 INFORM_MISSION_STATS_OF_INCREMENT(FBI5_STUNS) scientist[i].was_stunned = TRUE ENDIF ENDIF ENDIF endfor ENDPROC //PURPOSE: Need to manually keep track of the security guards being stunned, for the stats PROC check_for_patrol_security_guards_being_stunned() INT i for i = 0 to count_of(patrol_security_guard) - 1 IF NOT IS_PED_INJURED(patrol_security_guard[i].ped) IF NOT patrol_security_guard[i].was_stunned IF HAS_PED_BEEN_TAZERED_BY_PED(patrol_security_guard[i].ped, PLAYER_PED_ID()) set_ped_drops_weapon(patrol_security_guard[i].ped) //INFORM_FBI_FIVE_STUN_GUN_USED() set_ped_config_flag(patrol_security_guard[i].ped, PCF_DisableBloodPoolCreation, true) if is_synchronized_scene_running(patrol_security_guard[i].scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(patrol_security_guard[i].ped, normal_blend_in, true) endif SET_ENTITY_HEALTH(patrol_security_guard[i].ped, 5) INFORM_MISSION_STATS_OF_INCREMENT(FBI5_STUNS) patrol_security_guard[i].was_stunned = TRUE ENDIF ELSE IF IS_PED_RAGDOLL(patrol_security_guard[i].ped) SET_ENTITY_HEALTH(patrol_security_guard[i].ped, 5) ENDIF ENDIF ENDIF endfor ENDPROc PROC check_for_security_guard_being_stunned() INT i for i = 0 to count_of(security_guard) - 1 IF NOT IS_PED_INJURED(security_guard[i].ped) IF NOT security_guard[i].was_stunned IF HAS_PED_BEEN_TAZERED_BY_PED(security_guard[i].ped, PLAYER_PED_ID()) //INFORM_FBI_FIVE_STUN_GUN_USED() set_ped_config_flag(security_guard[i].ped, PCF_DisableBloodPoolCreation, true) SET_ENTITY_HEALTH(security_guard[i].ped, 2) INFORM_MISSION_STATS_OF_INCREMENT(FBI5_STUNS) security_guard[i].was_stunned = TRUE ENDIF ELSE // if not is_ped_ragdoll(security_guard[i].ped) // SET_ENTITY_HEALTH(security_guard[i].ped, 2) // ENDIF ENDIF ENDIF endfor ENDPROC proc get_to_lift_dialogue_system() switch get_to_lift_dialogue_status case 0 dialogue_time = 0 IF CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_zapper", CONV_PRIORITY_low) get_to_lift_dialogue_status++ endif break case 1 if not has_label_been_triggered("fbi5a_surf4") IF CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_surf4", CONV_PRIORITY_low) REPLAY_RECORD_BACK_FOR_TIME(4.0, 8.0, REPLAY_IMPORTANCE_HIGHEST) set_label_as_triggered("fbi5a_surf4", true) endif else if not has_label_been_triggered("FOL_CREW") if not is_any_text_being_displayed(locates_data) print_now("FOL_CREW", default_god_text_time, 1) set_label_as_triggered("FOL_CREW", true) endif endif endif if is_entity_in_angled_area(player_ped_id(), <<3522.246, 3701.509, 19.798>>, <<3527.063, 3700.612, 22.998>>, 2.600) or is_entity_in_angled_area(dave.ped, <<3522.246, 3701.509, 19.798>>, <<3527.063, 3700.612, 22.998>>, 2.600) get_to_lift_dialogue_status = 2 endif break case 2 //scientist 0 hands up if is_message_being_displayed() clear_this_print("FOL_CREW") endif //if the player runs immediately from getting control fbi5a_zapper will be playing so by the time //fbi5a_up0a triggers the scientist may already have put his hands up and could be against the wall. //checking the phase will ensure hands up dialogue does not play and moves onto next dialogue //this keeps the synched scene and dialogue better synched up. if is_synchronized_scene_running(dave.scene_id) if get_synchronized_scene_phase(dave.scene_id) < 0.46 IF CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_up0a",CONV_PRIORITY_medium) get_to_lift_dialogue_status++ endif else get_to_lift_dialogue_status++ endif endif break case 3 IF CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_up0c",CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_up0c", true) get_to_lift_dialogue_status++ endif break case 4 IF CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_up0b", CONV_PRIORITY_medium) get_to_lift_dialogue_status++ endif break case 5 IF CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_shock0",CONV_PRIORITY_medium) get_to_lift_dialogue_status++ endif break case 6 if not is_any_text_being_displayed(locates_data) //print_now("TAZ_SCI", default_god_text_time, 0) dialogue_time = get_game_timer() get_to_lift_dialogue_status++ endif break case 7 //move forward if is_ped_injured(scientist[0].ped) // //clear_this_print("TAZ_SCI") // if dialogue_time = 0 // // dialogue_time = get_game_timer() // // else // // if lk_timer(dialogue_time, 1000) IF CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_dia41",CONV_PRIORITY_medium)//fbi5a_elv0 get_to_lift_dialogue_status++ endif // endif // endif else if not is_any_text_being_displayed(locates_data) if lk_timer(dialogue_time, 7000) switch get_random_int_in_range(0, 2) case 0 IF CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_shock0", CONV_PRIORITY_medium) dialogue_time = get_game_timer() endif break case 1 IF CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_shock0", CONV_PRIORITY_medium) dialogue_time = get_game_timer() endif break case 2 IF CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_cower1", CONV_PRIORITY_medium) dialogue_time = get_game_timer() endif break endswitch endif endif endif break case 8 //guard drop gun if not has_label_been_triggered("fbi5a_secur0") if not is_ped_injured(patrol_security_guard[0].ped) if (is_synchronized_scene_running(patrol_security_guard[0].scene_id) and get_synchronized_scene_phase(patrol_security_guard[0].scene_id) > 0.75) or (patrol_security_guard_0_system_status > 0 and not is_synchronized_scene_running(patrol_security_guard[0].scene_id)) //if is_entity_at_coord(patrol_security_guard[0].ped, patrol_security_guard[0].run_to_pos, <<1.5, 1.5, 2.0>>) if CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_secur0", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_secur0", true) //script_assert("test 0") get_to_lift_dialogue_status++ endif endif else if patrol_security_guard[0].created get_to_lift_dialogue_status = 11 endif endif endif break case 9 if not is_any_text_being_displayed(locates_data) if CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_secur1",CONV_PRIORITY_medium) get_to_lift_dialogue_status++ endif endif break case 10 if not is_any_text_being_displayed(locates_data) if CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_stun0", CONV_PRIORITY_medium) dialogue_time = get_game_timer() get_to_lift_dialogue_status++ endif endif break case 11 if is_ped_injured(patrol_security_guard[0].ped) kill_any_conversation() get_to_lift_dialogue_status++ else if lk_timer(dialogue_time, 7000) if not is_any_text_being_displayed(locates_data) switch get_random_int_in_range(0, 3) case 0 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_shock0", CONV_PRIORITY_medium) dialogue_time = get_game_timer() endif break case 1 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_stun0", CONV_PRIORITY_medium) dialogue_time = get_game_timer() endif break case 2 // if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_cower4", CONV_PRIORITY_medium) // dialogue_time = get_game_timer() // endif break endswitch endif endif endif break case 12 //move to lift if CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_stun1", CONV_PRIORITY_medium) get_to_lift_dialogue_status++ endif break case 13 if not is_any_text_being_displayed(locates_data) //player not outside lift. if not is_entity_in_angled_area(player_ped_id(), <<3540.059, 3673.385, 19.999>>, <<3539.403, 3669.642, 22.999>>, 12.0) dialogue_time = get_game_timer() print_now("GET_LFT", 5000, 1) endif get_to_lift_dialogue_status++ endif break case 14 if not has_label_been_triggered("fbi5a_dia7c") if lk_timer(dialogue_time, 4000) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia7c", CONV_PRIORITY_low) set_label_as_triggered("fbi5a_dia7c", true) endif endif endif if does_entity_exist(scientist[1].ped) and is_entity_in_angled_area(player_ped_id(), <<3540.059, 3673.385, 19.999>>, <<3539.403, 3669.642, 22.999>>, 12.0) and (has_anim_dict_loaded("missfbi5ig_10") and is_entity_at_coord(dave.ped, GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_10", "lift_holdup_dave", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>), <<1.0, 1.0, 1.6>>))// and not is_synchronized_scene_running(dave.scene_id)) and (has_anim_dict_loaded("missfbi5ig_10") and is_entity_at_coord(steve.ped, GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_10", "lift_holdup_steve", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>), <<1.0, 1.0, 1.6>>))// and not is_synchronized_scene_running(steve.scene_id)) get_to_lift_dialogue_status++ endif break case 15 //if has_label_been_triggered("WAIT_LIFT") //if lk_timer(dialogue_time, 2000) if CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbia5a_elv1", CONV_PRIORITY_medium) get_to_lift_dialogue_status++ endif //endif //endif break case 16 if is_synchronized_scene_running(scientist[1].scene_id) if get_synchronized_scene_phase(scientist[1].scene_id) > 0.3 get_to_lift_dialogue_status++ endif endif break case 17 if not is_any_text_being_displayed(locates_data) if CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbia5a_card0", CONV_PRIORITY_medium) get_to_lift_dialogue_status++ endif endif break case 18 if does_blip_exist(lift_blip) if not has_label_been_triggered("fbia5a_card4") if CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbia5a_card4", CONV_PRIORITY_medium) set_label_as_triggered("fbia5a_card4", true) get_to_lift_dialogue_status++ endif else get_to_lift_dialogue_status++ endif endif break case 19 if not is_any_text_being_displayed(locates_data) if not is_entity_in_angled_area(player_ped_id(), <<3539.104004,3675.680908,19.686018>>, <<3542.164551,3675.201172,22.622726>>, 4.250000) if not has_label_been_triggered("GET_LFT2") clear_prints() print_now("GET_LFT2", default_god_text_time, 1) set_label_as_triggered("fbi5a_lift0", true) get_to_lift_dialogue_status++ endif endif endif break case 20 if is_entity_in_angled_area(player_ped_id(), <<3539.104004,3675.680908,19.686018>>, <<3542.164551,3675.201172,22.622726>>, 4.250000) clear_this_print("GET_LFT2") endif break endswitch if get_to_lift_dialogue_status < 7 if is_ped_injured(scientist[0].ped) or is_entity_in_angled_area(player_ped_id(), <<3525.810, 3687.614, 19.995>>, <<3521.676, 3688.336, 23.000>>, 2.0) clear_prints() kill_any_conversation() get_to_lift_dialogue_status = 7 endif endif if get_to_lift_dialogue_status < 8 if not is_ped_injured(patrol_security_guard[0].ped) if is_entity_at_coord(patrol_security_guard[0].ped, patrol_security_guard[0].run_to_pos, <<1.5, 1.5, 2.0>>) clear_prints() kill_any_conversation() get_to_lift_dialogue_status = 8 endif endif endif if get_to_lift_dialogue_status < 12 if patrol_security_guard[0].created if is_ped_injured(patrol_security_guard[0].ped) clear_prints() kill_any_conversation() get_to_lift_dialogue_status = 12 endif endif endif // KILL_FACE_TO_FACE_CONVERSATION_DO_NOT_FINISH_LAST_LINE() // ADD_NON_CRITICAL_STANDARD_CONVERSATION_TO_BUFFER(scripted_speech[0], "heataud", "amb_cut_2", CONV_PRIORITY_MEDIUM) endproc proc steve_ai_system() switch steve_ai_system_status case 0 //set_current_ped_weapon(steve.ped, steve.weapon, true) //task_put_ped_directly_into_cover(steve.ped, GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_2", "holdup_scient_steve", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>), -1, false, 0.0, true, true, cover_point[0]) task_put_ped_directly_into_cover(steve.ped, <<3524.1816, 3703.0017, 19.9918>>, -1, false, 0.0, true, true, cover_point[0]) force_ped_ai_and_animation_update(steve.ped) steve_ai_system_status++ break case 1 if is_entity_in_angled_area(player_ped_id(), <<3527.343, 3698.451, 20.199>>, <<3523.396, 3699.103, 22.799>>, 3.000) or is_ped_injured(scientist[0].ped) scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_2", "holdup_scient_steve", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) steve_cover_point_stolen = false steve.run_to_pos = get_anim_initial_offset_position("missfbi5ig_2", "holdup_scient_steve", scene_pos, scene_rot, 1.0) steve_ai_system_status++ endif break case 2 request_anim_dict("missfbi5ig_5") TRANSITION_FROM_MOCAP_TO_AIM(steve.ped, steve.scene_id, steve.run_to_pos, <<3523.1, 36.94, 21.6>>, scientist[0].ped) if is_ped_injured(scientist[0].ped) if not is_synchronized_scene_running(steve.scene_id) and has_anim_dict_loaded("missfbi5ig_5") and has_ped_task_finished_2(steve.ped, script_task_perform_sequence, 1) scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_5", "holdup_sec_steve", slow_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) steve_cover_point_stolen = false steve.run_to_pos = get_anim_initial_offset_position("missfbi5ig_5", "holdup_sec_steve", scene_pos, scene_rot, 1.0) steve_ai_system_status++ endif else if patrol_security_guard[0].created if not is_synchronized_scene_running(steve.scene_id) if has_ped_task_finished_2(steve.ped) open_sequence_task(seq) task_shoot_at_entity(null, scientist[0].ped, 1500, FIRING_TYPE_1_BURST) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif endif endif break case 3 request_anim_dict("missfbi5ig_8") TRANSITION_FROM_MOCAP_TO_AIM(steve.ped, steve.scene_id, steve.run_to_pos, <<3521.4, 3676.9, 21.6>>, patrol_security_guard[0].ped, 1.0, true) if is_ped_injured(scientist[0].ped) and is_ped_injured(patrol_security_guard[0].ped) if not is_synchronized_scene_running(steve.scene_id) and has_anim_dict_loaded("missfbi5ig_8") steve.run_to_pos = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_8", "runto_lift_steve", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>, 1.0) scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_8", "runto_lift_steve", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) steve_ai_system_status++ endif endif break case 4 printstring("elevator_0_system_status") printint(elevator_0_system_status) printnl() request_anim_dict("missfbi5ig_10") TRANSITION_FROM_MOCAP_TO_AIM(steve.ped, steve.scene_id, steve.run_to_pos, <<3540.0, 3673.2, 21.6>>, null) if not is_synchronized_scene_running(steve.scene_id) if has_anim_dict_loaded("missfbi5ig_10") and elevator_0_system_status > 1 //lift doors starting to open. //and (is_synchronized_scene_running(dave.scene_id) and get_synchronized_scene_anims() //ADD BACK WHEN scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_10", "lift_holdup_steve", normal_blend_in, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_blend_in) //TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_10", "lift_holdup_steve", FAST_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, rbf_none, FAST_BLEND_IN) set_ped_reset_flag(steve.ped, PRF_DontQuitMotionAiming, true) steve_ai_system_status++ endif endif break case 5 if is_synchronized_scene_running(steve.scene_id) if get_synchronized_scene_phase(steve.scene_id) < 0.1 set_ped_reset_flag(steve.ped, PRF_DontQuitMotionAiming, true) endif if get_synchronized_scene_phase(steve.scene_id) >= 1.0 or is_ped_injured(scientist[1].ped) scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_10", "lift_holdup_loop_steve", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_blend_in) SET_SYNCHRONIZED_SCENE_LOOPED(steve.scene_id, true) steve_ai_system_status = 6 endif // if is_ped_injured(scientist[1].ped) // steve_ai_system_status++ // endif endif break case 6 request_anim_dict("missfbi5ig_11") if is_ped_injured(scientist[1].ped) and scientist[1].created and not does_entity_exist(security_card.obj) if has_anim_dict_loaded("missfbi5ig_11") scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_11", "enter_lift_steve", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_blend_in) steve_ai_system_status++ endif endif break case 7 if is_synchronized_scene_running(steve.scene_id) if get_synchronized_scene_phase(steve.scene_id) >= 1.00 //STOP_SYNCHRONIZED_ENTITY_ANIM(steve.ped, NORMAL_BLEND_OUT, TRUE) //clear_ped_tasks(steve.ped) SET_SYNCHRONIZED_SCENE_HOLD_LAST_FRAME(steve.scene_id, false) endif else endif break endswitch endproc //PURPOSE: forces the ped aim at scientist for a second longer. func bool allow_dave_to_run_to_patrol_guard_0() if is_ped_injured(scientist[0].ped) if dave_time = 0 dave_time = get_game_timer() else if lk_timer(dave_time, 1000) return true endif endif else return true endif return false endfunc proc dave_ai_system() // printint(dave_ai_system_status) // printnl() switch dave_ai_system_status case 0 //set_current_ped_weapon(dave.ped, dave.weapon, true) task_aim_gun_at_coord(dave.ped, <<3525.2, 3703.0, 21.50>>, -1, true) force_ped_motion_state(dave.ped, MS_AIMING) force_ped_ai_and_animation_update(dave.ped) dave_ai_system_status++ break case 1 if is_entity_in_angled_area(player_ped_id(), <<3531.971, 3708.092, 19.997>>, <<3519.421, 3710.035, 22.997>>, 2.5) //5.5 3.7 //get_to_lift_dialogue_status = 2 //triggers dialogue kill_any_conversation() scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_2", "holdup_scient_dave", slow_BLEND_IN, slow_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, slow_blend_in) dave.run_to_pos = get_anim_initial_offset_position("missfbi5ig_2", "holdup_scient_dave", scene_pos, scene_rot, 1.0) dave_time = 0 dave_ai_system_status = 2 endif if is_ped_injured(scientist[0].ped) dave_ai_system_status = 2 endif break case 2 TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, dave.run_to_pos, <<3523.1, 3693.6, 21.6>>, scientist[0].ped) request_anim_dict("missfbi5ig_5") if is_ped_injured(scientist[0].ped) or is_entity_in_angled_area(player_ped_id(), <<3525.810, 3687.614, 19.995>>, <<3521.676, 3688.336, 23.000>>, 2.0) dave_ai_system_status++ endif break case 3 request_anim_dict("missfbi5ig_5") TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, dave.run_to_pos, <<3523.1, 3693.6, 21.6>>, scientist[0].ped) if not is_synchronized_scene_running(dave.scene_id) and has_anim_dict_loaded("missfbi5ig_5") // if allow_dave_to_run_to_patrol_guard_0() scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_5", "holdup_sec_dave", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_blend_in) dave.run_to_pos = get_anim_initial_offset_position("missfbi5ig_5", "holdup_sec_dave", scene_pos, scene_rot, 1.0) dave_ai_system_status++ endif break case 4 request_anim_dict("missfbi5ig_8") TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, dave.run_to_pos, <<3521.4, 3676.9, 21.6>>, patrol_security_guard[0].ped) if is_ped_injured(scientist[0].ped) and is_ped_injured(patrol_security_guard[0].ped) dave_ai_system_status++ endif break case 5 request_anim_dict("missfbi5ig_8") if is_synchronized_scene_running(dave.scene_id) TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, dave.run_to_pos, <<3521.4, 3676.9, 21.6>>, patrol_security_guard[0].ped) else if has_anim_dict_loaded("missfbi5ig_8") scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_8", "runto_lift_dave", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_blend_in) dave.run_to_pos = get_anim_initial_offset_position("missfbi5ig_8", "runto_lift_dave", scene_pos, scene_rot, 1.0) dave_ai_system_status++ endif endif break case 6 request_anim_dict("missfbi5ig_10") TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, dave.run_to_pos, <<3539.9, 3672.8, 21.6>>) if is_synchronized_scene_running(dave.scene_id) //TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, dave.run_to_pos, <<3539.9, 3672.8, 21.6>>) else if has_anim_dict_loaded("missfbi5ig_10") //and elevator_0_system_status > 0 //lift doors starting to open. and does_entity_exist(scientist[1].ped) and is_entity_in_angled_area(player_ped_id(), <<3540.059, 3673.385, 19.999>>, <<3539.403, 3669.642, 22.999>>, 12.0) and (is_entity_at_coord(dave.ped, GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_10", "lift_holdup_dave", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>), <<1.0, 1.0, 1.6>>)) //and (has_anim_dict_loaded("missfbi5ig_10") and is_entity_at_coord(steve.ped, GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_10", "lift_holdup_steve", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>), <<1.0, 1.0, 1.6>>) and not is_synchronized_scene_running(steve.scene_id)) scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_10", "lift_holdup_dave", slow_BLEND_IN, slow_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_blend_in) dave_ai_system_status++ //script_assert("anim") endif if scientist[1].created if is_ped_injured(scientist[1].ped) dave_ai_system_status++ endif endif endif break case 7 request_anim_dict("missfbi5ig_11") if is_synchronized_scene_running(dave.scene_id) if get_synchronized_scene_phase(dave.scene_id) >= 1.0 scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_10", "lift_holdup_loop_dave", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_blend_in) SET_SYNCHRONIZED_SCENE_LOOPED(dave.scene_id, true) dave_ai_system_status++ endif if is_ped_injured(scientist[1].ped) if get_synchronized_scene_phase(dave.scene_id) < 0.588 //time after grab //STOP_SYNCHRONIZED_ENTITY_ANIM(dave.ped, NORMAL_BLEND_OUT, TRUE) dave_ai_system_status = 20 endif endif endif break case 8 request_anim_dict("missfbi5ig_11") if is_ped_injured(scientist[1].ped) and not does_entity_exist(security_card.obj) and has_anim_dict_loaded("missfbi5ig_11") scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_11", "enter_lift_dave", normal_BLEND_IN, slow_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_blend_in) dave_ai_system_status++ endif break case 9 if is_synchronized_scene_running(dave.scene_id) if get_synchronized_scene_phase(dave.scene_id) >= 1.00 //STOP_SYNCHRONIZED_ENTITY_ANIM(dave.ped, NORMAL_BLEND_OUT, TRUE) clear_ped_tasks(dave.ped) endif else endif break case 20 request_anim_dict("missfbi5ig_11") if has_anim_dict_loaded("missfbi5ig_11") if is_entity_in_angled_area(dave.ped, <<3539.104004,3675.680908,19.686018>>, <<3542.164551,3675.201172,22.622726>>, 4.250000) dave.rot = GET_ANIM_INITIAL_OFFSET_rotation("missfbi5ig_11", "enter_lift_dave", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>, 1.0) open_sequence_task(seq) //TASK_GO_TO_COORD_WHILE_AIMING_AT_coord(null, GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_11", "enter_lift_dave", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>, 1.0), <<3540.4, 3673.4, 21.2>>, pedmove_walk, false, 0.1, 0.1, true) task_follow_nav_mesh_to_coord(null, GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_11", "enter_lift_dave", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>, 1.0), pedmove_walk, -1, 0.1, enav_default, dave.rot.z) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_ai_system_status = 22 else open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_coord(null, GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_10", "lift_holdup_dave", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>, 1.0), <<3540.4, 3673.4, 21.2>>, pedmove_walk, false, 0.1, 0.1, true) task_aim_gun_at_coord(null, <<3540.4, 3673.4, 21.2>>, -1, true) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_ai_system_status = 21 endif endif break case 21 request_anim_dict("missfbi5ig_11") if not is_entity_at_coord(dave.ped, GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_10", "lift_holdup_dave", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>, 1.0), <<0.5, 0.5, 1.6>>) if has_ped_task_finished_2(dave.ped, script_task_perform_sequence, 1) open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_coord(null, GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_10", "lift_holdup_dave", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>, 1.0), <<3540.4, 3673.4, 21.2>>, pedmove_walk, false, 0.1, 0.1, true) task_aim_gun_at_coord(null, <<3540.4, 3673.4, 21.2>>, -1, true) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif else if ((does_blip_exist(lift_blip)) or ((not does_blip_exist(lift_blip)) and (get_to_lift_master_flow_system_status >= 5))) //incase player enters lift and collects card so lift blip will not exist anymore and has_anim_dict_loaded("missfbi5ig_11") scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_11", "enter_lift_dave", slow_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, slow_blend_in) dave_ai_system_status++ endif endif break case 22 if not is_entity_at_coord(dave.ped, GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_11", "enter_lift_dave", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>, 1.0), <<0.5, 0.5, 1.6>>) if has_ped_task_finished_2(dave.ped, script_task_perform_sequence, 1) open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_coord(null, GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_11", "enter_lift_dave", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>, 1.0), <<3540.4, 3673.4, 21.2>>, pedmove_walk, false, 0.1, 0.1, true) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif endif break endswitch endproc proc kill_ped_on_certain_damage(ped_structure &miss_ped) if not is_ped_injured(miss_ped.ped) IF HAS_ENTITY_BEEN_DAMAGED_BY_WEAPON(miss_ped.ped, WEAPONTYPE_GRENADE) OR HAS_ENTITY_BEEN_DAMAGED_BY_WEAPON(miss_ped.ped, WEAPONTYPE_GRENADELAUNCHER) OR HAS_ENTITY_BEEN_DAMAGED_BY_WEAPON(miss_ped.ped, WEAPONTYPE_STICKYBOMB) OR HAS_ENTITY_BEEN_DAMAGED_BY_WEAPON(miss_ped.ped, WEAPONTYPE_RPG) if is_synchronized_scene_running(miss_ped.scene_id) stop_synchronized_entity_anim(miss_ped.ped, normal_blend_out, true) endif set_ped_can_ragdoll(miss_ped.ped, true) set_entity_health(miss_ped.ped, 1) endif endif endproc proc scientist_0_ai_system() if not is_ped_injured(scientist[0].ped) switch scientist_0_ai_status case 0 if is_entity_in_angled_area(player_ped_id(), <<3531.971, 3708.092, 19.997>>, <<3519.421, 3710.035, 22.997>>, 2.5) //5.5 3.7 scene_pos = << 3538.970, 3673.487, 19.992>> scene_rot = << 0.000, 0.000, -9.400 >> scientist[0].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[0].ped, scientist[0].scene_id, "missfbi5ig_2", "holdup_scient_labped", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, NORMAL_BLEND_IN) SET_SYNCHRONIZED_SCENE_HOLD_LAST_FRAME(scientist[0].scene_id, true) //force_ped_ai_and_animation_update(scientist[0].ped) scientist_0_ai_status++ endif break case 1 if not does_blip_exist(scientist[0].blip) scientist[0].blip = CREATE_BLIP_FOR_entity(scientist[0].ped, true) endif if is_synchronized_scene_running(scientist[0].scene_id) if get_synchronized_scene_phase(scientist[0].scene_id) >= 1.0 scene_pos = <<3538.970, 3673.487, 19.992>> scene_rot = <<0.000, 0.000, -9.400>> scientist[0].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[0].ped, scientist[0].scene_id, "missfbi5ig_2", "holdup_scient_loop_labped", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, instant_BLEND_IN) set_synchronized_scene_looped(scientist[0].scene_id, true) scientist_0_ai_status++ endif else scientist_0_ai_status++ endif break case 2 if not IS_PED_RAGDOLL(scientist[0].ped) and not IS_PED_DEAD_OR_DYING(scientist[0].ped) if not is_synchronized_scene_running(scientist[0].scene_id) scientist[0].run_to_pos = get_anim_initial_offset_position("missfbi5ig_2", "holdup_scient_loop_labped", <<3538.970, 3673.487, 19.992>>, <<0.000, 0.000, -9.400>>, 1.0) scientist[0].rot = get_anim_initial_offset_rotation("missfbi5ig_2", "holdup_scient_loop_labped", <<3538.970, 3673.487, 19.992>>, <<0.000, 0.000, -9.400>>, 1.0) if not is_entity_playing_anim(scientist[0].ped, "missfbi5ig_2", "holdup_scient_loop_labped") if not is_entity_playing_anim(scientist[0].ped, "ped", "handsup_base") if not is_entity_playing_anim(scientist[0].ped, "ped", "handsup") TASK_PLAY_ANIM(scientist[0].ped, "ped", "handsup", NORMAL_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING) else if GET_ENTITY_ANIM_CURRENT_TIME(scientist[0].ped, "ped", "handsup") > 0.99 TASK_PLAY_ANIM(scientist[0].ped, "ped", "handsup_base", instant_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING) endif endif endif else if get_entity_anim_current_time(scientist[0].ped, "missfbi5ig_2", "holdup_scient_loop_labped") > 0.1 if is_entity_playing_anim(scientist[0].ped, "ped", "handsup") STOP_ANIM_TASK(scientist[0].ped, "ped", "handsup") endif if is_entity_playing_anim(scientist[0].ped, "ped", "handsup_base") STOP_ANIM_TASK(scientist[0].ped, "ped", "handsup_base") endif endif endif if not is_entity_at_coord(scientist[0].ped, scientist[0].run_to_pos, <<0.5, 0.5, 1.6>>) or not is_entity_playing_anim(scientist[0].ped, "missfbi5ig_2", "holdup_scient_loop_labped") if has_ped_task_finished_2(scientist[0].ped, script_task_perform_sequence, 1) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, scientist[0].run_to_pos, pedmove_walk, -1, 0.05, ENAV_STOP_EXACTLY | ENAV_DONT_ADJUST_TARGET_POSITION, scientist[0].rot.z) TASK_PLAY_ANIM_advanced(null, "missfbi5ig_2", "holdup_scient_loop_labped", scientist[0].run_to_pos, scientist[0].rot, 1, NORMAL_BLEND_OUT, -1, AF_LOOPING | AF_EXIT_AFTER_INTERRUPTED) close_sequence_task(seq) task_perform_sequence(scientist[0].ped, seq) clear_sequence_task(seq) endif endif endif else if is_entity_playing_anim(scientist[0].ped, "ped", "handsup") STOP_ANIM_TASK(scientist[0].ped, "ped", "handsup", slow_blend_out) endif if is_entity_playing_anim(scientist[0].ped, "ped", "handsup_base") STOP_ANIM_TASK(scientist[0].ped, "ped", "handsup_base", slow_blend_out) endif endif break endswitch if HAS_PED_BEEN_TAZERED_BY_PED(scientist[0].ped, steve.ped) setup_tazor_kill_for_ped(scientist[0]) endif else //scientist's in this section do not get marked as no longer needed via ped_structure_are_all_enemies_dead() //scientist set as no longer need would be deleted by code when the security card was moved by script. //This code forces this specific ped to be set as no longer needed. if scientist[0].created if does_entity_exist(scientist[0].ped) if not does_blip_exist(scientist[0].blip) //stops ped_structure_are_all_enemies_dead() from breaking when scientist_0_ai_system() is called before ped_structure_are_all_enemies_dead() thus meaning does_entity_exist will return false inside ped_structure_are_all_enemies_dead() because SET_PED_AS_NO_LONGER_NEEDED(scientist[0].ped) has been set here. SET_PED_AS_NO_LONGER_NEEDED(scientist[0].ped) endif endif endif endif endproc func bool elevator_0_system() switch elevator_0_system_status case 0 elevator_display[0].obj = create_object_no_offset(elevator_display[0].model, elevator_display[0].pos) set_entity_rotation(elevator_display[0].obj, elevator_display[0].rot) freeze_entity_position(elevator_display[0].obj, true) elevator_0_system_status++ break case 1 if does_entity_exist(scientist[1].ped) and (is_synchronized_scene_running(dave.scene_id) and is_entity_playing_anim(dave.ped, "missfbi5ig_10", "lift_holdup_dave")) //play_sound_from_coord(lift_sound, "LIFT_POSH_MOVE", <<3539.0, 3673.7, 20.0>>) play_sound_from_coord(lift_sound, "Move_Fade_In", <<3539.0, 3673.7, 20.0>>, "LIFT_POSH_SOUNDSET") original_time = get_game_timer() elevator_0_system_status++ endif break case 2 if lk_timer(original_time, 1500) delete_object(elevator_display[0].obj) set_model_as_no_longer_needed(elevator_display[0].model) elevator_display[1].obj = create_object_no_offset(elevator_display[1].model, elevator_display[1].pos) set_entity_rotation(elevator_display[1].obj, elevator_display[1].rot) freeze_entity_position(elevator_display[1].obj, true) elevator_0_system_status++ endif break case 3 if lk_timer(original_time, 3000) if not is_ped_injured(scientist[1].ped) scientist[1].blip = create_blip_for_ped(scientist[1].ped, true) //clear_this_print("WAIT_LIFT") endif delete_object(elevator_display[1].obj) set_model_as_no_longer_needed(elevator_display[1].model) elevator_display[2].obj = create_object_no_offset(elevator_display[2].model, elevator_display[2].pos) set_entity_rotation(elevator_display[2].obj, elevator_display[2].rot) freeze_entity_position(elevator_display[2].obj, true) stop_sound(lift_sound) play_sound_from_coord(lift_sound, "LIFTS_TONE", <<3539.0, 3673.7, 20.0>>) elevator_0_system_status++ endif break case 4 if has_sound_finished(lift_sound) play_sound_from_coord(lift_sound, "LIFT_POSH_DOOR_OPEN", <<3539.0, 3673.7, 20.0>>) move_doors(V_ILev_BL_DoorEL_L, <<3539.0, 3673.7, 20.0>>, V_ILev_BL_DoorEL_R, <<3541.6, 3673.2, 20.0>>) elevator_0_system_status++ endif break case 5 //if move_doors(V_ILev_BL_DoorEL_L, <<3539.0, 3673.7, 20.0>>, V_ILev_BL_DoorEL_R, <<3541.6, 3673.2, 20.0>>) if move_doors_with_new_door_system(fbi_5_door[1], fbi_5_door[2]) if not has_sound_finished(lift_sound) stop_sound(lift_sound) endif return true elevator_0_system_status++ endif break case 6 return true break endswitch return false endfunc func float get_dif_between_angles(float target_angle, float current_angle) float angle_dif angle_dif = target_angle - current_angle if angle_dif > 180 angle_dif -= 360 endif if angle_dif < 180 angle_dif += 360 endif return angle_dif endfunc PROC SHIFT_FLOAT_TO_IDEAL_FLOAT(FLOAT &fCurrent, FLOAT fIdeal, FLOAT fSpeed) IF fCurrent < fIdeal fCurrent = fCurrent +@ fSpeed IF fCurrent > fIdeal fCurrent = fIdeal ENDIF ELIF fCurrent > fIdeal fCurrent = fCurrent -@ fSpeed IF fCurrent < fIdeal fCurrent = fIdeal ENDIF ENDIF ENDPROC PROC SHIFT_VECTOR_TO_IDEAL_VECTOR(VECTOR &vCurrent, VECTOR vIdeal, FLOAT fSpeed) SHIFT_FLOAT_TO_IDEAL_FLOAT(vCurrent.x, vIdeal.x, fSpeed) SHIFT_FLOAT_TO_IDEAL_FLOAT(vCurrent.y, vIdeal.y, fSpeed) SHIFT_FLOAT_TO_IDEAL_FLOAT(vCurrent.z, vIdeal.z, fSpeed) ENDPROC proc security_card_physics_system() if does_entity_exist(security_card.obj) #if is_debug_build widget_card_pos = get_entity_coords(security_card.obj) widget_card_rot = get_entity_rotation(security_card.obj) #endif switch security_card_physics_system_status case 0 if is_entity_attached(security_card.obj) detach_entity(security_card.obj, false) endif security_card_target_pos = get_entity_coords(security_card.obj) security_card_target_pos.z = 20.0 //20.00floor height // security_card_target_rot = get_entity_rotation(security_card.obj) // security_card_target_rot.x = 270.00 security_card_target_rot = get_entity_rotation(security_card.obj) security_card.rot = get_entity_rotation(security_card.obj) //security_card_target_rot.x = 270.00 // security_card_target_rot.x = (270.00 - security_card.rot.x) // security_card_target_rot.y = (0.0 - security_card.rot.y) // security_card_target_rot.z = (0.0 - security_card.rot.z) vector target_rot_0 vector target_rot_1 float target_rot_0_x_diff float target_rot_1_x_diff target_rot_0 = get_entity_rotation(security_card.obj) target_rot_0.x = 273.2776//270.00 target_rot_1 = get_entity_rotation(security_card.obj) target_rot_1.x = -86.7224//-90.00 target_rot_0_x_diff = target_rot_0.x - security_card.rot.x target_rot_1_x_diff = target_rot_1.x - security_card.rot.x // example // -90 - (-45) = -45 // 270 - (-45) = 315 if absf(target_rot_0_x_diff) < absf(target_rot_1_x_diff) security_card_target_rot.x = target_rot_0.x else security_card_target_rot.x = target_rot_1.x endif printstring("original pos = ") printvector(get_entity_coords(security_card.obj)) printnl() printstring("original rot = ") printvector(get_entity_rotation(security_card.obj)) printnl() printstring("security_card_target_rot = ") printvector(security_card_target_rot) printnl() security_card.blip = create_blip_for_object(security_card.obj) // set_entity_coords_no_offset(security_card.obj, security_card_target_pos) // SET_entity_COLLISION(security_card.obj, true) // freeze_entity_position(security_card.obj, true) // security_card_physics_system_status = 100 security_card_physics_system_status++ break case 1 vector direction_pos_vec security_card.pos = get_entity_coords(security_card.obj) direction_pos_vec = normalise_vector(security_card_target_pos - security_card.pos) if are_vectors_alomost_equal(security_card.pos, security_card_target_pos, (direction_pos_vec * get_frame_time() * 0.1))//0.2 set_entity_coords_no_offset(security_card.obj, security_card_target_pos) SET_entity_COLLISION(security_card.obj, true) freeze_entity_position(security_card.obj, true) else security_card.pos -= (direction_pos_vec * get_frame_time() * 0.1)//0.2 set_entity_coords_no_offset(security_card.obj, security_card.pos) endif printstring("pos = ") printvector(get_entity_coords(security_card.obj)) printnl() vector direction_rot_vec // security_card.rot = get_entity_rotation(security_card.obj) direction_rot_vec = normalise_vector(security_card_target_rot - security_card.rot) if are_vectors_alomost_equal(security_card.rot, security_card_target_rot, (direction_rot_vec * get_frame_time() * 1000.0))//0.2 250 security_card.rot = security_card_target_rot set_entity_rotation(security_card.obj, security_card.rot) printstring("security_card_target_rot = ") printvector(security_card_target_rot) printnl() printstring("test 2") printnl() else security_card.rot += (direction_rot_vec * get_frame_time() * 1000.0) set_entity_rotation(security_card.obj, security_card.rot) printstring("test 1") printnl() endif // // //// SHIFT_VECTOR_TO_IDEAL_VECTOR(security_card.rot, security_card_target_rot, 100) //// //// set_entity_rotation(security_card.obj, security_card.rot) // printstring("rot = ") printvector(get_entity_rotation(security_card.obj)) printnl() printstring("security_card.rot = ") printvector(security_card.rot) printnl() break case 2 break endswitch if not has_label_been_triggered("fbia5a_card3") if not is_entity_attached(security_card.obj) if get_entity_height_above_ground(security_card.obj) < 0.2 //KILL_FACE_TO_FACE_CONVERSATION_DO_NOT_FINISH_LAST_LINE() //ADD_NON_CRITICAL_STANDARD_CONVERSATION_TO_BUFFER(scripted_speech, "fbi5aAU", "fbia5a_card3", CONV_PRIORITY_MEDIUM) if create_conversation(scripted_speech, "fbi5aAU", "fbia5a_card3", CONV_PRIORITY_MEDIUM) set_label_as_triggered("fbia5a_card3", true) else kill_any_conversation() endif endif endif endif if not has_label_been_triggered("GET_SCARD") if has_label_been_triggered("fbia5a_card3") if not is_any_text_being_displayed(locates_data) print_now("GET_SCARD", default_god_text_time, 1) set_label_as_triggered("GET_SCARD", true) endif endif endif endif endproc proc scientist_1_ai_system() bool elevator_doors_open = elevator_0_system() if not is_ped_injured(scientist[1].ped) if scientist_1_ai_status != 3 if scientist_1_ai_status > 0 if is_ped_ragdoll(scientist[1].ped) scientist_1_ai_status = 3 endif endif endif switch scientist_1_ai_status case 0 if elevator_doors_open endif if has_anim_dict_loaded("missfbi5ig_10") and elevator_0_system_status > 1 //and (is_synchronized_scene_running(dave.scene_id) and get_syncrhonized_scene_anims()) scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> scientist[1].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[1].ped, scientist[1].scene_id, "missfbi5ig_10", "lift_holdup_labped", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_EXPAND_PED_CAPSULE_FROM_SKELETON) set_entity_proofs(scientist[1].ped, false, false, false, false, false) scientist_1_ai_status++ endif break case 1 if is_synchronized_scene_running(scientist[1].scene_id) if get_synchronized_scene_phase(scientist[1].scene_id) > 0.5 if CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbia5a_card2", CONV_PRIORITY_medium) scientist_1_ai_status++ endif endif endif break case 2 if not IS_ANY_CONVERSATION_ONGOING_OR_QUEUED() security_card_physics_system() endif if is_synchronized_scene_running(scientist[1].scene_id) if get_synchronized_scene_phase(scientist[1].scene_id) >= 1.0 scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> scientist[1].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[1].ped, scientist[1].scene_id, "missfbi5ig_10", "lift_holdup_loop_labped", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS) SET_SYNCHRONIZED_SCENE_LOOPED(scientist[1].scene_id, true) scientist_1_ai_status++ endif endif break case 3 security_card_physics_system() if not is_ped_ragdoll(scientist[1].ped) and not IS_PED_DEAD_OR_DYING(scientist[1].ped) if not is_synchronized_scene_running(scientist[1].scene_id) if not is_entity_playing_anim(scientist[1].ped, "ped", "handsup_base") if not is_entity_playing_anim(scientist[1].ped, "ped", "handsup") TASK_PLAY_ANIM(scientist[1].ped, "ped", "handsup", NORMAL_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING | AF_EXIT_AFTER_INTERRUPTED) else if GET_ENTITY_ANIM_CURRENT_TIME(scientist[1].ped, "ped", "handsup") >= 0.99 STOP_ANIM_TASK(scientist[1].ped, "ped", "handsup") TASK_PLAY_ANIM(scientist[1].ped, "ped", "handsup_base", instant_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING | AF_EXIT_AFTER_INTERRUPTED) endif endif endif scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> scientist[1].pos = get_anim_initial_offset_position("missfbi5ig_10", "lift_holdup_loop_labped", scene_pos, scene_rot, 1.0) if not is_entity_at_coord(scientist[1].ped, scientist[1].pos, <<0.75, 0.75, 1.6>>) if has_ped_task_finished_2(scientist[1].ped) task_look_at_entity(scientist[1].ped, player_ped_id(), -1, slf_while_not_in_fov) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, scientist[1].pos, pedmove_Walk) task_turn_ped_to_face_entity(null, player_ped_id()) close_sequence_task(seq) task_perform_sequence(scientist[1].ped, seq) clear_sequence_task(seq) endif else if not is_ped_facing_ped(scientist[1].ped, player_ped_id(), 50.00) //if has_ped_task_finished_2(scientist[1].ped, script_task_turn_ped_to_face_entity, -2, false) if has_ped_task_finished_2(scientist[1].ped) open_sequence_task(seq) task_turn_ped_to_face_entity(null, player_ped_id()) close_sequence_task(seq) task_perform_sequence(scientist[1].ped, seq) clear_sequence_task(seq) endif endif endif else SET_PED_CAPSULE(scientist[1].ped, 0.2) endif if has_label_been_triggered("GET_SCARD") if not is_any_text_being_displayed(locates_data) if not has_label_been_triggered("fbi5a_cower2") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_cower2", conv_priority_medium) set_label_as_triggered("fbi5a_cower2", true) endif endif endif endif endif break case 4 break endswitch if IS_PED_RAGDOLL(scientist[1].ped) if is_entity_playing_anim(scientist[1].ped, "ped", "handsup") STOP_ANIM_TASK(scientist[1].ped, "ped", "handsup") endif if is_entity_playing_anim(scientist[1].ped, "ped", "handsup_base") STOP_ANIM_TASK(scientist[1].ped, "ped", "handsup_base") endif endif else if scientist[1].created security_card_physics_system() //caches the scientist[1] / temp scientist pos untill the cutscene starts to find out if he is inside the lift. if does_entity_exist(temp_scientist) scientist[1].pos = get_entity_coords(temp_scientist, false) endif //can't set the scientist as no longer needed when dead untill securitycard has been picked up as //moving the card causes the scientist to vanish infront of the player if does_entity_exist(scientist[1].ped) if not does_entity_exist(security_card.obj) SET_PED_AS_NO_LONGER_NEEDED(scientist[1].ped) endif endif endif endif endproc func bool drop_patrol_security_guard_0_weapon() if not patrol_security_0_dropped_weapon if has_label_been_triggered("fbi5a_secur0") //if IS_ANY_CONVERSATION_ONGOING_OR_QUEUED() if IS_SCRIPTED_CONVERSATION_ONGOING() dialogue_root = GET_CURRENTLY_PLAYING_STANDARD_CONVERSATION_ROOT() //get currently playing will only return the root of a playing conversation BUT not a queued one, it will return NULL. Need to use dialogue_root = //dialogue_root = GET_LAST_PASSED_STANDARD_CONVERSATION_ROOT() if not ARE_STRINGS_EQUAL(dialogue_root, "fbi5a_secur0") //backup incase player hits ped before the drop weapon synced scene anim //patrol_security_0_dropped_weapon is also set in patrol_security_guard_0_synchronized_scene_system() if not is_synchronized_scene_running(patrol_security_guard[0].scene_id) set_ped_drops_weapon(patrol_security_guard[0].ped) patrol_security_0_dropped_weapon = true endif return true endif else if not is_any_text_being_displayed(locates_data) if not is_synchronized_scene_running(patrol_security_guard[0].scene_id) set_ped_drops_weapon(patrol_security_guard[0].ped) patrol_security_0_dropped_weapon = true endif return true endif endif endif endif return false endfunc proc patrol_security_guard_0_synchronized_scene_system() if is_synchronized_scene_running(patrol_security_guard[0].scene_id) switch patrol_security_guard_0_synchronized_scene_system_status case 0 if get_synchronized_scene_phase(patrol_security_guard[0].scene_id) >= 1.0 scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> patrol_security_guard[0].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(patrol_security_guard[0].ped, patrol_security_guard[0].scene_id, "missfbi5ig_5", "holdup_sec_loop_withgun_labped", instant_BLEND_IN, slow_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_ABORT_ON_WEAPON_DAMAGE, RBF_NONE, instant_BLEND_IN) set_synchronized_scene_looped(patrol_security_guard[0].scene_id, true) patrol_security_guard_0_synchronized_scene_system_status++ endif break case 1 if drop_patrol_security_guard_0_weapon() scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> patrol_security_guard[0].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(patrol_security_guard[0].ped, patrol_security_guard[0].scene_id, "missfbi5ig_5", "holdup_sec_drop_gun_labped", normal_BLEND_IN, slow_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_ABORT_ON_WEAPON_DAMAGE, RBF_NONE, normal_BLEND_IN) set_synchronized_scene_looped(patrol_security_guard[0].scene_id, true) patrol_security_guard_0_synchronized_scene_system_status++ endif break case 2 if has_anim_event_fired(patrol_security_guard[0].ped, get_hash_key("Detach")) set_ped_drops_weapon(patrol_security_guard[0].ped) patrol_security_0_dropped_weapon = true patrol_security_guard_0_synchronized_scene_system_status++ endif break case 3 if get_synchronized_scene_phase(patrol_security_guard[0].scene_id) >= 1.0 scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> patrol_security_guard[0].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(patrol_security_guard[0].ped, patrol_security_guard[0].scene_id, "missfbi5ig_5", "holdup_sec_loop_labped", normal_BLEND_IN, slow_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_ABORT_ON_WEAPON_DAMAGE, RBF_NONE, normal_BLEND_IN) set_synchronized_scene_looped(patrol_security_guard[0].scene_id, true) patrol_security_guard_0_synchronized_scene_system_status++ patrol_security_guard_0_system_status = 3 endif break case 4 break endswitch else //if ped attacked via melee - knife patrol_security_guard_0_system_status = 3 endif endproc proc patrol_security_guard_0_ai_system() if not is_ped_injured(patrol_security_guard[0].ped) switch patrol_security_guard_0_system_status case 0 request_anim_dict("missfbi5ig_5") if has_anim_dict_loaded("missfbi5ig_5") patrol_security_guard_0_time = get_game_timer() patrol_security_guard_0_system_status++ endif break case 1 if lk_timer(patrol_security_guard_0_time, 250)//1000 scene_pos = << 3538.970, 3673.487, 19.992 >> scene_rot = << 0.000, 0.000, -9.400 >> patrol_security_guard[0].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(patrol_security_guard[0].ped, patrol_security_guard[0].scene_id, "missfbi5ig_5", "holdup_sec_labped", normal_BLEND_IN, slow_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_ABORT_ON_WEAPON_DAMAGE, RBF_NONE, NORMAL_BLEND_IN) patrol_security_guard_0_system_status++ endif break case 2 //drop_patrol_security_guard_0_weapon() patrol_security_guard_0_synchronized_scene_system() if is_ped_ragdoll(patrol_security_guard[0].ped) or IS_PED_PERFORMING_MELEE_ACTION(patrol_security_guard[0].ped) set_ped_drops_weapon(patrol_security_guard[0].ped) patrol_security_guard_0_system_status = 3 endif if (get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(patrol_security_guard[0].ped)) < 2.0) //or (is_entity_in_angled_area and CAN_PED_SEE_HATED_PED))) if is_synchronized_scene_running(patrol_security_guard[0].scene_id) and get_synchronized_scene_phase(patrol_security_guard[0].scene_id) < 0.6 clear_ped_tasks(patrol_security_guard[0].PED) patrol_security_guard_0_system_status = 3 endif endif break case 3 if not is_ped_ragdoll(patrol_security_guard[0].ped) and not is_synchronized_scene_running(patrol_security_guard[0].scene_id) and not IS_PED_DEAD_OR_DYING(patrol_security_guard[0].ped) and not IS_PED_PERFORMING_MELEE_ACTION(patrol_security_guard[0].ped) if not is_entity_playing_anim(patrol_security_guard[0].ped, "missfbi5ig_5", "holdup_sec_loop_labped") if not is_entity_playing_anim(patrol_security_guard[0].ped, "ped", "handsup_base") if not is_entity_playing_anim(patrol_security_guard[0].ped, "ped", "handsup") TASK_PLAY_ANIM(patrol_security_guard[0].ped, "ped", "handsup", NORMAL_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING) else if GET_ENTITY_ANIM_CURRENT_TIME(patrol_security_guard[0].ped, "ped", "handsup") > 0.99 TASK_PLAY_ANIM(patrol_security_guard[0].ped, "ped", "handsup_base", instant_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING) endif endif endif else if get_entity_anim_current_time(patrol_security_guard[0].ped, "missfbi5ig_5", "holdup_sec_loop_labped") > 0.1 if is_entity_playing_anim(patrol_security_guard[0].ped, "ped", "handsup") STOP_ANIM_TASK(patrol_security_guard[0].ped, "ped", "handsup") endif if is_entity_playing_anim(patrol_security_guard[0].ped, "ped", "handsup_base") STOP_ANIM_TASK(patrol_security_guard[0].ped, "ped", "handsup_base") endif endif endif patrol_security_guard[0].pos = get_anim_initial_offset_position("missfbi5ig_5", "holdup_sec_loop_labped", <<3538.970, 3673.487, 20.00>>, <<0.000, 0.000, -9.400>>, 0.0) patrol_security_guard[0].rot = get_anim_initial_offset_rotation("missfbi5ig_5", "holdup_sec_loop_labped", <<3538.970, 3673.487, 20.00>>, <<0.000, 0.000, -9.400>>, 0.0) if not is_entity_at_coord(patrol_security_guard[0].ped, patrol_security_guard[0].pos, <<0.5, 0.5, 1.6>>) or not is_entity_playing_anim(patrol_security_guard[0].ped, "missfbi5ig_5", "holdup_sec_loop_labped") if has_ped_task_finished_2(patrol_security_guard[0].ped, script_task_perform_sequence, 1) // patrol_security_guard[0].pos = get_anim_initial_offset_position("missfbi5ig_5", "holdup_sec_loop_labped", <<3538.970, 3673.487, 19.92>>, <<0.000, 0.000, -9.400>>, 0.0) // patrol_security_guard[0].rot = get_anim_initial_offset_rotation("missfbi5ig_5", "holdup_sec_loop_labped", <<3538.970, 3673.487, 19.92>>, <<0.000, 0.000, -9.400>>, 0.0) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, patrol_security_guard[0].pos, pedmove_walk, default_time_before_warp, 0.05, ENAV_STOP_EXACTLY, patrol_security_guard[0].rot.z) TASK_PLAY_ANIM_advanced(null, "missfbi5ig_5", "holdup_sec_loop_labped", patrol_security_guard[0].pos, patrol_security_guard[0].rot, normal_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_LOOPING | AF_EXIT_AFTER_INTERRUPTED) close_sequence_task(seq) task_perform_sequence(patrol_security_guard[0].ped, seq) clear_sequence_task(seq) endif endif endif break case 4 break endswitch drop_patrol_security_guard_0_weapon() if not does_blip_exist(patrol_security_guard[0].blip) if (is_synchronized_scene_running(patrol_security_guard[0].scene_id) and get_synchronized_scene_phase(patrol_security_guard[0].scene_id) > 0.75) or (patrol_security_guard_0_system_status > 1 and not is_synchronized_scene_running(patrol_security_guard[0].scene_id)) patrol_security_guard[0].blip = create_blip_for_ped(patrol_security_guard[0].ped, true) endif endif if IS_PED_RAGDOLL(patrol_security_guard[0].ped) if is_entity_playing_anim(patrol_security_guard[0].ped, "ped", "handsup") STOP_ANIM_TASK(patrol_security_guard[0].ped, "ped", "handsup") endif if is_entity_playing_anim(patrol_security_guard[0].ped, "ped", "handsup_base") STOP_ANIM_TASK(patrol_security_guard[0].ped, "ped", "handsup_base") endif if is_entity_playing_anim(patrol_security_guard[0].ped, "missfbi5ig_5", "holdup_sec_loop_labped", anim_script) STOP_ANIM_TASK(patrol_security_guard[0].ped, "missfbi5ig_5", "holdup_sec_loop_labped") endif if is_entity_playing_anim(patrol_security_guard[0].ped, "missfbi5ig_5", "holdup_sec_loop_labped", ANIM_SYNCED_SCENE) STOP_SYNCHRONIZED_ENTITY_ANIM(patrol_security_guard[0].ped, NORMAL_BLEND_OUT, TRUE) endif endif endif endproc func bool get_to_lift_master_flow_system() switch get_to_lift_master_flow_system_status case 0 if is_ped_injured(scientist[0].ped) or is_entity_in_angled_area(player_ped_id(), <<3525.810, 3687.614, 19.995>>, <<3521.676, 3688.336, 23.000>>, 2.0) setup_enemy(patrol_security_guard[0]) STOP_PED_WEAPON_FIRING_WHEN_DROPPED(patrol_security_guard[0].ped) STOP_PED_SPEAKING(patrol_security_guard[0].ped, true) remove_blip(patrol_security_guard[0].blip) add_ped_for_dialogue(scripted_speech, 7, patrol_security_guard[0].ped, "security1") get_to_lift_master_flow_system_status++ endif break case 1 if is_ped_injured(scientist[0].ped) and is_ped_injured(patrol_security_guard[0].ped) outside_lift_blip = create_blip_for_coord(<<3539.6780, 3671.2178, 19.9944>>) get_to_lift_master_flow_system_status++ endif break case 2 request_anim_dict("missfbi1") if is_entity_in_angled_area(player_ped_id(), <<3540.059, 3673.385, 19.999>>, <<3539.403, 3669.642, 22.999>>, 12.0) setup_enemy(scientist[1]) clear_all_ped_props(scientist[1].ped) SET_RAGDOLL_BLOCKING_FLAGS(scientist[1].ped, RBF_BULLET_IMPACT | RBF_VEHICLE_IMPACT | RBF_FIRE | RBF_PLAYER_IMPACT | RBF_EXPLOSION)//allow ragdoll from taser remove_blip(scientist[1].blip) SET_PED_MONEY(scientist[1].ped, 0) set_entity_proofs(scientist[1].ped, false, true, true, false, false, false, false, true) SET_PED_COMPONENT_VARIATION(scientist[1].ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[1].ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[1].ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[1].ped, PED_COMP_TORSO, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[1].ped, PED_COMP_LEG, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[1].ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[1].ped, PED_COMP_FEET, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[1].ped, PED_COMP_TEETH, 0, 0) set_ped_component_variation(scientist[1].ped, ped_comp_special, 1, 0) SET_PED_COMPONENT_VARIATION(scientist[1].ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[1].ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[1].ped, PED_COMP_JBIB, 0, 0) add_ped_for_dialogue(scripted_speech, 6, scientist[1].ped, "scientist1") request_anim_dict("missfbi5ig_10") //hack for tracking scientist[1] ped when marked as no longer needed temp_scientist = scientist[1].ped security_card.obj = create_object(security_card.model, security_card.pos) ATTACH_ENTITY_TO_ENTITY(security_card.obj, scientist[1].ped, get_ped_bone_index(scientist[1].ped, BONETAG_PH_R_HAND), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 180.0>>, true) //<<0.12, 0.03, -0.03>>, <<100.00, 132.00, 50.00>> <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>> if does_blip_exist(outside_lift_blip) remove_blip(outside_lift_blip) endif if is_this_print_being_displayed("GET_LFT") clear_this_print("GET_LFT") endif //CLEAR_PRINTS() //print_now("WAIT_LIFT", default_god_text_time, 1) //set_label_as_triggered("WAIT_LIFT", true) dialogue_time = get_game_timer() get_to_lift_master_flow_system_status++ endif break case 3 if does_blip_exist(security_card.blip) if lk_timer(original_time, 2500) if is_entity_at_coord(player_ped_id(), get_entity_coords(security_card.obj), <<0.5, 0.5, 1.5>>) remove_blip(security_card.blip) delete_object(security_card.obj) PLAY_SOUND_FRONTEND(-1, "PICK_UP", "HUD_FRONTEND_DEFAULT_SOUNDSET") clear_prints() if not is_ped_injured(scientist[1].ped) print_now("TAZ_SCI", default_god_text_time, 1) endif get_to_lift_master_flow_system_status++ endif endif endif break case 4 if is_ped_injured(scientist[1].ped) REPLAY_RECORD_BACK_FOR_TIME(2) if is_this_print_being_displayed("TAZ_SCI") clear_this_print("TAZ_SCI") endif lift_blip = create_blip_for_coord(<<3540.5374, 3675.7593, 19.9944>>) get_to_lift_master_flow_system_status++ endif break case 5 if does_blip_exist(lift_blip) if is_entity_in_angled_area(player_ped_id(), <<3539.104004,3675.680908,19.686018>>, <<3542.164551,3675.201172,22.622726>>, 4.250000) remove_blip(lift_blip) endif else if not is_entity_in_angled_area(player_ped_id(), <<3539.104004,3675.680908,19.686018>>, <<3542.164551,3675.201172,22.622726>>, 4.750000) lift_blip = create_blip_for_coord(<<3540.5374, 3675.7593, 19.9944>>) endif endif if not does_entity_exist(dave_lift_cutscene_weapon) dave_lift_cutscene_weapon = GET_OBJECT_INDEX_FROM_ENTITY_INDEX(GET_CURRENT_PED_WEAPON_ENTITY_INDEX(dave.ped)) REQUEST_WEAPON_HIGH_DETAIL_MODEL(dave_lift_cutscene_weapon) endif if is_entity_in_angled_area(player_ped_id(), <<3539.104004,3675.680908,19.686018>>, <<3542.164551,3675.201172,22.622726>>, 4.250000) and is_entity_in_angled_area(dave.ped, <<3539.104004,3675.680908,19.686018>>, <<3542.164551,3675.201172,22.622726>>, 4.250000) and is_entity_in_angled_area(steve.ped, <<3539.104004,3675.680908,19.686018>>, <<3542.164551,3675.201172,22.622726>>, 4.250000) and ((is_synchronized_scene_running(dave.scene_id) and get_synchronized_scene_phase(dave.scene_id) > 0.32) or not is_synchronized_scene_running(dave.scene_id)) and ((is_synchronized_scene_running(steve.scene_id) and get_synchronized_scene_phase(steve.scene_id) > 0.32) or not is_synchronized_scene_running(steve.scene_id)) return true endif break endswitch return false endfunc proc metal_door_system() //bool door_lock_state //float door_open_ratio switch metal_door_system_status case 0 metal_door_system_status++ break case 1 if is_entity_in_angled_area(player_ped_id(), <<3531.971, 3708.092, 19.997>>, <<3519.421, 3710.035, 22.997>>, 2.5) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[0], DOORSTATE_force_unlocked_this_frame, false, true) metal_door_system_status++ endif break case 2 //if door_open_ratio > 0.5 if DOOR_SYSTEM_GET_OPEN_RATIO(fbi_5_door[0]) > 0.5 if move_door_with_new_door_system(fbi_5_door[0], true, 0.7) metal_door_system_status++ endif endif break endswitch endproc func bool has_player_fired_weapon() if allow_player_fired_weapon if not gun_fired if is_ped_shooting(player_ped_id()) weapon_type players_weapon if get_current_ped_weapon(player_ped_id(), players_weapon) if players_weapon != weapontype_stungun gun_fired = true return true endif endif endif else if not has_label_been_triggered("fbi5a_usegun") if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_usegun", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_usegun", true) endif endif endif return true endif endif return false endfunc proc gas_mask_audio_system() if not IS_PED_SWIMMING_UNDER_WATER(player_ped_id()) IF NOT IS_AUDIO_SCENE_ACTIVE("BIOTECH_HEIST_GASMASK_SCENE") START_AUDIO_SCENE("BIOTECH_HEIST_GASMASK_SCENE") ENDIF IF HAS_SOUND_FINISHED(i_sound_gas_mask) PLAY_SOUND_FROM_ENTITY(i_sound_gas_mask, "Gasmask", PLAYER_PED_ID(), "FBI_05_SOUNDS") ENDIF else IF IS_AUDIO_SCENE_ACTIVE("BIOTECH_HEIST_GASMASK_SCENE") stop_AUDIO_SCENE("BIOTECH_HEIST_GASMASK_SCENE") ENDIF IF not HAS_SOUND_FINISHED(i_sound_gas_mask) stop_sound(i_sound_gas_mask) ENDIF endif endproc proc load_get_to_lift_assets() interior_lab = GET_INTERIOR_AT_COORDS(v_pipe_end_pos) REQUEST_MODEL(scientist[0].model) REQUEST_MODEL(security_guard[0].model) request_model(security_card.model) request_model(elevator_display[0].model) request_model(elevator_display[1].model) request_model(elevator_display[2].model) request_model(get_weapontype_model(weapontype_carbinerifle)) request_weapon_asset(WEAPONTYPE_CARBINERIFLE) request_model(get_weapontype_model(WEAPONTYPE_STUNGUN)) request_weapon_asset(WEAPONTYPE_STUNGUN) prepare_alarm("FIB_05_BIOTECH_LAB_ALARMS") REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\LIFTS") request_anim_dict("missfbi5ig_2") REQUEST_ACTION_MODE_ASSET("MICHAEL_ACTION") request_action_mode_asset("MP_FEMALE_ACTION") SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_HEAD, 0, 0) SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_TORSO, 4, 0) SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_LEG, 4, 0) SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_FEET, 4, 0) SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_SPECIAL, 4, 0) SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_DECL, 0, 0) PIN_INTERIOR_IN_MEMORY(interior_lab) endproc func bool has_get_to_lift_assets_loaded() if not HAS_MODEL_LOADED(scientist[0].model) printstring("a") printnl() endif if not HAS_MODEL_LOADED(security_guard[0].model) printstring("b") printnl() endif if not has_model_loaded(security_card.model) printstring("c") printnl() endif if not has_model_loaded(elevator_display[0].model) printstring("d") printnl() endif if not has_model_loaded(elevator_display[1].model) printstring("e") printnl() endif if not has_model_loaded(elevator_display[2].model) printstring("f") printnl() endif if not has_weapon_asset_loaded(WEAPONTYPE_STUNGUN) printstring("g") printnl() endif if not has_weapon_asset_loaded(WEAPONTYPE_CARBINERIFLE) printstring("h") printnl() endif if not has_anim_dict_loaded("missfbi5ig_2") printstring("i") printnl() endif if not IS_INTERIOR_READY(interior_lab) printstring("j") printnl() endif if HAS_MODEL_LOADED(scientist[0].model) AND HAS_MODEL_LOADED(security_guard[0].model) and has_model_loaded(security_card.model) and has_model_loaded(elevator_display[0].model) and has_model_loaded(elevator_display[1].model) and has_model_loaded(elevator_display[2].model) and has_model_loaded(get_weapontype_model(weapontype_carbinerifle)) and has_weapon_asset_loaded(weapontype_carbinerifle) and has_model_loaded(get_weapontype_model(WEAPONTYPE_STUNGUN)) and has_weapon_asset_loaded(WEAPONTYPE_STUNGUN) and has_anim_dict_loaded("missfbi5ig_2") and HAS_ACTION_MODE_ASSET_LOADED("MICHAEL_ACTION") and HAS_ACTION_MODE_ASSET_LOADED("MP_FEMALE_ACTION") AND IS_INTERIOR_READY(interior_lab) and prepare_alarm("FIB_05_BIOTECH_LAB_ALARMS") and REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\LIFTS") return true endif return false endfunc proc create_get_to_lift_assets() DISABLE_CELLPHONE(false) CLEAR_TRIGGERED_LABELS() //FORCE_RETICLE_MODE(hud_reticle_can_be_stunned) SET_WANTED_LEVEL_MULTIPLIER(0.0) IF GET_IS_WAYPOINT_RECORDING_LOADED(str_waypoint_swim) REMOVE_WAYPOINT_RECORDING(str_waypoint_swim) ENDIF IF GET_IS_WAYPOINT_RECORDING_LOADED("fbi5_steve_swim_lab") REMOVE_WAYPOINT_RECORDING("fbi5_steve_swim_lab") ENDIF // SCRIPT_ASSERT("hit") clear_area(<<3526.2493, 3711.0015, 19.9928>>, 1000, true) REMOVE_DECALS_IN_RANGE(<<3526.2493, 3711.0015, 19.9928>>, 1000.00) setup_enemy(scientist[0], true) remove_blip(scientist[0].blip) //SET_RAGDOLL_BLOCKING_FLAGS(scientist[0].ped, RBF_VEHICLE_IMPACT | RBF_FIRE | RBF_PLAYER_IMPACT | RBF_EXPLOSION) SET_PED_MONEY(scientist[0].ped, 0) set_ped_component_variation(scientist[0].ped, ped_comp_special, 1, 0) add_ped_for_dialogue(scripted_speech, 5, scientist[0].ped, "scientist0") if does_entity_exist(dave_weapon_obj) delete_object(dave_weapon_obj) endif if does_entity_exist(steve_weapon_obj) delete_object(steve_weapon_obj) endif if is_screen_faded_in() end_cutscene_no_fade(false, true, false, 0, 0, 0, false) else end_cutscene(false, 0, 0, false) endif SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(2, "get to lift") original_time = get_game_timer() endproc proc FBI_5a_MCS_1_exit_state_controller() IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("steves_mask", steves_mask.model)) steves_mask.obj = GET_object_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("steves_mask", steves_mask.model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("scuba_mike", scuba_mike.model)) scuba_mike.obj = GET_object_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("scuba_mike", scuba_mike.model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("scuba_dave", scuba_dave.model)) scuba_dave.obj = GET_object_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("scuba_dave", scuba_dave.model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("OxyTank_1", OxyTank_1.model)) OxyTank_1.obj = GET_object_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("OxyTank_1", OxyTank_1.model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("OxyTank_2", OxyTank_2.model)) OxyTank_2.obj = GET_object_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("OxyTank_2", OxyTank_2.model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("OxyTank_3", OxyTank_3.model)) OxyTank_3.obj = GET_object_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("OxyTank_3", OxyTank_3.model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("scuba_steve", scuba_steve.model)) scuba_steve.obj = GET_object_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("scuba_steve", scuba_steve.model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("swag_bag", swag_bag.model)) swag_bag.obj = GET_object_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("swag_bag", swag_bag.model)) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("steves_mask", steves_mask.model) set_entity_coords_no_offset(steves_mask.obj, steves_mask.pos) set_entity_rotation(steves_mask.obj, steves_mask.rot) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("scuba_mike", scuba_mike.model) set_entity_coords_no_offset(scuba_mike.obj, scuba_mike.pos) set_entity_rotation(scuba_mike.obj, scuba_mike.rot) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("scuba_dave", scuba_dave.model) set_entity_coords_no_offset(scuba_dave.obj, scuba_dave.pos) set_entity_rotation(scuba_dave.obj, scuba_dave.rot) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("OxyTank_1", OxyTank_1.model) set_entity_coords_no_offset(OxyTank_1.obj, OxyTank_1.pos) set_entity_rotation(OxyTank_1.obj, OxyTank_1.rot) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("OxyTank_2", OxyTank_2.model) set_entity_coords_no_offset(OxyTank_2.obj, OxyTank_2.pos) set_entity_rotation(OxyTank_2.obj, OxyTank_2.rot) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("OxyTank_3", OxyTank_3.model) set_entity_coords_no_offset(OxyTank_3.obj, OxyTank_3.pos) set_entity_rotation(OxyTank_3.obj, OxyTank_3.rot) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("scuba_steve", scuba_steve.model) set_entity_coords_no_offset(scuba_steve.obj, scuba_steve.pos) set_entity_rotation(scuba_steve.obj, scuba_steve.rot) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("swag_bag", swag_bag.model) set_entity_coords_no_offset(swag_bag.obj, swag_bag.pos) set_entity_rotation(swag_bag.obj, swag_bag.rot) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("michael", GET_PLAYER_PED_MODEL(char_michael)) SET_ENTITY_COORDS(PLAYER_PED_ID(), <<3526.2493, 3711.0015, 19.9928>> ) SET_ENTITY_HEADING(PLAYER_PED_ID(), 172.3092) SET_PED_COMP_ITEM_CURRENT_SP(player_ped_id(), comp_type_outfit, OUTFIT_P0_SCUBA_LAND, false) SET_PED_PROP_INDEX(PLAYER_PED_ID(), ANCHOR_EYES, 2, 0) SET_PED_DIES_IN_WATER(PLAYER_PED_id(), true) SET_PED_MAX_TIME_UNDERWATER(PLAYER_PED_ID(), -1) SET_ENABLE_SCUBA(player_ped_id(), false) set_entity_proofs(player_ped_id(), false, false, false, false, false, false, false, true) GIVE_WEAPON_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_CARBINERIFLE, 400) //GIVE_WEAPON_COMPONENT_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) give_weapon_to_ped(PLAYER_PED_ID(), WEAPONTYPE_GRENADE, 2) GIVE_WEAPON_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_STUNGUN , 50, true) SET_PED_USING_ACTION_MODE(player_ped_id(), true) SET_PED_USING_ACTION_MODE(player_ped_id(), true, -1, "MP_FEMALE_ACTION") force_ped_motion_state(player_ped_id(), MS_ACTIONMODE_idle) force_ped_ai_and_animation_update(player_ped_id()) endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("dave_fbi", GET_npc_PED_MODEL(char_dave)) if not is_ped_injured(dave.ped) // set_entity_coords(dave.ped, dave.pos) // set_entity_heading(dave.ped, dave.heading) SET_PED_MAX_TIME_UNDERWATER(dave.ped, -1.0) SET_PED_DIES_IN_WATER(dave.ped, TRUE) set_current_ped_weapon(dave.ped, dave.weapon, true) set_entity_proofs(dave.ped, false, true, false, false, false, true, false, true) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_FEET, 2, 0) //comment out for pop issue SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_JBIB, 3, 0) SET_PED_PROP_INDEX(dave.ped, ANCHOR_EYES, 2, 0) SET_FORCE_FOOTSTEP_UPDATE(dave.ped, true) set_ped_config_flag(dave.ped, PCF_GetOutBurningVehicle, true) set_ped_can_ragdoll(dave.ped, false) dave_ai_system() endif endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("daves_Weapon") give_weapon_object_to_ped(dave_weapon_obj, dave.ped) endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("steve_fbi", GET_npc_PED_MODEL(char_steve)) if not is_ped_injured(steve.ped) steve.pos = <<3524.22, 3703.04, 19.9928>> steve.heading = -110.00 set_entity_coords(steve.ped, steve.pos) set_entity_heading(steve.ped, steve.heading) set_ped_can_ragdoll(steve.ped, false) SET_PED_MAX_TIME_UNDERWATER(steve.ped, -1.0) SET_PED_DIES_IN_WATER(steve.ped, TRUE) set_current_ped_weapon(steve.ped, steve.weapon, true) set_entity_proofs(steve.ped, false, true, false, false, false, true, false, true) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_FEET, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_JBIB, 0, 0) SET_PED_PROP_INDEX(steve.ped, ANCHOR_EYES, 2) SET_FORCE_FOOTSTEP_UPDATE(steve.ped, true) set_ped_can_ragdoll(steve.ped, false) set_ped_config_flag(steve.ped, PCF_GetOutBurningVehicle, true) set_entity_proofs(steve.ped, false, true, false, false, false, true, false, true) steve_ai_system() endif endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("steves_gun") give_weapon_object_to_ped(steve_weapon_obj, steve.ped) endif endproc proc get_out_of_water_mocap IF e_section_stage = SECTION_STAGE_SETUP SET_PED_RESET_FLAG(player_ped_id(), PRF_DisableTakeOffScubaGear, true) request_cutscene("FBI_5a_MCS_1") SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("michael", PLAYER_PED_ID()) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("dave", dave.ped) //SET_CUTSCENE_PED_COMPONENT_VARIATION("Dave_FBI", ped_comp_feet, 2, 0, cs_davenorton)//get_npc_ped_model(char_dave) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("steve", steve.ped) if has_cutscene_loaded() //int i trigger_music_event("FBI5A_ENTER_LAB_STOP_TRACK") if not is_ped_injured(dave.ped) register_entity_for_cutscene(dave.ped, "Dave_FBI", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, dave.model) endif if not is_ped_injured(steve.ped) register_entity_for_cutscene(steve.ped, "Steve_FBI", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, steve.model, CEO_RESET_CAPSULE_AT_END) endif //dave_weapon_obj = CREATE_WEAPON_OBJECT(WEAPONTYPE_CARBINERIFLE, infinite_ammo, <<3526.6, 3698.4, 21.0>>, true) dave_weapon_obj = CREATE_WEAPON_OBJECT_FROM_PED_WEAPON_WITH_COMPONENTS(dave.ped, WEAPONTYPE_CARBINERIFLE) register_entity_for_cutscene(dave_weapon_obj, "daves_Weapon", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) //steve_weapon_obj = CREATE_WEAPON_OBJECT(WEAPONTYPE_CARBINERIFLE, infinite_ammo, <<3526.6, 3698.4, 22.0>>, true) steve_weapon_obj = CREATE_WEAPON_OBJECT_FROM_PED_WEAPON_WITH_COMPONENTS(steve.ped, WEAPONTYPE_CARBINERIFLE) register_entity_for_cutscene(steve_weapon_obj, "steves_gun", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) register_entity_for_cutscene(null, "steves_mask", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, steves_mask.model) register_entity_for_cutscene(null, "scuba_mike", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, scuba_mike.model) register_entity_for_cutscene(null, "scuba_dave", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, scuba_dave.model) register_entity_for_cutscene(null, "OxyTank_1", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, OxyTank_1.model) register_entity_for_cutscene(null, "OxyTank_2", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, OxyTank_2.model) register_entity_for_cutscene(null, "oxytank_3", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, OxyTank_3.model) register_entity_for_cutscene(null, "scuba_steve", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, scuba_steve.model) register_entity_for_cutscene(null, "swag_bag", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, swag_bag.model) remove_anim_dict("mini@biotech@blowtorch_str") remove_anim_dict("mini@biotech@blowtorch_def") remove_anim_dict("SWIMMING@swim") remove_anim_dict("swimming@scuba") remove_anim_dict("missheistchem2") SET_SCRIPTS_SAFE_FOR_CUTSCENE(true) REPLAY_RECORD_BACK_FOR_TIME(5.0, 0.0, REPLAY_IMPORTANCE_HIGH) REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) start_cutscene() load_get_to_lift_assets() e_section_stage = SECTION_STAGE_RUNNING endif endif IF e_section_stage = SECTION_STAGE_RUNNING has_get_to_lift_assets_loaded() switch get_out_of_water_mocap_status case 0 if is_cutscene_playing() clear_area(get_entity_coords(player_ped_id()), 100.00, true) int i for i = 0 to count_of(flare) - 1 if does_entity_exist(flare[i].obj) if does_particle_fx_looped_exist(flare_ptfx[i]) STOP_PARTICLE_FX_LOOPED(flare_ptfx[i]) endif delete_object(flare[i].obj) set_model_as_no_longer_needed(flare[i].model) endif endfor if not has_sound_finished(flare_sound) stop_sound(flare_sound) endif get_out_of_water_mocap_status++ endif break case 1 if is_cutscene_active() if not WAS_CUTSCENE_SKIPPED() FBI_5a_MCS_1_exit_state_controller() else SET_CUTSCENE_FADE_VALUES(false, false, true) e_section_stage = SECTION_STAGE_CLEANUP endif else if has_get_to_lift_assets_loaded() create_get_to_lift_assets() REPLAY_STOP_EVENT() e_section_stage = SECTION_STAGE_setup e_mission_stage = STAGE_GET_TO_LIFT else do_screen_fade_out(500) while not is_screen_faded_out() or not has_get_to_lift_assets_loaded() wait(0) endwhile create_get_to_lift_assets() e_section_stage = SECTION_STAGE_setup e_mission_stage = STAGE_GET_TO_LIFT endif endif break endswitch endif IF e_section_stage = SECTION_STAGE_CLEANUP if is_cutscene_active() FBI_5a_MCS_1_exit_state_controller() else if not is_ped_injured(steve.ped) steve.pos = <<3524.19, 3702.99, 19.9928>> steve.heading = -110.00 clear_ped_tasks_immediately(steve.ped) set_entity_coords(steve.ped, steve.pos) set_entity_heading(steve.ped, steve.heading) steve_ai_system_status = 0 steve_ai_system() endif REPLAY_STOP_EVENT() create_get_to_lift_assets() e_section_stage = SECTION_STAGE_setup e_mission_stage = STAGE_GET_TO_LIFT endif endif IF e_section_stage = SECTION_STAGE_SKIP get_out_of_water_mocap_status = 1 if is_cutscene_active() STOP_CUTSCENE() endif endif endproc proc disable_friendly_fire_audio() SET_PED_RESET_FLAG(dave.ped, PRF_DisableFriendlyGunReactAudio, true) //SET_PED_RESET_FLAG(dave.ped, PRF_DisableCoverAudio, true) SET_PED_RESET_FLAG(steve.ped, PRF_DisableFriendlyGunReactAudio, true) //SET_PED_RESET_FLAG(steve.ped, PRF_DisableCoverAudio, true) endproc //PURPOSE: Mission stage dealing with getting out the water to the lif leading to the upper levels PROC GET_TO_LIFT() disable_friendly_fire_audio() REPLAY_DISABLE_CAMERA_MOVEMENT_THIS_FRAME() //Fix for bug 2217405 IF e_section_stage = SECTION_STAGE_SETUP set_max_wanted_level(0) set_create_random_cops(false) trigger_music_event("FBI5A_ENTER_LAB_STEALTH_ST") start_audio_scene("FBI_5_GET_TO_LIFT") e_section_stage = section_stage_running endif IF e_section_stage = SECTION_STAGE_RUNNING if get_to_lift_master_flow_system() e_section_stage = SECTION_STAGE_CLEANUP endif has_player_fired_weapon() get_to_lift_dialogue_system() metal_door_system() dave_ai_system() steve_ai_system() scientist_0_ai_system() scientist_1_ai_system() check_for_scientists_being_stunned() ped_structure_are_all_enemies_dead(scientist, false) patrol_security_guard_0_ai_system() check_for_patrol_security_guards_being_stunned() ped_structure_are_all_enemies_dead(patrol_security_guard) gas_mask_audio_system() force_pool_room_for_player_system() ENDIF IF e_section_stage = SECTION_STAGE_CLEANUP delete_all_scuba_gear() REMOVE_ALL_BLIPS() e_mission_stage = STAGE_LIFT_CUTSCENE // STAGE_LOAD_CONTAINER e_section_stage = SECTION_STAGE_SETUP ENDIF IF e_section_stage = SECTION_STAGE_SKIP IF DOES_BLIP_EXIST(lift_blip) REMOVE_BLIP(lift_blip) ENDIF CLEAR_PED_TASKS_IMMEDIATELY(PLAYER_PED_ID()) SET_ENTITY_COORDS(PLAYER_PED_ID(), << 3541.5522, 3671.9285, 27.1223 >>) SET_ENTITY_HEADING(PLAYER_PED_ID(), 89.0802) IF NOT IS_ENTITY_DEAD(dave.ped) CLEAR_PED_TASKS_IMMEDIATELY(dave.ped) SET_ENTITY_COORDS(dave.ped, << 3541.2070, 3670.7104, 27.1223 >>) SET_ENTITY_HEADING(dave.ped, 80.1433) ENDIF IF NOT IS_ENTITY_DEAD(steve.ped) CLEAR_PED_TASKS_IMMEDIATELY(steve.ped) SET_ENTITY_COORDS(steve.ped, << 3539.6199, 3670.6697, 27.1223 >>) SET_ENTITY_HEADING(steve.ped, 89.2698) ENDIF IF DOES_ENTITY_EXIST(scientist[0].ped) DELETE_PED(scientist[0].ped) ENDIF IF DOES_ENTITY_EXIST(scientist[1].ped) DELETE_PED(scientist[1].ped) ENDIF e_section_stage = SECTION_STAGE_CLEANUP ENDIF ENDPROC proc request_find_chemicals_assets() request_model(clip_board.model) request_model(pencil.model) REQUEST_MODEL(chemicals.model) request_model(nerve_agent.model) request_model(security_card.model) REQUEST_MODEL(crate.model) request_model(fridge_pallet.model) REQUEST_MODEL(fridge.model) REQUEST_COLLISION_FOR_MODEL(fridge.model) request_model(container_light.model) request_model(PROP_BOXPILE_02B) request_anim_dict("missfbi5ig_15") request_vehicle_recording(army_truck[0].recording_number, "lkfbi5a") request_vehicle_recording(army_truck[1].recording_number, "lkfbi5a") request_vehicle_recording(army_truck[2].recording_number, "lkfbi5a") REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05_GRAB_TOXIN") request_waypoint_recording("fbi5_dave_1") prepare_music_event("FBI5A_LIFT_EXIT") endproc //PURPOSE: Cutscene showing the player and crew in the lift PROC LIFT_CUTSCENE() REPLAY_DISABLE_CAMERA_MOVEMENT_THIS_FRAME() //Fix for bug 2217405 if e_section_stage != SECTION_STAGE_SETUP //added to stop third person camera rendering for a frame 2056605. Speak to camera guys about update order DISABLE_ON_FOOT_FIRST_PERSON_VIEW_THIS_UPDATE() //bug 2035340 endif IF e_section_stage = SECTION_STAGE_SETUP int i set_model_as_no_longer_needed(security_card.model) for i = 0 to count_of(elevator_display) - 1 if does_entity_exist(elevator_display[i].obj) delete_object(elevator_display[i].obj) endif set_model_as_no_longer_needed(elevator_display[i].model) endfor remove_anim_dict("missfbi5ig_2") remove_anim_dict("missfbi5ig_5") remove_anim_dict("missfbi5ig_8") remove_anim_dict("missfbi5ig_10") remove_anim_dict("missfbi5ig_11") request_anim_dict("missfbi5ig_12") if has_anim_dict_loaded("missfbi5ig_12") if start_new_cutscene_no_fade(false, false) if is_audio_scene_active("FBI_5_GET_TO_LIFT") STOP_AUDIO_SCENE("FBI_5_GET_TO_LIFT") endif start_audio_scene("FBI_5_LIFT_SCENE") request_find_chemicals_assets() clear_area(<<3540.8340, 3676.7585, 27.1233>>, 1000, true) REMOVE_DECALS_IN_RANGE(<<3540.8340, 3676.7585, 27.1233>>, 1000.00) if is_point_in_angled_area(scientist[1].pos, <<3542.130, 3675.186, 19.0>>, <<3539.177, 3675.717, 22.597>>, 4.0) setup_enemy(scientist[6]) clear_all_ped_props(scientist[6].ped) DISABLE_PED_PAIN_AUDIO(scientist[6].ped, true) DISABLE_PED_INJURED_ON_GROUND_BEHAVIOUR(scientist[6].ped) remove_blip(scientist[6].blip) SET_PED_MONEY(scientist[6].ped, 0) SET_PED_COMPONENT_VARIATION(scientist[6].ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[6].ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[6].ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[6].ped, PED_COMP_TORSO, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[6].ped, PED_COMP_LEG, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[6].ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[6].ped, PED_COMP_FEET, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[6].ped, PED_COMP_TEETH, 0, 0) set_ped_component_variation(scientist[6].ped, ped_comp_special, 1, 0) SET_PED_COMPONENT_VARIATION(scientist[6].ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[6].ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(scientist[6].ped, PED_COMP_JBIB, 0, 0) scene_pos = <<3540.980, 3676.299, 28.2>> scene_rot = <<0.000, 0.000, 62.000>> // scientist[6].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) // TASK_SYNCHRONIZED_SCENE(scientist[6].ped, scientist[6].scene_id, "missfbi5ig_12", "dead_c", INSTANT_BLEND_IN, normal_blend_out, synced_scene_use_physics) // force_ped_ai_and_animation_update(scientist[6].ped) // set_entity_health(scientist[6].ped, 2) task_play_anim_advanced(scientist[6].ped, "missfbi5ig_12", "dead_c", scene_pos, scene_rot, INSTANT_BLEND_IN, normal_BLEND_OUT, -1, AF_ENDS_IN_DEAD_POSE | AF_OVERRIDE_PHYSICS | af_extract_initial_offset | AF_NOT_INTERRUPTABLE, 0.99) force_ped_ai_and_animation_update(scientist[6].ped) //set_ped_as_no_longer_needed(scientist[6].ped) //remove_anim_dict("missfbi1") endif clear_ped_tasks_immediately(player_ped_id()) SET_ENTITY_COORDS(PLAYER_PED_ID(), <<3540.78, 3675.01, 27.1233>>) SET_ENTITY_HEADING(PLAYER_PED_ID(), 169.2532) SET_PED_USING_ACTION_MODE(PLAYER_PED_ID(), TRUE) // 2146534 force_ped_motion_state(player_ped_id(), MS_ACTIONMODE_idle) force_ped_ai_and_animation_update(player_ped_id()) IF NOT IS_ENTITY_DEAD(dave.ped) clear_ped_tasks_immediately(dave.ped) //set_current_ped_weapon(dave.ped, WEAPONTYPE_CARBINERIFLE, true) scene_pos = <<3538.663, 3673.165, 27.126>> scene_rot = <<0.000, 0.000, 80.400>> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_12", "inlift_loop_dave", INSTANT_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT | SYNCED_SCENE_PROCESS_ATTACHMENTS_ON_START, rbf_none, instant_blend_in, AIK_DISABLE_TORSO_IK) set_synchronized_scene_looped(dave.scene_id, true) force_ped_ai_and_animation_update(dave.ped) PROCESS_ENTITY_ATTACHMENTS(dave.ped) if does_entity_exist(dave_lift_cutscene_weapon) //FORCE_ROOM_FOR_ENTITY(dave_lift_cutscene_weapon, GET_INTERIOR_AT_COORDS_with_type(<<3540.8066, 3675.7822, 27.5211>>, "v_lab"), get_hash_key("lab_waste_elev")) endif ENDIF IF NOT IS_ENTITY_DEAD(steve.ped) CLEAR_PED_TASKS_IMMEDIATELY(steve.ped) scene_pos = <<3538.663, 3673.165, 27.126>> scene_rot = <<0.000, 0.000, 80.400>> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_12", "inlift_loop_steve", INSTANT_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT) //SET_SYNCHRONIZED_SCENE_RATE(steve.scene_id, 0.0) set_synchronized_scene_looped(steve.scene_id, true) force_ped_ai_and_animation_update(steve.ped) //REMOVE_WEAPON_COMPONENT_FROM_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) ENDIF cam_cutscene = CREATE_CAM_WITH_PARAMS("DEFAULT_SCRIPTED_CAMERA", <<3539.484131,3674.813477,28.547911>>, <<0.216973,-0.128160,-107.866089>>, 32.132156, TRUE) SET_CAM_PARAMS(cam_cutscene, <<3539.611328,3675.167480,28.547104>>,<<0.216973,-0.128160,-116.007423>>, 32.132156, 2500, GRAPH_TYPE_LINEAR, GRAPH_TYPE_LINEAR) shake_cam(cam_cutscene, "hand_shake", 0.2) RENDER_SCRIPT_CAMS(TRUE, FALSE) WAIT(0) DISABLE_ON_FOOT_FIRST_PERSON_VIEW_THIS_UPDATE() SET_ROOM_FOR_GAME_VIEWPORT_BY_NAME("Lab_waste_elev") SETTIMERA(0) stop_sound(lift_sound) play_sound_from_entity(lift_sound, "LIFT_POSH_MOVE", player_ped_id()) ADD_NON_CRITICAL_STANDARD_CONVERSATION_TO_BUFFER(scripted_speech, "fbi5aAU", "fbi5a_elcut0", CONV_PRIORITY_MEDIUM) REPLAY_RECORD_BACK_FOR_TIME(5.0, 0.0, REPLAY_IMPORTANCE_HIGHEST) REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) e_section_stage = SECTION_STAGE_RUNNING endif endif ENDIF IF e_section_stage = SECTION_STAGE_RUNNING switch lift_cutscene_status case 0 if not is_cam_interpolating(cam_cutscene) destroy_cam(cam_cutscene) cam_cutscene = CREATE_CAM_WITH_PARAMS("DEFAULT_SCRIPTED_CAMERA",<<3540.598877,3675.687500,28.729021>>,<<-10.441384,-0.128160,178.590073>>, 49.967346, TRUE) SET_CAM_PARAMS(cam_cutscene, <<3540.729736,3676.014404,28.789108>>,<<-10.441384,-0.128160,170.638580>>,49.967346, 2000, GRAPH_TYPE_LINEAR, GRAPH_TYPE_LINEAR) shake_cam(cam_cutscene, "hand_shake", 0.2) original_time = get_game_timer() lift_cutscene_status++ endif break case 1 if lk_timer(original_time, 500) stop_sound(lift_sound) lift_cutscene_status++ endif break case 2 //if not is_cam_interpolating(cam_cutscene) if not is_any_text_being_displayed(locates_data) e_section_stage = SECTION_STAGE_CLEANUP endif break endswitch IF IS_CUTSCENE_SKIP_BUTTON_JUST_PRESSED_WITH_DELAY() //IF TIMERA() > 1000 e_section_stage = SECTION_STAGE_SKIP //ENDIF ENDIF ENDIF IF e_section_stage = SECTION_STAGE_CLEANUP REPLAY_STOP_EVENT() if does_entity_exist(dave_lift_cutscene_weapon) REMOVE_OBJECT_HIGH_DETAIL_MODEL(dave_lift_cutscene_weapon) endif if is_screen_faded_in() end_cutscene_no_fade(false, false, false, 0, 0, 3000, false) STOP_RENDERING_SCRIPT_CAMS_USING_CATCH_UP() else end_cutscene(false, 0, 0, false) endif e_section_stage = SECTION_STAGE_SETUP e_mission_stage = STAGE_FIND_CHEMICALS //script_assert("test 0") ENDIF IF e_section_stage = SECTION_STAGE_SKIP REPLAY_CANCEL_EVENT() DO_SAFE_FADE_OUT() stop_sound(lift_sound) e_section_stage = SECTION_STAGE_CLEANUP ENDIF ENDPROC proc elevator_1_system() switch elevator_1_system_status case 0 play_sound_from_coord(lift_sound, "LIFTS_TONE", <<3538.8, 3673.7, 27.1>>) elevator_1_system_status++ break case 1 if has_sound_finished(lift_sound) play_sound_from_coord(lift_sound, "LIFT_POSH_DOOR_OPEN", <<3538.8, 3673.7, 27.1>>) //move_doors(V_ILev_BL_DoorEL_L, <<3538.8, 3673.7, 27.1>>, V_ILev_BL_DoorEL_R, <<3541.7, 3673.2, 27.1>>) move_doors_with_new_door_system(fbi_5_door[3], fbi_5_door[4]) if is_audio_scene_active("FBI_5_LIFT_SCENE") STOP_AUDIO_SCENE("FBI_5_LIFT_SCENE") endif start_audio_scene("FBI_5_GET_TO_NERVE_TOXIN") elevator_1_system_status++ endif break case 2 //if move_doors(V_ILev_BL_DoorEL_L, <<3538.8, 3673.7, 27.1>>, V_ILev_BL_DoorEL_R, <<3541.7, 3673.2, 27.1>>) if move_doors_with_new_door_system(fbi_5_door[3], fbi_5_door[4]) stop_sound(lift_sound) release_named_script_audio_bank("SCRIPT\\LIFTS") elevator_1_system_status++ endif break case 3 break endswitch endproc proc steve_ai_system_1() switch steve_ai_system_1_status case 0 steve_cover_point_stolen = false steve.run_to_pos = <<3533.59, 3671.10, 27.12>> //cover_point[6] if DOES_OBJECT_OF_TYPE_EXIST_AT_COORDS(<<3538.8, 3673.7, 27.1>>, 1.0, V_ILev_BL_DoorEL_L, true) and DOES_OBJECT_OF_TYPE_EXIST_AT_COORDS(<<3541.7, 3673.2, 27.1>>, 1.0, V_ILev_BL_DoorEL_R, true) float left_door_ratio float right_door_ratio bool left_lock_state bool right_lock_state GET_STATE_OF_CLOSEST_DOOR_OF_TYPE(V_ILev_BL_DoorEL_L, <<3538.8, 3673.7, 27.1>>, left_lock_state, left_door_ratio) GET_STATE_OF_CLOSEST_DOOR_OF_TYPE(V_ILev_BL_DoorEL_R, <<3541.7, 3673.2, 27.1>>, right_lock_state, right_door_ratio) if left_door_ratio < -0.6 and right_door_ratio > 0.6 scene_pos = <<3538.663, 3673.165, 27.126>> scene_rot = <<0.000, 0.000, 80.400>> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_12", "moveto_hall_cover_steve", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT) //SET_SYNCHRONIZED_SCENE_RATE(steve.scene_id, 1.0) steve_ai_system_1_status++ endif endif break case 1 TRANSITION_FROM_MOCAP_TO_COVER(steve.ped, steve.scene_id, steve_time, steve.run_to_pos, 1, 0, false, false, cover_point[6]) //cover_point[6] if IS_PLAYER_STEALING_PEDS_DESTINATION(steve.ped, steve.run_to_pos, 2.0, false) or steve_cover_point_stolen steve_cover_point_stolen = true IF IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(steve.ped, NORMAL_BLEND_OUT, TRUE) steve.scene_id = -1 endif if not is_entity_at_coord(steve.ped, <<3531.9678, 3673.7690, 27.1211>>, <<0.5, 0.5, 2.0>>) if has_ped_task_finished_2(steve.ped, script_task_perform_sequence, 1) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3531.9678, 3673.7690, 27.1211>>, <<3530.1, 3662.7, 28.6>>, pedmove_walk, false, 0.2, 0.2, true, ENAV_STOP_EXACTLY) task_aim_gun_at_coord(null, <<3530.1, 3662.7, 28.6>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif // else // // IF not IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) // PUT_PED_INTO_COVER_FOR_MOCAP(steve_decision, steve.ped, steve_time, steve.run_to_pos, cover_point[6], <<3529.9, 3662.6, 28.7>>) // endif endif request_anim_dict("missfbi5ig_14") if is_entity_in_angled_area(player_ped_id(), <<3532.819, 3667.771, 27.129>>, <<3529.369, 3668.370, 29.927>>, 2.0) steve_ai_system_1_status++ endif break case 2 request_anim_dict("missfbi5ig_14") IF IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) //saftey incase player runs ahead quickly TRANSITION_FROM_MOCAP_TO_COVER(steve.ped, steve.scene_id, steve_time, steve.run_to_pos, 1, 0, false, false, cover_point[6]) //no need to check above ai as the player won't be stealing the cover point if he has hit the area check. else if PUT_PED_INTO_COVER_FOR_MOCAP(steve_decision, steve.ped, steve_time, steve.run_to_pos, cover_point[6], <<3529.9, 3662.6, 28.7>>) AND HAS_ANIM_DICT_LOADED("missfbi5ig_14") SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(steve.ped, TRUE) steve_refresh_task = false steve_cover_point_stolen = false steve.run_to_pos = <<3528.18269, 3660.25269, 27.12186>> //cover_point[8] steve_time = 0 switch steve_decision case play_synched_scene scene_pos = << 3533.920, 3662.750, 28.118 >> scene_rot = << 0.000, 0.000, 169.920 >> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_14", "run_down_hallway_steve", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) break case use_ai open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, steve.run_to_pos, pedmove_run, -1, 1.0) //task_seek_cover_to_cover_point(null, cover_point[8], <<3535.8, 3646.9, 28.4>>, -1) task_put_ped_directly_into_cover(null, steve.run_to_pos, -1, false, normal_blend_in, false, true, cover_point[8], true) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) break endswitch steve_ai_system_1_status++ ENDIF ENDIF break case 3 TRANSITION_FROM_MOCAP_TO_COVER(steve.ped, steve.scene_id, steve_time, steve.run_to_pos, 1.0, normal_blend_in, true, true, cover_point[8]) if IS_PLAYER_STEALING_PEDS_DESTINATION(steve.ped, steve.run_to_pos, 2.0) or steve_cover_point_stolen steve_cover_point_stolen = true IF IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(steve.ped, NORMAL_BLEND_OUT, TRUE) steve.scene_id = -1 endif if not is_entity_at_coord(steve.ped, <<3528.6558, 3661.3770, 27.1219>>, <<0.5, 0.5, 2.0>>) if has_ped_task_finished_2(steve.ped, script_task_perform_sequence, 1) or steve_refresh_task open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3528.6558, 3661.3770, 27.1219>>, <<3532.4, 3664.6, 28.9>>, pedmove_walk, false, 0.2, 0.2, true, ENAV_STOP_EXACTLY) task_aim_gun_at_coord(null, <<3532.4, 3664.6, 28.9>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_refresh_task = false endif endif endif request_anim_dict("missfbi5ig_18_p1") if is_ped_injured(scientist[2].ped) and is_ped_injured(scientist[3].ped) if not is_entity_in_angled_area(player_ped_id(), <<3537.933, 3674.032, 27.127>>, <<3535.935, 3662.807, 30.227>>, 15.800) //and not is_ped_in_specific_room(player_ped_id(), <<3535.4087, 3664.4260, 27.1217>>, "lab_lab1") steve_ai_system_1_status++ endif endif break case 4 if not has_label_been_triggered("fbi5a_dia37")//fbi5a_dia19 if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia37", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia37", true) endif endif endif IF IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) TRANSITION_FROM_MOCAP_TO_COVER(steve.ped, steve.scene_id, steve_time, steve.run_to_pos) else if PUT_PED_INTO_COVER_FOR_MOCAP(steve_decision, steve.ped, steve_time, steve.run_to_pos, cover_point[8], <<3535.8, 3646.9, 28.4>>) and has_anim_dict_loaded("missfbi5ig_18_p1") set_label_as_triggered("fbi5a_dia37", false) //reset dialogue as this line is used many times steve_cover_point_stolen = false switch steve_decision case play_synched_scene steve.run_to_pos = get_anim_initial_offset_position("missfbi5ig_18_p1", "through_hallway_steve", scene_pos, scene_rot, 1.0) scene_pos = << 3533.916, 3645.635, 26.527 >> scene_rot = << 0.000, 0.000, 169.920 >> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_18_p1", "through_hallway_steve", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) steve_ai_system_1_status = 5 break //if player steals cover point have steve them just run to the very end and not to the end of //continue_down_to_hallway_steve and not through_hallway_steve anim case use_ai request_anim_dict("missfbi5ig_18_p2") if has_anim_dict_loaded("missfbi5ig_18_p2") steve.run_to_pos = get_anim_initial_offset_position("missfbi5ig_18_p2", "continue_down_to_hallway_steve", scene_pos, scene_rot, 1.0) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, steve.run_to_pos, <<3540.4, 3645.6, 28.7>>, pedmove_run, false, 0.5, 0.5) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_ai_system_1_status = 6 //run straight to the nex stage endif break endswitch endif endif break case 5 request_anim_dict("missfbi5ig_18_p2") if IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) if GET_SYNCHRONIZED_SCENE_PHASE(steve.scene_id) >= 1.0 and has_anim_dict_loaded("missfbi5ig_18_p2") scene_pos = << 3533.916, 3645.635, 26.527 >> scene_rot = << 0.000, 0.000, 169.920 >> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_18_p2", "continue_down_to_hallway_steve", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) steve.run_to_pos = get_anim_initial_offset_position("missfbi5ig_18_p2", "continue_down_to_hallway_steve", scene_pos, scene_rot, 1.0) steve_ai_system_1_status = 6 endif endif if IS_PLAYER_STEALING_PEDS_DESTINATION(steve.ped, steve.run_to_pos, 2.0) IF IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(steve.ped, NORMAL_BLEND_OUT, TRUE) steve.scene_id = -1 endif steve.run_to_pos = get_anim_initial_offset_position("missfbi5ig_18_p2", "continue_down_to_hallway_steve", scene_pos, scene_rot, 1.0) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, steve.run_to_pos, <<3540.4, 3645.6, 28.7>>, pedmove_run, false, 0.5, 0.5) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_ai_system_1_status = 6 endif break case 6 TRANSITION_FROM_MOCAP_TO_AIM(steve.ped, steve.scene_id, steve.run_to_pos, <<3540.4, 3645.6, 28.7>>, null) if does_entity_exist(patrol_security_guard[1].ped) if not is_ped_injured(patrol_security_guard[1].ped) if is_entity_in_angled_area(patrol_security_guard[1].ped, <<3545.832, 3643.640, 27.128>>, <<3546.306, 3646.501, 30.128>>, 1.5) steve_ai_system_1_status++ endif else steve_ai_system_1_status++ endif endif //set_ped_reset_flag(steve.ped, PRF_DisableWeaponLaserSight, true) break case 7 request_anim_dict("missfbi5ig_20a") //TRANSITION_FROM_MOCAP_TO_AIM(steve.ped, steve.scene_id, <<3545.8169, 3641.2805, 27.1217>>, <<3540.4, 3645.6, 28.7>>, null) // if does_entity_exist(patrol_security_guard[1].ped) // if not is_ped_injured(patrol_security_guard[1].ped) // if is_entity_in_angled_area(patrol_security_guard[1].ped, <<3545.832, 3643.640, 27.128>>, <<3546.306, 3646.501, 30.128>>, 1.5) // script_assert("steve test 1") // steve_ai_system_1_status++ // endif // endif // endif //put steve into combat if patrol security are in combat if patrol_security_guard_1_ai_system_status > 2 or patrol_security_guard_2_ai_system_status > 2 if is_ped_injured(patrol_security_guard[1].ped) if not is_ped_injured(patrol_security_guard[2].ped) if not is_entity_in_angled_area(patrol_security_guard[2].ped, <<3545.086, 3646.993, 27.122>>, <<3544.545, 3643.939, 30.122>>, 1.200) if has_ped_task_finished_2(steve.ped, script_task_shoot_at_entity) open_sequence_task(seq) task_shoot_at_entity(null, patrol_security_guard[2].ped, 3000, FIRING_TYPE_1_BURST) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif endif elif is_ped_injured(patrol_security_guard[2].ped) if not is_ped_injured(patrol_security_guard[1].ped) if not is_entity_in_angled_area(patrol_security_guard[1].ped, <<3545.086, 3646.993, 27.122>>, <<3544.545, 3643.939, 30.122>>, 1.200) if has_ped_task_finished_2(steve.ped, script_task_shoot_at_entity) open_sequence_task(seq) task_shoot_at_entity(null, patrol_security_guard[1].ped, 3000, FIRING_TYPE_1_BURST) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif endif //forces steve to kill guard 1 then it should then go back to top of code and kill guard 2 //might not need guard 2 check bellow. elif not is_ped_injured(patrol_security_guard[1].ped) if not is_entity_in_angled_area(patrol_security_guard[1].ped, <<3545.086, 3646.993, 27.122>>, <<3544.545, 3643.939, 30.122>>, 1.200) if has_ped_task_finished_2(steve.ped, script_task_shoot_at_entity) open_sequence_task(seq) task_shoot_at_entity(null, patrol_security_guard[1].ped, 3000, FIRING_TYPE_1_BURST) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif elif not is_ped_injured(patrol_security_guard[2].ped) if not is_entity_in_angled_area(patrol_security_guard[2].ped, <<3545.086, 3646.993, 27.122>>, <<3544.545, 3643.939, 30.122>>, 1.200) if has_ped_task_finished_2(steve.ped, script_task_shoot_at_entity) open_sequence_task(seq) task_shoot_at_entity(null, patrol_security_guard[2].ped, 3000, FIRING_TYPE_1_BURST) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif endif // if has_ped_task_finished_2(steve.ped, script_task_shoot_at_entity) // set_ped_sphere_defensive_area(steve.ped, <<3541.8352, 3645.4143, 27.1216>>, 10.00) // set_blocking_of_non_temporary_events(steve.ped, false) // steve_ai_system_1_status++ // endif //script_assert("steve test 2") else //set_ped_reset_flag(dave.ped, PRF_DisableWeaponLaserSight, true) endif if patrol_security_guard[1].created and patrol_security_guard[2].created if (is_ped_injured(patrol_security_guard[1].ped) and is_ped_injured(patrol_security_guard[2].ped)) steve_ai_system_1_status = 8 endif endif break case 8 request_anim_dict("missfbi5ig_20a") if has_anim_dict_loaded("missfbi5ig_20a") set_blocking_of_non_temporary_events(steve.ped, true) clear_ped_tasks(steve.ped) steve_cover_point_stolen = false steve.run_to_pos = <<3552.4348, 3664.7957, 27.1101>> //cover_point[12] scene_pos = << 3551.580, 3658.520, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_20a", "run_through_door_steve", 2, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, 2) steve_ai_system_1_status++ endif break case 9 request_anim_dict("missfbi5ig_20b") TRANSITION_FROM_MOCAP_TO_COVER(steve.ped, steve.scene_id, steve_time, steve.run_to_pos) if IS_PLAYER_STEALING_PEDS_DESTINATION(steve.ped, steve.run_to_pos, 2.0) or steve_cover_point_stolen steve_cover_point_stolen = true IF IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(steve.ped, NORMAL_BLEND_OUT, TRUE) steve.scene_id = -1 endif if not is_entity_at_coord(steve.ped, <<3551.9094, 3663.2585, 27.1219>>, <<0.5, 0.5, 2.0>>) if has_ped_task_finished_2(steve.ped, script_task_perform_sequence, 1) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3551.9094, 3663.2585, 27.1219>>, <<3532.4, 3664.6, 28.9>>, pedmove_walk, false, 0.2, 0.2, true, ENAV_STOP_EXACTLY) task_aim_gun_at_coord(null, <<3553.9, 3664.8, 28.9>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif endif if open_door_with_security_card_cutscene_status > 22 if has_anim_dict_loaded("missfbi5ig_20b") if is_synchronized_scene_running(steve.scene_id) steve_cover_point_stolen = false steve.run_to_pos = <<3557.29, 3667.28, 27.12>> //cover_point[11] SET_SYNCHRONIZED_SCENE_RATE(steve.scene_id, 1.0) steve_ai_system_1_status++ endif endif endif break case 10 TRANSITION_FROM_MOCAP_TO_COVER(steve.ped, steve.scene_id, steve_time, steve.run_to_pos, 1.0, 0.5, false, false, cover_point[11]) request_anim_dict("missfbi5ig_21") if does_entity_exist(scientist[5].ped) steve_ai_system_1_status++ endif break case 11 request_anim_dict("missfbi5ig_21") //if player steels steves voer point then have dave say a line like come over here michael. Then when //michael moves away steve can get into the cover point. if is_synchronized_scene_running(steve.scene_id) TRANSITION_FROM_MOCAP_TO_COVER(steve.ped, steve.scene_id, steve_time, steve.run_to_pos) else // if has_label_been_triggered("fbi5a_dia18") // if not has_label_been_triggered("fbi5a_noise")//fbi5a_dia19 // if not is_any_text_being_displayed(locates_data) // if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_noise", CONV_PRIORITY_medium) // set_label_as_triggered("fbi5a_noise", true) // endif // endif // endif // endif if has_label_been_triggered("fbi5a_dia19b") if not has_label_been_triggered("fbi5a_dia19c") if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia19c", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia19c", true) endif endif endif endif if has_anim_dict_loaded("missfbi5ig_21") and PUT_PED_INTO_COVER_FOR_MOCAP(steve_decision, steve.ped, steve_time, steve.run_to_pos, cover_point[11], <<3561.9, 3681.9, 28.5>>) and has_label_been_triggered("fbi5a_dia19c") and not is_ped_injured(scientist[5].ped) //and is_entity_at_coord(scientist[5].ped, get_anim_initial_offset_position("missfbi5ig_21", "holdup_hallway_scientist", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 0), <<0.5, 0.5, 1.6>>)) scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_21", "holdup_hallway_steve", normal_BLEND_IN, slow_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_BLEND_IN) steve_cover_point_stolen = false steve.run_to_pos = get_anim_initial_offset_position("missfbi5ig_21", "holdup_hallway_steve", scene_pos, scene_rot, 1.0) steve_ai_system_1_status++ endif endif break case 12 if not is_ped_injured(scientist[5].ped) if is_synchronized_scene_running(steve.scene_id) if get_synchronized_scene_phase(steve.scene_id) >= 1.0 scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> if is_entity_in_angled_area(player_ped_id(), <<3554.461, 3680.366, 27.122>> , <<3558.623, 3679.670, 30.122>>, 3.3) or is_ped_ragdoll(scientist[5].ped) steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_21", "holdup_hallway_saw_player_steve", normal_BLEND_IN, slow_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_BLEND_IN) steve_cover_point_stolen = false steve.run_to_pos = get_anim_initial_offset_position("missfbi5ig_21", "holdup_hallway_saw_player_steve", scene_pos, scene_rot, 1.0) else steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_21", "holdup_hallway_saw_steve_steve", normal_BLEND_IN, slow_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, normal_BLEND_IN) steve_cover_point_stolen = false steve.run_to_pos = get_anim_initial_offset_position("missfbi5ig_21", "holdup_hallway_saw_steve_steve", scene_pos, scene_rot, 1.0) endif steve_ai_system_1_status++ endif endif else steve_ai_system_1_status = 14 endif break case 13 TRANSITION_FROM_MOCAP_TO_AIM(steve.ped, steve.scene_id, steve.run_to_pos, <<3554.0, 3664.2, 28.7>>, scientist[5].ped) if not is_ped_injured(scientist[5].ped) if not has_label_been_triggered("fbi5a_dia20") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia20", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia20", true) endif endif if not has_label_been_triggered("fbi5a_dia22") if has_label_been_triggered("fbi5a_dia20") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia22", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia22", true) endif endif endif endif if (is_synchronized_scene_running(steve.scene_id) and get_synchronized_scene_phase(steve.scene_id) >= 1.0) or is_ped_injured(scientist[5].ped) steve_ai_system_1_status++ endif break case 14 if not is_ped_injured(scientist[5].ped) if not is_entity_at_coord(steve.ped, get_anim_initial_offset_position("missfbi5ig_21", "holdup_hallway_saw_steve_steve", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 1.0), <<0.5, 0.5, 1.5>>) if has_ped_task_finished_2(steve.ped, script_task_perform_sequence, 1) or not steve_aiming_task_given[0] open_sequence_task(seq) task_go_to_coord_while_aiming_at_entity(null, get_anim_initial_offset_position("missfbi5ig_21", "holdup_hallway_saw_steve_steve", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 1.0), scientist[5].ped, pedmove_walk, false, 0.2, 0.2) task_aim_gun_at_entity(null, scientist[5].ped, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_aiming_task_given[0] = true endif else if has_ped_task_finished_2(steve.ped) or not steve_aiming_task_given[0] open_sequence_task(seq) task_aim_gun_at_entity(null, scientist[5].ped, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_aiming_task_given[0] = true endif endif elif not is_ped_injured(scientist[4].ped) if not is_entity_at_coord(steve.ped, get_anim_initial_offset_position("missfbi5ig_21", "holdup_hallway_saw_steve_steve", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 1.0), <<0.5, 0.5, 1.5>>) if has_ped_task_finished_2(steve.ped, script_task_perform_sequence, 1) or not steve_aiming_task_given[1] open_sequence_task(seq) task_go_to_coord_while_aiming_at_entity(null, get_anim_initial_offset_position("missfbi5ig_21", "holdup_hallway_saw_steve_steve", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 1.0), scientist[4].ped, pedmove_walk, false, 0.2, 0.2) task_aim_gun_at_entity(null, scientist[4].ped, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_aiming_task_given[1] = true endif else if has_ped_task_finished_2(steve.ped) or not steve_aiming_task_given[1] open_sequence_task(seq) task_aim_gun_at_entity(null, scientist[4].ped, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_aiming_task_given[1] = true endif endif else if has_ped_task_finished_2(steve.ped, script_task_perform_sequence, 1) or not steve_aiming_task_given[2] if not is_entity_at_coord(steve.ped, get_anim_initial_offset_position("missfbi5ig_21", "holdup_hallway_saw_steve_steve", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 1.0), <<0.5, 0.5, 1.5>>) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, get_anim_initial_offset_position("missfbi5ig_21", "holdup_hallway_saw_steve_steve", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 1.0), <<3557.1, 3690.4, 28.8>>, pedmove_walk, false, 0.2, 0.2) task_aim_gun_at_coord(null, <<3557.1, 3690.4, 28.8>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_aiming_task_given[2] = true else if has_ped_task_finished_2(steve.ped) or not steve_aiming_task_given[2] open_sequence_task(seq) task_aim_gun_at_coord(null, <<3553.9, 3668.7, 28.8>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_aiming_task_given[2] = true endif endif endif endif break endswitch endproc proc dave_ai_system_1() switch dave_ai_system_1_status case 0 dave_cover_point_stolen = false dave.run_to_pos = <<3532.22, 3666.6399, 27.1238>> //cover_point[7] if DOES_OBJECT_OF_TYPE_EXIST_AT_COORDS(<<3538.8, 3673.7, 27.1>>, 1.0, V_ILev_BL_DoorEL_L, true) and DOES_OBJECT_OF_TYPE_EXIST_AT_COORDS(<<3541.7, 3673.2, 27.1>>, 1.0, V_ILev_BL_DoorEL_R, true) float left_door_ratio float right_door_ratio bool left_lock_state bool right_lock_state GET_STATE_OF_CLOSEST_DOOR_OF_TYPE(V_ILev_BL_DoorEL_L, <<3538.8, 3673.7, 27.1>>, left_lock_state, left_door_ratio) GET_STATE_OF_CLOSEST_DOOR_OF_TYPE(V_ILev_BL_DoorEL_R, <<3541.7, 3673.2, 27.1>>, right_lock_state, right_door_ratio) if left_door_ratio < -0.6 and right_door_ratio > 0.6 //SET_SYNCHRONIZED_SCENE_RATE(dave.scene_id, 1.0) scene_pos = <<3538.663, 3673.165, 27.126>> scene_rot = <<0.000, 0.000, 80.400>> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_12", "moveto_hall_cover_dave", normal_BLEND_IN, INSTANT_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT) dave_ai_system_1_status++ endif endif break case 1 TRANSITION_FROM_MOCAP_TO_COVER(dave.ped, dave.scene_id, dave_time, dave.run_to_pos, 1.0, 0.5, true, false, cover_point[7]) //keep ped in cover = false when true it forces ped into cover when synched scene not running. if IS_PLAYER_STEALING_PEDS_DESTINATION(dave.ped, dave.run_to_pos, 2.0, false) //false or dave_cover_point_stolen dave_cover_point_stolen = true IF IS_SYNCHRONIZED_SCENE_RUNNING(dave.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(dave.ped, NORMAL_BLEND_OUT, TRUE) dave.scene_id = -1 endif if not is_entity_at_coord(dave.ped, <<3531.1191, 3667.4055, 27.1217>>, <<0.5, 0.5, 2.0>>) if has_ped_task_finished_2(dave.ped, script_task_perform_sequence, 1) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3531.1191, 3667.4055, 27.1217>>, <<3535.4, 3664.0, 28.5>>, pedmove_walk, false, 0.2, 0.2, true, ENAV_STOP_EXACTLY) task_aim_gun_at_coord(null, <<3535.4, 3664.0, 28.5>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif endif endif request_anim_dict("missfbi5ig_17_b") //if is_entity_in_angled_area(player_ped_id(), <<3533.239, 3669.902, 27.127>>, <<3529.693, 3670.527, 30.127>>, 1.6) if is_entity_in_angled_area(player_ped_id(), <<3532.774, 3666.266, 27.127>>, <<3532.260, 3663.208, 30.127>>, 2.200)//door entrance of lab dave_ai_system_1_status++ endif //player kills scientst and does not enter the room if is_ped_injured(scientist[1].ped) and is_ped_injured(scientist[2].ped) dave_ai_system_1_status = 5 endif break case 2 request_anim_dict("missfbi5ig_17_b") IF IS_SYNCHRONIZED_SCENE_RUNNING(dave.scene_id) TRANSITION_FROM_MOCAP_TO_COVER(dave.ped, dave.scene_id, dave_time, dave.run_to_pos) //keep ped in cover = false when true it forces ped into cover when synched scene not running. if IS_PLAYER_STEALING_PEDS_DESTINATION(dave.ped, dave.run_to_pos, 2.0, false) //false or dave_cover_point_stolen dave_cover_point_stolen = true IF IS_SYNCHRONIZED_SCENE_RUNNING(dave.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(dave.ped, NORMAL_BLEND_OUT, TRUE) dave.scene_id = -1 open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3531.1191, 3667.4055, 27.1217>>, <<3535.4, 3664.0, 28.5>>, pedmove_walk, false, 0.2, 0.2, true, ENAV_STOP_EXACTLY) task_aim_gun_at_coord(null, <<3535.4, 3664.0, 28.5>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif // if not is_entity_at_coord(dave.ped, <<3531.1191, 3667.4055, 27.1217>>, <<0.5, 0.5, 2.0>>) // if has_ped_task_finished_2(dave.ped, script_task_perform_sequence, 1) // // open_sequence_task(seq) // task_go_to_coord_while_aiming_at_coord(null, <<3531.1191, 3667.4055, 27.1217>>, <<3535.4, 3664.0, 28.5>>, pedmove_walk, false, 0.2, 0.2, true, ENAV_STOP_EXACTLY) // task_aim_gun_at_coord(null, <<3535.4, 3664.0, 28.5>>, -1) // close_sequence_task(seq) // task_perform_sequence(dave.ped, seq) // clear_sequence_task(seq) // // endif // // endif endif else if PUT_PED_INTO_COVER_FOR_MOCAP(dave_decision, dave.ped, dave_time, dave.run_to_pos, cover_point[7], <<3538.6, 3660.3, 29.2>>) AND HAS_ANIM_DICT_LOADED("missfbi5ig_17_b") dave.run_to_pos = get_anim_initial_offset_position("missfbi5ig_17_b", "run_in_aim_dave", scene_pos, scene_rot, 1.0) switch dave_decision case play_synched_scene scene_pos = << 3533.920, 3662.750, 28.118 >> scene_rot = << 0.000, 0.000, 169.920 >> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_17_b", "run_in_aim_dave", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) break case use_ai open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_COORD(null, dave.run_to_pos, <<3537.3, 3663.4, 29.0>>, pedmove_walk, false, 0.2, 0.2, true, ENAV_STOP_EXACTLY) task_aim_gun_at_coord(null, <<3537.3, 3663.4, 29.0>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) break endswitch dave_ai_system_1_status++ endif endif break case 3 printstring("run_in_aim_dave = ") printvector(get_anim_initial_offset_position("missfbi5ig_17_b", "run_in_aim_dave", scene_pos, scene_rot, 1.0) ) printnl() printstring("dave run to pos = ") printvector(dave.run_to_pos) printnl() TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, dave.run_to_pos, <<3537.3, 3663.4, 29.0>>, null) if is_ped_injured(scientist[2].ped) and is_ped_injured(scientist[3].ped) dave_ai_system_1_status = 5 endif break case 4 if is_ped_injured(scientist[2].ped) and is_ped_injured(scientist[3].ped) dave_ai_system_1_status = 5 endif break case 5 dave.run_to_pos = <<3547.1499, 3642.3276, 27.1219>> open_sequence_task(seq) task_aim_gun_at_coord(null, <<3536, 3662, 29.0>>, 500) TASK_FOLLOW_WAYPOINT_RECORDING(null, "fbi5_dave_1", 0, EWAYPOINT_START_FROM_CLOSEST_POINT | EWAYPOINT_NAVMESH_BACK_TO_WAYPOINT_IF_LEFT_ROUTE | EWAYPOINT_DO_NOT_RESPOND_TO_COLLISION_EVENTS)// | EWAYPOINT_USE_TIGHTER_TURN_SETTINGS) //task_go_to_coord_while_aiming_at_coord(null, dave.run_to_pos, <<3548.18, 3646.84, 28.92>>, pedmove_run, false, 0.2, 0.2, true, ENAV_STOP_EXACTLY) //77.8859 task_aim_gun_at_coord(null, <<3540.94, 3645.2, 28.72>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_ai_system_1_status++ break case 6 if IS_WAYPOINT_PLAYBACK_GOING_ON_FOR_PED(dave.ped) WAYPOINT_PLAYBACK_OVERRIDE_SPEED(dave.ped, 2.0) int dave_closeset_waypoint if waypoint_recording_get_closest_waypoint("fbi5_dave_1", get_entity_coords(dave.ped), dave_closeset_waypoint) if dave_closeset_waypoint > 2 if dave_closeset_waypoint < 14//12 // WAYPOINT_PLAYBACK_START_AIMING_AT_COORD(dave.ped, <<3529.1, 3647.7, 28.2>>, false) // // elif dave_closeset_waypoint < 15 //WAYPOINT_PLAYBACK_START_AIMING_AT_COORD(dave.ped, <<3532.1, 3647.1, 28.2>>, false) WAYPOINT_PLAYBACK_START_AIMING_AT_COORD(dave.ped, <<3535.4, 3646.4, 28.3>>, false) else WAYPOINT_PLAYBACK_START_AIMING_AT_COORD(dave.ped, <<3541.9, 3645.2, 28.9>>, false) endif endif endif endif if not is_entity_at_coord(dave.ped, dave.run_to_pos, <<0.5, 0.5, 2.0>>) if has_ped_task_finished_2(dave.ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, dave.run_to_pos, <<3548.18, 3646.84, 28.92>>, pedmove_run, false, 0.2, 0.2, true, ENAV_STOP_EXACTLY) //77.8859 task_aim_gun_at_coord(null, <<3540.94, 3645.2, 28.72>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif endif if does_entity_exist(patrol_security_guard[1].ped) if not is_ped_injured(patrol_security_guard[1].ped) if is_entity_in_angled_area(patrol_security_guard[1].ped, <<3545.832, 3643.640, 27.128>>, <<3546.306, 3646.501, 30.128>>, 1.5) dave_ai_system_1_status++ endif else dave_ai_system_1_status++ endif else if patrol_security_guard[1].created if is_ped_injured(patrol_security_guard[1].ped) dave_ai_system_1_status++ endif endif endif //set_ped_reset_flag(dave.ped, PRF_DisableWeaponLaserSight, true) break case 7 if not is_entity_at_coord(dave.ped, dave.run_to_pos, <<0.1, 0.1, 2.0>>) if has_ped_task_finished_2(dave.ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, dave.run_to_pos, <<3548.18, 3646.84, 28.92>>, pedmove_run, false, 0.2, 0.2, true, ENAV_STOP_EXACTLY) //77.8859 task_aim_gun_at_coord(null, <<3540.94, 3645.2, 28.72>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif else //need to delete both security guards on same frame other dave could shoot . // if is_ped_injured(patrol_security_guard[1].ped) // // if not is_ped_injured(patrol_security_guard[2].ped) // // open_sequence_task(seq) // task_shoot_at_entity(null, patrol_security_guard[2].ped, 3000, FIRING_TYPE_1_BURST) // close_sequence_task(seq) // task_perform_sequence(dave.ped, seq) // clear_sequence_task(seq) // // dave_ai_system_1_status++ // // endif // // elif is_ped_injured(patrol_security_guard[2].ped) // // if not is_ped_injured(patrol_security_guard[1].ped) // // open_sequence_task(seq) // task_shoot_at_entity(null, patrol_security_guard[1].ped, 3000, FIRING_TYPE_1_BURST) // close_sequence_task(seq) // task_perform_sequence(dave.ped, seq) // clear_sequence_task(seq) // // dave_ai_system_1_status++ // // endif // // endif endif if patrol_security_guard_1_ai_system_status > 2 or patrol_security_guard_2_ai_system_status > 2 SET_PED_COMBAT_MOVEMENT(dave.ped, cm_stationary) set_ped_sphere_defensive_area(dave.ped, dave.run_to_pos, 0.8) set_blocking_of_non_temporary_events(dave.ped, false) dave_ai_system_1_status = 8 else //set_ped_reset_flag(dave.ped, PRF_DisableWeaponLaserSight, true) endif if (is_ped_injured(patrol_security_guard[1].ped) and is_ped_injured(patrol_security_guard[2].ped)) set_ped_combat_movement(dave.ped, cm_defensive) set_blocking_of_non_temporary_events(dave.ped, true) clear_ped_tasks(dave.ped) dave_ai_system_1_status = 9 endif break case 8 if patrol_security_guard_1_ai_system_status > 2 or patrol_security_guard_2_ai_system_status > 2 SET_PED_COMBAT_MOVEMENT(dave.ped, cm_stationary) set_ped_sphere_defensive_area(dave.ped, dave.run_to_pos, 0.8) set_blocking_of_non_temporary_events(dave.ped, false) else //set_ped_reset_flag(dave.ped, PRF_DisableWeaponLaserSight, true) endif if (is_ped_injured(patrol_security_guard[1].ped) and is_ped_injured(patrol_security_guard[2].ped)) set_ped_combat_movement(dave.ped, cm_defensive) set_blocking_of_non_temporary_events(dave.ped, true) clear_ped_tasks(dave.ped) dave_ai_system_1_status = 9 endif break case 9 request_anim_dict("missfbi5ig_20a") if has_anim_dict_loaded("missfbi5ig_20a") scene_pos = <<3551.580, 3658.520, 27.125>> scene_rot = <<0.000, 0.000, 170.00>> dave.run_to_pos = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_20a", "run_through_door_dave", scene_pos, scene_rot, 0) dave.rot = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_20a", "run_through_door_dave", scene_pos, scene_rot, 0) if not is_entity_at_coord(dave.ped, dave.run_to_pos, <<0.1, 0.1, 2.0>>) if has_ped_task_finished_2(dave.ped, SCRIPT_TASK_FOLLOW_NAV_MESH_TO_COORD, -2, false) set_blocking_of_non_temporary_events(dave.ped, true) clear_ped_tasks(dave.ped) task_follow_nav_mesh_to_coord(dave.ped, dave.run_to_pos, pedmove_walk, -1, 0.05, ENAV_STOP_EXACTLY, dave.rot.z) //77.8859 endif else set_blocking_of_non_temporary_events(dave.ped, true) dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_20a", "run_through_door_dave", slow_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, slow_BLEND_IN) dave.run_to_pos = get_anim_initial_offset_position("missfbi5ig_20a", "run_through_door_dave", scene_pos, scene_rot, 1.0) dave_dialogue_time = 0 dave_ai_system_1_status++ endif // open_sequence_task(seq) // task_go_to_coord_while_aiming_at_coord(null, <<3551.6824, 3662.8660, 27.1230>>, <<3555, 3673, 29.00>>, 2.0, false) //77.8859 // task_seek_cover_to_cover_point(null, cover_point[12], <<3560.3176, 3695.0330, 28.4180>>, -1) // close_sequence_task(seq) // task_perform_sequence(dave.ped, seq) // clear_sequence_task(seq) endif break case 10 TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, dave.run_to_pos, <<3555.0, 3664.8, 28.8>>, null) //tells the player to hurry up if not is_synchronized_scene_running(dave.scene_id) if dave_dialogue_time = 0 dave_dialogue_time = get_game_timer() endif if lk_timer(dave_dialogue_time, 7000) if is_ped_in_specific_room(player_ped_id(), <<3551.5889, 3662.3013, 27.1218>>, "Lab_hazmat1") if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dcome", CONV_PRIORITY_medium) dave_dialogue_time = get_game_timer() endif endif endif endif endif request_anim_dict("missfbi5ig_20b") //security card cutscene finished allow the mocap to continue if open_door_with_security_card_cutscene_status > 22 if has_anim_dict_loaded("missfbi5ig_20b") if is_synchronized_scene_running(dave.scene_id) dave.run_to_pos = get_anim_initial_offset_position("missfbi5ig_20b", "ask_open_door_dave", <<3558.880, 3677.870, 27.125>>, <<0.000, 0.000, 170.000>>, 1.0) SET_SYNCHRONIZED_SCENE_RATE(dave.scene_id, 1.0) set_ped_config_flag(dave.ped, PCF_UseKinematicModeWhenStationary, true) //fix for bug 1463718 KILL_FACE_TO_FACE_CONVERSATION_DO_NOT_FINISH_LAST_LINE() ADD_NON_CRITICAL_STANDARD_CONVERSATION_TO_BUFFER(scripted_speech, "fbi5aAU", "fbi5a_dia16b", CONV_PRIORITY_MEDIUM) REPLAY_RECORD_BACK_FOR_TIME(5.0, 5.0, REPLAY_IMPORTANCE_HIGHEST) dave_ai_system_1_status++ endif endif endif break case 11 //TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, <<3557.3, 3672.9, 27.1230>>, <<0.0, 0.0, 0.0>>, scientist[4].ped) TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, dave.run_to_pos, scientist[4].pos, scientist[4].ped) if is_synchronized_scene_running(dave.scene_id) if get_synchronized_scene_phase(dave.scene_id) > 0.55 if not has_label_been_triggered("fbi5a_dia17") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia17", CONV_PRIORITY_medium) SET_LABEL_AS_TRIGGERED("fbi5a_dia17", true) endif endif endif else if has_label_been_triggered("fbi5a_dia19b") //all dialogue finished scientist[5].created = true //create the scientist 5 via the master controller. dave_ai_system_1_status++ endif endif if not has_label_been_triggered("fbi5a_outno") if has_label_been_triggered("fbi5a_dia17") if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_outno", CONV_PRIORITY_medium) SET_LABEL_AS_TRIGGERED("fbi5a_outno", true) endif endif endif endif if not has_label_been_triggered("fbi5a_dia18") if has_label_been_triggered("fbi5a_outno") if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia18", CONV_PRIORITY_medium) SET_LABEL_AS_TRIGGERED("fbi5a_dia18", true) endif endif endif endif if not has_label_been_triggered("fbi5a_dia19b") if has_label_been_triggered("fbi5a_dia18") if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia19b", CONV_PRIORITY_medium) SET_LABEL_AS_TRIGGERED("fbi5a_dia19b", true) endif endif endif endif break case 12 TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, dave.run_to_pos, scientist[4].pos, scientist[4].ped) if not is_ped_injured(scientist[5].ped) if has_label_been_triggered("fbi5a_dia20") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia21", CONV_PRIORITY_medium) SET_LABEL_AS_TRIGGERED("fbi5a_dia21", true) dave_ai_system_1_status++ endif endif else if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia21b", CONV_PRIORITY_medium) SET_LABEL_AS_TRIGGERED("fbi5a_dia21b", true) dave_ai_system_1_status++ else kill_any_conversation() //kills the conversations fbi5a_dia20 if the scientist is killed by the player endif endif break case 13 TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, dave.run_to_pos, scientist[4].pos, scientist[4].ped) request_anim_dict("missfbi5ig_22") if has_anim_dict_loaded("missfbi5ig_22") if is_entity_at_coord(dave.ped, dave.run_to_pos, <<0.5, 0.5, 2.0>>, false) scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.000 >> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_22", "aim_scientist_walkout_dave", slow_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, rbf_none, slow_blend_in) dave_ai_system_1_status++ endif endif break case 14 if is_ped_injured(scientist[4].ped) or (is_synchronized_scene_running(dave.scene_id) and get_synchronized_scene_phase(dave.scene_id) >= 1.0) set_ped_config_flag(dave.ped, PCF_UseKinematicModeWhenStationary, false) kill_any_conversation() dave_ai_system_1_status++ endif if not has_LABEL_been_TRIGGERED("fbi5a_dia23") if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia23", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia23", true) endif endif endif break case 15 if not has_LABEL_been_TRIGGERED("fbi5a_dia23") if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia23", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia23", true) dave_ai_system_1_status++ endif endif else if does_entity_exist(chemicals.obj) if not has_label_been_triggered("GET_CHEMS") if not is_any_text_being_displayed(locates_data) set_label_as_triggered("GET_CHEMS", true) print_now("GET_CHEMS", default_god_text_time, 1) endif endif endif endif if not is_ped_injured(scientist[4].ped) if not is_entity_at_coord(dave.ped, get_anim_initial_offset_position("missfbi5ig_22", "aim_scientist_walkout_dave", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 1.0), <<0.5, 0.5, 1.5>>) if has_ped_task_finished_2(dave.ped, script_task_perform_sequence, 1) or not dave_aiming_task_given[0] open_sequence_task(seq) task_go_to_coord_while_aiming_at_entity(null, get_anim_initial_offset_position("missfbi5ig_22", "aim_scientist_walkout_dave", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 1.0), scientist[4].ped, pedmove_walk, false, 0.2, 0.2, true, ENAV_STOP_EXACTLY) task_aim_gun_at_entity(null, scientist[4].ped, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_aiming_task_given[0] = true endif else if has_ped_task_finished_2(dave.ped) or not dave_aiming_task_given[0] open_sequence_task(seq) task_aim_gun_at_entity(null, scientist[4].ped, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) FORCE_PED_MOTION_STATE(dave.ped, MS_AIMING) dave_aiming_task_given[0] = true endif endif elif not is_ped_injured(scientist[5].ped) if not is_entity_at_coord(dave.ped, get_anim_initial_offset_position("missfbi5ig_22", "aim_scientist_walkout_dave", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 1.0), <<0.5, 0.5, 1.5>>) if has_ped_task_finished_2(dave.ped, script_task_perform_sequence, 1) or not dave_aiming_task_given[1] //or get_script_task_status(script_task_aim_gun_at_entity) = performing_task open_sequence_task(seq) task_go_to_coord_while_aiming_at_entity(null, get_anim_initial_offset_position("missfbi5ig_22", "aim_scientist_walkout_dave", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 1.0), scientist[5].ped, pedmove_walk, false, 0.2, 0.2) task_aim_gun_at_entity(null, scientist[5].ped, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_aiming_task_given[1] = true //dave_ai_system_1_status++ endif else if has_ped_task_finished_2(dave.ped) or not dave_aiming_task_given[1] open_sequence_task(seq) task_aim_gun_at_entity(null, scientist[5].ped, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_aiming_task_given[1] = true endif endif else if has_ped_task_finished_2(dave.ped, script_task_perform_sequence, 1) or not dave_aiming_task_given[2] if not is_entity_at_coord(dave.ped, get_anim_initial_offset_position("missfbi5ig_22", "aim_scientist_walkout_dave", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 1.0), <<0.5, 0.5, 1.5>>) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, get_anim_initial_offset_position("missfbi5ig_22", "aim_scientist_walkout_dave", <<3558.898, 3677.850, 27.125>>, <<0.000, 0.000, 170.00>>, 1.0), <<3557.1, 3690.4, 28.8>>, pedmove_walk, false, 0.2, 0.2) task_aim_gun_at_coord(null, <<3557.1, 3690.4, 28.8>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_aiming_task_given[2] = true //dave_ai_system_1_status++ else if has_ped_task_finished_2(dave.ped) or not steve_aiming_task_given[2] open_sequence_task(seq) task_aim_gun_at_coord(null, <<3553.9, 3668.7, 28.8>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_aiming_task_given[2] = true endif endif endif endif break endswitch endproc func bool okay_to_delete_security_1_and_2() if not is_ped_injured(patrol_security_guard[1].ped) and not is_entity_in_angled_area(patrol_security_guard[1].ped, <<3537.418, 3648.729, 26.528>>, <<3536.256, 3642.130, 30.128>>, 18.000) and not is_entity_in_angled_area(patrol_security_guard[1].ped, <<3545.659, 3650.203, 27.127>>, <<3550.288, 3649.387, 30.127>>, 18.000) and not is_ped_injured(patrol_security_guard[2].ped) and not is_entity_in_angled_area(patrol_security_guard[2].ped, <<3537.418, 3648.729, 26.528>>, <<3536.256, 3642.130, 30.128>>, 18.000) and not is_entity_in_angled_area(patrol_security_guard[2].ped, <<3545.659, 3650.203, 27.127>>, <<3550.288, 3649.387, 30.127>>, 18.000) if is_entity_in_angled_area(player_ped_id(), <<3543.768, 3640.804, 27.127>>, <<3544.861, 3647.008, 30.127>>, 10.7) or is_entity_in_angled_area(player_ped_id(), <<3546.138, 3651.365, 27.121>>, <<3555.296, 3649.750, 30.121>>, 16.00) //long corridor patrol guards walk down or get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(patrol_security_guard[1].ped)) > 40 delete_ped(patrol_security_guard[1].ped) if does_blip_exist(patrol_security_guard[1].blip) remove_blip(patrol_security_guard[1].blip) endif delete_ped(patrol_security_guard[2].ped) if does_blip_exist(patrol_security_guard[2].blip) remove_blip(patrol_security_guard[2].blip) endif return true endif endif return false endfunc proc patrol_security_guard_1_ai_system() if not is_ped_injured(patrol_security_guard[1].ped) switch patrol_security_guard_1_ai_system_status case 0 open_sequence_task(seq) task_pause(null, 500) task_follow_nav_mesh_to_coord(null, <<3545.9080, 3645.1091, 27.1217>>, pedmove_walk, -1) task_follow_nav_mesh_to_coord(null, <<3534.8479, 3647.2698, 26.5223>>, pedmove_walk, -1, default_navmesh_radius, enav_no_stopping) task_follow_nav_mesh_to_coord(null, patrol_security_guard[1].run_to_pos, pedmove_walk, -1) task_turn_ped_to_face_entity(null, player_ped_id()) close_sequence_task(seq) task_perform_sequence(patrol_security_guard[1].ped, seq) clear_sequence_task(seq) patrol_security_guard_1_ai_system_status++ break case 1 SET_PED_RESET_FLAG(patrol_security_guard[1].ped, PRF_SearchForClosestDoor, TRUE) if not is_entity_at_coord(patrol_security_guard[1].ped, patrol_security_guard[1].run_to_pos, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(patrol_security_guard[1].ped) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, patrol_security_guard[1].run_to_pos, pedmove_walk, -1) task_turn_ped_to_face_entity(null, player_ped_id()) close_sequence_task(seq) task_perform_sequence(patrol_security_guard[1].ped, seq) clear_sequence_task(seq) endif else if get_distance_between_coords(get_entity_coords(patrol_security_guard[1].ped), get_entity_coords(player_ped_id())) < 15.0 patrol_security_guard_1_ai_system_status = 2 endif endif if has_ped_been_harmed(patrol_security_guard[1].ped, patrol_security_guard[1].health) or has_ped_been_harmed(patrol_security_guard[2].ped, patrol_security_guard[2].health) patrol_security_guard_1_ai_system_status = 2 endif if not is_entity_in_angled_area(patrol_security_guard[1].ped, <<3546.030, 3651.371, 27.122>>, <<3551.035, 3650.498, 30.122>>, 15.7) //area covering double doors where patrol security guards walk through. vector fire_pos if GET_CLOSEST_FIRE_POS(fire_pos, get_entity_coords(patrol_security_guard[1].ped)) if get_distance_between_coords(fire_pos, get_entity_coords(patrol_security_guard[1].ped)) < 10.0 patrol_security_guard_1_ai_system_status = 2 endif endif //if has_entity_clear_los_to_entity(patrol_security_guard[1].ped, player_ped_id()) if has_entity_clear_los_to_entity_in_front(patrol_security_guard[1].ped, player_ped_id()) // START_SHAPE_TEST_LOS_PROBE(startPosn, endPosn) //CAN_PED_SEE_HATED_PED(cia_enemy[i].ped, player_ped_id()) // if SHAPETEST_INDEX != 0 // if GET_SHAPE_TEST_RESULT() = SHAPETEST_STATUS_RESULTS_READ patrol_security_guard_1_ai_system_status = 2 else // printstring("can't see entity") // printnl() endif if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(patrol_security_guard[1].ped)) < 13 if is_ped_shooting(player_ped_id()) WEAPON_TYPE player_weapon IF GET_CURRENT_PED_WEAPON(player_ped_id(), player_weapon) IF (player_weapon != WEAPONTYPE_STUNGUN) patrol_security_guard_1_ai_system_status = 2 endif endif endif endif //if IS_PROJECTILE_TYPE_WITHIN_DISTANCE(get_entity_coords(patrol_security_guard[1].ped), WEAPONTYPE_STICKYBOMB, 10.0) if IS_PROJECTILE_TYPE_IN_ANGLED_AREA(get_offset_from_entity_in_world_coords(patrol_security_guard[1].ped, <<-2.0, 2.4, -1.0>>), get_offset_from_entity_in_world_coords(patrol_security_guard[1].ped, <<2.000, 2.4, 1.6>>), 5.0, WEAPONTYPE_STICKYBOMB) or IS_PROJECTILE_TYPE_IN_ANGLED_AREA(get_offset_from_entity_in_world_coords(patrol_security_guard[1].ped, <<-2.0, 2.4, -1.0>>), get_offset_from_entity_in_world_coords(patrol_security_guard[1].ped, <<2.000, 2.4, 1.6>>), 5.0, WEAPONTYPE_DLC_PROXMINE) patrol_security_guard_1_ai_system_status = 2 endif else //if is_entity_in_angled_area(player_ped_id(), <<3545.832, 3643.640, 27.128>>, <<3546.306, 3646.501, 30.128>>, 1.0) //1.5 if is_entity_in_angled_area(player_ped_id(), <<3546.030, 3651.371, 27.122>>, <<3551.035, 3650.498, 30.122>>, 15.7) patrol_security_guard_1_ai_system_status = 2 endif if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(patrol_security_guard[1].ped)) < 13 if is_ped_shooting(player_ped_id()) WEAPON_TYPE player_weapon IF GET_CURRENT_PED_WEAPON(player_ped_id(), player_weapon) IF (player_weapon != WEAPONTYPE_STUNGUN) patrol_security_guard_1_ai_system_status = 2 endif endif endif endif endif okay_to_delete_security_1_and_2() break case 2 set_label_as_triggered("fbi5a_chat1", true) set_label_as_triggered("fbi5a_chat2", true) kill_any_conversation() set_blocking_of_non_temporary_events(patrol_security_guard[1].ped, false) set_ped_sphere_defensive_area(patrol_security_guard[1].ped, <<3541.0510, 3646.4338, 27.1220>>, 1.0) SET_PED_COMBAT_ATTRIBUTES(patrol_security_guard[1].ped, CA_REMOVE_AREA_SET_WILL_ADVANCE_WHEN_DEFENSIVE_AREA_REACHED, TRUE) SET_PED_COMBAT_ATTRIBUTES(patrol_security_guard[1].ped, CA_CAN_CHARGE, TRUE) task_combat_ped(patrol_security_guard[1].ped, player_ped_id()) patrol_security_guard_1_ai_system_status++ if ! (patrol_security_guard_2_ai_system_status > 2) patrol_security_guard_2_ai_system_status = 2 endif break case 3 break endswitch if does_entity_exist(patrol_security_guard[1].ped) if HAS_PED_BEEN_TAZERED_BY_PED(patrol_security_guard[1].ped, dave.ped) or has_entity_been_damaged_by_weapon(patrol_security_guard[1].ped, WEAPONTYPE_INVALID, GENERALWEAPON_TYPE_ANYWEAPON) set_entity_health(patrol_security_guard[1].ped, 2) endif endif endif endproc proc patrol_security_guard_2_ai_system() if not is_ped_injured(patrol_security_guard[2].ped) switch patrol_security_guard_2_ai_system_status case 0 open_sequence_task(seq) task_pause(null, 700) task_follow_nav_mesh_to_coord(null, <<3545.9080, 3645.1091, 27.1217>>, pedmove_walk, -1) task_follow_nav_mesh_to_coord(null, <<3534.8479, 3647.2698, 26.5223>>, pedmove_walk, -1) task_follow_nav_mesh_to_coord(null, patrol_security_guard[2].run_to_pos, pedmove_walk, -1) task_turn_ped_to_face_entity(null, player_ped_id()) close_sequence_task(seq) task_perform_sequence(patrol_security_guard[2].ped, seq) clear_sequence_task(seq) patrol_security_guard_2_ai_system_status++ break case 1 SET_PED_RESET_FLAG(patrol_security_guard[2].ped, PRF_SearchForClosestDoor, TRUE) if not is_entity_at_coord(patrol_security_guard[2].ped, patrol_security_guard[2].run_to_pos, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(patrol_security_guard[2].ped) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, patrol_security_guard[2].run_to_pos, pedmove_walk, -1) task_turn_ped_to_face_entity(null, player_ped_id()) close_sequence_task(seq) task_perform_sequence(patrol_security_guard[2].ped, seq) clear_sequence_task(seq) endif else if get_distance_between_coords(get_entity_coords(patrol_security_guard[2].ped), get_entity_coords(player_ped_id())) < 15.0 patrol_security_guard_2_ai_system_status = 2 endif endif if has_ped_been_harmed(patrol_security_guard[1].ped, patrol_security_guard[1].health) or has_ped_been_harmed(patrol_security_guard[2].ped, patrol_security_guard[2].health) patrol_security_guard_2_ai_system_status = 2 endif if not is_entity_in_angled_area(patrol_security_guard[2].ped, <<3546.030, 3651.371, 27.122>>, <<3551.035, 3650.498, 30.122>>, 15.7) vector fire_pos if GET_CLOSEST_FIRE_POS(fire_pos, get_entity_coords(patrol_security_guard[2].ped)) if get_distance_between_coords(fire_pos, get_entity_coords(patrol_security_guard[2].ped)) < 10.0 patrol_security_guard_1_ai_system_status = 2 endif endif if has_entity_clear_los_to_entity_in_front(patrol_security_guard[2].ped, player_ped_id()) //CAN_PED_SEE_HATED_PED(cia_enemy[i].ped, player_ped_id()) patrol_security_guard_2_ai_system_status = 2 endif if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(patrol_security_guard[2].ped)) < 13 if is_ped_shooting(player_ped_id()) WEAPON_TYPE player_weapon IF GET_CURRENT_PED_WEAPON(player_ped_id(), player_weapon) IF (player_weapon != WEAPONTYPE_STUNGUN) patrol_security_guard_2_ai_system_status = 2 endif endif endif endif if IS_PROJECTILE_TYPE_IN_ANGLED_AREA(get_offset_from_entity_in_world_coords(patrol_security_guard[2].ped, <<-2.0, 2.4, -1.0>>), get_offset_from_entity_in_world_coords(patrol_security_guard[2].ped, <<2.000, 2.4, 1.6>>), 5.0, WEAPONTYPE_STICKYBOMB) or IS_PROJECTILE_TYPE_IN_ANGLED_AREA(get_offset_from_entity_in_world_coords(patrol_security_guard[2].ped, <<-2.0, 2.4, -1.0>>), get_offset_from_entity_in_world_coords(patrol_security_guard[2].ped, <<2.000, 2.4, 1.6>>), 5.0, WEAPONTYPE_DLC_PROXMINE) patrol_security_guard_1_ai_system_status = 2 endif endif okay_to_delete_security_1_and_2() break case 2 set_blocking_of_non_temporary_events(patrol_security_guard[2].ped, false) set_ped_sphere_defensive_area(patrol_security_guard[2].ped, <<3539.5627, 3643.4182, 27.1220>>, 1.0) SET_PED_COMBAT_ATTRIBUTES(patrol_security_guard[2].ped, CA_REMOVE_AREA_SET_WILL_ADVANCE_WHEN_DEFENSIVE_AREA_REACHED, TRUE) SET_PED_COMBAT_ATTRIBUTES(patrol_security_guard[2].ped, CA_CAN_CHARGE, TRUE) task_combat_ped(patrol_security_guard[2].ped, player_ped_id()) patrol_security_guard_2_ai_system_status++ if ! (patrol_security_guard_1_ai_system_status > 2) patrol_security_guard_1_ai_system_status = 2 endif break case 3 break endswitch if does_entity_exist(patrol_security_guard[2].ped) if HAS_PED_BEEN_TAZERED_BY_PED(patrol_security_guard[2].ped, dave.ped) or has_entity_been_damaged_by_weapon(patrol_security_guard[2].ped, WEAPONTYPE_INVALID, GENERALWEAPON_TYPE_ANYWEAPON) set_entity_health(patrol_security_guard[2].ped, 2) endif endif endif endproc proc dialogue_system_1() switch dialogue_system_1_status case 0 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia0", CONV_PRIORITY_LOW) dialogue_system_1_status++ endif break case 1 if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia1", CONV_PRIORITY_LOW) dialogue_system_1_status++ endif endif break case 2 if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia2", CONV_PRIORITY_LOW) dialogue_system_1_status++ endif endif break case 3 if not is_any_text_being_displayed(locates_data) if not has_label_been_triggered("TAZ_LAB") print_now("TAZ_LAB", default_god_text_time, 1) set_label_as_triggered("TAZ_LAB", true) endif dialogue_system_1_status++ endif break case 4 if is_entity_in_angled_area(player_ped_id(), <<3532.774, 3666.266, 27.127>>, <<3532.260, 3663.208, 30.127>>, 2.200) dialogue_system_1_status++ endif //if is_entity_in_angled_area(dave.ped, <<3537.917, 3669.565, 27.122 >>, <<3536.163, 3659.720, 29.722>>, 8.600) break case 5 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_holdup", CONV_PRIORITY_medium) dialogue_system_1_status++ endif break case 6 // if not has_label_been_triggered("fbi5a_dia5") // if not IS_ANY_CONVERSATION_ONGOING_OR_QUEUED() // if not is_ped_injured(scientist[2].ped) // if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia5", CONV_PRIORITY_medium) // set_label_as_triggered("fbi5a_dia5", true) // endif // endif // endif // endif if not has_label_been_triggered("fbi5a_dia5b") if not is_ped_injured(scientist[2].ped) and not is_ped_injured(scientist[3].ped) if not IS_ANY_CONVERSATION_ONGOING_OR_QUEUED() if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia5b", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia5b", true) endif endif endif endif if not has_label_been_triggered("fbi5a_dia5c") if (is_ped_injured(scientist[2].ped) and not is_ped_injured(scientist[3].ped)) or (is_ped_injured(scientist[3].ped) and not is_ped_injured(scientist[2].ped)) if lk_timer(alarm_time, 10000) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia5c", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia5c", true) endif endif endif endif if not has_label_been_triggered("fbi5a_dia5d") if alarm_time_stored and lk_timer(alarm_time, 30000) //if not IS_ANY_CONVERSATION_ONGOING_OR_QUEUED() //if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia5d", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia5d", true) set_label_as_triggered("fbi5a_dia5c", true) //deactivate fbi5a_dia5c //endif //endif endif endif if has_label_been_triggered("fbi5a_dia5d") if not IS_ANY_CONVERSATION_ONGOING_OR_QUEUED() alarm_time = get_game_timer() alarm_fail = true endif endif if is_ped_injured(scientist[2].ped) and is_ped_injured(scientist[3].ped) dialogue_system_1_status++ endif break case 7 if is_ped_injured(scientist[2].ped) and is_ped_injured(scientist[3].ped) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia6", CONV_PRIORITY_medium) dialogue_system_1_status++ endif endif break case 8 if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia7", CONV_PRIORITY_medium) dialogue_system_1_status++ endif endif break case 9 if is_entity_in_angled_area(player_ped_id(), <<3541.838, 3645.780, 27.137>>, <<3538.978, 3646.279, 30.135>>, 3.400) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia10", CONV_PRIORITY_medium) dialogue_system_1_status++ endif endif break case 10 if not is_ped_injured(patrol_security_guard[1].ped) if is_entity_in_angled_area(patrol_security_guard[1].ped, <<3545.832, 3643.640, 27.128>>, <<3546.306, 3646.501, 30.128>>, 1.5) if patrol_security_guard_1_ai_system_status < 2 and patrol_security_guard_2_ai_system_status < 2 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia15", CONV_PRIORITY_medium) dialogue_system_1_status++ endif else //player alerted guards dialogue_system_1_status++ endif endif endif break case 11 if not is_any_text_being_displayed(locates_data) //print_now("COV_SEC2", default_god_text_time, 1) dialogue_system_1_status++ endif break case 12 switch GET_FAILS_COUNT_WITHOUT_PROGRESS_FOR_THIS_MISSION_SCRIPT() case 0 if not is_any_conversation_ongoing_or_queued() if not has_label_been_triggered("fbi5a_chat1") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_chat1", conv_priority_low, do_not_display_subtitles, do_not_add_to_brief_screen) dialogue_system_1_status++ endif else dialogue_system_1_status++ endif endif break case 1 if not is_any_conversation_ongoing_or_queued() if not has_label_been_triggered("fbi5a_chat2") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_chat2", conv_priority_low, do_not_display_subtitles, do_not_add_to_brief_screen) dialogue_system_1_status++ endif else dialogue_system_1_status++ endif endif break default if not is_any_conversation_ongoing_or_queued() if not has_label_been_triggered("fbi5a_chat2") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_chat2", conv_priority_low, do_not_display_subtitles, do_not_add_to_brief_screen) dialogue_system_1_status++ endif else dialogue_system_1_status++ endif endif break endswitch break case 13 if (is_ped_injured(patrol_security_guard[1].ped) and is_ped_injured(patrol_security_guard[2].ped)) dialogue_system_1_status++ endif break case 14 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia16", CONV_PRIORITY_medium) dialogue_system_1_status++ endif break case 15 if not is_any_text_being_displayed(locates_data) if is_entity_in_angled_area(player_ped_id(), <<3549.414, 3662.368, 27.12>>, <<3559.35, 3660.562, 29.722>>, 8.0) //6.5 //print_now("FBI5A_GOD_4", default_god_text_time, 1) dialogue_system_1_status++ endif endif break case 16 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_swipe", CONV_PRIORITY_medium) dialogue_system_1_status++ endif break case 17 break endswitch if dialogue_system_1_status < 4 if is_entity_in_angled_area(player_ped_id(), <<3532.774, 3666.266, 27.127>>, <<3532.260, 3663.208, 30.127>>, 2.200) dialogue_system_1_status = 4 endif endif if dialogue_system_1_status < 7 if (is_ped_injured(scientist[2].ped) and is_ped_injured(scientist[3].ped)) dialogue_system_1_status = 7 endif endif if dialogue_system_1_status < 14 if patrol_security_guard[1].created if is_ped_injured(patrol_security_guard[1].ped) and is_ped_injured(patrol_security_guard[2].ped) dialogue_system_1_status = 14 endif endif endif endproc proc store_alarm_time() if not alarm_time_stored alarm_time = get_game_timer() alarm_time_stored = true endif endproc func bool have_lab_workers_been_spooked() if is_entity_in_angled_area(player_ped_id(), <<3532.774, 3666.266, 27.127>>, <<3532.260, 3663.208, 30.127>>, 2.200)//door entrance of lab or is_entity_in_angled_area(player_ped_id(), <<3537.917, 3669.565, 27.122 >>, <<3536.163, 3659.720, 29.722>>, 8.600) //lab room with scientists or is_entity_in_angled_area(dave.ped, <<3537.917, 3669.565, 27.122 >>, <<3536.163, 3659.720, 29.722>>, 8.600) //lab room with scientists or has_ped_been_harmed(scientist[2].ped, scientist[2].health) or has_ped_been_harmed(scientist[3].ped, scientist[3].health) or (is_ped_shooting(player_ped_id()) and (get_distance_between_coords(get_entity_coords(player_ped_id()), <<3537.0, 3664.4, 28.6>>) < 30.00)) return true endif return false endfunc proc scientist_2_ai_system() if not is_ped_injured(scientist[2].ped) if scientist_2_ai_system_status != 4 if is_ped_ragdoll(scientist[2].ped) store_alarm_time() scientist_2_ai_system_status = 4 endif endif switch scientist_2_ai_system_status case 0 request_anim_dict("missfbi5ig_15") if has_anim_dict_loaded("missfbi5ig_15") request_anim_dict("missfbi5ig_17") //anims for alerted scientist scene_pos = << 3533.920, 3662.750, 28.118 >> scene_rot = << 0.000, 0.000, 169.920 >> OPEN_SEQUENCE_TASK(seq) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_a_scientistb", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS, -1) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_b_scientistb", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS, -1) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_c_scientistb", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS, -1) set_sequence_to_repeat(seq, repeat_forever) close_sequence_task(seq) task_perform_sequence(scientist[2].ped, seq) clear_sequence_task(seq) scientist_2_ai_system_status++ else printstring("scientist 2 test 0") printnl() endif break case 1 if is_entity_in_angled_area(player_ped_id(), <<3532.584, 3664.330, 27.127>>, <<3528.744, 3665.008, 30.127>>, 12.5) if not is_entity_playing_anim(scientist[2].ped, "missfbi5ig_15", "look_into_microscope_base_scientistb") scene_pos = << 3533.920, 3662.750, 28.118 >> scene_rot = << 0.000, 0.000, 169.920 >> OPEN_SEQUENCE_TASK(seq) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_base_scientistb", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS | AF_LOOPING, -1) close_sequence_task(seq) task_perform_sequence(scientist[2].ped, seq) clear_sequence_task(seq) endif else if not is_entity_playing_anim(scientist[2].ped, "missfbi5ig_15", "look_into_microscope_a_scientistb") and not is_entity_playing_anim(scientist[2].ped, "missfbi5ig_15", "look_into_microscope_b_scientistb") and not is_entity_playing_anim(scientist[2].ped, "missfbi5ig_15", "look_into_microscope_c_scientistb") scene_pos = << 3533.920, 3662.750, 28.118 >> scene_rot = << 0.000, 0.000, 169.920 >> OPEN_SEQUENCE_TASK(seq) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_a_scientistb", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS, -1) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_b_scientistb", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS, -1) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_c_scientistb", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS, -1) set_sequence_to_repeat(seq, repeat_forever) close_sequence_task(seq) task_perform_sequence(scientist[2].ped, seq) clear_sequence_task(seq) endif endif if have_lab_workers_been_spooked() store_alarm_time() remove_anim_dict("missfbi5ig_15") scientist_2_ai_system_status++ endif break case 2 if has_anim_dict_loaded("missfbi5ig_17") scene_pos = << 3533.920, 3662.750, 28.118 >> scene_rot = << 0.000, 0.000, 169.920 >> scientist[2].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[2].ped, scientist[2].scene_id, "missfbi5ig_17", "walk_in_aim_scientistb", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS) scientist_2_ai_system_status++ endif break case 3 if is_synchronized_scene_running(scientist[2].scene_id) if get_synchronized_scene_phase(scientist[2].scene_id) >= 1.0 scene_pos = << 3533.920, 3662.750, 28.118 >> scene_rot = << 0.000, 0.000, 169.920 >> scientist[2].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[2].ped, scientist[2].scene_id, "missfbi5ig_17", "walk_in_aim_loop_scientistb", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS) endif endif break case 4 manage_ped_hands_up_system(scientist[2].ped, <<3536.89, 3662.69, 27.12>>) break endswitch if HAS_PED_BEEN_TAZERED_BY_PED(scientist[2].ped, dave.ped) setup_tazor_kill_for_ped(scientist[2]) endif if scientist_2_ai_system_status > 2 if not has_label_been_triggered("fbi5a_cower1") if not is_any_text_being_displayed(locates_data) if CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_cower1", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_cower1", true) endif endif else if not has_label_been_triggered("fbi5a_dia5f") if not is_any_text_being_displayed(locates_data) if is_ped_injured(scientist[3].ped) if CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_dia5f", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia5f", true) endif endif endif endif endif endif kill_ped_on_certain_damage(scientist[2]) else store_alarm_time() endif endproc proc detach_scientist_3_assets() if does_entity_exist(clip_board.obj) if is_entity_attached(clip_board.obj) detach_entity(clip_board.obj) endif set_object_as_no_longer_needed(clip_board.obj) endif //set_model_as_no_longer_needed(clip_board.model) if does_entity_exist(pencil.obj) if is_entity_attached(pencil.obj) detach_entity(pencil.obj) endif set_object_as_no_longer_needed(pencil.obj) endif //set_model_as_no_longer_needed(pencil.model) endproc proc scientist_3_ai_system() if not is_ped_injured(scientist[3].ped) if scientist_3_ai_system_status != 5 if is_ped_ragdoll(scientist[3].ped) detach_scientist_3_assets() store_alarm_time() scientist_3_ai_system_status = 5 endif endif switch scientist_3_ai_system_status case 0 request_anim_dict("missfbi5ig_15") request_model(clip_board.model) request_model(pencil.model) if has_anim_dict_loaded("missfbi5ig_15") and has_model_loaded(clip_board.model) and has_model_loaded(pencil.model) request_anim_dict("missfbi5ig_17") //anims for alerted clip_board.obj = create_object(clip_board.model, get_offset_from_entity_in_world_coords(scientist[3].ped, <<0.0, 0.0, 1.0>>)) ATTACH_ENTITY_TO_ENTITY(clip_board.obj, scientist[3].ped, get_ped_bone_index(scientist[3].ped, BONETAG_PH_L_HAND), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) pencil.obj = create_object(pencil.model, get_offset_from_entity_in_world_coords(scientist[3].ped, <<0.0, 0.0, 1.0>>)) ATTACH_ENTITY_TO_ENTITY(pencil.obj, scientist[3].ped, get_ped_bone_index(scientist[3].ped, BONETAG_PH_R_HAND), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) scene_pos = << 3533.920, 3662.750, 28.118 >> scene_rot = << 0.000, 0.000, 169.920 >> OPEN_SEQUENCE_TASK(seq) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_a_scientista", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS, -1) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_b_scientista", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS, -1) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_c_scientista", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS, -1) set_sequence_to_repeat(seq, repeat_forever) close_sequence_task(seq) task_perform_sequence(scientist[3].ped, seq) clear_sequence_task(seq) scientist_3_ai_system_status++ else printstring("scientist 3 test 0") printnl() endif break case 1 if is_entity_in_angled_area(player_ped_id(), <<3532.584, 3664.330, 27.127>>, <<3528.744, 3665.008, 30.127>>, 12.5) if not is_entity_playing_anim(scientist[3].ped, "missfbi5ig_15", "look_into_microscope_base_scientista") OPEN_SEQUENCE_TASK(seq) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_base_scientista", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS | AF_LOOPING, -1) close_sequence_task(seq) task_perform_sequence(scientist[3].ped, seq) clear_sequence_task(seq) endif else if not is_entity_playing_anim(scientist[3].ped, "missfbi5ig_15", "look_into_microscope_a_scientista") and not is_entity_playing_anim(scientist[3].ped, "missfbi5ig_15", "look_into_microscope_b_scientista") and not is_entity_playing_anim(scientist[3].ped, "missfbi5ig_15", "look_into_microscope_c_scientista") OPEN_SEQUENCE_TASK(seq) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_a_scientista", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS, -1) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_b_scientista", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS, -1) TASK_PLAY_ANIM_ADVANCED(NULL, "missfbi5ig_15", "look_into_microscope_c_scientista", scene_pos, scene_rot, normal_BLEND_IN, normal_BLEND_OUT, -1, AF_NOT_INTERRUPTABLE | AF_EXTRACT_INITIAL_OFFSET | AF_OVERRIDE_PHYSICS | AF_USE_KINEMATIC_PHYSICS, -1) set_sequence_to_repeat(seq, repeat_forever) close_sequence_task(seq) task_perform_sequence(scientist[3].ped, seq) clear_sequence_task(seq) endif endif if have_lab_workers_been_spooked() store_alarm_time() remove_anim_dict("missfbi5ig_15") scientist_3_ai_system_status++ endif break case 2 if has_anim_dict_loaded("missfbi5ig_17") scene_pos = << 3533.920, 3662.750, 28.118 >> scene_rot = << 0.000, 0.000, 169.920 >> scientist[3].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[3].ped, scientist[3].scene_id, "missfbi5ig_17", "walk_in_aim_scientista", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS) scientist_3_ai_system_status++ endif break case 3 if is_synchronized_scene_running(scientist[3].scene_id) if has_anim_event_fired(scientist[3].ped, get_hash_key("Prop_Detach")) detach_scientist_3_assets() scientist_3_ai_system_status++ endif endif break case 4 if is_synchronized_scene_running(scientist[3].scene_id) if get_synchronized_scene_phase(scientist[3].scene_id) >= 1.0 //if has_anim_event_fired(scientist[3].ped, get_hash_key("Prop_Detach")) scene_pos = << 3533.920, 3662.750, 28.118 >> scene_rot = << 0.000, 0.000, 169.920 >> scientist[3].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[3].ped, scientist[3].scene_id, "missfbi5ig_17", "walk_in_aim_loop_scientista", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS) set_synchronized_scene_looped(scientist[3].scene_id, true) endif endif break case 5 manage_ped_hands_up_system(scientist[3].ped, <<3538.74, 3664.09, 27.12>>) break endswitch if scientist_3_ai_system_status > 3 if not has_label_been_triggered("fbi5a_cower7") if not is_any_text_being_displayed(locates_data) if CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_cower7", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_cower7", true) endif endif else if not has_label_been_triggered("fbi5a_dia5h") if not is_any_text_being_displayed(locates_data) if is_ped_injured(scientist[2].ped) if CREATE_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_dia5h", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia5h", true) endif endif endif endif endif endif if HAS_PED_BEEN_TAZERED_BY_PED(scientist[3].ped, dave.ped) setup_tazor_kill_for_ped(scientist[3]) endif kill_ped_on_certain_damage(scientist[3]) else store_alarm_time() if scientist[3].created store_alarm_time() if not scientist[5].created //stops the clipboard and pencil being cleaned when created for scientist[5] if does_entity_exist(clip_board.obj) detach_entity(clip_board.obj) set_object_as_no_longer_needed(clip_board.obj) //set_model_as_no_longer_needed(clip_board.model) endif if does_entity_exist(pencil.obj) detach_entity(pencil.obj) set_object_as_no_longer_needed(pencil.obj) //set_model_as_no_longer_needed(pencil.model) endif endif endif endif endproc proc scientist_4_ai_system() if not is_ped_injured(scientist[4].ped) switch scientist_4_ai_system_status case 0 request_anim_dict("missfbi5ig_20b") if has_anim_dict_loaded("missfbi5ig_20b") scene_pos = << 3558.880, 3677.870, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> scientist[4].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[4].ped, scientist[4].scene_id, "missfbi5ig_20b", "do_experiment_idle_scientist", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, NORMAL_BLEND_IN) set_synchronized_scene_looped(scientist[4].scene_id, true) scientist_4_ai_system_status++ endif break case 1 if open_door_with_security_card_cutscene_status > 22 scene_pos = << 3558.880, 3677.870, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> scientist[4].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[4].ped, scientist[4].scene_id, "missfbi5ig_20b", "ask_open_door_scientist", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, NORMAL_BLEND_IN) scientist_4_ai_system_status++ endif // if HAS_LABEL_BEEN_TRIGGERED("fbi5adoor0") // // open_sequence_task(seq) // task_look_at_entity(null, dave.ped, -1) // task_turn_ped_to_face_entity(null, dave.ped) // TASK_PLAY_ANIM(null, "ped", "handsup", NORMAL_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_PRIORITY_HIGH | AF_UPPERBODY) // task_play_anim(null, "missheat", "Dazed_Guard_Loop", normal_blend_in, normal_blend_out, -1, AF_SECONDARY | AF_PRIORITY_HIGH | AF_UPPERBODY | AF_LOOPING) // close_sequence_task(seq) // task_perform_sequence(scientist[4].ped, seq) // clear_sequence_task(seq) // // scientist_4_ai_system_status++ // // endif break case 2 if is_synchronized_scene_running(scientist[4].scene_id) if get_synchronized_scene_phase(scientist[4].scene_id) >= 1.0 scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> scientist[4].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[4].ped, scientist[4].scene_id, "missfbi5ig_20b", "hands_up_scientist", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, NORMAL_BLEND_IN) set_synchronized_scene_looped(scientist[4].scene_id, true) scientist_4_ai_system_status++ endif endif break case 3 request_anim_dict("missfbi5ig_22") if has_anim_dict_loaded("missfbi5ig_22") if HAS_LABEL_BEEN_TRIGGERED("fbi5a_dia21") or HAS_LABEL_BEEN_TRIGGERED("fbi5a_dia21b") //if IS_ANY_CONVERSATION_ONGOING_OR_QUEUED() scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> scientist[4].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[4].ped, scientist[4].scene_id, "missfbi5ig_22", "aim_scientist_walkout_scientist", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, NORMAL_BLEND_IN) scientist_4_ai_system_status++ //endif endif endif break case 4 if not has_label_been_triggered("fbi5a_jab") if has_label_been_triggered("fbi5a_dia21") or has_label_been_triggered("fbi5a_dia21b") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_jab", conv_priority_medium) set_label_as_triggered("fbi5a_jab", true) endif endif endif // endif // endif // if not is_entity_at_coord(scientist[4].ped, <<3558.5271, 3669.7112, 27.1230>>, <<1.5, 1.5, 2.0>>) // if has_ped_task_finished_2(scientist[4].ped) // // open_sequence_task(seq) // task_follow_nav_mesh_to_coord(null, <<3558.5271, 3669.7112, 27.1230>>, -1) // close_sequence_task(seq) // task_perform_sequence(scientist[4].ped, seq) // clear_sequence_task(seq) // // endif if is_synchronized_scene_running(scientist[4].scene_id) if get_synchronized_scene_phase(scientist[4].scene_id) > 0.4 move_door(V_ILev_Bl_DoorSL_R, <<3557.6, 3669.2, 27.1>>) chemicals.blip = CREATE_BLIP_FOR_OBJECT(chemicals.obj) set_blip_scale(chemicals.blip, 1.0) set_entity_proofs(scientist[4].ped, false, false, false, false, false, false, false, false) scientist_4_ai_system_status++ endif endif break case 5 //if move_door(V_ILev_Bl_DoorSL_R, <<3557.6, 3669.2, 27.1>>) if move_door_with_new_door_system(fbi_5_door[13]) scientist_4_ai_system_status++ endif break case 6 if is_synchronized_scene_running(scientist[4].scene_id) if get_synchronized_scene_phase(scientist[4].scene_id) >= 1.0 scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> scientist[4].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[4].ped, scientist[4].scene_id, "missfbi5ig_22", "hands_up_anxious_scientist", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS) set_synchronized_scene_looped(scientist[4].scene_id, true) //task_hands_up(scientist[4].ped, -1) scientist_4_ai_system_status++ endif endif break case 7 if not IS_PED_RAGDOLL(scientist[4].ped) and not IS_PED_DEAD_OR_DYING(scientist[4].ped) scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> if not is_synchronized_scene_running(scientist[4].scene_id) scientist[4].run_to_pos = get_anim_initial_offset_position("missfbi5ig_22", "hands_up_anxious_scientist", scene_pos, scene_rot, 1.0) scientist[4].rot = get_anim_initial_offset_rotation("missfbi5ig_22", "hands_up_anxious_scientist", scene_pos, scene_rot, 1.0) if not is_entity_playing_anim(scientist[4].ped, "missfbi5ig_22", "hands_up_anxious_scientist") if not is_entity_playing_anim(scientist[4].ped, "ped", "handsup_base") if not is_entity_playing_anim(scientist[4].ped, "ped", "handsup") TASK_PLAY_ANIM(scientist[4].ped, "ped", "handsup", NORMAL_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING) else if GET_ENTITY_ANIM_CURRENT_TIME(scientist[4].ped, "ped", "handsup") > 0.99 TASK_PLAY_ANIM(scientist[4].ped, "ped", "handsup_base", instant_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING) endif endif endif else if get_entity_anim_current_time(scientist[4].ped, "missfbi5ig_22", "hands_up_anxious_scientist") > 0.1 if is_entity_playing_anim(scientist[4].ped, "ped", "handsup") STOP_ANIM_TASK(scientist[4].ped, "ped", "handsup") endif if is_entity_playing_anim(scientist[4].ped, "ped", "handsup_base") STOP_ANIM_TASK(scientist[4].ped, "ped", "handsup_base") endif endif endif if not is_entity_at_coord(scientist[4].ped, scientist[4].run_to_pos, <<0.5, 0.5, 2.0>>) or not is_entity_playing_anim(scientist[4].ped, "missfbi5ig_22", "hands_up_anxious_scientist") if has_ped_task_finished_2(scientist[4].ped, script_task_perform_sequence, 1) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, scientist[4].run_to_pos, pedmove_walk, -1, 0.1, enav_default, scientist[4].rot.z) TASK_PLAY_ANIM_advanced(null, "missfbi5ig_22", "hands_up_anxious_scientist", scientist[4].run_to_pos, scientist[4].rot, normal_blend_in, NORMAL_BLEND_OUT, -1, AF_LOOPING | AF_EXIT_AFTER_INTERRUPTED) close_sequence_task(seq) task_perform_sequence(scientist[4].ped, seq) clear_sequence_task(seq) endif endif endif //synced scene running will stop the above check from running if not scientist_5_dead if is_ped_injured(scientist[5].ped) if is_entity_at_coord(scientist[4].ped, get_anim_initial_offset_position("missfbi5ig_22", "hands_up_shocked_scientist", scene_pos, scene_rot, 1.0), <<0.5, 0.5, 2.0>>) scientist[4].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[4].ped, scientist[4].scene_id, "missfbi5ig_22", "hands_up_shocked_scientist", slow_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, rbf_none, slow_blend_in) scientist_4_ai_system_status++ endif scientist_5_dead = true endif endif endif switch e_mission_stage case STAGE_FIND_CHEMICALS if has_label_been_triggered("GET_CHEMS")//get cnerve toxin god text if not is_any_text_being_displayed(locates_data) if lk_timer(scientist_time[4], 15000) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_cower6", CONV_PRIORITY_medium) //set_label_as_triggered("fbi5a_cower1", true) scientist_time[4] = get_game_timer() endif endif endif endif break case stage_shootout break endswitch break case 8 if is_synchronized_scene_running(scientist[4].scene_id) if get_synchronized_scene_phase(scientist[4].scene_id) >= 1.0 if is_entity_playing_anim(scientist[4].ped, "missfbi5ig_22", "hands_up_shocked_scientist") scientist[4].run_to_pos = get_anim_initial_offset_position("missfbi5ig_22", "hands_up_anxious_scientist", scene_pos, scene_rot, 1.0) scientist[4].rot = get_anim_initial_offset_rotation("missfbi5ig_22", "hands_up_anxious_scientist", scene_pos, scene_rot, 1.0) TASK_PLAY_ANIM_advanced(scientist[4].ped, "missfbi5ig_22", "hands_up_anxious_scientist", scientist[4].run_to_pos, scientist[4].rot, normal_blend_in, NORMAL_BLEND_OUT, -1, AF_LOOPING | AF_EXIT_AFTER_INTERRUPTED) scientist_4_ai_system_status = 7 endif endif else scientist_4_ai_system_status = 7 endif break endswitch if IS_PED_RAGDOLL(scientist[4].ped) // if is_entity_playing_anim(scientist[4].ped, "missheat", "Dazed_Guard_Loop") // STOP_ANIM_TASK(scientist[4].ped, "missheat", "Dazed_Guard_Loop") // endif endif if HAS_PED_BEEN_TAZERED_BY_PED(scientist[4].ped, dave.ped) set_entity_health(scientist[4].ped, 2) endif else if scientist[4].created if e_mission_stage = STAGE_FIND_CHEMICALS //only want to add blip if scientst dead in this stage. Not in shootout stage. if does_entity_exist(chemicals.obj) if move_door_with_new_door_system(fbi_5_door[13]) if not does_blip_exist(chemicals.blip) chemicals.blip = CREATE_BLIP_FOR_OBJECT(chemicals.obj) set_blip_scale(chemicals.blip, 1.0) endif endif endif endif endif endif endproc proc cleanup_clip_board_and_pencil_assets() if does_entity_exist(clip_board.obj) if is_entity_attached(clip_board.obj) detach_entity(clip_board.obj) endif set_object_as_no_longer_needed(clip_board.obj) set_model_as_no_longer_needed(clip_board.model) endif if does_entity_exist(pencil.obj) if is_entity_attached(pencil.obj) detach_entity(pencil.obj) endif set_object_as_no_longer_needed(pencil.obj) set_model_as_no_longer_needed(pencil.model) endif endproc proc scientist_5_ai_system() if not is_ped_injured(scientist[5].ped) if scientist_5_ai_system_status != 4 if is_ped_ragdoll(scientist[5].ped) //store_alarm_time() cleanup_clip_board_and_pencil_assets() scientist_5_ai_system_status = 4 endif endif //move_doors_with_new_door_system(fbi_5_door[16], fbi_5_door[17], true, 0.7) //move_doors_with_new_door_system(fbi_5_door[14], fbi_5_door[15], true, 0.7) switch scientist_5_ai_system_status case 0 request_anim_dict("missfbi5ig_21") if has_anim_dict_loaded("missfbi5ig_21") if is_synchronized_scene_running(steve.scene_id) if is_entity_playing_anim(steve.ped, "missfbi5ig_21", "holdup_hallway_steve") or steve_ai_system_1_status >= 12 PLAY_SOUND_FROM_ENTITY(-1, "Scientist_Approaching", scientist[5].ped, "FBI_05_SOUNDS") scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> scientist[5].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[5].ped, scientist[5].scene_id, "missfbi5ig_21", "holdup_hallway_scientist", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT) // unlock door 15 & 16 DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[16], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[16], DOORSTATE_unlocked, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[17], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[17], DOORSTATE_unlocked, false, true) scientist_5_ai_system_status++ endif endif endif break case 1 if is_synchronized_scene_running(scientist[5].scene_id) if get_synchronized_scene_phase(scientist[5].scene_id) > 0.5 move_doors_with_new_door_system(fbi_5_door[16], fbi_5_door[17], false, 0.7) endif if get_synchronized_scene_phase(scientist[5].scene_id) > 0.85 scientist[5].blip = CREATE_BLIP_FOR_PED(scientist[5].ped, true) set_entity_proofs(scientist[5].ped, false, false, false, false, false) scientist_5_ai_system_status++ endif endif break case 2 if is_synchronized_scene_running(scientist[5].scene_id) if get_synchronized_scene_phase(scientist[5].scene_id) >= 1.0 scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> if is_entity_in_angled_area(player_ped_id(), <<3554.461, 3680.366, 27.122>> , <<3558.623, 3679.670, 30.122>>, 3.3) scientist[5].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[5].ped, scientist[5].scene_id, "missfbi5ig_21", "holdup_hallway_saw_player_scientist", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, rbf_none, normal_blend_in) else scientist[5].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[5].ped, scientist[5].scene_id, "missfbi5ig_21", "holdup_hallway_saw_steve_scientist", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, rbf_none, normal_blend_in) endif scientist_5_ai_system_status++ endif endif break case 3 if is_synchronized_scene_running(scientist[5].scene_id) if get_synchronized_scene_phase(scientist[5].scene_id) >= 1.0 scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> scientist[5].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[5].ped, scientist[5].scene_id, "missfbi5ig_21", "hands_up_anxious_scientist", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, rbf_none, normal_blend_in) set_synchronized_scene_looped(scientist[5].scene_id, true) scientist_5_ai_system_status++ endif if does_entity_exist(clip_board.obj) if is_entity_playing_anim(scientist[5].ped, "missfbi5ig_21", "holdup_hallway_saw_player_scientist") if get_synchronized_scene_phase(scientist[5].scene_id) >= 0.05 cleanup_clip_board_and_pencil_assets() endif elif is_entity_playing_anim(scientist[5].ped, "missfbi5ig_21", "holdup_hallway_saw_steve_scientist") if get_synchronized_scene_phase(scientist[5].scene_id) >= 0.125 cleanup_clip_board_and_pencil_assets() endif endif endif else //player shoots scientist with WEAPONTYPE_DLC_FIREWORK and causes a damage event which stops the synced scene. scientist_5_ai_system_status = 4 cleanup_clip_board_and_pencil_assets() cleanup_clip_board_and_pencil_assets() endif break case 4 // move_doors_with_new_door_system(fbi_5_door[14], fbi_5_door[15], true, 0.7) if not IS_PED_RAGDOLL(scientist[5].ped) and not IS_PED_DEAD_OR_DYING(scientist[5].ped) scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> if not is_synchronized_scene_running(scientist[5].scene_id) scientist[5].run_to_pos = get_anim_initial_offset_position("missfbi5ig_21", "hands_up_anxious_scientist", scene_pos, scene_rot, 1.0) scientist[5].rot = get_anim_initial_offset_rotation("missfbi5ig_21", "hands_up_anxious_scientist", scene_pos, scene_rot, 1.0) if not is_entity_playing_anim(scientist[5].ped, "missfbi5ig_21", "hands_up_anxious_scientist") if not is_entity_playing_anim(scientist[5].ped, "ped", "handsup_base") if not is_entity_playing_anim(scientist[5].ped, "ped", "handsup") TASK_PLAY_ANIM(scientist[5].ped, "ped", "handsup", NORMAL_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING) else if GET_ENTITY_ANIM_CURRENT_TIME(scientist[5].ped, "ped", "handsup") > 0.99 TASK_PLAY_ANIM(scientist[5].ped, "ped", "handsup_base", instant_BLEND_IN, NORMAL_BLEND_OUT, -1, AF_SECONDARY | AF_UPPERBODY | AF_LOOPING) endif endif endif else if get_entity_anim_current_time(scientist[5].ped, "missfbi5ig_21", "hands_up_anxious_scientist") > 0.1 if is_entity_playing_anim(scientist[5].ped, "ped", "handsup") STOP_ANIM_TASK(scientist[5].ped, "ped", "handsup") endif if is_entity_playing_anim(scientist[5].ped, "ped", "handsup_base") STOP_ANIM_TASK(scientist[5].ped, "ped", "handsup_base") endif endif endif if not is_entity_at_coord(scientist[5].ped, scientist[5].run_to_pos, <<0.5, 0.5, 2.0>>) or not is_entity_playing_anim(scientist[5].ped, "missfbi5ig_21", "hands_up_anxious_scientist") if has_ped_task_finished_2(scientist[5].ped, script_task_perform_sequence, 1) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, scientist[5].run_to_pos, pedmove_walk, -1, 0.1, enav_default, scientist[5].rot.z) TASK_PLAY_ANIM_advanced(null, "missfbi5ig_21", "hands_up_anxious_scientist", scientist[5].run_to_pos, scientist[5].rot, normal_blend_in, NORMAL_BLEND_OUT, -1, AF_LOOPING | AF_EXIT_AFTER_INTERRUPTED) close_sequence_task(seq) task_perform_sequence(scientist[5].ped, seq) clear_sequence_task(seq) endif endif endif if not scientist_4_dead if is_ped_injured(scientist[4].ped) if is_entity_at_coord(scientist[5].ped, get_anim_initial_offset_position("missfbi5ig_21", "hands_up_shocked_scientist", scene_pos, scene_rot, 1.0), <<0.5, 0.5, 2.0>>) scientist[5].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[5].ped, scientist[5].scene_id, "missfbi5ig_21", "hands_up_shocked_scientist", slow_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, rbf_none, slow_blend_in) endif scientist_4_dead = true endif else if is_synchronized_scene_running(scientist[5].scene_id) if get_synchronized_scene_phase(scientist[5].scene_id) >= 1.0 if is_entity_playing_anim(scientist[5].ped, "missfbi5ig_21", "hands_up_shocked_scientist") scientist[5].run_to_pos = get_anim_initial_offset_position("missfbi5ig_21", "hands_up_anxious_scientist", scene_pos, scene_rot, 1.0) scientist[5].rot = get_anim_initial_offset_rotation("missfbi5ig_21", "hands_up_anxious_scientist", scene_pos, scene_rot, 1.0) TASK_PLAY_ANIM_advanced(scientist[5].ped, "missfbi5ig_21", "hands_up_anxious_scientist", scientist[5].run_to_pos, scientist[5].rot, normal_blend_in, NORMAL_BLEND_OUT, -1, AF_LOOPING | AF_EXIT_AFTER_INTERRUPTED) endif endif endif endif switch e_mission_stage case STAGE_FIND_CHEMICALS if has_label_been_triggered("GET_CHEMS")//get cnerve toxin god text if not is_any_text_being_displayed(locates_data) if lk_timer(scientist_time[5], 30000) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_cower1", CONV_PRIORITY_medium) //set_label_as_triggered("fbi5a_cower1", true) scientist_time[5] = get_game_timer() endif endif endif endif break case stage_shootout break endswitch endif break endswitch if IS_PED_RAGDOLL(scientist[5].ped) // if is_entity_playing_anim(scientist[5].ped, "missheat", "Dazed_Guard_Loop") // STOP_ANIM_TASK(scientist[5].ped, "missheat", "Dazed_Guard_Loop") // endif endif if HAS_PED_BEEN_TAZERED_BY_PED(scientist[5].ped, steve.ped) set_entity_health(scientist[5].ped, 2) endif else if scientist[5].created //if does_entity_exist(clip_board.obj) cleanup_clip_board_and_pencil_assets() //endif endif endif endproc proc move_doors_14_and_15_system() switch move_doors_14_and_15_system_status case 0 if scientist[5].created if is_synchronized_scene_running(scientist[5].scene_id) if get_synchronized_scene_phase(scientist[5].scene_id) > 0.85 move_doors_with_new_door_system(fbi_5_door[14], fbi_5_door[15], true, 0.7) move_doors_14_and_15_system_status++ endif endif endif break case 1 if move_doors_with_new_door_system(fbi_5_door[14], fbi_5_door[15], true, 0.7) move_doors_14_and_15_system_status++ endif break case 2 break endswitch endproc proc security_guard_ai_system() int i for i = 0 to count_of(security_guard) - 1 if not is_ped_injured(security_guard[i].ped) switch security_guard_ai_system_status[i] case attack_phase_0 switch i case 0 SET_PED_RESET_FLAG(security_guard[i].ped, PRF_ConsiderAsPlayerCoverThreatWithoutLOS, true) request_anim_dict("missfbi5misc") if has_anim_dict_loaded("missfbi5misc") //if is_entity_in_angled_area(player_ped_id(), <<3566.335, 3684.536, 27.127>>, <<3565.776, 3681.081, 30.227>>, 3.5)//3.5 if(is_entity_in_angled_area(player_ped_id(), <<3566.335, 3684.536, 27.127>>, <<3565.776, 3681.081, 30.227>>, 3.9) and is_sphere_visible(<<3567.2, 3696.0, 28.4>>, 2.0)) or is_entity_in_angled_area(player_ped_id(), <<3564.522, 3685.620, 27.122>>, <<3568.162, 3684.958, 29.722>>, 1.4) scene_pos = <<3563.842, 3694.651, 28.101>> scene_rot = <<0.000, 0.000, -178.000>> //open_sequence_task(seq) task_play_anim_advanced(security_guard[i].ped, "missfbi5misc", "plyr_roll_left", scene_pos, scene_rot, instant_blend_in, slow_blend_out, -1, AF_OVERRIDE_PHYSICS, 0.0, EULER_YXZ, AIK_DISABLE_LEG_IK) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif endif break case 2 case 3 case 7 case 15 set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 1.0) //1.0 task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = get_to_attack_phase_0 break case 16 SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_DISABLE_SEEK_DUE_TO_LINE_OF_SIGHT, false)//fix for bug 1506176 set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 1.0) //1.0 task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = get_to_attack_phase_0 break //current start pos case 4 case 5 case 10 case 13 case 24 set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].pos, 2.0) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = attack_phase_1 break case 8 set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 1.0) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_REMOVE_AREA_SET_WILL_ADVANCE_WHEN_DEFENSIVE_AREA_REACHED, TRUE) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = do_nothing break case 1 case 17 case 18 case 21 case 22 case 32 case 33 if i = 1 SET_PED_RESET_FLAG(security_guard[i].ped, PRF_ConsiderAsPlayerCoverThreatWithoutLOS, true) endif open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), 2.0, true) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_0 break case 6 //door way area box if is_entity_in_angled_area(player_ped_id(), <<3568.042, 3692.851, 27.129>>, <<3568.892, 3696.966, 30.126>>, 1.500) open_sequence_task(seq) task_pause(null, 2500) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), 1.5, true) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break case 9 if is_entity_in_angled_area(player_ped_id(), <<3595.197, 3692.011, 27.828>>, <<3597.873, 3695.875, 30.828>>, 2.100) SET_COMBAT_FLOAT(security_guard[i].ped, CCF_STRAFE_WHEN_MOVING_CHANCE, 1.0) SET_COMBAT_FLOAT(security_guard[i].ped, CCF_WALK_WHEN_STRAFING_CHANCE, 0.0) set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 1.0) //1.0 task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break case 11 case 12 if is_entity_in_angled_area(player_ped_id(), <<3583.195, 3699.724, 27.828>>, <<3586.471, 3697.429, 30.828>>, 5.8) open_sequence_task(seq) task_pause(null, 500) TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(null, false) TASK_SET_SPHERE_DEFENSIVE_AREA(null, security_guard[i].run_to_pos, 2.0) task_combat_hated_targets_around_ped(null, 200.00) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break case 14 if is_entity_in_angled_area(player_ped_id(), <<3583.195, 3699.724, 27.828>>, <<3586.471, 3697.429, 30.828>>, 5.8) open_sequence_task(seq) task_pause(null, 500) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), 2.0, true) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break case 19 if is_vehicle_driveable(army_truck[0].veh) if is_playback_going_on_for_vehicle(army_truck[0].veh) if ((get_time_position_in_recording(army_truck[0].veh) + 500) > GET_TOTAL_DURATION_OF_VEHICLE_RECORDING(army_truck[0].recording_number, "lkfbi5a")) stop_playback_recorded_vehicle(army_truck[0].veh) set_vehicle_engine_on(army_truck[0].veh, false, false) open_sequence_task(seq) task_leave_vehicle(null, army_truck[0].veh, ecf_dont_close_door) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), pedmove_run, true, 0.5, 0.8) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif endif else security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break case 20 if is_vehicle_driveable(army_truck[0].veh) if not is_playback_going_on_for_vehicle(army_truck[0].veh) open_sequence_task(seq) task_pause(null, 300) task_leave_vehicle(null, army_truck[0].veh, ecf_dont_close_door) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), pedmove_run, true, 0.5, 0.8) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif else security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break case 23 if is_vehicle_driveable(army_truck[0].veh) if not is_playback_going_on_for_vehicle(army_truck[0].veh) set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 2.0) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_REMOVE_AREA_SET_WILL_ADVANCE_WHEN_DEFENSIVE_AREA_REACHED, TRUE) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = do_nothing endif else security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break case 25 set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].pos, 2.0) set_ped_sphere_defensive_area(security_guard[i].ped, <<3623.8704, 3731.5371, 27.6895>>, 2.0, false, true) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_REMOVE_AREA_SET_WILL_ADVANCE_WHEN_DEFENSIVE_AREA_REACHED, TRUE) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = attack_phase_1 break case 26 if is_vehicle_driveable(army_truck[1].veh) if not is_playback_going_on_for_vehicle(army_truck[1].veh) open_sequence_task(seq) task_pause(null, 550) task_leave_vehicle(null, army_truck[1].veh, ecf_dont_close_door) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), pedmove_run, true, 0.5, 0.8) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif else security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break case 27 if is_vehicle_driveable(army_truck[1].veh) if not is_playback_going_on_for_vehicle(army_truck[1].veh) open_sequence_task(seq) task_pause(null, 750) task_leave_vehicle(null, army_truck[1].veh, ecf_dont_close_door) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), pedmove_run, true, 0.5, 0.8) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif else security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break case 28 if is_vehicle_driveable(army_truck[2].veh) if is_playback_going_on_for_vehicle(army_truck[2].veh) if ((get_time_position_in_recording(army_truck[2].veh) + 500) > GET_TOTAL_DURATION_OF_VEHICLE_RECORDING(army_truck[2].recording_number, "lkfbi5a")) stop_playback_recorded_vehicle(army_truck[2].veh) open_sequence_task(seq) task_leave_vehicle(null, army_truck[2].veh, ecf_dont_close_door) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), pedmove_run, true, 0.5, 0.8) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif endif else security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break case 29 if is_vehicle_driveable(army_truck[2].veh) if not is_playback_going_on_for_vehicle(army_truck[2].veh) open_sequence_task(seq) task_pause(null, 300) task_leave_vehicle(null, army_truck[2].veh, ecf_dont_close_door) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), pedmove_run, true, 0.5, 0.8) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif else security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break case 30 if is_vehicle_driveable(army_truck[2].veh) if not is_playback_going_on_for_vehicle(army_truck[2].veh) open_sequence_task(seq) task_pause(null, 550) task_leave_vehicle(null, army_truck[2].veh, ecf_dont_close_door) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), pedmove_run, true, 0.5, 0.8) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif else security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break case 31 if is_vehicle_driveable(army_truck[2].veh) if not is_playback_going_on_for_vehicle(army_truck[2].veh) open_sequence_task(seq) task_pause(null, 750) task_leave_vehicle(null, army_truck[2].veh, ecf_dont_close_door) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), pedmove_run, true, 0.5, 0.8) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_0 endif else security_guard_ai_system_status[i] = get_to_attack_phase_0 endif break endswitch break case get_to_attack_phase_0 switch i case 0 SET_PED_RESET_FLAG(security_guard[i].ped, PRF_ConsiderAsPlayerCoverThreatWithoutLOS, true) if (is_entity_playing_anim(security_guard[0].ped, "missfbi5misc", "plyr_roll_left") and GET_ENTITY_ANIM_CURRENT_TIME(security_guard[0].ped, "missfbi5misc", "plyr_roll_left") > 0.99) or not is_entity_playing_anim(security_guard[0].ped, "missfbi5misc", "plyr_roll_left") if is_entity_playing_anim(security_guard[0].ped, "missfbi5misc", "plyr_roll_left") set_ped_reset_flag(security_guard[0].ped, PRF_InstantBlendToAim, true) endif set_ped_sphere_defensive_area(security_guard[i].ped, <<3565.8367, 3691.8591, 27.1217>>, 1.0) set_blocking_of_non_temporary_events(security_guard[i].ped, false) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_REMOVE_AREA_SET_WILL_ADVANCE_WHEN_DEFENSIVE_AREA_REACHED, TRUE) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = do_nothing endif break case 2 case 3 case 7 case 9 case 15 case 16 if is_entity_at_coord(security_guard[i].ped, security_guard[i].run_to_pos, <<1.5, 1.5, 2.0>>) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 10) set_ped_combat_movement(security_guard[i].ped, CM_WILLADVANCE) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = do_nothing endif break case 1 case 6 case 12 case 17 case 18 case 23 case 24 case 25 case 26 case 27 case 28 case 29 case 30 case 31 case 32 case 33 if not is_entity_at_coord(security_guard[i].ped, security_guard[i].run_to_pos, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(security_guard[i].ped) clear_ped_tasks(security_guard[i].ped) open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), 2.0, true) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) endif else set_blocking_of_non_temporary_events(security_guard[i].ped, false) switch i case 1 SET_PED_RESET_FLAG(security_guard[i].ped, PRF_ConsiderAsPlayerCoverThreatWithoutLOS, true) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 1.5) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_REMOVE_AREA_SET_WILL_ADVANCE_WHEN_DEFENSIVE_AREA_REACHED, TRUE) break case 3 set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 2.0) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_OPEN_COMBAT_WHEN_DEFENSIVE_AREA_IS_REACHED, true) break case 6 set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 10.0) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_REMOVE_AREA_SET_WILL_ADVANCE_WHEN_DEFENSIVE_AREA_REACHED, TRUE) break default set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 2.0) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_REMOVE_AREA_SET_WILL_ADVANCE_WHEN_DEFENSIVE_AREA_REACHED, TRUE) break endswitch SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = do_nothing endif break case 11 if is_entity_at_coord(security_guard[i].ped, security_guard[i].run_to_pos, <<1.5, 1.5, 2.0>>) set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 10) set_ped_combat_movement(security_guard[i].ped, CM_WILLADVANCE) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = attack_phase_1 endif break case 14 case 19 case 20 case 21 case 22 if not is_entity_at_coord(security_guard[i].ped, security_guard[i].run_to_pos, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(security_guard[i].ped) clear_ped_tasks(security_guard[i].ped) open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), 2.0, true) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) endif else set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 2.0) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_REMOVE_AREA_SET_WILL_ADVANCE_WHEN_DEFENSIVE_AREA_REACHED, TRUE) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = attack_phase_1 endif break endswitch break case attack_phase_1 switch i case 4 if is_ped_injured(security_guard[2].ped) security_guard[i].run_to_pos = security_guard[2].pos set_blocking_of_non_temporary_events(security_guard[i].ped, false) SET_COMBAT_FLOAT(security_guard[i].ped, CCF_STRAFE_WHEN_MOVING_CHANCE, 1.0) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 2.0) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = get_to_attack_phase_1 elif is_ped_injured(security_guard[3].ped) security_guard[i].run_to_pos = security_guard[3].run_to_pos set_blocking_of_non_temporary_events(security_guard[i].ped, false) SET_COMBAT_FLOAT(security_guard[i].ped, CCF_STRAFE_WHEN_MOVING_CHANCE, 1.0) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 2.0) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = get_to_attack_phase_1 endif break case 5 if (is_ped_injured(security_guard[2].ped) and is_ped_injured(security_guard[3].ped)) or is_ped_injured(security_guard[4].ped) security_guard[i].run_to_pos = <<3580.17, 3692.23, 26.12>> set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 2.0)//20.00 task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = get_to_attack_phase_1 endif break case 10 if is_entity_in_angled_area(player_ped_id(), <<3583.195, 3699.724, 27.828>>, <<3586.471, 3697.429, 30.828>>, 5.8) set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 10) set_ped_combat_movement(security_guard[i].ped, CM_WILLADVANCE) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = do_nothing endif break case 11 if is_ped_injured(security_guard[10].ped) security_guard[i].run_to_pos = <<3592.3342, 3706.5149, 28.6908>> set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 1.0) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = get_to_attack_phase_1 endif break case 13 if is_ped_injured(security_guard[11].ped) set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 2.0)//20.00 task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = get_to_attack_phase_1 endif break case 14 if is_ped_injured(security_guard[10].ped) set_blocking_of_non_temporary_events(security_guard[i].ped, true) clear_ped_tasks(security_guard[i].ped) open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), 2.0, true) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_1 endif break case 19 if is_ped_injured(security_guard[17].ped) set_blocking_of_non_temporary_events(security_guard[i].ped, true) clear_ped_tasks(security_guard[i].ped) security_guard[i].run_to_pos = security_guard[17].run_to_pos open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), 2.0, true) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_1 endif break case 20 if is_ped_injured(security_guard[23].ped) set_blocking_of_non_temporary_events(security_guard[i].ped, true) clear_ped_tasks(security_guard[i].ped) security_guard[i].run_to_pos = security_guard[23].run_to_pos open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), 2.0, true) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_1 endif break case 21 if is_ped_injured(security_guard[18].ped) set_blocking_of_non_temporary_events(security_guard[i].ped, true) clear_ped_tasks(security_guard[i].ped) security_guard[i].run_to_pos = security_guard[18].run_to_pos open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), 2.0, true) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_1 endif break case 22 if is_ped_injured(security_guard[20].ped) set_blocking_of_non_temporary_events(security_guard[i].ped, true) clear_ped_tasks(security_guard[i].ped) security_guard[i].run_to_pos = <<3623.7, 3739.14, 27.6917>> open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), 2.0, true) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) security_guard_ai_system_status[i] = get_to_attack_phase_1 endif break case 24 break case 25 break endswitch break case get_to_attack_phase_1 switch i case 4 case 11 if is_entity_at_coord(security_guard[i].ped, security_guard[i].run_to_pos, <<1.5, 1.5, 2.0>>) set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 10) set_ped_combat_movement(security_guard[i].ped, CM_WILLADVANCE) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = do_nothing endif break case 5 if is_entity_at_coord(security_guard[i].ped, security_guard[i].run_to_pos, <<1.5, 1.5, 1.5>>) if is_ped_injured(security_guard[2].ped) and is_ped_injured(security_guard[3].ped) //stops guard 5 going to the same place as guard 4 if ARE_VECTORS_EQUAL(security_guard[4].run_to_pos, security_guard[3].run_to_pos) security_guard[i].run_to_pos = security_guard[2].run_to_pos else security_guard[i].run_to_pos = security_guard[3].run_to_pos endif set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 2.0) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = get_to_attack_phase_2 else //guard 4 must be dead. //in order for 4 to run 2 or 3 must have been killed set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 2.0) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) if is_ped_injured(security_guard[2].ped) security_guard[i].run_to_pos = security_guard[2].run_to_pos else security_guard[i].run_to_pos = security_guard[3].run_to_pos endif security_guard_ai_system_status[i] = get_to_attack_phase_2 endif endif break case 13 if is_entity_at_coord(security_guard[i].ped, security_guard[i].run_to_pos, <<1.5, 1.5, 2.0>>) set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 10) set_ped_combat_movement(security_guard[i].ped, CM_WILLADVANCE) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = do_nothing endif break case 14 case 19 case 20 case 21 case 22 if not is_entity_at_coord(security_guard[i].ped, security_guard[i].run_to_pos, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(security_guard[i].ped) clear_ped_tasks(security_guard[i].ped) set_blocking_of_non_temporary_events(security_guard[i].ped, true) open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(null, security_guard[i].run_to_pos, player_ped_id(), 2.0, true) close_sequence_task(seq) task_perform_sequence(security_guard[i].ped, seq) clear_sequence_task(seq) endif else set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 2.0) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_REMOVE_AREA_SET_WILL_ADVANCE_WHEN_DEFENSIVE_AREA_REACHED, TRUE) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = do_nothing endif break endswitch break case get_to_attack_phase_2 switch i case 5 if is_entity_at_coord(security_guard[i].ped, security_guard[i].run_to_pos, <<1.5, 1.5, 2.0>>) set_blocking_of_non_temporary_events(security_guard[i].ped, false) set_ped_sphere_defensive_area(security_guard[i].ped, security_guard[i].run_to_pos, 10) set_ped_combat_movement(security_guard[i].ped, CM_WILLADVANCE) SET_PED_COMBAT_ATTRIBUTES(security_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(security_guard[i].ped, 200.00) security_guard_ai_system_status[i] = do_nothing endif break endswitch break case do_nothing break endswitch endif endfor endproc proc open_lab_doors() switch open_lab_doors_status case 0 if is_synchronized_scene_running(players_scene_id) if get_synchronized_scene_phase(players_scene_id) > 0.6 //move_doors(V_ILEV_BL_DOORSL_L, <<3552.87, 3665.25, 27.12>>, V_ILEV_BL_DOORSL_R, <<3555.44, 3664.8, 27.12>>) move_doors_with_new_door_system(fbi_5_door[11], fbi_5_door[12]) open_lab_doors_status++ endif endif break case 1 //if move_doors(V_ILEV_BL_DOORSL_L, <<3552.87, 3665.25, 27.12>>, V_ILEV_BL_DOORSL_R, <<3555.44, 3664.8, 27.12>>) if move_doors_with_new_door_system(fbi_5_door[11], fbi_5_door[12]) open_lab_doors_status++ endif break endswitch endproc func bool open_door_with_security_card_cutscene() open_lab_doors() switch open_door_with_security_card_cutscene_status case 0 if is_ped_in_specific_room(player_ped_id(), <<3552.6628, 3662.5032, 27.1217>>, "lab_hazmat1") request_anim_dict("missfbi5ig_20b") REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05_GRAB_TOXIN") if is_entity_in_angled_area(player_ped_id(), <<3553.929, 3664.253, 27.127>>, <<3555.701, 3663.940, 29.127>>, 3.00) //2.0 and has_anim_dict_loaded("missfbi5ig_20b") and REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05_GRAB_TOXIN") if start_new_cutscene_no_fade(true, true, false) allow_player_fired_weapon = false clear_area(get_entity_coords(player_ped_id()), 100, true) remove_anim_dict("missfbi5ig_12") remove_anim_dict("missfbi5ig_14") remove_anim_dict("missfbi5ig_17") remove_anim_dict("missfbi5ig_17_b") remove_anim_dict("missfbi5ig_18_p1") remove_anim_dict("missfbi5ig_18_p2") remove_anim_dict("missfbi5ig_20a") if does_entity_exist(clip_board.obj) delete_object(clip_board.obj) //set_model_as_no_longer_needed(clip_board.model) endif if does_entity_exist(pencil.obj) delete_object(pencil.obj) //set_model_as_no_longer_needed(pencil.model) endif if does_blip_exist(security_card_reader_blip) remove_blip(security_card_reader_blip) endif clear_ped_tasks_immediately(player_ped_id()) scene_pos = << 3558.880, 3677.870, 27.125 >> scene_rot = << 0.000, 0.000, 170.000 >> players_scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(player_ped_id(), players_scene_id, "missfbi5ig_20b", "press_open_door_player0", INSTANT_BLEND_IN, slow_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS) //set_synchronized_scene_phase(players_scene_id, 0.25) force_ped_ai_and_animation_update(player_ped_id()) security_card.obj = create_object(security_card.model, get_offset_from_entity_in_world_coords(player_ped_id(), <<0.0, 0.0, 1.0>>)) attach_entity_to_entity(security_card.obj, player_ped_id(), get_ped_bone_index(player_ped_id(), BONETAG_PH_R_HAND), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) force_entity_ai_and_animation_update(security_card.obj) camera_a = CREATE_CAM("DEFAULT_ANIMATED_CAMERA") PLAY_SYNCHRONIZED_CAM_ANIM(camera_a, players_scene_id, "press_open_door_cam", "missfbi5ig_20b") SET_CAM_ACTIVE (camera_a, true) RENDER_SCRIPT_CAMS(TRUE, FALSE) set_synchronized_scene_phase(players_scene_id, 0.25) clear_ped_tasks_immediately(dave.ped) scene_pos = << 3558.880, 3677.870, 27.125 >> scene_rot = << 0.000, 0.000, 170.000 >> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_20b", "ask_open_door_dave", INSTANT_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT) set_synchronized_scene_phase(dave.scene_id, 0.22) SET_SYNCHRONIZED_SCENE_RATE(dave.scene_id, 0.0) set_entity_visible(dave.ped, false) force_ped_ai_and_animation_update(dave.ped) clear_ped_tasks_immediately(steve.ped) scene_pos = << 3558.880, 3677.870, 27.125 >> scene_rot = << 0.000, 0.000, 170.000 >> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_20b", "ask_open_door_steve", INSTANT_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT) set_synchronized_scene_phase(steve.scene_id, 0.01)//0.08 SET_SYNCHRONIZED_SCENE_RATE(steve.scene_id, 0.0) //GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) force_ped_ai_and_animation_update(steve.ped) steve_cover_point_stolen = false //deactivates flag to fix bug 1338013 stops ai system from putting ped back into cover. open_door_with_security_card_cutscene_status++ endif endif endif break case 1 if is_synchronized_scene_running(players_scene_id) if get_synchronized_scene_phase(players_scene_id) >= 0.8 delete_object(security_card.obj) set_model_as_no_longer_needed(security_card.model) // clear_ped_tasks_immediately(player_ped_id()) // set_entity_coords(player_ped_id(), <<3553.7732, 3662.6169, 27.1217>>) // set_entity_heading(player_ped_id(), 349.2162) // force_ped_ai_and_animation_update(player_ped_id()) //clear_ped_tasks(player_ped_id()) set_entity_visible(dave.ped, true) scientist[4].blip = create_blip_for_ped(scientist[4].ped, true) allow_player_fired_weapon = true end_cutscene_no_fade(true, false, false, 0, 0, 3000, false) SET_PED_USING_ACTION_MODE(player_ped_id(), true) force_ped_motion_state(player_ped_id(), MS_ACTIONMODE_idle) force_ped_ai_and_animation_update(player_ped_id()) STOP_RENDERING_SCRIPT_CAMS_USING_CATCH_UP() open_door_with_security_card_cutscene_status = 23 endif endif break case 22 open_door_with_security_card_cutscene_status = 23 break endswitch return false endfunc proc player_cover_blip_system() if is_entity_at_coord(player_ped_id(), <<3545.0039, 3643.0620, 27.1230>>, <<1.0, 1.0, 1.5>>) if is_ped_in_cover(player_ped_id()) if does_blip_exist(cover_blip) clear_prints() set_label_as_triggered("COV_SEC1", true) remove_blip(cover_blip) endif endif else if not does_blip_exist(cover_blip) cover_blip = create_blip_for_coord(<<3545.0039, 3643.0620, 27.1230>>) endif endif if not is_any_text_being_displayed(locates_data) if (is_entity_at_coord(player_ped_id(), <<3545.0039, 3643.0620, 27.1230>>, <<1.0, 1.0, 1.5>>) and not is_ped_in_cover(player_ped_id())) or not is_entity_at_coord(player_ped_id(), <<3545.0039, 3643.0620, 27.1230>>, <<1.0, 1.0, 1.5>>) print_now("COV_SEC1", default_god_text_time, 1) set_label_as_triggered("COV_SEC1", true) endif endif endproc func bool get_chemicals_master_flow_system() int i switch get_chemicals_master_flow_system_status case 0 if is_entity_in_angled_area(dave.ped, <<3539.414, 3673.118, 27.127>>, <<3538.843, 3669.665, 30.127>>, 2.6) or is_entity_in_angled_area(player_ped_id(), <<3539.414, 3673.118, 27.127>>, <<3538.843, 3669.665, 30.127>>, 2.6) for i = 2 to 3 if not is_ped_injured(scientist[i].ped) scientist[i].blip = create_blip_for_ped(scientist[i].ped, true) endif endfor original_time = get_game_timer() get_chemicals_master_flow_system_status++ endif break case 1 ped_structure_are_all_enemies_dead(scientist) if is_ped_injured(scientist[2].ped) and is_ped_injured(scientist[3].ped) clear_prints() get_chemicals_master_flow_system_status++ endif break case 2 if is_entity_in_angled_area(player_ped_id(), <<3544.821, 3647.110, 27.127>>, <<3543.693, 3640.708, 30.135>>, 10.900) cover_blip = create_blip_for_coord(<<3545.0039, 3643.0620, 27.1230>>) get_chemicals_master_flow_system_status++ original_time = get_game_timer() endif break case 3 player_cover_blip_system() if is_entity_in_angled_area(player_ped_id(), <<3544.821, 3647.110, 27.127>>, <<3543.693, 3640.708, 30.135>>, 10.900) and is_entity_in_angled_area(dave.ped, <<3544.821, 3647.110, 27.127>>, <<3543.693, 3640.708, 30.135>>, 10.900) and is_entity_in_angled_area(steve.ped, <<3544.821, 3647.110, 27.127>>, <<3543.693, 3640.708, 30.135>>, 10.900) //or lk_timer(original_time, 5000) setup_enemy(patrol_security_guard[1]) SET_PED_CONFIG_FLAG(patrol_security_guard[1].ped, PCF_OpenDoorArmIK, TRUE) SET_PED_COMPONENT_VARIATION(patrol_security_guard[1].ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[1].ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[1].ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[1].ped, PED_COMP_TORSO, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[1].ped, PED_COMP_LEG, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[1].ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[1].ped, PED_COMP_FEET, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[1].ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[1].ped, PED_COMP_SPECIAL, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[1].ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[1].ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[1].ped, PED_COMP_JBIB, 0, 0) //patrol_security_guard[1].blip = CREATE_BLIP_FOR_PED(patrol_security_guard[1].ped, true) add_ped_for_dialogue(scripted_speech, ConvertSingleCharacter("C"), patrol_security_guard[1].ped, "SECURITY2") set_blip_display(patrol_security_guard[1].blip, DISPLAY_BLIP) setup_enemy(patrol_security_guard[2]) SET_PED_CONFIG_FLAG(patrol_security_guard[2].ped, PCF_OpenDoorArmIK, TRUE) SET_PED_COMPONENT_VARIATION(patrol_security_guard[2].ped, PED_COMP_HEAD, 1, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[2].ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[2].ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[2].ped, PED_COMP_TORSO, 0, 1) SET_PED_COMPONENT_VARIATION(patrol_security_guard[2].ped, PED_COMP_LEG, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[2].ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[2].ped, PED_COMP_FEET, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[2].ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[2].ped, PED_COMP_SPECIAL, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[2].ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[2].ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(patrol_security_guard[2].ped, PED_COMP_JBIB, 0, 0) add_ped_for_dialogue(scripted_speech, ConvertSingleCharacter("D"), patrol_security_guard[2].ped, "SECURITY3") //patrol_security_guard[2].blip = CREATE_BLIP_FOR_PED(patrol_security_guard[2].ped, true) set_blip_display(patrol_security_guard[2].blip, DISPLAY_BLIP) start_audio_scene("FBI_5_HIDE_FROM_SECURITY") original_time = get_game_timer() get_chemicals_master_flow_system_status++ endif break case 4 player_cover_blip_system() if not is_ped_injured(patrol_security_guard[1].ped) if is_entity_in_angled_area(patrol_security_guard[1].ped, <<3545.832, 3643.640, 27.128>>, <<3546.306, 3646.501, 30.128>>, 1.0) or patrol_security_guard_1_ai_system_status >= 2 //player has been shooting before the patrol guards come through the door clear_prints() if does_blip_exist(cover_blip) remove_blip(cover_blip) endif DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[7], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[7], DOORSTATE_force_unlocked_this_frame, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[8], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[8], DOORSTATE_force_unlocked_this_frame, false, true) get_chemicals_master_flow_system_status++ endif endif break case 5 ped_structure_are_all_enemies_dead(patrol_security_guard) if is_ped_injured(patrol_security_guard[1].ped) and is_ped_injured(patrol_security_guard[2].ped) security_card_reader_blip = create_blip_for_coord(<<3555.0469, 3664.2588, 27.1217>>) for i = 1 to 2 if does_entity_exist(patrol_security_guard[i].ped) delete_ped(patrol_security_guard[i].ped) if does_blip_exist(patrol_security_guard[i].blip) remove_blip(patrol_security_guard[i].blip) endif endif endfor remove_ped_for_dialogue(scripted_speech, 5) remove_ped_for_dialogue(scripted_speech, 6) if is_audio_scene_active("FBI_5_HIDE_FROM_SECURITY") STOP_AUDIO_SCENE("FBI_5_HIDE_FROM_SECURITY") endif setup_enemy(scientist[4]) remove_blip(scientist[4].blip) set_ragdoll_blocking_flags(scientist[4].ped, RBF_BULLET_IMPACT | RBF_VEHICLE_IMPACT | RBF_FIRE | RBF_PLAYER_IMPACT | RBF_EXPLOSION) set_ped_config_flag(scientist[4].ped, PCF_DisableExplosionReactions, true) set_entity_proofs(scientist[4].ped, true, true, true, true, true, true, false, true) SET_PED_MONEY(scientist[4].ped, 0) add_ped_for_dialogue(scripted_speech, ConvertSingleCharacter("B"), scientist[4].ped, "scientist5") get_chemicals_master_flow_system_status++ endif break case 6 if move_doors_with_new_door_system(fbi_5_door[9], fbi_5_door[10], true) get_chemicals_master_flow_system_status++ endif break case 7 //ped_structure_are_all_enemies_dead(scientist) if scientist[5].created setup_enemy(scientist[5]) remove_blip(scientist[5].blip) SET_RAGDOLL_BLOCKING_FLAGS(scientist[5].ped, RBF_VEHICLE_IMPACT | RBF_FIRE | RBF_PLAYER_IMPACT | RBF_EXPLOSION) //RBF_BULLET_IMPACT | //set_ped_config_flag(scientist[5].ped, PCF_DisableExplosionReactions, true) SET_PED_CONFIG_FLAG(scientist[5].ped, PCF_RunFromFiresAndExplosions, FALSE) set_entity_proofs(scientist[5].ped, false, false, true, false, false) SET_PED_MONEY(scientist[5].ped, 0) set_ped_component_variation(scientist[5].ped, ped_comp_special, 1, 0) add_ped_for_dialogue(scripted_speech, 8, scientist[5].ped, "scientist3") clip_board.obj = create_object(clip_board.model, get_offset_from_entity_in_world_coords(scientist[5].ped, <<0.0, 0.0, 1.0>>)) ATTACH_ENTITY_TO_ENTITY(clip_board.obj, scientist[5].ped, get_ped_bone_index(scientist[5].ped, BONETAG_PH_L_HAND), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) pencil.obj = create_object(pencil.model, get_offset_from_entity_in_world_coords(scientist[5].ped, <<0.0, 0.0, 1.0>>)) ATTACH_ENTITY_TO_ENTITY(pencil.obj, scientist[5].ped, get_ped_bone_index(scientist[5].ped, BONETAG_PH_R_HAND), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) get_chemicals_master_flow_system_status++ endif break case 8 request_anim_dict("missfbi5ig_23") //ped_structure_are_all_enemies_dead(scientist) if has_anim_dict_loaded("missfbi5ig_23") if (does_entity_have_physics(chemicals.obj) and is_entity_touching_entity(player_ped_id(), chemicals.obj)) or is_entity_in_angled_area(player_ped_id(), <<3558.150, 3671.999, 27.122>>, <<3562.286, 3671.269, 29.722>>, 2.0)//<<3559.469, 3672.282, 27.127>>, <<3560.750, 3672.063, 29.627>>, 2.0)//1.2 return true endif endif break endswitch return false endfunc proc get_to_chemicals_audio_event_system() switch get_to_chemicals_audio_event_system_status case 0 if DOES_OBJECT_OF_TYPE_EXIST_AT_COORDS(<<3538.8, 3673.7, 27.1>>, 1.0, V_ILev_BL_DoorEL_L, true) and DOES_OBJECT_OF_TYPE_EXIST_AT_COORDS(<<3541.7, 3673.2, 27.1>>, 1.0, V_ILev_BL_DoorEL_R, true) float left_door_ratio float right_door_ratio bool left_lock_state bool right_lock_state GET_STATE_OF_CLOSEST_DOOR_OF_TYPE(V_ILev_BL_DoorEL_L, <<3538.8, 3673.7, 27.1>>, left_lock_state, left_door_ratio) GET_STATE_OF_CLOSEST_DOOR_OF_TYPE(V_ILev_BL_DoorEL_R, <<3541.7, 3673.2, 27.1>>, right_lock_state, right_door_ratio) if left_door_ratio < -0.6 and right_door_ratio > 0.6 trigger_music_event("FBI5A_LIFT_EXIT") get_to_chemicals_audio_event_system_status++ endif endif break case 1 if is_entity_in_angled_area(player_ped_id(), <<3558.113, 3668.658, 27.127>>, <<3558.450, 3670.629, 29.527>>, 1.100) trigger_music_event("FBI5A_GET_CHEMICALS_MA") get_to_chemicals_audio_event_system_status++ endif break endswitch endproc //PURPOSE: Mission stage from when the player + crew leave the lift to finding the chemicals. Mainly stealth / using the stun gun PROC FIND_CHEMICALS() INT i REPLAY_DISABLE_CAMERA_MOVEMENT_THIS_FRAME() //Fix for bug 2217405 disable_friendly_fire_audio() IF e_section_stage = SECTION_STAGE_SETUP request_find_chemicals_assets() if has_model_loaded(clip_board.model) and has_model_loaded(pencil.model) and HAS_MODEL_LOADED(chemicals.model) and has_model_loaded(nerve_agent.model) and has_model_loaded(security_card.model) and has_model_loaded(crate.model) and HAS_MODEL_LOADED(fridge_pallet.model) and HAS_MODEL_LOADED(fridge.model) and HAS_COLLISION_FOR_MODEL_LOADED(fridge.model) and has_model_loaded(container_light.model) and has_model_loaded(PROP_BOXPILE_02B) and has_anim_dict_loaded("missfbi5ig_15") and has_vehicle_recording_been_loaded(army_truck[0].recording_number, "lkfbi5a") and has_vehicle_recording_been_loaded(army_truck[1].recording_number, "lkfbi5a") and has_vehicle_recording_been_loaded(army_truck[2].recording_number, "lkfbi5a") and REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05_GRAB_TOXIN") and get_is_waypoint_recording_loaded("fbi5_dave_1") and prepare_music_event("FBI5A_LIFT_EXIT") CLEAR_TRIGGERED_LABELS() clear_area(get_entity_coords(player_ped_id()), 1000, true) REMOVE_DECALS_IN_RANGE(get_entity_coords(player_ped_id()), 1000.00) stop_ped_speaking(dave.ped, true) stop_ped_speaking(steve.ped, true) set_ped_accuracy(dave.ped, 100) set_ped_accuracy(steve.ped, 100) remove_ped_for_dialogue(scripted_speech, 5) remove_ped_for_dialogue(scripted_speech, 6) add_ped_for_dialogue(scripted_speech, ConvertSingleCharacter("E"), null, "SECURITYTANNOY") setup_enemy(scientist[2]) SET_RAGDOLL_BLOCKING_FLAGS(scientist[2].ped, RBF_VEHICLE_IMPACT| RBF_PLAYER_IMPACT) remove_blip(scientist[2].blip) SET_PED_MONEY(scientist[2].ped, 0) add_ped_for_dialogue(scripted_speech, 8, scientist[2].ped, "scientist3") setup_enemy(scientist[3]) SET_RAGDOLL_BLOCKING_FLAGS(scientist[3].ped, RBF_VEHICLE_IMPACT | RBF_PLAYER_IMPACT) remove_blip(scientist[3].blip) SET_PED_MONEY(scientist[3].ped, 0) add_ped_for_dialogue(scripted_speech, ConvertSingleCharacter("A"), scientist[3].ped, "scientist4") crate.obj = CREATE_OBJECT_no_offset(crate.model, crate.pos) //-10.00 SET_ENTITY_HEADING(crate.obj, crate.heading) freeze_entity_position(crate.obj, true) SET_OBJECT_TAKES_DAMAGE_FROM_COLLIDING_WITH_BUILDINGS(crate.obj) SET_ENTITY_PROOFS(crate.obj, TRUE, TRUE, TRUE, TRUE, TRUE) fridge_pallet.obj = CREATE_OBJECT_no_offset(fridge_pallet.model, fridge_pallet.pos) SET_ENTITY_HEADING(fridge_pallet.obj, fridge_pallet.heading) sET_ENTITY_PROOFS(fridge_pallet.obj, TRUE, TRUE, TRUE, TRUE, TRUE) fridge.obj = CREATE_OBJECT_no_offset(fridge.model, fridge.pos) SET_ENTITY_HEADING(fridge.obj, fridge.heading) //sET_ENTITY_PROOFS(fridge.obj, TRUE, TRUE, TRUE, TRUE, TRUE) attach_entity_to_entity(fridge.obj, fridge_pallet.obj, 0, <<0.0, 0.0, 0.860>>, <<0.0, 0.0, 180.0>>, false, false, true) attach_entity_to_entity(fridge_pallet.obj, crate.obj, 0, <<0.0, 0.0, -1.210>>, <<0.0, 0.0, 0.0>>) container_light.obj = CREATE_OBJECT_no_offset(container_light.model, container_light.pos) SET_ENTITY_HEADING(container_light.obj, container_light.heading) sET_ENTITY_PROOFS(container_light.obj, TRUE, TRUE, TRUE, TRUE, TRUE) chemicals.obj = CREATE_OBJECT(chemicals.model, chemicals.pos) freeze_entity_position(chemicals.obj, true) SET_ENTITY_HEADING(chemicals.obj, chemicals.heading) SET_MODEL_AS_NO_LONGER_NEEDED(chemicals.model) nerve_agent.obj = create_object(nerve_agent.model, get_offset_from_entity_in_world_coords(chemicals.obj, <<0.0, 0.0, 1.5>>)) attach_entity_to_entity(nerve_agent.obj, chemicals.obj, 0, <<-0.054, -0.032, -0.230>>, <<0.0, 0.0, 0.0>>) e_section_stage = SECTION_STAGE_RUNNING ENDIF ENDIF IF e_section_stage = SECTION_STAGE_RUNNING if get_chemicals_master_flow_system() e_section_stage = SECTION_STAGE_CLEANUP endif open_door_with_security_card_cutscene() dialogue_system_1() elevator_1_system() dave_ai_system_1() steve_ai_system_1() scientist_2_ai_system() scientist_3_ai_system() scientist_4_ai_system() scientist_5_ai_system() check_for_scientists_being_stunned() ped_structure_are_all_enemies_dead(scientist, false) patrol_security_guard_1_ai_system() patrol_security_guard_2_ai_system() check_for_patrol_security_guards_being_stunned() ped_structure_are_all_enemies_dead(patrol_security_guard) move_doors_14_and_15_system() // security_guard_ai_system() // check_for_security_guard_being_stunned() get_to_chemicals_audio_event_system() gas_mask_audio_system() has_player_fired_weapon() endif IF e_section_stage = SECTION_STAGE_CLEANUP e_mission_stage = stage_chemicals_cutscene e_section_stage = SECTION_STAGE_SETUP ENDIF IF e_section_stage = SECTION_STAGE_SKIP DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[7], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[7], DOORSTATE_force_unlocked_this_frame, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[8], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[8], DOORSTATE_force_unlocked_this_frame, false, true) // unlock door 15 & 16 DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[15], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[15], DOORSTATE_force_unlocked_this_frame, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[16], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[16], DOORSTATE_force_unlocked_this_frame, false, true) KILL_ANY_CONVERSATION() for i = 0 to 3 if not is_ped_injured(scientist[i].ped) delete_ped(scientist[i].ped) endif if does_blip_exist(scientist[i].blip) remove_blip(scientist[i].blip) endif endfor for i = 0 to count_of(patrol_security_guard) - 1 if not is_ped_injured(patrol_security_guard[i].ped) delete_ped(patrol_security_guard[i].ped) endif if does_blip_exist(patrol_security_guard[i].blip) remove_blip(patrol_security_guard[i].blip) endif endfor scientist[4].pos = <<3553.9468, 3669.1521, 27.1230>> scientist[4].heading = 144.8027 if not does_entity_exist(scientist[4].ped) setup_enemy(scientist[4]) SET_RAGDOLL_BLOCKING_FLAGS(scientist[4].ped, RBF_VEHICLE_IMPACT | RBF_FIRE | RBF_PLAYER_IMPACT | RBF_EXPLOSION) add_ped_for_dialogue(scripted_speech, ConvertSingleCharacter("B"), scientist[4].ped, "scientist5") else if not is_ped_injured(scientist[4].ped) set_entity_coords(scientist[4].ped, scientist[4].pos) set_entity_heading(scientist[4].ped, scientist[4].heading) endif endif scientist[5].pos = <<3553.9468, 3669.1521, 27.1230>> scientist[5].heading = 144.8027 if not does_entity_exist(scientist[5].ped) setup_enemy(scientist[5]) SET_RAGDOLL_BLOCKING_FLAGS(scientist[5].ped, RBF_VEHICLE_IMPACT | RBF_FIRE | RBF_PLAYER_IMPACT | RBF_PLAYER_BUMP | RBF_EXPLOSION) add_ped_for_dialogue(scripted_speech, 8, scientist[5].ped, "scientist3") else if not is_ped_injured(scientist[5].ped) set_entity_coords(scientist[5].ped, scientist[5].pos) set_entity_heading(scientist[5].ped, scientist[5].heading) endif endif set_ped_combat_movement(dave.ped, cm_defensive) set_entity_coords(dave.ped, <<3556.1140, 3672.0681, 27.1230>>) set_entity_heading(dave.ped, 144.8027) set_entity_coords(steve.ped, <<3555.7307, 3676.5354, 27.1230>>) set_entity_heading(steve.ped, 170.5338) set_entity_coords(player_ped_id(), <<3560.2693, 3671.9189, 27.1234>>) set_entity_heading(player_ped_id(), 353.1301) e_section_stage = SECTION_STAGE_CLEANUP ENDIF ENDPROC //PURPOSE: scientists might have been killed before checkpoint set. Therefore you don't want to create them on a //replay of that checkpoint. proc set_global_flags_for_scientist_4_and_5() if not is_ped_injured(scientist[4].ped) fbi5a_scientist_4_alive = true else fbi5a_scientist_4_alive = false endif if not is_ped_injured(scientist[5].ped) fbi5a_scientist_5_alive = true else fbi5a_scientist_5_alive = false endif endproc proc chemicals_cutscene() REPLAY_DISABLE_CAMERA_MOVEMENT_THIS_FRAME() //Fix for bug 2217405 IF e_section_stage = SECTION_STAGE_SETUP request_anim_dict("missfbi5ig_21") request_anim_dict("missfbi5ig_22") request_anim_dict("missfbi5ig_23") if has_anim_dict_loaded("missfbi5ig_21") and has_anim_dict_loaded("missfbi5ig_22") and has_anim_dict_loaded("missfbi5ig_23") e_section_stage = SECTION_STAGE_RUNNING endif endif IF e_section_stage = SECTION_STAGE_RUNNING if IS_CUTSCENE_SKIP_BUTTON_JUST_PRESSED_WITH_DELAY() REPLAY_CANCEL_EVENT() chemicals_cutscene_status = 22 endif switch chemicals_cutscene_status case 0 if start_new_cutscene_no_fade(false) CLEAR_TRIGGERED_LABELS() clear_area(<<3551.580, 3658.520, 27.125>>, 100, true) if does_blip_exist(chemicals.blip) remove_blip(chemicals.blip) endif set_label_as_triggered("fbi5achem0", true) clear_ped_tasks_immediately(player_ped_id()) scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> players_scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(player_ped_id(), players_scene_id, "missfbi5ig_22", "take_chemical_player0", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, instant_blend_in, AIK_DISABLE_ARM_IK) force_ped_ai_and_animation_update(player_ped_id()) PLAY_SYNCHRONIZED_ENTITY_ANIM(chemicals.obj, players_scene_id, "take_chemical_vial", "missfbi5ig_22", instant_BLEND_IN, normal_BLEND_OUT) FORCE_ENTITY_AI_AND_ANIMATION_UPDATE(chemicals.obj) detach_entity(nerve_agent.obj) //nerve_agent.obj = create_object(nerve_agent.model, get_offset_from_entity_in_world_coords(player_ped_id(), <<0.0, 0.0, 1.5>>)) PLAY_SYNCHRONIZED_ENTITY_ANIM(nerve_agent.obj, players_scene_id, "take_chemical_tube", "missfbi5ig_22", instant_BLEND_IN, normal_BLEND_OUT) FORCE_ENTITY_AI_AND_ANIMATION_UPDATE(nerve_agent.obj) clear_ped_tasks_immediately(dave.ped) dave.pos = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_23", "run_through_door_dave", << 3558.898, 3677.850, 27.125 >>, << 0.000, 0.000, 170.00 >>) dave.pos.z = 27.12 set_entity_coords(dave.ped, dave.pos) set_entity_heading(dave.ped, 86.1642) SET_CURRENT_PED_WEAPON(dave.ped, dave.weapon) if not is_ped_injured(scientist[4].ped) task_aim_gun_at_entity(dave.ped, scientist[4].ped, -1, true) elif not is_ped_injured(scientist[5].ped) task_aim_gun_at_entity(dave.ped, scientist[5].ped, -1, true) else task_aim_gun_at_coord(dave.ped, <<3553.9, 3668.7, 28.8>>, -1, true) endif set_blocking_of_non_temporary_events(dave.ped, true) force_ped_ai_and_animation_update(dave.ped) clear_ped_tasks_immediately(steve.ped) steve.pos = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_23", "run_through_door_steve", << 3558.898, 3677.850, 27.125 >>, << 0.000, 0.000, 170.00 >>) steve.pos.z = 27.12 set_entity_coords(steve.ped, steve.pos) set_entity_heading(steve.ped, 86.1642) if not is_ped_injured(scientist[5].ped) task_aim_gun_at_entity(steve.ped, scientist[5].ped, -1, true) elif not is_ped_injured(scientist[4].ped) task_aim_gun_at_entity(steve.ped, scientist[4].ped, -1, true) else task_aim_gun_at_coord(steve.ped, <<3553.9, 3668.7, 28.8>>, -1, true) endif set_blocking_of_non_temporary_events(steve.ped, true) //SET_CURRENT_PED_WEAPON(steve.ped, weapontype_stungun, true) //SET_CURRENT_PED_WEAPON(dave.ped, dave.weapon) force_ped_ai_and_animation_update(steve.ped) if not is_ped_injured(scientist[4].ped) clear_ped_tasks_immediately(scientist[4].ped) scene_pos = <<3559.398, 3676.750, 27.125>> scene_rot = <<0.000, 0.000, 174.000>> scientist[4].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[4].ped, scientist[4].scene_id, "missfbi5ig_22", "hands_up_anxious_scientist", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, NORMAL_BLEND_IN) set_synchronized_scene_looped(scientist[4].scene_id, true) scientist_4_ai_system_status = 7 endif if not is_ped_injured(scientist[5].ped) clear_ped_tasks_immediately(scientist[5].ped) scene_pos = <<3558.898, 3677.850, 27.125>> scene_rot = <<0.0, 0.0, 170.00>> scientist[5].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[5].ped, scientist[5].scene_id, "missfbi5ig_21", "hands_up_anxious_scientist", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, NORMAL_BLEND_IN) set_synchronized_scene_looped(scientist[5].scene_id, true) scientist_5_ai_system_status = 3 endif //unlock door 15 & 16 DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[14], -1.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[14], DOORSTATE_force_locked_this_frame, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[15], 1.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[15], DOORSTATE_force_locked_this_frame, false, true) scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.00 >> camera_a = CREATE_CAMERA(camtype_animated, true) play_cam_anim(camera_a, "take_chemical_cam", "missfbi5ig_22", scene_pos, scene_rot) render_script_cams(true, false) REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) set_global_flags_for_scientist_4_and_5() SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(3, "start of shootout") chemicals_cutscene_status++ endif break case 1 if is_synchronized_scene_running(players_scene_id) if get_synchronized_scene_phase(players_scene_id) > 0.15 create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia25", conv_priority_medium) chemicals_cutscene_status++ endif endif break case 2 if is_synchronized_scene_running(players_scene_id) if get_synchronized_scene_phase(players_scene_id) >= 1.0 if does_entity_exist(chemicals.obj) STOP_SYNCHRONIZED_ENTITY_ANIM(chemicals.obj, instant_BLEND_OUT, true) //freeze_entity_position(chemicals.obj, true) play_entity_anim(chemicals.obj, "take_chemical_vial", "missfbi5ig_22", instant_blend_in, false, true, false, 1.0) endif if does_entity_exist(nerve_agent.obj) delete_object(nerve_agent.obj) endif end_cutscene_no_fade(true, false, true, 0, 0, 0, false, false) STOP_RENDERING_SCRIPT_CAMS_USING_CATCH_UP() SET_PED_USING_ACTION_MODE(player_ped_id(), true) force_ped_motion_state(player_ped_id(), MS_ACTIONMODE_idle) force_ped_ai_and_animation_update(player_ped_id()) REPLAY_STOP_EVENT() e_mission_stage = STAGE_shootout e_section_stage = SECTION_STAGE_SETUP endif endif break case 22 if not is_screen_faded_out() if not is_screen_fading_out() do_screen_fade_out(default_fade_time) endif else vector player_pos vector player_rot player_rot = GET_ANIM_INITIAL_OFFSET_rotation("missfbi5ig_22", "take_chemical_player0", << 3558.898, 3677.850, 27.125 >>, << 0.000, 0.000, 170.00 >>, 1.0) player_pos = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_22", "take_chemical_player0", << 3558.898, 3677.850, 27.125 >>, << 0.000, 0.000, 170.00 >>, 1.0) player_pos.z -= 1 clear_ped_tasks_immediately(player_ped_id()) set_entity_coords(player_ped_id(), player_pos) set_entity_heading(player_ped_id(), player_rot.z) //FORCE_PED_MOTION_STATE(player_ped_id(), MS_ON_FOOT_IDLE, TRUE) SET_PED_USING_ACTION_MODE(player_ped_id(), true) force_ped_motion_state(player_ped_id(), MS_ACTIONMODE_idle) force_ped_ai_and_animation_update(player_ped_id()) if does_entity_exist(chemicals.obj) //delete_object(chemicals.obj) STOP_SYNCHRONIZED_ENTITY_ANIM(chemicals.obj, instant_BLEND_OUT, true) play_entity_anim(chemicals.obj, "take_chemical_vial", "missfbi5ig_22", instant_blend_in, false, true, false, 1.0) //freeze_entity_position(chemicals.obj, true) endif if does_entity_exist(nerve_agent.obj) delete_object(nerve_agent.obj) endif end_cutscene(false) REPLAY_STOP_EVENT() e_mission_stage = STAGE_shootout e_section_stage = SECTION_STAGE_SETUP endif break endswitch endif if e_section_stage = section_stage_cleanup REPLAY_STOP_EVENT() e_mission_stage = STAGE_shootout e_section_stage = SECTION_STAGE_SETUP endif IF e_section_stage = SECTION_STAGE_SKIP if not is_screen_faded_out() if not is_screen_fading_out() do_screen_fade_out(default_fade_time) endif else REPLAY_CANCEL_EVENT() vector player_pos vector player_rot player_rot = GET_ANIM_INITIAL_OFFSET_rotation("missfbi5ig_22", "take_chemical_player0", << 3558.898, 3677.850, 27.125 >>, << 0.000, 0.000, 170.00 >>, 1.0) player_pos = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_22", "take_chemical_player0", << 3558.898, 3677.850, 27.125 >>, << 0.000, 0.000, 170.00 >>, 1.0) player_pos.z -= 1 clear_ped_tasks_immediately(player_ped_id()) set_entity_coords(player_ped_id(), player_pos) set_entity_heading(player_ped_id(), player_rot.z) SET_PED_USING_ACTION_MODE(player_ped_id(), true) force_ped_motion_state(player_ped_id(), MS_ACTIONMODE_idle) force_ped_ai_and_animation_update(player_ped_id()) if does_entity_exist(chemicals.obj) delete_object(chemicals.obj) endif if does_entity_exist(nerve_agent.obj) delete_object(nerve_agent.obj) endif end_cutscene(true, 0, 0, false) e_section_stage = SECTION_STAGE_CLEANUP endif endif endproc func bool shootout_master_flow_system() int i switch shootout_master_flow_system_status case 0 ped_structure_are_all_enemies_dead(scientist, true, true) request_anim_dict("missfbi5misc") if is_ped_injured(scientist[4].ped) and is_ped_injured(scientist[5].ped) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[16], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[16], DOORSTATE_unlocked, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[17], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[17], DOORSTATE_unlocked, false, true) remove_ped_for_dialogue(scripted_speech, 5) remove_ped_for_dialogue(scripted_speech, 6) original_time = get_game_timer() shootout_master_flow_system_status++ endif break case 1 shootout_master_flow_system_status++ break case 2 //if is_entity_in_angled_area(player_ped_id(), <<3563.002, 3684.953, 27.128>>, <<3562.224, 3680.521, 30.128>>, 4.500) if is_entity_in_angled_area(player_ped_id(), <<3564.598, 3684.717, 27.122>>, <<3563.824, 3680.284, 30.122>>, 7.7) setup_enemy(security_guard[0]) setup_enemy(security_guard[1]) shootout_master_flow_system_status++ else endif break case 3 ped_structure_are_all_enemies_dead(security_guard) if is_entity_in_angled_area(player_ped_id(), <<3562.023, 3693.149, 27.134>>, <<3569.504, 3691.803, 30.128>>, 2.500) for i = 2 to 5 setup_enemy(security_guard[i]) endfor security_guard[6].created = true //took out security guard 6 shootout_master_flow_system_status++ endif break case 4 ped_structure_are_all_enemies_dead(security_guard) if is_entity_in_angled_area(player_ped_id(), <<3581.554, 3695.001, 26.170>>, <<3578.904, 3688.198, 30.167>>, 1.5) for i = 7 to 7 setup_enemy(security_guard[i]) endfor security_guard[8].created = true shootout_master_flow_system_status++ endif break case 5 ped_structure_are_all_enemies_dead(security_guard) if is_entity_in_angled_area(player_ped_id(), <<3596.862, 3691.483, 27.829>>, <<3599.352, 3689.805, 30.827>>, 2.1) for i = 0 to count_of(scientist) - 1 delete_ped(scientist[i].ped) set_model_as_no_longer_needed(scientist[i].model) endfor for i = 9 to 14 if i != 12 and i != 14 setup_enemy(security_guard[i]) else security_guard[i].created = true endif endfor shootout_master_flow_system_status++ endif break case 6 ped_structure_are_all_enemies_dead(security_guard) if is_entity_in_angled_area(player_ped_id(), <<3587.558, 3714.437, 28.697>>, <<3597.201, 3712.683, 32.094>>, 2.0) for i = 15 to 16 setup_enemy(security_guard[i]) endfor shootout_master_flow_system_status++ endif break case 7 ped_structure_are_all_enemies_dead(security_guard) request_model(security_guard[19].model) request_model(army_truck[0].model) //area check conditions for steve shooting door if is_entity_in_angled_area(player_ped_id(), <<3604.850, 3719.574, 28.690>>, <<3600.483, 3722.665, 31.690>>, 7.200) and is_entity_in_angled_area(dave.ped, <<3604.618, 3718.985, 28.695>>, <<3600.785, 3721.701, 30.700>>, 8.00) and is_entity_in_angled_area(steve.ped, <<3604.618, 3718.985, 28.695>>, <<3600.785, 3721.701, 30.700>>, 8.00) and has_model_loaded(security_guard[19].model) and has_model_loaded(army_truck[0].model) if ped_structure_are_specific_number_enemies_dead(security_guard, 16) // obj_loading_boxes[0] = CREATE_OBJECT(PROP_BOXPILE_02B, <<3615.9490, 3742.2510, 27.6909 >>) // SET_ENTITY_HEADING(obj_loading_boxes[0], -36.0) obj_loading_boxes[1] = CREATE_OBJECT(PROP_BOXPILE_02B, <<3623.3342, 3738.3862, 27.6897>>) SET_ENTITY_HEADING(obj_loading_boxes[1], 150.2056) shootout_master_flow_system_status++ endif endif break case 8 ped_structure_are_all_enemies_dead(security_guard) // - can't get to this area check untill doors unlocked in steve_ai_system_2 if is_entity_in_angled_area(player_ped_id(), <<3600.638, 3705.292, 28.695>>, <<3597.794, 3701.179, 32.295>>, 2.600) if has_player_fired_weapon() security_guard[17].model = security_guard[22].model security_guard[18].model = security_guard[22].model endif setup_enemy(security_guard[17], true) setup_enemy(security_guard[18], true) army_truck[0].veh = create_vehicle(army_truck[0].model, army_truck[0].pos, army_truck[0].heading) set_vehicle_doors_locked(army_truck[0].veh, vehiclelock_lockout_player_only) SET_VEHICLE_IS_CONSIDERED_BY_PLAYER(army_truck[0].veh, false) SET_VEHICLE_RADIO_ENABLED(army_truck[0].veh, false) start_playback_recorded_vehicle(army_truck[0].veh, army_truck[0].recording_number, "lkfbi5a") skip_time_in_playback_recorded_vehicle(army_truck[0].veh, (get_total_duration_of_vehicle_recording(army_truck[0].recording_number, "lkfbi5a") - 2000)) // army_truck[1].veh = create_vehicle(army_truck[1].model, army_truck[1].pos, army_truck[1].heading) // start_playback_recorded_vehicle(army_truck[1].veh, army_truck[1].recording_number, "lkfbi5a") // skip_time_in_playback_recorded_vehicle(army_truck[1].veh, (get_total_duration_of_vehicle_recording(army_truck[1].recording_number, "lkfbi5a") - 6000)) setup_enemy_in_vehicle(security_guard[19], army_truck[0].veh, vs_driver, true) setup_enemy_in_vehicle(security_guard[20], army_truck[0].veh, vs_front_right, true) setup_enemy_in_vehicle(security_guard[23], army_truck[0].veh, vs_extra_right_3, true) setup_enemy(security_guard[21], true) setup_enemy(security_guard[22], true) setup_enemy(security_guard[24], true) setup_enemy(security_guard[25], true) //guards removed security_guard[26].created = true security_guard[27].created = true shootout_master_flow_system_status++ endif break case 9 ped_structure_are_all_enemies_dead(security_guard) if ped_structure_are_specific_number_enemies_dead(security_guard, 26) REPLAY_RECORD_BACK_FOR_TIME(5) // army_truck[2].veh = create_vehicle(army_truck[2].model, army_truck[2].pos, army_truck[2].heading) // start_playback_recorded_vehicle(army_truck[2].veh, army_truck[2].recording_number, "lkfbi5a") // //skip_time_in_playback_recorded_vehicle(army_truck[2].veh, (get_total_duration_of_vehicle_recording(army_truck[2].recording_number, "lkfbi5a") - 5000)) // // setup_enemy_in_vehicle(security_guard[28], army_truck[2].veh) // setup_enemy_in_vehicle(security_guard[29], army_truck[2].veh, vs_front_right) // setup_enemy_in_vehicle(security_guard[30], army_truck[2].veh, vs_back_left) security_guard[28].created = true security_guard[29].created = true security_guard[30].created = true dialogue_system_2_status = 8 shootout_master_flow_system_status++ endif break case 10 if ped_structure_are_all_enemies_dead(security_guard, true, true) if does_entity_exist(chemicals.obj) delete_object(chemicals.obj) endif set_object_as_no_longer_needed(chemicals.obj) for i = 0 to count_of(patrol_security_guard) - 1 if does_entity_exist(patrol_security_guard[i].ped) set_ped_as_no_longer_needed(patrol_security_guard[i].ped) endif set_model_as_no_longer_needed(patrol_security_guard[i].model) endfor remove_anim_dict("missfbi5ig_20b") remove_anim_dict("missfbi5ig_21") remove_anim_dict("missfbi5ig_22") remove_anim_dict("missfbi5ig_23") remove_anim_dict("missfbi5ig_27") remove_anim_dict("missfbi5ig_28") remove_anim_dict("missfbi5ig_30") remove_anim_dict("missfbi5misc") stop_stream() return true endif break case 11 if ped_structure_are_all_enemies_dead(security_guard) SET_INSTANCE_PRIORITY_HINT(INSTANCE_HINT_NONE) return true endif break endswitch return false endfunc proc steve_ai_system_2() // printint(steve_ai_system_2_status) // printnl() if has_label_been_triggered("fbi5a_dia29") if steve_flash_light_time = 0 steve_flash_light_time = get_game_timer() else if lk_timer(steve_flash_light_time, 2500) SET_PED_RESET_FLAG(steve.ped, PRF_ForceEnableFlashLightForAI, TRUE) endif endif endif switch steve_ai_system_2_status case 0 request_anim_dict("missfbi5ig_23") if is_ped_injured(scientist[4].ped) and is_ped_injured(scientist[5].ped) if has_anim_dict_loaded("missfbi5ig_23") steve_cover_point_stolen = false steve.run_to_pos = <<3567.4180, 3683.9111, 27.1238>> //cover_point[15] set_ped_accuracy(steve.ped, 5) set_blocking_of_non_temporary_events(steve.ped, true) scene_pos = <<3558.898, 3677.850, 27.125>> scene_rot = <<0.000, 0.000, 170.000>> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_23", "run_through_door_steve", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) steve_ai_system_2_status = 3 endif endif break case 1 break case 2 break case 3 IF IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) TRANSITION_FROM_MOCAP_TO_COVER(steve.ped, steve.scene_id, steve_time, <<3567.9141, 3683.6233, 27.5230>>, 1.0, 0, true, true, cover_point[15]) if IS_PLAYER_STEALING_PEDS_DESTINATION(steve.ped, steve.run_to_pos, 1.5, false) or steve_cover_point_stolen steve_cover_point_stolen = true IF IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(steve.ped, NORMAL_BLEND_OUT, TRUE) steve.scene_id = -1 endif set_blocking_of_non_temporary_events(steve.ped, false) set_ped_sphere_defensive_area(steve.ped, <<3564.6758, 3684.3003, 27.1219>>, 1.0) task_combat_hated_targets_around_ped(steve.ped, 200.00) steve_ai_system_2_status++ endif else if security_guard[0].created set_blocking_of_non_temporary_events(steve.ped, false) set_ped_sphere_defensive_area(steve.ped, <<3567.9141, 3683.6233, 27.5230>>, 1.0) task_combat_hated_targets_around_ped(steve.ped, 200.00) steve_ai_system_2_status++ endif endif break case 4 if security_guard[0].created if is_ped_injured(security_guard[0].ped) and is_ped_injured(security_guard[1].ped) set_blocking_of_non_temporary_events(steve.ped, true) //set_current_ped_weapon(steve.ped, steve.weapon, true) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3564.6709, 3691.8030, 27.1230>>, <<3568.74, 3694.13, 28.91>>, 2.0, false) //77.8859 task_aim_gun_at_coord(null, <<3568.74, 3694.13, 28.91>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_ai_system_2_status++ endif endif // // // if is_entity_in_angled_area(player_ped_id(), <<3568.983, 3694.584, 27.128>>, <<3563.074, 3695.626, 30.128>>, 3.500) // // set_blocking_of_non_temporary_events(steve.ped, false) // set_ped_sphere_defensive_area(steve.ped, <<3568.4695, 3693.5408, 27.1230>>, 2.0) // task_combat_hated_targets_around_ped(steve.ped, 200.00) // // steve_ai_system_1_status++ // // endif break case 5 if not has_LABEL_been_TRIGGERED("fbi5a_dia37") if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia37", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia37", true) endif endif endif if not is_entity_at_coord(steve.ped, <<3564.6709, 3691.8030, 27.1230>>, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(steve.ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3564.6709, 3691.8030, 27.1230>>, <<3568.74, 3694.13, 28.91>>, 2.0, false) //77.8859 task_aim_gun_at_coord(null, <<3568.74, 3694.13, 28.91>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif else if is_entity_in_angled_area(player_ped_id(), <<3564.229, 3695.411, 26.127>>, <<3568.856, 3694.587, 30.127>>, 5.0) if is_ped_in_cover(player_ped_id()) if is_entity_at_coord(player_ped_id(), <<3568.2822, 3692.8123, 27.1216>>, <<1.5, 1.5, 2.0>>) if security_guard[2].created set_blocking_of_non_temporary_events(steve.ped, false) set_ped_sphere_defensive_area(steve.ped, <<3568.8987, 3696.5913, 27.1216>>, 2.0) task_combat_hated_targets_around_ped(steve.ped, 200.00) steve_ai_system_2_status++ endif elif is_entity_at_coord(player_ped_id(), <<3568.8987, 3696.5913, 27.1216>>, <<1.5, 1.5, 2.0>>) if security_guard[2].created set_blocking_of_non_temporary_events(steve.ped, false) set_ped_sphere_defensive_area(steve.ped, <<3568.2822, 3692.8123, 27.1216>>, 2.0) task_combat_hated_targets_around_ped(steve.ped, 200.00) steve_ai_system_2_status++ endif endif endif endif endif if security_guard[2].created if is_ped_injured(security_guard[2].ped) and is_ped_injured(security_guard[3].ped) and is_ped_injured(security_guard[4].ped) and is_ped_injured(security_guard[5].ped) and is_ped_injured(security_guard[6].ped) steve_ai_system_2_status++ endif endif break case 6 if security_guard[2].created if is_ped_injured(security_guard[2].ped) and is_ped_injured(security_guard[3].ped) and is_ped_injured(security_guard[4].ped) and is_ped_injured(security_guard[5].ped) and is_ped_injured(security_guard[6].ped) set_blocking_of_non_temporary_events(steve.ped, true) clear_ped_tasks(steve.ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3581.7710, 3694.1631, 26.1239>>, <<3592.74, 3679.13, 28.91>>, 2.0, false) //77.8859 task_seek_cover_to_cover_point(null, cover_point[16], <<3594.77, 3676.27, 28.55>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_ai_system_2_status++ endif endif break case 7 if not is_ped_in_cover(steve.ped) if has_ped_task_finished_2(steve.ped) clear_ped_tasks(steve.ped) open_sequence_task(seq) task_seek_cover_to_cover_point(null, cover_point[16], <<3594.77, 3676.27, 28.55>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif if security_guard[7].created set_blocking_of_non_temporary_events(steve.ped, false) set_ped_sphere_defensive_area(steve.ped, <<3585.9514, 3690.7346, 26.1239>>, 3.0) task_combat_hated_targets_around_ped(steve.ped, 200.00) steve_ai_system_2_status++ endif break case 8 if is_ped_injured(security_guard[7].ped) set_blocking_of_non_temporary_events(steve.ped, true) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3587.5156, 3682.9033, 26.6235>>, <<3596.63, 3688.09, 29.44>>, 2.0, false) //77.8859 task_aim_gun_at_coord(null, <<3587.5156, 3682.9033, 26.6235>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_ai_system_2_status++ else if not has_LABEL_been_TRIGGERED("fbi5a_dia38") if is_entity_at_coord(security_guard[7].ped, security_guard[7].run_to_pos, <<3.0, 3.0, 2.0>>) //or has_ped_task_finished_2(security_guard[7].ped) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia38", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia38", true) endif endif endif endif break case 9 if not is_entity_at_coord(steve.ped, <<3587.5156, 3682.9033, 26.6235>>, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(steve.ped) set_blocking_of_non_temporary_events(steve.ped, true) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3587.5156, 3682.9033, 26.6235>>, <<3596.63, 3688.09, 29.44>>, 2.0, false) //77.8859 task_aim_gun_at_coord(null, <<3587.5156, 3682.9033, 26.6235>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif else steve_ai_system_2_status++ endif break case 10 if is_ped_injured(security_guard[7].ped) //and is_ped_injured(security_guard[8].ped) //ped 8 removed set_blocking_of_non_temporary_events(steve.ped, true) KILL_FACE_TO_FACE_CONVERSATION_DO_NOT_FINISH_LAST_LINE() ADD_NON_CRITICAL_STANDARD_CONVERSATION_TO_BUFFER(scripted_speech, "fbi5aAU", "fbi5a_dia39", CONV_PRIORITY_MEDIUM) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3595.5186, 3684.0454, 26.6235>>, <<3596.63, 3688.09, 29.44>>, 2.0, false) //77.8859 task_aim_gun_at_coord(null, <<3596.63, 3688.09, 29.44>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_ai_system_2_status++ endif break case 11 if not is_entity_at_coord(steve.ped, <<3595.5186, 3684.0454, 26.6235>>, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(steve.ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3595.5186, 3684.0454, 26.6235>>, <<3596.63, 3688.09, 29.44>>, 2.0, false) //77.8859 task_aim_gun_at_coord(null, <<3596.63, 3688.09, 29.44>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif else if has_ped_task_finished_2(steve.ped) open_sequence_task(seq) task_aim_gun_at_coord(null, <<3596.63, 3688.09, 29.44>>, 7000) task_aim_gun_at_coord(null, <<3587.5156, 3682.9033, 26.6215>>, 7000) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif if security_guard[9].created if is_ped_injured(security_guard[9].ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3590.4583, 3693.0808, 27.8234>>, <<3584.84, 3697.54, 29.74>>, 2.0, false) //77.8859 task_aim_gun_at_coord(null, <<3584.84, 3697.54, 29.74>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_ai_system_2_status++ endif endif break case 12 if not is_entity_at_coord(steve.ped, <<3590.4583, 3693.0808, 27.8234>>, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(steve.ped) clear_ped_tasks(steve.ped) set_blocking_of_non_temporary_events(steve.ped, true) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3590.4583, 3693.0808, 27.8234>>, <<3584.84, 3697.54, 29.74>>, 2.0, false) //77.8859 task_aim_gun_at_coord(null, <<3584.84, 3697.54, 29.74>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif if is_ped_injured(security_guard[10].ped) and is_ped_injured(security_guard[11].ped) and is_ped_injured(security_guard[12].ped) and is_ped_injured(security_guard[13].ped) and is_ped_injured(security_guard[14].ped) set_blocking_of_non_temporary_events(steve.ped, true) clear_ped_tasks(steve.ped) steve_cover_point_stolen = false steve.run_to_pos = <<3595.4631, 3718.7578, 28.6907>> //cover_point[22] open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, steve.run_to_pos, pedmove_run, -1) task_put_ped_directly_into_cover(null, steve.run_to_pos, -1, false, 0.5, true, true, cover_point[22], true) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_ai_system_2_status++ endif break case 13 //if player at cover point cover_point[22] steve.run_to_pos = <<3595.4631, 3718.7578, 28.6907>> //then have the buddy go to a coord and then aim at a pos //if security_guard[15].created then the player must be in the area which the cover point is part of if security_guard[15].created //and has_ped_task_finished_2(steve.ped) // set_blocking_of_non_temporary_events(steve.ped, false) // set_ped_sphere_defensive_area(steve.ped, <<3595.4631, 3718.7578, 28.6907>>, 1.0) // task_combat_hated_targets_around_ped(steve.ped, 200.00) //steve_combat_set = true steve_ai_system_2_status++ endif break case 14 if not is_ped_injured(security_guard[15].ped) or not is_ped_injured(security_guard[16].ped) if not steve_combat_set if IS_PLAYER_STEALING_PEDS_DESTINATION(steve.ped, steve.run_to_pos, 2.5, false) IF IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(steve.ped, NORMAL_BLEND_OUT, TRUE) steve.scene_id = -1 endif open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_coord(null, <<3595.5, 3716.6, 29.7>>, <<3596.2, 3725.1, 29.8>>, pedmove_run, false, 0.5, 0.5, true, ENAV_STOP_EXACTLY) task_aim_gun_at_coord(null, <<3596.2, 3725.1, 29.8>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_combat_set = true endif else if not is_entity_at_coord(steve.ped, <<3595.5, 3716.6, 29.7>>, <<1.0, 1.0, 2.0>>) if has_ped_task_finished_2(steve.ped, script_task_perform_sequence, 1) open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_coord(null, <<3595.5, 3716.6, 29.7>>, <<3596.2, 3725.1, 29.8>>, pedmove_run, false, 0.5, 0.5, true, ENAV_STOP_EXACTLY) task_aim_gun_at_coord(null, <<3596.2, 3725.1, 29.8>>, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif endif endif request_anim_dict("missfbi5ig_30") if is_ped_injured(security_guard[15].ped) and is_ped_injured(security_guard[16].ped) if not is_entity_at_coord(steve.ped, steve.run_to_pos, <<0.5, 0.5, 1.6>>) if has_ped_task_finished_2(steve.ped, script_task_perform_sequence, 1) set_blocking_of_non_temporary_events(steve.ped, true) clear_ped_tasks(steve.ped) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, steve.run_to_pos, pedmove_run, -1, 0.2, ENAV_STOP_EXACTLY) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif else if PUT_PED_INTO_COVER_FOR_MOCAP(steve_decision, steve.ped, steve_time, steve.run_to_pos, cover_point[22], <<3594.6, 3725.2, 31.3>>) AND HAS_ANIM_DICT_LOADED("missfbi5ig_30") set_blocking_of_non_temporary_events(steve.ped, true) steve_cover_point_stolen = false steve.run_to_pos = get_anim_initial_offset_position("missfbi5ig_30", "run_through_hallways_steve", <<3603.881, 3719.827, 28.692>>, <<0.000, 0.000, -125.000>>, 1.0) set_ped_config_flag(steve.ped, PCF_UseKinematicModeWhenStationary, true)//kinematic mode set to ensure the player can't bang into steve fix for bug 1155083 set_ragdoll_blocking_flags(steve.ped, rbf_player_impact) //disables player impact event which is not really a ragdoll event. switch steve_decision case play_synched_scene scene_pos = <<3603.881, 3719.827, 28.692>> scene_rot = <<0.000, 0.000, -125.000>> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_30", "run_through_hallways_steve", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) break case use_ai open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, steve.run_to_pos, <<3601.3, 3719.5, 30.7>>, pedmove_run, false, 0.2, 0.2, true, ENAV_STOP_EXACTLY) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) break endswitch steve_combat_set = false steve_ai_system_2_status++ endif endif endif break case 15 if not has_label_been_triggered("fbi5a_dia44") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia44", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia44", true) endif endif request_anim_dict("missfbi5ig_31") TRANSITION_FROM_MOCAP_TO_AIM(steve.ped, steve.scene_id, steve.run_to_pos, <<3601.0, 3718.7, 29.9>>, null) if is_synchronized_scene_running(steve.scene_id) if not has_label_been_triggered("fbi5a_monk0") if get_synchronized_scene_phase(steve.scene_id) > 0.525 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_monk0", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_monk0", true) endif endif endif dialogue_time = get_game_timer() else if has_anim_dict_loaded("missfbi5ig_31") //and is_entity_in_angled_area(player_ped_id(), <<3604.618, 3718.985, 28.695>>, <<3600.785, 3721.701, 30.700>>, 8.00) and is_entity_in_angled_area(player_ped_id(), <<3604.850, 3719.574, 28.690>>, <<3600.483, 3722.665, 31.690>>, 7.200) and is_entity_at_coord(steve.ped, get_anim_initial_offset_position("missfbi5ig_30", "run_through_hallways_steve", <<3603.881, 3719.827, 28.692>>, <<0.000, 0.000, -125.000>>, 1.0), <<1.0, 1.0, 1.6>>) and (is_entity_at_coord(dave.ped, get_anim_initial_offset_position("missfbi5ig_30", "run_through_hallways_dave", <<3603.881, 3719.827, 28.692>>, <<0.000, 0.000, -125.000>>, 1.0), <<1.0, 1.0, 1.6>>) or (dave_combat_set and is_entity_at_coord(dave.ped, <<3604.5688, 3721.4595, 28.6896>>, <<1.0, 1.0, 2.0>>))) and not is_synchronized_scene_running(dave.scene_id) if not is_entity_in_angled_area(player_ped_id(), <<3603.904, 3718.038, 28.694>>, <<3599.703, 3721.102, 31.494>>, 2.6) if not IS_ANY_CONVERSATION_ONGOING_OR_QUEUED() clear_prints() KILL_FACE_TO_FACE_CONVERSATION_DO_NOT_FINISH_LAST_LINE() ADD_NON_CRITICAL_STANDARD_CONVERSATION_TO_BUFFER(scripted_speech, "fbi5aAU", "fbi5a_dia45", CONV_PRIORITY_MEDIUM) SET_PED_CAPSULE(steve.ped, 0.4) scene_pos = <<3603.881, 3719.827, 28.692>> scene_rot = <<0.000, 0.000, -125.000>> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_31", "down_hallway_cover_steve", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) steve.run_to_pos = get_anim_initial_offset_position("missfbi5ig_31", "down_hallway_cover_steve", <<3603.881, 3719.827, 28.692>>, <<0.000, 0.000, -125.000>>, 1.0) set_ped_config_flag(steve.ped, PCF_UseKinematicModeWhenStationary, false) start_audio_scene("FBI_5_MILITARY_SHOOTOUT") steve_ai_system_2_status++ endif else if not has_label_been_triggered("fbi5a_door0") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_door0", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_door0", true) endif else if not has_label_been_triggered("door_0") if not is_any_text_being_displayed(locates_data) print_now("door_0", default_god_text_time, 1) set_label_as_triggered("door0", true) endif endif endif endif else if lk_timer(dialogue_time, 5000) if not has_label_been_triggered("fbi5a_dia44b") if has_anim_dict_loaded("missfbi5ig_31") and (is_entity_at_coord(dave.ped, get_anim_initial_offset_position("missfbi5ig_30", "run_through_hallways_dave", <<3603.881, 3719.827, 28.692>>, <<0.000, 0.000, -125.000>>, 1.0), <<1.0, 1.0, 1.6>>) or (dave_combat_set and is_entity_at_coord(dave.ped, <<3604.5688, 3721.4595, 28.6896>>, <<1.0, 1.0, 2.0>>))) and is_entity_at_coord(steve.ped, get_anim_initial_offset_position("missfbi5ig_30", "run_through_hallways_steve", <<3603.881, 3719.827, 28.692>>, <<0.000, 0.000, -125.000>>, 1.0), <<1.0, 1.0, 1.6>>) if not is_entity_in_angled_area(player_ped_id(), <<3604.618, 3718.985, 28.695>>, <<3600.785, 3721.701, 30.700>>, 8.00) if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia44b", CONV_PRIORITY_low) //dialogue_time = get_game_timer() set_label_as_triggered("fbi5a_dia44b", true) endif endif endif endif endif endif endif endif break case 16 if get_synchronized_scene_phase(steve.scene_id) > 0.02//0.015 set_ped_shoots_at_coord(steve.ped, <<3601.0, 3718.7, 29.9>>, true) play_sound_from_coord(-1, "Shoot_Door", <<3601.0, 3718.7, 29.9>>, "FBI_05_SOUNDS") start_particle_fx_non_looped_at_coord("bul_carmetal", <<3601.0, 3718.7, 29.9>>, <<0.0, 0.0, 0.0>>) start_particle_fx_non_looped_at_coord("muz_assault_rifle", <<3601.0, 3718.7, 29.9>>, <<0.0, 0.0, 0.0>>)//1495169 steve_ai_system_2_status++ endif if get_synchronized_scene_phase(steve.scene_id) < 0.15 if is_entity_in_angled_area(player_ped_id(), <<3603.904, 3718.038, 28.694>>, <<3599.703, 3721.102, 31.494>>, 2.6) disable_control_action(PLAYER_CONTROL, INPUT_JUMP) disable_control_action(PLAYER_CONTROL, INPUT_sprint) disable_control_action(PLAYER_CONTROL, input_move_lr) disable_control_action(PLAYER_CONTROL, input_move_ud) endif endif break case 17 if is_synchronized_scene_running(steve.scene_id) if get_synchronized_scene_phase(steve.scene_id) > 0.12 DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[24], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[24], DOORSTATE_force_unlocked_this_frame, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[25], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[25], DOORSTATE_force_unlocked_this_frame, false, true) steve_ai_system_2_status++ endif endif break case 18 request_anim_dict("missfbi5ig_32") //get_anim_initial_offset_position("missfbi5ig_31", "down_hallway_cover_steve", <<3603.881, 3719.827, 28.692>>, <<0.000, 0.000, -125.000>>, 1.0) //is_entity_at_coord(player_ped_id(), steve.run_to_pos, <<2.0, 2.0, 2.0>>) if IS_PLAYER_STEALING_PEDS_DESTINATION(steve.ped, steve.run_to_pos, 2.0, false) IF IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) clear_ped_tasks(steve.ped) steve.scene_id = -1 endif //right of wharehouse doorway SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(STEVE.PED, false) set_ped_sphere_defensive_area(steve.ped, <<3614.0027, 3719.8589, 28.6893>>, 2.0) TASK_COMBAT_HATED_TARGETS_AROUND_PED(steve.ped, 100.0) steve_ai_system_2_status = 20 endif if is_synchronized_scene_running(steve.scene_id) if get_synchronized_scene_phase(steve.scene_id) >= 1.0 and has_anim_dict_loaded("missfbi5ig_32") SET_PED_CAPSULE(steve.ped, 0.0) steve_cover_point_stolen = false steve.run_to_pos = <<3614.0027, 3719.8589, 28.6893>> //right of wharehouse doorway scene_pos = <<3613.697, 3728.311, 27.690>> scene_rot = <<0.000, 0.000, -125.000>> steve.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(steve.ped, steve.scene_id, "missfbi5ig_32", "run_hall_cover_steve", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) steve_ai_system_2_status++ endif if get_synchronized_scene_phase(steve.scene_id) < 0.15 if is_entity_in_angled_area(player_ped_id(), <<3603.904, 3718.038, 28.694>>, <<3599.703, 3721.102, 31.494>>, 2.6) disable_control_action(PLAYER_CONTROL, INPUT_JUMP) disable_control_action(PLAYER_CONTROL, INPUT_sprint) disable_control_action(PLAYER_CONTROL, input_move_lr) disable_control_action(PLAYER_CONTROL, input_move_ud) endif endif endif // //get_anim_initial_offset_position("missfbi5ig_31", "down_hallway_cover_steve", <<3603.881, 3719.827, 28.692>>, <<0.000, 0.000, -125.000>>, 1.0) // is_entity_at_coord(player_ped_id(), steve.run_to_pos, <<2.0, 2.0, 2.0>>) // // if IS_PLAYER_STEALING_PEDS_DESTINATION(steve.ped, steve.run_to_pos, 2.0, false) // // IF IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) // clear_ped_tasks(steve.ped) // steve.scene_id = -1 // endif // // //right of wharehouse doorway // SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(STEVE.PED, false) // set_ped_sphere_defensive_area(steve.ped, <<3614.0027, 3719.8589, 28.6893>>, 2.0) // TASK_COMBAT_HATED_TARGETS_AROUND_PED(steve.ped, 100.0) // // steve_ai_system_2_status = 20 // // endif break case 19 if is_synchronized_scene_running(steve.scene_id) if TRANSITION_FROM_MOCAP_TO_COVER_THEN_COMBAT(steve.ped, steve.scene_id, steve_time, steve.run_to_pos, <<3614.0027, 3719.8589, 28.6893>>, 2.0) steve_ai_system_2_status = 20 endif if IS_PLAYER_STEALING_PEDS_DESTINATION(steve.ped, steve.run_to_pos, 2.0) IF IS_SYNCHRONIZED_SCENE_RUNNING(steve.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(steve.ped, NORMAL_BLEND_OUT, TRUE) steve.scene_id = -1 endif //left of wharehouse doorway SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(STEVE.PED, false) set_ped_sphere_defensive_area(steve.ped, <<3610.2234, 3722.5315, 28.6896>>, 2.0) TASK_COMBAT_HATED_TARGETS_AROUND_PED(steve.ped, 100.0) steve_ai_system_2_status = 20 endif endif if does_blip_exist(fridge.blip) steve_ai_system_2_status = 20 endif break case 20 if does_blip_exist(fridge.blip) set_blocking_of_non_temporary_events(steve.ped, true) clear_ped_tasks(steve.ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3619.3105, 3734.5251, 27.6895>>, <<3630.2, 3751.8, 30.3>>, 2.0, false, 0.5, 0.5) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_ai_system_2_status++ endif break case 21 if not is_entity_at_coord(steve.ped, <<3619.3105, 3734.5251, 27.6895>>, <<1.0, 1.0, 2.0>>) if has_ped_task_finished_2(steve.ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3619.3105, 3734.5251, 27.6895>>, <<3630.2, 3751.8, 30.3>>, 2.0, false, 0.5, 0.5) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif else if has_ped_task_finished_2(steve.ped) open_sequence_task(seq) task_aim_gun_at_coord(null, <<3630.2, 3751.8, 30.3>>, 7000, false) task_aim_gun_at_coord(null, <<3611.6, 3720.7, 30.3>>, 7000, false) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif break case 101 open_sequence_task(seq) task_aim_gun_at_entity(null, helicopter.veh, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) steve_ai_system_2_status++ break case 102 if not is_entity_at_coord(steve.ped, <<3629.7551, 3746.9419, 27.6062>>, <<1.0, 1.0, 1.6>>) if has_ped_task_finished_2(steve.ped, script_task_perform_sequence, 1) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, <<3629.7551, 3746.9419, 27.6062>>, -1) task_aim_gun_at_entity(null, helicopter.veh, -1) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) endif endif break endswitch // printstring("steve ai system: ") // printint(steve_ai_system_2_status) // printnl() endproc proc dave_ai_system_2() // printint(dave_ai_system_2_status) // printnl() if has_label_been_triggered("fbi5a_dia29") SET_PED_RESET_FLAG(dave.ped, PRF_ForceEnableFlashLightForAI, TRUE) endif switch dave_ai_system_2_status case 0 request_anim_dict("missfbi5ig_23") if is_ped_injured(scientist[4].ped) and is_ped_injured(scientist[5].ped) if has_anim_dict_loaded("missfbi5ig_23") set_ped_accuracy(dave.ped, 5) scene_pos = << 3558.898, 3677.850, 27.125 >> scene_rot = << 0.000, 0.000, 170.000 >> dave.run_to_pos = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_23", "run_through_door_dave", scene_pos, scene_rot, 1.0) dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_23", "run_through_door_dave", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) dave_ai_system_2_status = 2 endif endif break case 1 break case 2 TRANSITION_FROM_MOCAP_TO_AIM(dave.ped, dave.scene_id, dave.run_to_pos, <<3567.5, 3686.6, 28.1230>>) if security_guard[0].created if is_ped_injured(security_guard[0].ped) and is_ped_injured(security_guard[1].ped) kill_any_conversation() set_blocking_of_non_temporary_events(dave.ped, true) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3566.5325, 3697.6667, 27.1230>>, <<3568.74, 3694.13, 28.91>>, 2.0, false, 0.5, 1.0) //77.8859 task_aim_gun_at_coord(null, <<3568.74, 3694.13, 28.91>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_ai_system_2_status++ endif endif break case 3 if not is_entity_at_coord(dave.ped, <<3566.5325, 3697.6667, 27.1230>>, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(dave.ped, script_task_perform_sequence, 1) set_blocking_of_non_temporary_events(dave.ped, true) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3566.5325, 3697.6667, 27.1230>>, <<3568.74, 3694.13, 28.91>>, 2.0, false, 0.5, 1.0) //77.8859 task_aim_gun_at_coord(null, <<3568.74, 3694.13, 28.91>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif else //fix for player lagging behind and ped not being created. if security_guard[2].created set_blocking_of_non_temporary_events(dave.ped, false) set_ped_sphere_defensive_area(dave.ped, <<3566.5325, 3697.6667, 27.1230>>, 1.0) task_combat_hated_targets_around_ped(dave.ped, 200.00) dave_ai_system_2_status++ endif endif break case 4 if security_guard[2].created if is_ped_injured(security_guard[2].ped) and is_ped_injured(security_guard[3].ped) and is_ped_injured(security_guard[4].ped) and is_ped_injured(security_guard[5].ped) and is_ped_injured(security_guard[6].ped) kill_any_conversation() set_blocking_of_non_temporary_events(dave.ped, true) clear_ped_tasks(dave.ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3583.7832, 3688.1079, 26.1239>>, <<3593.15, 3684.12, 28.59>>, 2.0, false) //77.8859 task_aim_gun_at_coord(null, <<3593.15, 3684.12, 28.59>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_ai_system_2_status++ endif endif break case 5 if not has_LABEL_been_TRIGGERED("fbi5a_dia41") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia41", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia41", true) endif endif if not is_entity_at_coord(dave.ped, <<3583.7832, 3688.1079, 26.1239>>, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(dave.ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3583.7832, 3688.1079, 26.1239>>, <<3593.15, 3684.12, 28.59>>, 2.0, false) //77.8859 task_aim_gun_at_coord(null, <<3593.15, 3684.12, 28.59>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif endif if security_guard[7].created set_label_as_triggered("fbi5a_dia41", false)//reset dialogue flag kill_any_conversation() set_blocking_of_non_temporary_events(dave.ped, false) set_ped_sphere_defensive_area(dave.ped, <<3583.7832, 3688.1079, 26.1239>>, 2.0) if not is_ped_injured(security_guard[7].ped) task_combat_ped(dave.ped, security_guard[7].ped) endif dave_ai_system_2_status++ endif break case 6 if is_ped_injured(security_guard[7].ped) set_ped_sphere_defensive_area(dave.ped, <<3590.9641, 3682.5806, 26.6235>>, 2.0) dave_ai_system_2_status++ endif break case 7 if is_ped_injured(security_guard[7].ped) kill_any_conversation() set_blocking_of_non_temporary_events(dave.ped, true) dave.run_to_pos = <<3596.95, 3685.77, 26.62>> //cover_point[32] // open_sequence_task(seq) // task_go_to_coord_while_aiming_at_coord(null, dave.run_to_pos, <<3597.7, 3690.06, 29.3>>, pedmove_run, false, 0.5, 0.5) // //task_seek_cover_to_cover_point(null, cover_point[32], <<3599.7, 3692.2, 29.8>>, -1) // TASK_PUT_PED_DIRECTLY_INTO_COVER(null, cover_point[32], -1, FALSE, blend_duration, false, false, null, true) // close_sequence_task(seq) // task_perform_sequence(dave.ped, seq) // clear_sequence_task(seq) dave_ai_system_2_status++ endif break case 8 request_anim_dict("missfbi5ig_27") // //if you add a second guy back in you will need to comment this back in // if IS_PLAYER_STEALING_PEDS_DESTINATION(dave.ped, dave.run_to_pos, 3.0) // // IF IS_SYNCHRONIZED_SCENE_RUNNING(dave.scene_id) // STOP_SYNCHRONIZED_ENTITY_ANIM(dave.ped, NORMAL_BLEND_OUT, TRUE) // steve.scene_id = -1 // endif // // SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(dave.ped, false) // set_ped_sphere_defensive_area(dave.ped, dave.run_to_pos, 4.0) // TASK_COMBAT_HATED_TARGETS_AROUND_PED(dave.ped, 100.0) // // dave_combat_set = true // // endif if is_ped_injured(security_guard[8].ped) if PUT_PED_INTO_COVER_FOR_MOCAP(dave_decision, dave.ped, dave_time, dave.run_to_pos, cover_point[32], <<3598.7, 3694.0, 29.8>>) AND HAS_ANIM_DICT_LOADED("missfbi5ig_27") dave.run_to_pos = <<3592.66, 3695.31, 27.82>> //cover_point[33] switch dave_decision case play_synched_scene scene_pos = <<3584.103, 3700.864, 27.823>> scene_rot = <<0.000, 0.000, -34.940>> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_27", "run_stairs_door_dave", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) break case use_ai open_sequence_task(seq) //task_go_to_coord_while_aiming_at_coord(null, dave.run_to_pos, <<3597.7, 3690.06, 29.3>>, pedmove_run, false, 0.5, 0.5) task_go_to_coord_while_aiming_at_coord(null, dave.run_to_pos, <<3589.0, 3695.6, 29.5>>, pedmove_run, false, 1.5, 1.5) task_put_ped_directly_into_cover(null, dave.run_to_pos, -1, false, 0.5, true, true, cover_point[33], true) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) break endswitch dave_ai_system_2_status++ endif endif break case 9 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia41b", CONV_PRIORITY_medium) SET_LABEL_AS_TRIGGERED("fbi5a_dia41b", true) dave_ai_system_2_status++ else kill_any_conversation() endif break case 10 request_anim_dict("missfbi5ig_28") switch dave_decision case play_synched_scene //if TRANSITION_FROM_MOCAP_TO_COVER_THEN_COMBAT(dave.ped, dave.scene_id, dave_time, dave.run_to_pos, (dave.run_to_pos + <<0.0, 0.0, 0.5>>), 1.0, 1.0, 0, true, true) if TRANSITION_FROM_MOCAP_TO_COVER(dave.ped, dave.scene_id, dave_time, dave.run_to_pos, 1.0, normal_blend_in, true, true, cover_point[33]) dave_combat_set = false dave_ai_system_2_status = 11 endif break case use_ai if is_ped_in_cover(dave.ped) dave_combat_set = false dave_ai_system_2_status = 11 endif break endswitch if IS_PLAYER_STEALING_PEDS_DESTINATION(dave.ped, dave.run_to_pos, 3.0, false) IF IS_SYNCHRONIZED_SCENE_RUNNING(dave.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(dave.ped, NORMAL_BLEND_OUT, TRUE) steve.scene_id = -1 endif SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(dave.ped, false) set_ped_sphere_defensive_area(dave.ped, dave.run_to_pos, 4.0) TASK_COMBAT_HATED_TARGETS_AROUND_PED(dave.ped, 100.0) dave_combat_set = true dave_ai_system_2_status = 11 endif break case 11 if security_guard[9].created if not is_ped_injured(security_guard[9].ped) if not dave_combat_set SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(dave.ped, false) set_ped_sphere_defensive_area(dave.ped, dave.run_to_pos, 2.0) TASK_COMBAT_HATED_TARGETS_AROUND_PED(dave.ped, 50.0) dave_combat_set = true endif else dave_combat_set = false dave_ai_system_2_status++ endif endif break case 12 IF IS_SYNCHRONIZED_SCENE_RUNNING(dave.scene_id) TRANSITION_FROM_MOCAP_TO_COVER(dave.ped, dave.scene_id, dave_time, dave.run_to_pos) //keep ped in cover = false when true it forces ped into cover when synched scene not running. else if PUT_PED_INTO_COVER_FOR_MOCAP(dave_decision, dave.ped, dave_time, dave.run_to_pos, cover_point[33], <<3583.2, 3698.6, 29.2>>) AND HAS_ANIM_DICT_LOADED("missfbi5ig_28") dave.run_to_pos = <<3583.87, 3700.70, 27.82>> //cover_point[19] kill_any_conversation() switch dave_decision case play_synched_scene scene_pos = <<3584.103, 3700.864, 27.823>> scene_rot = <<0.000, 0.000, -34.940>> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_28", "run_to_door_dave", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) break case use_ai open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, dave.run_to_pos, pedmove_run, -1, 0.5) //task_seek_cover_to_cover_point(null, cover_point[19], <<3583.2, 3698.6, 29.2>>, -1) task_put_ped_directly_into_cover(null, dave.run_to_pos, -1, false, 0.5, true, false, cover_point[19], true) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) break endswitch dave_ai_system_2_status++ endif endif break case 13 switch dave_decision case play_synched_scene if TRANSITION_FROM_MOCAP_TO_COVER_THEN_COMBAT(dave.ped, dave.scene_id, dave_time, dave.run_to_pos, (dave.run_to_pos + <<0.0, 0.0, 0.5>>), 1.0, 1.0, 0, false, false, cover_point[19]) dave_ai_system_2_status = 14 endif if(IS_SYNCHRONIZED_SCENE_RUNNING(dave.scene_id) and get_synchronized_scene_phase(dave.scene_id) > 0.37 and is_entity_in_angled_area(player_ped_id(), <<3582.915, 3701.415, 27.822>>, <<3587.949, 3697.797, 30.822>>, 1.5) and is_ped_in_cover(player_ped_id())) IF IS_SYNCHRONIZED_SCENE_RUNNING(dave.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(dave.ped, NORMAL_BLEND_OUT, TRUE) steve.scene_id = -1 endif if is_entity_at_coord(player_ped_id(), dave.run_to_pos, <<1.0, 1.0, 2.0>>) //right side of door SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(dave.ped, false) set_ped_sphere_defensive_area(dave.ped, <<3586.4392, 3698.8975, 27.8217>>, 1.0) TASK_COMBAT_HATED_TARGETS_AROUND_PED(dave.ped, 100.0) else //left side of door SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(dave.ped, false) set_ped_sphere_defensive_area(dave.ped, dave.run_to_pos, 1.0) TASK_COMBAT_HATED_TARGETS_AROUND_PED(dave.ped, 100.0) endif dave_ai_system_2_status = 14 endif break case use_ai if is_ped_in_cover(dave.ped) SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(dave.ped, false) set_ped_sphere_defensive_area(dave.ped, dave.run_to_pos, 1.0) TASK_COMBAT_HATED_TARGETS_AROUND_PED(dave.ped, 100.0) dave_ai_system_2_status = 14 else if has_ped_task_finished_2(dave.ped) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, dave.run_to_pos, pedmove_run, -1, 0.5) task_seek_cover_to_cover_point(null, cover_point[19], <<3583.2, 3698.6, 29.2>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif endif break endswitch if IS_PLAYER_STEALING_PEDS_DESTINATION(dave.ped, dave.run_to_pos, 4.0) IF IS_SYNCHRONIZED_SCENE_RUNNING(dave.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(dave.ped, NORMAL_BLEND_OUT, TRUE) steve.scene_id = -1 endif //right side of door SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(dave.ped, false) set_ped_sphere_defensive_area(dave.ped, <<3586.4392, 3698.8975, 27.8217>>, 1.0) TASK_COMBAT_HATED_TARGETS_AROUND_PED(dave.ped, 100.0) dave_ai_system_2_status = 14 endif if not has_LABEL_been_TRIGGERED("fbi5a_dia41") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia41", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia41", true) endif endif break case 14 if is_ped_injured(security_guard[10].ped) and is_ped_injured(security_guard[11].ped) and is_ped_injured(security_guard[12].ped) and is_ped_injured(security_guard[13].ped) and is_ped_injured(security_guard[14].ped) set_label_as_triggered("fbi5a_dia41", false)//reset dialogue flag dave_combat_set = false kill_any_conversation() dave.run_to_pos = <<3591.2021, 3719.5081, 28.6907>> //cover_point[23] set_blocking_of_non_temporary_events(dave.ped, true) clear_ped_tasks(dave.ped) open_sequence_task(seq) //task_follow_nav_mesh_to_coord(null, dave.run_to_pos, pedmove_run, -1) TASK_GO_TO_COORD_WHILE_AIMING_AT_coord(null, dave.run_to_pos, <<3594.6, 3725.2, 31.3>>, pedmove_run, false, 0.5, 0.5, true, ENAV_DONT_ADJUST_TARGET_POSITION) //task_seek_cover_to_cover_point(null, cover_point[23], <<3594.6, 3725.2, 31.3>>, -1) task_put_ped_directly_into_cover(null, dave.run_to_pos, -1, false, 0.5, false, false, cover_point[23]) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_ai_system_2_status++ endif break case 15 if not has_LABEL_been_TRIGGERED("fbi5a_dia41") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia41", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia41", true) endif endif if security_guard[15].created //and has_ped_task_finished_2(dave.ped) dave_combat_set = false kill_any_conversation() set_blocking_of_non_temporary_events(dave.ped, false) set_ped_sphere_defensive_area(dave.ped, (dave.run_to_pos + <<0.0, 0.0, 0.5>>), 1.0) task_combat_hated_targets_around_ped(dave.ped, 200.00) dave_ai_system_2_status++ endif break case 16 //must check if the player is stealing cover point even if combat has already been given. if not dave_combat_set if IS_PLAYER_STEALING_PEDS_DESTINATION(dave.ped, dave.run_to_pos, 2.0, false) IF IS_SYNCHRONIZED_SCENE_RUNNING(dave.scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(dave.ped, NORMAL_BLEND_OUT, TRUE) steve.scene_id = -1 endif open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3590.4910, 3716.4412, 28.6896>>, <<3596.2, 3724.7, 30.6>>, 2.0, true) //task_aim_gun_at_coord(null, <<3596.2, 3724.7, 30.6>>) task_set_blocking_of_non_temporary_events(null, false) TASK_SET_SPHERE_DEFENSIVE_AREA(null, <<3590.4910, 3716.4412, 28.6896>>, 1.0) task_combat_hated_targets_around_ped(null, 50.00) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_combat_set = true endif endif if not has_LABEL_been_TRIGGERED("fbi5a_dia43") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia43", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia43", true) endif endif request_anim_dict("missfbi5ig_30") if is_ped_injured(security_guard[15].ped) and is_ped_injured(security_guard[16].ped) // if not is_entity_at_coord(dave.ped, dave.run_to_pos, <<1.0, 1.0, 1.6>>) // if has_ped_task_finished_2(dave.ped) // // //clear_ped_tasks(dave.ped) // set_blocking_of_non_temporary_events(dave.ped, true) // // open_sequence_task(seq) // task_follow_nav_mesh_to_coord(null, dave.run_to_pos, pedmove_run, -1) // close_sequence_task(seq) // task_perform_sequence(dave.ped, seq) // clear_sequence_task(seq) // endif // // else if PUT_PED_INTO_COVER_FOR_MOCAP(dave_decision, dave.ped, dave_time, dave.run_to_pos, cover_point[23], <<3594.6, 3725.2, 31.3>>) AND HAS_ANIM_DICT_LOADED("missfbi5ig_30") set_label_as_triggered("fbi5a_dia41", false) dave_combat_set = false dave.run_to_pos = <<3604.3132, 3719.8501, 28.6907>> //cover_point[25] kill_any_conversation() switch dave_decision case play_synched_scene scene_pos = <<3603.881, 3719.827, 28.692>> scene_rot = <<0.000, 0.000, -125.000>> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_30", "run_through_hallways_dave", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) break case use_ai open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, dave.run_to_pos, <<3601.43, 3719.85, 30.07>>, pedmove_run, false, 0.5, 0.5) task_put_ped_directly_into_cover(null, dave.run_to_pos, -1, false, 0.5, false, false, cover_point[25], TRUE) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) break endswitch dave_ai_system_2_status++ endif // endif endif break case 17 if not has_LABEL_been_TRIGGERED("fbi5a_dia41") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia41", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia41", true) endif endif request_anim_dict("missfbi5ig_31") switch dave_decision case play_synched_scene TRANSITION_FROM_MOCAP_TO_COVER(dave.ped, dave.scene_id, dave_time, dave.run_to_pos, 1.0, 0.5, false, false, cover_point[25]) break case use_ai break endswitch if not dave_combat_set if IS_PLAYER_STEALING_PEDS_DESTINATION(dave.ped, dave.run_to_pos, 3.0) open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_coord(null, <<3604.5688, 3721.4595, 28.6896>>, <<3601.8, 3719.5, 30.7>>, pedmove_run, false, 0.5, 0.5, false) task_aim_gun_at_coord(null, <<3601.8, 3719.5, 30.7>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_combat_set = true endif else if not is_entity_at_coord(dave.ped, <<3604.5688, 3721.4595, 28.6896>>, <<1.0, 1.0, 2.0>>) if has_ped_task_finished_2(dave.ped, script_task_perform_sequence, 1) open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_coord(null, <<3604.5688, 3721.4595, 28.6896>>, <<3601.8, 3719.5, 30.7>>, pedmove_run, false, 0.5, 0.5, false) task_aim_gun_at_coord(null, <<3601.8, 3719.5, 30.7>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif endif endif if is_entity_at_coord(dave.ped, get_anim_initial_offset_position("missfbi5ig_30", "run_through_hallways_dave", <<3603.881, 3719.827, 28.692>>, <<0.000, 0.000, -125.000>>, 1.0), <<1.0, 1.0, 1.6>>) or (dave_combat_set and is_entity_at_coord(dave.ped, <<3604.5688, 3721.4595, 28.6896>>, <<1.0, 1.0, 2.0>>)) if has_anim_dict_loaded("missfbi5ig_31") //and (is_entity_at_coord(dave.ped, get_anim_initial_offset_position("missfbi5ig_30", "run_through_hallways_dave", <<3603.881, 3719.827, 28.692>>, <<0.000, 0.000, -125.000>>, 1.0), <<1.0, 1.0, 1.6>>) //or (dave_combat_set and //and PUT_PED_INTO_COVER_FOR_MOCAP(dave_decision, dave.ped, dave_time, dave.run_to_pos, cover_point[25], <<3598.4, 3712.8, 30.4>>) and (is_synchronized_scene_running(steve.scene_id) and is_entity_playing_anim(steve.ped, "missfbi5ig_31", "down_hallway_cover_steve") and get_synchronized_scene_phase(steve.scene_id) > 0.15) //or steve ai status > x dave_ai_system_2_status = 118 endif endif break case 118 if PUT_PED_INTO_COVER_FOR_MOCAP(dave_decision, dave.ped, dave_time, dave.run_to_pos, cover_point[25], <<3598.4, 3712.8, 30.4>>, normal_blend_in) switch dave_decision case play_synched_scene kill_any_conversation() scene_pos = <<3603.881, 3719.827, 28.692>> scene_rot = <<0.000, 0.000, -125.000>> dave.scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(dave.ped, dave.scene_id, "missfbi5ig_31", "down_hallway_cover_dave", normal_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS | SYNCED_SCENE_DONT_INTERRUPT, RBF_NONE, NORMAL_BLEND_IN) dave.run_to_pos = get_anim_initial_offset_position("missfbi5ig_31", "down_hallway_cover_dave", <<3603.881, 3719.827, 28.692>>, <<0.000, 0.000, -125.000>>, 1.0) //cover point 35 break case use_ai set_blocking_of_non_temporary_events(dave.ped, true) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3599.3596, 3702.7502, 28.6908>>, <<3603.07, 3697.65, 30.28>>, 2.0, false, 0.5, 0.5, true, enav_no_stopping) task_go_to_coord_while_aiming_at_coord(null, <<3610.0935, 3713.6577, 28.6896>>, <<3614.91, 3725.84, 30.41>>, 2.0, false, 0.5, 0.5) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave.run_to_pos = <<3610.0935, 3713.6577, 28.6896>> break endswitch dave_ai_system_2_status = 18 endif break case 18 if not has_label_been_triggered("fbi5a_dia46") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia46", CONV_PRIORITY_high) SET_LABEL_AS_TRIGGERED("fbi5a_dia46", true) endif endif if not has_label_been_triggered("fbi5a_dia47") if has_label_been_triggered("fbi5a_dia46") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia47", CONV_PRIORITY_high) SET_LABEL_AS_TRIGGERED("fbi5a_dia47", true) endif endif endif switch dave_decision case play_synched_scene //if TRANSITION_FROM_MOCAP_TO_COMBAT(dave.ped, dave.scene_id, dave.run_to_pos, 2.0) //steve.run_to_pos = <<3595.4631, 3718.7578, 28.6907>> //cover_point[25] if transition_from_mocap_to_cover_then_combat(dave.ped, dave.scene_id, dave_time, dave.run_to_pos, dave.run_to_pos, 2.0, 1, 0, false, false, cover_point[35]) dave_ai_system_2_status = 19 endif break case use_ai if is_entity_at_coord(dave.ped, dave.run_to_pos, <<1.5, 1.5, 2.0>>) set_blocking_of_non_temporary_events(dave.ped, false) set_ped_sphere_defensive_area(dave.ped, dave.run_to_pos, 3.0) task_combat_hated_targets_around_ped(dave.ped, 200.00) dave_ai_system_2_status = 19 endif break endswitch if IS_PLAYER_STEALING_PEDS_DESTINATION(dave.ped, dave.run_to_pos, 3.0) set_blocking_of_non_temporary_events(dave.ped, false) set_ped_sphere_defensive_area(dave.ped, (dave.run_to_pos), 4.0) task_combat_hated_targets_around_ped(dave.ped, 200.00) dave_ai_system_2_status = 19 endif break case 19 if ped_structure_are_specific_number_enemies_dead(security_guard, 24) set_blocking_of_non_temporary_events(dave.ped, true) clear_ped_tasks(dave.ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3610.7813, 3729.3533, 28.6908>>, <<3621.96, 3750.96, 30.27>>, 2.0, false) //task_seek_cover_to_cover_point(null, cover_point[27], <<3621.96, 3750.96, 30.27>>, 3000) task_put_ped_directly_into_cover(null, <<3610.86426, 3729.17578, 28.68974>>, 1000, false, 0.5, true, true, cover_point[27]) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_ai_system_2_status++ endif break case 20 if not has_label_been_triggered("fbi5a_dcome") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dcome", CONV_PRIORITY_high) SET_LABEL_AS_TRIGGERED("fbi5a_dcome", true) endif endif if has_ped_task_finished_2(dave.ped) set_blocking_of_non_temporary_events(dave.ped, false) set_ped_sphere_defensive_area(dave.ped, <<3610.7813, 3729.3533, 28.6908>>, 1.0) task_combat_hated_targets_around_ped(dave.ped, 200.00) dave_ai_system_2_status++ endif if does_blip_exist(fridge.blip) dave_ai_system_2_status++ endif break case 21 if does_blip_exist(fridge.blip) set_blocking_of_non_temporary_events(dave.ped, true) clear_ped_tasks(dave.ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3626.2354, 3762.1626, 27.6171>>, <<3609.5, 3800.3, 30.9>>, 2.0, false, 0.5, 0.5) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_ai_system_2_status++ endif break case 22 if not is_entity_at_coord(dave.ped, <<3626.2354, 3762.1626, 27.6171>>, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(dave.ped) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3626.2354, 3762.1626, 27.6171>>, <<3609.5, 3800.3, 30.9>>, 2.0, false, 0.5, 0.5) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif else if has_ped_task_finished_2(dave.ped) open_sequence_task(seq) task_aim_gun_at_coord(null, <<3610.1, 3765.7, 29.8>>, 5000) task_aim_gun_at_coord(null, <<3609.2, 3801.2, 29.8>>, 5000) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif endif break case 50 open_sequence_task(seq) task_aim_gun_at_entity(null, helicopter.veh, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_ai_system_2_status++ break case 51 request_anim_dict("missfbi5ig_34") if not is_entity_at_coord(dave.ped, <<3626.2354, 3762.1626, 27.6171>>, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(dave.ped, script_task_perform_sequence, 1) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, <<3626.2354, 3762.1626, 27.6171>>, pedmove_run, -1) task_aim_gun_at_entity(null, helicopter.veh, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif endif if has_anim_dict_loaded("missfbi5ig_34") if get_distance_between_coords(<<3626.2354, 3762.1626, 27.6171>>, get_entity_coords(helicopter.veh)) < 40.00 open_sequence_task(seq) task_play_anim_advanced(null, "missfbi5ig_34", "direct_heli_a_dave", get_entity_coords(dave.ped), get_entity_rotation(dave.ped), slow_blend_in) task_go_to_coord_while_aiming_at_entity(null, <<3626.9160, 3749.3779, 27.5710>>, helicopter.veh, 2.0, false) task_aim_gun_at_entity(null, helicopter.veh, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_ai_system_2_status++ endif endif break case 52 if not is_entity_at_coord(dave.ped, <<3626.9160, 3749.3779, 27.5710>>, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(dave.ped, script_task_perform_sequence, 1) open_sequence_task(seq) task_go_to_coord_while_aiming_at_entity(null, <<3626.9160, 3749.3779, 27.5710>>, helicopter.veh, 2.0, false) task_aim_gun_at_entity(null, helicopter.veh, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif endif if not does_blip_exist(blip_current_destination) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3618.8721, 3774.8633, 27.5867>>, <<3555.7, 3783.3, 31.6>>, pedmove_run, false, 0.5, 1.0) task_aim_gun_at_coord(null, <<3555.7, 3783.3, 31.6>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) dave_ai_system_2_status++ endif break case 53 if not is_entity_at_coord(dave.ped, <<3618.8721, 3774.8633, 27.58>>, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(dave.ped, script_task_perform_sequence, 1) open_sequence_task(seq) task_go_to_coord_while_aiming_at_coord(null, <<3618.8721, 3774.8633, 27.5867>>, <<3555.7, 3783.3, 31.6>>, pedmove_run, false, 0.5, 1.0) task_aim_gun_at_coord(null, <<3555.7, 3783.3, 31.6>>, -1) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) endif endif break endswitch endproc func bool is_player_aiming_at_the_monkies() int i = 0 for i = 0 to count_of(monkey) -1 if not is_ped_injured(monkey[i].ped) if IS_BULLET_IN_AREA(get_entity_coords(monkey[i].ped), 2.0) return true endif endif endfor return false endfunc proc dialogue_system_2() switch dialogue_system_2_status case 0 // if not does_entity_exist(chemicals.obj) // if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia25", CONV_PRIORITY_high) dialogue_system_2_status++ // endif // endif break case 1 if is_entity_in_angled_area(player_ped_id(), <<3556.582, 3668.987, 27.128>>, <<3556.929, 3670.957, 30.128>>, 1.500) dialogue_system_2_status++ endif break case 2 if not is_ped_injured(scientist[4].ped) and not is_ped_injured(scientist[5].ped) if not has_label_been_triggered("fbi5a_dia25c") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia25b", CONV_PRIORITY_medium) set_label_as_triggered("fbi5a_dia25b", true) dialogue_time = get_game_timer() dialogue_system_2_status++ endif endif endif if (is_ped_injured(scientist[4].ped) and not is_ped_injured(scientist[5].ped)) or (is_ped_injured(scientist[5].ped) and not is_ped_injured(scientist[4].ped)) if not has_label_been_triggered("fbi5a_dia25c") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia25c", CONV_PRIORITY_medium) REPLAY_RECORD_BACK_FOR_TIME(5.0, 5.0, REPLAY_IMPORTANCE_HIGHEST) set_label_as_triggered("fbi5a_dia25c", true) dialogue_time = get_game_timer() dialogue_system_2_status++ endif endif endif if is_ped_injured(scientist[4].ped) and is_ped_injured(scientist[5].ped) dialogue_system_2_status++ else if lk_timer(dialogue_time, 7000) if not is_any_text_being_displayed(locates_data) switch get_random_int_in_range(0, 2) case 0 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dcome", CONV_PRIORITY_medium) dialogue_time = get_game_timer() endif break case 1 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_scome", CONV_PRIORITY_medium) dialogue_time = get_game_timer() endif break endswitch endif endif endif break case 3 if is_ped_injured(scientist[4].ped) and is_ped_injured(scientist[5].ped) if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia27", CONV_PRIORITY_medium) dialogue_system_2_status++ endif endif endif // if is_entity_in_angled_area(player_ped_id(), <<3553.140, 3674.035, 27.130>>, <<3558.169, 3673.186, 30.130>>, 2.0) // dialogue_system_2_status++ // endif break case 4 if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "FBI5A_al", CONV_PRIORITY_medium) if is_audio_scene_active("FBI_5_GET_TO_NERVE_TOXIN") STOP_AUDIO_SCENE("FBI_5_GET_TO_NERVE_TOXIN") endif start_audio_scene("FBI_5_SHOOTOUT_START") dialogue_system_2_status++ endif endif break case 5 //fbi5a_dia29c //fbi5a_dia29 //bug 1512204 if not is_any_text_being_displayed(locates_data) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia29", CONV_PRIORITY_medium) START_ALARM("FIB_05_BIOTECH_LAB_ALARMS", false) set_label_as_triggered("fbi5a_dia29", true) dialogue_time = get_game_timer() dialogue_system_2_status++ endif endif break case 6 //global variable if not fbi5a_special_ability_help_activated if lk_timer(dialogue_time, 1500) // Different help text for keyboard and mouse as special ability is only one button on PC. IF IS_USING_KEYBOARD_AND_MOUSE(PLAYER_CONTROL) print_help("fbi5a_help_3_KM") ELSE print_help("fbi5a_help_3") ENDIF fbi5a_special_ability_help_activated = true endif endif if security_guard[0].created if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia28", CONV_PRIORITY_high) dialogue_system_2_status++ endif endif break case 7 if not is_any_text_being_displayed(locates_data) print_now("FHT_SEC1", 5000, 1)//allows steves dialogue to play sooner. dialogue_system_2_status = 22 endif break case 8 // if not is_any_text_being_displayed(locates_data) // if create_conversation(scripted_speech, "fbi5aAU", "fbi5amov9", CONV_PRIORITY_medium) // dialogue_system_2_status++ // endif // endif break case 9 break case 22 //default case do nothing break endswitch if security_guard[0].created if not is_any_text_being_displayed(locates_data) if lk_timer(dialogue_time, 10000) if is_ped_shooting(player_ped_id()) if not is_player_aiming_at_the_monkies() if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia34", CONV_PRIORITY_low) dialogue_time = get_game_timer() endif endif elif is_ped_shooting(dave.ped) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia33", CONV_PRIORITY_low) dialogue_time = get_game_timer() endif elif is_ped_shooting(steve.ped) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia32", CONV_PRIORITY_low) dialogue_time = get_game_timer() endif endif endif endif endif endproc proc play_scream_from_random_monkey() if lk_timer(monkey_time[1], 5000) int current_alive_monkies = (total_number_of_monkeys - ped_structure_get_total_number_of_enemies_dead(monkey)) if current_alive_monkies > 0 ped_index monkey_array[total_number_of_monkeys] int monkey_index = 0 int i = 0 for i = 0 to count_of(monkey) - 1 if not is_ped_injured(monkey[i].ped) monkey_array[monkey_index] = monkey[i].ped monkey_index++ endif endfor PLAY_SOUND_FROM_ENTITY(monkey_sound[1], "Monkey_Scream", monkey_array[get_random_int_in_range(0, current_alive_monkies)], "FBI_05_SOUNDS") monkey_time[1] = get_game_timer() endif endif endproc proc monkey_sounds_system() switch monkey_sounds_system_status case 0 request_model(monkey_sounds_object.model) if REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05_MONKEYS") and REQUEST_SCRIPT_AUDIO_BANK("FBI_05_MONKEY_SCREAMS_01") and LOAD_STREAM("Monkey_Stream", "FBI_05_SOUNDS") and has_model_loaded(monkey_sounds_object.model) monkey_sounds_object.obj = create_object(monkey_sounds_object.model, monkey_sounds_object.pos) set_entity_visible(monkey_sounds_object.obj, false) set_entity_collision(monkey_sounds_object.obj, false) freeze_entity_position(monkey_sounds_object.obj, true) set_entity_proofs(monkey_sounds_object.obj, true, true, true, true, true) monkey_sounds_system_status++ endif break case 1 if get_distance_between_coords(get_entity_coords(player_ped_id()), <<3592.4177, 3714.6970, 28.6893>>) < 22 SET_AMBIENT_ZONE_LIST_STATE("FBI_05_MONKEYS", TRUE) //PLAY_STREAM_FROM_POSITION(<<3588, 3719 ,31>>) play_stream_from_object(monkey_sounds_object.obj) monkey_sounds_system_status++ endif break case 2 if has_sound_finished(monkey_sound[0]) if get_distance_between_coords(get_entity_coords(player_ped_id()), <<3592.4177, 3714.6970, 28.6893>>) < 22 if lk_timer(monkey_time[0], 7000) or is_ped_shooting(player_ped_id()) or is_bullet_in_area(<<3592.4177, 3714.6970, 28.6893>>, 10.00, false) PLAY_SOUND_FROM_COORD(monkey_sound[0], "Monkey_Yell", monkey[get_random_int_in_range(0, count_of(monkey))].pos, "FBI_05_SOUNDS") monkey_time[0] = get_game_timer() endif endif endif //scale the sound to the number of monkies alive int current_alive_monkies current_alive_monkies = total_number_of_monkeys - ped_structure_get_total_number_of_enemies_dead(monkey) if current_alive_monkies > 0 SET_VARIABLE_ON_STREAM("Monkey_Stream", to_float(((current_alive_monkies - 0) / (total_number_of_monkeys - 0)))) endif play_scream_from_random_monkey() // printstring("count_of(monkey) = ") // printint((count_of(monkey) - 1)) // printnl() // // printstring("ped_structure_are_specific_number_enemies_dead(monkey ") // printint(ped_structure_get_total_number_of_enemies_dead(monkey)) // printnl() // // // if not ped_structure_are_specific_number_enemies_dead(monkey, (count_of(monkey) - 1 )) // printstring("MORE THAN ONE MONEY ALIVE") // printnl() // endif //only one monkey left if ped_structure_are_specific_number_enemies_dead(monkey, (count_of(monkey) - 1 )) CLEAR_AMBIENT_ZONE_LIST_STATE("FBI_05_MONKEYS") STOP_STREAM() stop_sound(monkey_sound[0]) stop_sound(monkey_sound[1]) monkey_sounds_system_status++ endif break case 3 break endswitch endproc func bool put_monkeys_back_to_idle_anim(ped_index &miss_ped) if get_distance_between_coords(get_entity_coords(player_ped_id()), <<3592.4177, 3714.6970, 28.6893>>) < 22 if not is_ped_shooting(player_ped_id()) return true endif else if not is_bullet_in_area(get_entity_coords(miss_ped), 4.0) return true endif endif return false endfunc //bool unfreeze_monkies = false proc monkey_anim_system() int i // if not unfreeze_monkies // if get_distance_between_coords(get_entity_coords(player_ped_id()), <<3586.7590, 3702.9053, 27.9973>>) < 10 // for i = 0 to count_of(monkey) - 1 // if does_entity_exist(monkey[i].ped) // if not is_ped_injured(monkey[i].ped) // freeze_entity_position(monkey[i].ped, false) // endif // endif // endfor // unfreeze_monkies = true // endif // endif for i = 0 to count_of(monkey) - 1 if not is_ped_injured(monkey[i].ped) if not is_ped_ragdoll(monkey[i].ped) switch monkey_anim_status[i] case 0 switch i case 0 case 4 case 6 case 9 case 11 case 13 open_sequence_task(seq) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_a_idle", normal_blend_in, normal_blend_out, -1, af_looping) close_sequence_task(seq) task_perform_sequence(monkey[i].ped, seq) clear_sequence_task(seq) break case 1 case 3 case 5 case 8 case 12 case 14 case 16 open_sequence_task(seq) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_b_idle", normal_blend_in, normal_blend_out, -1, af_looping) close_sequence_task(seq) task_perform_sequence(monkey[i].ped, seq) clear_sequence_task(seq) break case 2 case 7 case 10 case 15 open_sequence_task(seq) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_c_idle", normal_blend_in, normal_blend_out, -1, af_looping) close_sequence_task(seq) task_perform_sequence(monkey[i].ped, seq) clear_sequence_task(seq) break endswitch monkey_anim_status[i]++ break case 1 if get_distance_between_coords(get_entity_coords(player_ped_id()), <<3592.4177, 3714.6970, 28.6893>>) < 22 if is_bullet_in_area(get_entity_coords(monkey[i].ped), 4.0) //or is_bullet_in_area(<<3592.4177, 3714.6970, 28.6893>>, 10.00, false) or is_ped_shooting(player_ped_id()) switch i case 0 case 4 case 6 case 9 case 11 case 13 open_sequence_task(seq) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_a_freakout_in", normal_blend_in, normal_blend_out, -1) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_a_freakout_loop", instant_blend_in, normal_blend_out, -1, af_looping) //5000 close_sequence_task(seq) task_perform_sequence(monkey[i].ped, seq) clear_sequence_task(seq) break case 1 case 3 case 5 case 8 case 12 case 14 case 16 open_sequence_task(seq) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_b_freakout_in", normal_blend_in, normal_blend_out, -1) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_b_freakout_loop", instant_blend_in, normal_blend_out, -1, af_looping) close_sequence_task(seq) task_perform_sequence(monkey[i].ped, seq) clear_sequence_task(seq) break case 2 case 7 case 10 case 15 open_sequence_task(seq) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_c_freakout_in", normal_blend_in, normal_blend_out, -1) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_c_freakout_loop", instant_blend_in, normal_blend_out, -1, af_looping) close_sequence_task(seq) task_perform_sequence(monkey[i].ped, seq) clear_sequence_task(seq) break endswitch monkey_anim_status[i]++ endif endif break case 2 if put_monkeys_back_to_idle_anim(monkey[i].ped) switch i case 0 case 4 case 6 case 9 case 11 case 13 if is_entity_playing_anim(monkey[i].ped, "missfbi5ig_30monkeys", "monkey_a_freakout_loop") if GET_ENTITY_ANIM_CURRENT_TIME(monkey[i].ped, "missfbi5ig_30monkeys", "monkey_a_freakout_loop") > 0.99 open_sequence_task(seq) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_a_freakout_out", normal_blend_in, normal_blend_out, -1) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_a_idle", normal_blend_in, normal_blend_out, -1, af_looping) close_sequence_task(seq) task_perform_sequence(monkey[i].ped, seq) clear_sequence_task(seq) monkey_anim_status[i] = 1 endif endif break case 1 case 3 case 5 case 8 case 12 case 14 case 16 if is_entity_playing_anim(monkey[i].ped, "missfbi5ig_30monkeys", "monkey_b_freakout_loop") if GET_ENTITY_ANIM_CURRENT_TIME(monkey[i].ped, "missfbi5ig_30monkeys", "monkey_b_freakout_loop") > 0.99 open_sequence_task(seq) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_b_freakout_out", normal_blend_in, normal_blend_out, -1) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_b_idle", normal_blend_in, normal_blend_out, -1, af_looping) close_sequence_task(seq) task_perform_sequence(monkey[i].ped, seq) clear_sequence_task(seq) monkey_anim_status[i] = 1 endif endif break case 2 case 7 case 10 case 15 if is_entity_playing_anim(monkey[i].ped, "missfbi5ig_30monkeys", "monkey_c_freakout_loop") // if i = 12 // printstring("plying anim") // printnl() // // printfloat(GET_ENTITY_ANIM_CURRENT_TIME(monkey[i].ped, "missfbi5ig_30monkeys", "monkey_c_freakout_loop")) // printnl() // // endif if GET_ENTITY_ANIM_CURRENT_TIME(monkey[i].ped, "missfbi5ig_30monkeys", "monkey_c_freakout_loop") > 0.99 open_sequence_task(seq) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_c_freakout_out", normal_blend_in, normal_blend_out, -1) task_play_anim(null, "missfbi5ig_30monkeys", "monkey_c_idle", normal_blend_in, normal_blend_out, -1, af_looping) close_sequence_task(seq) task_perform_sequence(monkey[i].ped, seq) clear_sequence_task(seq) monkey_anim_status[i] = 1 endif // else // // if i = 12 // printstring("NOT plying anim") // printnl() // // endif // endif break endswitch // endif endif break endswitch endif else if not monkey[i].created request_model(monkey[i].model) request_anim_dict("missfbi5ig_30Monkeys") if has_model_loaded(monkey[i].model) and has_anim_dict_loaded("missfbi5ig_30Monkeys") monkey[i].ped = create_ped(pedtype_mission, monkey[i].model, monkey[i].pos, monkey[i].heading) //set_entity_load_collision_flag(monkey[i].ped, true) //freeze_entity_position(monkey[i].ped, true) //activate_physics(monkey[i].ped) setup_buddy_attributes(monkey[i]) set_ped_can_ragdoll(monkey[i].ped, true) monkey[i].created = true set_ped_config_flag(monkey[i].ped, PCF_AllowNearbyCoverUsage, true) //allows enemy to take cover here see bug 994336 set_ped_dies_when_injured(monkey[i].ped, true) set_ped_name_debug(monkey[i].ped, monkey[i].name) set_blocking_of_non_temporary_events(monkey[i].ped, true) endif //temp debug test remove //unfreeze_monkies = false endif //set_entity_health(monkey[i].ped, 2) endif endfor endproc proc shootout_audio_event_system() switch shootout_audio_event_system_status case 0 if IS_ALARM_PLAYING("FIB_05_BIOTECH_LAB_ALARMS") trigger_music_event("FBI5A_ALARM_MA") shootout_audio_event_system_status++ endif break case 1 if is_entity_in_angled_area(player_ped_id(), <<3570.549, 3695.681, 26.326>>, <<3570.039, 3693.030, 29.126>>, 1.5) trigger_music_event("FBI5A_FIGHT_START_MA") shootout_audio_event_system_status++ endif break case 2 if prepare_music_event("FBI5A_BLUE_DOOR") if security_guard[15].created trigger_music_event("FBI5A_BLUE_DOOR") shootout_audio_event_system_status++ endif endif break case 3 if is_entity_in_angled_area(player_ped_id(), <<3599.956, 3705.828, 28.694>>, <<3604.130, 3703.076, 31.994>>, 1.5) trigger_music_event("FBI5A_FIGHT_RAMP_UP_MA") shootout_audio_event_system_status++ endif break case 4 break endswitch endproc proc shootout_audio_scene_system() switch shootout_audio_scene_system_status case 0 if is_entity_in_angled_area(player_ped_id(), <<3596.862, 3691.483, 27.829>>, <<3599.352, 3689.805, 30.827>>, 2.1) start_audio_scene("FBI_5_SHOOTOUT_GUARD_RUNS_OUT") shootout_audio_scene_system_status++ endif break case 1 if security_guard[9].created if is_ped_injured(security_guard[9].ped) if is_audio_scene_active("FBI_5_SHOOTOUT_GUARD_RUNS_OUT") stop_audio_scene("FBI_5_SHOOTOUT_GUARD_RUNS_OUT") endif start_audio_scene("FBI_5_SHOOTOUT_ANIMAL_LAB") shootout_audio_scene_system_status++ endif endif break case 2 break endswitch endproc proc shootout() REPLAY_DISABLE_CAMERA_MOVEMENT_THIS_FRAME() //Fix for bug 2217405 disable_friendly_fire_audio() IF e_section_stage = SECTION_STAGE_SETUP stop_ped_speaking(dave.ped, false) stop_ped_speaking(steve.ped, false) trigger_music_event("FBI5A_CHEM_START") SET_INSTANCE_PRIORITY_HINT(INSTANCE_HINT_SHOOTING) release_named_script_audio_bank("SCRIPT\\FBI_05_GRAB_TOXIN") //SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(2, "load chemicals into container") e_section_stage = SECTION_STAGE_RUNNING endif IF e_section_stage = SECTION_STAGE_RUNNING if shootout_master_flow_system() e_section_stage = SECTION_STAGE_CLEANUP endif disable_friendly_fire_audio() dialogue_system_2() dave_ai_system_2() steve_ai_system_2() scientist_4_ai_system() scientist_5_ai_system() check_for_scientists_being_stunned() ped_structure_are_all_enemies_dead(scientist, true, true) security_guard_ai_system() check_for_security_guard_being_stunned() monkey_sounds_system() monkey_anim_system() shootout_audio_event_system() gas_mask_audio_system() shootout_audio_scene_system() // if is_entity_in_angled_area(truck.veh, <<3605.959, 3745.803, 27.694>>, <<3629.080, 3729.311, 31.694>>, 25.000) // LOCK_FORKLIFT_FORKS(forklift_truck.veh) // endif endif if e_section_stage = section_stage_cleanup shootout_audio_event_system() e_mission_stage = STAGE_LOAD_FRIDGE e_section_stage = SECTION_STAGE_SETUP endif IF e_section_stage = SECTION_STAGE_SKIP int i KILL_ANY_CONVERSATION() //---------SKIP TO END OF THE WHOLE SHOOTOUT for i = 0 to count_of(patrol_security_guard) - 1 if does_entity_exist(patrol_security_guard[i].ped) delete_ped(patrol_security_guard[i].ped) set_model_as_no_longer_needed(patrol_security_guard[i].model) endif if does_blip_exist(patrol_security_guard[i].blip) remove_blip(patrol_security_guard[i].blip) endif endfor for i = 0 to count_of(security_guard) - 1 if does_entity_exist(security_guard[i].ped) delete_ped(security_guard[i].ped) set_model_as_no_longer_needed(security_guard[i].model) endif if does_blip_exist(security_guard[i].blip) remove_blip(security_guard[i].blip) endif endfor for i = 0 to count_of(scientist) - 1 if not is_ped_injured(scientist[i].ped) delete_ped(scientist[i].ped) set_model_as_no_longer_needed(scientist[i].model) endif if does_blip_exist(scientist[i].blip) remove_blip(scientist[i].blip) endif endfor clear_ped_tasks_immediately(player_ped_id()) set_entity_coords(player_ped_id(), <<3613.4080, 3739.4495, 27.6921>>) set_entity_heading(player_ped_id(), 144.6041) clear_ped_tasks_immediately(dave.ped) set_entity_coords(dave.ped, <<3606.5066, 3729.5735, 28.6912>>) set_entity_heading(dave.ped, 322.8864) dave_ai_system_1_status = 37 clear_ped_tasks_immediately(steve.ped) set_entity_coords(steve.ped, <<3614.3503, 3722.5393, 28.6912>>) set_entity_heading(steve.ped, 342.22) steve_ai_system_1_status = 28 set_label_as_triggered("fbi5asteve0", true) e_section_stage = SECTION_STAGE_CLEANUP ENDIF endproc proc collect_crate_dialogue_system() switch collect_crate_dialogue_system_status case 0 IF PLAY_SINGLE_LINE_FROM_CONVERSATION(scripted_speech, "fbi5aAU", "fbi5a_switch", "fbi5a_switch_1", CONV_PRIORITY_HIGH) REPLAY_RECORD_BACK_FOR_TIME(1.0, 10.0, REPLAY_IMPORTANCE_HIGHEST) collect_crate_dialogue_system_status++ endif break case 1 if does_blip_exist(blip_current_destination) if not is_any_text_being_displayed(locates_data) PRINT_NOW("DROP_CRATE", DEFAULT_GOD_TEXT_TIME, 0) collect_crate_dialogue_system_status++ endif endif break case 2 if get_distance_between_coords(get_entity_coords(helicopter.veh), get_entity_coords(crate.obj)) < 45 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_crate3", conv_priority_medium) collect_crate_dialogue_system_status++ endif endif // if get_distance_between_coords(get_entity_coords(helicopter.veh), v_drop_crate_loc) < 150.00 // if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_crate1", conv_priority_medium) // collect_crate_dialogue_system_status++ // endif // endif break case 3 if get_distance_between_coords(get_entity_coords(helicopter.veh), get_entity_coords(crate.obj)) < 20 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_crate4", conv_priority_medium) collect_crate_dialogue_system_status++ endif endif // crate.pos = get_entity_coords(crate.obj) // // if lk_timer(dialogue_time, 7000) // if not IS_ENTITY_IN_ANGLED_AREA(PLAYER_PED_ID(), <<3623.677, 3769.895, 27.298635>>, <<3639.052, 3759.721, 37.276325>>, 16.700) // // if get_distance_between_coords(get_entity_coords(helicopter.veh), v_drop_crate_loc) < 50.00 // and (crate.pos.z > 35.00) // // if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_crate2", conv_priority_medium) // dialogue_time = get_game_timer() // endif // // elif (crate.pos.z < (28.930 + 1.0)) // // if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_crate3", conv_priority_medium) // dialogue_time = get_game_timer() // endif // // endif // // else // // collect_crate_dialogue_system_status++ // // endif // endif // if not is_any_text_being_displayed(locates_data) // // if lk_timer(dialogue_time, 10000) // // IF IS_ENTITY_IN_ANGLED_AREA(PLAYER_PED_ID(), <<3623.677, 3769.895, 27.298635>>, <<3639.052, 3759.721, 37.276325>>, 16.700) // // crate.pos = get_entity_coords(crate.obj) // // IF (get_entity_pitch(crate.obj) > -1.2) and (get_entity_pitch(crate.obj) < 1.2) // if (get_entity_roll(crate.obj) > -1.2) and (get_entity_roll(crate.obj) < 1.2) // if (crate.pos.z < (28.930 + 0.15))//28.930 = exact height of crate when it lies on the ground. // if get_entity_speed(crate.obj) < 1.0 // if get_entity_heading(crate.obj) < x // if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_crate2", conv_priority_medium) // dialogue_time = get_game_timer() // endif // endif // endif // endif // endif // endif // // endif // // endif // // if is player in bigger locate with helicopter near the wharehouse then after 40s // have the dialogue playing hurry up and land this thing. break endswitch endproc proc LOAD_FRIDGE() REPLAY_DISABLE_CAMERA_MOVEMENT_THIS_FRAME() //Fix for bug 2217405 IF e_section_stage = SECTION_STAGE_SETUP REQUEST_MODEL(model_trevor) REQUEST_MODEL(helicopter.model) request_model(flare[0].model) request_model(nerve_agent_store.model) request_model(nerve_agent.model) request_anim_dict("missfbi5ig_33") request_vehicle_recording(007, "lkfbi5a") LOAD_STREAM_WITH_START_OFFSET("STASH_TOXIN_STREAM", 2400, "FBI_05_SOUNDS") if has_model_loaded(model_trevor) and has_model_loaded(helicopter.model) and has_model_loaded(flare[0].model) and has_model_loaded(nerve_agent_store.model) and has_model_loaded(nerve_agent.model) and has_anim_dict_loaded("missfbi5ig_33") and has_vehicle_recording_been_loaded(007, "lkfbi5a") and LOAD_STREAM_WITH_START_OFFSET("STASH_TOXIN_STREAM", 2400, "FBI_05_SOUNDS") set_entity_proofs(dave.ped, false, false, false, false, false, true) set_entity_proofs(steve.ped, false, false, false, false, false, true) trigger_music_event("FBI5A_FIGHT_END_MA") if is_audio_scene_active("FBI_5_SHOOTOUT_START") STOP_AUDIO_SCENE("FBI_5_SHOOTOUT_START") endif if is_audio_scene_active("FBI_5_SHOOTOUT_ANIMAL_LAB") STOP_AUDIO_SCENE("FBI_5_SHOOTOUT_ANIMAL_LAB") endif if is_audio_scene_active("FBI_5_MILITARY_SHOOTOUT") STOP_AUDIO_SCENE("FBI_5_MILITARY_SHOOTOUT") endif start_audio_scene("FBI_5_GO_TO_CONTAINER") fridge.blip = create_blip_for_object(fridge.obj) SET_BLIP_NAME_FROM_TEXT_FILE(fridge.blip, "fbi5a_god_24") set_blip_scale(fridge.blip, 1.0) e_section_stage = SECTION_STAGE_RUNNING endif endif IF e_section_stage = SECTION_STAGE_RUNNING IF load_fridge_status > 0 IF IS_CUTSCENE_SKIP_BUTTON_JUST_PRESSED_WITH_DELAY() IF load_fridge_status > 0 REPLAY_CANCEL_EVENT() ENDIF load_fridge_status = 22 ENDIF ENDIF switch load_fridge_status case 0 // if not HAS_LABEL_BEEN_TRIGGERED("fbi5a_inst2") // if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_inst2", CONV_PRIORITY_medium) // SET_LABEL_AS_TRIGGERED("fbi5a_inst2", true) // endif // endif if not HAS_LABEL_BEEN_TRIGGERED("fbi5a_dia50b") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_dia50b", CONV_PRIORITY_medium) SET_LABEL_AS_TRIGGERED("fbi5a_dia50b", true) endif endif if not HAS_LABEL_BEEN_TRIGGERED("CHEM_FRDIGE") if HAS_LABEL_BEEN_TRIGGERED("fbi5a_dia50b") if not is_any_text_being_displayed(locates_data) print_now("CHEM_FRDIGE", default_god_text_time, 1) SET_LABEL_AS_TRIGGERED("CHEM_FRDIGE", true) endif endif endif if is_ped_on_foot(player_ped_id()) if is_entity_in_angled_area(player_ped_id(), get_offset_from_entity_in_world_coords(crate.obj, <<-2.100, -3.000, -1.400>>), get_offset_from_entity_in_world_coords(crate.obj, <<2.100, -3.000, 1.600>>), 2.300) //2.6 or is_entity_in_angled_area(player_ped_id(), get_offset_from_entity_in_world_coords(crate.obj, <<-0.75, -1.50, -1.400>>), get_offset_from_entity_in_world_coords(crate.obj, <<0.75, -1.500, 1.600>>), 2.300) if start_new_cutscene_no_fade() REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) if does_blip_exist(fridge.blip) remove_blip(fridge.blip) endif if is_audio_scene_active("FBI_5_GO_TO_CONTAINER") STOP_AUDIO_SCENE("FBI_5_GO_TO_CONTAINER") endif start_audio_scene("FBI_5_LOAD_UP_SYNC_SCENE") clear_ped_tasks_immediately(player_ped_id()) clear_area(<<3638.322, 3771.815, 28.525>>, 100.00, true) scene_pos = get_entity_coords(fridge.obj) scene_rot = get_entity_rotation(fridge.obj) players_scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(player_ped_id(), players_scene_id, "missfbi5ig_33", "mid_mission_switch_player0", INSTANT_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS) force_ped_ai_and_animation_update(player_ped_id()) camera_a = CREATE_CAM("DEFAULT_ANIMATED_CAMERA") PLAY_SYNCHRONIZED_CAM_ANIM(camera_a, players_scene_id, "mid_mission_switch_cam", "missfbi5ig_33") SET_CAM_ACTIVE (camera_a, true) RENDER_SCRIPT_CAMS(TRUE, FALSE) //attach tube to players ph_right_hand //create_object nerve_agent.obj = create_object(nerve_agent.model, get_offset_from_entity_in_world_coords(player_ped_id(), <<0.0, 0.0, 1.5>>)) //ATTACH_ENTITY_TO_ENTITY(nerve_agent.obj, player_ped_id(), get_ped_bone_index(player_ped_id(), BONETAG_PH_R_HAND), <<0.0, 0.0, 0.0>>, <<0.0, 0.0, 0.0>>) PLAY_SYNCHRONIZED_ENTITY_ANIM(nerve_agent.obj, players_scene_id, "mid_mission_switch_tube", "missfbi5ig_33", instant_BLEND_IN) force_entity_ai_and_animation_update(nerve_agent.obj) nerve_agent_store.obj = create_object(nerve_agent_store.model, get_offset_from_entity_in_world_coords(player_ped_id(), <<0.0, 0.0, 1.5>>)) PLAY_SYNCHRONIZED_ENTITY_ANIM(nerve_agent_store.obj, players_scene_id, "mid_mission_switch_vial", "missfbi5ig_33", instant_BLEND_IN) force_entity_ai_and_animation_update(nerve_agent_store.obj) set_synchronized_scene_phase(players_scene_id, 0.08) PLAY_STREAM_FRONTEND() set_current_ped_weapon(player_ped_id(), weapontype_unarmed) //loads the steeam for the cutum switch cam and addes null trevor fo dialogue eSwitchCamState = SWITCH_CAM_REQUEST_ASSETS HANDLE_SWITCH_CAM_TO_TREVOR_IN_HELI(scsSwitchCamToTrevorInHeli) load_fridge_status++ endif endif endif break case 1 if not HAS_LABEL_BEEN_TRIGGERED("fbi5a_inst2") if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_inst2", CONV_PRIORITY_medium) SET_LABEL_AS_TRIGGERED("fbi5a_inst2", true) endif endif if is_synchronized_scene_running(players_scene_id) if get_synchronized_scene_phase(players_scene_id) > 0.31 fridge_ptfx = START_PARTICLE_FX_LOOPED_AT_COORD("scr_fbi5_dry_ice", <<3638.420, 3772.000, 28.600>>, <<0.0, 0.0, 0.0>>) load_fridge_status++ endif endif break case 2 if is_synchronized_scene_running(players_scene_id) if get_synchronized_scene_phase(players_scene_id) >= 0.7 if does_particle_fx_looped_exist(fridge_ptfx) STOP_PARTICLE_FX_LOOPED(fridge_ptfx) endif endif if get_synchronized_scene_phase(players_scene_id) >= fMichaelToTrevor_StartDialogue if collect_crate_dialogue_system_status < 1 collect_crate_dialogue_system() endif ENDIF if get_synchronized_scene_phase(players_scene_id) >= fMichaelToTrevor_EndSyncScenePhase e_section_stage = SECTION_STAGE_CLEANUP endif endif break case 22 if not is_screen_faded_out() if not is_screen_fading_out() do_screen_fade_out(default_fade_time) endif else // clear_ped_tasks_immediately(player_ped_id()) // set_entity_coords(player_ped_id(), <<3635.9595, 3770.0081, 27.5157>>) // set_entity_heading(player_ped_id(), 72.4378) SET_SYNCHRONIZED_SCENE_PHASE(players_scene_id, fMichaelToTrevor_EndSyncScenePhase) e_section_stage = SECTION_STAGE_CLEANUP endif break endswitch dave_ai_system_2() steve_ai_system_2() gas_mask_audio_system() // if is_entity_in_angled_area(forklift_truck.veh, <<3605.959, 3745.803, 27.694>>, <<3629.080, 3729.311, 31.694>>, 25.000) // LOCK_FORKLIFT_FORKS(forklift_truck.veh) // endif endif IF e_section_stage = SECTION_STAGE_CLEANUP CLEAR_TRIGGERED_LABELS() stop_stream() REPLAY_STOP_EVENT() if is_synchronized_scene_running(players_scene_id) STOP_SYNCHRONIZED_ENTITY_ANIM(nerve_agent_store.obj, instant_BLEND_OUT, true) endif if does_particle_fx_looped_exist(fridge_ptfx) STOP_PARTICLE_FX_LOOPED(fridge_ptfx) endif delete_object(nerve_agent.obj) set_model_as_no_longer_needed(nerve_agent.model) if does_entity_exist(nerve_agent_store.obj) delete_object(nerve_agent_store.obj) endif set_model_as_no_longer_needed(nerve_agent_store.model) // clear_ped_tasks_immediately(player_ped_id()) // set_entity_coords(player_ped_id(), <<3637.0654, 3768.1030, 27.5156>>) // set_entity_heading(player_ped_id(), 79.3423) // SET_PED_USING_ACTION_MODE(player_ped_id(), true) // force_ped_motion_state(player_ped_id(), MS_ACTIONMODE_idle) // force_ped_ai_and_animation_update(player_ped_id()) if not is_screen_faded_out() end_cutscene_no_fade(false, false, false, 0, 0, 3000, false, false, false) STOP_RENDERING_SCRIPT_CAMS_USING_CATCH_UP() else end_cutscene(false, 0, 0, false) endif //[MF] Creating the helicopter and setting up switch cam early, we need it to render the frame that the cutscene ends. eSwitchCamState = SWITCH_CAM_SETUP_SPLINE_1 HANDLE_SWITCH_CAM_TO_TREVOR_IN_HELI(scsSwitchCamToTrevorInHeli) e_mission_stage = STAGE_HOTSWAP_TO_CHOPPER//STAGE_GET_FORKLIFT e_section_stage = SECTION_STAGE_SETUP ENDIF IF e_section_stage = SECTION_STAGE_SKIP if load_fridge_status = 0 set_entity_coords(player_ped_id(), get_offset_from_entity_in_world_coords(crate.obj, <<0.0, -4.0, -1.0>>), true, true, true) else DO_SAFE_FADE_OUT() e_section_stage = SECTION_STAGE_CLEANUP endif ENDIF // printint(enum_to_int(e_section_stage) // printnl() endproc proc disable_helicopter_flying_controls() disable_control_action(player_control, INPUT_VEH_FLY_ATTACK) disable_control_action(player_control, INPUT_VEH_ROOF) disable_control_action(player_control, INPUT_VEH_GRAPPLING_HOOK) endproc //PURPOSE: Once the player has loaded the chemicals into the crate, they need to find a forklift truck float speed_multiplier = 0.0 //int ropes_attached_count = 0 //bool debug_rope_attached_flag = false //PURPOSE: Once the crate has been collected with the forklift, need to swap to Franklin who is flying a chopper transporting a large crate. PROC HOTSWAP_TO_CHOPPER() disable_helicopter_flying_controls() IF e_section_stage = SECTION_STAGE_SETUP //Setup Franklin's chopper REQUEST_MODEL(helicopter.model) REQUEST_MODEL(model_trevor) request_model(flare[0].model) request_vehicle_recording(007, "lkfbi5a") request_ptfx_asset() IF HAS_MODEL_LOADED(helicopter.model) AND HAS_MODEL_LOADED(model_trevor) and has_model_loaded(flare[0].model) and has_vehicle_recording_been_loaded(007, "lkfbi5a") and has_ptfx_asset_loaded() remove_anim_dict("missfbi5ig_31") remove_anim_dict("missfbi5ig_32") remove_anim_dict("missfbi5ig_33") //[MF] This setup is done by the custom switch cam. Wrapped in an 'IF' statement to ensure we don't execute it twice. IF NOT DOES_ENTITY_EXIST(helicopter.veh) VECTOR v_chopper_start_pos = get_position_of_vehicle_recording_at_time(007, 100, "lkfbi5a") FLOAT f_chopper_start_heading = 301.8604 //322.8308 helicopter.veh = CREATE_VEHICLE(helicopter.model, v_chopper_start_pos, f_chopper_start_heading) SET_VEHICLE_AS_RESTRICTED(helicopter.veh, 0) ENDIF SET_VEHICLE_ENGINE_CAN_DEGRADE(helicopter.veh, false) SET_MODEL_AS_NO_LONGER_NEEDED(helicopter.model) SET_VEHICLE_ENGINE_ON(helicopter.veh, TRUE, TRUE) SET_HELI_BLADES_FULL_SPEED(helicopter.veh) //FREEZE_ENTITY_POSITION(helicopter.veh, TRUE) SET_VEH_RADIO_STATION(helicopter.veh, "OFF") REMOVE_PICK_UP_ROPE_FOR_CARGOBOB(helicopter.veh) //SET_VEHICLE_LOD_MULTIPLIER(helicopter.veh, 1.5) //[MF] This setup is also done by the custom switch cam. Wrapped in an 'IF' statement to ensure we don't execute it twice. IF NOT IS_PLAYBACK_GOING_ON_FOR_VEHICLE(helicopter.veh) start_playback_recorded_vehicle(helicopter.veh, 007, "lkfbi5a") force_playback_recorded_vehicle_update(helicopter.veh) pause_playback_recorded_vehicle(helicopter.veh) ENDIF CREATE_PLAYER_PED_INSIDE_VEHICLE(selector_ped.pedID[SELECTOR_PED_TREVOR], CHAR_TREVOR, helicopter.veh) SET_SELECTOR_PED_HINT(selector_ped, selector_ped_trevor) SET_SELECTOR_PED_PRIORITY(selector_ped, selector_ped_michael, selector_ped_trevor, number_of_selector_peds) add_ped_for_dialogue(scripted_speech, 2, selector_ped.pedID[SELECTOR_PED_TREVOR], "trevor") trigger_music_event("FBI5A_SWITCH_HELI_MA") //print_now("H2PART3_help0", default_god_text_time, 1) iCurrentEvent = 0 e_section_stage = SECTION_STAGE_RUNNING // SECTION_STAGE_CLEANUP ENDIF ENDIF IF e_section_stage = SECTION_STAGE_RUNNING int i printint(iCurrentEvent) printnl() IF iCurrentEvent = 0 // IF UPDATE_SELECTOR_HUD(selector_ped, FALSE) // if HAS_SELECTOR_PED_BEEN_SELECTED(selector_ped, SELECTOR_PED_TREVOR) // // IF NOT selector_cam.bSplineCreated CLEAR_SELECTOR_PED_PRIORITY(selector_ped) for i = 0 to count_of(monkey) - 1 if does_entity_exist(monkey[i].ped) delete_ped(monkey[i].ped) endif set_model_as_no_longer_needed(monkey[0].model) endfor CLEAR_AMBIENT_ZONE_LIST_STATE("FBI_05_MONKEYS") if not has_sound_finished(monkey_sound[0]) stop_sound(monkey_sound[0]) endif if not has_sound_finished(monkey_sound[1]) stop_sound(monkey_sound[1]) endif if does_entity_exist(monkey_sounds_object.obj) delete_object(monkey_sounds_object.obj) endif set_model_as_no_longer_needed(monkey_sounds_object.model) remove_anim_dict("missfbi5ig_30Monkeys") if is_audio_scene_active("FBI_5_LOAD_UP_SYNC_SCENE") STOP_AUDIO_SCENE("FBI_5_LOAD_UP_SYNC_SCENE") endif start_audio_scene("FBI_5_FLY_TO_CONTAINER") clear_prints() if does_blip_exist(steve.blip) remove_blip(steve.blip) endif selector_cam.bSplineCreated = TRUE selector_cam.camType = SELECTOR_CAM_STRAIGHT_INTERP selector_cam.pedTo = selector_ped.pedID[SELECTOR_PED_trevor] unpause_playback_recorded_vehicle(helicopter.veh) set_playback_speed(helicopter.veh, 1.0) set_entity_load_collision_flag(helicopter.veh, true) iCurrentEvent++ ELIF iCurrentEvent = 1 IF NOT HANDLE_SWITCH_CAM_TO_TREVOR_IN_HELI(scsSwitchCamToTrevorInHeli) SET_GAMEPLAY_CAM_FOLLOW_PED_THIS_UPDATE(selector_cam.pedTo) //set_gameplay_cam_relative_heading(relative_player_heading) if not has_label_been_triggered("FBI5A_HELI_OS") if prepare_music_event("FBI5A_HELI_OS") if get_cam_spline_phase(scsSwitchCamToTrevorInHeli.ciSpline) > 0.93 trigger_music_event("FBI5A_HELI_OS") set_label_as_triggered("FBI5A_HELI_OS", true) endif endif endif IF selector_cam.bOKToSwitchPed IF NOT selector_cam.bPedSwitched IF GET_CAM_SPLINE_NODE_INDEX(scsSwitchCamToTrevorInHeli.ciSpline) >= scsSwitchCamToTrevorInHeli.iCamSwitchFocusNode IF MAKE_SELECTOR_PED_SELECTION(selector_ped, SELECTOR_PED_TREVOR) IF TAKE_CONTROL_OF_SELECTOR_PED(selector_ped) SET_MODEL_AS_NO_LONGER_NEEDED(model_trevor) IF IS_VEHICLE_DRIVEABLE(helicopter.veh) FREEZE_ENTITY_POSITION(helicopter.veh, FALSE) FREEZE_ENTITY_POSITION(crate.obj, FALSE) ENDIF setup_relationship_contact(selector_ped.pedID[selector_ped_michael], true) ENDIF setup_relationship_contact(selector_ped.pedID[selector_ped_michael], true) selector_cam.bPedSwitched = TRUE ENDIF ENDIF ENDIF ENDIF ELSE //initialise switch mission variables back. selector_cam.bOKToSwitchPed = false selector_cam.bPedSwitched = false if does_blip_exist(dave.blip) remove_blip(dave.blip) endif if does_blip_exist(steve.blip) remove_blip(steve.blip) endif stop_playback_recorded_vehicle(helicopter.veh) //remove the masks clear_all_ped_props(dave.ped) set_entity_proofs(dave.ped, false, false, false, false, false, false) clear_all_ped_props(steve.ped) set_entity_proofs(steve.ped, false, false, false, false, false, false) remove_player_ped_props(selector_ped.pedID[selector_ped_michael]) //clear_all_ped_props(selector_ped.pedID[selector_ped_michael]) set_entity_proofs(selector_ped.pedID[selector_ped_michael], false, false, false, false, false, false) INFORM_MISSION_STATS_OF_INCREMENT(FBI5_SWITCHES) e_section_stage = SECTION_STAGE_CLEANUP ENDIF ENDIF if get_current_player_ped_enum() = char_trevor IF NOT IS_ENTITY_WAITING_FOR_WORLD_COLLISION(helicopter.veh) // vector heli_velocity // if speed_multiplier < 1.2 speed_multiplier += 0.05 if speed_multiplier >= 1.2 speed_multiplier = 1.2 endif endif // //// printfloat(get_frame_time() * speed_multiplier * 100.00) //// printnl() // // heli_velocity = <<8.59556, 5.78886, 0.0>> * get_frame_time() * speed_multiplier * 36.00 // // set_entity_velocity(helicopter.veh, heli_velocity) // // set_entity_coords(crate.obj, get_offset_from_entity_in_world_coords(helicopter.veh, <<0.0, 0.0, -8.0>>)) // set_entity_velocity(crate.obj, heli_velocity) ENDIF endif dave_ai_system_2() steve_ai_system_2() // //delete forklift and create a new one when you are in full control of helicopter - might need to delete // //get offset // // printstring("forklift pos: ") // printvector(get_entity_coords(forklift_truck.veh)) // printnl() // // printstring("forklift heading: ") // printfloat(get_entity_heading(forklift_truck.veh)) // printnl() // // printstring("fridge pallet pos: ") // printvector(get_entity_coords(fridge_pallet.obj)) // printnl() // // printstring("fridge pallet heading: ") // printfloat(get_entity_heading(fridge_pallet.obj)) // printnl() ENDIF IF e_section_stage = SECTION_STAGE_CLEANUP //SET_VEHICLE_LOD_MULTIPLIER(helicopter.veh, 1.0) flare[0].obj = create_object(flare[0].model, v_drop_crate_loc) set_entity_rotation(flare[0].obj, <<0.0, 0.0, 0.0>>) flare_ptfx[0] = START_PARTICLE_FX_LOOPED_ON_entity("scr_fbi5a_flare", flare[0].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) SET_PARTICLE_FX_LOOPED_COLOUR(flare_ptfx[0], 1.0, 0.84, 0.0) // ATTACH_CHOPPER_TO_CONTAINER_WITH_ROPE(helicopter.veh, crate.obj, rope_chopper, b_ropes_created, b_ropes_attached, FALSE, TRUE) //other re-position checks such as making sure the vehicle recordings are not in the way. clear_area(<<3617.3799, 3746.4309, 27.6917>>, 100.00, true) if not is_ped_injured(selector_ped.pedID[SELECTOR_PED_MICHAEL]) clear_ped_tasks_immediately(selector_ped.pedID[SELECTOR_PED_MICHAEL]) //set_ped_into_vehicle(selector_ped.pedID[SELECTOR_PED_MICHAEL], forklift_truck.veh) endif // if IS_ENTITY_ATTACHED_TO_FORKLIFT_FORKS(forklift_truck.veh, fridge_pallet.obj) // detach_pallet_from_forklift_forks(forklift_truck.veh) // endif // set_entity_coords(truck.veh, truck.pos) // set_entity_heading(truck.veh, truck.heading) // set_vehicle_on_ground_properly(truck.veh) //call richard new function clear_ped_tasks_immediately(dave.ped) set_entity_coords(dave.ped, <<3626.2354, 3762.1626, 27.6171>>) set_entity_heading(dave.ped, 33.6764) dave_ai_system_2_status = 50 clear_ped_tasks_immediately(steve.ped) set_entity_coords(steve.ped, <<3629.7551, 3746.9419, 27.6062>>) set_entity_heading(steve.ped, 7.00) steve_ai_system_2_status = 101 SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(5, "land crate with helicopter") e_mission_stage = stage_collect_crate e_section_stage = SECTION_STAGE_SETUP ENDIF IF e_section_stage = SECTION_STAGE_SKIP IF iCurrentEvent = 0 if does_blip_exist(steve.blip) remove_blip(steve.blip) endif clear_help() make_selector_ped_selection(selector_ped, SELECTOR_PED_TREVOR) selector_cam.pedTo = selector_ped.pedID[SELECTOR_PED_TREVOR] selector_cam.bPedSwitched = FALSE iCurrentEvent = 1 endif ENDIF ENDPROC proc request_mocap_data_for_FBI_5B_MCS_1() mocap_streaming_system(crate.pos, 130, 160, "FBI_5B_MCS_1") if can_request_assets_for_cutscene_entity() SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("trevor", player_ped_id()) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("michael", selector_ped.pedID[selector_ped_michael]) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("Dave_FBI", dave.ped) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("Steve_FBI", steve.ped) endif request_model(crate_door_left.model) request_model(crate_door_right.model) request_vehicle_recording(006, "lkfbi5a") request_script_audio_bank("FBI_05_METAL_STRAIN") endproc proc michael_ai_system() if not is_entity_at_coord(selector_ped.pedID[selector_ped_michael], <<3625.9453, 3757.5190, 27.5157>>, <<1.5, 1.5, 1.6>>) if has_ped_task_finished_2(selector_ped.pedID[selector_ped_michael], script_task_perform_sequence, 1) open_sequence_task(seq) TASK_GO_TO_COORD_WHILE_AIMING_AT_entity(null, <<3625.9453, 3757.5190, 27.5157>>, helicopter.veh, pedmove_walk, false, 0.5, 0.5) task_aim_gun_at_entity(null, helicopter.veh, -1, true) close_sequence_task(seq) task_perform_sequence(selector_ped.pedID[selector_ped_michael], seq) clear_sequence_task(seq) endif endif endproc //PURPOSE: Need to place the crate attached to the helicopter just outside the loading bay. PROC collect_crate() // ATTACH_CHOPPER_TO_CONTAINER_WITH_ROPE(helicopter.veh, crate.obj, rope_chopper, b_ropes_created, b_ropes_attached, FALSE) // STABILISE_ENTITY_ATTACHED_TO_HELI(helicopter.veh, crate.obj, f_container_offset_z) REPLAY_DISABLE_CAMERA_MOVEMENT_THIS_FRAME() //Fix for bug 2220305 disable_helicopter_flying_controls() IF e_section_stage = SECTION_STAGE_SETUP IF IS_AUDIO_SCENE_ACTIVE("BIOTECH_HEIST_GASMASK_SCENE") stop_AUDIO_SCENE("BIOTECH_HEIST_GASMASK_SCENE") ENDIF IF not HAS_SOUND_FINISHED(i_sound_gas_mask) stop_sound(i_sound_gas_mask) ENDIF e_section_stage = SECTION_STAGE_RUNNING iCurrentEvent = 0 ENDIF request_mocap_data_for_FBI_5B_MCS_1() IF e_section_stage = SECTION_STAGE_RUNNING IF IS_PED_sitting_In_VEHICLE(PLAYER_PED_ID(), helicopter.veh) //[MF] - Stopping playback of Trevor's Helicopter so player can control it... IF eSwitchCamState = SWITCH_CAM_IDLE IF IS_PLAYBACK_GOING_ON_FOR_VEHICLE(helicopter.veh) STOP_PLAYBACK_RECORDED_VEHICLE(helicopter.veh) ENDIF ENDIF if is_entity_in_angled_area(player_ped_id(), get_offset_from_entity_in_world_coords(crate.obj, <<-3.500, 0.0, 2.5>>), get_offset_from_entity_in_world_coords(crate.obj, <<3.500, 0.0, 12.00>>), 7.8, false) if has_cutscene_loaded()//HAS_CUTSCENE_LOADED_WITH_FAILSAFE() and has_model_loaded(crate_door_left.model) and has_model_loaded(crate_door_right.model) and has_vehicle_recording_been_loaded(006, "lkfbi5a") and request_script_audio_bank("FBI_05_METAL_STRAIN") disable_control_action(PLAYER_CONTROL, INPUT_VEH_EXIT) REMOVE_ALL_BLIPS() e_mission_stage = stage_collect_crate_mocap e_section_stage = SECTION_STAGE_SETUP endif ELSE IF NOT DOES_BLIP_EXIST(blip_current_destination) if is_this_print_being_displayed("GOBACK_CHOPPER") clear_this_print("GOBACK_CHOPPER") endif REMOVE_ALL_BLIPS() blip_current_destination = ADD_BLIP_FOR_COORD(get_offset_from_entity_in_world_coords(crate.obj, <<0.0, 0.0, 2.0>>))//ADD_BLIP_FOR_COORD(v_drop_crate_loc) set_blip_COLOUR(blip_current_destination, BLIP_COLOUR_GREEN) ENDIF ENDIF collect_crate_dialogue_system() ELSE IF NOT DOES_BLIP_EXIST(helicopter.blip) REMOVE_ALL_BLIPS() helicopter.blip = CREATE_BLIP_FOR_VEHICLE(helicopter.veh) IF NOT HAS_LABEL_BEEN_TRIGGERED("GOBACK_CHOPPER") PRINT_NOW("GOBACK_CHOPPER", DEFAULT_GOD_TEXT_TIME, 0) SET_LABEL_AS_TRIGGERED("GOBACK_CHOPPER", TRUE) ENDIF ENDIF ENDIF michael_ai_system() dave_ai_system_2() steve_ai_system_2() ENDIF IF e_section_stage = SECTION_STAGE_SKIP IF NOT IS_ENTITY_DEAD(helicopter.veh) set_entity_coords_no_offset(helicopter.veh, get_offset_from_entity_in_world_coords(crate.obj, <<0.0, -1.6, 7.0>>)) // set_entity_heading(helicopter.veh, 237.2705) // set_entity_coords(crate.obj, <<3625.6089, 3764.1924, 28.930>>) // set_entity_rotation(crate.obj, <<0.0, 0.0, 0.0>>) e_section_stage = SECTION_STAGE_RUNNING ENDIF ENDIF IF e_section_stage = SECTION_STAGE_CLEANUP REMOVE_ALL_BLIPS() e_mission_stage = stage_collect_crate_mocap e_section_stage = SECTION_STAGE_SETUP ENDIF ENDPROC func bool setup_hotswap_cam_to_michael() // float distance_between_peds // int max_distance_limit = 130 // int minimum_distance_limit = 8 // int max_interp_limit = 5000 // int min_interp_limit = 1700 // int interp_time IF NOT selector_cam.bSplineCreated // distance_between_peds = get_distance_between_coords(GET_ENTITY_COORDS(player_ped_id()), GET_ENTITY_COORDS(sSelectorPeds.pedID[SELECTOR_PED_michael])) // // if distance_between_peds > 8.0 // interp_time = round((((distance_between_peds - minimum_distance_limit) / (max_distance_limit - minimum_distance_limit)) * (max_interp_limit - min_interp_limit)) + min_interp_limit) // else // interp_time = 1700 // endif CLEAR_SELECTOR_PED_PRIORITY(selector_ped) clear_help() clear_prints() IF NOT DOES_CAM_EXIST(selector_cam.camID) selector_cam.camID = CREATE_CAM("DEFAULT_SPLINE_CAMERA", FALSE) ENDIF ADD_CAM_SPLINE_NODE(selector_cam.camID, GET_GAMEPLAY_CAM_COORD(), GET_GAMEPLAY_CAM_ROT(), 0) ADD_CAM_SPLINE_NODE(selector_cam.camID, <<3623.297852,3754.481200,30.223562>>, <<-2.431579,0.000000,-27.479588>>, 1200) ADD_CAM_SPLINE_NODE(selector_cam.camID, get_offset_from_entity_in_world_coords(selector_ped.pedID[SELECTOR_PED_michael], <<0.263986, -2.75, 0.8>>), GET_ENTITY_ROTATION(selector_ped.pedID[SELECTOR_PED_michael]), 1700) selector_cam.bSplineCreated = TRUE selector_cam.camType = SELECTOR_CAM_STRAIGHT_INTERP selector_cam.pedTo = selector_ped.pedID[SELECTOR_PED_michael] return true ENDIF return false endfunc func float calculate_acceleration_multiplier(bool accelerate, float &acceleration_multiplier, float target_speed) if accelerate if acceleration_multiplier < target_speed //(current_height - min_height) / (max_height - min_height) * 2.0 acceleration_multiplier += get_frame_time() //* 0.5 endif if acceleration_multiplier >= target_speed acceleration_multiplier = target_speed endif else if acceleration_multiplier > target_speed acceleration_multiplier -= get_frame_time() //* 0.5 endif if acceleration_multiplier <= target_speed acceleration_multiplier = target_speed endif endif printfloat(acceleration_multiplier) printnl() return acceleration_multiplier endfunc proc helicopter_hover_system() float hover_speed = 0.07 float helicopter_amplitude = 0.375 switch helicopter_hover_system_status case 0 helicopter_pos = get_entity_coords(helicopter.veh) helicopter_time = get_game_timer() helicopter_hover_system_status++ break case 1 vector helicopter_sin_pos // hover_speed = angular frequency specifies how many oscillations occur in a unit time e.g 0.07 will take (1 / 0.07) = 14.28s to do one oscillation // get_game_timer() - helicopter_time = (is the angle) - time interval when you move the time the position on the sin curve changes. helicopter_sin_pos.z = helicopter_amplitude * sin((get_game_timer() - helicopter_time) * hover_speed) helicopter_sin_pos += helicopter_pos set_entity_coords_no_offset(helicopter.veh, helicopter_sin_pos) break endswitch endproc proc request_fly_to_airport_assets() request_model(steve_badge.model) request_anim_dict("MISSFBI5IG_0") endproc func bool has_fly_to_airport_assets_loaded() if has_model_loaded(steve_badge.model) and has_anim_dict_loaded("MISSFBI5IG_0") return true endif return false endfunc proc create_fly_to_airport_assets(bool setup_helicopter_on_skip = false) remove_all_blips(true) delete_object(fridge.obj) set_model_as_no_longer_needed(fridge.model) delete_object(fridge_pallet.obj) set_model_as_no_longer_needed(fridge_pallet.model) if does_entity_exist(nerve_agent.obj) delete_object(nerve_agent.obj) endif set_model_as_no_longer_needed(nerve_agent.model) if does_entity_exist(nerve_agent_store.obj) delete_object(nerve_agent_store.obj) endif set_model_as_no_longer_needed(nerve_agent_store.model) if does_entity_exist(container_light.obj) delete_object(container_light.obj) endif set_model_as_no_longer_needed(container_light.model) remove_anim_dict("missfbi5ig_34") if is_valid_interior(interior_lab) UNPIN_INTERIOR(interior_lab) endif clear_area(get_entity_coords(player_ped_id()), 200, true) //kills ambient birds flying over if setup_helicopter_on_skip set_entity_coords_no_offset(helicopter.veh, <<3633.9233, 3766.1704, 40.3>>) set_entity_heading(helicopter.veh, 163.1875) start_playback_recorded_vehicle(helicopter.veh, 006, "lkfbi5a") skip_time_in_playback_recorded_vehicle(helicopter.veh, 3500) SET_VEHICLE_ACTIVE_DURING_PLAYBACK(helicopter.veh, true) FORCE_PLAYBACK_RECORDED_VEHICLE_UPDATE(helicopter.veh) freeze_entity_position(crate.obj, false) set_entity_coords_no_offset(crate.obj, get_offset_from_entity_in_world_coords(helicopter.veh, v_container_offset)) set_entity_heading(crate.obj, (GET_ENTITY_HEADING(helicopter.veh)+ 180.0)) ATTACH_CHOPPER_TO_CONTAINER_WITH_ROPE(helicopter.veh, crate.obj, rope_chopper, b_ropes_created, b_ropes_attached, FALSE, false, true) STABILISE_ENTITY_ATTACHED_TO_HELI(helicopter.veh, crate.obj, f_container_offset_z) SET_ENTITY_PROOFS(crate.obj, false, false, false, false, false) ROPE_SET_UPDATE_PINVERTS( rope_chopper[0] ) ROPE_SET_UPDATE_PINVERTS( rope_chopper[1] ) ROPE_SET_UPDATE_PINVERTS( rope_chopper[2] ) ROPE_SET_UPDATE_PINVERTS( rope_chopper[3] ) play_sound_from_entity(crate_sound, "Cable_Strain", crate.obj, "FBI_05_SOUNDS") ATTACH_ENTITY_TO_ENTITY(crate_door_left.obj, crate.obj, 0, <<-1.3, -1.8, 0.00>>, <<0,0,0>>, FALSE, FALSE, TRUE) ATTACH_ENTITY_TO_ENTITY(crate_door_right.obj, crate.obj, 0, <<1.3, -1.8, 0.00>>, <<0,0,0>>, FALSE, FALSE, TRUE) endif clear_all_ped_props(steve.ped) set_entity_coords(steve.ped, <<3622.69, 3749.85, 27.69>>) set_entity_heading(steve.ped, 75.5) set_current_ped_weapon(steve.ped, weapontype_unarmed, true) set_entity_proofs(steve.ped, false, false, false, false, false, false) task_play_anim(steve.ped, "MISSFBI5IG_0", "LyingInPain_Loop_Steve", instant_blend_in, normal_blend_out, -1, AF_LOOPING | AF_FORCE_START | AF_EXIT_AFTER_INTERRUPTED) FORCE_PED_AI_AND_ANIMATION_UPDATE(steve.ped) steve_badge.obj = CREATE_OBJECT(steve_badge.model, steve_badge.pos) ATTACH_ENTITY_TO_ENTITY(steve_badge.obj, steve.ped, GET_PED_BONE_INDEX(steve.ped, BONETAG_PH_R_HAND), <<0,0,0>>, <<0,0,0>>, TRUE, TRUE) int i for i = 0 to count_of(security_guard_2) - 1 if not is_ped_injured(security_guard_2[i].ped) setup_enemy_attributes(security_guard_2[i]) setup_relationship_security_guard_2(security_guard_2[i].ped) remove_blip(security_guard_2[i].blip) task_combat_hated_targets_around_ped(security_guard_2[i].ped, 200) endif endfor original_time = get_game_timer() helicopter_hover_system_status = 0 //resets hover status trigger_music_event("FBI5A_TO_AIRPORT") if is_screen_faded_in() end_cutscene_no_fade() else end_cutscene() endif endproc ped_index cs_steve_ped func bool collect_crate_mocap() disable_helicopter_flying_controls() IF e_section_stage = SECTION_STAGE_SETUP helicopter_target_pos = get_offset_from_entity_in_world_coords(crate.obj, <<0.0, 0.0, 7.3>>) e_section_stage = SECTION_STAGE_RUNNING ENDIF IF e_section_stage = SECTION_STAGE_RUNNING printint(collect_crate_mocap_status) printnl() switch collect_crate_mocap_status case 0 disable_control_action(PLAYER_CONTROL, INPUT_VEH_EXIT) if start_new_cutscene_no_fade(false) if is_audio_scene_active("FBI_5_FLY_TO_CONTAINER") STOP_AUDIO_SCENE("FBI_5_FLY_TO_CONTAINER") endif if not is_ped_injured(selector_ped.pedID[selector_ped_michael]) register_entity_for_cutscene(selector_ped.pedID[selector_ped_michael], "Michael", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, get_player_ped_model(char_michael)) endif if not is_ped_injured(dave.ped) register_entity_for_cutscene(dave.ped, "Dave_FBI", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, dave.model) endif if not is_ped_injured(steve.ped) register_entity_for_cutscene(steve.ped, "Steve_FBI", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, steve.model) endif dave_weapon_obj = CREATE_WEAPON_OBJECT_FROM_PED_WEAPON_WITH_COMPONENTS(dave.ped, WEAPONTYPE_CARBINERIFLE) register_entity_for_cutscene(dave_weapon_obj, "daves_Weapon", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) // steve_weapon_obj = CREATE_WEAPON_OBJECT_FROM_PED_WEAPON_WITH_COMPONENTS(steve.ped, WEAPONTYPE_CARBINERIFLE) // register_entity_for_cutscene(steve_weapon_obj, "steves_gun", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) REGISTER_ENTITY_FOR_CUTSCENE(crate.obj, "fbi_5_container", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) set_entity_proofs(fridge.obj, true, true, true, true, true) detach_entity(fridge.obj, false, false) REGISTER_ENTITY_FOR_CUTSCENE(fridge.obj, "Biotech_prop", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) detach_entity(fridge_pallet.obj, false, false) //REGISTER_ENTITY_FOR_CUTSCENE(fridge.obj, "Prop_Biotech_Store", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) crate_door_left.obj = create_object(crate_door_left.model, crate_door_left.pos) REGISTER_ENTITY_FOR_CUTSCENE(crate_door_left.obj, "left_container_door", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) //FREEZE_ENTITY_POSITION(crate_door_left.obj, TRUE) crate_door_right.obj = create_object(crate_door_right.model, crate_door_right.pos) REGISTER_ENTITY_FOR_CUTSCENE(crate_door_right.obj, "right_container_door", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) ///FREEZE_ENTITY_POSITION(crate_door_right.obj, TRUE) REGISTER_ENTITY_FOR_CUTSCENE(helicopter.veh, "fbi_5_heli", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) register_entity_for_cutscene(null, "dreyfuss", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, security_guard_2[0].model) register_entity_for_cutscene(null, "marine_on_ramp", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, security_guard_2[1].model) register_entity_for_cutscene(null, "back_marine", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, security_guard_2[2].model) register_entity_for_cutscene(null, "outside_marine", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, security_guard_2[3].model) if get_cam_view_mode_for_context(cam_view_mode_context_in_heli) = cam_view_mode_first_person SET_VEHICLE_MODEL_PLAYER_WILL_EXIT_SCENE(helicopter.model) endif start_cutscene() REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) trigger_music_event("FBI5A_CONTAINER") collect_crate_mocap_status++ endif break case 1 if is_cutscene_playing() //**** //ATTACH_CHOPPER_TO_CONTAINER_WITH_ROPE(helicopter.veh, crate.obj, rope_chopper, b_ropes_created, b_ropes_attached, false, false, true) //**** clear_ped_tasks_immediately(player_ped_id()) set_ped_into_vehicle(player_ped_id(), helicopter.veh) SET_VEH_RADIO_STATION(helicopter.veh, "OFF") clear_area(get_entity_coords(player_ped_id()), 1000, true) collect_crate_mocap_status++ endif break case 2 printint(get_cutscene_time()) printnl() request_fly_to_airport_assets() if not WAS_CUTSCENE_SKIPPED() if is_cutscene_active() if not does_entity_exist(cs_steve_ped) if does_entity_exist(GET_ENTITY_INDEX_OF_CUTSCENE_ENTITY("steve_fbi", CS_SteveHains)) cs_steve_ped = GET_PED_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_CUTSCENE_ENTITY("steve_fbi", CS_SteveHains)) endif else // CS_SteveHains // IG_STEVEHAINS //bug 1234790 if not is_ped_injured(cs_steve_ped) if has_anim_event_fired(cs_steve_ped, get_hash_key("leg_shotwound")) printstring("leg_shotwound") printnl() endif if not apply_steve_blood_decal if has_anim_event_fired(cs_steve_ped, get_hash_key("leg_shotwound")) or (get_cutscene_time() >= 24328) APPLY_PED_BLOOD_SPECIFIC(cs_steve_ped, enum_to_int(PDZ_LEFT_LEG), 0.72, 0.664, 0.000, 1.000, 1, 0.0, "ShotgunSmallMonolithic")//"ShotgunSmall") blood.the_decal_id = add_decal(blood.decal_texture_id, blood.pos, blood.direction, blood.side, blood.width, blood.height, 0.196, 0, 0, blood.fAlpha, blood.life) apply_steve_blood_decal = true // printstring("decal applied") // printnl() //script_assert("decal") endif endif endif endif IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("dreyfuss", security_guard_2[0].model)) security_guard_2[0].ped = GET_PED_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("dreyfuss", security_guard_2[0].model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("marine_on_ramp", security_guard_2[1].model)) security_guard_2[1].ped = GET_PED_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("marine_on_ramp", security_guard_2[1].model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("back_marine", security_guard_2[2].model)) security_guard_2[2].ped = GET_PED_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("back_marine", security_guard_2[2].model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("outside_marine", security_guard_2[3].model)) security_guard_2[3].ped = GET_PED_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("outside_marine", security_guard_2[3].model)) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("Michael", get_player_ped_model(char_michael)) set_ped_into_vehicle(selector_ped.pedID[selector_ped_michael], helicopter.veh, vs_front_right) endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("Dave_FBI", dave.model) set_ped_into_vehicle(dave.ped, helicopter.veh, vs_back_left) endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("daves_Weapon") give_weapon_object_to_ped(dave_weapon_obj, dave.ped) endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("fbi_5_heli") set_entity_coords_no_offset(helicopter.veh, <<3633.9233, 3766.1704, 40.3>>) set_entity_heading(helicopter.veh, 163.1875) start_playback_recorded_vehicle(helicopter.veh, 006, "lkfbi5a") skip_time_in_playback_recorded_vehicle(helicopter.veh, 3500) SET_VEHICLE_ACTIVE_DURING_PLAYBACK(helicopter.veh, true) FORCE_PLAYBACK_RECORDED_VEHICLE_UPDATE(helicopter.veh) freeze_entity_position(crate.obj, false) set_entity_coords_no_offset(crate.obj, get_offset_from_entity_in_world_coords(helicopter.veh, v_container_offset)) set_entity_heading(crate.obj, (GET_ENTITY_HEADING(helicopter.veh)+ 180.0)) ATTACH_CHOPPER_TO_CONTAINER_WITH_ROPE(helicopter.veh, crate.obj, rope_chopper, b_ropes_created, b_ropes_attached, FALSE, false, true) STABILISE_ENTITY_ATTACHED_TO_HELI(helicopter.veh, crate.obj, f_container_offset_z) SET_ENTITY_PROOFS(crate.obj, false, false, false, false, false) ROPE_SET_UPDATE_PINVERTS( rope_chopper[0] ) ROPE_SET_UPDATE_PINVERTS( rope_chopper[1] ) ROPE_SET_UPDATE_PINVERTS( rope_chopper[2] ) ROPE_SET_UPDATE_PINVERTS( rope_chopper[3] ) play_sound_from_entity(crate_sound, "Cable_Strain", crate.obj, "FBI_05_SOUNDS") ATTACH_ENTITY_TO_ENTITY(crate_door_left.obj, crate.obj, 0, <<-1.3, -1.8, 0.00>>, <<0,0,0>>, FALSE, FALSE, TRUE) ATTACH_ENTITY_TO_ENTITY(crate_door_right.obj, crate.obj, 0, <<1.3, -1.8, 0.00>>, <<0,0,0>>, FALSE, FALSE, TRUE) endif else if has_fly_to_airport_assets_loaded() create_fly_to_airport_assets() REPLAY_STOP_EVENT() e_mission_stage = stage_fly_to_airport e_section_stage = SECTION_STAGE_SETUP return true endif endif else SET_CUTSCENE_FADE_VALUES(false, false, true) e_section_stage = SECTION_STAGE_CLEANUP endif break endswitch endif IF e_section_stage = SECTION_STAGE_SKIP if is_cutscene_active() REPLAY_CANCEL_EVENT() STOP_CUTSCENE() endif endif IF e_section_stage = SECTION_STAGE_CLEANUP request_fly_to_airport_assets() if is_cutscene_active() IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("dreyfuss", security_guard_2[0].model)) security_guard_2[0].ped = GET_PED_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("dreyfuss", security_guard_2[0].model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("marine_on_ramp", security_guard_2[1].model)) security_guard_2[1].ped = GET_PED_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("marine_on_ramp", security_guard_2[1].model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("back_marine", security_guard_2[2].model)) security_guard_2[2].ped = GET_PED_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("back_marine", security_guard_2[2].model)) ENDIF IF DOES_ENTITY_EXIST(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("outside_marine", security_guard_2[3].model)) security_guard_2[3].ped = GET_PED_INDEX_FROM_ENTITY_INDEX(GET_ENTITY_INDEX_OF_REGISTERED_ENTITY("outside_marine", security_guard_2[3].model)) ENDIF else if has_fly_to_airport_assets_loaded() set_ped_into_vehicle(selector_ped.pedID[selector_ped_michael], helicopter.veh, vs_front_right) set_ped_into_vehicle(dave.ped, helicopter.veh, vs_back_left) steve_badge.obj = CREATE_OBJECT(steve_badge.model, steve_badge.pos) ATTACH_ENTITY_TO_ENTITY(steve_badge.obj, steve.ped, GET_PED_BONE_INDEX(steve.ped, BONETAG_PH_R_HAND), <<0,0,0>>, <<0,0,0>>, TRUE, TRUE) create_fly_to_airport_assets(true) REPLAY_STOP_EVENT() e_mission_stage = stage_fly_to_airport e_section_stage = SECTION_STAGE_SETUP return true endif endif endif if collect_crate_mocap_status < 1 dave_ai_system_2() steve_ai_system_2() endif // if collect_crate_mocap_status > 0 // if not is_cutscene_playing() // helicopter_hover_system() // endif // endif set_heli_blades_full_speed(helicopter.veh) return false endfunc proc request_mocap_data_for_fbi_5a_mcs_10() mocap_streaming_system(<<1739.6, 3276.8, 41.1>>, 125.00, 200.00, "fbi_5a_mcs_10") SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("franklin", selector_ped.pedID[selector_ped_franklin]) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("trevor", player_ped_id()) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("michael", selector_ped.pedID[selector_ped_michael]) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("Dave_FBI", dave.ped) endproc proc deactivate_hovering_system() if not stop_prcocessing_hover_system int left_stick_x int left_stick_y int right_stick_x int right_stick_y int stick_dead_zone = (127 + 28) GET_CONTROL_VALUE_OF_ANALOGUE_STICKS(left_stick_x, left_stick_y, right_stick_x, right_stick_y) IF NOT IS_LOOK_INVERTED() right_stick_y *= -1 ENDIF // invert the vertical IF (left_stick_y > STICK_DEAD_ZONE) OR (left_stick_y < (STICK_DEAD_ZONE * -1)) or is_control_pressed(player_control, INPUT_VEH_ACCELERATE) or is_control_pressed(player_control, INPUT_VEH_BRAKE) or is_control_pressed(player_control, INPUT_VEH_FLY_YAW_LEFT) or is_control_pressed(player_control, INPUT_VEH_FLY_YAW_RIGHT) stop_prcocessing_hover_system = true endif helicopter_hover_system() endif endproc proc deactivate_helicopter_recording_system() if is_playback_going_on_for_vehicle(helicopter.veh) int left_stick_x int left_stick_y int right_stick_x int right_stick_y int stick_dead_zone = 28 //(127 + 28) GET_CONTROL_VALUE_OF_ANALOGUE_STICKS(left_stick_x, left_stick_y, right_stick_x, right_stick_y) IF NOT IS_LOOK_INVERTED() right_stick_y *= -1 ENDIF // invert the vertical IF (left_stick_x > STICK_DEAD_ZONE) OR (left_stick_x < (STICK_DEAD_ZONE * -1)) or (left_stick_y > STICK_DEAD_ZONE) OR (left_stick_y < (STICK_DEAD_ZONE * -1)) or is_control_pressed(player_control, INPUT_VEH_ACCELERATE) or is_control_pressed(player_control, INPUT_VEH_BRAKE) or is_control_pressed(player_control, INPUT_VEH_FLY_YAW_LEFT) or is_control_pressed(player_control, INPUT_VEH_FLY_YAW_RIGHT) stop_playback_recorded_vehicle(helicopter.veh) endif endif endproc func bool is_player_flying_erratically() vector helicopter_rotation helicopter_rotation = get_entity_rotation(helicopter.veh) crate.rot = get_entity_rotation(crate.obj) // printstring("helicopter data:") // printnl() // printvector(helicopter_rotation) // printnl() // printfloat(get_entity_pitch(helicopter.veh)) // printnl() // printfloat(get_entity_roll(helicopter.veh)) // printnl() // // printstring("crate data:") // printnl() // printvector(crate.rot) // printnl() // printfloat(get_entity_pitch(crate.obj)) // printnl() // printfloat(get_entity_roll(crate.obj)) // printnl() if HAS_ENTITY_BEEN_DAMAGED_BY_ENTITY(helicopter.veh, player_ped_id()) or HAS_ENTITY_BEEN_DAMAGED_BY_ENTITY(crate.obj, player_ped_id()) or absf(helicopter_rotation.x) > 29.0 or absf(helicopter_rotation.y) > 29.0 or absf(crate.rot.x) > 29.0 or absf(crate.rot.y) > 29.0 CLEAR_ENTITY_LAST_DAMAGE_ENTITY(helicopter.veh) CLEAR_ENTITY_LAST_DAMAGE_ENTITY(crate.obj) return true endif return false endfunc proc fly_to_airport_dialogue_system() switch fly_to_airport_dialogue_system_status case 0 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_pullup", CONV_PRIORITY_medium) fly_to_airport_dialogue_system_status++ endif break case 1 if dialogue_monitoring_system(locates_data.LocationBlip, dave.ped, selector_ped.pedID[selector_ped_michael]) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_chat", CONV_PRIORITY_medium) REPLAY_RECORD_BACK_FOR_TIME(0.0, 10.0, REPLAY_IMPORTANCE_HIGHEST) fly_to_airport_dialogue_system_status++ endif endif break case 2 if dialogue_monitoring_system(locates_data.LocationBlip, dave.ped, selector_ped.pedID[selector_ped_michael]) fly_to_airport_dialogue_system_status++ endif break case 3 if lk_timer(dialogue_time, 7000) //if not is_any_text_being_displayed(locates_data) if dialogue_monitoring_system(locates_data.LocationBlip, dave.ped, selector_ped.pedID[selector_ped_michael]) if is_player_flying_erratically() switch get_random_int_in_range(0, 1) case 0 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_hit", CONV_PRIORITY_medium) dialogue_time = get_game_timer() endif break case 1 if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_hit2", CONV_PRIORITY_medium) dialogue_time = get_game_timer() endif break endswitch endif endif endif break endswitch endproc proc remove_remaining_chemical_lab_assets() if does_entity_exist(army_truck[0].veh) if get_distance_between_coords(get_entity_coords(player_ped_id()), <<3638.326, 3771.813, 35.930>>) > 200 int i for i = 0 to count_of(security_guard_2) - 1 if does_entity_exist(security_guard_2[i].ped) delete_ped(security_guard_2[i].ped) endif set_model_as_no_longer_needed(security_guard_2[i].model) endfor for i = 0 to count_of(army_truck) - 1 if does_entity_exist(army_truck[i].veh) delete_vehicle(army_truck[i].veh) endif set_model_as_no_longer_needed(army_truck[i].model) endfor if does_entity_exist(steve_badge.obj) delete_object(steve_badge.obj) endif set_model_as_no_longer_needed(steve_badge.model) if does_entity_exist(steve.ped) delete_ped(steve.ped) endif set_model_as_no_longer_needed(steve.model) for i = 0 to count_of(flare) - 1 if does_entity_exist(flare[i].obj) delete_object(flare[i].obj) endif set_model_as_no_longer_needed(flare[i].model) endfor for i = 0 to count_of(obj_loading_boxes) - 1 if does_entity_exist(obj_loading_boxes[i]) delete_object(obj_loading_boxes[i]) endif endfor set_model_as_no_longer_needed(PROP_BOXPILE_02B) remove_anim_dict("MISSFBI5IG_0") remove_vehicle_recording(001, "lkfbi5a") remove_vehicle_recording(002, "lkfbi5a") remove_vehicle_recording(003, "lkfbi5a") REMOVE_PTFX_ASSET() RELEASE_SCRIPT_AUDIO_BANK() endif endif endproc proc create_land_crate_assets() if not does_entity_exist(truck.veh) if get_distance_between_coords(get_entity_coords(player_ped_id()), <<3638.326, 3771.813, 35.930>>) > 220 request_model(truck.model) request_model(trailer.model) request_model(get_player_ped_model(char_franklin)) request_vehicle_recording(truck.recording_number, "lkfbi5a") request_vehicle_recording(trailer.recording_number, "lkfbi5a") request_vehicle_recording(crate_veh.recording_number, "lkfbi5a") if has_model_loaded(truck.model) and has_model_loaded(trailer.model) and has_model_loaded(get_player_ped_model(char_franklin)) and has_vehicle_recording_been_loaded(truck.recording_number, "lkfbi5a") and has_vehicle_recording_been_loaded(trailer.recording_number, "lkfbi5a") and has_vehicle_recording_been_loaded(crate_veh.recording_number, "lkfbi5a") clear_area(truck.pos, 70.0, true) create_player_ped_on_foot(selector_ped.pedID[selector_ped_franklin], char_franklin, <<1741.1381, 3289.1230, 40.1094>>, 217.4986) setup_player_ped_buddy_attributes(selector_ped.pedID[selector_ped_franklin]) set_ped_can_ragdoll(selector_ped.pedID[selector_ped_franklin], true) setup_relationship_contact(selector_ped.pedID[selector_ped_franklin], true) add_ped_for_dialogue(scripted_speech, 1, selector_ped.pedID[selector_ped_franklin], "franklin") task_look_at_entity(selector_ped.pedID[selector_ped_franklin], player_ped_id(), -1, slf_while_not_in_fov) truck.veh = create_vehicle(truck.model, truck.pos, truck.heading) set_vehicle_on_ground_properly(truck.veh) set_vehicle_doors_locked(truck.veh, vehiclelock_lockout_player_only) trailer.veh = create_vehicle(trailer.model, truck.pos, truck.heading) set_vehicle_on_ground_properly(truck.veh) attach_vehicle_to_trailer(truck.veh, trailer.veh) endif endif endif endproc func bool has_player_landed_crate_on_truck() // printstring("helicopter speed = ") // printfloat(get_entity_speed(helicopter.veh)) // printnl() // // printstring("crate speed = ") // printfloat(get_entity_speed(crate.obj)) // printnl() // // printstring("crate pitch = ") // printfloat(get_entity_pitch(crate.obj)) // printnl() // // printstring("crate roll = ") // printfloat(get_entity_roll(crate.obj)) // printnl() if does_entity_exist(truck.veh) vector crate_corner[4] vector truck_angled_area_l vector truck_angled_area_r ///top plane and bottom plane tl and br of crate crate_corner[0] = get_offset_from_entity_in_world_coords(crate.obj, <<-1.3, 1.8, -1.4>>) crate_corner[1] = get_offset_from_entity_in_world_coords(crate.obj, <<1.3, -1.8, -1.4>>) crate_corner[2] = get_offset_from_entity_in_world_coords(crate.obj, <<-1.3, 1.8, 1.4>>) crate_corner[3] = get_offset_from_entity_in_world_coords(crate.obj, <<1.3, -1.8, 1.4>>) truck_angled_area_l = get_offset_from_entity_in_world_coords(trailer.veh, <<-6.0, -0.5, 0.0>>) //-2.5 truck_angled_area_r = get_offset_from_entity_in_world_coords(trailer.veh, <<6.0, -0.52, 13.0>>) if is_point_in_angled_area(crate_corner[0], truck_angled_area_l, truck_angled_area_r, 15.3)//7.2 and is_point_in_angled_area(crate_corner[1], truck_angled_area_l, truck_angled_area_r, 15.3) and is_point_in_angled_area(crate_corner[2], truck_angled_area_l, truck_angled_area_r, 15.3) and is_point_in_angled_area(crate_corner[3], truck_angled_area_l, truck_angled_area_r, 15.3) and get_entity_speed(helicopter.veh) < 15.0 if not is_this_help_message_being_displayed("fbi5a_help_4") print_help("fbi5a_help_4") endif if IS_DISABLED_CONTROL_PRESSED(player_control, INPUT_VEH_GRAPPLING_HOOK) return true endif else if is_this_help_message_being_displayed("fbi5a_help_4") clear_help() else printstring("help not on screen") printnl() endif endif //// vector crate_corner[4] //// //// //top plane and bottom plane tl and br of crate //// crate_corner[0] = get_offset_from_entity_in_world_coords(crate.obj, <<-1.3, 1.8, -1.4>>) //// crate_corner[1] = get_offset_from_entity_in_world_coords(crate.obj, <<1.3, -1.8, -1.4>>) //// crate_corner[2] = get_offset_from_entity_in_world_coords(crate.obj, <<-1.3, 1.8, 1.4>>) //// crate_corner[3] = get_offset_from_entity_in_world_coords(crate.obj, <<1.3, -1.8, 1.4>>) //// //// vector truck_angled_area_l = get_offset_from_entity_in_world_coords(trailer.veh, <<-3.0, 0.1, 0.0>>) //-2.5 //// vector truck_angled_area_r = get_offset_from_entity_in_world_coords(trailer.veh, <<3.0, 0.12, 4.0>>) // // //// if is_point_in_angled_area(crate_corner[0], truck_angled_area_l, truck_angled_area_r, 13.3)//7.2 //// and is_point_in_angled_area(crate_corner[1], truck_angled_area_l, truck_angled_area_r, 13.3) //// and is_point_in_angled_area(crate_corner[2], truck_angled_area_l, truck_angled_area_r, 13.3) //// and is_point_in_angled_area(crate_corner[3], truck_angled_area_l, truck_angled_area_r, 13.3) //// and get_entity_speed(helicopter.veh) < 5.0 //// and get_entity_speed(crate.obj) < 1.0 //// and (get_entity_pitch(crate.obj) > -5.0 and get_entity_pitch(crate.obj) < 5.0) //// and (get_entity_roll(crate.obj) > -5.0 and get_entity_roll(crate.obj) < 5.0) // // if is_this_help_message_being_displayed("fbi5a_help_4") // clear_prints() // endif // // if is_control_pressed(player_control, INPUT_SCRIPT_RDOWN) // // if is_this_help_message_being_displayed("fbi5a_help_4") // clear_prints() // endif // // int i // // for i = 0 to count_of(rope_chopper) - 1 // DETACH_ROPE_FROM_ENTITY(rope_chopper[i], helicopter.veh) // DETACH_ROPE_FROM_ENTITY(rope_chopper[i], crate.obj) // endfor // //// crate.pos = get_offset_from_entity_given_world_coords(trailer.veh, get_entity_coords(crate.obj)) //// crate.rot = get_entity_rotation(crate.obj) - get_entity_rotation(trailer.veh) //// //// attach_entity_to_entity(crate.obj, trailer.veh, 0, crate.pos, crate.rot) // // //--- // // crate.rot = get_entity_rotation(crate.obj) // // vector crate_target_rot = crate.rot // crate_target_rot.x = 0.0 // crate_target_rot.y = 0.0 // // vector vec_rot_ba = crate_target_rot - crate.rot // // vector crate_rot_direction_vector = normalise_vector(vec_rot_ba) // // while not are_vectors_alomost_equal(crate.rot, crate_target_rot, crate_rot_direction_vector) // // crate.pos += crate_rot_direction_vector * 0.1 // // set_entity_rotation(crate.obj, crate.rot) // // wait(0) // // endwhile // // // crate.pos = get_entity_coords(crate.obj) // // vector trailer_offset_pos = get_offset_from_entity_given_world_coords(trailer.veh, get_entity_coords(crate.obj)) // trailer_offset_pos.x = 0.0 // trailer_offset_pos.z = 1.0 // // vector trailer_target_pos = get_offset_from_entity_in_world_coords(trailer.veh, trailer_offset_pos) // // vector vec_ba = trailer_target_pos - crate.pos // // // vector crate_direction_vector = normalise_vector(vec_ba) // // while not are_vectors_alomost_equal(crate.pos, trailer_target_pos, crate_direction_vector) // // crate.pos += crate_direction_vector * 0.1 // // set_entity_coords(crate.obj, crate.pos) // // wait(0) // // endwhile // // // crate.pos = get_offset_from_entity_given_world_coords(trailer.veh, get_entity_coords(crate.obj)) // crate.rot = get_entity_rotation(crate.obj) - get_entity_rotation(trailer.veh) // // attach_entity_to_entity(crate.obj, trailer.veh, 0, crate.pos, crate.rot) // //// pos z //// //// rot x //// rot y // // // return true // // endif // // //else // //// if is_this_help_message_being_displayed("fbi5a_help_4") //// clear_help() //// endif // // //endif // // endif // case 0 // // if is_control_pressed(player_control, INPUT_SCRIPT_RDOWN) // // int i // // for i = 0 to count_of(rope_chopper) - 1 // DETACH_ROPE_FROM_ENTITY(rope_chopper[i], helicopter.veh) // DETACH_ROPE_FROM_ENTITY(rope_chopper[i], crate.obj) // endfor // // has_player_landed_crate_on_truck_status++ // // endif // // break // // case 1 // // crate.pos = get_entity_coords(crate.obj) // // // vector trailer_offset_pos // trailer_offset_pos = get_offset_from_entity_given_world_coords(trailer.veh, get_entity_coords(crate.obj)) // trailer_offset_pos.x = 0.0 // trailer_offset_pos.y = -2.0 // trailer_offset_pos.z = 1.0 // // vector trailer_target_pos // trailer_target_pos = get_offset_from_entity_in_world_coords(trailer.veh, trailer_offset_pos) // printstring("trailer_target_pos = ") // printvector(trailer_target_pos) // printnl() // // vector vec_ba // vec_ba = trailer_target_pos - crate.pos // // vector crate_direction_vector // crate_direction_vector = normalise_vector(vec_ba) // // if not are_vectors_alomost_equal(crate.pos, trailer_target_pos, crate_direction_vector) // //or not (absf(trailer_target_pos.z - crate.pos.z) < 0.1) // // crate.pos += crate_direction_vector * 0.1 // // set_entity_coords(crate.obj, crate.pos) // // printstring("move crate") // printnl() // // else // // crate.pos = get_offset_from_entity_given_world_coords(trailer.veh, get_entity_coords(crate.obj)) // crate.rot = get_entity_rotation(crate.obj) - get_entity_rotation(trailer.veh) // // attach_entity_to_entity(crate.obj, trailer.veh, 0, crate.pos, crate.rot) // // has_player_landed_crate_on_truck_status++ // // endif // // break // // case 2 // // break // endswitch endif return false endfunc func bool crate_land_cutscene() switch crate_land_cutscene_status case 0 // set_entity_coords(truck.veh, truck.pos) // set_entity_heading(truck.veh, truck.heading) // set_vehicle_on_ground_properly(truck.veh) // // set_entity_coords(trailer.veh, trailer.pos) // set_entity_heading(trailer.veh, trailer.heading) // // attach_vehicle_to_trailer(truck.veh, trailer.veh) DELETE_VEHICLE(truck.veh) DELETE_VEHICLE(trailer.veh) //same colour and vehicle extras int i STABILISE_ENTITY_ATTACHED_TO_HELI(helicopter.veh, null, 0.0) for i = 0 to count_of(rope_chopper) - 1 DETACH_ROPE_FROM_ENTITY(rope_chopper[i], helicopter.veh) DETACH_ROPE_FROM_ENTITY(rope_chopper[i], crate.obj) delete_rope(rope_chopper[i]) endfor truck.veh = create_vehicle(truck.model, truck.pos, truck.heading) set_vehicle_strong(truck.veh, true) SET_VEHICLE_HAS_STRONG_AXLES(truck.veh, true) SET_VEHICLE_ENGINE_ON(truck.veh, TRUE, TRUE) set_vehicle_tyres_can_burst(truck.veh, false) set_vehicle_colours(truck.veh, 0, 0) set_entity_health(truck.veh, 1500) set_vehicle_engine_health(truck.veh, 1500) set_vehicle_petrol_tank_health(truck.veh, 1500) start_playback_recorded_vehicle(truck.veh, truck.recording_number, "lkfbi5a") force_playback_recorded_vehicle_update(truck.veh) trailer.veh = create_vehicle(trailer.model, trailer.pos, trailer.heading) set_vehicle_tyres_can_burst(trailer.veh, false) attach_vehicle_to_trailer(truck.veh, trailer.veh) start_playback_recorded_vehicle(trailer.veh, trailer.recording_number, "lkfbi5a") force_playback_recorded_vehicle_update(trailer.veh) set_entity_coords_no_offset(helicopter.veh, get_offset_from_entity_in_world_coords(trailer.veh, <<0.0, -2.5, 15.0>>))//15.00 set_entity_heading(helicopter.veh, get_entity_heading(trailer.veh)) delete_object(crate_door_left.obj) delete_object(crate_door_right.obj) delete_object(crate.obj) crate_veh.veh = create_vehicle(crate_veh.model, get_offset_from_entity_in_world_coords(trailer.veh, <<0.0, -2.5, 20.0>>)) set_entity_collision(crate_veh.veh, false) set_entity_visible(crate_veh.veh, false) start_playback_recorded_vehicle(crate_veh.veh, crate_veh.recording_number, "lkfbi5a") force_playback_recorded_vehicle_update(crate_veh.veh) crate.obj = create_object_no_offset(crate.model, get_entity_coords(crate_veh.veh)) set_entity_rotation(crate.obj, GET_ENTITY_rotation(crate_veh.veh)) SET_OBJECT_TAKES_DAMAGE_FROM_COLLIDING_WITH_BUILDINGS(crate.obj) SET_ENTITY_PROOFS(crate.obj, TRUE, TRUE, TRUE, TRUE, TRUE) crate_door_left.obj = create_object(crate_door_left.model, crate_door_left.pos) ATTACH_ENTITY_TO_ENTITY(crate_door_left.obj, crate.obj, 0, <<-1.3, -1.8, 0.00>>, <<0,0,0>>, FALSE, FALSE, TRUE) crate_door_right.obj = create_object(crate_door_right.model, crate_door_right.pos) ATTACH_ENTITY_TO_ENTITY(crate_door_right.obj, crate.obj, 0, <<1.3, -1.8, 0.00>>, <<0,0,0>>, FALSE, FALSE, TRUE) activate_physics(crate.obj) //apply_force_to_entity(crate.obj, APPLY_TYPE_IMPULSE, <<0.0, 0.0, -1.0>>, <<0.0, 0.0, 0.0>>, 0, false, true, true) helicopter_hover_system() camera_a = create_cam_with_params("default_scripted_camera", <<1759.406616,3274.470215,42.138393>>,<<39.766510,0.000005,174.944931>>,41.658504) camera_b = create_cam_with_params("default_scripted_camera", <<1759.406616,3274.470215,42.138393>>,<<8.238567,0.000005,174.944870>>,41.658504) set_cam_active(camera_a, true) set_cam_active_with_interp(camera_b, camera_a, 1200, graph_type_accel, graph_type_accel) render_script_cams(true, false) REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) play_sound_from_entity(-1, "Release_Crate", crate.obj, "FBI_05_SOUNDS") original_time = get_game_timer() crate_land_cutscene_status++ break case 1 if not is_entity_dead(crate_veh.veh) set_entity_coords_no_offset(crate.obj, get_entity_coords(crate_veh.veh)) set_entity_rotation(crate.obj, GET_ENTITY_rotation(crate_veh.veh)) endif helicopter_hover_system() crate.pos = get_entity_coords(crate.obj) printfloat(crate.pos.z) printnl() if crate.pos.z < 43.3 or not is_cam_interpolating(camera_b) shake_cam(camera_a, "small_EXPLOSION_SHAKE", 0.05) shake_cam(camera_b, "small_EXPLOSION_SHAKE", 0.05) play_sound_from_entity(-1, "Crate_Land", crate.obj, "FBI_05_SOUNDS") original_time = get_game_timer() crate_land_cutscene_status++ endif break case 2 if not is_entity_dead(crate_veh.veh) set_entity_coords_no_offset(crate.obj, get_entity_coords(crate_veh.veh)) set_entity_rotation(crate.obj, GET_ENTITY_rotation(crate_veh.veh)) endif helicopter_hover_system() if lk_timer(original_time, 750) if is_playback_going_on_for_vehicle(truck.veh) stop_playback_recorded_vehicle(truck.veh) endif if is_playback_going_on_for_vehicle(trailer.veh) stop_playback_recorded_vehicle(trailer.veh) endif if is_playback_going_on_for_vehicle(crate_veh.veh) stop_playback_recorded_vehicle(crate_veh.veh) endif delete_vehicle(crate_veh.veh) //crate.pos = get_offset_from_entity_given_world_coords(trailer.veh, get_entity_coords(crate.obj)) crate.pos.x = 0.0 crate.pos.y = -2.37 crate.pos.z = 1.81 //crate.rot = get_entity_rotation(crate.obj) - get_entity_rotation(trailer.veh) crate.rot = <<0.0, 0.0, 0.0>> //set_object_physics_params(crate.obj attach_entity_to_entity(crate.obj, trailer.veh, 0, crate.pos, crate.rot) end_cutscene_no_fade() REPLAY_STOP_EVENT() return true endif break endswitch return false endfunc func bool fly_to_airport_master_flow_system() switch fly_to_airport_master_flow_system_status case 0 vector drop_crate_pos if does_entity_exist(truck.veh) drop_crate_pos = get_offset_from_entity_in_world_coords(truck.veh, <<0.0, -2.0, 1.0>>) else drop_crate_pos = <<1757.35352, 3269.75024, 41.76557>> endif is_player_at_location_in_vehicle(locates_data, drop_crate_pos, <<0.01, 0.01, LOCATE_SIZE_HEIGHT>>, false, helicopter.veh, "fbi5a_god_20", "GOBACK_CHOPPER") if does_blip_exist(locates_data.LocationBlip) if not has_label_been_triggered("fbi5a_god_25") if get_distance_between_coords(get_entity_coords(player_ped_id()), drop_crate_pos) < 250.00 if not is_any_text_being_displayed(locates_data) print_now("fbi5a_god_25", default_god_text_time, 1) set_label_as_triggered("fbi5a_god_25", true) endif endif endif if has_player_landed_crate_on_truck() REPLAY_RECORD_BACK_FOR_TIME(10.0, 0.0) start_new_cutscene_no_fade(false, true, true, true) clear_mission_locate_stuff(locates_data, false) crate_land_cutscene() fly_to_airport_master_flow_system_status++ endif endif break case 1 if crate_land_cutscene() fly_to_airport_master_flow_system_status++ endif break case 2 is_player_at_location_in_vehicle(locates_data, <<1730.1304, 3275.4885, 40.1240>>, <<0.01, 0.01, LOCATE_SIZE_HEIGHT>>, false, helicopter.veh, "fbi5a_god_26", "", "GOBACK_CHOPPER") if does_blip_exist(locates_data.LocationBlip) if is_entity_at_coord(player_ped_id(), <<1730.1304, 3275.4885, 40.1240>>, <<25.0, 25.0, LOCATE_SIZE_HEIGHT>>, true) if IS_VEHICLE_ON_ALL_WHEELS(helicopter.veh) and get_entity_speed(helicopter.veh) < 0.2 if has_cutscene_loaded() if start_new_cutscene_no_fade() return true endif endif endif endif endif break endswitch return false endfunc proc franklin_ai_system() if does_entity_exist(selector_ped.pedID[selector_ped_franklin]) switch franklin_ai_system_status case 0 request_anim_dict("missfbi5ig_34") if not is_entity_at_coord(selector_ped.pedID[selector_ped_franklin], <<1740.1632, 3279.4734, 40.0934>>, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(selector_ped.pedID[selector_ped_franklin]) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, <<1740.1632, 3279.4734, 40.0934>>, pedmove_run, -1) close_sequence_task(seq) task_perform_sequence(selector_ped.pedID[selector_ped_franklin], seq) clear_sequence_task(seq) endif endif if has_anim_dict_loaded("missfbi5ig_34") if get_distance_between_coords(<<1757.35352, 3269.75024, 41.76557>>, get_entity_coords(helicopter.veh)) < 40.00 open_sequence_task(seq) task_play_anim(null, "missfbi5ig_34", "direct_heli_a_dave", slow_blend_in) task_follow_nav_mesh_to_coord(null, <<1741.1381, 3289.1230, 40.1094>>, pedmove_run, -1) close_sequence_task(seq) task_perform_sequence(selector_ped.pedID[selector_ped_franklin], seq) clear_sequence_task(seq) franklin_ai_system_status++ endif endif break case 1 if not is_entity_at_coord(selector_ped.pedID[selector_ped_franklin], <<1741.1381, 3289.1230, 40.1094>>, <<1.5, 1.5, 2.0>>) if has_ped_task_finished_2(selector_ped.pedID[selector_ped_franklin], script_task_perform_sequence, 1) open_sequence_task(seq) task_follow_nav_mesh_to_coord(null, <<1741.1381, 3289.1230, 40.1094>>, pedmove_run, -1) close_sequence_task(seq) task_perform_sequence(selector_ped.pedID[selector_ped_franklin], seq) clear_sequence_task(seq) endif else if not is_ped_facing_ped(selector_ped.pedID[selector_ped_franklin], player_ped_id(), 40.00) if has_ped_task_finished_2(selector_ped.pedID[selector_ped_franklin]) open_sequence_task(seq) task_turn_ped_to_face_entity(null, player_ped_id()) close_sequence_task(seq) task_perform_sequence(selector_ped.pedID[selector_ped_franklin], seq) clear_sequence_task(seq) endif else if is_ped_sitting_in_vehicle(player_ped_id(), helicopter.veh) if lk_timer(original_time, 7000) if not is_ped_ragdoll(selector_ped.pedID[selector_ped_franklin]) if has_ped_task_finished_2(selector_ped.pedID[selector_ped_franklin], script_task_play_anim, -2, false) task_play_anim(selector_ped.pedID[selector_ped_franklin], "missfbi5ig_34", "direct_heli_a_dave", slow_blend_in) original_time = get_game_timer() endif endif endif endif endif endif break case 2 break endswitch endif endproc proc fly_to_airport() REPLAY_DISABLE_CAMERA_MOVEMENT_THIS_FRAME() //For for bug 2233102 DELETE_VEHICLE_GEN_VEHICLE(VEHGEN_WEB_HANGAR_TREVOR) disable_helicopter_flying_controls() IF e_section_stage = SECTION_STAGE_SETUP if is_screen_faded_in() SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(6, "fly to airport") start_audio_scene("FBI_5_FLY_TO_AIRSTRIP") fly_to_airport_dialogue_system() e_section_stage = SECTION_STAGE_RUNNING endif endif IF e_section_stage = SECTION_STAGE_RUNNING if fly_to_airport_master_flow_system_status = 0 STABILISE_ENTITY_ATTACHED_TO_HELI(helicopter.veh, crate.obj, f_container_offset_z) activate_physics(crate.obj) endif if not increase_pilot_skill if does_entity_exist(trailer.veh) if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(trailer.veh)) < 100 SET_AIRCRAFT_PILOT_SKILL_NOISE_SCALAR(helicopter.veh, 0.0) increase_pilot_skill = true endif endif endif //deactivate_hovering_system() deactivate_helicopter_recording_system() request_mocap_data_for_fbi_5a_mcs_10() remove_remaining_chemical_lab_assets() create_land_crate_assets() franklin_ai_system() if fly_to_airport_master_flow_system() e_mission_stage = stage_airport_mocap endif fly_to_airport_dialogue_system() endif IF e_section_stage = SECTION_STAGE_SKIP switch fly_to_airport_master_flow_system_status case 0 if is_playback_going_on_for_vehicle(helicopter.veh) stop_playback_recorded_vehicle(helicopter.veh) endif clear_ped_tasks_immediately(player_ped_id()) set_ped_into_vehicle(player_ped_id(), helicopter.veh) set_entity_coords_no_offset(helicopter.veh, <<1790.5543, 3265.8384, 68.00>>) set_entity_heading(helicopter.veh, 17.4409) set_entity_coords(crate.obj, get_offset_from_entity_in_world_coords(helicopter.veh, v_container_offset)) set_entity_heading(crate.obj, (get_entity_heading(helicopter.veh) + 180)) break // case 1 // case 2 // // if is_cutscene_active() // STOP_CUTSCENE() // endif // // break endswitch endif IF e_section_stage = SECTION_STAGE_CLEANUP endif endproc proc airport_mocap() IF e_section_stage = SECTION_STAGE_SETUP e_section_stage = SECTION_STAGE_RUNNING endif IF e_section_stage = SECTION_STAGE_RUNNING switch airport_mocap_status case 0 clear_mission_locate_stuff(locates_data) trigger_music_event("FBI5A_STOP_TRACK") if is_audio_scene_active("FBI_5_FLY_TO_AIRSTRIP") STOP_AUDIO_SCENE("FBI_5_FLY_TO_AIRSTRIP") endif detach_entity(crate.obj) detach_entity(crate_door_left.obj) detach_entity(crate_door_right.obj) register_entity_for_cutscene(dave.ped, "Dave_FBI", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, dave.model) register_entity_for_cutscene(selector_ped.pedID[selector_ped_michael], "Michael", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, get_player_ped_model(char_michael)) register_entity_for_cutscene(selector_ped.pedID[selector_ped_franklin], "franklin", cu_animate_and_delete_existing_script_entity, get_player_ped_model(char_franklin)) register_entity_for_cutscene(helicopter.veh, "FBI_5_heli", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, helicopter.model) if is_vehicle_driveable(truck.veh) register_entity_for_cutscene(truck.veh, "FBI_5_Lorry", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, truck.model) endif if is_vehicle_driveable(trailer.veh) register_entity_for_cutscene(trailer.veh, "FBI_5_trailer", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, trailer.model) endif register_entity_for_cutscene(crate.obj, "fbi_5_container", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, crate.model) register_entity_for_cutscene(crate_door_left.obj, "left_container_door", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, crate_door_left.model) register_entity_for_cutscene(crate_door_right.obj, "right_container_door", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, crate_door_right.model) if not has_sound_finished(crate_sound) stop_sound(crate_sound) endif ENABLE_DISPATCH_SERVICE(DT_GANGS, FALSE) //stops gangs attacking when the player is driving patricia home make_selector_ped_selection(selector_ped, SELECTOR_PED_michael) take_control_of_selector_ped(selector_ped, true, false) SET_GAMEPLAY_CAM_FOLLOW_PED_THIS_UPDATE(selector_ped.pedID[selector_ped_trevor]) start_cutscene(CUTSCENE_SUPPRESS_FP_TRANSITION_FLASH) REPLAY_RECORD_BACK_FOR_TIME(10.0, 0.0) REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) eSwitchCamState = SWITCH_CAM_REQUEST_ASSETS HANDLE_SWITCH_CAM_MIKE_TO_TREV_AND_PAT(scsSwitchCamMikeToTrevPatricia_Intro, scsSwitchCamMikeToTrevPatricia_Outro) airport_mocap_status++ break case 1 if is_cutscene_playing() clear_area(<<1739.6, 3276.8, 41.1>>, 1000, true) airport_mocap_status++ endif break case 2 printstring("get_cutscene_time()") printint(get_cutscene_time()) printnl() if is_cutscene_active() if not WAS_CUTSCENE_SKIPPED() IF GET_CUTSCENE_SECTION_PLAYING() >= 13 IF NOT DOES_ENTITY_EXIST(oiMichaelSwitchCamLightRig) PRINTLN("Creating scripted lighting prop...") oiMichaelSwitchCamLightRig = CREATE_OBJECT(FIB_5_MCS_10_LIGHTRIG, (<<1733.74219, 3297.11157, 0.0>>)) ENDIF ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("michael", GET_PLAYER_PED_MODEL(char_michael)) //michael or (get_cutscene_time() >= airport_end_cutscene_time) //not required switch is done before the cutscene is started endif if CAN_SET_EXIT_STATE_FOR_CAMERA() or (get_cutscene_time() >= airport_end_cutscene_time) set_gameplay_cam_relative_heading(0) set_gameplay_cam_relative_pitch(0) eSwitchCamState = SWITCH_CAM_SETUP_SPLINE_1 //[MF] Force first frame of switch camera spline to render immediately after cutscene completes. HANDLE_SWITCH_CAM_MIKE_TO_TREV_AND_PAT(scsSwitchCamMikeToTrevPatricia_Intro, scsSwitchCamMikeToTrevPatricia_Outro) BYPASS_CUTSCENE_CAM_RENDERING_THIS_UPDATE() endif if get_cutscene_time() >= airport_end_cutscene_time REPLAY_STOP_EVENT() e_mission_stage = stage_switch_to_trevor e_section_stage = SECTION_STAGE_SETUP endif if not airport_mocap_michael_in_0 if get_cutscene_time() >= 98133 ANIMPOSTFX_PLAY("SwitchOpenMichaelIn", 0, false) PLAY_SOUND_FRONTEND(-1, "Hit_out", "PLAYER_SWITCH_CUSTOM_SOUNDSET") airport_mocap_michael_in_0 = true endif endif else SET_CUTSCENE_FADE_VALUES(false, false, true) e_section_stage = SECTION_STAGE_CLEANUP endif else REPLAY_STOP_EVENT() endif break endswitch endif IF e_section_stage = SECTION_STAGE_SKIP REPLAY_CANCEL_EVENT() switch airport_mocap_status case 1 case 2 if is_cutscene_active() STOP_CUTSCENE() endif break endswitch endif IF e_section_stage = SECTION_STAGE_CLEANUP if is_cutscene_active() if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("michael", GET_PLAYER_PED_MODEL(char_michael)) //michael // make_selector_ped_selection(selector_ped, SELECTOR_PED_michael) // take_control_of_selector_ped(selector_ped, true, false) // SET_PED_USING_ACTION_MODE(player_ped_id(), false) // force_ped_motion_state(player_ped_id(), MS_on_foot_idle) // force_ped_ai_and_animation_update(player_ped_id()) endif else REPLAY_STOP_EVENT() setup_entities_after_drop_off() cleanup_airport_cutscene = true //stops it processing within stage_switch_to_trevor eSwitchCamState = SWITCH_CAM_SETUP_SPLINE_1 HANDLE_SWITCH_CAM_MIKE_TO_TREV_AND_PAT(scsSwitchCamMikeToTrevPatricia_Intro, scsSwitchCamMikeToTrevPatricia_Outro) e_mission_stage = stage_switch_to_trevor e_section_stage = SECTION_STAGE_SETUP end_cutscene() endif endif endproc proc drop_off_patricia_dialogue_system() switch drop_off_patricia_dialogue_system_status case 0 if lk_timer(dialogue_time, iMikeToTrevAndPat_DialogueStartTime) if not is_any_text_being_displayed(locates_data, IAT_IGNORE_GOD_TEXT_IF_SUBTITLES_OFF) if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_TNP", conv_priority_low) drop_off_patricia_dialogue_system_status++ endif endif endif break case 1 if lk_timer(dialogue_time, 10000) if not has_label_been_triggered("fbi5a_mess") if not allow_dialogue_to_trigger(locates_data.LocationBlip, patricia.ped, null) //not allowing main dialogue to trigger if GET_PLAYER_WANTED_LEVEL(player_id()) = 0 get_dialogue_data_for_future_resumption() if create_conversation(scripted_speech, "fbi5aAU", "fbi5a_mess", conv_priority_medium) dialogue_time = get_game_timer() set_label_as_triggered("fbi5a_mess", true) else kill_any_conversation() endif endif endif endif endif if dialogue_monitoring_system(locates_data.LocationBlip, patricia.ped, null, false) RESET_PED_IN_VEHICLE_CONTEXT(player_ped_id()) drop_off_patricia_dialogue_system_status++ endif break case 2 break case 22 break endswitch endproc proc switch_to_trevor() BYPASS_CUTSCENE_CAM_RENDERING_THIS_UPDATE() IF e_section_stage = SECTION_STAGE_SETUP printstring("switch_to_trevor test 0") printnl() request_model(model_trevor) request_model(trevors_truck.model) request_model(patricia.model) //request_anim_dict("missfbi5@trevor_driving") REQUEST_CLIP_SET("clipset@missfbi5_trevor_driving") request_vehicle_recording(trevors_truck.recording_number, "lkfbi5a") if has_model_loaded(model_trevor) and has_model_loaded(trevors_truck.model) and has_model_loaded(patricia.model) //and has_anim_dict_loaded("missfbi5@trevor_driving") and has_clip_set_loaded("clipset@missfbi5_trevor_driving") and has_vehicle_recording_been_loaded(trevors_truck.recording_number, "lkfbi5a") clear_area(trevors_truck.pos, 22.00, true) CREATE_PLAYER_VEHICLE(trevors_truck.veh, CHAR_TREVOR, trevors_truck.pos, trevors_truck.heading, false) start_playback_recorded_vehicle(trevors_truck.veh, trevors_truck.recording_number, "lkfbi5a") SKIP_TIME_IN_PLAYBACK_RECORDED_VEHICLE(trevors_truck.veh, 5000) force_playback_recorded_vehicle_update(trevors_truck.veh) set_playback_speed(trevors_truck.veh, 0.0) if GET_VEHICLE_MOD_KIT(trevors_truck.veh) >= 0 AND GET_VEHICLE_MOD_KIT(trevors_truck.veh) < 255 IF GET_VEHICLE_MOD(trevors_truck.veh, MOD_ROOF) >= 0 REMOVE_VEHICLE_MOD(trevors_truck.veh, MOD_ROOF) ENDIF ENDIF //create_player_ped_inside_vehicle(selector_ped.pedID[selector_ped_trevor], char_trevor, trevors_truck.veh) set_ped_into_vehicle(selector_ped.pedID[selector_ped_trevor], trevors_truck.veh) SET_PED_COMP_ITEM_CURRENT_SP(selector_ped.pedID[selector_ped_trevor], comp_type_outfit, OUTFIT_P2_TSHIRT_CARGOPANTS_1, false) add_ped_for_dialogue(scripted_speech, 2, selector_ped.pedID[selector_ped_trevor], "trevor") CREATE_NPC_PED_INSIDE_VEHICLE(patricia.ped, CHAR_PATRICIA, trevors_truck.veh, vs_front_right) setup_buddy_attributes(patricia) setup_relationship_contact(patricia.ped, true) SET_PED_LOD_MULTIPLIER(patricia.ped, 2.0) add_ped_for_dialogue(scripted_speech, 7, patricia.ped, "patricia") make_selector_ped_selection(selector_ped, SELECTOR_PED_trevor) selector_cam.pedTo = selector_ped.pedID[SELECTOR_PED_trevor] SET_VEHICLE_POPULATION_BUDGET(2) start_audio_scene("FBI_5_TAKE_PATRICIA_HOME") //[MF] Safety, just in case we arrive at this state without the switch cam being initialized IF eSwitchCamState = SWITCH_CAM_IDLE eSwitchCamState = SWITCH_CAM_SETUP_SPLINE_1 ENDIF e_section_stage = SECTION_STAGE_RUNNING endif endif IF e_section_stage = SECTION_STAGE_RUNNING printstring("switch_to_trevor test 1") printnl() if get_current_player_ped_enum() = char_trevor set_ped_reset_flag(player_ped_id(), PRF_DisableInVehicleActions, true) set_ped_reset_flag(player_ped_id(), PRF_PreventGoingIntoShuntInVehicleState, true) set_ped_reset_flag(patricia.ped, PRF_DisableInVehicleActions, true) set_ped_reset_flag(patricia.ped, PRF_PreventGoingIntoShuntInVehicleState, true) endif //IF RUN_SWITCH_CAM_FROM_PLAYER_TO_PED(selector_cam) // Returns FALSE when the camera spline is complete IF NOT HANDLE_SWITCH_CAM_MIKE_TO_TREV_AND_PAT(scsSwitchCamMikeToTrevPatricia_Intro, scsSwitchCamMikeToTrevPatricia_Outro)// Returns TRUE when the camera spline is complete drop_off_patricia_dialogue_system() IF selector_cam.bOKToSwitchPed IF NOT selector_cam.bPedSwitched IF TAKE_CONTROL_OF_SELECTOR_PED(selector_ped, false) clear_area(get_entity_coords(player_ped_id()), 300, true) REPLAY_RECORD_BACK_FOR_TIME(0.0, 15.0, REPLAY_IMPORTANCE_HIGH) prepare_music_event("FBI5A_TREV_RADIO_FRTA") SET_INITIAL_PLAYER_STATION("RADIO_01_CLASS_ROCK") //start_playback_recorded_vehicle(trevors_truck.veh, trevors_truck.recording_number, "lkfbi5a") selector_cam.bPedSwitched = true endif endif endif else // trigger_music_event("FBI5A_TREV_RADIO_FRTA") //[MF] triggered during the switch dialogue_time = get_game_timer() if is_playback_going_on_for_vehicle(trevors_truck.veh) stop_playback_recorded_vehicle(trevors_truck.veh) endif SET_PED_IN_VEHICLE_CONTEXT(player_ped_id(), get_hash_key("MISSFBI5_TREVOR_DRIVING")) INFORM_MISSION_STATS_OF_INCREMENT(FBI5_SWITCHES) e_mission_stage = stage_drop_off_patricia e_section_stage = SECTION_STAGE_SETUP endif endif IF e_section_stage = SECTION_STAGE_SKIP switch switch_to_trevor_system_status case 0 make_selector_ped_selection(selector_ped, selector_ped_trevor) selector_cam.pedTo = selector_ped.pedID[SELECTOR_PED_TREVOR] clear_this_print("H2PART3_help0") switch_to_trevor_system_status++ break endswitch endif IF e_section_stage = SECTION_STAGE_CLEANUP endif endproc proc madrazzos_guard_ai_system() int i = 0 for i = 0 to count_of(madrazzos_guard) - 1 if not is_ped_injured(madrazzos_guard[i].ped) if madrazzos_guard_ai_system_status[i] != 23 if has_ped_been_harmed(madrazzos_guard[i].ped, madrazzos_guard[i].health) or has_player_antagonised_ped(madrazzos_guard[i].ped, 30.00, true) or is_ped_ragdoll(madrazzos_guard[i].ped) madrazzos_guard_ai_system_status[0] = 22 madrazzos_guard_ai_system_status[1] = 22 attacked_madrazzos_guard_fail = true endif endif switch madrazzos_guard_ai_system_status[i] case 0 break case 1 break case 22 set_blocking_of_non_temporary_events(madrazzos_guard[i].ped, false) set_ped_sphere_defensive_area(madrazzos_guard[i].ped, madrazzos_guard[i].run_to_pos, 2.0) SET_PED_COMBAT_ATTRIBUTES(madrazzos_guard[i].ped, CA_REMOVE_AREA_SET_WILL_ADVANCE_WHEN_DEFENSIVE_AREA_REACHED, TRUE) SET_PED_COMBAT_ATTRIBUTES(madrazzos_guard[i].ped, CA_CAN_CHARGE, TRUE) task_combat_hated_targets_around_ped(madrazzos_guard[i].ped, 200.00) madrazzos_guard_ai_system_status[i] = 23 break case 23 break endswitch else if not madrazzos_guard[i].created request_model(madrazzos_guard[i].model) request_anim_dict("mini@strip_club@idles@bouncer@idle_a") request_anim_dict("mini@strip_club@idles@bouncer@idle_c") if has_model_loaded(madrazzos_guard[i].model) and has_anim_dict_loaded("mini@strip_club@idles@bouncer@idle_a") and has_anim_dict_loaded("mini@strip_club@idles@bouncer@idle_c") setup_enemy(madrazzos_guard[i]) set_ped_component_variation(madrazzos_guard[i].ped, PED_COMP_TORSO, i, 0) remove_blip(madrazzos_guard[i].blip) task_look_at_entity(madrazzos_guard[i].ped, player_ped_id(), -1, slf_while_not_in_fov) switch i case 0 open_sequence_task(seq) task_play_anim(null, "mini@strip_club@idles@bouncer@idle_a", "idle_a", normal_blend_in, normal_blend_out, -1, af_looping) close_sequence_task(seq) task_perform_sequence(madrazzos_guard[i].ped, seq) clear_sequence_task(seq) break case 1 open_sequence_task(seq) task_play_anim(null, "mini@strip_club@idles@bouncer@idle_c", "idle_c", normal_blend_in, normal_blend_out, -1, af_looping) close_sequence_task(seq) task_perform_sequence(madrazzos_guard[i].ped, seq) clear_sequence_task(seq) break endswitch endif else //player killed by sniper bullet immediately attacked_madrazzos_guard_fail = true endif endif endfor endproc proc drop_off_patricia() IF e_section_stage = SECTION_STAGE_SETUP SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(7, "drive with patricia", true) dialogue_time = get_game_timer() e_section_stage = SECTION_STAGE_RUNNING endif if drop_off_patricia_status < 2 madrazzos_guard_ai_system() endif IF e_section_stage = SECTION_STAGE_RUNNING switch drop_off_patricia_status case 0 drop_off_patricia_dialogue_system() mocap_streaming_system(<<1369.7981, 1148.1598, 113.2>>, DEFAULT_CUTSCENE_LOAD_DIST, DEFAULT_CUTSCENE_UNLOAD_DIST, "FBI_5_EXT") if can_request_assets_for_cutscene_entity() SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("trevor", PLAYER_PED_ID()) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("patricia", patricia.ped) endif //add in set ped in mocap for variaitons commands. if is_player_at_location_with_buddy_in_vehicle(locates_data, <<1362.9181, 1156.9108, 112.7590>>, <<2.5, 2.5, 2.5>>, true, patricia.ped, trevors_truck.veh, "fbi5a_god_21", "fbi5a_god_23", "", "fbi5a_god_22", false, true) BRING_VEHICLE_TO_HALT_AND_DISABLE_VEH_CONTROLS(trevors_truck.veh) drop_off_patricia_status++ endif break case 1 mocap_streaming_system(<<1369.7981, 1148.1598, 113.2>>, DEFAULT_CUTSCENE_LOAD_DIST, DEFAULT_CUTSCENE_UNLOAD_DIST, "FBI_5_EXT") if can_request_assets_for_cutscene_entity() SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("trevor", PLAYER_PED_ID()) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("patricia", patricia.ped) endif if BRING_VEHICLE_TO_HALT_AND_DISABLE_VEH_CONTROLS(trevors_truck.veh) if has_cutscene_loaded() if start_new_cutscene_no_fade() if is_audio_scene_active("FBI_5_TAKE_PATRICIA_HOME") STOP_AUDIO_SCENE("FBI_5_TAKE_PATRICIA_HOME") endif clear_mission_locate_stuff(locates_data) register_entity_for_cutscene(patricia.ped, "patricia", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, patricia.model) register_entity_for_cutscene(trevors_truck.veh, "trevors_car", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, trevors_truck.model) setup_vehicle_proofs(trevors_truck.veh) REPLAY_RECORD_BACK_FOR_TIME(10.0, 0.0) REPLAY_START_EVENT(REPLAY_IMPORTANCE_HIGHEST) if get_cam_view_mode_for_context(cam_view_mode_context_in_vehicle) = cam_view_mode_first_person SET_VEHICLE_MODEL_PLAYER_WILL_EXIT_SCENE(trevors_truck.model) endif start_cutscene() drop_off_patricia_status++ endif endif endif break case 2 if is_cutscene_playing() clear_area(<<1369.7981, 1148.1598, 112.7589>>, 1000, true) drop_off_patricia_status++ endif break case 3 if is_cutscene_active() if not WAS_CUTSCENE_SKIPPED() if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("trevor", GET_PLAYER_PED_MODEL(char_trevor)) set_ped_into_vehicle(player_ped_id(), trevors_truck.veh) endif if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("patricia", patricia.model) delete_ped(patricia.ped) endif if CAN_SET_EXIT_STATE_FOR_CAMERA(true) set_gameplay_cam_relative_heading(0) set_gameplay_cam_relative_pitch(0) endif else SET_CUTSCENE_FADE_VALUES(false, false, true) drop_off_patricia_status++ endif else deactivate_vehicle_proofs(trevors_truck.veh) SET_VEHICLE_DOORS_SHUT(trevors_truck.veh, true) end_cutscene_no_fade() REPLAY_STOP_EVENT() mission_passed() endif break case 4 if is_cutscene_active() if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("trevor", GET_PLAYER_PED_MODEL(char_trevor)) set_ped_into_vehicle(player_ped_id(), trevors_truck.veh) endif else if does_entity_exist(patricia.ped) delete_ped(patricia.ped) endif deactivate_vehicle_proofs(trevors_truck.veh) SET_VEHICLE_DOORS_SHUT(trevors_truck.veh, true) end_cutscene() REPLAY_STOP_EVENT() mission_passed() endif break endswitch endif IF e_section_stage = SECTION_STAGE_SKIP switch drop_off_patricia_status case 0 clear_ped_tasks_immediately(player_ped_id()) set_ped_into_vehicle(player_ped_id(), trevors_truck.veh) clear_ped_tasks_immediately(patricia.ped) set_ped_into_vehicle(patricia.ped, trevors_truck.veh, vs_front_right) set_entity_coords(trevors_truck.veh, <<1369.7981, 1148.1598, 112.7589>>) drop_off_patricia_status++ break case 1 break endswitch endif IF e_section_stage = SECTION_STAGE_CLEANUP endif endproc //object_index temp_crate PROC HOTSWAP_TO_FORKLIFT() // if not does_entity_exist(temp_crate) // temp_crate = create_object(crate.model, <<3637.69, 3761.28, 28.51>>) // set_entity_rotation(temp_crate, <<0.0, 0.0, 0.0>>) // endif ATTACH_CHOPPER_TO_CONTAINER_WITH_ROPE(helicopter.veh, crate.obj, rope_chopper, b_ropes_created, b_ropes_attached, FALSE, TRUE) IF e_section_stage = SECTION_STAGE_SETUP set_selector_ped_hint(selector_ped, SELECTOR_PED_MICHAEL) SET_SELECTOR_PED_PRIORITY(selector_ped, selector_ped_trevor, selector_ped_michael, number_of_selector_peds) helicopter_target_pos = get_offset_from_entity_in_world_coords(crate.obj, <<0.0, 0.0, 7.3>>) print_now("H2PART3_help1", default_god_text_time, 1) //freeze_entity_position(fridge_pallet.obj, false) //freeze_entity_position(fridge.obj, false) set_entity_collision(fridge.obj, true)//fixes issue with the fridge being attached but having no collision after switch to chopper and then back to michael e_section_stage = section_stage_running rope_pos[0] = GET_ROPE_VERTEX_COORD( rope_chopper[0], 0 ) rope_pos[1] = GET_ROPE_VERTEX_COORD( rope_chopper[1], 0 ) rope_pos[2] = GET_ROPE_VERTEX_COORD( rope_chopper[2], 0 ) rope_pos[3] = GET_ROPE_VERTEX_COORD( rope_chopper[3], 0 ) ROPE_ATTACH_VIRTUAL_BOUND_GEOM( rope_chopper[0], 0, rope_pos[0], rope_pos[1], rope_pos[2], rope_pos[3] ) ROPE_ATTACH_VIRTUAL_BOUND_GEOM( rope_chopper[1], 0, rope_pos[0], rope_pos[1], rope_pos[2], rope_pos[3] ) ROPE_ATTACH_VIRTUAL_BOUND_GEOM( rope_chopper[2], 0, rope_pos[0], rope_pos[1], rope_pos[2], rope_pos[3] ) ROPE_ATTACH_VIRTUAL_BOUND_GEOM( rope_chopper[3], 0, rope_pos[0], rope_pos[1], rope_pos[2], rope_pos[3] ) ENDIF if e_section_stage = section_stage_running switch hotswap_to_forklift_status case 0 if update_selector_hud(selector_ped) if HAS_SELECTOR_PED_BEEN_SELECTED(selector_ped, SELECTOR_PED_MICHAEL) if setup_hotswap_cam_to_michael() hotswap_to_forklift_status++ endif endif endif break case 1 IF RUN_CAM_SPLINE_FROM_PLAYER_TO_PED(selector_cam) // Returns FALSE when the camera spline is complete IF selector_cam.bOKToSwitchPed IF NOT selector_cam.bPedSwitched IF TAKE_CONTROL_OF_SELECTOR_PED(selector_ped) selector_cam.bPedSwitched = TRUE endif endif endif else destroy_all_cams() //fix to stop interior glitch trigger_music_event("FBI5A_LOAD_CRATE_MA") e_mission_stage = STAGE_LOAD_CONTAINER_INTO_CRATE e_section_stage = SECTION_STAGE_SETUP endif break case 2 break endswitch endif IF e_section_stage = SECTION_STAGE_SKIP switch hotswap_to_forklift_status case 0 make_selector_ped_selection(selector_ped, SELECTOR_PED_michael) selector_cam.pedTo = selector_ped.pedID[selector_ped.eNewSelectorPed] selector_cam.bPedSwitched = FALSE hotswap_to_forklift_status++ break case 1 IF RUN_CAM_SPLINE_FROM_PLAYER_TO_PED(selector_cam) // Returns FALSE when the camera spline is complete IF selector_cam.bOKToSwitchPed IF NOT selector_cam.bPedSwitched IF TAKE_CONTROL_OF_SELECTOR_PED(selector_ped) selector_cam.bPedSwitched = TRUE endif endif endif else e_mission_stage = STAGE_LOAD_CONTAINER_INTO_CRATE e_section_stage = SECTION_STAGE_SETUP endif break endswitch endif dave_ai_system_2() steve_ai_system_2() if not helicopter_stabilized if SLIDE_CAR_TO_POSITION_AND_ROTATION(helicopter.veh, 2000, helicopter_target_pos, <<0.0, 0.0, get_entity_heading(helicopter.veh)>>) helicopter_stabilized = true endif else helicopter_hover_system() endif set_heli_blades_full_speed(helicopter.veh) // printstring("crate pos: ") // printvector(get_entity_coords(crate.obj)) // printnl() // // printstring("height above ground: ") // printfloat(GET_ENTITY_HEIGHT_ABOVE_GROUND(crate.obj)) // printnl() ENDPROC PROC LOAD_CONTAINER_INTO_CRATE() dave_ai_system_2() steve_ai_system_2() helicopter_hover_system() set_heli_blades_full_speed(helicopter.veh) ENDPROC PROC REVERSE_OUT_CRATE() IF e_section_stage = SECTION_STAGE_SETUP e_section_stage = SECTION_STAGE_RUNNING ENDIF dave_ai_system_2() steve_ai_system_2() helicopter_hover_system() set_heli_blades_full_speed(helicopter.veh) ENDPROC proc setup_mission_fail() REMOVE_ALL_BLIPS(true) fail_time = get_game_timer() stop_mission_fail_checks = true trigger_music_event("FBI5A_MISSION_FAIL") //e_mission_stage = stage_shootout_fail MISSION_FLOW_MISSION_FAILED_WITH_REASON(mission_failed_text) endproc #IF IS_DEBUG_BUILD // INT iWdPedForceProg // VECTOR vWdPedForceOff, vWdPedForce // VECTOR vWdForceConverted // VECTOR vWdForcePedPos, vWdForcePedCurPos // FLOAT fWdFOrcePedHead, fWdForcePedCurHead // FLOAT fWdForceMulti // BOOL bWdApplyPedForce, bWdPedForceOutput // BOOL bWdForcePedActivate // BOOL bWdPedFOrceSetRagdoll // BOOL bWdPedForceResetPed // BOOL bWdForcePedMovePed PROC DO_DEBUG() #IF IS_DEBUG_BUILD dont_do_j_skip(locates_data) IF NOT b_is_skipping_in_progress IF e_section_stage = SECTION_STAGE_SKIP e_section_stage = SECTION_STAGE_RUNNING ENDIF IF e_section_stage = SECTION_STAGE_RUNNING IF IS_KEYBOARD_KEY_JUST_PRESSED(KEY_J) e_section_stage = SECTION_STAGE_SKIP ENDIF ENDIF // IF e_section_stage = SECTION_STAGE_RUNNING // // IF IS_KEYBOARD_KEY_JUST_PRESSED(KEY_S) // MISSION_PASSED() // // ELIF IS_KEYBOARD_KEY_JUST_PRESSED(KEY_F) // // setup_mission_fail() // // WHILE NOT GET_MISSION_FLOW_SAFE_TO_CLEANUP() // WAIT(0) // printstring("GET_MISSION_FLOW_SAFE_TO_CLEANUP()") // printnl() // ENDWHILE // // MISSION_FLOW_SET_FAIL_WARP_LOCATION(<<3826.0095, 4461.6323, 2.1847>>, 275.4845) // // MISSION_FAILED() // // ELIF IS_KEYBOARD_KEY_JUST_PRESSED(KEY_J) // e_section_stage = SECTION_STAGE_SKIP // // endif // IF LAUNCH_MISSION_STAGE_MENU(s_skip_menu, i_debug_jump_stage) // //Miss out chopper hotswap as a stage //// IF i_debug_jump_stage > 10 //// i_debug_jump_stage++ //// ENDIF // // MISSION_STAGE e_stage = INT_TO_ENUM(MISSION_STAGE, i_debug_jump_stage + 1) // SKIP_TO_STAGE(e_stage) // ENDIF // ENDIF ENDIF #endif ENDPROC #ENDIF func bool is_vehicle_out_of_water(vehicle_index mission_veh, int &water_timer) //, bool &start_water_timer, int time_out_of_water = 10000) if does_entity_exist(mission_veh) if is_vehicle_driveable(mission_veh) if not is_entity_in_water(mission_veh) if lk_timer(water_timer, 10000) return true endif else water_timer = get_game_timer() endif endif endif return false endfunc func bool is_fridget_pallet_stuck() vector matrix_front vector matrix_side vector matrix_up vector matrix_pos if does_entity_exist(fridge_pallet.obj) GET_ENTITY_MATRIX(fridge_pallet.obj, matrix_front, matrix_side, matrix_up, matrix_pos) if dot_product(matrix_up, <<0.0, 0.0, 1.0>>) < 0.5 if pallet_time = 0 pallet_time = get_game_timer() endif if lk_timer(pallet_time, 60000) return true endif else pallet_time = 0 endif endif return false endfunc func bool mission_fail_checks() switch e_mission_stage case STAGE_OPENING_CUTSCENE if mission_ped_injured(dave.ped) endif if mission_ped_injured(steve.ped) endif if mission_vehicle_injured(boat.veh) endif break case STAGE_GO_TO_PIPE case STAGE_DIVE_OUT_CUTSCENE if mission_ped_injured(dave.ped) mission_failed_text = "FAIL_CREW5" e_mission_stage = stage_underwater_fail return true endif if mission_ped_injured(steve.ped) mission_failed_text = "FAIL_CREW6" e_mission_stage = stage_underwater_fail return true endif if mission_vehicle_injured(boat.veh) mission_failed_text = "FAIL_BOAT" e_mission_stage = stage_underwater_fail return true endif if is_vehicle_stuck_every_check(boat.veh) or is_vehicle_out_of_water(boat.veh, boat_time) mission_failed_text = "STUCK_BOAT" e_mission_stage = stage_underwater_fail return true endif if get_distance_between_coords(get_entity_coords(player_ped_id()), v_pipe_pos_above_water) > 1200 mission_failed_text = "fbi5a_FAIL_14" e_mission_stage = stage_underwater_fail return true endif if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped)) > 200.00 and get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped)) > 200.00 mission_failed_text = "FAIL_CREW3" e_mission_stage = stage_underwater_fail return true elif get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped)) > 200.00 mission_failed_text = "fbi5a_FAIL_18" e_mission_stage = stage_underwater_fail return true elif get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped)) > 200.00 mission_failed_text = "fbi5a_FAIL_19" e_mission_stage = stage_underwater_fail return true endif //fails if the player leaves the buddies and gets near the chemical factory on foot if not is_entity_in_water(player_ped_id()) if not is_ped_inside_interior(player_ped_id(), v_pipe_end_pos, "v_lab") if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped)) > 100.00 or get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped)) > 100.00 mission_failed_text = "FAIL_CREW3" e_mission_stage = stage_underwater_fail return true endif endif endif break case STAGE_SWIM_TO_PIPE case STAGE_PIPE_PREPARE_CUTSCENE case STAGE_CUT_PIPE case STAGE_PIPE_LEAVE_CUTSCENE case STAGE_SWIM_INTO_LAB case stage_get_out_of_water_mocap if mission_ped_injured(dave.ped) mission_failed_text = "FAIL_CREW5" e_mission_stage = stage_underwater_fail return true endif if mission_ped_injured(steve.ped) mission_failed_text = "FAIL_CREW6" e_mission_stage = stage_underwater_fail return true endif if e_mission_stage != stage_get_out_of_water_mocap if e_mission_stage = STAGE_SWIM_TO_PIPE // printstring("dave distance = ") // printfloat(get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped))) // printnl() // // printstring("steve distance = ") // printfloat(get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped))) // printnl() if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped)) > 250.00 or get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped)) > 250.00 mission_failed_text = "FAIL_CREW3" e_mission_stage = stage_underwater_fail return true endif elif e_mission_stage = STAGE_SWIM_INTO_LAB if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped)) > 130.00 or get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped)) > 130.00 mission_failed_text = "FAIL_CREW3" e_mission_stage = stage_underwater_fail return true endif else if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped)) > 150.00 or get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped)) > 150.00 mission_failed_text = "FAIL_CREW3" e_mission_stage = stage_underwater_fail return true endif endif if not is_entity_in_water(player_ped_id()) if not is_ped_inside_interior(player_ped_id(), v_pipe_end_pos, "v_lab") if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped)) > 100.00 or get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped)) > 100.00 mission_failed_text = "FAIL_CREW3" e_mission_stage = stage_underwater_fail return true endif endif endif if is_player_wanted_level_greater(player_id(), 0) mission_failed_text = "FAIL_CREW9" e_mission_stage = stage_underwater_fail return true endif endif //add check in for player being in angled area arround lab the fail on cover was blown. if welding_gun_fuel_fail mission_failed_text = "FAIL_CREW4" e_mission_stage = stage_fuel_gun_fail return true endif break case STAGE_GET_TO_LIFT case STAGE_LIFT_CUTSCENE case STAGE_FIND_CHEMICALS case stage_chemicals_cutscene case stage_shootout kill_ped_on_certain_damage(dave) kill_ped_on_certain_damage(steve) if mission_ped_injured(dave.ped) mission_failed_text = "FAIL_CREW5" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(steve.ped) mission_failed_text = "FAIL_CREW6" e_mission_stage = stage_shootout_fail return true endif if mission_vehicle_injured(truck.veh) mission_failed_text = "FAIL_FORK" e_mission_stage = stage_shootout_fail return true endif if e_mission_stage = STAGE_FIND_CHEMICALS if alarm_fail //and lk_timer(alarm_time, 5000) //or (alarm_time_stored and lk_timer(alarm_time, 30000) //and (not is_ped_injured(scientist[2].ped) or not is_ped_injured(scientist[3].ped))) //and not (is_ped_injured(scientist[2].ped) and is_ped_injured(scientist[3].ped)) START_ALARM("FIB_05_BIOTECH_LAB_ALARMS", false) mission_failed_text = "FAIL_CREW9" e_mission_stage = stage_shootout_fail return true endif endif if does_entity_exist(dave.ped) if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped)) > 200.00 or get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped)) > 200.00 mission_failed_text = "FAIL_CREW3" e_mission_stage = stage_shootout_fail return true endif endif if does_entity_exist(fridge.obj) if get_entity_health(fridge.obj) < 700 mission_failed_text = "fbi5a_FAIL_21" e_mission_stage = stage_shootout_fail return true endif endif break case STAGE_LOAD_FRIDGE case STAGE_GET_FORKLIFT case STAGE_LOAD_FORKLIFT if mission_ped_injured(dave.ped) mission_failed_text = "FAIL_CREW5" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(steve.ped) mission_failed_text = "FAIL_CREW6" e_mission_stage = stage_shootout_fail return true endif if mission_vehicle_injured(truck.veh) mission_failed_text = "FAIL_FORK" e_mission_stage = stage_shootout_fail return true endif if is_vehicle_stuck_every_check(truck.veh) mission_failed_text = "FAIL_FORK2" e_mission_stage = stage_shootout_fail return true endif // if is_fridget_pallet_stuck() // mission_failed_text = "FAIL_CREW10" // e_mission_stage = stage_shootout_fail // return true // endif if does_entity_exist(fridge.obj) if get_entity_health(fridge.obj) < 700 mission_failed_text = "fbi5a_FAIL_21" e_mission_stage = stage_shootout_fail return true endif endif if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped)) > 200.00 or get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped)) > 200.00 mission_failed_text = "FAIL_CREW3" e_mission_stage = stage_shootout_fail return true endif break case STAGE_HOTSWAP_TO_CHOPPER case STAGE_HOTSWAP_TO_FORKLIFT case STAGE_LOAD_CONTAINER_INTO_CRATE case STAGE_REVERSE_OUT_CRATE case stage_collect_crate case stage_collect_crate_mocap if mission_ped_injured(dave.ped) mission_failed_text = "FAIL_CREW5" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(steve.ped) mission_failed_text = "FAIL_CREW6" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(selector_ped.pedID[SELECTOR_PED_MICHAEL]) mission_failed_text = "FAIL_CREW7" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(selector_ped.pedID[SELECTOR_PED_TREVOR]) mission_failed_text = "FAIL_CREW8" e_mission_stage = stage_shootout_fail return true endif if mission_vehicle_injured(truck.veh) mission_failed_text = "FAIL_FORK" e_mission_stage = stage_shootout_fail return true endif if does_entity_exist(fridge.obj) if get_entity_health(fridge.obj) < 700 mission_failed_text = "fbi5a_FAIL_21" e_mission_stage = stage_shootout_fail return true endif endif // if is_vehicle_stuck_timer_up(forklift_truck.veh, VEH_STUCK_ON_ROOF, ROOF_TIME) // script_assert("VEH_STUCK_ON_ROOF") // endif // // if is_vehicle_stuck_timer_up(forklift_truck.veh, VEH_STUCK_JAMMED, JAMMED_TIME) // script_assert("VEH_STUCK_JAMMED") // endif // // if is_vehicle_stuck_timer_up(forklift_truck.veh, VEH_STUCK_HUNG_UP, HUNG_UP_TIME) // script_assert("VEH_STUCK_HUNG_UP") // endif // // if is_vehicle_stuck_timer_up(forklift_truck.veh, VEH_STUCK_ON_SIDE, SIDE_TIME) // script_assert("VEH_STUCK_ON_SIDE") // endif // if is_vehicle_stuck_every_check(truck.veh) // mission_failed_text = "FAIL_FORK2" // e_mission_stage = stage_shootout_fail // return true // endif // if is_fridget_pallet_stuck() // e_mission_stage = stage_shootout_fail // return true // endif if mission_vehicle_injured(helicopter.veh) if not is_entity_dead(helicopter.veh) FREEZE_ENTITY_POSITION(helicopter.veh, false) endif mission_failed_text = "FAIL_CHOPPER" e_mission_stage = stage_shootout_fail return true endif if (e_mission_stage != stage_collect_crate_mocap) and not is_cutscene_playing() if get_current_player_ped_enum() = char_trevor if is_vehicle_stuck_every_check(helicopter.veh) mission_failed_text = "FAIL_CHOPPER2" e_mission_stage = stage_shootout_fail return true endif if not is_ped_sitting_in_vehicle(player_ped_id(), helicopter.veh) if get_entity_height_above_ground(helicopter.veh) > 15 mission_failed_text = "FAIL_CHOPPER3" e_mission_stage = stage_helicopter_fail return true endif endif endif endif // if get_current_player_ped_enum() = char_michael // if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(dave.ped)) > 200.00 // or get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(steve.ped)) > 200.00 // mission_failed_text = "FAIL_CREW3" // e_mission_stage = stage_shootout_fail // return true // endif // endif break case stage_fly_to_airport if mission_ped_injured(dave.ped) mission_failed_text = "FAIL_CREW5" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(steve.ped) mission_failed_text = "FAIL_CREW6" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(selector_ped.pedID[SELECTOR_PED_MICHAEL]) mission_failed_text = "FAIL_CREW7" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(selector_ped.pedID[SELECTOR_PED_TREVOR]) mission_failed_text = "FAIL_CREW8" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(selector_ped.pedID[selector_ped_franklin]) mission_failed_text = "fbi5a_FAIL_17" e_mission_stage = stage_shootout_fail return true endif if mission_vehicle_injured(helicopter.veh) if not is_entity_dead(helicopter.veh) FREEZE_ENTITY_POSITION(helicopter.veh, false) endif mission_failed_text = "FAIL_CHOPPER" e_mission_stage = stage_shootout_fail return true endif if mission_vehicle_injured(helicopter.veh) or mission_vehicle_injured(trailer.veh) mission_failed_text = "fbi5a_FAIL_16" e_mission_stage = stage_shootout_fail return true endif if fly_to_airport_master_flow_system_status = 0 if get_current_player_ped_enum() = char_trevor if is_vehicle_stuck_every_check(helicopter.veh) mission_failed_text = "FAIL_CHOPPER2" e_mission_stage = stage_shootout_fail return true endif if not is_ped_in_vehicle(player_ped_id(), helicopter.veh) if get_entity_height_above_ground(helicopter.veh) > 15 mission_failed_text = "FAIL_CHOPPER3" e_mission_stage = stage_helicopter_fail return true endif endif endif if does_entity_exist(crate.obj) // printstring("crate.obj = ") // printint(get_entity_health(crate.obj)) // printnl() if get_entity_health(crate.obj) < 300 mission_failed_text = "fbi5a_FAIL_15" e_mission_stage = stage_shootout_fail return true endif endif endif if fly_to_airport_master_flow_system_status = 2 vector trailer_rot trailer_rot = get_entity_rotation(trailer.veh) if absf(trailer_rot.x) > 72 or absf(trailer_rot.y) > 72 mission_failed_text = "fbi5a_FAIL_15" e_mission_stage = stage_shootout_fail return true endif endif if mission_vehicle_injured(truck.veh) mission_failed_text = "fbi5a_FAIL_16" e_mission_stage = stage_shootout_fail return true endif if mission_vehicle_injured(trailer.veh) mission_failed_text = "fbi5a_FAIL_16" e_mission_stage = stage_shootout_fail return true endif if get_distance_between_coords(get_entity_coords(player_ped_id()), <<1739.6, 3276.8, 41.1>>) > 3200 mission_failed_text = "fbi5a_FAIL_14" e_mission_stage = stage_shootout_fail return true endif break case stage_airport_mocap if mission_ped_injured(dave.ped) mission_failed_text = "FAIL_CREW5" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(selector_ped.pedID[SELECTOR_PED_MICHAEL]) mission_failed_text = "FAIL_CREW7" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(selector_ped.pedID[selector_ped_franklin]) mission_failed_text = "fbi5a_FAIL_17" e_mission_stage = stage_shootout_fail return true endif if mission_vehicle_injured(helicopter.veh) if not is_entity_dead(helicopter.veh) FREEZE_ENTITY_POSITION(helicopter.veh, false) endif mission_failed_text = "FAIL_CHOPPER" e_mission_stage = stage_shootout_fail return true endif if mission_vehicle_injured(helicopter.veh) or mission_vehicle_injured(trailer.veh) mission_failed_text = "fbi5a_FAIL_16" e_mission_stage = stage_shootout_fail return true endif break case stage_switch_to_trevor if mission_ped_injured(selector_ped.pedID[SELECTOR_PED_TREVOR]) mission_failed_text = "FAIL_CREW8" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(patricia.ped) mission_failed_text = "fbi5a_FAIL_11" e_mission_stage = stage_shootout_fail return true endif if mission_vehicle_injured(trevors_truck.veh) mission_failed_text = "fbi5a_FAIL_10" e_mission_stage = stage_shootout_fail return true endif break case stage_drop_off_patricia if mission_vehicle_injured(trevors_truck.veh) mission_failed_text = "fbi5a_FAIL_10" e_mission_stage = stage_shootout_fail return true endif if is_vehicle_stuck_every_check(trevors_truck.veh) mission_failed_text = "fbi5a_FAIL_13" e_mission_stage = stage_shootout_fail return true endif if mission_ped_injured(patricia.ped) mission_failed_text = "fbi5a_FAIL_11" e_mission_stage = stage_shootout_fail return true endif if drop_off_patricia_status <= 1 if get_distance_between_coords(get_entity_coords(player_ped_id()), get_entity_coords(patricia.ped)) > 200 mission_failed_text = "fbi5a_FAIL_12" e_mission_stage = stage_shootout_fail return true endif endif if attacked_madrazzos_guard_fail mission_failed_text = "fbi5a_FAIL_20" e_mission_stage = stage_shootout_fail return true endif break endswitch return false endfunc proc fuel_gun_fail_cutscene() MANAGE_GRID_WELDING_V2(s_welding_data) welding_camera_system() welding_gun_fuel_capacity_system() SET_PED_RESET_FLAG(player_ped_id(), PRF_DisableTakeOffScubaGear, true) if lk_timer(fail_time, 2000) IF GET_MISSION_FLOW_SAFE_TO_CLEANUP() MISSION_FLOW_SET_FAIL_WARP_LOCATION(<<3826.0095, 4461.6323, 2.1847>>, 275.4845) mission_failed() ENDIF ENDIF endproc proc underwater_fail_cutscene() SET_PED_RESET_FLAG(player_ped_id(), PRF_DisableTakeOffScubaGear, true) if lk_timer(fail_time, 2000) if GET_MISSION_FLOW_SAFE_TO_CLEANUP() RESTORE_PLAYER_PED_VARIATIONS(player_ped_id()) MISSION_FLOW_SET_FAIL_WARP_LOCATION(<<3826.0095, 4461.6323, 2.1847>>, 275.4845) mission_failed() endif endif endproc proc shootout_fail() if lk_timer(fail_time, 2000) if GET_MISSION_FLOW_SAFE_TO_CLEANUP() RESTORE_PLAYER_PED_VARIATIONS(player_ped_id()) MISSION_FLOW_SET_FAIL_WARP_LOCATION(<<3826.0095, 4461.6323, 2.1847>>, 275.4845) mission_failed() endif endif endproc proc helicopter_fail() if lk_timer(fail_time, 2000) if GET_MISSION_FLOW_SAFE_TO_CLEANUP() RESTORE_PLAYER_PED_VARIATIONS(player_ped_id()) MISSION_FLOW_SET_FAIL_WARP_LOCATION(<<3826.0095, 4461.6323, 2.1847>>, 275.4845) mission_failed() endif endif //ATTACH_CHOPPER_TO_CONTAINER_WITH_ROPE(helicopter.veh, crate.obj, rope_chopper, b_ropes_created, b_ropes_attached, FALSE, TRUE) endproc proc load_repeat_play_assets() REQUEST_MODEL(boat.model) request_model(model_michael) while not has_model_loaded(boat.model) or not has_model_loaded(model_michael) wait(0) endwhile clear_area(<<3801.2, 4468.4, 5.8>>, 1000, true) boat.veh = CREATE_VEHICLE(boat.model, v_boat_start_pos, 266.1028) set_vehicle_colours(boat.veh, 0, 0) SET_VEHICLE_DIRT_LEVEL(boat.veh, 5.0) SET_VEHICLE_ON_GROUND_PROPERLY(boat.veh) SET_VEH_RADIO_STATION(boat.veh, "OFF") SET_VEHICLE_EXTRA(boat.veh, 3, false) SET_MODEL_AS_NO_LONGER_NEEDED(boat.model) clear_ped_tasks_immediately(player_ped_id()) set_current_selector_ped(selector_ped_michael, false) set_entity_coords(player_ped_id(), <<3818.6096, 4463.6060, 2.7104>>) set_entity_heading(player_ped_id(), 269.9429) request_cutscene("fbi_5_int") while not has_cutscene_loaded() SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("Michael", PLAYER_PED_ID()) SET_STORED_PLAYER_PED_CUTSCENE_VARIATIONS(char_franklin, "franklin") SET_STORED_PLAYER_PED_CUTSCENE_VARIATIONS(char_trevor, "trevor") wait(0) endwhile load_scene(get_entity_coords(player_ped_id())) NEW_LOAD_SCENE_START(<<3818.6096, 4463.6060, 2.7104>>, CONVERT_ROTATION_TO_DIRECTION_VECTOR(<<0.0, 0.0, 269.9429>>), 100.0) while not IS_NEW_LOAD_SCENE_LOADED() wait(0) endwhile NEW_LOAD_SCENE_STOP() if is_vehicle_driveable(boat.veh) register_entity_for_cutscene(boat.veh, "fbi_5_michaels_boat", CU_ANIMATE_EXISTING_SCRIPT_ENTITY) endif REGISTER_ENTITY_FOR_CUTSCENE(NULL, "dave_fbi", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, dave.model) REGISTER_ENTITY_FOR_CUTSCENE(NULL, "steve_fbi", CU_CREATE_AND_ANIMATE_NEW_SCRIPT_ENTITY, steve.model) SET_SCRIPTS_SAFE_FOR_CUTSCENE(true) start_cutscene() while not is_cutscene_playing() wait(0) endwhile MISSION_FLOW_RELEASE_TRIGGER_SCENE_ASSETS(SP_MISSION_FBI_5) clear_area(<<3801.2, 4468.4, 5.8>>, 1000, true) repostion_players_last_vehicle(players_last_vehicle, <<3801.2, 4468.4, 5.8>>, <<50.00, 50.00, 50.00>>, <<3767.1614, 4472.0337, 6.4168>>, 283.2421) request_intro_fbi5_assets() opening_cutscene_status = 1 e_section_stage = section_stage_running e_mission_stage = STAGE_OPENING_CUTSCENE do_screen_fade_in(default_fade_time) endproc proc load_replay_skip_0() if replay_active start_replay_setup(v_boat_start_pos, 266.72, false) endif REQUEST_MODEL(boat.model) REQUEST_MODEL(dave.model) REQUEST_MODEL(steve.model) REQUEST_MODEL(model_michael) REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05_Chemical_Factory_01") REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05A_GRILL_CUTTING") REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\Underwater") if replay_active END_REPLAY_SETUP() endif while not HAS_MODEL_LOADED(boat.model) or not HAS_MODEL_LOADED(dave.model) or not has_model_loaded(steve.model) or not HAS_MODEL_LOADED(model_michael) or not REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05_Chemical_Factory_01") or not REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\FBI_05A_GRILL_CUTTING") or not REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\Underwater") wait(0) endwhile clear_ped_tasks_immediately(player_ped_id()) create_entities_for_start_of_mission() if not replay_active NEW_LOAD_SCENE_START(v_boat_start_pos, CONVERT_ROTATION_TO_DIRECTION_VECTOR(<<0.0, 0.0, 266.1028>>), 300) while not IS_NEW_LOAD_SCENE_LOADED() wait(0) endwhile NEW_LOAD_SCENE_STOP() endif //ensures the boat is on the water incase the water has not streamed in before the load area call. if is_vehicle_driveable(boat.veh) set_vehicle_on_ground_properly(boat.veh) endif START_AUDIO_SCENE("FBI_5_DINGHY_TO_DIVE_POINT") trigger_music_event("FBI5A_MISSION_START_ST") SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(0, "start of mission") //deactivates the enter boat anim systems michael_enter_boat_anim_system_status = 22 dave_enter_boat_anim_system_status = 22 steve_enter_boat_anim_system_status = 22 e_section_stage = SECTION_STAGE_RUNNING e_mission_stage = STAGE_GO_TO_PIPE end_cutscene(false, 0, 0, false) endproc proc load_replay_skip_1() int i = 0 DISABLE_TAXI_HAILING(true) set_max_wanted_level(0) set_create_random_cops(false) s_grill_parts[0].model = PROP_CHEM_GRILL s_grill_parts[1].model = PROP_CHEM_GRILL_BIT if replay_active start_replay_setup(<<3832.896484, 3665.741943, -23.5>>, 150.00, false) endif request_model(model_michael) request_model(dave.model) request_model(steve.model) REQUEST_MODEL(s_grill_parts[0].model) REQUEST_MODEL(s_grill_parts[1].model) request_model(flare[0].model) REQUEST_ANIM_DICT("swimming@scuba") REQUEST_PTFX_ASSET() REQUEST_WAYPOINT_RECORDING(str_waypoint_swim) REQUEST_WAYPOINT_RECORDING("fbi5_steve_swim_lab") REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\Underwater") PRELOAD_PED_COMP(player_ped_id(), comp_type_outfit, OUTFIT_P0_SCUBA_WATER) PRELOAD_PED_COMP(player_ped_id(), comp_type_special, SPECIAL_P0_SCUBA_ACCS_1) if replay_active END_REPLAY_SETUP() endif while not has_model_loaded(model_michael) or not has_model_loaded(dave.model) or not has_model_loaded(steve.model) or not has_model_loaded(s_grill_parts[0].model) or not has_model_loaded(s_grill_parts[1].model) or not has_model_loaded(flare[0].model) or not has_anim_dict_loaded("swimming@scuba") or not has_ptfx_asset_loaded() or not get_is_waypoint_recording_loaded(str_waypoint_swim) or not get_is_waypoint_recording_loaded("fbi5_steve_swim_lab") or not REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\Underwater") or not has_ped_preload_variation_data_finished(player_ped_id()) wait(0) endwhile clear_area(v_boat_start_pos, 10000, true) if get_cam_view_mode_for_context(cam_view_mode_context_on_foot) != cam_view_mode_first_person camera_a = create_cam_with_params("default_scripted_camera", <<3833.167969,3667.149658,-22.680361>>,<<-15.675879,3.090937,165.056198>>,45.012604) set_cam_active(camera_a, true) render_script_cams(true, false) wait(0) // forces_camera_to_update endif s_grill_parts[0].obj = CREATE_OBJECT_NO_OFFSET(s_grill_parts[0].model, v_grill_pos) SET_ENTITY_ROTATION(s_grill_parts[0].obj, v_grill_rot) SET_MODEL_AS_NO_LONGER_NEEDED(s_grill_parts[0].model) FREEZE_ENTITY_POSITION(s_grill_parts[0].obj, TRUE) s_grill_parts[1].obj = CREATE_OBJECT_NO_OFFSET(s_grill_parts[1].model, <<3831.37, 3663, -24.3083>>) SET_ENTITY_ROTATION(s_grill_parts[1].obj, <<86.173, -15.3571, 149.922>>) SET_MODEL_AS_NO_LONGER_NEEDED(s_grill_parts[1].model) for i = 0 to count_of(grill_0_ptfx) - 1 grill_0_ptfx[i] = START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_bio_grille_break", s_grill_parts[0].obj, grill_0_ptfx_offset[i], <<0.0, 90.0, 0.00>>) SET_PARTICLE_FX_LOOPED_EVOLUTION(grill_0_ptfx[i], "open", 1.0) endfor // for i = 0 to count_of(grill_0_ptfx) - 1 // grill_0_ptfx[i] = START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_bio_grille_break", s_grill_parts[0].obj, grill_0_ptfx_offset[i], <<0.0, 90.0, 0.00>>) // SET_PARTICLE_FX_LOOPED_EVOLUTION(grill_0_ptfx[i], "open", 1.0) // endfor //set_entity_coords(player_ped_id(), <<3832.896484, 3665.741943, -23.997499>>) set_entity_coords_no_offset(player_ped_id(), <<3832.896484, 3665.741943, -23.5>>) set_entity_heading(player_ped_id(), 150.00) set_current_selector_ped(selector_ped_michael, false) SET_PED_MAX_TIME_UNDERWATER(PLAYER_PED_ID(), 100000000.00) SET_PED_DIES_IN_WATER(PLAYER_PED_ID(), FALSE) SET_ENABLE_SCUBA(player_ped_id(), true) ADD_PED_FOR_DIALOGUE(scripted_speech, 0, player_ped_id(), "michael") SET_PED_COMP_ITEM_CURRENT_SP(player_ped_id(), comp_type_outfit, OUTFIT_P0_SCUBA_WATER, false) SET_PED_COMP_ITEM_CURRENT_SP(player_ped_id(), comp_type_special, SPECIAL_P0_SCUBA_ACCS_1, false) //SET_PED_PROP_INDEX(player_ped_id(), ANCHOR_EYES, 1, 0) set_current_ped_weapon(player_ped_id(), weapontype_unarmed, true) //force_ped_ai_and_animation_update(player_ped_id(), true) flare[0].obj = create_object(flare[0].model, get_offset_from_entity_in_world_coords(player_ped_id(), <<0.0, 0.0, 1.0>>)) attach_entity_to_entity(flare[0].obj, player_ped_id(), get_ped_bone_index(player_ped_id(), BONETAG_SPINE3), <<-0.060, -0.120, -0.165>>, <<0.0, 90.00, 345.00>>) flare_ptfx[0] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[0].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) //load_scene(get_entity_coords(player_ped_id())) open_sequence_task(seq) TASK_PLAY_ANIM(NULL, "swimming@scuba", "dive_run", instant_BLEND_IN, walk_BLEND_OUT, 1000, AF_LOOPING | AF_NOT_INTERRUPTABLE | AF_FORCE_START) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) //TASK_GO_STRAIGHT_TO_COORD(NULL, <<3826.8359, 3655.3850, -24.5750>>, PEDMOVE_RUN, -1) TASK_FOLLOW_WAYPOINT_RECORDING(null, str_waypoint_swim, 5, EWAYPOINT_USE_TIGHTER_TURN_SETTINGS, 20)//EWAYPOINT_default CLOSE_SEQUENCE_TASK(seq) TASK_PERFORM_SEQUENCE(PLAYER_PED_ID(), seq) CLEAR_SEQUENCE_TASK(seq) FORCE_PED_AI_AND_ANIMATION_UPDATE(PLAYER_PED_ID(), true) //b_allow_scuba_breath = TRUE dave.pos = <<3831.3, 3662.3, -22.75>> dave.heading = 147.00 setup_buddy(dave) dave.blip = create_blip_for_ped(dave.ped) set_entity_coords_no_offset(dave.ped, <<3828.9, 3659.2, -22.75>>) set_entity_heading(dave.ped, 147.00) SET_PED_MAX_TIME_UNDERWATER(dave.ped, 10000000.0) SET_PED_DIES_IN_WATER(dave.ped, FALSE) //GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) give_weapon_to_ped(dave.ped, weapontype_stungun, infinite_ammo, false) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAIR, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_FEET, 1, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL, 1, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_JBIB, 0, 0) set_entity_proofs(dave.ped, false, true, false, false, false, true, false, true) set_enable_scuba(dave.ped, true) ADD_PED_FOR_DIALOGUE(scripted_speech, 3, dave.ped, "dave") flare[2].obj = create_object(flare[2].model, get_offset_from_entity_in_world_coords(dave.ped, <<0.0, 0.0, 1.0>>)) attach_entity_to_entity(flare[2].obj, dave.ped, get_ped_bone_index(dave.ped, BONETAG_SPINE3), <<-0.060, -0.120, -0.165>>, <<0.0, 90.00, 345.00>>) flare_ptfx[2] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[2].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) int i_buddy_node WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT(str_waypoint_swim, GET_ENTITY_COORDS(dave.ped), i_buddy_node) i_buddy_node += 1 open_sequence_task(seq) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) TASK_FOLLOW_WAYPOINT_RECORDING(null, str_waypoint_swim, i_buddy_node, EWAYPOINT_START_FROM_CLOSEST_POINT | EWAYPOINT_DO_NOT_RESPOND_TO_COLLISION_EVENTS | EWAYPOINT_START_TASK_EXACTSTOP | EWAYPOINT_USE_TIGHTER_TURN_SETTINGS) close_sequence_task(seq) task_perform_sequence(dave.ped, seq) clear_sequence_task(seq) force_ped_ai_and_animation_update(dave.ped) steve.pos = <<3835.858643, 3673.410645, -21.817038>> steve.heading = 153.541626 setup_buddy(steve) steve.blip = create_blip_for_ped(steve.ped) // set_entity_coords_no_offset(steve.ped, <<3835.858643, 3673.410645, -21.817038>>) // set_entity_heading(steve.ped, 153.541626) set_entity_coords_no_offset(steve.ped, <<3831.3, 3662.3, -22.75>>) set_entity_heading(steve.ped, 147.00) ADD_PED_FOR_DIALOGUE(scripted_speech, 4, steve.ped, "steve") SET_PED_MAX_TIME_UNDERWATER(steve.ped, 10000000.0) SET_PED_DIES_IN_WATER(steve.ped, FALSE) //GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) give_weapon_to_ped(steve.ped, weapontype_stungun, infinite_ammo, false) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAIR, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_FEET, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_JBIB, 0, 0) SET_PED_PROP_INDEX(steve.ped, ANCHOR_EYES, 1) set_entity_proofs(steve.ped, false, true, false, false, false, true, false, true) set_enable_scuba(steve.ped, true) flare[3].obj = create_object(flare[3].model, get_offset_from_entity_in_world_coords(steve.ped, <<0.0, 0.0, 1.0>>)) attach_entity_to_entity(flare[3].obj, steve.ped, get_ped_bone_index(steve.ped, BONETAG_R_CLAVICLE), <<-0.060, -0.120, -0.165>>, <<0.0, 90.00, 345.00>>) flare_ptfx[3] = START_PARTICLE_FX_LOOPED_ON_entity("scr_bio_flare", flare[3].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) open_sequence_task(seq) TASK_FORCE_MOTION_STATE(null, enum_to_int(MS_diving_swim)) TASK_FOLLOW_WAYPOINT_RECORDING(null, str_waypoint_swim, 0, EWAYPOINT_START_FROM_CLOSEST_POINT | EWAYPOINT_DO_NOT_RESPOND_TO_COLLISION_EVENTS | EWAYPOINT_START_TASK_EXACTSTOP | EWAYPOINT_USE_TIGHTER_TURN_SETTINGS) close_sequence_task(seq) task_perform_sequence(steve.ped, seq) clear_sequence_task(seq) force_ped_ai_and_animation_update(steve.ped) fxBubbles = START_PARTICLE_FX_LOOPED_AT_COORD("scr_tunnel_vent_bubbles", << 3790.8879, 3658.5581, -19.0412 >>,<<0.0, 0.0, 0.0>>, 1.0) blip_current_destination = ADD_BLIP_FOR_COORD(v_pipe_end_pos) original_time = get_game_timer() if not replay_active load_scene(get_entity_coords(player_ped_id())) endif trigger_music_event("FBI5A_CUT_PIPE_RESTART") do_screen_fade_in(1000) if get_cam_view_mode_for_context(cam_view_mode_context_on_foot) != cam_view_mode_first_person end_cutscene_no_fade(false, true, true, 0, 0, 2000, false) else end_cutscene_no_fade(false, true, false, 0, 0, 2000, false) endif e_mission_stage = STAGE_SWIM_INTO_LAB e_section_stage = SECTION_STAGE_SETUP SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(1, "swim through tunnel") endproc proc load_replay_skip_2() DISABLE_TAXI_HAILING(true) //FORCE_RETICLE_MODE(hud_reticle_can_be_stunned) set_max_wanted_level(0) set_create_random_cops(false) if replay_active start_replay_setup(<<3526.2493, 3711.0015, 19.9928>>, 172.30, false) endif request_model(model_michael) request_model(dave.model) request_model(steve.model) REQUEST_MODEL(scientist[0].model) REQUEST_MODEL(security_guard[0].model) request_model(security_card.model) request_model(elevator_display[0].model) request_model(elevator_display[1].model) request_model(elevator_display[2].model) //scuba props request_model(steves_mask.model) request_model(scuba_mike.model) request_model(scuba_dave.model) request_model(OxyTank_1.model) request_model(OxyTank_2.model) request_model(OxyTank_3.model) request_model(scuba_steve.model) request_model(swag_bag.model) request_model(get_weapontype_model(weapontype_carbinerifle)) request_weapon_asset(WEAPONTYPE_CARBINERIFLE) request_model(get_weapontype_model(WEAPONTYPE_STUNGUN)) request_weapon_asset(WEAPONTYPE_STUNGUN) request_anim_dict("missfbi5ig_2") REQUEST_ACTION_MODE_ASSET("MICHAEL_ACTION") request_action_mode_asset("MP_FEMALE_ACTION") prepare_alarm("FIB_05_BIOTECH_LAB_ALARMS") REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\LIFTS") SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_HEAD, 0, 0) SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_TORSO, 4, 0) SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_LEG, 4, 0) SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_FEET, 4, 0) SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_SPECIAL, 4, 0) SET_PED_PRELOAD_VARIATION_DATA(player_ped_id(), PED_COMP_DECL, 0, 0) interior_lab = GET_INTERIOR_AT_COORDS(v_pipe_end_pos) PIN_INTERIOR_IN_MEMORY(interior_lab) REQUEST_PTFX_ASSET() if replay_active END_REPLAY_SETUP() endif while not HAS_MODEL_LOADED(model_michael) or not HAS_MODEL_LOADED(dave.model) or not HAS_MODEL_LOADED(steve.model) or not HAS_MODEL_LOADED(scientist[0].model) or not HAS_MODEL_LOADED(security_guard[0].model) or not has_model_loaded(security_card.model) or not has_model_loaded(elevator_display[0].model) or not has_model_loaded(elevator_display[1].model) or not has_model_loaded(elevator_display[2].model) or not has_model_loaded(steves_mask.model) or not has_model_loaded(scuba_mike.model) or not has_model_loaded(scuba_dave.model) or not has_model_loaded(OxyTank_1.model) or not has_model_loaded(OxyTank_2.model) or not has_model_loaded(OxyTank_3.model) or not has_model_loaded(scuba_steve.model) or not has_model_loaded(swag_bag.model) or not has_model_loaded(get_weapontype_model(weapontype_carbinerifle)) or not has_weapon_asset_loaded(weapontype_carbinerifle) or not has_model_loaded(get_weapontype_model(WEAPONTYPE_STUNGUN)) or not has_weapon_asset_loaded(WEAPONTYPE_STUNGUN) or not has_anim_dict_loaded("missfbi5ig_2") or not HAS_ACTION_MODE_ASSET_LOADED("MICHAEL_ACTION") or not HAS_ACTION_MODE_ASSET_LOADED("MP_FEMALE_ACTION") or not prepare_alarm("FIB_05_BIOTECH_LAB_ALARMS") or not REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\\LIFTS") or not has_ped_preload_variation_data_finished(player_ped_id()) or not IS_INTERIOR_READY(interior_lab) wait(0) endwhile clear_area(<<3526.2493, 3711.0015, 19.9928>>, 10000, true) REMOVE_DECALS_IN_RANGE(<<3526.2493, 3711.0015, 19.9928>>, 1000.00) if not (get_current_player_ped_enum() = char_michael) set_current_selector_ped(selector_ped_michael, false) endif SET_ENTITY_COORDS(PLAYER_PED_ID(), <<3526.2493, 3711.0015, 19.9928>>) SET_ENTITY_HEADING(PLAYER_PED_ID(), 172.3092) SET_PED_COMP_ITEM_CURRENT_SP(player_ped_id(), comp_type_outfit, OUTFIT_P0_SCUBA_LAND, false) SET_PED_MAX_TIME_UNDERWATER(PLAYER_PED_ID(), -1.0) FORCE_ROOM_FOR_ENTITY(PLAYER_PED_ID(), GET_INTERIOR_AT_COORDS_with_type(<<3526.2493, 3711.0015, 21.0>>, "v_lab"), get_hash_key("Lab_poolroom")) FORCE_ROOM_FOR_GAME_VIEWPORT(GET_INTERIOR_AT_COORDS_with_type(<<3526.2493, 3711.0015, 21.00>>, "v_lab"), get_hash_key("Lab_poolroom")) GIVE_WEAPON_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_CARBINERIFLE, 400) //GIVE_WEAPON_COMPONENT_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) give_weapon_to_ped(PLAYER_PED_ID(), WEAPONTYPE_GRENADE, 2) GIVE_WEAPON_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_STUNGUN , 50, true) ADD_PED_FOR_DIALOGUE(scripted_speech, 0, player_ped_id(), "michael") set_entity_proofs(player_ped_id(), false, false, false, false, false, false, false, true) SET_PED_USING_ACTION_MODE(player_ped_id(), true) SET_PED_USING_ACTION_MODE(player_ped_id(), true, -1, "MP_FEMALE_ACTION") //SET_WEAPON_ANIMATION_OVERRIDE(PLAYER_PED_ID(), hash("MP_F_Freemode")) //can't force motion state whilst in first person mode or it will assert. if get_cam_view_mode_for_context(cam_view_mode_context_on_foot) != cam_view_mode_first_person force_ped_motion_state(player_ped_id(), MS_ACTIONMODE_idle) endif force_ped_ai_and_animation_update(player_ped_id()) setup_buddy(dave) dave.blip = create_blip_for_ped(dave.ped) SET_PED_MAX_TIME_UNDERWATER(dave.ped, -1.0) SET_PED_DIES_IN_WATER(dave.ped, TRUE) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_FEET, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_JBIB, 3, 0)//0 SET_PED_PROP_INDEX(dave.ped, ANCHOR_EYES, 2, 0) give_weapon_to_ped(dave.ped, weapontype_stungun, infinite_ammo, false) //GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) set_current_ped_weapon(dave.ped, dave.weapon, true) set_ped_accuracy(dave.ped, 100) SET_FORCE_FOOTSTEP_UPDATE(dave.ped, true) set_entity_proofs(dave.ped, false, true, false, false, false, true, false, true)//bug 1483811 ADD_PED_FOR_DIALOGUE(scripted_speech, 3, dave.ped, "dave") dave_ai_system() // scene_pos = << 3538.970, 3673.487, 19.992 >> // scene_rot = << 0.000, 0.000, -9.400 >> steve.pos = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_2", "holdup_scient_steve", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>) steve.rot = GET_ANIM_INITIAL_OFFSET_rotation("missfbi5ig_2", "holdup_scient_steve", <<3538.970, 3673.487, 19.992>>, <<0.0, 0.0, -9.4>>) steve.pos.z = 19.9928 steve.heading = -110.00 //steve.rot.z//259.2684//-110.00 printstring("steve.pos = ") printvector(steve.pos) printnl() printstring("steve.rot.z = ") // -49.379578 = 310 printfloat(steve.rot.z) printnl() setup_buddy(steve) steve.blip = create_blip_for_ped(steve.ped) SET_PED_MAX_TIME_UNDERWATER(steve.ped, -1.0) SET_PED_DIES_IN_WATER(steve.ped, TRUE) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_FEET, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_JBIB, 0, 0) SET_PED_PROP_INDEX(steve.ped, ANCHOR_EYES, 2) //SET_PED_COMBAT_ATTRIBUTES(steve.ped, CA_PLAY_REACTION_ANIMS, FALSE) give_weapon_to_ped(steve.ped, weapontype_stungun, infinite_ammo, false) //GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) set_current_ped_weapon(steve.ped, steve.weapon, true) set_ped_accuracy(steve.ped, 100) SET_FORCE_FOOTSTEP_UPDATE(steve.ped, true) set_entity_proofs(steve.ped, false, true, false, false, false, true, false, true) ADD_PED_FOR_DIALOGUE(scripted_speech, 4, steve.ped, "steve") steve_ai_system() setup_enemy(scientist[0], true) remove_blip(scientist[0].blip) //SET_RAGDOLL_BLOCKING_FLAGS(scientist[0].ped, RBF_VEHICLE_IMPACT | RBF_FIRE | RBF_PLAYER_IMPACT | RBF_EXPLOSION) SET_PED_MONEY(scientist[0].ped, 0) set_ped_component_variation(scientist[0].ped, ped_comp_special, 1, 0) add_ped_for_dialogue(scripted_speech, 5, scientist[0].ped, "scientist0") steves_mask.obj = create_object_no_offset(steves_mask.model, steves_mask.pos) set_entity_rotation(steves_mask.obj, steves_mask.rot) scuba_mike.obj = create_object_no_offset(scuba_mike.model, scuba_mike.pos) set_entity_rotation(scuba_mike.obj, scuba_mike.rot) scuba_dave.obj = create_object_no_offset(scuba_dave.model, scuba_dave.pos) set_entity_rotation(scuba_dave.obj, scuba_dave.rot) OxyTank_1.obj = create_object_no_offset(OxyTank_1.model, OxyTank_1.pos) set_entity_rotation(OxyTank_1.obj, OxyTank_1.rot) OxyTank_2.obj = create_object_no_offset(OxyTank_2.model, OxyTank_2.pos) set_entity_rotation(OxyTank_2.obj, OxyTank_2.rot) OxyTank_3.obj = create_object_no_offset(OxyTank_3.model, OxyTank_3.pos) set_entity_rotation(OxyTank_3.obj, OxyTank_3.rot) scuba_steve.obj = create_object_no_offset(scuba_steve.model, scuba_steve.pos) set_entity_rotation(scuba_steve.obj, scuba_steve.rot) swag_bag.obj = create_object_no_offset(swag_bag.model, swag_bag.pos) set_entity_rotation(swag_bag.obj, swag_bag.rot) if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("OxyTank_1", OxyTank_1.model) set_entity_coords_no_offset(OxyTank_1.obj, OxyTank_1.pos) set_entity_rotation(OxyTank_1.obj, OxyTank_1.rot) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("OxyTank_2", OxyTank_2.model) set_entity_coords_no_offset(OxyTank_2.obj, OxyTank_2.pos) set_entity_rotation(OxyTank_2.obj, OxyTank_2.rot) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("OxyTank_3", OxyTank_3.model) set_entity_coords_no_offset(OxyTank_3.obj, OxyTank_3.pos) set_entity_rotation(OxyTank_3.obj, OxyTank_3.rot) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("scuba_steve", scuba_steve.model) set_entity_coords_no_offset(scuba_steve.obj, scuba_steve.pos) set_entity_rotation(scuba_steve.obj, scuba_steve.rot) ENDIF if CAN_SET_EXIT_STATE_FOR_REGISTERED_ENTITY("swag_bag", swag_bag.model) set_entity_coords_no_offset(swag_bag.obj, swag_bag.pos) set_entity_rotation(swag_bag.obj, swag_bag.rot) ENDIF if not replay_active NEW_LOAD_SCENE_START(<<3526.2493, 3711.0015, 19.9928>>, CONVERT_ROTATION_TO_DIRECTION_VECTOR(<<0.0, 0.0, 172.3092>>), 10.0) while not IS_NEW_LOAD_SCENE_LOADED() wait(0) endwhile NEW_LOAD_SCENE_STOP() endif while not HAVE_ALL_STREAMING_REQUESTS_COMPLETED_FOR_PED(player_ped_id()) or not HAVE_ALL_STREAMING_REQUESTS_COMPLETED_FOR_PED(dave.ped) or not HAVE_ALL_STREAMING_REQUESTS_COMPLETED_FOR_PED(steve.ped) wait(0) endwhile RELEASE_PED_PRELOAD_VARIATION_DATA(player_ped_id()) if not is_ped_injured(dave.ped) RELEASE_PED_PRELOAD_VARIATION_DATA(dave.ped) endif if not is_ped_injured(steve.ped) RELEASE_PED_PRELOAD_VARIATION_DATA(steve.ped) endif trigger_music_event("FBI5A_LIFT_RESTART") start_audio_scene("FBI_5_GET_TO_LIFT") SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(2, "get to lift") clear_area(<<3526.2493, 3711.0015, 19.9928>>, 10000, true) end_cutscene(false, 0, 0, false) e_section_stage = SECTION_STAGE_running e_mission_stage = stage_get_to_lift endproc proc load_replay_skip_3() DISABLE_TAXI_HAILING(true) //FORCE_RETICLE_MODE(hud_reticle_can_be_stunned) set_max_wanted_level(0) set_create_random_cops(false) if replay_active start_replay_setup(<<3560.2490, 3671.9307, 27.1219>>, 338.4696, false) endif request_model(model_michael) request_model(dave.model) request_model(steve.model) request_model(scientist[0].model) request_model(monkey[0].model) request_model(chemicals.model) request_model(fridge_pallet.model) REQUEST_MODEL(fridge.model) request_model(container_light.model) request_model(crate.model) request_model(security_guard[0].model) request_model(PROP_BOXPILE_02B) request_vehicle_recording(army_truck[0].recording_number, "lkfbi5a") request_anim_dict("missfbi5ig_21") request_anim_dict("missfbi5ig_22") request_anim_dict("missfbi5ig_23") prepare_alarm("FIB_05_BIOTECH_LAB_ALARMS") interior_lab = GET_INTERIOR_AT_COORDS(<<3558.898, 3677.850, 27.125>>) PIN_INTERIOR_IN_MEMORY(interior_lab) request_model(get_weapontype_model(weapontype_carbinerifle)) request_weapon_asset(WEAPONTYPE_CARBINERIFLE) request_model(get_weapontype_model(WEAPONTYPE_STUNGUN)) request_weapon_asset(WEAPONTYPE_STUNGUN) REQUEST_PTFX_ASSET() if replay_active END_REPLAY_SETUP() endif while not HAS_MODEL_LOADED(model_michael) or not HAS_MODEL_LOADED(dave.model) or not HAS_MODEL_LOADED(steve.model) or not has_model_loaded(scientist[0].model) or not has_model_loaded(monkey[0].model) or not has_model_loaded(chemicals.model) or not has_model_loaded(fridge_pallet.model) or not HAS_MODEL_LOADED(fridge.model) or not has_model_loaded(container_light.model) or not has_model_loaded(crate.model) or not has_model_loaded(security_guard[0].model) or not has_model_loaded(PROP_BOXPILE_02B) or not has_vehicle_recording_been_loaded(army_truck[0].recording_number, "lkfbi5a") or not has_anim_dict_loaded("missfbi5ig_21") or not has_anim_dict_loaded("missfbi5ig_22") or not has_anim_dict_loaded("missfbi5ig_23") or not prepare_alarm("FIB_05_BIOTECH_LAB_ALARMS") or not IS_INTERIOR_READY(interior_lab) or not has_model_loaded(get_weapontype_model(weapontype_carbinerifle)) or not has_weapon_asset_loaded(weapontype_carbinerifle) or not has_model_loaded(get_weapontype_model(WEAPONTYPE_STUNGUN)) or not has_weapon_asset_loaded(WEAPONTYPE_STUNGUN) or not has_ptfx_asset_loaded() wait(0) endwhile clear_area(<<3551.580, 3658.520, 27.125>>, 1000, true) if not (get_current_player_ped_enum() = char_michael) set_current_selector_ped(selector_ped_michael, false) endif vector player_pos vector player_rot player_pos = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_22", "take_chemical_player0", << 3558.898, 3677.850, 27.125 >>, << 0.000, 0.000, 170.00 >>, 1.0) player_pos.z = 27.1217 player_rot = GET_ANIM_INITIAL_OFFSET_rotation("missfbi5ig_22", "take_chemical_player0", << 3558.898, 3677.850, 27.125 >>, << 0.000, 0.000, 170.00 >>, 1.0) clear_ped_tasks_immediately(player_ped_id()) set_entity_coords(player_ped_id(), player_pos) set_entity_heading(player_ped_id(), player_rot.z) //ped_comp_type_enum SET_PED_COMP_ITEM_CURRENT_SP(player_ped_id(), comp_type_outfit, OUTFIT_P0_SCUBA_LAND, false) //SET_PED_PROP_INDEX(PLAYER_PED_ID(), ANCHOR_EYES, 2, 0) SET_PED_MAX_TIME_UNDERWATER(PLAYER_PED_ID(), -1.0) SET_PED_USING_ACTION_MODE(player_ped_id(), true) ADD_PED_FOR_DIALOGUE(scripted_speech, 0, player_ped_id(), "michael") set_entity_proofs(player_ped_id(), false, false, false, false, false, false, false, true) GIVE_WEAPON_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_CARBINERIFLE, 400) //GIVE_WEAPON_COMPONENT_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) give_weapon_to_ped(PLAYER_PED_ID(), WEAPONTYPE_GRENADE, 2) GIVE_WEAPON_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_STUNGUN , 50, true) scene_pos = <<3559.398, 3676.750, 27.125>> scene_rot = <<0.000, 0.000, 174.000>> scientist[4].pos = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_21", "hand_up_scientist", scene_pos, scene_rot, 1.0) scientist[4].rot = GET_ANIM_INITIAL_OFFSET_rotation("missfbi5ig_21", "hand_up_scientist", scene_pos, scene_rot, 1.0) if fbi5a_scientist_4_alive setup_enemy(scientist[4]) SET_RAGDOLL_BLOCKING_FLAGS(scientist[4].ped, RBF_BULLET_IMPACT | RBF_VEHICLE_IMPACT | RBF_FIRE | RBF_PLAYER_IMPACT | RBF_EXPLOSION) SET_PED_MONEY(scientist[4].ped, 0) add_ped_for_dialogue(scripted_speech, ConvertSingleCharacter("B"), scientist[4].ped, "scientist5") scientist[4].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) //TASK_SYNCHRONIZED_SCENE(scientist[4].ped, scientist[4].scene_id, "missfbi5ig_21", "hand_up_scientist", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, NORMAL_BLEND_IN) TASK_SYNCHRONIZED_SCENE(scientist[4].ped, scientist[4].scene_id, "missfbi5ig_22", "hands_up_anxious_scientist", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, NORMAL_BLEND_IN) // hands_up_anxious_scientist set_synchronized_scene_looped(scientist[4].scene_id, true) scientist_4_ai_system_status = 7 endif if fbi5a_scientist_5_alive scientist[5].pos = <<3553.6331, 3672.7102, 27.1219>> setup_enemy(scientist[5]) SET_RAGDOLL_BLOCKING_FLAGS(scientist[5].ped, RBF_VEHICLE_IMPACT | RBF_FIRE | RBF_PLAYER_IMPACT | RBF_EXPLOSION) //RBF_BULLET_IMPACT | SET_PED_MONEY(scientist[5].ped, 0) set_ped_component_variation(scientist[5].ped, ped_comp_special, 1, 0) add_ped_for_dialogue(scripted_speech, 8, scientist[5].ped, "scientist3") scene_pos = <<3558.898, 3677.850, 27.125>> scene_rot = <<0.0, 0.0, 170.00>> scientist[5].scene_id = CREATE_SYNCHRONIZED_SCENE(scene_pos, scene_rot) TASK_SYNCHRONIZED_SCENE(scientist[5].ped, scientist[5].scene_id, "missfbi5ig_21", "hand_up_scientist", instant_BLEND_IN, normal_BLEND_OUT, SYNCED_SCENE_USE_PHYSICS, RBF_NONE, NORMAL_BLEND_IN) set_synchronized_scene_looped(scientist[5].scene_id, true) scientist_5_ai_system_status = 3 endif dave.pos = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_23", "run_through_door_dave", << 3558.898, 3677.850, 27.125 >>, << 0.000, 0.000, 170.00 >>) dave.pos.z = 27.1217 dave.heading = 86.1642 setup_buddy(dave) dave.blip = create_blip_for_ped(dave.ped) setup_relationship_contact(dave.ped, true) set_ped_can_ragdoll(dave.ped, false) SET_PED_MAX_TIME_UNDERWATER(dave.ped, -1.0) SET_PED_DIES_IN_WATER(dave.ped, TRUE) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_FEET, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_JBIB, 3, 0) SET_PED_PROP_INDEX(dave.ped, ANCHOR_EYES, 2, 0) //GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) set_current_ped_weapon(dave.ped, dave.weapon, true) set_ped_accuracy(dave.ped, 100) SET_FORCE_FOOTSTEP_UPDATE(dave.ped, true) set_entity_proofs(dave.ped, false, true, false, false, false, true, false, true) ADD_PED_FOR_DIALOGUE(scripted_speech, 3, dave.ped, "dave") if not is_ped_injured(scientist[4].ped) task_aim_gun_at_entity(dave.ped, scientist[4].ped, -1, true) elif not is_ped_injured(scientist[5].ped) task_aim_gun_at_entity(dave.ped, scientist[5].ped, -1, true) else task_aim_gun_at_coord(dave.ped, <<3553.9, 3668.7, 28.8>>, -1, true) endif force_ped_ai_and_animation_update(dave.ped) steve.pos = GET_ANIM_INITIAL_OFFSET_POSITION("missfbi5ig_23", "run_through_door_steve", << 3558.898, 3677.850, 27.125 >>, << 0.000, 0.000, 170.00 >>) steve.pos.z = 27.1217 steve.heading = 86.1642 setup_buddy(steve) steve.blip = create_blip_for_ped(steve.ped) set_ped_can_ragdoll(steve.ped, false) SET_PED_MAX_TIME_UNDERWATER(steve.ped, -1.0) SET_PED_DIES_IN_WATER(steve.ped, TRUE) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_FEET, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_JBIB, 0, 0) SET_PED_PROP_INDEX(steve.ped, ANCHOR_EYES, 2) //SET_PED_COMBAT_ATTRIBUTES(steve.ped, CA_PLAY_REACTION_ANIMS, FALSE) //GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) set_current_ped_weapon(steve.ped, steve.weapon, true) set_ped_accuracy(steve.ped, 100) SET_FORCE_FOOTSTEP_UPDATE(steve.ped, true) set_entity_proofs(steve.ped, false, true, false, false, false, true, false, true) ADD_PED_FOR_DIALOGUE(scripted_speech, 4, steve.ped, "steve") if not is_ped_injured(scientist[5].ped) task_aim_gun_at_entity(steve.ped, scientist[5].ped, -1, true) elif not is_ped_injured(scientist[4].ped) task_aim_gun_at_entity(steve.ped, scientist[4].ped, -1, true) else task_aim_gun_at_coord(steve.ped, <<3553.9, 3668.7, 28.8>>, -1, true) endif set_blocking_of_non_temporary_events(steve.ped, true) force_ped_ai_and_animation_update(steve.ped) chemicals.obj = CREATE_OBJECT(chemicals.model, chemicals.pos) freeze_entity_position(chemicals.obj, true) SET_ENTITY_HEADING(chemicals.obj, chemicals.heading) SET_MODEL_AS_NO_LONGER_NEEDED(chemicals.model) crate.obj = CREATE_OBJECT_no_offset(crate.model, crate.pos) SET_ENTITY_HEADING(crate.obj, crate.heading) freeze_entity_position(crate.obj, true) SET_OBJECT_TAKES_DAMAGE_FROM_COLLIDING_WITH_BUILDINGS(crate.obj) SET_ENTITY_PROOFS(crate.obj, TRUE, TRUE, TRUE, TRUE, TRUE) fridge_pallet.obj = CREATE_OBJECT_no_offset(fridge_pallet.model, fridge_pallet.pos) SET_ENTITY_HEADING(fridge_pallet.obj, fridge_pallet.heading) sET_ENTITY_PROOFS(fridge_pallet.obj, TRUE, TRUE, TRUE, TRUE, TRUE) fridge.obj = CREATE_OBJECT_no_offset(fridge.model, fridge.pos) SET_ENTITY_HEADING(fridge.obj, fridge.heading) //sET_ENTITY_PROOFS(fridge.obj, TRUE, TRUE, TRUE, TRUE, TRUE) attach_entity_to_entity(fridge.obj, fridge_pallet.obj, 0, <<0.0, 0.0, 0.860>>, <<0.0, 0.0, 180.0>>, false, false, true) attach_entity_to_entity(fridge_pallet.obj, crate.obj, 0, <<0.0, 0.0, -1.210>>, <<0.0, 0.0, 0.0>>) container_light.obj = CREATE_OBJECT_no_offset(container_light.model, container_light.pos) SET_ENTITY_HEADING(container_light.obj, container_light.heading) sET_ENTITY_PROOFS(container_light.obj, TRUE, TRUE, TRUE, TRUE, TRUE) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[13], 1.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[13], DOORSTATE_force_locked_this_frame, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[14], -1.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[14], DOORSTATE_force_locked_this_frame, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[15], 1.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[15], DOORSTATE_force_locked_this_frame, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[16], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[16], DOORSTATE_force_locked_this_frame, false, true) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[17], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[17], DOORSTATE_force_locked_this_frame, false, true) add_ped_for_dialogue(scripted_speech, ConvertSingleCharacter("E"), null, "SECURITYTANNOY") if not replay_active NEW_LOAD_SCENE_START(player_pos, CONVERT_ROTATION_TO_DIRECTION_VECTOR(<<0.0, 0.0, player_rot.z>>), 10.0) while not IS_NEW_LOAD_SCENE_LOADED() wait(0) endwhile NEW_LOAD_SCENE_STOP() endif //move_door(V_ILev_Bl_DoorSL_R, <<3557.6, 3669.2, 27.1>>) SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(3, "start of shootout") trigger_music_event("FBI5A_FIGHT_RESTART") start_audio_scene("FBI_5_GET_TO_NERVE_TOXIN") end_cutscene(false, 0, 0, false) e_section_stage = SECTION_STAGE_RUNNING e_mission_stage = STAGE_shootout endproc proc load_replay_skip_4() DISABLE_TAXI_HAILING(true) set_max_wanted_level(0) set_create_random_cops(false) if replay_active start_replay_setup(<<3623.5701, 3753.4863, 27.5156>>, 318.49, false) endif request_model(model_michael) request_model(dave.model) request_model(steve.model) request_model(fridge_pallet.model) REQUEST_MODEL(fridge.model) request_model(container_light.model) request_model(crate.model) request_model(container_light.model) request_model(nerve_agent.model) request_model(nerve_agent_store.model) REQUEST_MODEL(chemicals.model) request_model(army_truck[0].model) request_model(PROP_BOXPILE_02B) request_model(get_weapontype_model(weapontype_carbinerifle)) request_weapon_asset(WEAPONTYPE_CARBINERIFLE) request_model(get_weapontype_model(WEAPONTYPE_STUNGUN)) request_weapon_asset(WEAPONTYPE_STUNGUN) request_vehicle_recording(army_truck[0].recording_number, "lkfbi5a") request_anim_dict("missfbi5ig_33") prepare_alarm("FIB_05_BIOTECH_LAB_ALARMS") interior_lab = GET_INTERIOR_AT_COORDS(v_pipe_end_pos) PIN_INTERIOR_IN_MEMORY(interior_lab) REQUEST_PTFX_ASSET() if replay_active END_REPLAY_SETUP() endif //set_entity_coords(player_ped_id(), <<3624.0544, 3755.5129, 27.5157>>) //fix for pinning the interior as is you are too far away it won't pin in. while not HAS_MODEL_LOADED(model_michael) or not HAS_MODEL_LOADED(dave.model) or not HAS_MODEL_LOADED(steve.model) or not has_model_loaded(fridge_pallet.model) or not HAS_MODEL_LOADED(fridge.model) or not has_model_loaded(container_light.model) or not has_model_loaded(crate.model) or not has_model_loaded(nerve_agent.model) or not has_model_loaded(nerve_agent_store.model) or not HAS_MODEL_LOADED(chemicals.model) or not has_model_loaded(army_truck[0].model) or not has_model_loaded(PROP_BOXPILE_02B) or not has_model_loaded(container_light.model) or not has_model_loaded(get_weapontype_model(weapontype_carbinerifle)) or not has_weapon_asset_loaded(weapontype_carbinerifle) or not has_model_loaded(get_weapontype_model(WEAPONTYPE_STUNGUN)) or not has_weapon_asset_loaded(WEAPONTYPE_STUNGUN) or not has_vehicle_recording_been_loaded(army_truck[0].recording_number, "lkfbi5a") or not has_anim_dict_loaded("missfbi5ig_33") or not prepare_alarm("FIB_05_BIOTECH_LAB_ALARMS") or not IS_INTERIOR_READY(interior_lab) or not has_PTFX_ASSET_loaded() wait(0) printstring("laoding load_replay_skip_4") printnl() endwhile clear_area(<<3613.4080, 3739.4495, 27.6921>>, 10000, true) REMOVE_DECALS_IN_RANGE(<<3526.2493, 3711.0015, 19.9928>>, 1000.00) if not (get_current_player_ped_enum() = char_michael) set_current_selector_ped(selector_ped_michael, false) endif SET_ENTITY_COORDS(PLAYER_PED_ID(), <<3623.5701, 3753.4863, 27.5156>>) SET_ENTITY_HEADING(PLAYER_PED_ID(), 318.4949) SET_PED_COMP_ITEM_CURRENT_SP(player_ped_id(), comp_type_outfit, OUTFIT_P0_SCUBA_LAND, false) //SET_PED_PROP_INDEX(PLAYER_PED_ID(), ANCHOR_EYES, 2, 0) SET_PED_MAX_TIME_UNDERWATER(PLAYER_PED_ID(), -1.0) ADD_PED_FOR_DIALOGUE(scripted_speech, 0, player_ped_id(), "michael") SET_PED_USING_ACTION_MODE(player_ped_id(), true) GIVE_WEAPON_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_CARBINERIFLE, 400) //GIVE_WEAPON_COMPONENT_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) give_weapon_to_ped(PLAYER_PED_ID(), WEAPONTYPE_GRENADE, 2) GIVE_WEAPON_TO_PED(PLAYER_PED_ID(), WEAPONTYPE_STUNGUN , 50, true) set_entity_proofs(player_ped_id(), false, false, false, false, false, false, false, true) dave.pos = <<3626.2354, 3762.1626, 27.5157>> dave.heading = 90.9578 dave_ai_system_2_status = 22 setup_buddy(dave) dave.blip = create_blip_for_ped(dave.ped) set_ped_can_ragdoll(dave.ped, false) SET_PED_MAX_TIME_UNDERWATER(dave.ped, -1.0) SET_PED_DIES_IN_WATER(dave.ped, TRUE) set_entity_proofs(dave.ped, false, true, false, false, false, true, false, true) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_FEET, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_JBIB, 3, 0) SET_PED_PROP_INDEX(dave.ped, ANCHOR_EYES, 2, 0) give_weapon_to_ped(dave.ped, weapontype_stungun, infinite_ammo, false) //GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) set_current_ped_weapon(dave.ped, dave.weapon, true) ADD_PED_FOR_DIALOGUE(scripted_speech, 3, dave.ped, "dave") dave_ai_system_2() force_ped_motion_state(dave.ped, ms_aiming) force_ped_ai_and_animation_update(dave.ped) steve.pos = <<3619.3105, 3734.5251, 27.6895>> steve.heading = 323.7317 steve_ai_system_2_status = 21 setup_buddy(steve) steve.blip = create_blip_for_ped(steve.ped) set_ped_can_ragdoll(steve.ped, false) SET_PED_MAX_TIME_UNDERWATER(steve.ped, -1.0) SET_PED_DIES_IN_WATER(steve.ped, TRUE) set_entity_proofs(steve.ped, false, true, false, false, false, true, false, true) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_FEET, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_JBIB, 0, 0) SET_PED_PROP_INDEX(steve.ped, ANCHOR_EYES, 2) //SET_PED_COMBAT_ATTRIBUTES(steve.ped, CA_PLAY_REACTION_ANIMS, FALSE) give_weapon_to_ped(steve.ped, weapontype_stungun, infinite_ammo, false) //GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) set_current_ped_weapon(steve.ped, steve.weapon, true) ADD_PED_FOR_DIALOGUE(scripted_speech, 4, steve.ped, "steve") steve_ai_system_2() force_ped_motion_state(steve.ped, ms_aiming) force_ped_ai_and_animation_update(steve.ped) crate.obj = CREATE_OBJECT_no_offset(crate.model, crate.pos) //-10.00 SET_ENTITY_HEADING(crate.obj, crate.heading) freeze_entity_position(crate.obj, true) SET_OBJECT_TAKES_DAMAGE_FROM_COLLIDING_WITH_BUILDINGS(crate.obj) SET_ENTITY_PROOFS(crate.obj, TRUE, TRUE, TRUE, TRUE, TRUE) fridge_pallet.obj = CREATE_OBJECT_no_offset(fridge_pallet.model, fridge_pallet.pos) SET_ENTITY_HEADING(fridge_pallet.obj, fridge_pallet.heading) sET_ENTITY_PROOFS(fridge_pallet.obj, TRUE, TRUE, TRUE, TRUE, TRUE) fridge.obj = CREATE_OBJECT_no_offset(fridge.model, fridge.pos) SET_ENTITY_HEADING(fridge.obj, fridge.heading) //sET_ENTITY_PROOFS(fridge.obj, TRUE, TRUE, TRUE, TRUE, TRUE) attach_entity_to_entity(fridge.obj, fridge_pallet.obj, 0, <<0.0, 0.0, 0.860>>, <<0.0, 0.0, 180.00>>, false, false, true) attach_entity_to_entity(fridge_pallet.obj, crate.obj, 0, <<0.0, 0.0, -1.210>>, <<0.0, 0.0, 0.0>>) container_light.obj = CREATE_OBJECT_no_offset(container_light.model, container_light.pos) SET_ENTITY_HEADING(container_light.obj, container_light.heading) sET_ENTITY_PROOFS(container_light.obj, TRUE, TRUE, TRUE, TRUE, TRUE) obj_loading_boxes[1] = CREATE_OBJECT(PROP_BOXPILE_02B, <<3623.3342, 3738.3862, 27.6897>>) SET_ENTITY_HEADING(obj_loading_boxes[1], 150.2056) army_truck[0].veh = create_vehicle(army_truck[0].model, <<3635.9517, 3754.5137, 27.5157>>, 149.2777) set_vehicle_doors_locked(army_truck[0].veh, vehiclelock_lockout_player_only) SET_VEHICLE_IS_CONSIDERED_BY_PLAYER(army_truck[0].veh, false) SET_VEHICLE_RADIO_ENABLED(army_truck[0].veh, false) set_vehicle_engine_on(army_truck[0].veh, false, true) //start_playback_recorded_vehicle(army_truck[0].veh, army_truck[0].recording_number, "lkfbi5a") //skip_to_end_and_stop_playback_recorded_vehicle(army_truck[0].veh) if not replay_active load_scene(get_entity_coords(player_ped_id())) endif trigger_music_event("FBI5A_FORKLIFT_RESTART") START_ALARM("FIB_05_BIOTECH_LAB_ALARMS", true) SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(4, "load chemicals into container") e_section_stage = SECTION_STAGE_SETUP e_mission_stage = STAGE_LOAD_FRIDGE end_cutscene(false, 0, 0, false) endproc proc load_replay_skip_5() DISABLE_TAXI_HAILING(true) set_max_wanted_level(0) set_create_random_cops(false) if replay_active start_replay_setup(<<3166.7795, 3497.2307, 71.4959>>, 300.0811, false) endif request_model(model_michael) request_model(model_trevor) request_model(dave.model) request_model(steve.model) request_model(army_truck[0].model) request_model(helicopter.model) request_model(fridge_pallet.model) REQUEST_MODEL(fridge.model) request_model(container_light.model) REQUEST_MODEL(crate.model) request_model(PROP_BOXPILE_02B) request_model(flare[0].model) request_vehicle_recording(004, "lkfbi5a") request_vehicle_recording(army_truck[0].recording_number, "lkfbi5a") request_model(get_weapontype_model(weapontype_carbinerifle)) request_weapon_asset(WEAPONTYPE_CARBINERIFLE) request_model(get_weapontype_model(WEAPONTYPE_STUNGUN)) request_weapon_asset(WEAPONTYPE_STUNGUN) request_anim_dict("missfbi5ig_33") prepare_alarm("FIB_05_BIOTECH_LAB_ALARMS") request_ptfx_asset() interior_lab = GET_INTERIOR_AT_COORDS(v_pipe_end_pos) PIN_INTERIOR_IN_MEMORY(interior_lab) if replay_active END_REPLAY_SETUP() endif while not HAS_MODEL_LOADED(model_michael) or not HAS_MODEL_LOADED(model_trevor) or not HAS_MODEL_LOADED(dave.model) or not HAS_MODEL_LOADED(steve.model) or not has_model_loaded(army_truck[0].model) or not has_model_loaded(helicopter.model) or not has_model_loaded(fridge_pallet.model) or not HAS_MODEL_LOADED(fridge.model) or not has_model_loaded(container_light.model) or not has_model_loaded(crate.model) or not has_model_loaded(PROP_BOXPILE_02B) or not has_model_loaded(flare[0].model) or not has_vehicle_recording_been_loaded(004, "lkfbi5a") or not has_vehicle_recording_been_loaded(army_truck[0].recording_number, "lkfbi5a") or not has_model_loaded(get_weapontype_model(weapontype_carbinerifle)) or not has_weapon_asset_loaded(weapontype_carbinerifle) or not has_model_loaded(get_weapontype_model(WEAPONTYPE_STUNGUN)) or not has_weapon_asset_loaded(WEAPONTYPE_STUNGUN) or not has_anim_dict_loaded("missfbi5ig_33") or not prepare_alarm("FIB_05_BIOTECH_LAB_ALARMS") or not has_ptfx_asset_loaded() or not IS_INTERIOR_READY(interior_lab) wait(0) endwhile clear_area(<<3613.4080, 3739.4495, 27.6921>>, 10000, true) VECTOR v_chopper_start_pos = get_position_of_vehicle_recording_at_time(004, (get_total_duration_of_vehicle_recording(004, "lkfbi5a") - 1000), "lkfbi5a") //<< 2975.5715, 3368.7571, 150.0000 >> FLOAT f_chopper_start_heading = 301.8604 helicopter.veh = CREATE_VEHICLE(helicopter.model, v_chopper_start_pos, f_chopper_start_heading) SET_VEHICLE_AS_RESTRICTED(helicopter.veh, 0) SET_VEHICLE_ENGINE_CAN_DEGRADE(helicopter.veh, false) SET_MODEL_AS_NO_LONGER_NEEDED(helicopter.model) SET_VEHICLE_ENGINE_ON(helicopter.veh, TRUE, TRUE) SET_HELI_BLADES_FULL_SPEED(helicopter.veh) SET_VEH_RADIO_STATION(helicopter.veh, "OFF") REMOVE_PICK_UP_ROPE_FOR_CARGOBOB(helicopter.veh) start_playback_recorded_vehicle(helicopter.veh, 004, "lkfbi5a") skip_time_in_playback_recorded_vehicle(helicopter.veh, (get_total_duration_of_vehicle_recording(004, "lkfbi5a") - 1000)) force_playback_recorded_vehicle_update(helicopter.veh) //pause_playback_recorded_vehicle(helicopter.veh) crate.obj = CREATE_OBJECT_no_offset(crate.model, crate.pos) //-10.00 SET_ENTITY_HEADING(crate.obj, crate.heading) freeze_entity_position(crate.obj, true) SET_OBJECT_TAKES_DAMAGE_FROM_COLLIDING_WITH_BUILDINGS(crate.obj) SET_ENTITY_PROOFS(crate.obj, TRUE, TRUE, TRUE, TRUE, TRUE) fridge_pallet.obj = CREATE_OBJECT_no_offset(fridge_pallet.model, fridge_pallet.pos) SET_ENTITY_HEADING(fridge_pallet.obj, fridge_pallet.heading) sET_ENTITY_PROOFS(fridge_pallet.obj, TRUE, TRUE, TRUE, TRUE, TRUE) fridge.obj = CREATE_OBJECT_no_offset(fridge.model, fridge.pos) SET_ENTITY_HEADING(fridge.obj, fridge.heading) //sET_ENTITY_PROOFS(fridge.obj, TRUE, TRUE, TRUE, TRUE, TRUE) attach_entity_to_entity(fridge.obj, fridge_pallet.obj, 0, <<0.0, 0.0, 0.860>>, <<0.0, 0.0, 180.0>>, false, false, true) attach_entity_to_entity(fridge_pallet.obj, crate.obj, 0, <<0.0, 0.0, -1.210>>, <<0.0, 0.0, 0.0>>) container_light.obj = CREATE_OBJECT_no_offset(container_light.model, container_light.pos) SET_ENTITY_HEADING(container_light.obj, container_light.heading) sET_ENTITY_PROOFS(container_light.obj, TRUE, TRUE, TRUE, TRUE, TRUE) flare[0].obj = create_object(flare[0].model, v_drop_crate_loc) set_entity_rotation(flare[0].obj, <<0.0, 0.0, 0.0>>) flare_ptfx[0] = START_PARTICLE_FX_LOOPED_ON_entity("scr_fbi5a_flare", flare[0].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) SET_PARTICLE_FX_LOOPED_COLOUR(flare_ptfx[0], 1.0, 0.84, 0.0) if not (get_current_player_ped_enum() = char_trevor) set_current_selector_ped(selector_ped_trevor, false) endif add_ped_for_dialogue(scripted_speech, 2, player_ped_id(), "trevor") set_ped_into_vehicle(player_ped_id(), helicopter.veh) //CREATE_PLAYER_PED_INSIDE_VEHICLE(selector_ped.pedID[SELECTOR_PED_michael], CHAR_michael, forklift_truck.veh) create_player_ped_on_foot(selector_ped.pedID[SELECTOR_PED_michael], CHAR_michael, <<3622.3528, 3754.1428, 27.5154>>, 344.6723, false) SET_PED_COMP_ITEM_CURRENT_SP(selector_ped.pedID[SELECTOR_PED_michael], comp_type_outfit, OUTFIT_P0_SCUBA_LAND, false) SET_PED_COMP_ITEM_CURRENT_SP(selector_ped.pedID[SELECTOR_PED_michael], COMP_TYPE_PROPS, PROPS_HEAD_NONE, false) //RESTORE_PLAYER_PED_HAIRDO(selector_ped.pedID[selector_ped_michael]) SET_PED_COMPONENT_VARIATION(selector_ped.pedID[selector_ped_michael], PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(selector_ped.pedID[selector_ped_michael], PED_COMP_TORSO, 4, 0) SET_PED_COMPONENT_VARIATION(selector_ped.pedID[selector_ped_michael], PED_COMP_LEG, 4, 0) SET_PED_COMPONENT_VARIATION(selector_ped.pedID[selector_ped_michael], PED_COMP_FEET, 4, 0) SET_PED_COMPONENT_VARIATION(selector_ped.pedID[selector_ped_michael], PED_COMP_SPECIAL, 4, 0) SET_PED_COMPONENT_VARIATION(selector_ped.pedID[selector_ped_michael], PED_COMP_DECL, 0, 0) SET_PED_PROP_INDEX(selector_ped.pedID[selector_ped_michael], ANCHOR_EYES, 2, 0) SET_PED_MAX_TIME_UNDERWATER(selector_ped.pedID[selector_ped_michael], -1.0) ADD_PED_FOR_DIALOGUE(scripted_speech, 0, selector_ped.pedID[selector_ped_michael], "michael") SET_PED_USING_ACTION_MODE(selector_ped.pedID[selector_ped_michael], true) GIVE_WEAPON_TO_PED(selector_ped.pedID[selector_ped_michael], WEAPONTYPE_CARBINERIFLE, 400) //GIVE_WEAPON_COMPONENT_TO_PED(selector_ped.pedID[selector_ped_michael], WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(selector_ped.pedID[selector_ped_michael], WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) //GIVE_WEAPON_COMPONENT_TO_PED(selector_ped.pedID[selector_ped_michael], weapontype_carbinerifle, weaponcomponent_at_ar_flsh) give_weapon_to_ped(selector_ped.pedID[selector_ped_michael], WEAPONTYPE_GRENADE, 2) GIVE_WEAPON_TO_PED(selector_ped.pedID[selector_ped_michael], WEAPONTYPE_STUNGUN , 50, true) setup_relationship_contact(selector_ped.pedID[selector_ped_michael], true) dave.pos = <<3626.2354, 3762.1626, 27.6171>> dave.heading = 33.6764 setup_buddy(dave) ADD_PED_FOR_DIALOGUE(scripted_speech, 3, dave.ped, "dave") SET_PED_MAX_TIME_UNDERWATER(dave.ped, 10000000.0) SET_PED_DIES_IN_WATER(dave.ped, FALSE) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_FEET, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_JBIB, 3, 0) //SET_PED_PROP_INDEX(dave.ped, ANCHOR_EYES, 2, 0) //GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) give_weapon_to_ped(dave.ped, weapontype_stungun, infinite_ammo, false) set_current_ped_weapon(dave.ped, dave.weapon, true) dave_ai_system_2_status = 50 steve.pos = <<3629.7551, 3746.9419, 27.6062>> steve.heading = 7.00 setup_buddy(steve) ADD_PED_FOR_DIALOGUE(scripted_speech, 4, steve.ped, "steve") SET_PED_MAX_TIME_UNDERWATER(steve.ped, 10000000.0) SET_PED_DIES_IN_WATER(steve.ped, FALSE) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_FEET, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_JBIB, 0, 0) //SET_PED_PROP_INDEX(steve.ped, ANCHOR_EYES, 2) //GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) give_weapon_to_ped(steve.ped, weapontype_stungun, infinite_ammo, false) set_current_ped_weapon(steve.ped, steve.weapon, true) steve_ai_system_2_status = 101 obj_loading_boxes[1] = CREATE_OBJECT(PROP_BOXPILE_02B, <<3623.3342, 3738.3862, 27.6897>>) SET_ENTITY_HEADING(obj_loading_boxes[1], 150.2056) army_truck[0].veh = create_vehicle(army_truck[0].model, army_truck[0].pos, army_truck[0].heading) set_vehicle_doors_locked(army_truck[0].veh, vehiclelock_lockout_player_only) SET_VEHICLE_IS_CONSIDERED_BY_PLAYER(army_truck[0].veh, false) SET_VEHICLE_RADIO_ENABLED(army_truck[0].veh, false) set_vehicle_engine_on(army_truck[0].veh, false, true) start_playback_recorded_vehicle(army_truck[0].veh, army_truck[0].recording_number, "lkfbi5a") skip_to_end_and_stop_playback_recorded_vehicle(army_truck[0].veh) if not replay_active load_scene(get_entity_coords(player_ped_id())) endif trigger_music_event("FBI5A_HELI_RESTART") start_audio_scene("FBI_5_FLY_TO_CONTAINER") START_ALARM("FIB_05_BIOTECH_LAB_ALARMS", true) SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(5, "land crate with helicopter") e_mission_stage = stage_collect_crate e_section_stage = SECTION_STAGE_SETUP original_time = get_game_timer() // while not b_ropes_attached // or not lk_timer(original_time, 1500) // // if is_vehicle_driveable(helicopter.veh) // // ATTACH_CHOPPER_TO_CONTAINER_WITH_ROPE(helicopter.veh, crate.obj, rope_chopper, b_ropes_created, b_ropes_attached, FALSE, TRUE) // // STABILISE_ENTITY_ATTACHED_TO_HELI(helicopter.veh, crate.obj, f_container_offset_z) // //// if DOES_ENTITY_HAVE_PHYSICS(crate.obj) //// SET_OBJECT_PHYSICS_PARAMS(crate.obj, -1, -1, <<0.5, 0.5, 0.5>>, <<0.5, 0.5, 0.5>>, -1, -1, -1) //// endif // // if b_ropes_attached // UNPAUSE_PLAYBACK_RECORDED_VEHICLE(helicopter.veh) // endif // // wait(0) // // endif // endwhile // if DOES_ENTITY_HAVE_PHYSICS(crate.obj) // SET_OBJECT_PHYSICS_PARAMS(crate.obj, -1, -1, <<-1.0, -1.0, -1.0>>, <<-1.0, -1.0, -1.0>>, -1, -1, -1) // endif end_cutscene(false, 0, 0, false) endproc //PURPOSE: failing between flying to the airport and end of the mission. = flying to the airport from the chemical // factory proc load_replay_skip_6() int i DISABLE_TAXI_HAILING(true) set_max_wanted_level(0) set_create_random_cops(false) if replay_active start_replay_setup(<<3614.4639, 3773.9973, 29.0181>>, 143.9524, false) endif request_model(model_michael) request_model(model_trevor) request_model(dave.model) request_model(steve.model) request_model(security_guard_2[0].model) request_model(security_guard_2[1].model) request_model(army_truck[0].model) request_model(helicopter.model) REQUEST_MODEL(crate.model) request_model(PROP_BOXPILE_02B) request_model(flare[0].model) request_vehicle_recording(004, "lkfbi5a") request_vehicle_recording(army_truck[0].recording_number, "lkfbi5a") request_vehicle_recording(006, "lkfbi5a") request_model(get_weapontype_model(weapontype_carbinerifle)) request_weapon_asset(WEAPONTYPE_CARBINERIFLE) request_model(get_weapontype_model(WEAPONTYPE_STUNGUN)) request_weapon_asset(WEAPONTYPE_STUNGUN) request_anim_dict("MISSFBI5IG_0") prepare_alarm("FIB_05_BIOTECH_LAB_ALARMS") request_ptfx_asset() interior_lab = GET_INTERIOR_AT_COORDS(v_pipe_end_pos) PIN_INTERIOR_IN_MEMORY(interior_lab) if replay_active END_REPLAY_SETUP() endif while not HAS_MODEL_LOADED(model_michael) or not HAS_MODEL_LOADED(model_trevor) or not HAS_MODEL_LOADED(dave.model) or not HAS_MODEL_LOADED(steve.model) or not HAS_MODEL_LOADED(security_guard_2[0].model) or not HAS_MODEL_LOADED(security_guard_2[1].model) or not has_model_loaded(army_truck[0].model) or not has_model_loaded(helicopter.model) or not has_model_loaded(crate.model) or not has_model_loaded(PROP_BOXPILE_02B) or not has_model_loaded(flare[0].model) or not has_vehicle_recording_been_loaded(004, "lkfbi5a") or not has_vehicle_recording_been_loaded(army_truck[0].recording_number, "lkfbi5a") or not has_vehicle_recording_been_loaded(006, "lkfbi5a") or not has_model_loaded(get_weapontype_model(weapontype_carbinerifle)) or not has_weapon_asset_loaded(weapontype_carbinerifle) or not has_model_loaded(get_weapontype_model(WEAPONTYPE_STUNGUN)) or not has_weapon_asset_loaded(WEAPONTYPE_STUNGUN) or not has_anim_dict_loaded("MISSFBI5IG_0") or not prepare_alarm("FIB_05_BIOTECH_LAB_ALARMS") or not has_ptfx_asset_loaded() or not IS_INTERIOR_READY(interior_lab) wait(0) endwhile clear_area(<<3633.9233, 3766.1704, 40.3>>, 10000, true) set_current_selector_ped(selector_ped_trevor, false) helicopter.veh = CREATE_VEHICLE(helicopter.model, <<3633.9233, 3766.1704, 40.3>>, 163.1875) SET_VEHICLE_AS_RESTRICTED(helicopter.veh, 0) SET_VEHICLE_ENGINE_CAN_DEGRADE(helicopter.veh, false) SET_MODEL_AS_NO_LONGER_NEEDED(helicopter.model) SET_VEHICLE_ENGINE_ON(helicopter.veh, TRUE, TRUE) SET_HELI_BLADES_FULL_SPEED(helicopter.veh) SET_VEH_RADIO_STATION(helicopter.veh, "OFF") REMOVE_PICK_UP_ROPE_FOR_CARGOBOB(helicopter.veh) start_playback_recorded_vehicle(helicopter.veh, 006, "lkfbi5a") skip_time_in_playback_recorded_vehicle(helicopter.veh, 3500) SET_VEHICLE_ACTIVE_DURING_PLAYBACK(helicopter.veh, true) force_playback_recorded_vehicle_update(helicopter.veh) crate.obj = CREATE_OBJECT_no_offset(crate.model, get_offset_from_entity_in_world_coords(helicopter.veh, v_container_offset))//<<3633.9233, 3766.1704, 32.3>>) set_entity_heading(crate.obj, (GET_ENTITY_HEADING(helicopter.veh)+ 180.0)) //SET_ENTITY_PROOFS(crate.obj, TRUE, TRUE, TRUE, TRUE, TRUE) SET_OBJECT_TAKES_DAMAGE_FROM_COLLIDING_WITH_BUILDINGS(crate.obj) crate_door_left.obj = create_object(crate_door_left.model, crate_door_left.pos) ATTACH_ENTITY_TO_ENTITY(crate_door_left.obj, crate.obj, 0, <<-1.3, -1.8, 0.00>>, <<0,0,0>>, FALSE, FALSE, TRUE) crate_door_right.obj = create_object(crate_door_right.model, crate_door_right.pos) ATTACH_ENTITY_TO_ENTITY(crate_door_right.obj, crate.obj, 0, <<1.3, -1.8, 0.00>>, <<0,0,0>>, FALSE, FALSE, TRUE) ATTACH_CHOPPER_TO_CONTAINER_WITH_ROPE(helicopter.veh, crate.obj, rope_chopper, b_ropes_created, b_ropes_attached, FALSE, false) STABILISE_ENTITY_ATTACHED_TO_HELI(helicopter.veh, crate.obj, f_container_offset_z) //-- ROPE_SET_UPDATE_PINVERTS( rope_chopper[0] ) ROPE_SET_UPDATE_PINVERTS( rope_chopper[1] ) ROPE_SET_UPDATE_PINVERTS( rope_chopper[2] ) ROPE_SET_UPDATE_PINVERTS( rope_chopper[3] ) play_sound_from_entity(crate_sound, "Cable_Strain", crate.obj, "FBI_05_SOUNDS") //-- flare[0].obj = create_object(flare[0].model, v_drop_crate_loc) set_entity_rotation(flare[0].obj, <<0.0, 0.0, 0.0>>) flare_ptfx[0] = START_PARTICLE_FX_LOOPED_ON_entity("scr_fbi5a_flare", flare[0].obj, <<0.0, 0.0, 0.11>>, <<0.0, 0.0, 0.0>>) SET_PARTICLE_FX_LOOPED_COLOUR(flare_ptfx[0], 1.0, 0.84, 0.0) if not (get_current_player_ped_enum() = char_trevor) set_current_selector_ped(selector_ped_trevor, false) endif add_ped_for_dialogue(scripted_speech, 2, player_ped_id(), "trevor") set_ped_into_vehicle(player_ped_id(), helicopter.veh) //CREATE_PLAYER_PED_INSIDE_VEHICLE(selector_ped.pedID[SELECTOR_PED_michael], CHAR_michael, forklift_truck.veh) create_player_ped_inside_vehicle(selector_ped.pedID[SELECTOR_PED_michael], CHAR_michael, helicopter.veh, vs_front_right, false) SET_PED_COMP_ITEM_CURRENT_SP(selector_ped.pedID[SELECTOR_PED_michael], comp_type_outfit, OUTFIT_P0_SCUBA_LAND, false) SET_PED_COMP_ITEM_CURRENT_SP(selector_ped.pedID[SELECTOR_PED_michael], COMP_TYPE_PROPS, PROPS_HEAD_NONE, false) //RESTORE_PLAYER_PED_HAIRDO(selector_ped.pedID[selector_ped_michael]) SET_PED_MAX_TIME_UNDERWATER(selector_ped.pedID[selector_ped_michael], -1.0) ADD_PED_FOR_DIALOGUE(scripted_speech, 0, selector_ped.pedID[selector_ped_michael], "michael") SET_PED_USING_ACTION_MODE(selector_ped.pedID[selector_ped_michael], true) GIVE_WEAPON_TO_PED(selector_ped.pedID[selector_ped_michael], WEAPONTYPE_CARBINERIFLE, 400) //GIVE_WEAPON_COMPONENT_TO_PED(selector_ped.pedID[selector_ped_michael], WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(selector_ped.pedID[selector_ped_michael], WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) give_weapon_to_ped(selector_ped.pedID[selector_ped_michael], WEAPONTYPE_GRENADE, 2) GIVE_WEAPON_TO_PED(selector_ped.pedID[selector_ped_michael], WEAPONTYPE_STUNGUN , 50, true) setup_relationship_contact(selector_ped.pedID[selector_ped_michael], true) setup_buddy_inside_vehicle(dave, helicopter.veh, vs_back_left) ADD_PED_FOR_DIALOGUE(scripted_speech, 3, dave.ped, "dave") SET_PED_MAX_TIME_UNDERWATER(dave.ped, 10000000.0) SET_PED_DIES_IN_WATER(dave.ped, FALSE) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_FEET, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL, 2, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(dave.ped, PED_COMP_JBIB, 3, 0) //SET_PED_PROP_INDEX(dave.ped, ANCHOR_EYES, 2, 0) //GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(dave.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) give_weapon_to_ped(dave.ped, weapontype_stungun, infinite_ammo, false) set_current_ped_weapon(dave.ped, dave.weapon, true) //dave_ai_system_2_status = 50 steve.pos = <<3622.69, 3749.85, 27.69>> steve.heading = 75.5 setup_buddy(steve) ADD_PED_FOR_DIALOGUE(scripted_speech, 4, steve.ped, "steve") SET_PED_MAX_TIME_UNDERWATER(steve.ped, 10000000.0) SET_PED_DIES_IN_WATER(steve.ped, FALSE) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HEAD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_BERD, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAIR, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TORSO, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_LEG, 1, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_HAND, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_FEET, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_TEETH, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL, 2, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_SPECIAL2, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_DECL, 0, 0) SET_PED_COMPONENT_VARIATION(steve.ped, PED_COMP_JBIB, 0, 0) //SET_PED_PROP_INDEX(steve.ped, ANCHOR_EYES, 2) //GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_LASR) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, WEAPONTYPE_CARBINERIFLE, WEAPONCOMPONENT_AT_AR_SUPP) GIVE_WEAPON_COMPONENT_TO_PED(steve.ped, weapontype_carbinerifle, weaponcomponent_at_ar_flsh) give_weapon_to_ped(steve.ped, weapontype_stungun, infinite_ammo, false) task_play_anim(steve.ped, "MISSFBI5IG_0", "LyingInPain_Loop_Steve", instant_blend_in, normal_blend_out, -1, AF_LOOPING | AF_FORCE_START | AF_EXIT_AFTER_INTERRUPTED) FORCE_PED_AI_AND_ANIMATION_UPDATE(steve.ped) steve_badge.obj = CREATE_OBJECT(steve_badge.model, steve_badge.pos) ATTACH_ENTITY_TO_ENTITY(steve_badge.obj, steve.ped, GET_PED_BONE_INDEX(steve.ped, BONETAG_PH_R_HAND), <<0,0,0>>, <<0,0,0>>, TRUE, TRUE) obj_loading_boxes[1] = CREATE_OBJECT(PROP_BOXPILE_02B, <<3623.3342, 3738.3862, 27.6897>>) SET_ENTITY_HEADING(obj_loading_boxes[1], 150.2056) army_truck[0].veh = create_vehicle(army_truck[0].model, army_truck[0].pos, army_truck[0].heading) set_vehicle_doors_locked(army_truck[0].veh, vehiclelock_lockout_player_only) SET_VEHICLE_IS_CONSIDERED_BY_PLAYER(army_truck[0].veh, false) SET_VEHICLE_RADIO_ENABLED(army_truck[0].veh, false) set_vehicle_engine_on(army_truck[0].veh, false, true) start_playback_recorded_vehicle(army_truck[0].veh, army_truck[0].recording_number, "lkfbi5a") skip_to_end_and_stop_playback_recorded_vehicle(army_truck[0].veh) for i = 0 to count_of(security_guard_2) - 1 setup_enemy(security_guard_2[i]) remove_blip(security_guard_2[i].blip) endfor for i = 0 to count_of(security_guard_2) - 1 //remove_relationship_group(enemy_group) setup_relationship_security_guard_2(security_guard_2[i].ped) task_combat_hated_targets_around_ped(security_guard_2[i].ped, 200) endfor trigger_music_event("FBI5A_FLY_RESTART") START_ALARM("FIB_05_BIOTECH_LAB_ALARMS", true) if not replay_active load_scene(get_entity_coords(player_ped_id())) endif end_cutscene() UNPIN_INTERIOR(interior_lab) //fly_to_airport_dialogue_system() SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(6, "fly to airport") e_section_stage = SECTION_STAGE_SETUP//RUNNING e_mission_stage = stage_fly_to_airport endproc proc load_replay_skip_7() //set_entity_coords(player_ped_id(), <<457.8458, 2422.8691, 45.7794>>) if replay_active start_replay_setup(<<218.0823, 3269.5334, 40.5141>>, 170.5753, false) endif request_model(model_trevor) request_model(trevors_truck.model) request_model(patricia.model) request_model(madrazzos_guard[0].model) //request_anim_dict("missfbi5@trevor_driving") REQUEST_CLIP_SET("clipset@missfbi5_trevor_driving") request_vehicle_recording(trevors_truck.recording_number, "lkfbi5a") prepare_music_event("FBI5A_TREV_RADIO_FRTA") if replay_active END_REPLAY_SETUP() endif while not has_model_loaded(model_trevor) or not has_model_loaded(trevors_truck.model) or not has_model_loaded(patricia.model) or not has_model_loaded(madrazzos_guard[0].model) //or not has_anim_dict_loaded("missfbi5@trevor_driving") or not has_clip_set_loaded("clipset@missfbi5_trevor_driving") or not has_vehicle_recording_been_loaded(trevors_truck.recording_number, "lkfbi5a") or not prepare_music_event("FBI5A_TREV_RADIO_FRTA") wait(0) endwhile SET_VEHICLE_POPULATION_BUDGET(2) ENABLE_DISPATCH_SERVICE(DT_GANGS, FALSE) clear_area(trevors_truck.pos, 1000.00, true) CREATE_PLAYER_VEHICLE(trevors_truck.veh, CHAR_TREVOR, trevors_truck.pos, trevors_truck.heading, false) start_playback_recorded_vehicle(trevors_truck.veh, trevors_truck.recording_number, "lkfbi5a") SKIP_TIME_IN_PLAYBACK_RECORDED_VEHICLE(trevors_truck.veh, 5000) set_playback_speed(trevors_truck.veh, 0.0) force_playback_recorded_vehicle_update(trevors_truck.veh) SET_INITIAL_PLAYER_STATION("RADIO_01_CLASS_ROCK") if GET_VEHICLE_MOD_KIT(trevors_truck.veh) >= 0 AND GET_VEHICLE_MOD_KIT(trevors_truck.veh) < 255 IF GET_VEHICLE_MOD(trevors_truck.veh, MOD_ROOF) >= 0 REMOVE_VEHICLE_MOD(trevors_truck.veh, MOD_ROOF) ENDIF ENDIF set_current_selector_ped(selector_ped_trevor, false) set_ped_into_vehicle(player_ped_id(), trevors_truck.veh) SET_PED_IN_VEHICLE_CONTEXT(player_ped_id(), get_hash_key("MISSFBI5_TREVOR_DRIVING")) add_ped_for_dialogue(scripted_speech, 2, player_ped_id(), "trevor") CREATE_NPC_PED_INSIDE_VEHICLE(patricia.ped, CHAR_PATRICIA, trevors_truck.veh, vs_front_right) setup_buddy_attributes(patricia) setup_relationship_contact(patricia.ped, true) SET_PED_LOD_MULTIPLIER(patricia.ped, 2.0) add_ped_for_dialogue(scripted_speech, 7, patricia.ped, "patricia") madrazzos_guard_ai_system() wait(0)//added to fix vehicle recording freezing. Needed for variations to update a frame. if not replay_active load_scene(get_entity_coords(player_ped_id())) endif if is_vehicle_driveable(trevors_truck.veh) set_playback_speed(trevors_truck.veh, 1.0) endif while not HAVE_ALL_STREAMING_REQUESTS_COMPLETED_for_ped(player_ped_id()) or not HAVE_ALL_STREAMING_REQUESTS_COMPLETED_for_ped(patricia.ped) wait(0) endwhile if is_vehicle_driveable(trevors_truck.veh) if is_playback_going_on_for_vehicle(trevors_truck.veh) stop_playback_recorded_vehicle(trevors_truck.veh) endif endif trigger_music_event("FBI5A_TREV_RADIO_FRTA") e_section_stage = SECTION_STAGE_SETUP e_mission_stage = stage_drop_off_patricia SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(7, "drive with patricia", true) end_cutscene() endproc proc load_replay_skip_8() if replay_active start_replay_setup(<<1362.9181, 1156.9108, 112.7590>>, 0.0, false) endif request_model(model_trevor) request_model(trevors_truck.model) request_model(patricia.model) if replay_active END_REPLAY_SETUP() endif if has_model_loaded(model_trevor) and has_model_loaded(trevors_truck.model) and has_model_loaded(patricia.model) clear_area(<<1362.9181, 1156.9108, 112.7590>>, 1000.00, true) CREATE_PLAYER_VEHICLE(trevors_truck.veh, CHAR_TREVOR, <<1362.9181, 1156.9108, 112.7590>>, 0.0, false) if GET_VEHICLE_MOD_KIT(trevors_truck.veh) >= 0 AND GET_VEHICLE_MOD_KIT(trevors_truck.veh) < 255 IF GET_VEHICLE_MOD(trevors_truck.veh, MOD_ROOF) >= 0 REMOVE_VEHICLE_MOD(trevors_truck.veh, MOD_ROOF) ENDIF ENDIF set_current_selector_ped(selector_ped_trevor, false) set_ped_into_vehicle(player_ped_id(), trevors_truck.veh) add_ped_for_dialogue(scripted_speech, 2, player_ped_id(), "trevor") CREATE_NPC_PED_INSIDE_VEHICLE(patricia.ped, CHAR_PATRICIA, trevors_truck.veh, vs_front_right) setup_buddy_attributes(patricia) setup_relationship_contact(patricia.ped, true) SET_PED_LOD_MULTIPLIER(patricia.ped, 2.0) add_ped_for_dialogue(scripted_speech, 7, patricia.ped, "patricia") request_cutscene("FBI_5_EXT") while not has_cutscene_loaded() SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("trevor", PLAYER_PED_ID()) if not is_ped_injured(patricia.ped) SET_CUTSCENE_PED_COMPONENT_VARIATION_FROM_PED("patricia", patricia.ped) endif wait(0) endwhile start_new_cutscene_no_fade() if not replay_active load_scene(get_entity_coords(player_ped_id())) endif if not is_ped_injured(patricia.ped) register_entity_for_cutscene(patricia.ped, "patricia", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, patricia.model) endif if is_vehicle_driveable(trevors_truck.veh) register_entity_for_cutscene(trevors_truck.veh, "trevors_car", CU_ANIMATE_EXISTING_SCRIPT_ENTITY, trevors_truck.model) endif setup_vehicle_proofs(trevors_truck.veh) start_cutscene() REPLAY_RECORD_BACK_FOR_TIME(5.0, 0.0, REPLAY_IMPORTANCE_HIGHEST) while not is_cutscene_playing() wait(0) endwhile drop_off_patricia_status = 2 e_mission_stage = stage_drop_off_patricia e_section_stage = SECTION_STAGE_running do_screen_fade_in(default_fade_time) endif endproc proc initialise_mission_doors() //ground floor - Metal door fbi_5_door[0] = get_hash_key("fbi_5_door_0") add_door_to_system(fbi_5_door[0], V_ILev_BL_DoorPool, <<3526.0, 3702.2, 21.3>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[0], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[0], DOORSTATE_force_locked_this_frame, false, true) //ground floor - left elevator door fbi_5_door[1] = get_hash_key("fbi_5_door_1") add_door_to_system(fbi_5_door[1], v_ilev_bl_doorel_l, <<3538.99, 3673.65, 19.99>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[1], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[1], DOORSTATE_force_locked_this_frame, false, true) //ground floor - right elevator door fbi_5_door[2] = get_hash_key("fbi_5_door_2") add_door_to_system(fbi_5_door[2], v_ilev_bl_doorel_r, <<3541.56, 3673.2, 19.99>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[2], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[2], DOORSTATE_force_locked_this_frame, false, true) //first floor - left elevator door start of find chemicals fbi_5_door[3] = get_hash_key("fbi_5_door_3") add_door_to_system(fbi_5_door[3], V_ILev_BL_DoorEL_L, <<3538.8, 3673.7, 27.1>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[3], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[3], DOORSTATE_force_locked_this_frame, false, true) //first floor - right elevator door start of find chemicals fbi_5_door[4] = get_hash_key("fbi_5_door_4") add_door_to_system(fbi_5_door[4], V_ILev_BL_DoorEL_R, <<3541.7, 3673.2, 27.1>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[4], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[4], DOORSTATE_force_locked_this_frame, false, true) // first floor - first lab first floor scientist 2 & 3 // fbi_5_door[5] // fbi_5_door[6] //first floor - swinging doors patrol security walk through - left fbi_5_door[7] = get_hash_key("fbi_5_door_7") add_door_to_system(fbi_5_door[7], v_ilev_bl_door_l, <<3545.28, 3646.557, 28.27>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[7], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[7], DOORSTATE_force_locked_this_frame, false, true) //first floor - swinging doors patrol security walk through - right fbi_5_door[8] = get_hash_key("fbi_5_door_8") add_door_to_system(fbi_5_door[8], v_ilev_bl_door_r, <<3544.80, 3643.99, 28.27>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[8], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[8], DOORSTATE_force_locked_this_frame, false, true) //first floor - sliding doors before swipe card - left fbi_5_door[9] = get_hash_key("fbi_5_door_9") add_door_to_system(fbi_5_door[9], v_ilev_bl_doorsl_l, <<3549.01, 3658.79, 27.12>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[9], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[9], DOORSTATE_force_locked_this_frame, false, true) //first floor - sliding doors before swipe card cutscene - right fbi_5_door[10] = get_hash_key("fbi_5_door_10") add_door_to_system(fbi_5_door[10], v_ilev_bl_doorsl_r, <<3551.57, 3658.34, 27.12>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[10], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[10], DOORSTATE_force_locked_this_frame, false, true) //first floor - left sliding door swipe card cutscene - left fbi_5_door[11] = get_hash_key("fbi_5_door_11") add_door_to_system(fbi_5_door[11], V_ILEV_BL_DOORSL_L, <<3552.87, 3665.25, 27.12>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[11], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[11], DOORSTATE_force_locked_this_frame, false, true) //first floor - right sliding door swipe card cutscene fbi_5_door[12] = get_hash_key("fbi_5_door_12") add_door_to_system(fbi_5_door[12], V_ILEV_BL_DOORSL_R, <<3555.44, 3664.8, 27.12>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[12], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[12], DOORSTATE_force_locked_this_frame, false, true) //first floor - sliding door scientist 4 walks out of fbi_5_door[13] = get_hash_key("fbi_5_door_13") add_door_to_system(fbi_5_door[13], V_ILev_Bl_DoorSL_R, <<3557.6, 3669.2, 27.1>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[13], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[13], DOORSTATE_force_locked_this_frame, false, true) //first floor - second left sliding door scientist 5 walks through near lab fbi_5_door[14] = get_hash_key("fbi_5_door_14") add_door_to_system(fbi_5_door[14], V_ILEV_BL_DOORSL_L, <<3555.74, 3681.53, 27.12>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[14], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[14], DOORSTATE_force_locked_this_frame, false, true) //first floor - second right sliding door scientist 5 walks through near lab fbi_5_door[15] = get_hash_key("fbi_5_door_15") add_door_to_system(fbi_5_door[15], V_ILEV_BL_DOORSL_R, <<3558.30, 3681.08, 27.12>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[15], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[15], DOORSTATE_force_locked_this_frame, false, true) //first floor - first left sliding door scientist 5 walks through near lab fbi_5_door[16] = get_hash_key("fbi_5_door_16") add_door_to_system(fbi_5_door[16], V_ILEV_BL_DOORSL_L, <<3565.07, 3684.73, 27.12>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[16], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[16], DOORSTATE_force_locked_this_frame, false, true) //first floor - first right sliding door scientist 5 walks through near lab fbi_5_door[17] = get_hash_key("fbi_5_door_17") add_door_to_system(fbi_5_door[17], V_ILEV_BL_DOORSL_R, <<3567.63, 3684.28, 27.12>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[17], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[17], DOORSTATE_force_locked_this_frame, false, true) //first floor - left door second wave of guards fbi_5_door[18] = get_hash_key("fbi_5_door_18") add_door_to_system(fbi_5_door[18], V_ILEV_BL_DOOR_L, <<3569.16, 3695.87, 28.27>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[18], 1.1, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[18], DOORSTATE_force_locked_this_frame, false, true) //first floor - right door second wave of guards fbi_5_door[19] = get_hash_key("fbi_5_door_19") add_door_to_system(fbi_5_door[19], V_ILEV_BL_DOOR_R, <<3568.70, 3693.30, 28.27>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[19], -1.1, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[19], DOORSTATE_force_locked_this_frame, false, true) //first floor - left door before guard 8 - hallway runs to the left. fbi_5_door[20] = get_hash_key("fbi_5_door_20") add_door_to_system(fbi_5_door[20], V_ILEV_BL_DOOR_L, <<3596.38, 3690.46, 28.97>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[20], 1.1, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[20], DOORSTATE_force_locked_this_frame, false, true) //first floor - right door before guard 8 - hallway runs to the left. fbi_5_door[21] = get_hash_key("fbi_5_door_21") add_door_to_system(fbi_5_door[21], V_ILEV_BL_DOOR_R, <<3598.51, 3688.97, 28.97>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[21], -1.1, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[21], DOORSTATE_force_locked_this_frame, false, true) //first floor - left door monkey_area fbi_5_door[22] = get_hash_key("fbi_5_door_22") add_door_to_system(fbi_5_door[22], V_ILEV_BL_DOOR_L, <<3584.15, 3700.94, 28.97>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[22], 1.1, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[22], DOORSTATE_force_locked_this_frame, false, true) //first floor - right door monkey_area fbi_5_door[23] = get_hash_key("fbi_5_door_23") add_door_to_system(fbi_5_door[23], V_ILEV_BL_DOOR_R, <<3586.28, 3699.45, 28.97>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[23], -1.1, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[23], DOORSTATE_force_locked_this_frame, false, true) //first floor - left door leading to wharehouse (left door as a linear walk through) fbi_5_door[24] = get_hash_key("fbi_5_door_24") add_door_to_system(fbi_5_door[24], V_ILEV_BL_DOOR_R, <<3601.99, 3717.88, 29.83>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[24], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[24], DOORSTATE_force_locked_this_frame, false, true) //first floor - right door leading to wharehouse (right door as a linear walk through) fbi_5_door[25] = get_hash_key("fbi_5_door_25") add_door_to_system(fbi_5_door[25], V_ILEV_BL_DOOR_L, <<3599.86, 3719.37, 29.83>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[25], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[25], DOORSTATE_force_locked_this_frame, false, true) //first floor - side door in monkey area fbi_5_door[26] = get_hash_key("fbi_5_door_26") add_door_to_system(fbi_5_door[26], V_ILEV_BL_DOOR_R, <<3594.63, 3704.90, 29.83>>) DOOR_SYSTEM_SET_OPEN_RATIO(fbi_5_door[26], 0.0, false, false) DOOR_SYSTEM_SET_DOOR_STATE(fbi_5_door[26], DOORSTATE_force_locked_this_frame, false, true) endproc proc create_pickups() fbi1_pickup[0] = CREATE_PICKUP_ROTATE(PICKUP_HEALTH_STANDARD, <<3595.4709, 3728.9470, 30.2494>>, <<0.0000, 0.0000, 55.6000>>, 0) ADD_PICKUP_TO_INTERIOR_ROOM_BY_NAME(fbi1_pickup[0], "Lab_an2_storage") fbi1_pickup[1] = CREATE_PICKUP_ROTATE(PICKUP_HEALTH_STANDARD, <<3609.9334, 3725.5168, 30.1894>>, <<0,0,145>>, 0) ADD_PICKUP_TO_INTERIOR_ROOM_BY_NAME(fbi1_pickup[1], "Lab_loadingbay") fbi1_pickup[2] = CREATE_PICKUP_ROTATE(PICKUP_HEALTH_STANDARD, <<3585.431, 3680.366, 27.622>>, <<0,0,148>>, 0) ADD_PICKUP_TO_INTERIOR_ROOM_BY_NAME(fbi1_pickup[2], "Lab_hallway2") ENDPROC PROC MISSION_SETUP() SET_INTERIOR_CAPPED(INTERIOR_V_LAB, FALSE) SET_BUILDING_STATE(BUILDINGNAME_IPL_FIB5_UNDERWATER_GRATE, BUILDINGSTATE_DESTROYED) SUPPRESS_RESTRICTED_AREA_WANTED_LEVEL(AC_BIOTECH, TRUE) SET_SHOP_IS_TEMPORARILY_UNAVAILABLE(CARMOD_SHOP_01_AP, true) SET_SHOP_IS_TEMPORARILY_UNAVAILABLE(CARMOD_SHOP_05_ID2, true) SET_SHOP_IS_TEMPORARILY_UNAVAILABLE(CARMOD_SHOP_06_BT1, true) SET_SHOP_IS_TEMPORARILY_UNAVAILABLE(CARMOD_SHOP_07_CS1, true) SET_SHOP_IS_TEMPORARILY_UNAVAILABLE(CARMOD_SHOP_08_CS6, true) SET_SHOP_IS_TEMPORARILY_UNAVAILABLE(CARMOD_SHOP_SUPERMOD, true) SUPPRESS_EMERGENCY_CALLS() DISABLE_TAXI_HAILING(true) SET_PLAYER_PED_DATA_IN_CUTSCENES(false) // Custom controls for PC mouse and keyboard INIT_PC_SCRIPTED_CONTROLS("FBI5A_Cutting_Torch") //INFORM_MISSION_STATS_OF_MISSION_START_FBI_FIVE(FALSE) ALLOW_DIALOGUE_IN_WATER(TRUE) add_relationship_groups() group_player_and_buddies = GET_PLAYER_GROUP(PLAYER_ID()) SET_GROUP_SEPARATION_RANGE(group_player_and_buddies, 50.0) //SET_GROUP_FORMATION(group_player_and_buddies, FORMATION_LOOSE) //SET_GROUP_FORMATION_SPACING(group_player_and_buddies, 5.0) //SET_CLOCK_TIME(9, 0, 0) SET_VEHICLE_POPULATION_BUDGET(0)//1 set_ped_population_budget(1)//1 IF IS_PLAYER_PLAYING(PLAYER_ID()) clear_player_wanted_level(player_id()) set_current_ped_weapon(player_ped_id(), weapontype_unarmed, true) ENDIF //dock area at start of mission. add_scenario_blocking_area(<<3773.4, 4393.7, 50.00>>, <<3891.2, 4555.1, -50.00>>) add_scenario_blocking_area(<<3699.4, 3885.9, 100.00>>, <<3313.5, 3602.2, -100.00>>) set_ped_paths_in_area(<<3699.4, 3885.9, 100.00>>, <<3313.5, 3602.2, -100.00>>, false) //blocks fish from spawning near the welding gate SET_PED_NON_CREATION_AREA(<<3837.9, 3651.6, -18.8>>, <<3833.5, 3686.9, -15.00>>) //airport add_scenario_blocking_area(<<1589.00, 3390.00, 39.000>>, <<1849, 3210.0, 52.000>>) //area outside the ranch - stops scenario vehicles driving out. add_scenario_blocking_area(<<1540.0, 1244.0, 150.00>>, <<1275.8, 1061, 0.0>>) SET_SCENARIO_GROUP_ENABLED("ALAMO_PLANES", false) set_scenario_group_enabled("LOST_BIKERS", false) // Inside left shutter door DOOR_SYSTEM_SET_OPEN_RATIO(ENUM_TO_INT(DOORHASH_CHEMICAL_FACTORY_L), 1.0, false, false) //1.0 DOOR_SYSTEM_SET_DOOR_STATE(ENUM_TO_INT(DOORHASH_CHEMICAL_FACTORY_L), DOORSTATE_force_locked_this_frame, false, true) // Inside right shutter door DOOR_SYSTEM_SET_OPEN_RATIO(ENUM_TO_INT(DOORHASH_CHEMICAL_FACTORY_R), 1.0, false, false) //1.0 DOOR_SYSTEM_SET_DOOR_STATE(ENUM_TO_INT(DOORHASH_CHEMICAL_FACTORY_R), DOORSTATE_force_locked_this_frame, false, true) CLEAR_HELP() CLEAR_PRINTS() REGISTER_SCRIPT_WITH_AUDIO() OVERRIDE_UNDERWATER_STREAM("FBI_05_UNDERWATER_MASTER", TRUE) REQUEST_ADDITIONAL_TEXT("H2PART3", MISSION_TEXT_SLOT) REQUEST_ADDITIONAL_TEXT("fbi5aAU", MISSION_DIALOGUE_TEXT_SLOT) WHILE NOT HAS_ADDITIONAL_TEXT_LOADED(MISSION_TEXT_SLOT) OR NOT HAS_ADDITIONAL_TEXT_LOADED(MISSION_DIALOGUE_TEXT_SLOT) WAIT(0) ENDWHILE INT i for i = 0 to count_of(s_fans) - 1 s_fans[i].soundid = GET_SOUND_ID() endfor #IF IS_DEBUG_BUILD SETUP_SPLINE_CAM_NODE_ARRAY_MIKE_TO_TREV_AND_PAT_INTRO(scsSwitchCamMikeToTrevPatricia_Intro, MichaelPed) SETUP_SPLINE_CAM_NODE_ARRAY_MIKE_TO_TREV_AND_PAT_OUTRO(scsSwitchCamMikeToTrevPatricia_Outro, trevors_truck.veh) SETUP_SPLINE_CAM_NODE_ARRAY_TREVOR_IN_HELI(scsSwitchCamToTrevorInHeli, MichaelPed, helicopter.veh) CREATE_WIDGETS() #ENDIF initialise_mission_variables() initialise_mission_doors() setup_cover_points() create_pickups() //area near scientist 4 lab - right corner ADD_COVER_BLOCKING_AREA(<<3556.92896, 3668.02612, 30.12188>>, <<3558.23486, 3666.84082, 26.5>>, false, false, false, true) //double door near security guards 0 and 1 ADD_COVER_BLOCKING_AREA(<<3566.59, 3685.24, 30.00>>, <<3569.2, 3681.5, 26.5>>, false, false, false, true) IF (Is_Replay_In_Progress()) replay_active = true if not g_bShitskipAccepted SWITCH Get_Replay_Mid_Mission_Stage() CASE 0 load_replay_skip_0() //fail between start of mission and before swimming through tunnel = start of mission BREAK CASE 1 load_replay_skip_1() //fail between swimming through tunnel and before get to lift = swimming through tunnel BREAK CASE 2 load_replay_skip_2() //fail between get to lift and collecting chemicals = get to lift BREAK case 3 load_replay_skip_3() //fail between collecting chemicals and before loading foklift = start of shootout break case 4 load_replay_skip_4() //fail between loading chemicals into truck and flying helicopter = load chemicals into container break case 5 load_replay_skip_5() //failing between flying the helicopter and the end of the mission = flying the helicopter break case 6 load_replay_skip_6() //failing between flying to the airport and end of the mission. = flying to the airport from the chemical factory break case 7 load_replay_skip_7() //failing between driving to madrazoos house and end of mission. = driving to madrazzos house break ENDSWITCH else int shit_skip_status shit_skip_status = Get_Replay_Mid_Mission_Stage() + 1 switch shit_skip_status case 1 load_replay_skip_1() break case 2 load_replay_skip_2() break case 3 load_replay_skip_3() break case 4 load_replay_skip_4() break case 5 load_replay_skip_5() break case 6 load_replay_skip_6() break case 7 load_replay_skip_7() break case 8 load_replay_skip_8() break endswitch endif replay_active = false ELSE //only reset variables if playing through the mission from start. fbi5a_scientist_4_alive = true fbi5a_scientist_5_alive = true if not is_repeat_play_active() if not is_screen_faded_in() if not is_screen_fading_in() do_screen_fade_in(default_fade_time) endif endif SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(0, "start of mission") else load_repeat_play_assets() endif ENDIF //SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(1, "swim through tunnel") //SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(2, "get to lift") //SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(3, "shootout") //SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(4, "load container") //SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(5, "land crate with helicopter") //SET_REPLAY_MID_MISSION_STAGE_WITH_NAME(6, "fly to airport") // //remove once all trip skips implemented into mission // IF (Is_Replay_In_Progress()) // //Mission is being replayed // INT i_stage = Get_Replay_Mid_Mission_Stage() // // //Use i_stage to restart mission at the correct stage // IF i_stage = CHECKPOINT_START // //SKIP_TO_STAGE(STAGE_GO_TO_PIPE) // ELIF i_stage = CHECKPOINT_INTERIOR_START // //SKIP_TO_STAGE(STAGE_GET_TO_LIFT) // ELIF i_stage = CHECKPOINT_CHEMICALS // //SKIP_TO_STAGE(STAGE_LOAD_FRIDGE) // ELIF i_stage = CHECKPOINT_FLY_HELI // SKIP_TO_STAGE(STAGE_LAND_CRATE) // ENDIF // ELSE // // Your mission is being played normally, not being replayed // Set_Replay_Mid_Mission_Stage(CHECKPOINT_START) // ENDIF ENDPROC proc load_stage_selector_assets() #IF IS_DEBUG_BUILD initialise_mission_variables() wait(0)//fix to allow the doors to be removed and added via the z skip as removing and adding in one frame will not allow th doors to be added initialise_mission_doors() switch launch_mission_stage_menu_status case 0 load_replay_skip_0() break case 1 load_replay_skip_1() //change to cut pipe break case 2 load_replay_skip_1() break case 3 load_replay_skip_2() break case 4 load_replay_skip_3()//change to get chemicals break case 5 load_replay_skip_3() break case 6 load_replay_skip_4() break case 7 load_replay_skip_5() break case 8 load_replay_skip_6() break case 9 load_replay_skip_7() break case 10 load_replay_skip_8() break endswitch #endif endproc proc skip_system() #IF IS_DEBUG_BUILD if is_keyboard_key_just_pressed(key_p) switch e_mission_stage case STAGE_GO_TO_PIPE break endswitch endif // menu_stage_selector = menu_stage_selector // menu_return_stage = menu_return_stage if LAUNCH_MISSION_STAGE_MENU(menu_stage_selector, menu_return_stage) remove_all_mission_assets() launch_mission_stage_menu_status = menu_return_stage e_mission_stage = stage_load_stage_selector_assets do_screen_fade_out(1000) endif #endif endproc proc helicopter_and_crate_recording_system() #IF IS_DEBUG_BUILD disable_helicopter_flying_controls() if does_entity_exist(crate.obj) activate_physics(crate.obj) endif if not widget_reset_recording if does_entity_exist(helicopter.veh) and not is_entity_dead(truck.veh) and not is_entity_dead(trailer.veh) and not is_entity_dead(crate_veh.veh) if crate_land_cutscene() crate_land_cutscene_status = 0 widget_reset_recording = true endif // helicopter_hover_system() // // set_entity_coords_no_offset(temp_vehicle, get_entity_coords(crate.obj)) // set_entity_rotation(temp_vehicle, get_entity_rotation(crate.obj)) // // if not is_recording_going_on_for_vehicle(truck.veh) // and not is_recording_going_on_for_vehicle(trailer.veh) // and not is_recording_going_on_for_vehicle(temp_vehicle) // // if is_control_pressed(player_control, input_veh_accelerate) // // STABILISE_ENTITY_ATTACHED_TO_HELI(helicopter.veh, null, 0.0) // int i // for i = 0 to count_of(rope_chopper) - 1 // DETACH_ROPE_FROM_ENTITY(rope_chopper[i], helicopter.veh) // DETACH_ROPE_FROM_ENTITY(rope_chopper[i], crate.obj) // delete_rope(rope_chopper[i]) // endfor // // if START_RECORDING_VEHICLE(truck.veh, 10, "lkfbi5a", true) // and START_RECORDING_VEHICLE(trailer.veh, 11, "lkfbi5a", true) // and START_RECORDING_VEHICLE(temp_vehicle, 12, "lkfbi5a", true) // // //freeze_entity_position(helicopter.veh, false) // // print_now("fbi5a_god_25", default_god_text_time, 1) // // endif // // endif // // else // // if is_control_pressed(player_control, input_jump) // // print_now("fbi5a_god_26", default_god_text_time, 1) // // stop_recording_all_vehicles() // // widget_reset_recording = true // // endif // // endif endif else request_model(truck.model) request_model(trailer.model) request_model(helicopter.model) request_model(crate.model) request_vehicle_recording(truck.recording_number, "lkfbi5a") request_vehicle_recording(trailer.recording_number, "lkfbi5a") request_vehicle_recording(crate_veh.recording_number, "lkfbi5a") while not has_model_loaded(truck.model) or not has_model_loaded(trailer.model) or not has_model_loaded(helicopter.model) or not has_model_loaded(crate.model) or not has_vehicle_recording_been_loaded(truck.recording_number, "lkfbi5a") or not has_vehicle_recording_been_loaded(trailer.recording_number, "lkfbi5a") or not has_vehicle_recording_been_loaded(crate_veh.recording_number, "lkfbi5a") wait(0) endwhile if is_vehicle_driveable(helicopter.veh) if is_recording_going_on_for_vehicle(helicopter.veh) stop_recording_vehicle(helicopter.veh) endif endif clear_ped_tasks_immediately(player_ped_id()) DELETE_VEHICLE(truck.veh) DELETE_VEHICLE(trailer.veh) DELETE_VEHICLE(helicopter.veh) DELETE_VEHICLE(crate_veh.veh) DELETE_object(crate.obj) DELETE_object(crate_door_left.obj) DELETE_object(crate_door_right.obj) DELETE_BIOTECH_ROPES(rope_chopper, b_ropes_created, b_ropes_attached) truck.veh = create_vehicle(truck.model, truck.pos, truck.heading) set_vehicle_strong(truck.veh, true) SET_VEHICLE_HAS_STRONG_AXLES(truck.veh, true) SET_VEHICLE_ENGINE_ON(truck.veh, TRUE, TRUE) set_vehicle_tyres_can_burst(truck.veh, false) set_vehicle_colours(truck.veh, 0, 0) set_entity_health(truck.veh, 1500) set_vehicle_engine_health(truck.veh, 1500) set_vehicle_petrol_tank_health(truck.veh, 1500) trailer.veh = create_vehicle(trailer.model, trailer.pos, trailer.heading) set_vehicle_tyres_can_burst(trailer.veh, false) attach_vehicle_to_trailer(truck.veh, trailer.veh) //DISABLE_TRAILER_BREAKING_FROM_VEHICLE(trailer.veh, true) //helicopter.veh = CREATE_VEHICLE(helicopter.model, <<1760.6750, 3260.4841, 55.4332>>, 20.0331) helicopter.veh = CREATE_VEHICLE(helicopter.model, get_offset_from_entity_in_world_coords(trailer.veh, <<0.0, -2.5, 15.00>>)) SET_VEHICLE_AS_RESTRICTED(helicopter.veh, 0) set_entity_heading(helicopter.veh, get_entity_heading(trailer.veh)) SET_VEHICLE_ENGINE_CAN_DEGRADE(helicopter.veh, false) SET_MODEL_AS_NO_LONGER_NEEDED(helicopter.model) SET_VEHICLE_ENGINE_ON(helicopter.veh, TRUE, TRUE) SET_HELI_BLADES_FULL_SPEED(helicopter.veh) SET_VEH_RADIO_STATION(helicopter.veh, "OFF") REMOVE_PICK_UP_ROPE_FOR_CARGOBOB(helicopter.veh) //freeze_entity_position(helicopter.veh, true) crate.obj = CREATE_OBJECT_no_offset(crate.model, get_offset_from_entity_in_world_coords(helicopter.veh, v_container_offset))//<<3633.9233, 3766.1704, 32.3>>) set_entity_heading(crate.obj, (get_entity_heading(trailer.veh) + 180.00)) SET_OBJECT_TAKES_DAMAGE_FROM_COLLIDING_WITH_BUILDINGS(crate.obj) SET_ENTITY_PROOFS(crate.obj, TRUE, TRUE, TRUE, TRUE, TRUE) crate_door_left.obj = create_object(crate_door_left.model, crate_door_left.pos) ATTACH_ENTITY_TO_ENTITY(crate_door_left.obj, crate.obj, 0, <<-1.3, -1.8, 0.00>>, <<0,0,0>>, FALSE, FALSE, TRUE) crate_door_right.obj = create_object(crate_door_right.model, crate_door_right.pos) ATTACH_ENTITY_TO_ENTITY(crate_door_right.obj, crate.obj, 0, <<1.3, -1.8, 0.00>>, <<0,0,0>>, FALSE, FALSE, TRUE) ATTACH_CHOPPER_TO_CONTAINER_WITH_ROPE(helicopter.veh, crate.obj, rope_chopper, b_ropes_created, b_ropes_attached, FALSE, false) STABILISE_ENTITY_ATTACHED_TO_HELI(helicopter.veh, crate.obj, f_container_offset_z) crate_veh.veh = create_vehicle(crate_veh.model, <<1778.1, 3285.2, 50.1>>, 0.0) set_entity_collision(crate_veh.veh, false) set_entity_visible(crate_veh.veh, false) set_ped_into_vehicle(player_ped_id(), helicopter.veh) widget_reset_recording = false endif #endif endproc proc stat_system() inform_mission_stats_of_damage_watch_entity(player_ped_id(), fbi5_damage) if is_ped_sitting_in_any_vehicle(player_ped_id()) inform_mission_stats_of_damage_watch_entity(get_vehicle_ped_is_in(player_ped_id()), fbi5_car_damage) inform_mission_stats_of_speed_watch_entity(get_vehicle_ped_is_in(player_ped_id())) else inform_mission_stats_of_damage_watch_entity(null, fbi5_car_damage) inform_mission_stats_of_speed_watch_entity(null) endif endproc #IF IS_DEBUG_BUILD PROC HANDLE_SWITCH_CAM_SPECIFIC_WIDGETS() IF bDEBUG_WarpToMikeToTrevAndPatSwitch e_section_stage = SECTION_STAGE_SETUP e_mission_stage = stage_airport_mocap // SKIP_TO_STAGE(stage_drop_off_patricia) bDEBUG_WarpToMikeToTrevAndPatSwitch = FALSE ENDIF ENDPROC #ENDIF //object_index crate_2 SCRIPT SET_MISSION_FLAG(TRUE) IF HAS_FORCE_CLEANUP_OCCURRED() Store_Fail_Weapon(player_ped_id(), enum_to_int(get_current_player_ped_enum())) Mission_Flow_Mission_Force_Cleanup() MISSION_CLEANUP() ENDIF MISSION_SETUP() WHILE (TRUE) WAIT(0) if not stop_mission_fail_checks if mission_fail_checks() setup_mission_fail() endif endif skip_system() stat_system() REPLAY_CHECK_FOR_EVENT_THIS_FRAME("M_MonkeyBusiness") #IF IS_DEBUG_BUILD // UPDATE_SPLINE_CAM_WIDGETS(scsSwitchCamToTrevorInHeli) // UPDATE_SPLINE_CAM_WIDGETS(scsSwitchCamMikeToTrevPatricia_Intro) // UPDATE_SPLINE_CAM_WIDGETS(scsSwitchCamMikeToTrevPatricia_Outro) // HANDLE_SWITCH_CAM_SPECIFIC_WIDGETS() #ENDIF MANAGE_UNDERWATER_AUDIO() // SET_DOOR_STATE(DOORNAME_CHEMICAL_FACTORY_L, DOORSTATE_FORCE_OPEN_THIS_FRAME) // SET_DOOR_STATE(DOORNAME_CHEMICAL_FACTORY_R, DOORSTATE_FORCE_OPEN_THIS_FRAME) SWITCH e_mission_stage CASE STAGE_OPENING_CUTSCENE OPENING_CUTSCENE() BREAK CASE STAGE_GO_TO_PIPE GO_TO_PIPE() BREAK CASE STAGE_DIVE_OUT_CUTSCENE DIVE_OUT_CUTSCENE() BREAK CASE STAGE_SWIM_TO_PIPE SWIM_TO_PIPE() BREAK CASE STAGE_PIPE_PREPARE_CUTSCENE PIPE_PREPARE_CUTSCENE_V2() //-- USe V2 version to use the Move-network stuff, where the ped's arm follows the stick movement //-- ALso nned to call MANAGE_GRID_WELDING_V2 in CUT_PIPE() //PIPE_PREPARE_CUTSCENE() BREAK CASE STAGE_CUT_PIPE CUT_PIPE() BREAK CASE STAGE_PIPE_LEAVE_CUTSCENE PIPE_LEAVE_CUTSCENE() BREAK CASE STAGE_SWIM_INTO_LAB SWIM_TO_LAB() BREAK case stage_get_out_of_water_mocap get_out_of_water_mocap() break CASE STAGE_GET_TO_LIFT GET_TO_LIFT() BREAK CASE STAGE_LIFT_CUTSCENE LIFT_CUTSCENE() BREAK CASE STAGE_FIND_CHEMICALS FIND_CHEMICALS() BREAK case stage_chemicals_cutscene chemicals_cutscene() break case stage_shootout shootout() break case STAGE_LOAD_FRIDGE LOAD_FRIDGE() break CASE STAGE_GET_FORKLIFT //GET_FORKLIFT() BREAK CASE STAGE_LOAD_FORKLIFT //LOAD_FORKLIFT() BREAK CASE STAGE_HOTSWAP_TO_CHOPPER HOTSWAP_TO_CHOPPER() BREAK CASE stage_collect_crate collect_crate() BREAK case stage_collect_crate_mocap collect_crate_mocap() break case stage_fly_to_airport fly_to_airport() break case stage_airport_mocap airport_mocap() break case stage_switch_to_trevor switch_to_trevor() break case stage_drop_off_patricia drop_off_patricia() break CASE STAGE_HOTSWAP_TO_FORKLIFT HOTSWAP_TO_FORKLIFT() BREAK CASE STAGE_LOAD_CONTAINER_INTO_CRATE LOAD_CONTAINER_INTO_CRATE() BREAK CASE STAGE_REVERSE_OUT_CRATE REVERSE_OUT_CRATE() BREAK case stage_fuel_gun_fail fuel_gun_fail_cutscene() break case stage_underwater_fail underwater_fail_cutscene() break case stage_shootout_fail shootout_fail() break case stage_helicopter_fail helicopter_fail() break case stage_load_stage_selector_assets load_stage_selector_assets() break case stage_helicopter_recording_system helicopter_and_crate_recording_system() break ENDSWITCH //b_is_skipping_in_progress is set to true in skip_to_stage IF b_is_skipping_in_progress MANAGE_SKIP() ENDIF #IF IS_DEBUG_BUILD widget_main_mission_flow_status = enum_to_int(e_mission_stage) // if is_ped_sitting_in_any_vehicle(player_ped_id()) // // if get_cam_view_mode_for_context(cam_view_mode_context_on_foot) = cam_view_mode_first_person // printstring("on foot first person camera") // printnl() // endif // // if get_cam_view_mode_for_context(cam_view_mode_context_in_vehicle) = cam_view_mode_first_person // printstring("in vehicle first person camera") // printnl() // endif // endif // if does_entity_exist(boat.veh) // if widget_reset_cutscene // // set_vehicle_extra(boat.veh, 3, true) // printstring("vehicle extra 3 OFF") // printnl() // // else // // set_vehicle_extra(boat.veh, 3, false) // // printstring("vehicle extra 3 ON") // printnl() // // endif // endif //is_entity_in_angled_area(player_ped_id(), <<3545.197, 3646.541, 27.128>>, <<3550.121, 3645.673, 30.228>>, 5.8) //trace_native_command("ADD_DOOR_TO_SYSTEM") //BREAK_ON_NATIVE_COMMAND("ADD_DOOR_TO_SYSTEM", FALSE) //BREAK_ON_NATIVE_COMMAND("ADD_BLIP_FOR_ENTITY", false) DO_DEBUG() angled_area_locate_widget() camera_attached_to_vehicle_widget(boat.veh) if is_point_in_angled_area(scientist[1].pos, <<3542.130, 3675.186, 19.997>>, <<3539.177, 3675.717, 22.597>>, 4.0) endif IF IS_KEYBOARD_KEY_JUST_PRESSED(KEY_T) SET_PED_COMP_ITEM_CURRENT_SP(player_ped_id(), comp_type_outfit, OUTFIT_P0_SCUBA_WATER, false) endif IF IS_KEYBOARD_KEY_JUST_PRESSED(KEY_S) MISSION_PASSED() endif if not stop_mission_fail_checks if IS_KEYBOARD_KEY_JUST_PRESSED(KEY_F) setup_mission_fail() e_mission_stage = stage_shootout_fail //lots of different fails in misison_fail_checks specify here as it's not set in setup_mission_failed ENDIF endif pfx_widget() //int i // if IS_KEYBOARD_KEY_JUST_PRESSED(KEY_K) // for i = 0 to 15 // if not is_ped_injured(monkey[i].ped) // set_entity_health(monkey[i].ped, 2) // endif // endfor // endif // is_entity_in_angled_area(player_ped_id(), <<3537.418, 3648.729, 26.528>>, <<3536.256, 3642.130, 30.128>>, 18.000) // // is_entity_in_angled_area(player_ped_id(), <<3545.659, 3650.203, 27.127>>, <<3550.288, 3649.387, 30.127>>, 18.000) // // is_entity_in_angled_area(player_ped_id(), <<3543.768, 3640.804, 27.127>>, <<3544.861, 3647.008, 30.127>>, 10.7) // // is_entity_in_angled_area(player_ped_id(), <<3546.138, 3651.365, 27.121>>, <<3555.296, 3649.750, 30.121>>, 16.00) //angled_area_locate_widget_entity(forklift_truck.veh) //angled_area_locate_widget_entity(truck.veh) angled_area_locate_widget_entity(trailer.veh) //angled_area_locate_widget_entity(crate.obj) //draw_offset_marker_on_entity(crate.obj) //attach_object_to_ped_and_move(steve.ped, flare[3].obj) // if does_entity_exist(forklift_truck.veh) // and does_entity_exist(fridge_pallet.obj) // if IS_ENTITY_ATTACHED_TO_FORKLIFT_FORKS(forklift_truck.veh, fridge_pallet.obj) // printstring("ATTATCHED") // printnl() // else // printstring("NOT ATTACHED") // printnl() // endif // endif //attach_object_to_object_and_move(obj_welding_tool, temp_pool_ball) //attach_object_to_object_and_move(chemicals.obj, nerve_agent.obj) //attach_object_to_object_and_move(crate.obj, fridge_pallet.obj) //attach_object_to_object_and_move(truck.veh, crate.obj) // if does_entity_exist(trailer.veh) // if not does_entity_exist(crate_2) // // request_model(crate.model) // // if has_model_loaded(crate.model) // // freeze_entity_position(trailer.veh, true) // crate_2 = create_object(crate.model, get_offset_from_entity_in_world_coords(truck.veh, <<0.0, 0.0, 10.00>>)) // // endif // // else // // attach_object_to_object_and_move(trailer.veh, crate_2) // // endif // // endif // if not is_cutscene_active() // create_and_move_object(swag_bag.obj) // endif //create_and_move_object(elevator_display[0].obj) //create_and_move_object(security_card.obj) //create_and_move_object(fridge_pallet.obj) //create_and_move_object(flare[0].obj) //create_and_move_object(crate.obj) // if has_ptfx_asset_loaded() // if does_entity_exist(s_grill_parts[0].obj) // if not does_particle_fx_looped_exist(i_break_ptfx[0]) // i_break_ptfx[0] = START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_bio_grille_break", s_grill_parts[0].obj, <<0.0, 0.0, 0.0>>, <<0.0, 90.0, 0.00>>) // else // SET_PARTICLE_FX_LOOPED_OFFSETS(i_break_ptfx[0], widget_object_pos, <<0.0, 90.0, 0.0>>) // endif // endif // endif #ENDIF ENDWHILE MISSION_CLEANUP() ENDSCRIPT //sounds //- UW_Ambience //- UW_Rebreather //- Alarm//- Foot_Swish //- FBI_05_RAID_DROP_CONTAINER //- Fan //- Torch_Cut //- Torch //- Speech_Bubble //- Grate_Release //- Gasmask //buddy 0 // //cover_point[0] //cover_point[4] //cover_point[6] //cover_point[9] //cover_point[30] //cover_point[13] //cover_point[15] //cover_point[16] //cover_point[19] //cover_point[23] //cover_point[25] //cover_point[27] // // // // //buddy 1 // //cover_point[3] //cover_point[7] //cover_point[8] //cover_point[31] //cover_point[12] //cover_point[20] //cover_point[22] //cover_point[24] //cover_point[28] //DRAW_TIMER_HUD(current_fuel, max_fuel_limit, “Gas capacity”, INT FlashTime = 0, BOOL false) // //IF current fuel variable runs up then it’ll be, so you have full control of how it works. // //DRAW_TIMER_HUD((max_fuel_limit-current_fuel), max_fuel_limit, “Gas capacity”, INT FlashTime = 0, BOOL false) //233980 //207451 //ped_index camera_man_ped //ped_index microphone_man_ped //ped_index reporter_ped //object_index camera_obj //object_index microphone_obj //create_camera_crew(camera_man_ped, <<3825.4968, 4461.3213, 2.2849>>, 257.1678, camera_obj, microphone_man_ped, microphone_obj, reporter_ped) //give dave the sequence bellow //lemar 1 //IF HAS_ANIM_DICT_LOADED("misslamar1lam_1_ig_10") // AND IS_ENEMY_GROUP_DEAD(s_swat_indoor_window_2) // //s_lamar.v_dest = <<-562.07, -1620.54, 26.0110>> // s_lamar.v_dest = GET_ANIM_INITIAL_OFFSET_POSITION("misslamar1lam_1_ig_10", "lam_1_ig_10_lamar", <<-560.080, -1611.210, 26.002>>, <<0.000, 0.000, 85.000>>) // // WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT(str_waypoint_interior, s_lamar.v_dest, i_next_node) // // OPEN_SEQUENCE_TASK(seq) // TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(NULL, TRUE) // TASK_FOLLOW_WAYPOINT_RECORDING(NULL, str_waypoint_interior, 0, EWAYPOINT_START_FROM_CLOSEST_POINT, i_next_node - 2) // TASK_GO_TO_COORD_WHILE_AIMING_AT_COORD(NULL, s_lamar.v_dest, <<-560.4027, -1602.1191, 27.3222>>, PEDMOVE_RUN, FALSE, 0.1, 1.0) // TASK_AIM_GUN_AT_COORD(NULL, <<-560.4027, -1602.1191, 27.3222>>, -1) // CLOSE_SEQUENCE_TASK(seq) // TASK_PERFORM_SEQUENCE(s_lamar.ped, seq) // CLEAR_SEQUENCE_TASK(seq) // // s_lamar.i_timer = 0 // s_lamar.i_event++ // ENDIF // BREAK // // CASE 12 // REQUEST_ANIM_DICT("misslamar1lam_1_ig_10") // // IF VDIST2(v_lamar_pos, s_lamar.v_dest) < 0.1 // AND HAS_ANIM_DICT_LOADED("misslamar1lam_1_ig_10") // s_lamar.v_dest = <<-560.3149, -1611.9880, 26.0110>> // SET_UP_PERSONAL_COVER_POINT_AND_SPHERE(s_lamar.ped, s_lamar.cover, s_lamar.v_dest, 353.8994, 1.0, COVUSE_WALLTORIGHT, COVHEIGHT_LOW, COVARC_180) // // s_lamar.i_sync_scene = CREATE_SYNCHRONIZED_SCENE(<<-560.080, -1611.210, 26.002>>, <<0.000, 0.000, 85.000>>) // TASK_SYNCHRONIZED_SCENE(s_lamar.ped, s_lamar.i_sync_scene, "misslamar1lam_1_ig_10", "lam_1_ig_10_lamar", NORMAL_BLEND_IN, WALK_BLEND_OUT, // SYNCED_SCENE_USE_PHYSICS, RBF_NONE, NORMAL_BLEND_IN) // //FORCE_PED_AI_AND_ANIMATION_UPDATE(s_lamar.ped) // SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(s_lamar.ped, TRUE) // // s_lamar.i_timer = 0 // s_lamar.i_event++ // ENDIF // BREAK /// PURPOSE: ///// Performs the transition from a synced scene back to AI, and handles any issues with the ped getting stuck. //PROC UPDATE_MOCAP_TO_AI_TRANSITION(PED_INDEX &ped, INT &i_synced_scene, INT &i_timer, VECTOR v_destination, TASK_TO_PERFORM_AFTER_MOCAP e_post_mocap_task, VECTOR v_aim_pos, // FLOAT f_phase_to_switch = 0.99, BOOL b_force_cover_direction = FALSE, BOOL b_cover_direction_is_left = FALSE) // IF NOT IS_PED_INJURED(ped) // SEQUENCE_INDEX seq // // IF IS_SYNCHRONIZED_SCENE_RUNNING(i_synced_scene) // //Once the scene ends get the ped into whatever task they need to do // IF GET_SYNCHRONIZED_SCENE_PHASE(i_synced_scene) > f_phase_to_switch // STOP_SYNCHRONIZED_ENTITY_ANIM(ped, NORMAL_BLEND_OUT, TRUE) // i_synced_scene = -1 // // IF e_post_mocap_task = POST_MOCAP_COVER // TASK_PUT_PED_DIRECTLY_INTO_COVER(ped, v_destination, -1, FALSE, 0.0, b_force_cover_direction, b_cover_direction_is_left) // SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, TRUE) // ELIF e_post_mocap_task = POST_MOCAP_COVER_THEN_COMBAT // OPEN_SEQUENCE_TASK(seq) // TASK_PUT_PED_DIRECTLY_INTO_COVER(NULL, v_destination, 1000, FALSE, 0.0, b_force_cover_direction, b_cover_direction_is_left) // //TASK_SEEK_COVER_TO_COORDS(NULL, v_destination, v_aim_pos, 1000) // TASK_COMBAT_HATED_TARGETS_AROUND_PED(NULL, 50.0) // TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(NULL, FALSE) // CLOSE_SEQUENCE_TASK(seq) // TASK_PERFORM_SEQUENCE(ped, seq) // CLEAR_SEQUENCE_TASK(seq) // ELIF e_post_mocap_task = POST_MOCAP_COMBAT // TASK_COMBAT_HATED_TARGETS_AROUND_PED(ped, 50.0) // SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, FALSE) // ELIF e_post_mocap_task = POST_MOCAP_AIM_AT_COORDS // TASK_AIM_GUN_AT_COORD(ped, v_aim_pos, -1, TRUE) // SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, TRUE) // ENDIF // // i_timer = GET_GAME_TIMER() // ENDIF // ELSE // //If something went wrong sort it out // IF e_post_mocap_task = POST_MOCAP_COVER // // ELIF e_post_mocap_task = POST_MOCAP_COVER_THEN_COMBAT // IF GET_GAME_TIMER() - i_timer > 1500 // IF GET_SCRIPT_TASK_STATUS(ped, SCRIPT_TASK_COMBAT_HATED_TARGETS_AROUND_PED) != PERFORMING_TASK // TASK_COMBAT_HATED_TARGETS_AROUND_PED(ped, 50.0) // SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, FALSE) // ENDIF // ENDIF // ELIF e_post_mocap_task = POST_MOCAP_COMBAT // // ELIF e_post_mocap_task = POST_MOCAP_AIM_AT_COORDS // // ENDIF // ENDIF // ENDIF //ENDPROC // ///// PURPOSE: ///// Checks if a ped is in the correct position to play the given seamless mocap anim. //FUNC BOOL IS_PED_SAFE_TO_PLAY_SEAMLESS_ANIM(PED_INDEX ped, VECTOR v_desired_pos, FLOAT f_desired_heading, // FLOAT f_position_tolerance, FLOAT f_heading_tolerance, BOOL b_needs_to_be_aiming = FALSE, BOOL b_needs_to_be_in_cover = FALSE) // IF NOT IS_PED_INJURED(ped) // VECTOR v_pos = GET_ENTITY_COORDS(ped) // // IF VDIST(v_pos, v_desired_pos) < f_position_tolerance // FLOAT f_heading = GET_ENTITY_HEADING(ped) // FLOAT f_heading_diff = ABSF(f_heading - f_desired_heading) // // IF f_heading_diff > 180.0 // f_heading_diff = ABSF(f_heading_diff - 360.0) // ENDIF // // IF f_heading_diff < f_heading_tolerance // IF b_needs_to_be_aiming // IF IS_PED_SHOOTING(ped) // RETURN TRUE // ENDIF // ELIF b_needs_to_be_in_cover // IF IS_PED_IN_COVER(ped, TRUE) // RETURN TRUE // ENDIF // ELSE // RETURN TRUE // ENDIF // ENDIF // ENDIF // ENDIF // // RETURN FALSE //ENDFUNC //PROC SEQ_GO_TO_COVER_WHILE_AIMING_THEN_COMBAT(PED_INDEX ped, VECTOR v_destination, FLOAT move_state, INT i_time_spent_in_cover, BOOL b_shoot, VECTOR v_aim_pos, // FLOAT f_target_distance = 0.5, FLOAT f_slow_distance = 4.0, BOOL b_use_navmesh = TRUE, ENTITY_INDEX entity_aim = NULL) // IF NOT IS_PED_INJURED(ped) // SEQUENCE_INDEX seq // // OPEN_SEQUENCE_TASK(seq) // TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(NULL, TRUE) // IF IS_ENTITY_DEAD(entity_aim) // TASK_GO_TO_COORD_WHILE_AIMING_AT_COORD(NULL, v_destination, v_aim_pos, move_state, b_shoot, f_target_distance, f_slow_distance, b_use_navmesh) // TASK_SEEK_COVER_TO_COORDS(NULL, v_destination, v_aim_pos, i_time_spent_in_cover) // ELSE // TASK_GO_TO_COORD_WHILE_AIMING_AT_ENTITY(NULL, v_destination, entity_aim, move_state, b_shoot, f_target_distance, f_slow_distance, b_use_navmesh) // TASK_SEEK_COVER_TO_COORDS(NULL, v_destination, GET_ENTITY_COORDS(entity_aim), i_time_spent_in_cover) // ENDIF // // TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(NULL, FALSE) // TASK_COMBAT_HATED_TARGETS_AROUND_PED(NULL, 50.0) // CLOSE_SEQUENCE_TASK(seq) // // TASK_PERFORM_SEQUENCE(ped, seq) // CLEAR_SEQUENCE_TASK(seq) // ENDIF //ENDPROC //PLAYING A SYNCHED SCENE ANIM //Get the ped into cover via task_seek_cover_to_coords. Add your own cover points //Once the ped is in cover start the synched scene //When the synched scene is over put the ped directly into cover via TASK_PUT_PED_DIRECTLY_INTO_COVER //FAKE FIRE //set_ped_weapon_shooting //BUGS: ///307741 set_current_ped_weapon /// /// SET_ENABLE_SCUBA(PED_INDEX PedIndex, BOOL bEnable) //rupert 020 7751 2532 //--- ////when triggering a synchronized scene on 2 or more peds you must ensure that the AI system of the first ////ped called in the script engine is set as the Parent and every other AI system after that is a child ////e.g. // if has_anim_dict_loaded("missfbi5ig_21") // and PUT_PED_INTO_COVER_FOR_MOCAP(steve.ped, steve_time, steve.run_to_pos, 0.5, TRUE, true) // // // //PARENT // //Dave // if has_anim_dict_loaded("missfbi5ig_21") // and PUT_PED_INTO_COVER_FOR_MOCAP(dave.ped, dave_time, dave.run_to_pos, 0.5, TRUE, true) // and is_ped_in_cover(steve.ped) // and is_entity_at_coord(steve.ped, GET_ANIM_INITIAL_OFFSET_POSITION() // and PUT_PED_INTO_COVER_FOR_MOCAP(steve.ped, steve_time, steve.run_to_pos, 0.5, TRUE, true) // // //start synched scene // // endif // // // //CHILD // //steve // if has_anim_dict_loaded("missfbi5ig_21") // and PUT_PED_INTO_COVER_FOR_MOCAP(steve.ped, steve_time, steve.run_to_pos, 0.5, TRUE, true) // and (is_synchronized_scene_running(dave.scene_id) and get_synchronized_anims_playing()) // // //start synched scene // // endif // ATTACH_PALLET_TO_FORKLIFT_FORKS // IS_ENTITY_ATTACHED_TO_FORKLIFT_FORKS ////--- /// //interior bug - 536510 //"FAMILY_5_YOGA_CHIMPS" = sounds //"FAM5_YOGA_CHIMPS" = audio bank //PROC SET_PED_PREFERRED_COVER_POINT(PED_INDEX &ped, COVERPOINT_INDEX &cover) // IF NOT IS_PED_INJURED(ped) // ITEMSET_INDEX item_cover = CREATE_ITEMSET(TRUE) // ADD_TO_ITEMSET(cover, item_cover) // // SET_PED_PREFERRED_COVER_SET(ped, item_cover) // DESTROY_ITEMSET(item_cover) // ENDIF //ENDPROC // ///// PURPOSE: ///// General function to set up a ped's personal cover point and defensive sphere. //PROC SET_PED_COVER_POINT_AND_SPHERE(PED_INDEX ped, COVERPOINT_INDEX &cover, VECTOR v_pos, FLOAT f_heading, FLOAT f_sphere_radius, // COVERPOINT_USAGE cov_usage, COVERPOINT_HEIGHT cov_height, COVERPOINT_ARC cov_arc) // IF NOT IS_PED_INJURED(ped) // IF cover != NULL // REMOVE_COVER_POINT(cover) // ENDIF // cover = ADD_COVER_POINT(v_pos, f_heading, cov_usage, cov_height, cov_arc) // SET_PED_SPHERE_DEFENSIVE_AREA(ped, v_pos, f_sphere_radius) // ENDIF //ENDPROC //PRF_UseKinematicPhysics //stops ped from moving //SET_PED_RESET_FLAG //CA_MOVE_TO_LOCATION_BEFORE_COVER_SEARCH //SET_VEHICLE_OUT_OF_CONTROL //556202 - can_music_event //IS_MUSIC_ONESHOT_PLAYING() //audio bug - Alarm //new audio 566834 //enemy peds staying in cover for to long during combat - 734775 //SET_PED_CONFIG_FLAG(PedIndex, PCF_DisableHurt, TRUE) //move gate arround phase 0.29 //WALL BUG = 826112 //ROPES bug = 857115 //dave not reacting with door 872548 //926802 - steve not kick door. //894935 - invisible ped //840005 - mask bug //916547 - peds standing on top of water. //916550 - action mode //mode The new commands are REQUEST_ACTION_MODE_ASSET HAS_ACTION_MODE_ASSET_LOADED REMOVE_ACTION_MODE_ASSET For //Michael, the action mode asset is MICHAEL_ACTION And to force the ped into action mode, FORCE_PED_MOTION_STATE //With the MS_ACTION_MODE enum. You may or may not have to do an INSTANT AI and ANIM update, try it and see. //16425 //Register the door // //INT iFrontDoor = HASH("GIVE_THIS_A_UNIQUE_NAME") //ADD_DOOR_TO_SYSTEM(iFrontDoor, V_ILEV_MM_DOORM_L, vCoords) // // //Get/set door state // //DOOR_STATE_ENUM eDoorState = DOOR_SYSTEM_GET_DOOR_STATE(iFrontDoor) //DOOR_SYSTEM_SET_DOOR_STATE(iFrontDoor, DOORSTATE_LOCKED) // //FLOAT fDoorOpenRatio = DOOR_SYSTEM_GET_OPEN_RATIO(iFrontDoor) //DOOR_SYSTEM_SET_OPEN_RATIO(iFrontDoor, 0.5) //kevs message //DOORSTATE_FORCE_LOCKED_THIS_FRAME //DOOR_SYSTEM_SET_OPEN_RATIO(iGateHashR,0.0,false,false) //DOOR_SYSTEM_SET_DOOR_STATE(iGateHashR,DOORSTATE_FORCE_LOCKED_THIS_FRAME,false,true) //open doors and set them to 1.0 and -1.0 and allow then to reach targets rather than setting the unlocked to 0.0 //stops anims fucking up doors. //958406 //if player in angled area // if dave synshced scene running // if phase > 0.7 // task_player_to_follow_nav_mesh_to_coord to standing pos during cutscene and face heading. //1006049 - doors not settling. //1019613 - metal gate not falling //steve no gun = 1020777 //1055588 - cross blend on boat //new z skip - 1058384 //1088290 - ptfx not updating. //1136778 - peds not taking explosion damage. //985904 = buddies lift their weapons when near the player. //1177988 = HAS_ENTITY_BEEN_DAMAGED_BY_WEAPON(pedToTazer, WEAPONTYPE_STUNGUN) not working. //1153214 - dive out camera jerk. //bracnh anims for scientist - 541497 //stop dave and steve speaking - 1186578 //rough anim blend when ped is shot - 1196831 //get 4 corners of crate and check all 4 corners are inside the angled area of the truck //THOMAS RANDEL in leeds controls all the control action checks. //if is_point_in_angled_area(get_offset_from_entity_in_world_coords(crate.obj, // // allow them to detach the crate. // // set crate detached or check not is_entity_attached_to_entity(crate.obj, helicopter.veh) // // //endif // // //now land the helicopter and start the cutscene // // //fail checks for the helicopter land section // //if not is_entity_attached_to_entity(crate.obj, helicopter.veh) //or is_stage_int > 2 // // if pitch > x // or pitch < x // // return true // // endif // // if roll > x // or pitch < x // // return true // // endif // // if not is_crate_in_angled_area // // return true // // endif // //endif //1233218 - ropes not attatching to helicopter on a reaply //1268065 - buddies disappearing in tunnel. //1277182 - doors blocked. //1281871 - can't shoot monkey through cage. //1213868 = collision issue with monkies and cages //1284562 - steve missing weapon but playing anims. //1299220 - doors does not unlock //1299316 - fatal pt //1310219 - peds play scuba anims //SET_PLAYER_CAN_USE_VEHICLE_SEARCH_LIGHT //1314181 - set entity rotation not working. //1309644 - dave weapon bug where he hold it but it says he is un armed. //1321596 - gun pops in before dropping it //1367265 - cover blocking area for player //1375013 - steve swimming into gate. //cover point logic for ensuring the buddies always reaches the cover point if it is critical. //ADD_COVER_BLOCKING_AREA // //when the buddies synched scene phase > 0.99 // //add cover point //make sure add cover point is called before the task_ped_ped_directly_into_cover // //then once TRANSITION_FROM_MOCAP_TO_COVER will put the buddy into cover //code have a check which stops the player taking cover if a buddy on top of a cover point at a phase of 0.99 he will be //matthew freedman //matt tempest - in gmae boat anims.1274189 //1419884 - hauler truck to flat bed //1426616 - trvors truck stops on z skip //1430378 - //1450832 - variaiation not loading in for michael if cutscene skipped //G_M_Y_PoloGoon_01 //1504204 - steve haines pop up whilst blending from an aim task to a synced scene //1501053 - blend from sync scene to aim. //1557238 speaker number not playing //set_ped_comp_item_current_sp(player_ped_id(), COMP_TYPE_PROPS, PROPS_HEAD_NONE, false) // //set_ped_comp_item_current_sp(player_ped_id(), COMP_TYPE_PROPS, PROPS_EYES_NONE, false) // //set_ped_comp_item_current_sp(player_ped_id(), COMP_TYPE_PROPS, PROPS_EARS_NONE, false)