#include maps\_utility; #include maps\_vehicle; #include maps\_anim; #include maps\_hud_util; #include common_scripts\utility; main() { setDvarIfUninitialized( "cheap_spot", "1" ); initPrecache(); maps\dcburning_precache::main(); /*----------------------- LEVEL VARIABLES -------------------------*/ level.c4_models = []; level.chattertrigsinterior = getentarray( "interior_bcs", "targetname" ); level.chattertrigsexteriror = getentarray( "exterior_bcs", "targetname" ); array_thread( level.chattertrigsexteriror,::trigger_off ); array_thread( level.chattertrigsinterior,::trigger_off ); level.monument_target = getent( "monument_target", "targetname" ); level.sniperOrgs = getentarray( "humvee_spotlight_targets", "targetname" ); level.crowsArmor = []; level.snipeEnemies = 4; level.onHeli = false; level.CannonRange = 6000; level.CannonRangeSquared = level.CannonRange * level.CannonRange; //setsaveddvar( "thermalBlurFactorScope", 300 ); level.firemagicRPGs = true; level.squadsize = 3; level.mortarDamageRadius = 100; level.goodFriendlyDistanceFromPlayerSquared = 300 * 300; level.friendliesCanHelpCrowsnest = false; level.canTalk = true; level.evacSitePercentDestroyed = 0; level.targetsScriptedJavStinger = []; level.tempDialogueTime = 3; level.evacSiteEnemies = []; level.evacSiteVehicles = []; level.evacSiteEnemyVehicles = []; setDvarIfUninitialized( "bog_camerashake", "1" ); level.spawnerCallbackThread = ::AI_think; level.droneCallbackThread = ::AI_drone_think; level.stealthDistanceSquared = 512 * 512; setDvarIfUninitialized( "dc_debug", "0" ); setDvarIfUninitialized( "dc_dialog", "1" ); level.cosine[ "25" ] = cos( 25 ); level.cosine[ "35" ] = cos( 35 ); level.cosine[ "45" ] = cos( 45 ); level.cosine[ "60" ] = cos( 60 ); level.cosine[ "90" ] = cos( 90 ); level.cosine[ "180" ] = cos( 180 ); level.mortarWithinFOV = level.cosine[ "35" ]; trigs = getentarray( "trigger_multiple", "classname" ); level.aColornodeTriggers = []; foreach ( trigger in trigs ) { if ( ( isdefined( trigger.script_noteworthy ) ) && ( getsubstr( trigger.script_noteworthy, 0, 10 ) == "colornodes" ) ) level.aColornodeTriggers = array_add( level.aColornodeTriggers, trigger ); } //level.motiontrackergun_off = "masada_dcburn_mt_black_off"; //level.motiontrackergun_on = "masada_dcburn_mt_black_on"; disable_color_trigs(); /*----------------------- STARTS -------------------------*/ add_start( "debug", ::start_debug, "debug" ); add_start( "elevator_bottom", ::start_elevator_bottom, "elevator_bottom" ); add_start( "elevator_top", ::start_elevator_top, "elevator_top" ); add_start( "crows_nest", ::start_crows_nest, "crows_nest" ); add_start( "crows_nest_armor", ::start_crows_nest_armor, "crows_nest_armor" ); add_start( "barrett", ::start_barrett, "barrett" ); add_start( "to_roof", ::start_to_roof, "to_roof" ); add_start( "roof", ::start_roof, "roof" ); add_start( "heliride2", ::start_heli_ride2, "heliride2" ); add_start( "crash", ::start_crash, "crash" ); default_start( ::start_default ); /*----------------------- SUPPORT SCRIPTS -------------------------*/ maps\dc_crashsite::main(); maps\_breach_hinges_left::main(); maps\_breach::main(); maps\_drone_ai::init(); maps\createart\dcburning_fog::main(); maps\dcburning_fx::main(); maps\createfx\dcburning_audio::main(); maps\_minigun::main(); maps\_blackhawk_minigun::main( "vehicle_blackhawk_minigun_hero" ); maps\_hiding_door_anims::main(); maps\_c4::main(); maps\_load::main(); maps\_nightvision::main(); maps\_javelin::init(); maps\_stinger::init(); thread maps\dcburning_amb::main(); thread maps\_barrett::barrett_init(); maps\dcburning_anim::main(); thread maps\_mortar::bunker_style_mortar(); thread maps\_mortar::bog_style_mortar(); array_thread( getentarray( "animated_vehicle", "script_noteworthy" ),::vehicle_animated_think ); // --> moved to dc_crashsite.gsc ||||| array_thread( getvehiclenodearray( "plane_sound", "script_noteworthy" ), maps\_mig29::plane_sound_node ); array_thread( getvehiclenodearray( "plane_bomb", "script_noteworthy" ), maps\_mig29::plane_bomb_cluster ); /*----------------------- FLAGS -------------------------*/ //misc flag_init( "slamraam_c4_detonated" ); flag_init( "stop_elevator_doors" ); flag_init( "difficulty_initialized" ); flag_init( "can_talk" ); flag_set( "can_talk" ); maps\_compass::setupMiniMap("compass_map_dcburning"); //objectives flag_init( "obj_follow_sgt_macey_given" ); flag_init( "obj_follow_sgt_macey_complete" ); flag_init( "obj_commerce_given" ); flag_init( "obj_commerce_complete" ); flag_init( "obj_commerce_defend_snipe_given" ); flag_init( "obj_commerce_defend_snipe_complete" ); flag_init( "obj_commerce_defend_crow_given" ); flag_init( "obj_commerce_defend_crow_complete" ); flag_init( "obj_commerce_defend_javelin_given" ); flag_init( "obj_commerce_defend_javelin_complete" ); flag_init( "obj_rooftop_given" ); flag_init( "obj_rooftop_complete" ); flag_init( "obj_heli_mount_given" ); flag_init( "obj_heli_mount_complete" ); flag_init( "obj_heli_ride_given" ); //bunker flag_init( "bunker_door_closed" ); flag_init( "delete_bunker_mortars" ); //trenches flag_init( "seaknight_drones_loaded" ); flag_init( "seaknight_drones2_loaded" ); flag_init( "bradley_can_start_firing" ); flag_init( "humvee_commerce_left_done_with_spotlight" ); flag_init( "javelin_is_owning_fools" ); flag_init( "second_abrams_killed" ); flag_init( "commerce_rappelers_inserting" ); flag_init( "commerce_rappelers_rappeling" ); flag_init( "commerce_rappelers_done" ); flag_init( "trenches_dialogue_done" ); flag_init( "lav_is_suppressing" ); flag_init( "leader_orders_everyone_across_street" ); //elevator_bottom flag_init( "atrium_guys_at_end_of_anim" ); flag_init( "commerce_first_floor_enemies_dead" ); flag_init( "courtyard_has_been_cleared" ); flag_init( "ask_bradley_to_stop_firing" ); flag_init( "mezzanine_top_has_been_cleared" ); flag_init( "floor_four_has_been_cleared" ); flag_init( "player_shot_at_samsite_guys" ); flag_init( "commerce_samsite_revealed" ); //elevator_top flag_init( "fifth_floor_guys_damaged" ); flag_init( "start_music_to_crowsnest" ); flag_init( "macey_tells_you_to_move_to_crows" ); //crows nest - snipe flag_init( "player_shot_at_crowsnest_guys" ); flag_init( "crowsnest_has_been_cleared" ); flag_init( "make_seaknights_take_off" ); flag_init( "can_start_crow_nags" ); flag_init( "only_2_sniper_enemies_remaining" ); //wave of enemies after snipe flag_init( "player_killed_enough" ); flag_init( "humvee_spotlight_deleted" ); flag_init( "perimeter_enemies_have_retreated" ); //crows nest - armor flag_init( "start_crow_armor_sequence" ); flag_init( "only_1_javelin_enemies_remaining" ); flag_init( "only_2_javelin_enemies_remaining" ); flag_init( "monument_dummy_target_setup" ); flag_init( "crowsnest_sequence_finished" ); flag_init( "player_has_killed_at_least_one_javelin_target" ); //roof flag_init( "roof_breach_complete" ); flag_init( "roof_littlebird_lifted_off" ); flag_init( "player_heli_spawned" ); flag_init( "player_heli_ready_to_take_off" ); flag_init( "roof_heli_about_to_be_owned" ); flag_init( "roof_heli_owned" ); flag_init( "player_getting_on_minigun" ); flag_init( "player_has_used_minigun" ); flag_init( "blackhawk_landed" ); flag_init( "rooftop_run_dialogue_finished" ); flag_init( "littlebird_crash_path_end" ); flag_init( "littlebird_crash_path_end2" ); //lincoln flag_init( "player_starting_fastrope" ); flag_init( "player_fastroped_out" ); flag_init( "player_facing_blackhawk" ); //player crash and crash site flag_init( "player_crash_starting" ); /*----------------------- GLOBAL THREADS -------------------------*/ //setsaveddvar( "sm_sunSampleSizeNear", 0.125 );// 0.25 by default...higher value makes shadows look longer (inc size) setsaveddvar( "sm_sunShadowScale", 0.5 );// 1 by default...lower values is better performance // Press^3 [{+actionslot 3}] ^7to use\nthe M203 Grenade Launcher. add_hint_string( "grenade_launcher", &"SCRIPT_LEARN_GRENADE_LAUNCHER", ::should_break_m203_hint ); add_hint_string( "javelin_pickup", &"DCBURNING_HINT_JAVELIN_PICKUP", ::should_break_javelin_pickup_hint ); add_hint_string( "javelin_switch", &"DCBURNING_HINT_JAVELIN_SWITCH", ::should_break_javelin_switch_hint ); add_hint_string( "javelin_shoot", &"DCBURNING_HINT_JAVELIN_FIRE", ::should_break_javelin_fire_hint ); // Press^3 [{+actionslot 3}] ^7to activate heartbeat sensor. //add_hint_string( "hint_heartbeat_sensor", &"DCBURNING_SWITCH_HEARTBEAT", ::should_break_activate_heartbeat ); array_thread( getentarray( "destructible_trigger", "targetname" ),::destructible_trigger_think ); thread AA_global(); hideAll(); fx_management(); //setSavedDvar( "r_specularColorScale", "6.25" ); setsaveddvar( "r_lightGridEnableTweaks", 0 ); setsaveddvar( "r_lightGridIntensity", 1.2 ); setsaveddvar( "r_lightGridContrast", 0 ); //thread destructibles_think(); thread init_difficulty(); thread lights(); init_air_vehicle_flags(); //thread player_death(); array_thread( getentarray( "ai_cleanup_trigger", "targetname" ), ::ai_cleanup_trigger_think ); array_thread( getentarray( "redshirt_trigger", "targetname" ), ::redshirt_trigger_think ); array_thread( getentarray( "rpg_targets", "targetname" ), ::rpg_targets_think ); array_thread( getentarray( "dest_cheap", "targetname" ), ::cheap_destructibles_think ); createthreatbiasgroup( "player" ); createthreatbiasgroup( "ignored" ); createthreatbiasgroup( "oblivious" ); level.player setthreatbiasgroup( "player" ); setignoremegroup( "allies", "oblivious" ); // oblivious ignore allies setignoremegroup( "axis", "oblivious" ); // oblivious ignore axis setignoremegroup( "player", "oblivious" ); // oblivious ignore player setignoremegroup( "oblivious", "allies" ); // allies ignore oblivious setignoremegroup( "oblivious", "axis" ); // axis ignore oblivious setignoremegroup( "oblivious", "oblivious" ); // oblivious ignore oblivious /*----------------------- SPAWNER THREADS -------------------------*/ aVehicleSpawners = maps\_vehicle::_getvehiclespawnerarray(); array_thread( aVehicleSpawners, ::add_spawn_function, ::vehicle_think ); array_thread( getentarray( "ai_ambient", "script_noteworthy" ), ::add_spawn_function, ::ai_ambient_noprop_think ); array_thread( getentarray( "ai_ambient_prop", "script_noteworthy" ), ::add_spawn_function, ::ai_ambient_prop_think ); array_spawn_function_noteworthy( "door_breaker", ::AI_door_breaker_think ); array_spawn_function_targetname( "hostiles_commerce_samsite", ::AI_hostiles_commerce_samsite_think ); array_spawn_function_targetname( "commerce_sector_2_guys", ::AI_commerce_sector_2_guys_think ); array_spawn_function_targetname( "crowsnest_assault_guys_wave1", ::AI_crowsnest_assault_guys_wave1_think ); array_spawn_function_targetname( "commerce_flare_guys", ::AI_commerce_flare_guys_think ); array_spawn_function_targetname( "ww2_heli", ::vehicle_ww2_enemy_helis_think ); array_spawn_function_noteworthy( "no_suppress", ::ai_no_suppress_think ); array_spawn_function_noteworthy( "friendly_fodder", ::AI_friendly_fodder_think ); array_spawn_function_noteworthy( "enemy_spotter_prone", ::AI_jav_sting_spot_think ); array_spawn_function_noteworthy( "enemy_spotter_crouched", ::AI_jav_sting_spot_think ); array_spawn_function_noteworthy( "enemy_javelin", ::AI_jav_sting_spot_think ); array_spawn_function_noteworthy( "enemy_stinger", ::AI_jav_sting_spot_think ); array_spawn_function_noteworthy( "waittill_damaged_and_set_flag", ::AI_waittill_damaged_and_set_flag_think ); array_spawn_function_noteworthy( "invisible_patrol_fodder", ::AI_invisible_patrol_fodder_think ); array_spawn_function_noteworthy( "at4_friendly", ::AI_at4_friendly_think ); array_spawn_function_noteworthy( "player_seek", ::AI_player_seek ); array_spawn_function_noteworthy( "roof_escape_redshirts", ::AI_roof_escape_redshirts_think ); array_spawn_function_noteworthy( "redshirt", ::AI_redshirt_think ); array_spawn_function_noteworthy( "glass_building_enemies", ::AI_glass_building_enemies_think ); array_spawn_function_noteworthy( "ambush", ::AI_ambush_behavior ); array_spawn_function_noteworthy( "hummer_gunner", ::AI_hummer_gunner_think ); array_spawn_function_targetname( "commerce_rpg_upper", ::AI_commerce_rpg_upper_think ); //array_spawn_function_targetname( "friendlies_pavlov_street", ::AI_ambient_combat_think ); setsaveddvar( "r_spotlightbrightness", "6" ); setsaveddvar( "r_spotlightstartradius", "50" ); setsaveddvar( "r_spotlightEndradius", "250" ); setsaveddvar( "r_spotlightfovinnerfraction", "0" ); setsaveddvar( "r_spotlightexponent", "2" ); //flag_wait( "player_crash_done" ); //wait( 2 ); //iPrintlnbold( &"SCRIPT_DEBUG_LEVEL_END" ); } init_air_vehicle_flags() { array1 = getentarray( "script_origin", "classname" ); aAirNodes = array_merge( array1, level.struct ); array_thread( aAirNodes,::air_nodes_think ); } air_nodes_think() { if ( !isdefined( self.script_flag ) ) return; flag_init( self.script_flag ); if ( getdvar( "dc_debug" ) == "1" ) self thread debug_message( self.script_flag , self.origin, 9999 ); self waittill( "trigger" ); flag_set( self.script_flag ); if ( getdvar( "dc_debug" ) == "1" ) iPrintlnbold( "flag: " + self.script_flag + " has been set" ); } /**************************************************************************** START FUNCTIONS ****************************************************************************/ start_default() { AA_bunker_init(); //start_debug(); //start_roof(); } start_debug() { initFriendlies( "elevator_bottom" ); } start_elevator_bottom() { maps\_utility::vision_set_fog_changes( "dcburning_commerce", 0 ); initFriendlies( "elevator_bottom" ); thread obj_commerce(); flag_set( "obj_commerce_given" ); array_thread( level.squad, ::cqb_walk, "on" ); triggersEnable( "colornodes_commerce_bot_to_top", "script_noteworthy", true ); AA_elevator_bottom_init(); } start_elevator_top() { maps\_utility::vision_set_fog_changes( "dcburning_commerce", 0 ); initFriendlies( "elevator_top" ); battlechatter_off( "allies" ); array_thread( level.squad, ::cqb_walk, "on" ); flag_set( "player_at_commerce_crows_floor" ); AA_elevator_top_init(); } start_crows_nest() { maps\_utility::vision_set_fog_changes( "dcburning_commerce", 0 ); initFriendlies( "crows_nest" ); battlechatter_off( "allies" ); array_thread( level.squad, ::cqb_walk, "on" ); flag_set( "player_approaching_crowsnest" ); flag_set( "player_approaching_crowsnest2" ); AA_crows_nest_snipe_init(); } start_crows_nest_armor() { maps\_utility::vision_set_fog_changes( "dcburning_commerce", 0 ); initFriendlies( "crows_nest" ); battlechatter_off( "allies" ); array_thread( level.squad, ::cqb_walk, "on" ); flag_set( "start_crow_armor_sequence" ); flag_set( "player_approaching_crowsnest" ); flag_set( "player_approaching_crowsnest2" ); AA_crows_nest_armor_init(); } start_barrett() { maps\_utility::vision_set_fog_changes( "dcburning_commerce", 0 ); initFriendlies( "crows_nest" ); battlechatter_off( "allies" ); array_thread( level.squad, ::cqb_walk, "on" ); } start_to_roof() { maps\_utility::vision_set_fog_changes( "dcburning_commerce", 0 ); initFriendlies( "to_roof" ); battlechatter_on( "allies" ); array_thread( level.squad, ::cqb_walk, "on" ); flag_set( "only_2_javelin_enemies_remaining" ); flag_set( "crowsnest_sequence_finished" ); thread AA_commerce_to_roof_init(); } start_roof() { maps\_utility::vision_set_fog_changes( "dcburning_commerce", 0 ); initFriendlies( "Roof" ); array_thread( level.squad, ::cqb_walk, "off" ); flag_set( "player_headed_to_roof" ); flag_set( "player_approaching_outer_balcony" ); //thread music_loop( "dcburning_stairway_escape_loop", 40.96 ); dummy_trigger( "trigger_dummy_roof_colornode" ); AA_roof_init(); } start_heli_ride2() { maps\_utility::vision_set_fog_changes( "dcburning_heliride", 0 ); heliNode = getstruct( "player_heli_ww2_end", "script_noteworthy" ); player_blackhawk_setup( heliNode ); level.blackhawk.minigunUser = level.player; level.blackhawk thread maps\_minigun::minigun_think(); //thread maps\_minigun::minigun_hints_on(); thread AA_heli_ride2(); } start_crash() { thread maps\dc_crashsite::AA_crash_site_init(); wait( .1 ); flag_set( "player_crash_done" ); } /**************************************************************************** BUNKER ****************************************************************************/ AA_bunker_init() { initFriendlies( "Bunker" ); thread bunker_mortars(); thread music_bunker(); thread commerce_flyby(); //thread commerce_lasers(); thread AAA_sequence_bunker_to_commerce(); thread obj_follow_sgt_macey(); thread obj_commerce(); thread dialogue_bunker(); thread dialogue_trenches(); thread javelins_trench(); thread humvee_commerce_left(); thread humvee_commerce(); thread bradley_commerce(); thread humvee_convoy(); thread helis_monument(); thread helis_monument_ground(); thread helis_monument_cargo(); thread commerce_rappelers(); thread capitol_trench(); flag_wait( "player_commerce_trench_02" ); thread AA_elevator_bottom_init(); } music_bunker() { thread music_loop( "dcburning_intropad", 87 ); flag_wait( "player_bunker_walk_03" ); music_stop( 5 ); wait( 5.1 ); musicPlayWrapper( "dcburning_intropeak" ); } commerce_flyby() { flag_wait( "player_commerce_past_desks" ); level.vehicles_commerce_ambient = spawn_vehicles_from_targetname_and_drive( "vehicles_commerce_ambient" ); } AAA_sequence_bunker_to_commerce() { if ( getdvarint( "r_dcburning_culldist" ) == 1 ) { setculldist( 28500 ); } /*----------------------- PLAYER AND SQUAD IGNORED -------------------------*/ thread ignoreme_on_squad_and_player(); flavorbursts_off( "allies" ); battlechatter_off( "allies" ); battlechatter_off( "axis" ); /*----------------------- PLAYER SQUAD -------------------------*/ level.teamLeader thread make_ambient_ai( "bunker_radio_door_guy" ); level.friendly02 thread make_ambient_ai( "gun_toss_guy2" ); level.friendly03 thread make_ambient_ai( "gun_toss_guy1" ); //laptop_light_org = getent( "laptop_light_org", "targetname" ); //laptop_light_model = spawn_tag_origin(); //laptop_light_model.origin = laptop_light_org.origin; //laptop_light_org delete(); //playfxontag( getfx( "dlight_laptop" ), laptop_light_model, "tag_origin" ); /*----------------------- AMBIENT DRONES -------------------------*/ bunker_laptop_guys = array_spawn( getentarray( "bunker_laptop_guys", "targetname" ) ); thread bunker_radio_chatter(); bunker_hallway_injured_guys = array_spawn( getentarray( "bunker_hallway_injured_guys", "targetname" ) ); bunker_hallway_injured_guys2 = array_spawn( getentarray( "bunker_hallway_injured_guys2", "targetname" ) ); bunker_sleeping_guys = array_spawn( getentarray( "bunker_sleeping_guys", "targetname" ) ); bunker_doctor_and_patient = array_spawn( getentarray( "bunker_doctor_and_patient", "targetname" ) ); spawner = getent( "bunker_hallway_injured_carrier", "targetname" ); bunker_hallway_injured_carrier = spawner spawn_ai(); bunker_sitting_guys = array_spawn( getentarray( "bunker_sitting_guys", "targetname" ) ); flag_wait( "introscreen_complete" ); flag_wait( "player_bunker_comm_room" ); triggersEnable( "colornodes_trenches", "script_noteworthy", true ); /*----------------------- EXTERIOR MORTARS ON, DRONES -------------------------*/ flag_wait( "player_approaching_bunker_exit_hall" ); drones_flood_monument = getentarray( "drones_flood_monument", "targetname" ); thread drone_flood_start( drones_flood_monument, "drones_flood_monument" ); thread drones_trenches(); if ( getdvarint( "r_dcburning_culldist" ) != 1 ) { level.helis_ambient_trenches = spawn_vehicles_from_targetname_and_drive( "helis_ambient_trenches" ); level.helis_ambient_capitol = spawn_vehicles_from_targetname_and_drive( "helis_ambient_capitol" ); } delaythread( 0, maps\_mortar::bog_style_mortar_on, 2 ); drone_warrior_hydrant = dronespawn( getent( "drone_warrior_hydrant", "targetname" ) ); drone_warrior_hydrant thread drone_warrior_hydrant_think(); /*----------------------- LITTLEBIRD AND SEAKNIGHT BY MONUMENT -------------------------*/ seaknight_loader_start = getent( "seaknight_loader_start", "targetname" ); seaknight_loader_start notify( "spawn" ); seaknight_loader_start2 = getent( "seaknight_loader_start2", "targetname" ); seaknight_loader_start2 notify( "spawn" ); littlebird_monument = spawn_vehicle_from_targetname_and_drive( "littlebird_monument" ); littlebird_monument_riders_left = array_spawn( getentarray( "littlebird_monument_riders_left", "targetname" ) ); array_thread( littlebird_monument_riders_left,::AI_ignored_and_oblivious_on ); array_thread( littlebird_monument_riders_left,::magic_bullet_shield ); littlebird_monument_riders_right = array_spawn( getentarray( "littlebird_monument_riders_right", "targetname" ) ); array_thread( littlebird_monument_riders_right,::AI_ignored_and_oblivious_on ); array_thread( littlebird_monument_riders_right,::magic_bullet_shield ); // you'll send this node off to some commands to get the nodes contained in the stage prefab pickup_node_before_stage_monument = getstruct( "pickup_node_before_stage_monument", "script_noteworthy" ); littlebird_monument set_stage( pickup_node_before_stage_monument, littlebird_monument_riders_left, "left" ); littlebird_monument set_stage( pickup_node_before_stage_monument, littlebird_monument_riders_right, "right" ); aTrenchAIToDelete = []; spawners = getentarray( "monument_spotters", "targetname" ); monument_spotters = array_spawn( spawners, true ); aTrenchAIToDelete = array_merge( aTrenchAIToDelete, monument_spotters ); /*----------------------- LITTLEBIRD LOADS UP -------------------------*/ flag_wait( "player_approaching_monument" ); /*----------------------- DRONES LOADING INTO SEAKNIGHT -------------------------*/ spawner = getent( "drones_seaknight", "targetname" ); thread seaknight_drone_loaders( spawner, "seaknight_drones_loaded", "player_exiting_start_trench2" ); //load drones then set flag when loaded spawner = getent( "drones_seaknight2", "targetname" ); thread seaknight_drone_loaders( spawner, "seaknight_drones2_loaded", "player_exiting_start_trench" ); //load drones then set flag when loaded /*----------------------- FIRE HYDRANT DRONE -------------------------*/ flag_wait( "player_exiting_start_trench" ); //thread friendly_speed_adjustment_on(); /*----------------------- SEAKNIGHT DEFENDERS LOAD UP AFTER DRONES, THEN FLY OFF -------------------------*/ seaknight_loader_start thread waittill_flag_then_notify( "seaknight_drones_loaded", "load_riders" ); seaknight_loader_start thread waittill_notify_then_notify( "riders_loaded", "play_anim" ); seaknight_loader_start2 thread waittill_flag_then_notify( "seaknight_drones2_loaded", "load_riders" ); seaknight_loader_start2 thread waittill_notify_then_notify( "riders_loaded", "play_anim" ); /*----------------------- SPOTLIGHT DEFAULT TARGETS MOVE A LITTLE -------------------------*/ spot_targets = getentarray( "spot_targets", "script_noteworthy" ); array_thread( spot_targets,::spot_targets_think ); /*----------------------- CLOSE BUNKER AND DELETE FRIENDLIES THERE -------------------------*/ bunker_doorup = getent( "bunker_door_up", "targetname" ); bunker_doorup hide_entity(); bunker_door = getentarray( "bunker_door", "targetname" ); array_thread( bunker_door,:: show_entity ); flag_set( "bunker_door_closed" ); //stopfxontag( getfx( "dlight_laptop" ), laptop_light_model, "tag_origin" ); //laptop_light_model delete(); mortar_bunker = getstructarray( "mortar_bunker", "targetname" ); mortar_bunker_radius_triggers = getentarray( "mortar_bunker", "targetname" ); array_call( mortar_bunker_radius_triggers,::delete ); thread struct_delete( mortar_bunker,"delete_bunker_mortars" ); bunker_radio_org_room2 = getent( "bunker_radio_org_room2", "targetname" ); bunker_radio_org_room2 delete(); volume_bunker = getent( "volume_bunker", "targetname" ); aAI = volume_bunker get_ai_touching_volume_non_squad(); aDrones = volume_bunker get_drones_touching_volume( "allies" ); aAI = array_merge( aAI, aDrones ); array_thread( aAI,::AI_delete ); array_thread( level.effects_bunker, ::pauseEffect ); /*----------------------- COMMERCE WALL/STREET FRIENDLIES -------------------------*/ spawner = getent( "monument_waver", "targetname" ); monument_waver = spawner spawn_ai( true ); spawners = getentarray( "friendlies_commerce_street", "targetname" ); friendlies_commerce_street = []; foreach( spawner in spawners ) { friendlies_commerce_street[ friendlies_commerce_street.size ] = spawner spawn_ai( true ); } //wall_death_nodes = getnodearray( "wall_death_nodes", "script_noteworthy" ); array_thread( friendlies_commerce_street,::try_to_magic_bullet_shield ); //array_thread( friendlies_commerce_street,::AI_try_to_hang_and_die_near_player, wall_death_nodes ); spawners = getentarray( "friendlies_commerce_wall", "targetname" ); friendlies_commerce_wall = []; foreach( spawner in spawners ) { friendlies_commerce_wall[ friendlies_commerce_wall.size ] = spawner spawn_ai( true ); } /*----------------------- MONUMENT MORTAR GUYS -------------------------*/ flag_wait( "player_exiting_start_trench2" ); spawners = getentarray( "monument_mortarguys", "targetname" ); monument_mortarguy = array_spawn( spawners, true ); //array_spawn( getentarray( "trench_mortarguys", "targetname" ), true ); /*----------------------- JAVELIN MOMENT -------------------------*/ flag_wait( "commerce_enemy_javeling_failsafe" ); aTrenchAIToDelete = array_add( aTrenchAIToDelete, monument_waver ); thread AI_delete_when_out_of_sight( aTrenchAIToDelete, 1024 ); littlebird_monument thread load_side( "left", littlebird_monument_riders_left ); littlebird_monument thread load_side( "right", littlebird_monument_riders_right ); littlebird_monument_path = getstruct( "littlebird_monument_path", "targetname" ); littlebird_monument thread vehicle_littlebird_gopath_when_loaded_and_flag_set( "player_exiting_start_trench", littlebird_monument_path ); drones_flood_monument2 = getentarray( "drones_flood_monument2", "targetname" ); thread drone_flood_start( drones_flood_monument2, "drones_flood_monument2" ); /*----------------------- BUNKER MORTARS OFF -------------------------*/ flag_wait( "player_trench_capitol_failsafe" ); heli_trench = spawn_vehicle_from_targetname_and_drive( "heli_trench" ); heli_commerce_front = spawn_vehicle_from_targetname_and_drive( "heli_commerce_front" ); //heli_trench maxPitch /*----------------------- PLAYER IS FAIR GAME -------------------------*/ flag_wait( "player_commerce_trench_01" ); level.player.ignoreme = false; level.player set_threatbias( 1500 ); /*----------------------- GET RID OF AI ON 4th FLOOR NOW -------------------------*/ flag_wait( "player_commerce_trench_03" ); //thread AI_cleanup_volume( "volume_commerce_fouth_floor", "axis" ); /*----------------------- PLAYER AND TEAM NOT IGNORED -------------------------*/ flag_wait_either( "player_touching_commerce_wall_left", "player_touching_commerce_wall_right" ); thread autosave_by_name( "commerce_wall" ); thread ignoreme_off_squad_and_player(); /*----------------------- BRADLEY NOW FIRING AT REAL TARGETS -------------------------*/ level.bradley_commerce.fireAtDefaultTargets = false; /*----------------------- COMMERCE WALL FRIENDLIES CAN DIE -------------------------*/ array_thread( friendlies_commerce_street,::stop_magic_bullet_shield ); array_thread( friendlies_commerce_street,::AI_redshirt_think ); /*----------------------- PLAYER TEAM MOVES UP -------------------------*/ flag_wait_or_timeout( "player_approaching_commerce", 5 ); triggersEnable( "colornodes_commerce_approach", "script_noteworthy", true ); colornodes_commerce_approach = getentarray( "colornodes_commerce_approach", "script_noteworthy" ); thread dialogue_nag_cross_the_street(); flag_set( "lav_is_suppressing" ); hostiles = getaiarray( "axis" ); foreach( guy in hostiles ) { if ( !isdefined( guy ) ) continue; guy.ignoresuppression = false; guy.aggressivemode = false; //dont linger at cover when you cant see your enemy } flag_wait_any( "leader_orders_everyone_across_street", "player_entered_commerce_right", "player_entered_commerce_left" ); if ( !flag( "player_crossing_street" ) ) { trig_colornode = getclosest( level.player.origin, colornodes_commerce_approach ); trig_colornode notify( "trigger", level.player ); } level.squad = remove_dead_from_array( level.squad ); array_thread( level.squad,::AI_ignored_and_oblivious_on ); /*----------------------- PLAYER AT COMMERCE STAIRS...BLOCK OTHER ENTRANCE SO AI GO TO PLAYER DOOR -------------------------*/ flag_wait( "player_entering_commerce" ); //make AI aware of enemies and not ignored level.squad = remove_dead_from_array( level.squad ); array_thread( level.squad,::AI_ignored_and_oblivious_off ); commerce_blocker_right = getent( "commerce_blocker_right", "targetname" ); commerce_blocker_left = getent( "commerce_blocker_left", "targetname" ); aBlockers = []; aBlockers[ 0 ] = commerce_blocker_right; aBlockers[ 1 ] = commerce_blocker_left; blocker = getfarthest( level.player.origin, aBlockers ); blocker show(); blocker solid(); blocker disconnectpaths(); /*----------------------- PLAYER INSIDE LOBBY -------------------------*/ flag_wait_either( "player_entered_commerce_left", "player_entered_commerce_right" ); thread drone_flood_stop( "drones_flood_monument" ); thread drone_flood_stop( "drones_flood_monument2" ); array_thread( level.chattertrigsexteriror,::trigger_off ); array_thread( level.chattertrigsinterior,::trigger_on ); triggersEnable( "colornodes_commerce_bot_to_top", "script_noteworthy", true ); flag_clear( "lav_is_suppressing" ); hostiles = getaiarray( "axis" ); foreach( guy in hostiles ) { if ( !isdefined( guy ) ) continue; guy.ignoresuppression = true; guy.aggressivemode = true; //dont linger at cover when you cant see your enemy } thread autosave_by_name( "commerce_entered" ); flag_set( "obj_follow_sgt_macey_complete" ); triggersEnable( "colornodes_elevators", "script_noteworthy", true ); thread AI_delete_when_out_of_sight( friendlies_commerce_street, 1024 ); thread dialogue_nag_get_to_elevator(); /*----------------------- DEAL WITH FRIENDLIES ON OPPOSITE SIDE -------------------------*/ //array_thread( level.squad,::disable_ai_color ); //TODO /*----------------------- BRADLEY OWNS REMAINING ENEMIES -------------------------*/ volume_commerce_lobby_upper = getent( "volume_commerce_lobby_upper", "targetname" ); upper_floor_enemies = volume_commerce_lobby_upper get_ai_touching_volume( "axis" ); if ( ( isdefined( upper_floor_enemies ) ) && ( upper_floor_enemies.size > 0 ) ) level.bradleyPreferredTargets = upper_floor_enemies; wait( 1 ); thread commerce_first_floor_enemies_dead_monitor(); level.bradley_commerce.firing = false; delaythread( 4,::m203_hint ); flag_wait_either( "commerce_first_floor_enemies_dead", "player_middle_commerce_first_floor" ); //thread friendly_speed_adjustment_off(); level.player reset_threatbias(); //friendlies move to elevator...if not done already if ( !flag( "player_middle_commerce_first_floor" ) ) { trig_colornode = getent( "colornodes_elevators", "script_noteworthy" ); trig_colornode notify( "trigger", level.player ); } /*----------------------- BRADLEY FIRING AGAIN, RANDOMLY -------------------------*/ flag_wait( "player_heading_up_to_mezzanine" ); thread AI_drone_cleanup( "all", 1024, true ); level.bradleyPreferredTargets = undefined; level.bradley_commerce.fireAtDefaultTargets = true; level.bradley_commerce.firing = true; /*----------------------- MEZZANINE BLOCKERS TO GUIDE PLAYER -------------------------*/ mezzanine_blockers = getentarray( "mezzanine_blockers", "targetname" ); array_thread( mezzanine_blockers,::show_entity ); /*----------------------- BRADLEY STOPS FIRING AS PLAYER ENTERS TOP MEZZ -------------------------*/ flag_wait( "ask_bradley_to_stop_firing" ); level.bradley_commerce.firing = false; /*----------------------- CLEANUP TRENCHES AND CLOSE DOOR TO MEZZANINE -------------------------*/ flag_wait( "player_entering_top_elevator_area" ); //thread drone_flood_stop( "drone_flood_pavlov" ); thread AI_cleanup_non_squad( "all", 128 ); //close door back to mezzanine only if friendlies are close to player //mezzanine_door = getent( "mezzanine_door", "targetname" ); //mezzanine_door show_entity(); //delaythread( 2, maps\_mortar::bog_style_mortar_off, 2 ); } AI_commerce_rpg_upper_think() { self endon( "death" ); self.a.disableLongDeath = true;// no long death on these guys level endon( "player_approaching_commerce" ); flag_wait( "player_commerce_trench_03" ); //teleport to closest commerce door and kill self when player too near aNodes = getnodearray( "commerce_lobby_teleport_nodes", "targetname" ); eNode = getClosest( level.player.origin, aNodes ); self forceTeleport( eNode.origin, eNode.angles ); self setgoalpos( self.origin ); self.attackeraccuracy = 0; volume_commerce_front = getent( "volume_commerce_front", "targetname" ); self setgoalvolumeauto( volume_commerce_front ); flag_wait_either( "player_crossing_street", "leader_orders_everyone_across_street" ); wait( randomfloatrange( 0, 1 ) ); thread ambient_mortar_explosion( self.origin ); self kill(); } m203_hint() { //level.grenadeHint_timeout = gettime() + 8000; //level.player thread display_hint( "grenade_launcher" ); //TODO...use dialogue hint instead //Sgt. Foley Use your grenade launchers! //dcburn_mcy_grenadelaunch } seaknight_drone_loaders( spawner, sFlagToSetWhenLoaded, sFlagToStop ) { i = 1; while( !flag( sFlagToStop ) ) { dude = spawner dronespawn(); //dude.runcycle = level.scr_anim[ "generic" ][ "wounded_walkcycle" ]; //self.moveplaybackrate = .5; wait( randomfloatrange( 1, 2.5 ) ); } seaknight_drone_loaders = get_drones_with_targetname( spawner.targetname ); seaknight_drone_loaders = remove_dead_from_array( seaknight_drone_loaders ); waittill_dead( seaknight_drone_loaders ); flag_set( sFlagToSetWhenLoaded ); } vehicle_littlebird_gopath_when_loaded_and_flag_set( sFlag, pathStart ) { while ( self.riders.size < 6 ) wait( .1 ); // newArray = []; // foreach( guy in self.riders ) // { // if( isdefined( guy.magic_bullet_shield ) ) // guy stop_magic_bullet_shield(); // dude = maps\_vehicle_aianim::convert_guy_to_drone( guy ); // dude setcontents( 0 ); // } // self.riders = newArray; flag_wait( sFlag ); /*----------------------- LITTLEBIRD TAKES OFF -------------------------*/ //self thread vehicle_liftoff( 3 ); //wait( 1 ); self thread vehicle_paths( pathStart ); self setmaxpitchroll( 20, 50 ); wait( 2 ); self vehicle_ai_event( "idle_alert_to_casual" ); self Vehicle_SetSpeed( 25 ); self.script_vehicle_selfremove = 1; wait( 5 ); array_thread( self.riders,::stop_magic_bullet_shield ); self thread vehicle_delete_when_out_of_sight(); } drone_warrior_hydrant_think() { self endon( "death" ); flag_wait( "player_mid_trench" ); play_sound_in_space( "mortar_incoming", self.origin ); playfx( level._effect[ "mortar" ][ "dirt" ], self.origin ); earthquake( 0.25, 0.75, self.origin, 1250 ); thread play_sound_in_space( level.scr_sound[ "mortar" ][ "dirt" ], self.origin ); self notify( "stop_drone_fighting" ); thread play_sound_in_space( "generic_death_american_1", self.origin ); self.deathanim = level.scr_anim[ "generic" ][ "deathanim_mortar_00" ]; self kill(); } spot_targets_think() { movetime = 2.4; moveDistVert = 50; moveDistHor = 50; //self thread debug_message( "ORG", undefined, 9999, self ); wait( movetime ); while( !flag( "obj_commerce_defend_snipe_given" ) ) { //up self moveTo( self.origin + ( 0, 0, moveDistVert ), movetime, 1, 1 ); wait( movetime ); //right self moveTo( self.origin + ( moveDistHor, 0, 0 ), movetime, 1, 1 ); wait( movetime ); //down self moveTo( self.origin + ( 0, 0, moveDistVert * ( -1 ) ), movetime, 1, 1 ); wait( movetime ); //left self moveTo( self.origin + ( moveDistHor * ( -1 ), 0, 0 ), movetime, 1, 1 ); wait( movetime ); } self delete(); } bunker_mortars() { bunker_mortars = false; while( !flag( "bunker_door_closed" ) ) { if ( !flag( "player_inside_bunker" ) ) { maps\_mortar::bunker_style_mortar_off_nowait( 0 ); bunker_mortars = false; } else if ( bunker_mortars == false ) { maps\_mortar::bunker_style_mortar_on( 0 ); bunker_mortars = true; } wait( 3 ); } maps\_mortar::bunker_style_mortar_off_nowait( 0 ); flag_set( "delete_bunker_mortars" ); } bunker_radio_chatter() { level.bunker_radio_org = spawn( "script_origin", level.player.origin ); level.bunker_radio_org linkto( level.player ); level.bunker_radio_org.linked = true; level endon( "javelin_is_owning_fools" ); //Goliath, Goliath, this is Stalker Two-One, standby for report one-dash-three over. bunker_radio( "dcburn_rm1_report1dash3" ); //Stalker Two-One this is Goliath, send your traffic, over. bunker_radio( "dcburn_rm2_sendtraffic" ); //Line Whiskey - four zero personnel... Line X-Ray, three columns of mechanized infantry, break. bunker_radio( "dcburn_rm1_40personnel" ); //Line Yankee, two-zero Bravo-Tango-Romeos, five two five, six three niner. bunker_radio( "dcburn_rm1_lineyankee" ); //Line Zulu, Russian paratroopers, break. bunker_radio( "dcburn_rm1_linezulu" ); //Line Alpha, one niner one five Zulu, Line Echo, AK47s and RPGs. How copy so far, over? bunker_radio( "dcburn_rm1_linealpha" ); //Yeah, say again, Line Yankee, over. bunker_radio( "dcburn_rm2_sayagain" ); //Roger, I say again Line Yankee, Line Yankee, two-zero Bravo-Tango-Romeos, five two five, six three niner, how copy? bunker_radio( "dcburn_rm1_sayagain" ); //Solid copy. Do you have any remarks, over? bunker_radio( "dcburn_rm2_remarks" ); //Negative, no further remarks at this time, over. bunker_radio( "dcburn_rm1_noremarks" ); //Roger, solid copy on all. Stalker, do not engage unless compromised, and continue to report every ten mikes on enemy disposition. We need as all the intel we can get on any grid north of the White House. Goliath out. bunker_radio( "dcburn_rm2_needintel" ); //Grizzly Actual, this is Wolverine Two, we are diverting to engage enemy paratroopers, how copy, over? bunker_radio( "dcburn_rm3_engparatroop" ); //This is Grizzly, solid copy. All Grizzly teams, be advised, Wolverine is now engaged with foot-mobiles to our nine o'clock. bunker_radio( "dcburn_rm4_footmobiles" ); //Grizzly, this is Grizzly Two, interrogative - are we cleared to use our thermobaric LAWs, over? bunker_radio( "dcburn_rm5_thermlaws" ); //Two-Three, what's your target? bunker_radio( "dcburn_rm4_whattarget" ); //Snipers confirmed on the Boomerang in Building Alpha-Two-Five. It'll be easier if we drop the whole building, over. bunker_radio( "dcburn_rm5_dropbuilding" ); //Two-Three, confirm Alpha-Two-Five is the Federal Reserve Building, over. bunker_radio( "dcburn_rm4_fedresbuild" ); //Two, Two-Three, roger that, they're all over the top floor. bunker_radio( "dcburn_rm5_allover" ); //I'm going to have to check in with Overlord. Standby. bunker_radio( "dcburn_rm4_checkin" ); //Two-Three. Roger. bunker_radio( "dcburn_rm5_roger" ); //Overlord, Overlord, this is Grizzly Actual. Grizzly Two has confirmed enemy snipers in Building Alpha-Two-Five and is requesting permission to engage with thermobaric LAWs over. bunker_radio( "dcburn_rm4_thermlaws" ); //Overlord copies all. Standby. bunker_radio( "dcburn_rm6_copiesall" ); //Roger, standing by. bunker_radio( "dcburn_rm4_stndingby" ); //Grizzly this is Overlord. The use of thermobaric weapons is now authorized. Go ahead and level the building. Out. bunker_radio( "dcburn_rm6_thermlawsauth" ); //Grizzly Two, this is Grizzly Actual. You are approved to level the building, over. bunker_radio( "dcburn_rm4_approved" ); //Solid copy. bunker_radio( "dcburn_rm5_solidcopy" ); //Grizzly Two-Two, Echo Five Kilo, this is Grizzly Two, you are approved to engage the snipers in Building Alpha-Two-Five. bunker_radio( "dcburn_rm5_apprengage" ); //Roger that. Engaging targets with thermobaric LAWs. bunker_radio( "dcburn_rm1_engagingtarg" ); //Grizzly Two, target has been suppressed. bunker_radio( "dcburn_rm1_targetsupp" ); //All Grizzly personnel, this is Grizzly Actual. We have neutralized the snipers in Building Alpha-Two-Five. Saddle up - we're oscar mike. Out. bunker_radio( "dcburn_rm4_saddleup" ); //Three-One this is Three-Three, BTR-60 at your two o'clock! bunker_radio( "dcburn_rm5_btr60" ); //Roger, engaging with LAW rocket! bunker_radio( "dcburn_rm6_lawrocket" ); //Hunter Two-One this is Two Two, we have engaged the enemy at Logan Circle Park! bunker_radio( "dcburn_rm1_logancircpark" ); //Two-One Two Three! Two-Two is down, repeat two-two is down! bunker_radio( "dcburn_rm2_22isdown" ); //Three-Three this is Three-One, interrogative: where is the air support! Over! bunker_radio( "dcburn_rm3_airsupport" ); //One-Three, One-Two, be advised, our Mark-19 is down, I repeat our Mark-19 is down, over! bunker_radio( "dcburn_rm5_mark19down" ); //All Hunter teams, Two-Bravo is in contact with Overlord FAC! Break, retrograde to Franklin Square but continue to delay the enemy in your sectors!! Out! bunker_radio( "dcburn_rm4_retrograde" ); //Two, Two-Three! Be advised, we have visual on enemy paratroopers at grid Papa Uniform 2 5 niner, 1 1 niner! We are low on ammo and have sustained major casualties! bunker_radio( "dcburn_rm3_lowammo" ); //One-Zero-Zero enemy foot-mobiles and one column of five BTR-60s will be on top of us in less than two minutes, break! Enemy is unaware of our presence at this time, how copy, over? bunker_radio( "dcburn_rm3_5btr60s" ); //Solid copy on all. Two-Three standby, I'm calling it in. Warhammer this is Two-Bravo, standby for fire mission. bunker_radio( "dcburn_rm2_callingitin" ); //Wolverine Two, this is Warhammer, standing by for fire mission. bunker_radio( "dcburn_ra2_standingby" ); //Grid to suppress: Golf Foxtrot 2 7 niner, 3 1 6. Grid to mark, Golf Foxtrot, 2 7 8, 5 6 niner, over! bunker_radio( "dcburn_rm2_gridtomark" ); //Grid to suppress: Golf Foxtrot 2 7 niner, 3 1 6. Grid to mark, Golf Foxtrot, 2 7 8, 5 6 niner, out. bunker_radio( "dcburn_ra2_gridtosuppress" ); //Column of BTR-60s with attached infantry, request splash, danger close, over. bunker_radio( "dcburn_rm2_reqsplash" ); //Column of BTR-60s with attached infantry, request splash, danger close, out. bunker_radio( "dcburn_ra2_dangerclose" ); //Message to observer - Bravo, two rounds. Two guns in effect. Target number Alpha Whiskey, 3 2 3, over. bunker_radio( "dcburn_ra2_mess2ob" ); //Message to observer - Bravo, two rounds. Two guns in effect. Target number Alpha Whiskey, 3 2 3, out. bunker_radio( "dcburn_rm2_2gunseffect" ); //Shot - over. bunker_radio( "dcburn_ra2_shot" ); //Shot - out. bunker_radio( "dcburn_rm2_shot" ); //Splash - over. bunker_radio( "dcburn_rm2_splash" ); //Splash - out. bunker_radio( "dcburn_ra2_splash" ); //Two, Two-Three, target is partially suppressed but moving in quickly! (off mike) Hit that BTR with the LAW! Take it out! Take it out! bunker_radio( "dcburn_rm3_takeitout" ); //Wolverine One-Two, this is Wolverine Two-Actual. Gimme a sitrep. How far are you from Two-Three's position, over. bunker_radio( "dcburn_rm2_linkup" ); //Two-Actual, One-Two! We're dug in by the Capitol Building and are taking heavy fire from the east! Two-Three is about six-hundred meters to the south of us, over! bunker_radio( "dcburn_rm4_dugin" ); //One-Two, can you link up with Two-Three from where you are, over? bunker_radio( "dcburn_rm2_sitrep" ); //Negative negative! (off mike) Gray, get the two-forty Golf setup on our right flank move move! (on mike) They're rollin' us with a couple platoons of T-80s! Request Broken Arrow! Repeat - Broken Arrow! bunker_radio( "dcburn_rm4_brokenarrow" ); //Roger that! Solid copy on Broken Arrow! Major, it's been an honor! Out. bunker_radio( "dcburn_rm2_brokearrow" ); //Viper Three Actual, this is Viper Actual, gimme a sitrep over! bunker_radio( "dcburn_rm5_sitrep" ); //Viper Actual this is Three-Bravo, Echo Four Sierra! Three-Bravo-Actual is KIA! Repeat, Three-Bravo-Actual is KIA!! Break! We are down to three men, I repeat, we are down to three men how copy over!! bunker_radio( "dcburn_rm6_kia" ); //Solid copy Three-Bravo, be advised, I have Warhammer standing by, switch to tac freq 1 7 niner and go to town, over. bunker_radio( "dcburn_rm5_tacfreq" ); //Roger that! Switching to 1 7 niner!! Out! bunker_radio( "dcburn_rm6_switching" ); //Warpig Two, this is Warpig Two-One, I have visual on enemy armor closing twelve klicks due north of the Washington Monument, supported by infantry, APCs and attack helos, how copy over! bunker_radio( "dcburn_rm1_12klicksnorth" ); //Contact left contact left!! bunker_radio( "dcburn_rm2_contactleft" ); //Taking fire, eleven o'clock, one hundred meters! bunker_radio( "dcburn_rm3_takingfire" ); //Two-One-Alpha, Two-Two-Alpha - one of Warpig Two's victors just took a hit!!! Repeat, one of Warpig Two's victors has been hit!!! bunker_radio( "dcburn_rm4_tookahit" ); //Warpig Two, this is Wolverine Two, what's your status over!!! bunker_radio( "dcburn_rm5_status" ); //Wolverine Two this is Warpig Two-One!! We are taking heavy fire along the Potomac! Break! Two-Two-Echo's victor is gone - they took a direct hit from a Hind - bunker_radio( "dcburn_rm1_heavyfire" ); //Ambush!!!! Left side left side!!! bunker_radio( "dcburn_rm2_ambush" ); //Contact left! Contact left!! bunker_radio( "dcburn_rm3_contactleft" ); //Two-Three! RPG at your three o'clock!! bunker_radio( "dcburn_rm4_rpg" ); //Get the Mark 19 on that sector, cover that sector!!! bunker_radio( "dcburn_rm5_coversector" ); //Overlord, this is War Horse Five-One checking in with you, flight of two A-10s, holding area Lima, angels ten. Four by BLU-97s, two thousand rounds for the section. Ready for tasking. bunker_radio( "dcburn_rp1_tasking" ); //Roger War Horse Five-One, I have Stalker Two on the ground requesting immediate CAS at map grid Charlie Alpha, 3 1 5, niner niner 2, break. Push to IP Buick, how copy over? bunker_radio( "dcburn_fac_pushtoipbuick" ); //Solid copy. Map grid Charlie Alpha, 3 1 5, niner niner 2, pushing to IP Cadillac. bunker_radio( "dcburn_rp1_mapgrid" ); //Stalker Two, you have War Horse Five-One, flight of two A-10s at angels ten, pushing to IP Cadillac. bunker_radio( "dcburn_fac_2a10s" ); //Stalker copies all. Out. bunker_radio( "dcburn_rm2_stalkercopies" ); //War Horse Five-One, this is Stalker, standby for information! bunker_radio( "dcburn_rm2_standby" ); //War Horse standing by. bunker_radio( "dcburn_rp1_stndingby" ); //TOT two zero! Close-in-fire-support, non standard, minus one to minus one two, then plus four to plus two. Gun target line, zero five zero. I'm gonna talk you onto the target, how copy over? bunker_radio( "dcburn_rm2_talktotarg" ); //Solid copy on all. Go ahead, over. bunker_radio( "dcburn_rp1_goahead" ); //North-northwest of Union Station, about 800 metres, there is an oval track! Call contact! bunker_radio( "dcburn_rm2_ovaltrack" ); //Contact. bunker_radio( "dcburn_rp1_contact" ); //At the south edge of that oval track is a road running along an east-west axis to the White House. Call contact! bunker_radio( "dcburn_rm2_ewaxis" ); //Contact. bunker_radio( "dcburn_rp1_contact" ); //We are observing from a position 200 metres south of Logan Circle Park, looking east down that road. Call contact! bunker_radio( "dcburn_rm2_logancircpark" ); //Contact. bunker_radio( "dcburn_rp1_contact" ); //Your target is a column of six enemy T-72s moving from east to west along that road. The convention center is about halfway between our OP and the oval track, be advised, major civvies are packed into that convention center, awaiting evac. bunker_radio( "dcburn_rm2_yourtarget" ); //War Horse has contact on all. We are passing IP Cadillac, rolling in to heading zero-nine-zero. bunker_radio( "dcburn_rp1_rollingin" ); //Roger that. Bring the rain. bunker_radio( "dcburn_rm2_bringrain" ); //War Horse off safe. Guns guns guns. bunker_radio( "dcburn_rp1_offsafe" ); //Guns guns guns. bunker_radio( "dcburn_rp1_guns" ); //Dash two off safe. Rollin' in. bunker_radio( "dcburn_rp2_offsafe" ); //Apex inbound! Break right break right!...I'm hit! Ejecting! bunker_radio( "dcburn_rp1_ejecting" ); //I can't see it I can't see - (static burst) bunker_radio( "dcburn_rp2_cantseeit" ); //Overlord, this is Stalker Two, War Horse Five-One, flight of two A-10s is down, I see only one chute deploying. BDA is 80 over 15. Convention center is taking HEAT rounds from T-72s, it uh, doesn't look good from where we are, how copy over? bunker_radio( "dcburn_rm2_onechute" ); //Stalker Two, this is Overlord. Solid copy on all. We do not have any other close-air support in the area at this time. Displace to a more secure location south of K Street and await further instructions. Out. bunker_radio( "dcburn_fac_southkstreet" ); } dialogue_bunker() { level endon( "bunker_door_closed" ); flag_wait( "player_bunker_walk_01" ); bunker_radio_org_room2 = getent( "bunker_radio_org_room2", "targetname" ); bunker_radio_org_room1 = getstruct( "bunker_radio_org_room1", "targetname" ); bunker_radio_org_room2 endon( "death" ); bunker_radio_org_room1 endon( "death" ); //Marine 5 We've got wounded! bunker_radio_org_room2 play_sound_in_space( "dcburn_gm5_gotwounded" ); wait( 1 ); //Marine 3 He's all yours doc. bunker_radio_org_room1 play_sound_in_space( "dcburn_gm3_allyoursdoc" ); flag_wait( "player_bunker_walk_01a" ); //Marine 1 Give him some water and keep him still. bunker_radio_org_room2 play_sound_in_space( "dcburn_gm1_keepstill" ); //Marine 1 Corporal, where's your Canteen? bunker_radio_org_room2 play_sound_in_space( "dcburn_gm1_wherescanteen" ); wait( 1 ); //Marine 2 Right here, L-T. bunker_radio_org_room2 play_sound_in_space( "dcburn_gm2_righthere" ); wait( 2 ); //Marine 6 He's stable for now. Get him to the evac site. bunker_radio_org_room1 play_sound_in_space( "dcburn_gm6_stablefornow" ); //Marine 4 Christenson, two stretchers to Rajan. bunker_radio_org_room1 play_sound_in_space( "dcburn_gm4_2stretchers" ); } bunker_radio( sLine ) { if ( !isdefined( level.bunker_radio_org ) ) return; if ( isdefined( level.bunker_radio_org.deleteme ) ) { level.bunker_radio_org delete(); } level.bunker_radio_org playsound( sLine, "done" ); level.bunker_radio_org waittill( "done" ); } dialogue_nag_cross_the_street() { level endon( "player_entered_commerce_right" ); level endon( "player_entered_commerce_left" ); flag_wait( "trenches_dialogue_done" ); while( true ) { if ( !flag( "player_crossing_street" ) ) { //Sgt. Macey All right! RCT One's LAV has them suppressed! Get ready to move on my mark! level.teamleader dialogue_execute( "dcburn_mcy_humveesupp" ); } if ( !flag( "player_crossing_street" ) ) { //Sgt. Macey Ready….! level.teamleader dialogue_execute( "dcburn_mcy_ready" ); //Sgt. Macey Go go go!!! Move up! Move up! level.teamleader dialogue_execute( "dcburn_mcy_gomoveup" ); } flag_set( "leader_orders_everyone_across_street" ); wait( randomintrange( 7, 11 ) ); if ( flag( "player_entering_commerce" ) ) break; //Sgt. Macey Move up and stay out of that Humvee's line of fire! radio_dialogue("dcburn_mcy_lineoffire"); wait( randomintrange( 7, 11 ) ); if ( flag( "player_entering_commerce" ) ) break; //Sgt. Macey Move! Move! radio_dialogue("dcburn_mcy_movemove"); wait( randomintrange( 7, 11 ) ); if ( flag( "player_entering_commerce" ) ) break; //Sgt. Macey The 50cal has them suppressed! Move in! Move in! radio_dialogue("dcburn_mcy_50calsupp"); wait( randomintrange( 7, 11 ) ); if ( flag( "player_entering_commerce" ) ) break; //Sgt. Macey Push, push, push! We're sitting ducks out here! radio_dialogue("dcburn_mcy_sittingducks"); wait( randomintrange( 7, 11 ) ); if ( flag( "player_entering_commerce" ) ) break; //Sgt. Macey Get out of the killzone before you get your ass blown off! Move up! radio_dialogue("dcburn_mcy_blownoff"); wait( randomintrange( 7, 11 ) ); if ( flag( "player_entering_commerce" ) ) break; //Sgt. Macey Move up, get out of the killzone! radio_dialogue("dcburn_mcy_moveup"); wait( randomintrange( 7, 11 ) ); if ( flag( "player_entering_commerce" ) ) break; //Sgt. Macey Get your ass out of the killzone and into the target building, NOW! radio_dialogue( "dcburn_mcy_intotargbuilding" ); } } dialogue_nag_get_to_elevator() { grenadeHintGiven = false; //Sgt. Macey: Move up! Go! Go! level.teamleader dialogue_execute( "dcburn_mcy_lobby_move_nag_00" ); flag_set( "obj_commerce_given" ); level endon( "player_approaching_bottom_elevators" ); while( !flag( "player_approaching_bottom_elevators" ) ) { wait( randomintrange( 5, 8 ) ); if ( flag( "player_approaching_bottom_elevators" ) ) break; if ( grenadeHintGiven == false ) { //Sgt. Foley Use your grenade launchers! level.teamleader dialogue_execute( "dcburn_mcy_grenadelaunch" ); grenadeHintGiven = true; wait( randomintrange( 7, 11 ) ); } if ( flag( "player_approaching_bottom_elevators" ) ) break; //Sgt. Macey: Move in! level.teamleader dialogue_execute( "dcburn_mcy_lobby_move_nag_01" ); wait( randomintrange( 7, 11 ) ); if ( flag( "player_approaching_bottom_elevators" ) ) break; //Sgt. Macey: Push forward! Move! Move! level.teamleader dialogue_execute( "dcburn_mcy_lobby_move_nag_02" ); wait( randomintrange( 7, 11 ) ); if ( flag( "player_approaching_bottom_elevators" ) ) break; //Sgt. Macey: Keep moving forward! level.teamleader dialogue_execute( "dcburn_mcy_lobby_move_nag_03" ); wait( randomintrange( 7, 11 ) ); if ( flag( "player_approaching_bottom_elevators" ) ) break; //Sgt. Macey: Move up! Move up! level.teamleader dialogue_execute( "dcburn_mcy_lobby_move_nag_04" ); wait( randomintrange( 7, 11 ) ); } } commerce_first_floor_enemies_dead_monitor() { volume_commerce_lobby_lower = getent( "volume_commerce_lobby_lower", "targetname" ); enemies = volume_commerce_lobby_lower get_ai_touching_volume( "axis" ); while( enemies.size > 0 ) { wait( .5 ); enemies = volume_commerce_lobby_lower get_ai_touching_volume( "axis" ); } flag_set( "commerce_first_floor_enemies_dead" ); } dialogue_trenches() { bunker_radio_org_room2 = getent( "bunker_radio_org_room2", "targetname" ); flag_wait( "player_bunker_walk_02" ); //Overlord Radio Voice Ensure all weapons are condition-one and get topside to provide support. Casevac birds are under heavy fire. bunker_radio_org_room2 thread play_sound_on_entity( "dcburn_hqr_ensureweapons" ); flag_wait( "player_bunker_walk_03" ); //Ranger 1: On your feet. We're Oscar Mike level.friendly03 thread dialogue_execute( "dcburn_gr1_onyourfeet" ); flag_wait( "player_approaching_bunker_exit_hall" ); //Sgt. Macey Roger, Two-One out. level.teamleader dialogue_execute( "dcburn_mcy_rogerout" ); //Sgt. Macey: Listen up! This evac site is getting hit hard and we need to buy 'em some time. Hooah? level.teamleader dialogue_execute( "dcburn_mcy_evachithard" ); flag_set( "obj_follow_sgt_macey_given" ); level.friendly03 thread play_sound_on_entity( "dcburn_hoh_1" ); flag_wait( "player_leaving_bunker" ); battlechatter_on( "allies" ); battlechatter_on( "axis" ); array_thread( level.chattertrigsexteriror,::trigger_on ); //Overlord HQ Radio Voice All callsigns, the LZ is under heavy fire. Uncover enemy positions and engage potential targets. radio_dialogue("dcburn_hqr_uncoverengage"); flag_wait( "javelin_is_owning_fools" ); //Cpl. Dunn They've got optics on us..snipers, rpg teams and heavy arms fire, all floors...12 o'clock due west of our position. thread radio_dialogue( "dcburn_cpd_opticsonus" ); flavorbursts_on( "allies" ); level.bunker_radio_org.deleteme = true; wait( 4 ); thread dialogue_random_incoming_javelins(); wait( .75 ); //Sgt. Macey Overlord, this is Hunter 2-1. Requesting airstrike, over. level.teamleader dialogue_execute( "dcburn_mcy_reqairstrike" ); //Overlord HQ Radio Voice Uh, negative Two-One, all available air units are currently tasked with multiple casevacs along the Potomac. Proceed west to the target building and provide support, out. radio_dialogue("dcburn_hqr_alongpotomac"); thread autosave_by_name( "trench_start" ); //Sgt. Macey Everyone move up, get out of the killzone. We gotta buy some time for those casevac birds. level.teamleader dialogue_execute("dcburn_mcy_buytime"); flag_wait( "player_trench_capitol_failsafe" ); //Sgt. Macey Overlord this is Hunter Two-One. We're screening west with no adjacent support, and friendly victors from RCT One are hauling ass past us, over. level.teamleader dialogue_execute("dcburn_mcy_haulingpastus"); //Overlord HQ Radio Voice: Roger. RCT One has already peeled off an LAV to provide suppression, over." thread radio_dialogue("dcburn_hqr_humvee"); wait( 3 ); flag_set( "bradley_can_start_firing" ); //Sgt. Macey Copy that. //radio_dialogue("dcburn_mcy_copythat"); //Cpl. Dunn We're running the gauntlet with no armor or air and they give us one Humvee… //radio_dialogue("dcburn_cpd_gauntlet"); //Marine 3 Welcome to the suck. //radio_dialogue("dcburn_gm3_welcometosuck"); //Sgt. Macey Hey - no more talking. Stay frosty. //radio_dialogue("dcburn_mcy_stayfrosty"); flag_wait( "commerce_rappelers_inserting" ); wait( 1 ); if ( !flag( "player_commerce_trench_03" ) ) { //Overlord HQ Radio Voice Hunter Two-One, this is Overlord. SEAL Team Six is maneuvering into position on the northwest corner of the target building. Link up with them on the top floor and eliminate enemy fire teams, over. radio_dialogue("dcburn_hqr_linkup"); //Sgt. Macey Roger solid copy on all. //radio_dialogue("dcburn_mcy_solidcopyonall"); } if ( !flag( "player_commerce_trench_03" ) ) { //Sgt. Macey Keep your fire low...we got friendlies inserting up there. level.teamleader dialogue_execute("dcburn_mcy_firelow"); } //Cpl. Dunn I see foot mobiles...12 o'clock, 100 meters! //radio_dialogue("dcburn_cpd_footmobiles"); flag_set( "trenches_dialogue_done" ); } javelins_trench() { flag_wait( "player_approaching_bunker_exit" ); thread autosave_by_name( "javelins_trench" ); m1a1_trench = spawn_vehicle_from_targetname( "m1a1_trench" ); flag_wait( "player_leaving_bunker" ); //helicopter_crash_apache_01 = getent( "helicopter_crash_apache_01", "targetname" ); spawn_vehicles_from_targetname_and_drive( "apache_01" ); //apache.perferred_crash_location = helicopter_crash_apache_01; //apache thread apache_think(); javelin_source_org = getent( "javelin_source_org", "targetname" ); monument_heli_owned = spawn_vehicle_from_targetname( "monument_heli_owned" ); //monument_heli_owned Vehicle_TurnEngineOff(); m1a1_owned = spawn_vehicle_from_targetname( "m1a1_owned" ); m1a1_owned2 = spawn_vehicle_from_targetname( "m1a1_owned2" ); m1a1_owned2 maps\_vehicle::godon(); javelin_vehicle_targets = getentarray( "javelin_vehicle_targets", "targetname" ); array_thread( javelin_vehicle_targets,:: vehicles_cheap_waittill_destroyed_think ); flag_wait( "player_exiting_start_trench" ); spawn_vehicles_from_targetname_and_drive( "jets_monument_01" ); wait( 2 ); thread gopath( m1a1_owned ); /*----------------------- HELI OWNED BY ENEMY JAV -------------------------*/ flag_wait_either( "looking_commerce_enemy_javelin", "commerce_enemy_javeling_failsafe" ); /*----------------------- SPAWN SOME FRIENDLY FODDER TO SHOOT AT -------------------------*/ spawner = getent( "commerce_friendly_fodder", "targetname" ); spawner spawn_ai( true ); /*----------------------- HELI OWNED BY JAV -------------------------*/ newMissile = MagicBullet( "javelin_noimpact", javelin_source_org.origin, monument_heli_owned.origin ); playfx( getfx( "javelin_muzzle" ), javelin_source_org.origin ); newMissile thread javelin_earthquake(); //custom function to ensure an earthquake on impact newMissile Missile_SetTargetPos( monument_heli_owned.origin ); newMissile Missile_SetFlightmodeTop(); //Code added this command so we could make the Javelin do an arc instead of a straight line /*----------------------- SEAKNIGHT TAKES OFF -------------------------*/ seaknight_monument_takeoff_01 = get_vehicle( "seaknight_monument_takeoff_01", "script_noteworthy" ); heli_monument_path_01 = getstruct( "heli_monument_path_01", "targetname" ); seaknight_monument_takeoff_01 thread vehicle_paths( heli_monument_path_01 ); thread flag_set_delayed( "javelin_is_owning_fools", 1 ); wait( 2.5 ); thread gopath( m1a1_owned2 ); m1a1_owned2 maps\_vehicle::godoff(); /*----------------------- M1A1 #1 AND SEAKNIGHT OWNED BY JAV -------------------------*/ m1a1_owned setturrettargetent( javelin_source_org ); m1a1_owned thread vehicle_tank_fire_turret( javelin_source_org ); m1a1_owned thread m1a1_owned_think(); while( true ) { monument_heli_owned waittill( "damage", amount, attacker ); if ( ( isdefined( attacker ) ) && ( !isplayer( attacker ) ) ) break; } thread maps\dcburning_fx::monument_heli_destroyed( monument_heli_owned ); /*----------------------- OTHER TARGETS GET HIT BY JAVELINS -------------------------*/ wait( 10 ); m1a1_owned2 setturrettargetent( javelin_source_org ); m1a1_owned2 thread vehicle_tank_fire_turret( javelin_source_org ); m1a1_owned2 delaythread( 0,::vehicle_owned_by_javelin, javelin_source_org ); wait( 8 ); m1a1_trench delaythread( 0,::vehicle_owned_by_javelin, javelin_source_org ); flag_set( "second_abrams_killed" ); wait( 8 ); javelin_targets_trench = getstructarray( "javelin_targets_trench", "targetname" ); javelin_vehicle_target_array = javelin_vehicle_targets; eTargetVehicle = undefined; eTargetTrenchOrg = undefined; toggle = 1; dummy = spawn( "script_origin", ( 0, 0, 0 ) ); while ( !flag( "player_entering_top_elevator_area" ) ) { wait( randomfloatrange( 5, 8 ) ); //alternate javelin targets between vehicles and trenches // if( ( toggle == 1 ) && ( isdefined( javelin_vehicle_target_array ) ) && ( javelin_vehicle_target_array.size > 0 ) ) // { // eTargetVehicle = getclosest( level.player.origin, javelin_vehicle_target_array ); // javelin_vehicle_target_array = array_remove( javelin_vehicle_target_array, eTargetVehicle ); // eTargetVehicle vehicle_owned_by_javelin( javelin_source_org ); // toggle = 0; // } // else // { iRand = randomint( javelin_targets_trench.size ); eTargetTrenchOrg = javelin_targets_trench[ iRand ]; dummy.origin = eTargetTrenchOrg.origin; newMissile = MagicBullet( "javelin_dcburn", javelin_source_org.origin, dummy.origin ); Playfx( getfx( "javelin_muzzle" ), javelin_source_org.origin ); newMissile thread javelin_earthquake(); newMissile Missile_SetTargetEnt( dummy ); newMissile Missile_SetFlightmodeTop(); toggle = 1; // } wait( randomfloatrange( 5, 10 ) ); } dummy delete(); } m1a1_owned_think() { wait( 2 ); eTarget = getent( "javelin_source_org", "targetname" ); self setTurretTargetEnt( eTarget, ( 0, 0, -60 ) ); self waittill_notify_or_timeout( "turret_rotate_stopped", 1.0 ); self notify( "turret_fire" ); flag_wait_either( "player_trench_capitol_failsafe", "blow_up_abrams" ); self thread radius_damage_m1a1_owned(); self delaythread( 0,::vehicle_owned_by_javelin, eTarget ); } radius_damage_m1a1_owned() { self waittill( "death" ); if ( distance( self.origin, level.player.origin ) < 1024 ) { level.player DoDamage( 50 / level.player.damageMultiplier, level.player.origin ); } } apache_think() { // self endon( "death" ); // flag_wait( "apache_commerce" ); // javelin_source_org = getent( "javelin_source_org", "targetname" ); // attractor = Missile_CreateAttractorEnt( self, 100000, 100000 ); // MagicBullet( "rpg", javelin_source_org.origin, self.origin ); // while( isdefined( self ) ) // { // self waittill( "damage", amount, attacker ); // if ( !isdefined ( attacker ) ) // continue; // if ( isplayer( attacker ) ) // continue; // break; // } // self notify( "death" ); } vehicle_tank_fire_turret( eTarget ) { self endon( "death" ); tank_50cal = self.mgturret[ 0 ]; while ( isdefined( self ) ) { tank_50cal settargetentity( eTarget ); iBurstNumber = randomfloatrange( 1.5, 3 ); tank_50cal startfiring(); wait( iBurstNumber ); tank_50cal stopfiring(); wait( randomfloatrange( 3, 6 ) ); } } vehicle_heli_fire_turret( eTarget ) { self endon( "death" ); self notify( "stop_firing_turret" ); self endon( "stop_firing_turret" ); fireTime = .1; while ( isdefined( self ) ) { burstsize = randomintrange( 10, 20 ); if ( !self.firingMissiles ) { for ( i = 0; i < burstsize; i++ ) { self setturrettargetent( eTarget, randomvector( 50 ) + ( 0, 0, 32 ) ); self fireweapon(); wait fireTime; } } else wait( .5 ); wait( randomfloatrange( 2, 3 ) ); } } helis_monument() { flag_wait( "player_leaving_bunker" ); helis_monument = spawn_vehicles_from_targetname( "helisquad_monument" ); //array_call( helis_monument,::Vehicle_TurnEngineOff ); flag_wait( "player_approaching_monument" ); array_call( helis_monument,::Vehicle_SetSpeed, 100 ); array_thread( helis_monument,::gopath ); } helis_monument_ground() { flag_wait( "player_leaving_bunker" ); helis_monument = spawn_vehicles_from_targetname( "helisquad_monument_ground" ); // foreach( heli in helis_monument ) // { // if ( ( isdefined( heli.script_noteworthy ) ) && ( heli.script_noteworthy == "seaknight_monument_takeoff_01" ) ) // heli Vehicle_TurnEngineOff(); // } array_thread( helis_monument, maps\_vehicle::godon ); } helis_monument_cargo() { flag_wait( "player_leaving_bunker" ); helis_monument_cargo = spawn_vehicles_from_targetname( "helis_monument_cargo" ); helis_monument_cargo_noliftoff = spawn_vehicles_from_targetname( "helis_monument_cargo_noliftoff" ); //array_call( helis_monument_cargo_noliftoff,::Vehicle_TurnEngineOff ); flag_wait( "player_approaching_monument" ); array_thread( helis_monument_cargo,:: heli_cargo_liftoff_and_go ); array_thread( helis_monument_cargo_noliftoff,::gopath ); } capitol_trench() { flag_wait_either( "player_trench_looking_capitol", "player_trench_capitol_failsafe" ); jets = spawn_vehicles_from_targetname_and_drive( "jets_capitol_01" ); } //commerce_lasers() //{ // laser_orgs = getentarray( "laser_orgs", "targetname" ); // flag_wait( "javelin_is_owning_fools" ); // aTargets = getentarray( "target_crowsnest", "targetname" ); // array_thread( laser_orgs,::commerce_lasers_think, aTargets ); //} //commerce_lasers_think( aTargets ) //{ // while( !flag( "second_abrams_killed" ) ) // { // iRand = randomint( aTargets.size ); // wait( randomfloatrange( 1.2, 3.4 ) ); // } //} humvee_commerce_left() { flag_wait( "player_approaching_bunker_exit" ); humvee_spotlight_left = spawn_vehicle_from_targetname( "humvee_spotlight_left" ); /*----------------------- HUMVEE SPOTLIGHT SETUP -------------------------*/ humvee_spotlight_left humvee_spotlight_setup(); flag_wait( "javelin_is_owning_fools" ); aTargets = getentarray( "target_crowsnest", "targetname" ); humvee_spotlight_left.turret settargetentity( aTargets[ randomint( aTargets.size ) ] ); wait( 1.5 ); playfxontag( getfx( "_attack_heli_spotlight" ), humvee_spotlight_left.turret, "tag_flash" ); while( !flag( "second_abrams_killed" ) ) { humvee_spotlight_left.turret settargetentity( aTargets[ randomint( aTargets.size ) ] ); wait( randomfloatrange( 1.2, 3.4 ) ); } target_for_humvee_left = getent( "target_for_humvee_left", "targetname" ); humvee_spotlight_left.turret settargetentity( target_for_humvee_left ); wait( .5 ); humvee_spotlight_left.spotlight_org delete(); humvee_spotlight_left.turret delete(); flag_set( "humvee_commerce_left_done_with_spotlight" ); humvee_spotlight_left thread gopath(); humvee_spotlight_left waittill( "reached_end_node" ); /*----------------------- CLEANUP -------------------------*/ humvee_spotlight_left vehicle_delete(); } humvee_commerce() { flag_wait( "player_approaching_bunker_exit" ); humvee_spotlight = spawn_vehicle_from_targetname( "humvee_spotlight" ); humvee_spotlight maps\_vehicle::godon(); HummerTurret = humvee_spotlight.mgturret[ 0 ]; /*----------------------- HUMVEE SPOTLIGHT SETUP -------------------------*/ humvee_spotlight humvee_spotlight_setup(); flag_wait( "humvee_commerce_left_done_with_spotlight" ); humvee_spotlight.turret thread humvee_spotlight_think( humvee_spotlight, HummerTurret ); /*----------------------- HUMVEE SPOTLIGHT TARGETS RAPPELERS FOR A WHILE -------------------------*/ flag_wait( "commerce_rappelers_rappeling" ); if ( isdefined( level.commercerappelers ) ) { while( level.commercerappelers.size > 0 ) { wait( 0.05 ); if ( flag( "commerce_rappelers_done" ) ) break; iRand = randomint( level.commercerappelers.size ); level.commercerappelers = remove_dead_from_array( level.commercerappelers ); eTarget = level.commercerappelers[ iRand ]; if ( isdefined( eTarget ) ) { humvee_spotlight.eTarget = eTarget; wait( randomfloatrange( 2.2, 4.4 ) ); } } } /*----------------------- CLEANUP -------------------------*/ flag_wait( "player_entering_top_elevator_area" ); /*----------------------- CLEANUP -------------------------*/ flag_wait( "player_in_crowsnest_room" ); humvee_spotlight.spotlight_org delete(); humvee_spotlight.turret delete(); aRiders = humvee_spotlight.riders; array_thread( aRiders, ::AI_delete ); humvee_spotlight vehicle_delete(); flag_set( "humvee_spotlight_deleted" ); } bradley_commerce() { flag_wait( "player_approaching_bunker_exit" ); level.bradley_commerce = spawn_vehicle_from_targetname( "bradley_commerce" ); level.bradley_commerce maps\_vehicle::godon(); flag_wait( "bradley_can_start_firing" ); iFireTime = weaponfiretime( "bradley_turret" ); aDefaultTargets = getentarray( "humvee_spotlight_targets", "targetname" ); targetLoc = undefined; level.bradley_commerce.weaponrange = 6000; bradleyDefaultTargets = getentarray( "bradley_default_targets", "targetname" ); level.bradley_commerce.fireAtDefaultTargets = true; level.bradley_commerce.firing = true; while( !flag( "player_entering_top_elevator_area" ) ) { wait( 0.05 ); /*----------------------- KILL ANY PREFERRED TARGETS -------------------------*/ if ( level.bradley_commerce.firing == false ) { wait( 1 ); continue; } if ( ( isdefined( level.bradleyPreferredTargets ) ) && ( level.bradleyPreferredTargets.size > 0 ) ) { level.bradleyPreferredTargets = remove_dead_from_array( level.bradleyPreferredTargets ); if ( level.bradleyPreferredTargets.size == 0 ) continue; iRand = randomInt( level.bradleyPreferredTargets.size ); eTarget = level.bradleyPreferredTargets[ iRand ]; eTarget.health = 1; } else if ( level.bradley_commerce.fireAtDefaultTargets ) { iRand = randomInt( bradleyDefaultTargets.size ); eTarget = bradleyDefaultTargets[ iRand ]; } /*----------------------- OTHERWISE JUST GET A TARGET -------------------------*/ else eTarget = level.bradley_commerce vehicle_get_target(); if ( !isdefined( eTarget ) ) { wait( randomfloatrange( 2, 4 ) ); continue; } /*----------------------- SHOOT AT THE TARGET -------------------------*/ //targetLoc = eTarget gettagorigin( "tag_eye" ); level.bradley_commerce setturrettargetent( eTarget ); level.bradley_commerce waittill_notify_or_timeout( "turret_rotate_stopped", 1 ); iBurstNumber = randomfloatrange( 2, 6 ); i = 0; while ( i < iBurstNumber ) { i++ ; iFireTime = weaponfiretime( "bradley_turret" ); wait( iFireTime ); level.bradley_commerce fireWeapon(); earthquake( 0.25, .13, level.bradley_commerce.origin, 1024 ); } wait( randomfloatrange( 1.5, 5 ) ); } level.bradley_commerce vehicle_delete(); } humvee_magically_kill_dude( eTarget ) { eTarget endon( "death" ); if ( ( !isdefined( eTarget) ) || ( !isalive( eTarget ) ) ) return; targetTagOrigin = eTarget gettagorigin( "tag_eye" ); magicbullet( "m14_scoped", self.origin, targetTagOrigin ); bullettracer( self.origin, targetTagOrigin, true ); playfxontag( getfx( "headshot" ), eTarget, "tag_eye" ); } vehicle_get_target() { eTarget = undefined; switch( self.vehicletype ) { case "zpu_antiair": eTarget = self.defaultTargets[ randomint( self.defaultTargets.size ) ]; break; case "bradley": // getEnemyTarget( fRadius, iFOVcos, getAITargets, doSightTrace, getVehicleTargets, randomizeTargetArray, aExcluders ) eTarget = maps\_helicopter_globals::getEnemyTarget( self.weaponrange, level.cosine[ "180" ], true, false, false, true ); break; case "btr80": // getEnemyTarget( fRadius, iFOVcos, getAITargets, doSightTrace, getVehicleTargets, randomizeTargetArray, aExcluders ) eTarget = maps\_helicopter_globals::getEnemyTarget( level.CannonRange, level.cosine[ "180" ], true, true, false, true ); break; } if ( isdefined( eTarget ) ) return eTarget; } commerce_rappelers() { flag_wait( "player_commerce_trench_01" ); if ( getdvarint( "r_dcburning_culldist" ) == 1 ) { flag_set( "commerce_rappelers_inserting" ); flag_set( "commerce_rappelers_rappeling" ); flag_set( "commerce_rappelers_done" ); } else { blackhawk_commerce_rappel = spawn_vehicle_from_targetname_and_drive( "blackhawk_commerce_rappel" ); level.commercerappelers = blackhawk_commerce_rappel.riders; array_thread( level.commercerappelers,::commerce_rappelers_think ); flag_set( "commerce_rappelers_inserting" ); flag_wait( "commerce_rappelers_rappeling" ); wait( 6 ); flag_set( "commerce_rappelers_done" ); } } commerce_rappelers_think() { self endon( "death" ); self setthreatbiasgroup( "oblivious" ); eAnimEnt = getent( self.target, "targetname" ); sRappelAnim = eAnimEnt.animation; self.eExploder = undefined; if ( isdefined( eAnimEnt.target ) ) { aExploderArray = getentarray( eAnimEnt.target, "targetname" ); foreach ( exploderpiece in aExploderArray ) { if ( isdefined( exploderpiece.script_exploder ) ) { self.iExploderNum = exploderpiece.script_exploder; self.ExploderOrg = exploderpiece.origin; break; } } } self waittill( "jumpedout" ); eAnimEnt anim_generic_first_frame( self, sRappelAnim ); if ( !flag( "commerce_rappelers_rappeling" ) ) flag_set( "commerce_rappelers_rappeling" ); eAnimEnt anim_generic( self, sRappelAnim ); self delete(); } rappel_window_exploder( guy ) { assertex( isdefined( guy.iExploderNum ), "AI with export " + guy.export + " needs his target to target a window exploder" ); fxOrg = guy.ExploderOrg; exploder( guy.iExploderNum ); thread play_sound_in_space( "glass_break", fxOrg ); playfx( getfx( "commerce_window_shatter" ), fxOrg ); } humvee_spotlight_think( humvee, HummerTurret ) { //self ==> spotlight turret humvee endon( "death" ); self endon( "death" ); targets = getentarray( "humvee_spotlight_targets", "targetname" ); self.defaultTarget = targets[0]; self thread humvee_default_targets_think( targets, self ); self settargetentity( targets[ 0 ] ); wait( .5 ); HummerTurret setmode( "manual" ); HummerTurret StopFiring(); HummerTurret SetTargetEntity( targets[ 0 ] ); HummerTurret.dontshoot = true; if ( getdvarint( "sm_enable" ) ) { playfxontag( getfx( "_attack_heli_spotlight" ), self, "tag_flash" ); } self thread spotlight_preferred_targets(); offset = ( 0, 0, 32 ); while ( isdefined( self ) ) { if ( isdefined( self.spotlightPreferredTarget ) ) { self settargetentity( self.spotlightPreferredTarget, offset ); if ( isdefined( HummerTurret ) ) HummerTurret SetTargetEntity( self.spotlightPreferredTarget, offset ); } else if ( isdefined( humvee.eTarget ) ) { self settargetentity( humvee.eTarget, offset ); if ( isdefined( HummerTurret ) ) HummerTurret SetTargetEntity( humvee.eTarget, offset ); } else { if ( isdefined( self.defaultTarget ) ) { self settargetentity( self.defaultTarget ); if ( isdefined( HummerTurret ) ) HummerTurret SetTargetEntity( self.defaultTarget ); } } wait( 0.05 ); } } spotlight_preferred_targets() { self endon( "death" ); self.spotlightPreferredTarget = undefined; self thread find_player_attacker_for_spotlight( self ); flag_wait_either( "player_touching_commerce_lobby_right", "player_touching_commerce_lobby_left" ); /*----------------------- POINT SPOTLIGHT AT ENEMIES NEAR PLAYER, OR ONES DAMAGING PLAYER -------------------------*/ volume_commerce_lobby_lower = getent( "volume_commerce_lobby_lower", "targetname" ); volume_commerce_lobby_upper = getent( "volume_commerce_lobby_upper", "targetname" ); enemies1 = volume_commerce_lobby_lower get_ai_touching_volume( "axis" ); enemies2 = volume_commerce_lobby_upper get_ai_touching_volume( "axis" ); aAI = undefined; while ( ( isdefined( self ) ) && ( !flag( "player_entering_top_elevator_area" ) ) ) { aAI = array_merge( enemies1, enemies2 ); aAI = remove_dead_from_array( aAI ); if ( ( isdefined( level.playerAttacker ) ) && ( is_in_array( aAI, level.playerAttacker ) ) ) self.spotlightPreferredTarget = level.playerAttacker; else { if ( aAI.size > 0 ) self.spotlightPreferredTarget = getClosest( level.player.origin, aAI ); } if ( isdefined( self.spotlightPreferredTarget ) ) wait( randomfloatrange( 3, 5 ) ); else wait( .5 ); enemies1 = volume_commerce_lobby_lower get_ai_touching_volume( "axis" ); //want to get these guys again in case more spawned in } /*----------------------- FIFTH FLOOR - POINT SPOTLIGHT AT ENEMY WINDOWS NEAREST PLAYER -------------------------*/ flag_wait( "player_entering_top_elevator_area" ); humvee_spotlight_targets_upper = getentarray( "humvee_spotlight_targets_upper", "targetname" ); aAI = undefined; while ( isdefined( self ) ) { wait( randomfloatrange( 2, 4 ) ); // aAI = getaiarray( "axis" ); // if ( aAI.size == 0 ) // continue; // guy = getClosest( level.player.origin, aAI ); // self.spotlightPreferredTarget = getClosest( guy.origin, humvee_spotlight_targets_upper ); self.spotlightPreferredTarget = humvee_spotlight_targets_upper[ randomint( humvee_spotlight_targets_upper.size ) ]; } } find_player_attacker_for_spotlight( spotlight_turret ) { self endon( "death" ); level.playerAttacker = undefined; while( isdefined( self ) ) { level.player waittill( "damage", amount, attacker ); if ( !isdefined ( attacker ) ) continue; if ( ( isdefined ( attacker.team ) ) && ( attacker.team == "axis" ) ) { level.playerAttacker = attacker; self waittill_death_or_timeout( 4 ); if ( level.playerAttacker == self ) level.playerAttacker = undefined; } } } humvee_default_targets_think( targets, turret ) { self endon( "death" ); while ( isdefined( turret ) ) { foreach( target in targets ) { turret.defaultTarget = target; wait( randomfloatrange( 3, 6 ) ); } } //cleanup foreach( target in targets ) target delete(); } humvee_convoy() { flag_wait( "player_approaching_bunker_exit" ); humvee_convoy_00 = getentarray( "humvee_convoy_00", "targetname" ); if ( getdvarint( "r_dcburning_culldist" ) == 1 ) { //make vehicle convoy a bit thinner on minspec thread drone_vehicle_flood_start( humvee_convoy_00, "humvee_convoy_00", 7, 10, true ); } else { thread drone_vehicle_flood_start( humvee_convoy_00, "humvee_convoy_00", 3.1, 4.8, true ); } flag_wait( "player_at_top_of_pavlovs_ramp" ); drone_vehicle_flood_stop( "humvee_convoy_00" ); } /**************************************************************************** COMMERCE BUILDING - ELEVATOR_BOTTOM ****************************************************************************/ AA_elevator_bottom_init() { thread atrium_guys(); thread dialogue_elevator_bottom_to_top(); thread samsite_flyby(); thread AAA_sequence_elevator_bottom_to_top(); flag_wait( "player_entering_top_elevator_area" ); thread AA_elevator_top_init(); } samsite_flyby() { level endon( "player_entering_top_elevator_area" ); flag_wait( "player_near_samsite" ); spawn_vehicles_from_targetname_and_drive( "jets_samsite" ); } AAA_sequence_elevator_bottom_to_top() { flag_wait_either( "player_touching_commerce_lobby_right", "player_touching_commerce_lobby_left" ); thread AI_squad_fixed_node_interior(); aFodder_friendlies = []; aSpawners = undefined; if( flag( "player_touching_commerce_lobby_left" ) ) { aSpawners = getentarray( "friendlies_commerce_lobby_left", "targetname" ); } else { aSpawners = getentarray( "friendlies_commerce_lobby_right", "targetname" ); } foreach( spawner in aSpawners ) { guy = spawner spawn_ai( true ); if ( isdefined( guy ) ) { aFodder_friendlies = array_add( aFodder_friendlies, guy ); } } array_thread( aFodder_friendlies, ::AI_fixednode_off ); array_thread( aFodder_friendlies, ::try_to_magic_bullet_shield ); foreach( guy in aFodder_friendlies ) { if( !isdefined( guy ) ) continue; guy.attackeraccuracy = 0; //guy.useChokePoints = true; } thread elevator_start(); flag_wait( "player_approaching_bottom_elevators" ); thread autosave_by_name( "bottom_elevators" ); array_thread( aFodder_friendlies, ::stop_magic_bullet_shield ); foreach( guy in aFodder_friendlies ) { if( !isdefined( guy ) ) continue; guy.attackeraccuracy = .1; } array_thread( aFodder_friendlies, ::AI_redshirt_think ); /*----------------------- PLAYER ENTERING COURTYARD -------------------------*/ flag_wait( "player_entering_courtyard" ); if ( getdvarint( "r_dcburning_culldist" ) == 1 ) { setculldist( 0 ); } /*----------------------- TRY TO THIN OUT LOBBY ENEMIES -------------------------*/ thread AI_cleanup_volume( "volume_commerce_lobby_upper", "axis" ); thread AI_cleanup_volume( "volume_commerce_lobby_lower", "axis" ); /*----------------------- ALL ATRIUM ENEMIES GO INTO AMBUSH MODE -------------------------*/ flag_wait( "player_headed_to_atrium_side_hall" ); aAI = getaiarray( "axis" ); array_thread( aAI,::AI_ambush_behavior ); /*----------------------- PLAYER ENTERING COURTYARD SIDE HALL -------------------------*/ flag_wait( "player_entering_commerce_side_hall" ); flag_set( "stop_elevator_doors" ); wait( 8 ); thread waittill_targetname_volume_dead_then_set_flag( "volume_courtyard_windows", "courtyard_has_been_cleared"); flag_wait( "player_heading_up_to_mezzanine" ); /*----------------------- PAVLOV STREET DRONES -------------------------*/ //pavlov_ai = []; //drone_warriors_pavlov = getentarray( "drone_warriors_pavlov", "targetname" ); //friendlies_pavlov_street = getentarray( "friendlies_pavlov_street", "targetname" ); //hostiles_pavlov_street = getentarray( "hostiles_pavlov_street", "targetname" ); //spawners = array_merge( friendlies_pavlov_street, drone_warriors_pavlov ); //spawners = array_merge( spawners, hostiles_pavlov_street ); //foreach( spawner in spawners ) //{ // pavlov_ai[ pavlov_ai.size ] = spawner spawn_ai( true ); //} //drone_flood_pavlov = getentarray( "drone_flood_pavlov", "targetname" ); //thread drone_flood_start( drone_flood_pavlov, "drone_flood_pavlov" ); /*----------------------- MEZZANINE -------------------------*/ flag_wait( "player_entering_mezzanine_top" ); thread waittill_targetname_volume_dead_then_set_flag( "volume_commerce_lobby_upper", "mezzanine_top_has_been_cleared" ); spawn_vehicles_from_targetname_and_drive( "jets_mezz_01" ); flag_wait( "player_approaching_pavlov_hole" ); delaythread( 0, ::spawn_vehicles_from_targetname_and_drive, "helis_mezzanine" ); /*----------------------- HEADED TO FOURTH FLOOR -------------------------*/ flag_wait( "player_at_bottom_of_pavlovs_ramp" ); thread AI_cleanup( "axis" ); /*----------------------- SPAWN SAM SITE HOSTILES AND FRIENDLY FODDER -------------------------*/ thread samsite_enemy_chatter(); battlechatter_off( "allies" ); commerce_allied_fodder_4 = array_spawn( getentarray( "commerce_allied_fodder_4", "targetname" ), true ); hostiles_commerce_samsite = array_spawn( getentarray( "hostiles_commerce_samsite", "targetname" ), true ); samsite = samsite_setup( "samsite_commerce_01", "player_at_top_of_pavlovs_ramp", "commerce_samsite_revealed" ); commerce_samsite_nodes = getnodearray( "commerce_samsite_nodes", "targetname" ); eNode = getclosest( samsite.operator.origin, commerce_samsite_nodes ); commerce_samsite_nodes = array_remove( commerce_samsite_nodes, eNode ); samsite.operator thread samsite_ai_think( eNode ); samsite.puller thread samsite_ai_think( commerce_samsite_nodes[ 0 ] ); samsite.turret thread samsite_turret_think(); samsite thread samsite_c4_think(); /*----------------------- SAM SITE HOSTILES ALERTED! -------------------------*/ flag_wait_any( "player_entering_fourth_floor", "player_shot_at_samsite_guys", "player_gawking_at_fourth_floor_guys" ); flag_set( "player_shot_at_samsite_guys" ); battlechatter_on( "allies" ); if( !flag( "player_entering_fourth_floor" ) ) { thread dummy_trigger( "dummy_colornodes_pavlov_end" ); //make friendlies move up activate_trigger( "spawner_hostiles_commerce_floor4", "targetname", level.player ); //spawn enemies across balcony, etc } array_thread( commerce_allied_fodder_4,::AI_delete ); wait( 4 ); thread waittill_targetname_volume_dead_then_set_flag( "volume_commerce_fourth_floor", "floor_four_has_been_cleared" ); flag_wait_either( "floor_four_has_been_cleared", "player_headed_to_fifth_floor" ); /*----------------------- HEADED TO FIFTH FLOOR -------------------------*/ flag_wait( "player_headed_to_fifth_floor" ); battlechatter_off( "allies" ); //array_thread( pavlov_ai,::AI_delete ); thread AI_cleanup_non_squad( "all" ); } samsite_c4_think() { //self ==> the samsite struct c4_locations = getstructarray( "c4_slamraam", "script_noteworthy" ); foreach( c4_location in c4_locations ) { //c4_location( tag, origin_offset, angles_offset, org ) level.c4_models[ level.c4_models.size ] = self.base maps\_c4::c4_location( undefined, undefined, undefined, c4_location.origin ); } self.base waittill( "c4_detonation" ); self.base notify( "death" ); flag_set( "slamraam_c4_detonated" ); self.base setmodel( "vehicle_slamraam_destroyed" ); //playfx( getfx( "vehicle_explosion_slamraam" ), self.base.origin ); playfx( getfx( "large_vehicle_explosion" ), self.base.origin ); thread play_sound_in_space( "exp_slamraam_destroyed", self.base.origin ); self.turret delete(); radiusDamage( self.base.origin + ( 0, 0, 96 ), 180, 1000, 50 ); fx = spawnFx( getFx( "thin_black_smoke_L" ), self.base.origin ); triggerFx( fx ); earthquake( 0.6, 1.2, self.base.origin, 1600 ); if ( distance( self.base.origin, level.player.origin ) < 2048 ) level.player PlayRumbleOnEntity( "damage_heavy" ); flag_wait( "player_entering_top_elevator_area" ); fx delete(); } atrium_guys() { flag_wait( "player_approaching_bottom_elevators" ); spawners = getentarray( "atrium_guys", "targetname" ); atrium_guys = []; guy = undefined; puller = undefined; foreach ( spawner in spawners ) { guy = spawner dronespawn(); guy setcontents( 0 ); guy.noragdoll = true; guy.nocorpsedelete = true; guy.ignoreme = true; guy.reference = spawner; guy.dontDoNotetracks = true; //allows using of ai _anim functons without getting errors guy.script_looping = 0; //will force drone to scip default idle behavior guy gun_remove(); guy.deathanim = level.scr_anim[ "generic" ][ spawner.animation + "_death" ]; assert( isdefined( guy.deathanim ) ); atrium_guys[ atrium_guys.size ] = guy; guy.puller = false; if ( spawner.animation == "airport_civ_dying_groupB_pull" ) puller = guy; guy.animation = spawner.animation; guy.reference anim_generic_first_frame( guy, guy.animation ); } flag_wait( "player_entering_courtyard" ); atrium_guys[ 0 ].reference thread anim_generic( atrium_guys[ 0 ], atrium_guys[ 0 ].animation ); atrium_guys[ 1 ].reference thread anim_generic( atrium_guys[ 1 ], atrium_guys[ 1 ].animation ); wait( 0.05 ); atrium_guys[ 0 ] setAnimTime( level.scr_anim[ "generic" ][ atrium_guys[ 0 ].animation ], .5 ); atrium_guys[ 1 ] setAnimTime( level.scr_anim[ "generic" ][ atrium_guys[ 1 ].animation ], .5 ); array_thread( atrium_guys,::atrium_guys_end_of_anim ); flag_wait_either( "atrium_guys_at_end_of_anim", "player_entering_courtyard2" ); atrium_bullet = getent( "atrium_bullet", "targetname" ); headOrigin = puller gettagorigin( "tag_eye" ); vec = vectornormalize( headOrigin - atrium_bullet.origin ); thread play_sound_in_space( "weap_deserteagle_fire_npc", atrium_bullet.origin ); PlayFX( getfx( "headshot" ), headOrigin, vec ); magicbullet( "m14_scoped", atrium_bullet.origin, headOrigin ); bullettracer( atrium_bullet.origin, headOrigin, true ); foreach( guy in atrium_guys ) { guy kill(); } atrium_drag_blocker = getent( "atrium_drag_blocker", "targetname" ); atrium_drag_blocker hide_entity(); } atrium_guys_end_of_anim() { level endon( "player_entering_courtyard2" ); level endon( "atrium_guys_at_end_of_anim" ); self waittillmatch( "single anim", "end" ); flag_set( "atrium_guys_at_end_of_anim" ); } samsite_enemy_chatter() { samsite_chater_org = getent( "samsite_chater_org", "targetname" ); origin = samsite_chater_org.origin; sFlagToKillDialogue = "player_shot_at_samsite_guys"; level endon( sFlagToKillDialogue ); while( !flag( sFlagToKillDialogue ) ) { // Russian Airborne 1 Lieutenant Gureyvich, we have acquired two enemy aircrafts approaching, airspeed 500 knots, altitude 320 metres! play_sound_then_kill_on_flag( "dcburn_ra1_acquiredtwo", origin, sFlagToKillDialogue ); // Russian Airborne 2 Good! Lock on and engage the targets! play_sound_then_kill_on_flag( "dcburn_ra2_lockon", origin, sFlagToKillDialogue ); wait( 1 ); // Russian Airborne 3 Missile locked on and ready to fire! play_sound_then_kill_on_flag( "dcburn_ra3_missilelocked", origin, sFlagToKillDialogue ); wait( .5 ); // Russian Airborne 1 Two more southbound aircrafts, airspeed 620 knots, altitude 400 metres! play_sound_then_kill_on_flag( "dcburn_ra1_2moresouthbound", origin, sFlagToKillDialogue ); // Russian Airborne 2 Fire missile! play_sound_then_kill_on_flag( "dcburn_ra2_firemissile", origin, sFlagToKillDialogue ); // Russian Airborne 3 Yes sir! Firing missile! play_sound_then_kill_on_flag( "dcburn_ra3_firingmissile", origin, sFlagToKillDialogue ); wait( 1.5 ); // Russian Airborne 1 2 targets, moving north, 500 meters! play_sound_then_kill_on_flag( "dcburn_ra1_movingnorth", origin, sFlagToKillDialogue ); wait( 1 ); // Russian Airborne 2 Left, 10 degrees! play_sound_then_kill_on_flag( "dcburn_ra2_10degrees", origin, sFlagToKillDialogue ); } } samsite_ai_think( eNode ) { self endon( "death" ); self.ignorerandombulletdamage = true; self thread AI_hostiles_commerce_samsite_think(); self waittill_either( "damage", "alerted" ); // if ( !isdefined( attacker ) ) // continue; // if ( isPlayer( attacker ) ) // { // self thread stop_magic_bullet_shield(); // self.allowdeath = true; // self stopanimscripted(); // self notify( "alerted" ); // self.ignoreme = false; // if ( isdefined( type ) ) // { // if ( ( type == "MOD_PROJECTILE" ) || ( type == "MOD_PROJECTILE_SPLASH" ) || ( type == "MOD_GRENADE_SPLASH" ) || ( type == "MOD_GRENADE" ) ) // self kill(); // } // break; // } self anim_stopanimscripted(); self.ignorerandombulletdamage = false; self.ignoreme = false; self.ignoreme = false; self notify( "alerted" ); self setgoalnode( eNode ); } samsite_turret_think() { self endon( "death" ); flag_wait( "commerce_samsite_revealed" ); time = 4.5; self rotateto( self.angles + ( 0, -50 , 0 ), time, 2, 2 ); wait( time / 2 ); targetOrg = getent( "slamraam_missile_target", "targetname" ); while( !flag( "player_approaching_fourth_floor_sam" ) ) { self detach( "projectile_slamraam_missile", self.missileTags[ 0 ] ); earthquake( .3, .5, self.origin, 1600 ); magicBullet( "slamraam_missile_dcburning", self gettagorigin( self.missileTags[ 0 ] ), targetOrg.origin ); self.missileTags = array_remove( self.missileTags, self.missileTags[ 0 ] ); if ( self.missileTags.size < 1 ) break; wait( randomfloatrange( .3, 2 ) ); } } samsite_setup( targetname, sFlagToStart, sFlagToSetWhenDone ) { /*----------------------- SETUP SAMSITE AI AND RETURN TO CALLER -------------------------*/ aSamsiteComponents = getentarray( targetname, "targetname" ); eSamsiteBase = undefined; eSamsiteTarp = undefined; eSamsiteTurret = undefined; aSpawners = []; foreach( thing in aSamsiteComponents ) { if( isspawner( thing ) ) { aSpawners[ aSpawners.size ] = thing; continue; } if ( thing.code_classname == "script_model" ) { switch ( thing.model ) { case "slamraam_tarp": eSamsiteTarp = thing; break; case "vehicle_slamraam_launcher_no_spike": eSamsiteTurret = thing; break; case "vehicle_slamraam_base": eSamsiteBase = thing; break; } } } aAI_samsite = array_spawn( aSpawners, true ); foreach( guy in aAI_samsite ) { //guy.allowdeath = false; guy.ignoreme = true; guy.ignoreall = true; //guy thread magic_bullet_shield(); } assertex( aAI_samsite.size == 2, "Need exactly 2 AI for the sam site" ); assert( isdefined( eSamsiteTarp ) ); assert( isdefined( eSamsiteTurret ) ); assert( isdefined( eSamsiteBase ) ); eSamsiteTarp.animname = "tarp"; eSamsiteTarp assign_animtree(); aAI_samsite[ 0 ].animname = "operator"; aAI_samsite[ 1 ].animname = "puller"; aSamSiteActors = aAI_samsite; aSamSiteActors = array_add( aSamSiteActors, eSamsiteTarp ) ; eSamsiteTurret.missileTags = []; eSamsiteTurret.missileTags[ 0 ] = "tag_missle1"; eSamsiteTurret.missileTags[ 1 ] = "tag_missle2"; eSamsiteTurret.missileTags[ 2 ] = "tag_missle3"; eSamsiteTurret.missileTags[ 3 ] = "tag_missle4"; eSamsiteTurret.missileTags[ 4 ] = "tag_missle5"; eSamsiteTurret.missileTags[ 5 ] = "tag_missle6"; eSamsiteTurret.missileTags[ 6 ] = "tag_missle7"; eSamsiteTurret.missileTags[ 7 ] = "tag_missle8"; foreach( tag in eSamsiteTurret.missileTags ) { eSamsiteTurret Attach( "projectile_slamraam_missile", tag, true ); } samsite = spawnstruct(); samsite.operator = aAI_samsite[ 0 ]; samsite.puller = aAI_samsite[ 1 ]; samsite.turret = eSamsiteTurret; samsite.base = eSamsiteBase; /*----------------------- MAKE SAMSITE GO ONCE FLAG SET -------------------------*/ eSamsiteBase thread samsite_tarp_think( aSamSiteActors, sFlagToStart, sFlagToSetWhenDone ); /*----------------------- RETURN SAMSITE AI TO CALLER -------------------------*/ return samsite; } samsite_tarp_think( aSamSiteActors, sFlagToStart, sFlagToSetWhenDone ) { //self ==> the samsite base self anim_first_frame( aSamSiteActors, "pulldown" ); flag_wait( sFlagToStart ); self anim_single( aSamSiteActors, "pulldown" ); flag_set( sFlagToSetWhenDone ); } AI_hostiles_commerce_samsite_think() { self endon( "death" ); self.ignoreme = true; self.ignoreall = true; self.old_goalradius = self.goalradius; self.goalradius = 16; self thread AI_sneak_monitor( "player_shot_at_samsite_guys" ); self thread AI_samsite_player_too_close(); self waittill( "alerted" ); self.goalradius = self.old_goalradius; self.combatMode = "ambush"; self.ignoreall = false; self.ignoreme = false; } AI_samsite_player_too_close() { self endon( "death" ); self endon( "alerted" ); flag_wait_any( "player_entering_fourth_floor", "player_shot_at_samsite_guys", "player_gawking_at_fourth_floor_guys" ); flag_set( "player_shot_at_samsite_guys" ); self thread AI_become_alerted(); } elevator_dude_think( spawner ) { sLoop = "dcburning_elevator_corpse_idle_A"; sNudge = "dcburning_elevator_corpse_bump_A"; self.allowdeath = false; self.dontDoNotetracks = true; //allows using of ai _anim functons without getting errors self.script_looping = 0; self gun_remove(); self setcontents( 0 ); self.ignoreme = true; self setlookattext( "", &"" ); reference = spawner; iAnimSwitched = 0; elevator_clip = getent( "elevator_clip", "targetname" ); elevator_clip.origin = elevator_clip.origin + ( 0, 0, 32 ); self stopanimscripted(); while( !flag( "stop_elevator_doors" ) ) { reference thread anim_generic_loop( self, sLoop, "stop_idle" ); self waittill( "doors_closing" ); reference notify( "stop_idle" ); if ( ( flag( "player_looking_at_elevator" ) ) && ( isdefined( iAnimSwitched ) ) ) { iAnimSwitched = undefined; reference anim_generic( self, "dcburning_elevator_corpse_trans_A_2_B" ); sLoop = "dcburning_elevator_corpse_idle_B"; sNudge = "dcburning_elevator_corpse_bump_B"; } reference anim_generic( self, sNudge ); } self delete(); } elevator_start() { spawner = getent( "elevator_dude", "targetname" ); elevator_dude = spawner dronespawn(); elevator_dude thread elevator_dude_think( spawner ); elevator_door_left = getent( "elevator_door_left", "targetname" ); elevator_door_right = getent( "elevator_door_right", "targetname" ); elevator_door_left.startPos = elevator_door_left.origin; elevator_door_right.startPos = elevator_door_right.origin; movedistLeft = 28; movedistRight = -28; movetime = 2; musak_org = getent( "musak_org", "targetname" ); musak_org playloopsound( "elev_musak_loop" ); while( !flag( "stop_elevator_doors" ) ) { thread play_sound_in_space( "elev_bell_ding", elevator_door_left.origin ); thread play_sound_in_space( "elev_door_close", elevator_door_left.origin ); elevator_door_left movey( movedistLeft, movetime, movetime / 2 ); elevator_door_right movey( movedistRight, movetime, movetime / 2 ); wait( movetime - .25 ); elevator_dude notify( "doors_closing" ); wait( .25 ); thread play_sound_in_space( "elev_door_open", elevator_door_left.origin ); elevator_door_left moveto( elevator_door_left.startPos, movetime, movetime / 2, movetime / 2 ); elevator_door_right moveto( elevator_door_right.startPos, movetime, movetime / 2, movetime / 2 ); wait( movetime ); wait( 1.25 ); } musak_org stoploopsound(); musak_org delete(); } dialogue_elevator_bottom_to_top() { flag_wait( "player_approaching_bottom_elevators" ); //Sgt. Macey Overlord, this is Hunter Two-One, be advised, we're inside and proceeding to the upper floors. radio_dialogue( "dcburn_mcy_upperfloors" ); //Overlord HQ Radio Voice Roger, Overlord copies all. radio_dialogue("dcburn_hqr_copiesall"); /*----------------------- HEADED TO COURTYARD -------------------------*/ flag_wait_either( "courtyard_has_been_cleared", "player_heading_up_to_mezzanine" ); if ( flag( "courtyard_has_been_cleared" ) ) { //****Sgt. Macey: Hostiles suppressed in Section Two-Echo. radio_dialogue( "dcburn_mcy_alldeadcourtyard" ); //Overlord HQ Radio Voice: Solid copy, Two-One. radio_dialogue( "dcburn_hqr_solidcopy" ); } thread autosave_by_name( "courtyard_has_been_cleared" ); /*----------------------- UP TO MEZZANINE -------------------------*/ flag_wait( "player_heading_up_to_mezzanine" ); //***Sgt. Macey: Overlord this is Hunter Two-One. Proceeding to the mezzanine. Tell the LAV from RCT One to hold their fire, over. radio_dialogue( "dcburn_mcy_tomezzanine" ); //****Overlord HQ Radio Voice: Copy that, Two One, good hunting. radio_dialogue( "dcburn_hqr_goodhunt" ); flag_set( "ask_bradley_to_stop_firing" ); flag_wait( "player_entering_mezzanine_top" ); flag_wait_either( "mezzanine_top_has_been_cleared", "player_at_bottom_of_pavlovs_ramp" ); if ( flag( "mezzanine_top_has_been_cleared" ) ) { //****Sgt. Macey: Hostiles suppressed in Section Two-Echo. radio_dialogue( "dcburn_mcy_alldeadmezzanine" ); //Overlord HQ Radio Voice: Roger that, Two-One. radio_dialogue( "dcburn_hqr_rogerthat" ); } flavorbursts_off( "allies" ); //Ranger 1 This is Delta Four-One at the Lincoln Memorial!!! We are taking heavy fire, request arty and airstrike on our position!!! Send whatever you got! Broken arrow broken arrow!!! level.player thread play_sound_on_entity( "dcburn_ar1_lincolnmemorial" ); flavorbursts_on( "allies" ); flag_wait( "player_at_bottom_of_pavlovs_ramp" ); // if ( player_has_motiontracker() ) // { // if ( !motiontracker_enabled() ) // { // //Sgt. Macey 15 3 Let's get the drop on them...Ramirez, activate your heartbeat sensor. // radio_dialogue( "dcburn_mcy_droponthem" ); // level.heartbeat_timeout = gettime() + 15000; // level.player thread display_hint( "hint_heartbeat_sensor" );//it will endon this thread if not threaded // } // else // { // //Sgt. Macey 15 4 Keep an eye on your heartbeat sensor Ramirez. I wanna hit 'em fast and hard. // radio_dialogue( "dcburn_mcy_hitemfast" ); // } // } //That's the frickin' Capitol Building! level.friendly02 dialogue_execute( "dcburn_cpd_capitolbuild" ); //****Overlord HQ Radio Voice: Hunter Two-One be advised, hostiles on the southwest corner of the fifth floor are hammering the evac site, over. radio_dialogue( "dcburn_hqr_crownag" ); //****Sgt. Macey: Solid copy Overlord. We are Oscar Mike to the fifth floor. Out. radio_dialogue( "dcburn_mcy_omwtofifth" ); //Sgt. Macey Outlaw Two-Three this is Two-One-Actual. Interrogative - what are you seeing from your position over? //radio_dialogue( "dcburn_mcy_whatseeing_r" ); //Marine 5 The LZ is still receiving heavy fire from the target building, break - I see RPG teams on the upper floors, and medium caliber fire coming from the southwest corner over. //radio_dialogue("dcburn_gm5_lzheavyfire"); //Sgt. Macey Solid copy, Two-One out. //radio_dialogue("dcburn_mcy_solidcopy_r"); flag_wait( "player_at_top_of_pavlovs_ramp" ); if ( !flag( "player_shot_at_samsite_guys" ) ) { thread autosave_by_name( "crow_sneak" ); //Sgt. Macey: Standby to engage. radio_dialogue("dcburn_mcy_sby2engage"); } flag_wait_either( "floor_four_has_been_cleared", "player_headed_to_fifth_floor" ); if ( flag( "floor_four_has_been_cleared" ) ) { //****Sgt. Macey: Enemy fire team eliminated in Section Four-Charlie. radio_dialogue( "dcburn_mcy_alldeadfourth" ); //Overlord HQ Radio Voice Copy that, Two-One. radio_dialogue( "dcburn_hqr_copythat" ); } flavorbursts_off( "allies" ); //Ranger 2 Gator Two-Six, Gator Two-Five, be advised, we are pulling out of D.C.!! BCT Four has taken 90 percent losses! Our position is untenable, we are out of here! I repeat, we are getting the f*** outta dodge! level.player play_sound_on_entity( "dcburn_ar2_pullingout" ); //Ranger 3 All Goliath victors, pull back from the MSR!! Delta Four-One is calling in a Broken Arrow!!! Pull back from the MSR now!!! We are leaving!!! level.player play_sound_on_entity( "dcburn_ar3_pullback" ); flavorbursts_on( "allies" ); } /**************************************************************************** GLOBAL ****************************************************************************/ AA_global() { thread commerce_top_drone_flood(); } commerce_top_drone_flood() { /*----------------------- DRONES FLOOD TOWARDS COMMERCE FROM THE SOUTH -------------------------*/ flag_wait( "obj_commerce_defend_snipe_complete" ); /*----------------------- BTR80s AND DRONES FLOOD TOWARDS COMMERCE FROM THE SOUTH -------------------------*/ //hostiles_drones_comm_south = getentarray( "hostiles_drones_comm_south", "targetname" ); //thread drone_flood_start( hostiles_drones_comm_south, "hostiles_drones_comm_south" ); bmp_flood_south = getentarray( "bmp_flood_south", "targetname" ); thread crows_nest_bmp_flood( bmp_flood_south ); flag_wait( "obj_commerce_defend_javelin_complete" ); //thread drone_flood_stop( "hostiles_drones_comm_south" ); } crows_nest_bmp_flood( aSpawners ) { level endon( "obj_commerce_defend_javelin_complete" ); while( true ) { foreach( spawner in aSpawners ) { thread crows_nest_bmp_flood_think( spawner ); } wait( randomfloatrange( 40, 41 ) ); } } crows_nest_bmp_flood_think( spawner ) { if( !flag( "obj_commerce_defend_javelin_complete" ) ) return; level endon( "obj_commerce_defend_javelin_complete" ); wait( randomfloatrange( 40, 41 ) ); bmp = spawner spawn_vehicle_and_gopath(); target_set( bmp, ( 0, 0, 0 ) ); target_setJavelinOnly( bmp, true ); Target_SetAttackMode( bmp, "top" ); bmp thread obj_commerce_defend_javelin_enemies_think(); bmp endon( "death" ); //if reaches end node, kill it, but don't let it cound as an obj bmp waittill( "reached_end_node" ); bmp notify( "deleted_through_script" ); bmp delete(); } /**************************************************************************** COMMERCE BUILDING - ELEVATOR_TOP ****************************************************************************/ AA_elevator_top_init() { thread music_to_crowsnest(); thread dialogue_to_crowsnest(); thread AAA_sequence_elevator_top_2_crowsnest(); flag_wait( "player_approaching_crowsnest" ); thread AA_crows_nest_snipe_init(); } music_to_crowsnest() { flag_wait( "start_music_to_crowsnest" ); thread music_loop( "dcburning_evilcrowsnest_approach", 198 ); } AAA_sequence_elevator_top_2_crowsnest() { flag_wait( "player_at_commerce_crows_floor" ); triggersEnable( "colornodes_commerce_to_crowsnest", "script_noteworthy", true ); flag_wait( "player_entering_top_elevator_area" ); thread autosave_by_name( "elevator_top" ); thread AI_cleanup_non_squad( "all" ); if( isdefined( level.helis_ambient_trenches ) ) array_thread( level.helis_ambient_trenches,::vehicle_delete ); if( isdefined( level.vehicles_commerce_ambient ) ) array_thread( level.vehicles_commerce_ambient,::vehicle_delete ); /*----------------------- SETUP -------------------------*/ volume_commerce_sector_2 = getent( "volume_commerce_sector_2", "targetname" ); volume_commerce_sector_3 = getent( "volume_commerce_sector_3", "targetname" ); flare_dynamic_01 = getent( "flare_dynamic_01", "targetname" ); dynamicLight = getent( flare_dynamic_01.target, "targetname" ); dynamicLight setLightIntensity( 0 ); /*----------------------- ENEMY FLARE MOMENT -------------------------*/ flag_wait_either( "player_approaching_flare_moment", "player_looking_at_flare_moment" ); //thread AI_drone_cleanup( "all", 1024, true ); flare_dynamic_01 thread flare_burst_on_and_flicker( 4, 4, 10 ); commerce_flare_guys = array_spawn( getentarray( "commerce_flare_guys", "targetname" ), true ); /*----------------------- ENEMY FIRE TEAMS FIGHTING OTHER ALLIES -------------------------*/ //Done through spawn triggers now flag_wait( "player_approaching_crowsnest" ); thread crows_nest_enemy_chatter(); helis_ambient_crowsnest = spawn_vehicles_from_targetname_and_drive( "helis_ambient_crowsnest" ); helis_crows_snipe = spawn_vehicles_from_targetname_and_drive( "helis_crows_snipe" ); array_thread( helis_crows_snipe,::helis_crows_snipe_think ); if( isdefined( level.helis_ambient_capitol ) ) array_thread( level.helis_ambient_capitol,::helis_ambient_capitol_think ); thread AI_cleanup_non_squad( "allies", 128 ); } helis_crows_snipe_think() { self endon( "death" ); flag_wait( "obj_commerce_defend_crow_given" ); self thread vehicle_delete_when_hit_script_noteworthy( "start" ); /*----------------------- MAKE ANY AMBIENT VEHICLES COUNT AS OBJECTIVES WHILE ALIVE -------------------------*/ flag_wait( "obj_commerce_defend_javelin_given" ); self thread helis_crowsnest_think(); } helis_ambient_capitol_think() { self endon( "death" ); flag_wait( "player_shot_at_crowsnest_guys" ); self thread vehicle_delete_when_hit_script_noteworthy( "start" ); } crows_nest_enemy_chatter() { obj_commerce_sector_3 = getstruct( "obj_commerce_sector_3", "targetname" ); origin = obj_commerce_sector_3.origin; sFlagToKillDialogue = "player_shot_at_crowsnest_guys"; level endon( sFlagToKillDialogue ); while( !flag( sFlagToKillDialogue ) ) { // Russian Airborne 3 2 transports attempting to evac at grid square 253221! play_sound_then_kill_on_flag( "dcburn_ra3_gridsquare", origin, sFlagToKillDialogue ); // Russian Airborne 1 Don't worry, they're not going to get very far. play_sound_then_kill_on_flag( "dcburn_ra1_dontworry", origin, sFlagToKillDialogue ); wait( .5 ); // Russian Airborne 2 Target detected. Armored personnel carrier, moving northwest at 60 kilometres per hour. 20 degrees left of the Washington Monument. play_sound_then_kill_on_flag( "dcburn_ra2_60kph", origin, sFlagToKillDialogue ); // Russian Airborne 3 I see it. Locking onto target. Standby for launch. play_sound_then_kill_on_flag( "dcburn_ra3_standbyforlaunch", origin, sFlagToKillDialogue ); wait( .5 ); // Russian Airborne 1 Tank, range two miles. Speed, 20 kilometres per hour, moving left to right by the green car. play_sound_then_kill_on_flag( "dcburn_ra1_bygreencar", origin, sFlagToKillDialogue ); // Russian Airborne 2 I have the tank in my sights and I'm tracking it now. play_sound_then_kill_on_flag( "dcburn_ra2_trackingitnow", origin, sFlagToKillDialogue ); wait( .75 ); // Russian Airborne 3 This is too easy. I thought the Americans would fight harder than this! play_sound_then_kill_on_flag( "dcburn_ra3_tooeasy", origin, sFlagToKillDialogue ); // Russian Airborne 1 Armored personnel carrier, range four miles. I confirm target is hostile. play_sound_then_kill_on_flag( "dcburn_ra1_confirmhostile", origin, sFlagToKillDialogue ); // Russian Airborne 2 Locking onto target. Standby. They've increased speed to 25 kilometres per hour. play_sound_then_kill_on_flag( "dcburn_ra2_25kph", origin, sFlagToKillDialogue ); // Russian Airborne 3 Enemy tank moving east, range 572 metres, bearing 172 degrees! Request permission to engage! play_sound_then_kill_on_flag( "dcburn_ra3_range572meters", origin, sFlagToKillDialogue ); // Russian Airborne 1 Armored personnel carrier has stopped, they're loading passengers. Destroy it. play_sound_then_kill_on_flag( "dcburn_ra1_destroyit", origin, sFlagToKillDialogue ); // Russian Airborne 2 Tank moving east, range 572 metres, acknowledged. You are cleared to engage the target. play_sound_then_kill_on_flag( "dcburn_ra2_clearedtoengage", origin, sFlagToKillDialogue ); // Russian Airborne 3 I bet you never thought you'd see the day the Americans would run from us on the battlefield! play_sound_then_kill_on_flag( "dcburn_ra3_runfromus", origin, sFlagToKillDialogue ); } } AI_commerce_sector_2_guys_think() { self endon( "death" ); flag_wait( "fifth_floor_guys_damaged" ); self.combatMode = "ambush"; } dialogue_to_crowsnest() { flag_wait( "player_entering_top_elevator_area" ); flag_set( "start_music_to_crowsnest" ); //****Sgt. Macey: Overlord, We're on the fifth floor, proceeding to the southwest corner. radio_dialogue( "dcburn_mcy_onfifth" ); if ( ( flag( "player_approaching_flare_moment" ) ) || ( flag( "player_approaching_flare_moment" ) ) ) { //alt dialogue pending } else { //Overlord HQ Radio Voice: Copy that, Two-One. radio_dialogue( "dcburn_hqr_copy21" ); } flag_wait_either( "player_approaching_flare_moment", "player_looking_at_flare_moment" ); wait( .2 ); //****Cpl. Dunn: I got movement. radio_dialogue( "dcburn_cdn_movement" ); wait( 1 ); if ( !flag( "fifth_floor_guys_damaged" ) ) { //Sgt. Macey Watch your sectors. radio_dialogue("dcburn_mcy_watchsectors"); } wait( 3 ); if ( !flag( "fifth_floor_guys_damaged" ) ) { //Sgt. Macey Check those corners. radio_dialogue("dcburn_mcy_checkcorners"); } flag_wait( "player_approaching_crowsnest2" ); //Sgt. Macey: All Hunter units, I have a visual on the enemy crow's nest at the southwest corner. Move forward and clear it out. radio_dialogue( "dcburn_mcy_visoncrow" ); flavorbursts_off( "allies" ); //Ranger 4 Mystic Two-One, CENTCOM just gave the order to abandon all evac sites to the east of the Potomac!!! Get your ass outta there!!! level.player play_sound_on_entity( "dcburn_ar4_centcom" ); flavorbursts_on( "allies" ); flag_set( "macey_tells_you_to_move_to_crows" ); wait(.5); if ( !flag( "player_shot_at_crowsnest_guys" ) ) { thread autosave_by_name( "crow_sneak" ); //Sgt. Macey: Standby to engage. radio_dialogue("dcburn_mcy_sby2engage"); } flavorbursts_off( "allies" ); //Ranger 1 Darkstar One-Three, we do not have enough shells remaning in the battery to provide effective supporting fire to your position! We are pullin' outta D.C. in five mikes!! Out!! level.player play_sound_on_entity( "dcburn_ar1_fivemikes" ); //Ranger 2 Rhino Two-One, get your team outta there pronto!!! We cannot hold this position any longer!! We are leaving D.C.!! I repeat, we are leaving D.C.!!! level.player play_sound_on_entity( "dcburn_ar2_outtathere" ); flavorbursts_on( "allies" ); } /**************************************************************************** COMMERCE BUILDING - CROWS_NEST SNIPE ****************************************************************************/ AA_crows_nest_snipe_init() { thread AAA_sequence_crowsnest(); thread AAA_sequence_crowsnest_snipe(); thread obj_commerce_defend_snipe(); thread obj_commerce_defend_crow(); thread dialogue_crowsnest(); flag_wait( "start_crow_armor_sequence" ); thread AA_crows_nest_armor_init(); } AAA_sequence_crowsnest() { /*----------------------- SEQUENCE SETUP -------------------------*/ triggersEnable( "colornodes_crowsnest", "script_noteworthy", true ); volume_crowsnest = getent( "volume_crowsnest", "targetname" ); flag_wait( "player_approaching_crowsnest" ); /*----------------------- SPAWN CROWSNEST TEAMS -------------------------*/ hostiles_crowsnest = array_spawn( getentarray( "hostiles_crowsnest", "targetname" ), true ); thread waittill_dead_then_set_flag( hostiles_crowsnest, "crowsnest_has_been_cleared" ); array_thread( hostiles_crowsnest, ::AI_sneak_monitor, "player_shot_at_crowsnest_guys" ); array_thread( hostiles_crowsnest, ::AI_crowsnest_player_too_close ); array_thread( level.squad,::crowsnest_friendlies_inside ); /*----------------------- CROWSNEST CLEARED -------------------------*/ flag_wait( "player_shot_at_crowsnest_guys" ); tanks_crowsnest_wave1 = spawn_vehicles_from_targetname( "tanks_crowsnest_wave1" ); thread tanks_crowsnest_wave1_gopath( tanks_crowsnest_wave1 ); array_thread( tanks_crowsnest_wave1,:: tanks_crowsnest_wave1_think ); array_thread( level.squad,::AI_awesome_accuracy_untill_flag, "crowsnest_has_been_cleared" ); flag_wait( "crowsnest_has_been_cleared" ); thread flag_set_delayed( "obj_commerce_complete", 1 ); /*----------------------- FRIENDLIES INTO CROWNEST IF NOT THERE ALREADY -------------------------*/ colornodes_crowsnest = getent( "colornodes_crowsnest", "script_noteworthy" ); colornodes_crowsnest notify( "trigger", level.player ); thread dummy_trigger( "dummy_colornodes_crows1" ); //make friendlies move up thread dummy_trigger( "dummy_colornodes_crows2" ); //make friendlies move up flag_wait( "humvee_spotlight_deleted" ); flag_wait( "obj_commerce_defend_snipe_given" ); jets_crow_01 = spawn_vehicles_from_targetname_and_drive( "jets_crow_01" ); } crowsnest_friendlies_inside() { self endon( "death" ); level endon( "player_shot_at_crowsnest_guys" ); flag_wait( "player_approaching_crowsnest_door" ); player_in_crowsnest_room = getent( "player_in_crowsnest_room", "targetname" ); while( !flag( "player_shot_at_crowsnest_guys" ) ) { wait( .1 ); if ( !isdefined( self ) ) return; if( self istouching( player_in_crowsnest_room ) ) break; } thread axis_not_ignored(); flag_set( "player_shot_at_crowsnest_guys" ); } axis_not_ignored() { ai = getaiarray( "axis" ); foreach( guy in ai ) { if ( !isdefined( guy ) ) continue; guy.ignoreme = false; } } AAA_sequence_crowsnest_snipe() { flag_wait( "player_approaching_crowsnest2" ); thread crowsnest_ambient_vehicles(); model_barrett = getent( "model_barrett", "targetname" ); model_barrett_glow = spawn( "script_model", model_barrett.origin ); model_barrett_glow setModel( "weapon_m82_MG_Setup_obj" ); model_barrett_glow.origin = model_barrett.origin; model_barrett_glow.angles = model_barrett.angles ; model_barrett_glow hide(); /*----------------------- SPAWN FRIENDLY VEHICLES THAT PLAYER HAS TO KEEP ALIVE -------------------------*/ level.evacSiteVehicles = getentarray( "vehicles_crowsnest_defend", "targetname" ); array_thread( level.evacSiteVehicles,::vehicles_crowsnest_defend_think ); thread crowsnest_defend_failure(); /*----------------------- SPAWN WW2 MEMORIAL GUYS -------------------------*/ level.evacSiteEnemies = array_spawn( getentarray( "hostiles_ww2_barret", "targetname" ), true ); array_thread( level.evacSiteEnemies, ::obj_commerce_defend_snipe_enemies_think ); array_thread( level.evacSiteEnemies, ::AI_blood_spatter_when_sniped ); array_thread( level.evacSiteEnemies,::magic_bullet_shield ); /*----------------------- CROWSNEST CLEARED, GET ON BARRET -------------------------*/ flag_wait( "crowsnest_has_been_cleared" ); array_thread( level.evacSiteEnemies,::stop_magic_bullet_shield ); flag_wait( "obj_commerce_defend_snipe_given" ); /*----------------------- FRIENDLIES START SHOOTING TOWARDS DRONES BELOW -------------------------*/ thread friendlies_shoot_at_crows_drones_start(); /*----------------------- MAKE BARRET GLOW IF PLAYER NOT ON IT -------------------------*/ thread crowsnest_barret_glow( model_barrett, model_barrett_glow ); thread crowsnest_nags_snipe(); /*----------------------- MAKE ENEMIES START TO OWN EVAC SITE EITHER WHEN PLAYER GETS ON GUN, OR TIMEOUT -------------------------*/ flag_wait_or_timeout( "player_is_on_turret", 5 ); /*----------------------- GRADUALLY MAKE ENEMIES FIRE AT LIVE TARGETS -------------------------*/ thread evac_site_enemies_fire_live(); /*----------------------- PREP ENEMIES COME UP BEHIND PLAYER -------------------------*/ flag_wait( "only_2_sniper_enemies_remaining" ); thread player_fails_if_abandons_crowsnest(); //Overlord (HQ Radio) Hunter Two-One be advised, you have enemy foot mobiles converging on your position...stay frosty. flag_clear( "can_talk" ); radio_dialogue( "dcburn_hqr_stayfrosty" ); flag_set( "can_talk" ); /*----------------------- BARRETT GAMEPLAY DONE...ENEMIES INSIDE! -------------------------*/ flag_wait( "obj_commerce_defend_snipe_complete" ); /*----------------------- FRIENDLIES STOP OWNING DRONES -------------------------*/ thread friendlies_shoot_at_crows_drones_stop(); thread autosave_now( true ); thread flag_set_delayed( "obj_commerce_defend_crow_given", 3 ); array_thread( level.squad,::AI_awesome_accuracy_untill_flag, "perimeter_enemies_have_retreated" ); battlechatter_on( "allies" ); thread spawn_trigger_dummy( "dummy_spawner_crowsnest_assault_guys_wave1" ); thread dialogue_nag_hostiles_at_crows(); thread player_barrett_damage(); level.guysKilled = 0; /*----------------------- FRIENDLIES TAKE UP DEFENSIVE POSITIONS -------------------------*/ triggersEnable( "colornodes_crowsnest_surrounded", "script_noteworthy", true ); trig_colornode = getent( "colornodes_crowsnest_surrounded", "script_noteworthy" ); trig_colornode notify( "trigger", level.player ); /*----------------------- SURROUNDING ENEMIES KILLED -------------------------*/ flag_wait( "player_killed_enough" ); flag_set( "start_crow_armor_sequence" ); flag_set( "obj_commerce_defend_crow_complete" ); thread autosave_by_name( "defend_crow_complete" ); killspawner( 12 ); crowsnest_assault_guys_wave1 = getaiarray( "axis" ); thread AI_delete_when_out_of_sight( crowsnest_assault_guys_wave1, 512 ); array_thread( crowsnest_assault_guys_wave1,::retreat_to_elevators ); } player_fails_if_abandons_crowsnest() { level endon( "player_getting_on_minigun" ); flag_wait( "player_abandoning_crowsnest" ); //"Mission Failed.\nThe evac site was destroyed." setDvar( "ui_deadquote", &"DCBURNING_MISSIONFAIL_CROWSNEST_SNIPE" ); level notify( "mission failed" ); maps\_utility::missionFailedWrapper(); } player_barrett_damage() { wait( 3 ); //give player some clues that he is getting lit up iLoveTaps = 0; while ( flag( "player_is_on_turret" ) ) { level.player DoDamage( 20 / level.player.damageMultiplier, level.player.origin ); level.player viewkick( 127, level.player.origin ); wait( randomfloatrange( 1, 2 ) ); iLoveTaps++; if ( iLoveTaps > 3 ) break; } //Player can't take a hint, throw a nade at his ass if ( flag( "player_is_on_turret" ) ) { obj_commerce_defend_javelin = getstruct( "obj_commerce_defend_javelin", "targetname" ); MagicGrenade( "fraggrenade", obj_commerce_defend_javelin.origin + ( 0, 0, 144 ), obj_commerce_defend_javelin.origin + ( 0, 0, 32 ) ); } } retreat_to_elevators() { self endon( "death" ); if ( !isdefined( self ) ) return; self notify( "stop_seeking" ); position = getstruct( "obj_commerce_sector_1d", "targetname" ); self setgoalpos( position.origin ); } AI_crowsnest_assault_guys_wave1_think() { level endon( "player_killed_enough" ); if( !isalive( self ) ) return; while( isalive( self ) ) { self waittill( "death", attacker ); if ( ( isdefined( attacker ) )&& ( isplayer( attacker ) ) ) { level.guysKilled++; if ( level.guysKilled > 3 ) { flag_set( "player_killed_enough" ); } else break; } } } friendlies_shoot_stingers_start() { aFriendlies = []; aFriendlies[ 0 ] = level.teamleader; aFriendlies[ 1 ] = level.friendly02; friendlies_crowsnest_stage = getentarray( "friendlies_crowsnest_stage", "targetname" ); aFriendlies[ 0 ] thread friendly_shoot_stingers_and_jav_think( friendlies_crowsnest_stage [ 0 ] ); aFriendlies[ 1 ] thread friendly_shoot_stingers_and_jav_think( friendlies_crowsnest_stage [ 1 ] ); } friendly_shoot_stingers_and_jav_think( stingerJavNode ) { self.scriptedTargets = []; aDummyTargets = stingerJavNode get_linked_ents(); aTargetHeliNodes = stingerJavNode get_linked_structs(); array_thread( aTargetHeliNodes, ::friendly_stinger_target_nodes_think, self ); isJavelin = false; /*----------------------- DON'T TELEPORT TILL OUT OF SIGHT -------------------------*/ while( !flag( "only_1_javelin_enemies_remaining" ) ) { wait( 1 ); if ( within_fov( level.player.origin, level.player.angles, stingerJavNode.origin + ( 0, 0, 32 ), level.cosine[ "90" ] ) ) continue; if ( within_fov( level.player.origin, level.player.angles, self.origin + ( 0, 0, 32 ), level.cosine[ "90" ] ) ) continue; break; } self friendly_shoot_at_crows_drones_stop(); if ( flag( "only_1_javelin_enemies_remaining" ) ) return; /*----------------------- FRIENDLY IDLES WITH WEAPON -------------------------*/ playerBadPlace = undefined; self.reference = stingerJavNode; magicBulletType = "stinger"; weapon = "weapon_stinger"; muzzleFlash = "javelin_muzzle"; if ( stingerJavNode.animation == "stinger_idle" ) { playerBadPlace = getent( "volume_stinger_safezone", "targetname" ); self get_stinger_anims(); } else { playerBadPlace = getent( "volume_javelin_safezone", "targetname" ); isJavelin = true; self.animation = stingerJavNode.animation; self get_javelin_anims(); magicBulletType = "javelin_dcburn"; muzzleFlash = "javelin_muzzle"; weapon = "weapon_javelin_sp"; } self hide(); self.reference anim_generic_first_frame( self, self.sAnimIdleStart ); self show(); eTarget = undefined; newMissile = undefined; stinger_source_org = undefined; self attach( weapon, "TAG_INHAND", 1 ); randomWait = 8; /*----------------------- SHOOT AT TARGETS -------------------------*/ self.ignoreme = true; while( !flag( "only_1_javelin_enemies_remaining" ) ) { randomWait = randomfloatrange( 6, 9 ); self.reference thread anim_generic_loop( self, self.sAnimIdle, "stop_idle" ); self waittill_notify_or_timeout( "new_target", randomWait ); self.reference notify( "stop_idle" ); self.reference thread anim_generic( self, self.sAnimFire ); self waittillmatch( "single anim", "fire_weapon" ); eTarget = self friendly_shoot_stingers_get_target( aDummyTargets ); if ( ( isdefined( eTarget ) ) && ( !level.player istouching( playerBadPlace ) ) ) { stinger_source_org = self gettagorigin( "tag_inhand" ); newMissile = MagicBullet( magicBulletType, stinger_source_org, eTarget.origin ); newMissile Missile_SetTargetEnt( eTarget ); if ( isJavelin ) { newMissile Missile_SetFlightmodeTop(); Playfx( getfx( muzzleFlash ), stinger_source_org ); } } self waittillmatch( "single anim", "end" ); if ( ( flag( "only_1_javelin_enemies_remaining" ) ) || ( flag( "obj_commerce_defend_javelin_complete" ) ) ) break; } self.ignoreme = false; self notify( "stop_shooting_stingers_and_javs" ); self notify( "stop_first_frame" ); self.reference notify( "stop_idle" ); self anim_stopanimscripted(); self detach( weapon, "TAG_INHAND" ); self.reference = undefined; self.scriptedTargets = undefined; } player_is_not_in_the_way( playerBadPlace ) { if ( distance( playerBadPlace, level.player.origin ) > 64 ) return true; else return false; } friendly_shoot_stingers_stop() { } friendly_shoot_stingers_get_target( aDummyTargets ) { if ( !isdefined( self.scriptedTargets ) ) return aDummyTargets[ randomint( aDummyTargets.size ) ]; if ( self.scriptedTargets.size == 0 ) return aDummyTargets[ randomint( aDummyTargets.size ) ]; self.scriptedTargets = remove_dead_from_array( self.scriptedTargets ); if ( ( level.friendlyArmorTargets > 0 ) && ( level.friendliesCanHelpCrowsnest ) && ( self.scriptedTargets.size > 0 ) ) { return( self.scriptedTargets[ 0 ] ); } else return aDummyTargets[ randomint( aDummyTargets.size ) ]; } friendly_stinger_target_nodes_think( guy ) { level endon( "obj_commerce_defend_javelin_complete" ); guy endon( "stop_shooting_stingers_and_javs" ); self endon( "death" ); //self ==> the node the heli target will trigger to show its in a good place to be shot while ( ( !flag( "only_1_javelin_enemies_remaining" ) ) && ( isdefined( guy.scriptedTargets ) ) ) { self waittill( "trigger", heli ); if ( !isdefined( heli ) ) break; if ( !isdefined( guy.scriptedTargets ) ) break; guy.scriptedTargets = array_add( guy.scriptedTargets, heli ); guy notify( "new_target" ); wait( 2 ); if ( isdefined( heli ) ) guy.scriptedTargets = array_remove( guy.scriptedTargets, heli ); if ( ( flag( "only_1_javelin_enemies_remaining" ) ) || ( flag( "obj_commerce_defend_javelin_complete" ) ) ) break; } } friendlies_shoot_at_crows_drones_start() { aNodes = getnodearray( "crow_nodes_drone_fire", "targetname" ); spawner = getent( "hostiles_fodder_crowsnest", "targetname" ); level.hostiles_fodder_crowsnest = spawner spawn_ai(); aFriendlies = []; aFriendlies[ 0 ] = level.teamleader; aFriendlies[ 1 ] = level.friendly02; foreach( guy in aFriendlies ) { guy disable_ai_color(); eNode = getfarthest( level.player.origin, aNodes ); aNodes = array_remove( aNodes, eNode ); guy.fixednode = false; guy.goalradius = 16; guy setGoalNode( eNode ); } array_thread( aFriendlies,::friendlies_shoot_at_crows_drones_think ); } friendlies_shoot_at_crows_drones_think() { self endon( "stop_shooting_at_drones" ); while ( true ) { wait( randomfloatrange( 3, 6 ) ); self.ignoreall = true; wait( randomfloatrange( 3, 6 ) ); self.ignoreall = false; } } friendlies_shoot_at_crows_drones_stop() { if ( isdefined( level.hostiles_fodder_crowsnest ) ) level.hostiles_fodder_crowsnest AI_delete(); aFriendlies = []; aFriendlies[ 0 ] = level.teamleader; aFriendlies[ 1 ] = level.friendly02; array_thread( aFriendlies,::friendly_shoot_at_crows_drones_stop ); } friendly_shoot_at_crows_drones_stop() { self notify ( "stop_shooting_at_drones" ); wait( 0.05 ); self enable_ai_color(); self.fixednode = true; self.ignoreall = false; } dialogue_nag_hostiles_at_crows() { level endon( "player_killed_enough" ); while ( !flag( "player_killed_enough" ) ) { if ( flag( "player_killed_enough" ) ) break; //Cpl. Dunn 22 2 Hostiles inside the perimeter! Open fire! Open fire! level.friendly02 dialogue_execute( "dcburn_cpd_inperimeter" ); wait( randomfloatrange( 8, 14 ) ); if ( flag( "player_killed_enough" ) ) break; //Cpl. Dunn 22 4 Taking fire! Taking fire! Foot mobiles inside the perimeter! level.friendly02 dialogue_execute( "dcburn_cpd_takingfire" ); wait( randomfloatrange( 8, 14 ) ); if ( flag( "player_killed_enough" ) ) break; //Cpl. Dunn 22 3 Eyes up! Hostiles on our six!!! level.friendly02 dialogue_execute( "dcburn_cpd_hostatsix" ); wait( randomfloatrange( 8, 14 ) ); } } AI_sneak_monitor( sFlagToSet ) { self endon( "alerted" ); self thread AI_player_gunshot_monitor(); wait( .5 ); //self waittill_any( "grenade danger", "damage", "gunshot", "death" ); self waittill_any( "damage", "death", "shot_at" ); flag_set( sFlagToSet ); if( isdefined( self ) ) self thread AI_become_alerted(); } AI_player_gunshot_monitor() { distSquared = 512 * 512; self endon( "death" ); self endon( "alerted" ); self addAIEventListener( "grenade danger" ); self addAIEventListener( "gunshot" ); self addAIEventListener( "silenced_shot" ); self addAIEventListener( "bulletwhizby" ); self addAIEventListener( "projectile_impact" ); wait( .5 ); while( isalive( self ) ) { self waittill( "ai_event", eventtype ); if ( ( eventtype == "grenade danger" ) || ( eventtype == "damage" ) || ( eventtype == "projectile_impact" ) || ( eventtype == "explode" ) ) break; if ( distancesquared( self.origin, level.player.origin ) > distSquared ) continue; if ( ( eventtype == "grenade danger" ) || ( eventtype == "damage" ) || ( eventtype == "gunshot" ) || ( eventtype == "bulletwhizby" ) || ( eventtype == "projectile_impact" ) || ( eventtype == "explode" ) ) break; } self notify( "shot_at" ); } AI_crowsnest_player_too_close() { self endon( "death" ); self endon( "alerted" ); flag_wait_any( "player_entering_wall_hole", "player_shot_at_crowsnest_guys", "player_gawking_at_crowsnest_guys" ); flag_set( "player_shot_at_crowsnest_guys" ); self thread AI_become_alerted(); } evac_site_enemies_fire_live() { level endon ( "obj_commerce_defend_snipe_complete" ); /*----------------------- GRADUALLY MAKE ENEMIES FIRE AT LIVE TARGETS (BUT NOT FOR VET/HARDENED) -------------------------*/ iRampInterval = 4; if ( ( level.gameskill == 2 ) || ( level.gameskill == 3 ) ) iRampInterval = 0.1; foreach( guy in level.evacSiteEnemies ) { if ( isalive( guy ) ) { guy.fireAtLiveTargets = true; wait( iRampInterval ); } } } crowsnest_nags_snipe() { volume_crowsnest = getent( "volume_crowsnest", "targetname" ); level.lasttimePlayerKilledEnemy = getTime(); barret_nag_number = 0; barret_nag_number_max = 2; stay_in_nest_nag_number = 0; stay_in_nest_nag_number_max = 2; barret_shoot_nag_number = 0; barret_shoot_nag_number_max = 1; wait( .5 ); while( !flag( "obj_commerce_defend_snipe_complete" ) ) { //reset nag numbers if ( barret_nag_number > barret_nag_number_max ) barret_nag_number = 0; if ( stay_in_nest_nag_number > stay_in_nest_nag_number_max ) stay_in_nest_nag_number = 0; if ( barret_shoot_nag_number > barret_shoot_nag_number_max ) barret_shoot_nag_number = 0; nag_wait(); flag_wait( "can_start_crow_nags" ); if ( flag( "obj_commerce_defend_snipe_complete" ) ) break; if ( ( !level.player istouching( volume_crowsnest ) ) && ( flag( "can_talk" ) ) ) { flag_clear( "can_talk" ); level.teamleader dialogue_execute( "stay_in_nest_nag_" + stay_in_nest_nag_number ); stay_in_nest_nag_number++; flag_set( "can_talk" ); } else if( ( !flag( "player_is_on_turret" ) ) && ( flag( "can_talk" ) ) ) { flag_clear( "can_talk" ); level.teamleader dialogue_execute( "barret_nag_" + barret_nag_number ); barret_nag_number++; flag_set( "can_talk" ); } else if( ( !player_killing_crow_targets_at_a_good_pace() ) && ( flag( "can_talk" ) ) ) { flag_clear( "can_talk" ); level.teamleader dialogue_execute( "barret_shoot_nag_" + barret_shoot_nag_number ); barret_shoot_nag_number++; flag_set( "can_talk" ); } } } crowsnest_ambient_vehicles() { /*----------------------- GET SCRIPTED EVAC SITE VEHICLES READY -------------------------*/ crowsnest_seaknight_01 = getent( "crowsnest_seaknight_01", "targetname" ); crowsnest_seaknight_02 = getent( "crowsnest_seaknight_02", "targetname" ); crowsnest_seaknight_01 notify( "spawn" ); crowsnest_seaknight_02 notify( "spawn" ); flag_wait( "player_in_crowsnest_room" ); flag_wait( "make_seaknights_take_off" ); crowsnest_seaknight_01 notify( "play_anim" ); wait( 3 ); crowsnest_seaknight_02 notify( "play_anim" ); } crowsnest_defend_failure() { percentDestroyed = undefined; color = ( 1, 1, 0 ); level.evacSiteVehiclesStartNumber = level.evacSiteVehicles.size; HUDdefendStatus = createFontString( "default", 1.5 ); HUDdefendStatus setPoint( "TOP", undefined, -41, 30 ); HUDdefendStatus.color = color; HUDdefendStatus.alpha = 0; flag_wait( "obj_commerce_defend_snipe_given" ); HUDdefendStatus setText( &"DCBURNING_INFO_EVAC_SITE_HEALTH" ); HUDpercentage = createFontString( "default", 1.5 ); HUDpercentage setPoint( "TOP", undefined, 45, 30 ); HUDpercentage.color = color; HUDpercentage.alpha = 0; if ( getdvar( "dc_debug" ) == "1" ) { HUDpercentage fadeOverTime( 1 ); HUDdefendStatus fadeOverTime( 1 ); HUDdefendStatus.alpha = 1; HUDpercentage.alpha = 1; } thread evac_site_damage_nags_snipe(); while ( !flag( "obj_commerce_defend_snipe_complete" ) ) { //HUDpercentage setText( get_evac_site_percent_destroyed() ); percentDestroyed = get_evac_site_percent_destroyed(); if ( flag( "obj_commerce_defend_snipe_complete" ) ) break; level waittill_either( "evac_vehicle_owned", "obj_commerce_defend_snipe_complete" ); if ( flag( "obj_commerce_defend_snipe_complete" ) ) break; if ( level.evacSiteVehicles.size < 2 ) { thread crowsnest_failure_check(); } } HUDdefendStatus fadeOverTime( 1 ); HUDpercentage fadeOverTime( 1 ); HUDdefendStatus.alpha = 0; HUDpercentage.alpha = 0; HUDdefendStatus destroyElem(); HUDpercentage destroyElem(); } evac_site_damage_nags_snipe() { percentDestoyedAtLeast = 0; flag_wait( "can_start_crow_nags" ); while ( !flag( "obj_commerce_defend_snipe_complete" ) ) { flag_wait( "can_talk" ); level waittill( "evac_vehicle_owned" ); if ( level.evacSitePercentDestroyed == 100 ) { flag_clear( "can_talk" ); //Evac Site Radio Voice All callsigns, this is the Washington Monument evac site!!! Be advised, our situation is critical!!! We can't take much more of this!!! We need more time to get these civvies outta here!!! radio_dialogue( "dcburn_evc_damage_fail" ); flag_set( "can_talk" ); return; } else if ( ( level.evacSitePercentDestroyed > 25 ) && ( level.evacSitePercentDestroyed < 50 ) && ( percentDestoyedAtLeast < 25 ) ) { flag_clear( "can_talk" ); //Evac Site Radio Voice We're taking fire at the Washington Monument! We are down to 80 percent combat effectiveness! Request immediate sniper fire on targets west of the Monument, over! radio_dialogue( "dcburn_evc_damage_00" ); percentDestoyedAtLeast = 25; flag_set( "can_talk" ); } else if ( ( level.evacSitePercentDestroyed > 50 ) && ( level.evacSitePercentDestroyed < 75 ) && ( percentDestoyedAtLeast < 50 ) ) { flag_clear( "can_talk" ); //Evac Site Radio Voice All callsigns, be advised, enemies to the west are attempting a force-in-detail assault on the Washington Monument evac site! radio_dialogue( "dcburn_evc_damage_01" ); percentDestoyedAtLeast = 50; flag_set( "can_talk" ); } else if ( ( level.evacSitePercentDestroyed > 75 ) && ( level.evacSitePercentDestroyed < 90 ) && ( percentDestoyedAtLeast < 75 ) ) { flag_clear( "can_talk" ); //Evac Site Radio Voice Washington Monument evac site to all callsigns!! Enemy fire from the west is threatening to destroy our position!! We can't take much more of this!! radio_dialogue( "dcburn_evc_damage_02" ); percentDestoyedAtLeast = 75; flag_set( "can_talk" ); } else if ( ( level.evacSitePercentDestroyed > 90 ) && ( level.evacSitePercentDestroyed < 100 ) && ( percentDestoyedAtLeast < 90 ) ) { flag_clear( "can_talk" ); //Evac Site Radio Voice Washington Monument evac site taking heavy fire!!! We're down to 50 percent combat effectiveness!!! We gotta get more fire support or this evac site is gonna fall!!! Over!!! radio_dialogue( "dcburn_evc_damage_03" ); percentDestoyedAtLeast = 90; flag_set( "can_talk" ); } } } crowsnest_failure_check() { level.evacSiteVehicles = remove_dead_from_array( level.evacSiteVehicles ); if ( ( level.evacSiteVehicles.size == 0 ) && ( !flag( "obj_commerce_defend_snipe_complete" ) ) ) { crowsnest_mission_fail_snipe(); } } crowsnest_mission_fail_snipe() { setDvar( "ui_deadquote", &"DCBURNING_MISSIONFAIL_CROWSNEST_SNIPE" ); level notify( "mission failed" ); maps\_utility::missionFailedWrapper(); } crowsnest_mission_fail_armor() { setDvar( "ui_deadquote", &"DCBURNING_MISSIONFAIL_CROWSNEST_SNIPE" ); level notify( "mission failed" ); maps\_utility::missionFailedWrapper(); } get_evac_site_percent_destroyed() { fPercentRemaining = ( level.evacSiteVehicles.size / level.evacSiteVehiclesStartNumber ) * 100; fPercentRemaining = roundDecimalPlaces( fPercentRemaining, 0 ); fPercentDestroyed = 100 - fPercentRemaining; level.evacSitePercentDestroyed = fPercentDestroyed; sNumber = string( fPercentDestroyed ) + " percent"; return sNumber; } roundDecimalPlaces( value, places, style ) { if ( !isdefined( style ) ) style = "nearest"; modifier = 1; for ( i = 0; i < places; i++ ) modifier *= 10; newValue = value * modifier; if ( style == "up" ) roundedValue = ceil( newValue ); else if ( style == "down" ) roundedValue = floor( newValue ); else roundedValue = newvalue + 0.5; newvalue = Int( roundedValue ); newvalue = newvalue / modifier; return newvalue; } crowsnest_barret_glow( model_barrett, model_barrett_glow ) { if ( !flag( "player_is_on_turret" ) ) { model_barrett hide(); model_barrett_glow show(); } flag_wait( "player_is_on_turret" ); model_barrett_glow hide(); flag_waitopen( "player_is_on_turret" ); model_barrett show(); } dialogue_crowsnest() { flag_wait( "crowsnest_has_been_cleared" ); thread autosave_by_name( "crowsnest_cleared" ); wait( 1 ); flag_set( "make_seaknights_take_off" ); //Sgt. Macey: Overlord this is Hunter Two-One. We've secured the enemy crow's nest on the southwest corner. level.teamleader dialogue_execute( "dcburn_mcy_seccrowsnest" ); //Overlord HQ Radio Voice: Overlord copies all. Evac site reports several transports away, but they are still vulnerable. Can you provide support from your position, over? radio_dialogue( "dcburn_hqr_canyousupport" ); //Sgt. Macey: Roger that. We're sittin' on a stockpile of enemy munitions. We'll dig in and burn through their ammo. Out. level.teamleader dialogue_execute( "dcburn_mcy_stockpile" ); if ( !flag( "player_is_on_turret" ) ) { //Sgt. Macey 21 1 Ramirez, get on that sniper rifle! Scan for targets to the south of the Washington Monument. level.teamleader thread dialogue_execute( "dcburn_mcy_sniperrifle" ); } else { //Sgt. Macey Ramirez, scan for targets to the south of the Washington Monument! level.teamleader thread dialogue_execute( "dcburn_mcy_scanfortargets" ); } wait( 2 ); flag_set( "obj_commerce_defend_snipe_given" ); if ( !flag( "player_is_on_turret" ) ) { wait( 4 ); } //Evac Site Radio Voice All callsigns on this net, this is the Washington Monument Evac Site! We're holding our own but have glassed enemies to the west and are taking fire from that direction! radio_dialogue( "dcburn_evc_glassedenemieswest" ); flag_set( "can_start_crow_nags" ); } vehicles_crowsnest_defend_think() { level endon( "obj_commerce_defend_snipe_complete" ); /*----------------------- MAKE DAMAGEABLE/INVULNERABLE -------------------------*/ self setcandamage( true ); origin = self.origin; /*----------------------- WAIT TILL DAMAGED -------------------------*/ while( isdefined( self ) ) { self waittill( "damage", amount, attacker, enemy_org, impact_org, type ); if ( !isdefined( type ) ) continue; if ( !isdefined( attacker ) ) continue; if ( ( isdefined( attacker.code_classname ) ) && ( attacker.code_classname == "misc_turret" ) ) //don't blow up if using barrett continue; if ( !isdefined( amount ) ) continue; if ( isplayer( attacker ) ) continue; if ( ( isdefined( attacker.team ) ) && ( attacker.team != "axis" ) ) continue; if ( ( type == "MOD_PROJECTILE" ) && ( amount > 999 ) ) break; if ( ( type == "MOD_PROJECTILE_SPLASH" ) && ( amount == 4000 ) ) break; } /*----------------------- REMOVE FROM POOL OF TARGETS/VEHICLES -------------------------*/ if ( is_in_array( level.evacSiteVehicles, self ) ) level.evacSiteVehicles = array_remove( level.evacSiteVehicles, self ); if ( is_in_array( level.targetsScriptedJavStinger, self ) ) level.targetsScriptedJavStinger = array_remove( level.targetsScriptedJavStinger, self ); self.dead = true; level notify( "evac_vehicle_owned" ); /*----------------------- IF A SCRIPT_MODEL, DELETE AND SWAP -------------------------*/ eDeathModel = undefined; effect = "large_vehicle_explosion"; sound = "exp_tanker_vehicle"; if ( isdefined( self.script_linkTo ) ) { eDeathModel = getent( self.script_linkto, "script_linkname" ); eDeathModel show(); self delete(); } else { switch( self.model ) { case "vehicle_hummer": eDeathModel = "vehicle_hummer_destroyed"; sound = "exp_armor_vehicle"; break; case "vehicle_bradley_static": eDeathModel = "vehicle_bradley_destroyed"; sound = "exp_armor_vehicle"; break; default: assertmsg( "no destroyed model defined for " + self.model + " at " + self.origin ); } self setModel( eDeathModel ); } /*----------------------- PLAY FX AND EXPLOSION -------------------------*/ playfx( getfx( effect ), origin ); thread play_sound_in_space( sound, origin ); } vehicles_cheap_waittill_destroyed_think() { self endon( "death" ); /*----------------------- MAKE DAMAGEABLE/INVULNERABLE -------------------------*/ self setcandamage( true ); /*----------------------- WAIT TILL DAMAGED -------------------------*/ while( isdefined( self ) ) { self waittill( "damage", amount, attacker, enemy_org, impact_org, type ); if ( !isdefined( type ) ) continue; if ( !isdefined( attacker ) ) continue; if ( !isdefined( amount ) ) continue; if ( isplayer( attacker ) ) continue; if ( ( type == "MOD_PROJECTILE" ) && ( amount > 999 ) ) break; if ( ( type == "MOD_PROJECTILE_SPLASH" ) && ( amount == 4000 ) ) break; } /*----------------------- IF A SCRIPT_MODEL, DELETE AND SWAP -------------------------*/ eDeathModel = undefined; effect = "large_vehicle_explosion"; sound = "exp_tanker_vehicle"; fireFx = "tanker_fire"; onFire = false; if ( isdefined( self.script_linkTo ) ) { eDeathModel = getent( self.script_linkto, "script_linkname" ); eDeathModel show(); self delete(); } else { switch( self.model ) { case "vehicle_hummer": eDeathModel = "vehicle_hummer_destroyed"; sound = "exp_armor_vehicle"; fireFx = undefined; break; case "vehicle_bradley": eDeathModel = "vehicle_bradley"; sound = "exp_armor_vehicle"; fireFx = undefined; break; case "vehicle_m1a1_abrams": eDeathModel = "vehicle_m1a1_abrams_dmg"; sound = "exp_armor_vehicle"; fireFx = undefined; break; default: assertmsg( "no destroyed model defined for " + self.model + " at " + self.origin ); } self setModel( eDeathModel ); } /*----------------------- PLAY FX AND EXPLOSION -------------------------*/ playfx( getfx( effect ), self.origin ); self thread play_sound_in_space( sound ); if ( isDefined( fireFx ) ) { dummy = spawn( "script_origin", self.origin + ( 0, 0, 0 ) ); dummy.angles = self.angles; fx = spawnFx( getFx( fireFx ), dummy.origin ); triggerFx( fx ); flag_wait( "player_heli_19" ); fx delete(); dummy delete(); } } /**************************************************************************** COMMERCE BUILDING - CROWS_NEST ARMOR ****************************************************************************/ AA_crows_nest_armor_init() { thread AAA_sequence_crowsnest_armor(); thread javelin_hints(); thread backup_enemies_for_javelin_sequence(); thread music_crowsnest_armor(); thread obj_commerce_defend_javelin(); thread dialogue_crow_armor(); flag_wait( "crowsnest_sequence_finished" ); thread AA_commerce_to_roof_init(); } javelin_hints() { flag_wait( "obj_commerce_defend_javelin_given" ); wait ( 5 ); if ( flag( "player_has_killed_at_least_one_javelin_target" ) ) return; while( !flag( "player_has_killed_at_least_one_javelin_target" ) ) { wait( 20 ); if ( player_has_javelin() ) wait( 10 ); if ( flag( "player_has_killed_at_least_one_javelin_target" ) ) return; if ( !player_has_javelin() ) { level.player thread display_hint( "javelin_pickup" );//it will endon this thread if not threaded } else if ( ( player_has_javelin() ) && ( javelin_equipped() ) ) { level.player thread display_hint( "javelin_shoot" );//it will endon this thread if not threaded } else { level.player thread display_hint( "javelin_switch" );//it will endon this thread if not threaded } } } should_break_javelin_fire_hint() { if ( flag( "player_has_killed_at_least_one_javelin_target" ) ) return true; if ( !player_has_javelin() ) return true; if ( !javelin_equipped() ) return true; return maps\_javelin::PlayerJavelinAds(); } should_break_javelin_switch_hint() { if ( flag( "player_has_killed_at_least_one_javelin_target" ) ) return true; return javelin_equipped(); } should_break_javelin_pickup_hint() { if ( flag( "player_has_killed_at_least_one_javelin_target" ) ) return true; assert( isplayer( self ) ); //if ( gettime() > level.heartbeat_timeout ) //return true; if ( javelin_equipped() ) return true; weapons = level.player getweaponslistprimaries(); has_javelin = false; return player_has_javelin(); } player_has_javelin() { weapons = level.player GetWeaponsListAll(); if ( !isdefined( weapons ) ) return false; foreach ( weapon in weapons ) { if ( IsSubStr( weapon, "javelin" ) ) return true; } return false; } javelin_equipped() { weapon = level.player getCurrentWeapon(); if ( IsSubStr( weapon, "javelin" ) ) return true; else return false; } music_crowsnest_armor() { flag_wait( "obj_commerce_defend_javelin_given" ); music_stop(); wait( .1 ); thread music_loop( "dcburning_ordnance_and_run", 140 ); } backup_enemies_for_javelin_sequence() { flag_wait( "obj_commerce_defend_javelin_given" ); thread player_invulnerable_till_one_javelin_target_killed(); wait( 1 ); //spawn a few more tanks in case the player already went nuts during the javelin sequence if ( level.crowsarmor.size < 5 ) { tanks_crowsnest_wave2 = spawn_vehicles_from_targetname_and_drive( "tanks_crowsnest_wave2" ); array_thread( tanks_crowsnest_wave2,::tanks_crowsnest_wave2_think ); } // wait( .5 ); // // if ( level.crowsarmor.size < level.requiredJavTargets ) // { // level.requiredJavTargets = level.crowsarmor.size; // } } player_invulnerable_till_one_javelin_target_killed() { if ( level.gameskill > 1 ) return; level.player enableinvulnerability(); flag_wait( "player_has_killed_at_least_one_javelin_target" ); level.player disableinvulnerability(); } AAA_sequence_crowsnest_armor() { flag_wait( "start_crow_armor_sequence" ); barrett_trigger = getent( "barrett_trigger", "targetname" ); barrett_trigger.origin = barrett_trigger.origin + ( 0, 0, -20 ); barrett_trigger usetriggerrequirelookat(); /*----------------------- ENEMY ARMOR ROLLS IN -------------------------*/ level.monument_target thread monument_target_think(); helis_crowsnest = spawn_vehicles_from_targetname_and_drive( "helis_crowsnest" ); helis_crowsnest_respawners = spawn_vehicles_from_targetname_and_drive( "helis_crowsnest_respawners" ); array_thread( helis_crowsnest,:: helis_crowsnest_think ); array_thread( helis_crowsnest_respawners,:: helis_crowsnest_think ); /*----------------------- FRIENDLIES START SHOOTING AT DRONES, THEN STINGERS AT DUMMIES -------------------------*/ thread make_friendlies_shoot_stingers_and_javs(); volume = getent( "perimeter_enemies", "targetname" ); thread flag_set_when_volume_cleared_of_bad_guys( volume, "perimeter_enemies_have_retreated" ); /*----------------------- FRIENDLIES CAN HIT LIVE TARGETS NOW -------------------------*/ wait( 25 ); level.friendliesCanHelpCrowsnest = true; /*----------------------- ONLY 2 ARMOR/HELIS REMAINING -------------------------*/ flag_wait( "only_2_javelin_enemies_remaining" ); /*----------------------- DONE -------------------------*/ flag_wait( "obj_commerce_defend_javelin_complete" ); thread autosave_now(); flag_set( "crowsnest_sequence_finished" ); javelin_weapon_switch(); } make_friendlies_shoot_stingers_and_javs() { flag_wait( "perimeter_enemies_have_retreated" ); thread friendlies_shoot_at_crows_drones_start(); thread friendlies_shoot_stingers_start(); } javelin_weapon_switch() { /*----------------------- SWITCH OUT JAVELIN, GIVE EOTECH IF PLAYER DOES NOT HAVE -------------------------*/ if ( !player_has_javelin() ) return; hasGren = false; tookWeapon = false; weaponList = level.player GetWeaponsListPrimaries(); tookMainWeapon = false; foreach ( weapon in weaponList ) { if ( issubstr( weapon, "avelin" ) ) { tookWeapon = true; if ( issubstr( level.player GetCurrentWeapon(), "avelin" ) ) { tookMainWeapon = true; level.player DisableWeapons(); wait( 1.5 ); } level.player takeweapon( weapon ); continue; } if ( weapon == "m4m203_eotech" ) { hasGren = true; } } if ( !tookWeapon ) { return; } level.player EnableWeapons(); if ( !hasGren ) { level.player giveWeapon( "m4m203_eotech" ); } if ( tookMainWeapon ) level.player switchToWeapon( "m4m203_eotech" ); } dialogue_crow_armor() { flag_wait( "start_crow_armor_sequence" ); //Overlord (HQ Radio) Hunter Two-One, recommend you clear outta there...I see a mass of foot-mobiles converging on your position… radio_dialogue( "dcburn_hqr_clearout" ); //Sgt. Macey 23 2 Negative negative. I have eyes on enemy armor and helicopters advancing on the evac site from the south and southwest! level.teamleader dialogue_execute( "dcburn_mcy_negative" ); flag_set( "obj_commerce_defend_javelin_given" ); //Ramirez, use some of this ordnance to take out the enemy vehicles! Move! level.teamleader dialogue_execute( "dcburn_mcy_useordnance" ); thread crowsnest_nags_armor(); thread evac_site_damage_nags_armor(); } crowsnest_nags_armor() { volume_crowsnest = getent( "volume_crowsnest", "targetname" ); level.lasttimePlayerKilledEnemy = getTime(); rocket_nag_number = 0; rocket_nag_number_max = 3; stay_in_nest_nag_number = 0; stay_in_nest_nag_number_max = 2; rocket_shoot_nag_number = 0; rocket_shoot_nag_number_max = 2; wait( .5 ); while( !flag( "obj_commerce_defend_javelin_complete" ) ) { //reset nag numbers if ( rocket_nag_number > rocket_nag_number_max ) rocket_nag_number = 0; if ( stay_in_nest_nag_number > stay_in_nest_nag_number_max ) stay_in_nest_nag_number = 0; if ( rocket_shoot_nag_number > rocket_shoot_nag_number_max ) rocket_shoot_nag_number = 0; nag_wait(); if ( flag( "obj_commerce_defend_javelin_complete" ) ) break; if ( ( !level.player istouching( volume_crowsnest ) ) && ( flag( "can_talk" ) ) ) { flag_clear( "can_talk" ); level.teamleader dialogue_execute( "stay_in_nest_nag_" + stay_in_nest_nag_number ); stay_in_nest_nag_number++; flag_set( "can_talk" ); } else if( ( !level.player player_using_missile() ) && ( flag( "can_talk" ) ) ) { flag_clear( "can_talk" ); level.teamleader dialogue_execute( "rocket_nag_" + rocket_nag_number ); rocket_nag_number++; flag_set( "can_talk" ); } else if( ( !player_killing_crow_targets_at_a_good_pace() ) && ( flag( "can_talk" ) ) ) { flag_clear( "can_talk" ); level.teamleader dialogue_execute( "rocket_shoot_nag_" + rocket_shoot_nag_number ); rocket_shoot_nag_number++; flag_set( "can_talk" ); } } } monument_target_think() { level.evacSitePercentDestroyed = 0; /*----------------------- USE DUMMY SCRIPT MODEL TO DETERMINE DAMAGE DONE BY ENEMY ARMOR, HELIS -------------------------*/ level endon( "mission failed" ); level endon( "missionfailed" ); self setcandamage( true ); //determine barrel hitpoints based on difficulty self.hitpoints = undefined; switch( level.gameSkill ) { case 0:// easy self.hitpoints = 5000; break; case 1:// regular self.hitpoints = 5000; break; case 2:// hardened self.hitpoints = 5000; break; case 3:// veteran self.hitpoints = 5000; break; } self.baseHitpoints = self.hitpoints; flag_set( "monument_dummy_target_setup" ); while( !flag( "obj_commerce_defend_javelin_complete" ) ) { self waittill( "damage", amount, attacker, enemy_org, impact_org, type ); if ( !isdefined( attacker ) ) continue; if ( !isdefined( amount ) ) continue; if ( isplayer( attacker ) ) continue; if ( ( isdefined( attacker.team ) ) && ( attacker.team != "axis" ) ) continue; if ( !isdefined( type ) ) continue; if ( type == "MOD_PROJECTILE" ) { self reduce_monument_hitpoints( 100 ); if ( self.hitpoints < 1 ) break; } if ( type == "MOD_PROJECTILE_SPLASH" ) { self reduce_monument_hitpoints( 50 ); if ( self.hitpoints < 1 ) break; } } if( !flag( "obj_commerce_defend_javelin_complete" ) ) thread crowsnest_mission_fail_armor(); } reduce_monument_hitpoints( hitpoints ) { self.hitpoints = self.hitpoints - hitpoints; fPercentRemaining = ( self.hitpoints / self.baseHitpoints ) * 100; fPercentRemaining = roundDecimalPlaces( fPercentRemaining, 0 ); fPercentDestroyed = 100 - fPercentRemaining; level.evacSitePercentDestroyed = fPercentDestroyed; level notify( "monument_dummy_hit" ); if ( getdvar( "dc_debug" ) == "1" ) println( "evac damage = " + level.evacSitePercentDestroyed ); } evac_site_damage_nags_armor() { flag_wait( "monument_dummy_target_setup" ); percentDestoyedAtLeast = 0; baseHitpoints = level.monument_target.hitpoints; while ( !flag( "obj_commerce_defend_javelin_complete" ) ) { flag_wait( "can_talk" ); level waittill( "monument_dummy_hit" ); if ( level.evacSitePercentDestroyed == 100 ) { flag_clear( "can_talk" ); //Evac Site Radio Voice All callsigns, this is the Washington Monument evac site!!! Be advised, our situation is critical!!! We can't take much more of this!!! We need more time to get these civvies outta here!!! radio_dialogue( "dcburn_evc_damage_fail" ); flag_set( "can_talk" ); return; } else if ( ( level.evacSitePercentDestroyed > 25 ) && ( level.evacSitePercentDestroyed < 50 ) && ( percentDestoyedAtLeast < 25 ) ) { flag_clear( "can_talk" ); //Evac Site Radio Voice We're taking fire at the Washington Monument! We are down to 80 percent combat effectiveness! Request immediate sniper fire on targets west of the Monument, over! radio_dialogue( "dcburn_evc_damage_00" ); percentDestoyedAtLeast = 25; flag_set( "can_talk" ); } else if ( ( level.evacSitePercentDestroyed > 50 ) && ( level.evacSitePercentDestroyed < 75 ) && ( percentDestoyedAtLeast < 50 ) ) { flag_clear( "can_talk" ); //Evac Site Radio Voice All callsigns, be advised, enemies to the west are attempting a force-in-detail assault on the Washington Monument evac site! radio_dialogue( "dcburn_evc_damage_01" ); percentDestoyedAtLeast = 50; flag_set( "can_talk" ); } else if ( ( level.evacSitePercentDestroyed > 75 ) && ( level.evacSitePercentDestroyed < 90 ) && ( percentDestoyedAtLeast < 75 ) ) { flag_clear( "can_talk" ); //Evac Site Radio Voice Washington Monument evac site to all callsigns!! Enemy fire from the west is threatening to destroy our position!! We can't take much more of this!! radio_dialogue( "dcburn_evc_damage_02" ); percentDestoyedAtLeast = 75; flag_set( "can_talk" ); } else if ( ( level.evacSitePercentDestroyed > 90 ) && ( level.evacSitePercentDestroyed < 100 ) && ( percentDestoyedAtLeast < 90 ) ) { flag_clear( "can_talk" ); //Evac Site Radio Voice Washington Monument evac site taking heavy fire!!! We're down to 50 percent combat effectiveness!!! We gotta get more fire support or this evac site is gonna fall!!! Over!!! radio_dialogue( "dcburn_evc_damage_03" ); percentDestoyedAtLeast = 90; flag_set( "can_talk" ); } } } tanks_crowsnest_wave1_gopath( aTanks ) { foreach( tank in aTanks ) { wait( 5 ); thread gopath( tank ); } } helis_crowsnest_think() { self endon( "death" ); self thread heli_crowsnest_respawn(); self thread obj_commerce_defend_javelin_enemies_think(); aPathNodes = vehicle_get_path_array(); array_thread( aPathNodes, ::heli_pathnodes_think, self ); } heli_crowsnest_respawn() { if ( ( isdefined( self.script_noteworthy ) ) && ( issubstr( self.script_noteworthy, "crow_heli_respawner_" ) ) ) { noteworthyName = self.script_noteworthy; self waittill( "death" ); wait( 1 ); spawner = getent( noteworthyName, "script_noteworthy" ); assert( isdefined( spawner ) ); if ( !flag( "obj_commerce_defend_javelin_complete" ) ) { heli = vehicle_spawn( spawner ); thread gopath( heli ); heli thread helis_crowsnest_think(); } } } heli_pathnodes_think( heli ) { heli endon( "death" ); if ( !isdefined( self.script_noteworthy ) ) return; eTarget = undefined; bGunTarget = undefined; switch( self.script_noteworthy ) { case "target_nothing": eTarget = undefined; break; case "target_evac": eTarget = getent( "monument_target", "targetname" ); bGunTarget = eTarget; break; case "target_crowsnest": eTarget = getent( "javelin_source_org", "targetname" ); bGunTarget = level.player; break; default: return; } while( isdefined( heli ) ) { self waittill( "trigger" ); if ( !isdefined( eTarget ) ) heli clearLookAtEnt(); else heli SetLookAtEnt( eTarget ); if( isdefined( bGunTarget ) ) { heli thread vehicle_heli_fire_turret( bGunTarget ); } else heli notify( "stop_firing_turret" ); } } tanks_crowsnest_wave1_think() { self endon( "death" ); self ent_flag_init( "start_firing" ); self ent_flag_wait( "start_firing" ); self thread tank_fire_at_evac_site(); flag_wait( "obj_commerce_defend_javelin_given" ); self thread obj_commerce_defend_javelin_enemies_think(); } tanks_crowsnest_wave2_think() { self endon( "death" ); self ent_flag_init( "start_firing" ); flag_wait( "obj_commerce_defend_javelin_given" ); self thread obj_commerce_defend_javelin_enemies_think(); self ent_flag_wait( "start_firing" ); self thread tank_fire_at_evac_site(); } tank_fire_at_evac_site() { self endon( "death" ); self vehicle_turret_scan_off(); self thread vehicle_tank_fire_turret( level.monument_target ); while( isdefined( self ) ) { self setTurretTargetEnt( level.monument_target ); wait( randomfloatrange( 3, 6 ) ); self fireWeapon(); } } /**************************************************************************** COMMERCE TO ROOFTOP ****************************************************************************/ AA_commerce_to_roof_init() { thread AAA_sequence_get_to_roof(); thread dialogue_get_to_roof(); thread obj_rooftop(); //thread music_to_roof(); flag_wait( "player_approaching_outer_balcony" ); thread AA_roof_init(); } breach_double_door_swings_open() { flag_wait( "roof_door_kicked" ); door_to_roof_swing = getent( "door_to_roof_swing", "targetname" ); door_to_roof_swing.startingpos = self.origin; door_to_roof_swing.startingangles = self.angles; door_to_roof_swing rotateyaw( -170, 0.5 ); door_to_roof_swing moveto ( door_to_roof_swing.origin + ( 11, 0, 0), 0.1 ); door_to_roof_swing connectpaths(); } AI_breach_defenders_think() { //friendlies_breach_defend keep player company till he goes up the stairs self endon( "death" ); self thread try_to_magic_bullet_shield(); self.neverEnableCQB = true; //self.fixednode = false; self.goalradius = 16; self.baseaccuracy = 1000; self.attackeraccuracy = 0; //makes any AI attacking him have shitty accuracy flag_wait( "player_roof_stairs_00" ); //player heading up stairs...kill these guys self.health = 1; self.baseaccuracy = .01; self.attackeraccuracy = 10; //makes any AI attacking him have awesome accuracy self thread stop_magic_bullet_shield(); } AAA_sequence_get_to_roof() { /*----------------------- SETUP FRIENDLIES TO BREACH DOOR -------------------------*/ flag_wait( "only_2_javelin_enemies_remaining" ); trigger_volume_breach_stairwell = getent( "trigger_volume_breach_stairwell", "targetname" ); trigger_volume_breach_stairwell trigger_off(); volume_breach_stairwell = getent( "volume_breach_stairwell", "targetname" ); thread roof_breach_monitor( volume_breach_stairwell ); aBreachers = array_spawn( getentarray( "crowsnest_breachers", "targetname" ) ); aBreachDefenders = array_spawn( getentarray( "friendlies_breach_defend", "targetname" ) ); array_thread( aBreachDefenders,::AI_breach_defenders_think ); sBreachType = "shotgunhinges_breach_left"; volume_breach_stairwell thread maps\_breach::breach_think( aBreachers, sBreachType ); foreach ( guy in aBreachers ) { guy.eNode = getnode( guy.target, "targetname" ); guy thread AI_ignored_and_oblivious_on(); } /*----------------------- PLAYER SQUAD HEADS TO ROOF DOOR -------------------------*/ flag_wait( "crowsnest_sequence_finished" ); triggersEnable( "colornodes_start_to_roof", "script_noteworthy", true ); trig_colornode = getent( "colornodes_start_to_roof", "script_noteworthy" ); trig_colornode notify( "trigger", level.player ); level.squad = remove_dead_from_array( level.squad ); thread breach_double_door_swings_open(); trigger_volume_breach_stairwell trigger_on(); delaythread( 3,::spawn_trigger_dummy, "dummy_spawner_roof_wave_01" ); /*----------------------- ENEMIES START TO OVERRUN, DOOR BREACHED -------------------------*/ flag_wait( "obj_rooftop_given" ); if ( ( isdefined( level.crowsArmor ) ) && ( level.crowsArmor.size > 0 ) ) array_thread( level.crowsArmor,::crows_armor_cleanup ); //thread friendly_speed_adjustment_on(); friendlies = getaiarray( "allies" ); array_thread( friendlies,::cqb_walk, "off" ); foreach( guy in friendlies ) guy.neverEnableCQB = true; //wait( 2 ); flag_wait( "roof_breach_complete" ); /*----------------------- BREACHERS COVER PLAYER EXIT -------------------------*/ foreach ( guy in aBreachers ) { guy setgoalnode( guy.eNode ); //guy.fixednode = true; guy.goalradius = 64; } /*----------------------- SQUAD HEADS TO THE ROOF -------------------------*/ triggersEnable( "colornodes_to_roof", "script_noteworthy", true ); setsaveddvar( "ai_friendlyFireBlockDuration", 0 ); //ai won't stop in front of player line of fire foreach( guy in level.squad ) { if ( !isalive( guy ) ) continue; //guy.fixednode = true; //guy.ignoreall = true; guy.a.disablePain = true; guy.ignoresuppression = true; guy.disableDamageShieldPain = true; guy.grenadeawareness = 0; guy.goalradius = 32; //make Dunn and Macey have better accuracy than attackers if ( ( guy == level.teamleader ) || ( guy == level.friendly02 ) ) { self.attackeraccuracy = .01; //makes any AI attacking him miss a lot self.baseaccuracy = 1000; //excellent accuracy } } wait( 2 ); array_thread( aBreachers, ::AI_roof_escape_redshirts_think ); foreach ( guy in aBreachers ) { guy thread AI_ignored_and_oblivious_off(); } /*----------------------- MORE ENEMIES -------------------------*/ spawn_trigger_dummy( "dummy_spawner_roof_wave_02" ); /*----------------------- MAIN SQUAD HEADS TO THE ROOF IF PLAYER NOT ON HIS WAY -------------------------*/ if ( !flag( "player_roof_stairs_00" ) ) thread dummy_trigger( "dummy_colornodes_to_roof" ); /*----------------------- CLEANUP -------------------------*/ flag_wait( "player_roof_stairs_01" ); if ( ( isdefined( level.evacSiteEnemies ) ) && ( level.evacSiteEnemies.size > 0 ) ) array_thread( level.evacSiteEnemies,:: AI_delete ); thread drone_flood_stop( "hostiles_drones_comm_south" ); thread vehicle_delete_all(); thread AI_drone_cleanup( "all", 1024, true ); flag_wait( "player_roof_stairs_02" ); jets_tenches_01 = spawn_vehicles_from_targetname_and_drive( "jets_tenches_01" ); /*----------------------- TRY TO TELEPORT KEY FRIENDLIES TO ROOF -------------------------*/ eNodeLeader = getnode( "node_roof_leader", "targetname" ); eNodeFriendly02 = getnode( "node_roof_friendly02", "targetname" ); level.teamleader thread try_to_teleport_friendlies_to_roof( eNodeLeader ); level.friendly02 thread try_to_teleport_friendlies_to_roof( eNodeFriendly02 ); /*----------------------- ENEMY JETS DROPPING CLUSTER BOMBS -------------------------*/ flag_wait( "player_top_floor_commerce" ); jets_tenches_02 = spawn_vehicles_from_targetname_and_drive( "jets_tenches_02" ); flag_wait( "player_outer_balcony_top_commerce" ); eHeli = spawn_vehicle_from_targetname( "heli_deck2" ); thread maps\_vehicle::gopath( eHeli ); //eHeli.dontWaitForPathEnd = true; eHeli thread heli_balcony_think(); //eHeli = maps\_attack_heli::begin_attack_heli_behavior( eHeli ); flag_wait( "player_at_commerce_rooftop" ); if ( isdefined( eHeli ) ) eHeli delete(); flag_set( "obj_rooftop_complete" ); thread kill_timer(); thread autosave_by_name( "rooftop" ); //eHeli Vehicle_SetSpeed( 10 ); //music_stop( 5 ); } heli_balcony_think() { self endon( "death" ); self SetLookAtEnt( level.player ); flag_wait( "balcony_heli_raised_up" ); self ClearLookAtEnt(); flag_wait( "player_at_commerce_rooftop" ); if ( isdefined( self ) ) self delete(); } crows_armor_cleanup() { self endon( "death" ); flag_wait( "player_roof_stairs_01" ); if( isdefined( self ) ) self vehicle_delete(); } AI_roof_escape_redshirts_think() { self endon( "death" ); self.neverEnableCQB = true; self.health = 1; //self.fixednode = false; self.goalradius = 32; self.baseaccuracy = .01; // while( isalive( self ) ) // { // wait( 1 ); // self.ignoreall = true; // wait( 1 ); // self.ignoreall = false; // } } dummy_trigger( dummyName ) { dummy = getent( dummyName, "targetname" ); trigger = getEnt( dummy.script_LinkTo, "script_linkname" ); if ( isdefined( trigger ) ) trigger notify( "trigger", level.player ); } roof_breach_monitor( eVoloume ) { eVoloume waittill( "breach_complete" ); flag_set( "roof_breach_complete" ); } //music_to_roof() //{ // flag_wait( "roof_door_kicked" ); // // MusicPlay( "dcburning_stairway_escape_header" ); // wait( 40.978 ); // music_stop(); // thread music_loop( "dcburning_stairway_escape_loop", 40.96 ); // //} dialogue_get_to_roof() { flag_wait( "crowsnest_sequence_finished" ); //Overlord (HQ Radio) Outstanding work, Hunter Two-One, all transports are away. Now get your ass to the roof ASAP...you are in danger of being overrun. radio_dialogue( "dcburn_hqr_roofasap" ); flag_set( "obj_rooftop_given" ); //Sgt. Macey Roger that, we're headed to the rooftop! Everyone, move out! level.teamleader dialogue_execute( "dcburn_mcy_rooftop" ); thread escape_timer( 90 ); //Overlord (HQ Radio) 32 7 Atlas Two-Six is now away. All remaining evacuation units, execute level three evacuation protocols. Urgent surgicals only. radio_dialogue( "dcburn_hqr_urgentsurgicals" ); //nag player to get to breach door while ( !flag( "roof_breach_complete" ) ) { //Sgt. Macey Get to the roof and RV with the SEAL Team! Move! Move! level.teamleader dialogue_execute( "dcburn_mcy_rvwithseals" ); wait( randomfloatrange( 8, 12 ) ); if ( flag( "roof_breach_complete" ) ) break; //Sgt. Macey 26 3 Keep moving! This sector's gonna be crawlin' with hostiles! We gotta go, NOW!! level.teamleader dialogue_execute( "dcburn_mcy_crawlin" ); wait( randomfloatrange( 8, 12 ) ); if ( flag( "roof_breach_complete" ) ) break; //Sgt. Macey Ramirez! Let's move out! level.teamleader dialogue_execute( "dcburn_mcy_letsmoveout" ); wait( randomfloatrange( 8, 12 ) ); if ( flag( "roof_breach_complete" ) ) break; //Sgt. Macey Ramirez! Move your ass! We've gotta get to the roof, NOW! level.teamleader dialogue_execute( "dcburn_mcy_gettoroofnow" ); wait( randomfloatrange( 8, 12 ) ); if ( flag( "roof_breach_complete" ) ) break; //Sgt. Macey Ramirez, let's go! Hostiles are overrunning this position! level.teamleader dialogue_execute( "dcburn_mcy_overrunningpos" ); wait( randomfloatrange( 8, 12 ) ); if ( flag( "roof_breach_complete" ) ) break; } //**Ranger 5 32 8 We just lost Atlas Two-Three to triple-A from the Capitol Building!!! radio_dialogue( "dcburn_ar5_triplea" ); //**Ranger 2 32 9 Get those civvies back in their seats!!!! radio_dialogue( "dcburn_ar2_backinseats" ); //nag player to get up stairs after roof breached while ( !flag( "player_roof_stairs_00" ) ) { //Sgt. Macey 26 5 We're outnumbered - we need to get to the roof ASAP!!!! Go! Go! Go! level.teamleader dialogue_execute( "dcburn_mcy_outnumbered" ); wait( randomfloatrange( 8, 12 ) ); if ( flag( "player_roof_stairs_00" ) ) break; //Sgt. Macey Ramirez! Up the stairs! Let's go! level.teamleader dialogue_execute( "dcburn_mcy_upthestairsgo" ); wait( randomfloatrange( 8, 12 ) ); if ( flag( "player_roof_stairs_00" ) ) break; //Sgt. Macey Ramirez! Get up the stairs to the roof ASAP…our evac choppers aren't going to wait all day! level.teamleader dialogue_execute( "dcburn_mcy_waitallday" ); wait( randomfloatrange( 8, 12 ) ); if ( flag( "player_roof_stairs_00" ) ) break; //Sgt. Macey We're getting overrun! Everyone to the roof! Now! level.teamleader dialogue_execute( "dcburn_mcy_gettingoverrun" ); } wait( 2 ); //Sgt. Foley We're out of time! Go! level.teamleader dialogue_execute( "dcburn_mcy_outoftimego" ); wait( 2 ); //Cpl. Dunn Hostiles closing in!!! level.friendly02 dialogue_execute( "dcburn_cpd_closingin" ); flag_wait( "player_roof_stairs_02" ); //Sgt. Macey: Move up! Go! Go! level.teamleader dialogue_execute( "dcburn_mcy_lobby_move_nag_00" ); flavorbursts_off( "allies" ); //Ranger 3 32 5 I've got a major hydraulic leak! We're barely gonna make it over the MSR! We gotta touch down - we gotta (static)! level.player play_sound_on_entity( "dcburn_ar3_gottatouchdown" ); flavorbursts_on( "allies" ); flag_wait( "player_outer_balcony_top_commerce" ); while( !flag( "player_headed_to_roof" ) ) { //Sgt. Macey: Push forward! Move! Move! level.teamleader dialogue_execute( "dcburn_mcy_lobby_move_nag_02" ); wait( 2 ); //Sgt. Foley There's no time! Keep moving! level.teamleader dialogue_execute( "dcburn_mcy_notime" ); if ( flag( "player_headed_to_roof" ) ) break; wait( 2 ); if ( flag( "player_headed_to_roof" ) ) break; //Sgt. Foley We have to keep moving! Go! Go! Go! level.teamleader dialogue_execute( "dcburn_mcy_keepmoving" ); wait( 2 ); } flag_wait( "player_headed_to_roof" ); radio_dialogue( "dcburn_bhp_whatsyourstatus" ); //Black Hawk Pilot Hunter, this is Dagger Two-One. We are in position at the LZ on the rooftop, what's your status? //Sgt. Macey We're on our way! Hostiles following close behind! level.teamleader dialogue_execute( "dcburn_mcy_hostilesclose" ); while( !flag( "player_at_commerce_rooftop" ) ) { wait( 1 ); if ( flag( "player_at_commerce_rooftop" ) ) break; wait( 1 ); if ( flag( "player_at_commerce_rooftop" ) ) break; //Sgt. Foley We're getting overrun! Move! Move! Move! level.teamleader dialogue_execute( "dcburn_mcy_overrun" ); wait( 1 ); if ( flag( "player_at_commerce_rooftop" ) ) break; wait( 1 ); if ( flag( "player_at_commerce_rooftop" ) ) break; //Sgt. Macey: Move up! Go! Go! level.teamleader dialogue_execute( "dcburn_mcy_lobby_move_nag_00" ); wait( 1 ); if ( flag( "player_at_commerce_rooftop" ) ) break; wait( 1 ); if ( flag( "player_at_commerce_rooftop" ) ) break; //Sgt. Foley We're out of time! Go! level.teamleader dialogue_execute( "dcburn_mcy_outoftimego" ); wait( 1 ); if ( flag( "player_at_commerce_rooftop" ) ) break; wait( 1 ); if ( flag( "player_at_commerce_rooftop" ) ) break; //Sgt. Macey 26 5 We're outnumbered - we need to get to the roof ASAP!!!! Go! Go! Go! level.teamleader dialogue_execute( "dcburn_mcy_outnumbered" ); } flag_set( "rooftop_run_dialogue_finished" ); } /**************************************************************************** ROOF/HELI RIDE ****************************************************************************/ AA_roof_init() { thread obj_heli_mount(); thread dialogue_roof(); thread music_heli_ride(); thread heli_at4_sequence(); thread AAA_sequence_heli_ride(); thread littlebird_wingman_02_think(); thread littlebird_wingman_armed_think(); thread obj_heli_ride(); flag_wait( "player_heli_18" ); AA_heli_ride2(); } music_heli_ride() { flag_wait( "roof_heli_about_to_be_owned" ); flag_wait_or_timeout( "roof_heli_owned", 1.65 ); MusicPlayWrapper( "dcburning_heli_ride3" ); } dialogue_roof() { flag_wait( "player_at_commerce_rooftop" ); flag_wait( "blackhawk_landed" ); //wait( 3 ); flag_set( "obj_heli_mount_given" ); thread dialogue_nag_minigun(); flag_wait( "player_getting_on_minigun" ); level.player SetActionSlot( 1, "" ); level.player NightVisionForceOff(); while( !flag( "can_talk" ) ) wait( .5 ); //Sgt. Macey Overlord, we've linked up with the SEALs on the rooftop and are heading out. Interrogative - has the bunker been evacuated, over? radio_dialogue( "dcburn_mcy_bunkerevac" ); //Overlord (HQ Radio) 27 2 Negative Two-One, they're still pinned down by infantry and light armor. Doesn't look good from here, over. radio_dialogue( "dcburn_hqr_stillpinned" ); //Sgt. Macey 27 3 Copy Overlord, we'll do what we can from the air, out. radio_dialogue( "dcburn_mcy_fromtheair" ); //wait( 4 ); //Sgt. Macey 28 1 This is Hunter Two-One Actual. We have eyes on multiple hostile victors and foot mobiles....request permission to engage, over. //radio_dialogue( "dcburn_mcy_permission" ); //Overlord (HQ Radio) 28 2 Your call, Two-One. Outlaw is pinned down at the bunkers. You're cleared hot along the MSR, over. //radio_dialogue( "dcburn_hqr_clearedhot" ); flag_set( "obj_heli_ride_given" ); thread autosave_now( true ); //Overlord (HQ Radio) 32 1 First wave of civilian transports is away. Reaver Two, proceed with second stage evacation. Litter urgent personnel only. thread radio_dialogue( "dcburn_hqr_firstwave" ); //Sgt. Macey 28 3 Squad, we're engaging all targets of opportunity to buy Outlaw some time to get out! This may be a one way trip. Hooah? //radio_dialogue( "dcburn_mcy_onewaytrip" ); //Cpl. Dunn Hooah. Rangers lead the way! //radio_dialogue( "dcburn_cpd_leadtheway" ); //Sgt. Macey All the way. //radio_dialogue( "dcburn_mcy_alltheway" ); //SEAL Team Leader We're with you, Two-One. Let's do this. //radio_dialogue( "dcburn_sll_withyou" ); flag_wait( "player_heli_05" ); //Little Bird Pilot 1 Dagger Two, SAM launch! Break left break left!!! radio_dialogue_overlap( "dcburn_lbp1_breakleftbreakleft" ); flag_wait( "player_heli_07" ); //Sgt. Foley Overlord, Dagger Two-Two is hit and going down! radio_dialogue( "dcburn_mcy_hitgoingdown" ); flag_wait( "player_heli_09" ); wait( 1 ); //Black Hawk Pilot RPG teams in sight...I want you to pull that trigger till they don't get up. radio_dialogue( "dcburn_bhp_dontgetup" ); //Overlord (HQ Radio) 32 3 Atlas Two-Three, Two-Four and Two-Five are all away. Ground units at LZ 4, fall back now. radio_dialogue( "dcburn_hqr_fallbacknow" ); //Little Bird Pilot 1 Ramirez, we got foot mobiles and light armor down there. You're cleared hot. //radio_dialogue( "dcburn_lbp1_clearedhot" ); flag_set( "player_has_used_minigun" ); //**TODO, check to see if player has used gun to blow shit up yet if ( !flag( "player_has_used_minigun" ) ) { //Sgt. Macey Ramirez, spin her up and let her rip!!! dcburn_mcy_spinherup radio_dialogue( "dcburn_mcy_spinherup" ); } flag_wait( "player_heli_10c" ); //Little Bird Pilot 1 Enemy gunship lifting off at your twelve o'clock. radio_dialogue( "dcburn_lbp1_gunshipliftingoff" ); //Ranger 2 32 4 This is Atlas Two-Five at LZ 1! Engines are at 30 percent! I can't carry any more people! We're gonna have to leave some of them behind!! radio_dialogue( "dcburn_ar2_leavebehind" ); //Little Bird Pilot 1 Light armor rolling in. //radio_dialogue( "dcburn_lbp1_armorrollingin" ); flag_wait( "player_heli_14" ); //Evac Site Radio Voice Dagger Two, the evac site is taking fire from the main road! radio_dialogue( "dcburn_evc_mainroad" ); //Little Bird Pilot 1 Copy that, we're on it. //radio_dialogue( "dcburn_lbp1_wereonit" ); //**Overlord (HQ Radio) 32 10 Overlord to all units, evacuation order Irene, I repeat, evacuation order Irene. Everyone get the hell outta there. radio_dialogue( "dcburn_hqr_orderirene" ); //Ranger 1 32 11 Get your men on that transport now, WE ARE LEAVING!!! radio_dialogue( "dcburn_ar1_weareleaving" ); //Little Bird Pilot 1 Foot mobiles...take em out. //radio_dialogue( "dcburn_lbp1_footmobiles" ); //Ranger 4 32 6 This is Atlas One-One, civilian transport going down two klicks west of Dupont Circle! We are- (static) (screaming women and children on board in background) radio_dialogue( "dcburn_ar4_wearegoingdown" ); } dialogue_nag_minigun() { flag_wait( "rooftop_run_dialogue_finished" ); flag_set( "can_talk" ); while( !flag( "player_getting_on_minigun" ) ) { //Sgt. Macey We've gotta move! Ramirez, get on that minigun! flag_clear( "can_talk" ); level.teamleader dialogue_execute( "dcburn_mcy_moveminigun" ); flag_set( "can_talk" ); if( flag( "player_getting_on_minigun" ) ) break; wait( 30 ); if( flag( "player_getting_on_minigun" ) ) break; flag_clear( "can_talk" ); //Sgt. Macey Ramirez, get on the minigun!!! level.teamleader dialogue_execute( "dcburn_mcy_getonminigun" ); flag_set( "can_talk" ); if( flag( "player_getting_on_minigun" ) ) break; wait( 30 ); if( flag( "player_getting_on_minigun" ) ) break; flag_clear( "can_talk" ); //Sgt. Macey Ramirez!!! Get in the chopper!!! level.teamleader dialogue_execute( "dcburn_mcy_getinchopper" ); flag_set( "can_talk" ); if( flag( "player_getting_on_minigun" ) ) break; wait( 30 ); if( flag( "player_getting_on_minigun" ) ) break; flag_clear( "can_talk" ); //Sgt. Macey Ramirez!!! We are way outnumbered! Get on board!! Move!!! level.teamleader dialogue_execute( "dcburn_mcy_wayoutnumbered" ); flag_set( "can_talk" ); if( flag( "player_getting_on_minigun" ) ) break; wait( 30 ); if( flag( "player_getting_on_minigun" ) ) break; flag_clear( "can_talk" ); //Sgt. Macey Ramirez!! Forget about it! We got a minigun on board! Get on the helicopter! Let's go!!! level.teamleader dialogue_execute( "dcburn_mcy_forgetaboutit" ); flag_set( "can_talk" ); if( flag( "player_getting_on_minigun" ) ) break; wait( 30 ); if( flag( "player_getting_on_minigun" ) ) break; flag_clear( "can_talk" ); //Sgt. Macey Ramirez!!! You're polishing brass on the Titanic! Get on the minigun, let's go!!! level.teamleader dialogue_execute( "dcburn_mcy_brassontitanic" ); flag_set( "can_talk" ); if( flag( "player_getting_on_minigun" ) ) break; wait( 30 ); if( flag( "player_getting_on_minigun" ) ) break; } } AI_awesome_accuracy_untill_flag( sFlag ) { self endon( "death" ); if( !isdefined( self ) ) return; self.old_baseaccuracy = self.baseaccuracy; self.baseaccuracy = 1000; flag_wait( sFlag ); if( isdefined( self ) ) self.baseaccuracy = self.old_baseaccuracy; } AI_roof_defenders_think() { //rooftop_defender defend chokepoint till player on heli self endon( "death" ); self thread try_to_magic_bullet_shield(); self.neverEnableCQB = true; //self.fixednode = false; self.goalradius = 16; self.baseaccuracy = 1000; self.attackeraccuracy = 0; //makes any AI attacking him have shitty accuracy flag_wait( "player_getting_on_minigun" ); //player on minigun...this guy gets overrun self.health = 1; self.baseaccuracy = .01; self.attackeraccuracy = 10; //makes any AI attacking him have awesome accuracy self thread stop_magic_bullet_shield(); } AAA_sequence_heli_ride() { flag_wait( "player_headed_to_roof" ); /*----------------------- BLACKHAWK RIDER TO LEAD PLAYER -------------------------*/ level.AIdeleteExcluders = []; spawner = getent( "rooftop_helirider", "targetname" ); rooftop_helirider = spawner spawn_ai(); if ( isdefined( rooftop_helirider ) ) { rooftop_helirider thread AI_rooftop_helirider_think(); } /*----------------------- INVINCIBLE DUDE THAT WILL GUARD ROOFTOP CHOKEPOINT -------------------------*/ spawner = getent( "rooftop_defender", "targetname" ); defender = spawner spawn_ai(); if ( isdefined( defender ) ) defender thread AI_roof_defenders_think(); turret2 = getent( "turret2", "targetname" ); if ( isdefined( turret2 ) ) turret2 delete(); //thread autosave_by_name( "headed_to_roof" ); triggersEnable( "colornodes_roof", "script_noteworthy", true ); /*----------------------- TRENCH AMBIENT - FRIENDLY DRONES -------------------------*/ allied_drones_heliride_01 = getentarray( "allied_drones_heliride_01", "targetname" ); allied_drones_heliride_02 = getentarray( "allied_drones_heliride_02", "targetname" ); allied_drones_heliride_03 = getentarray( "allied_drones_heliride_03", "targetname" ); allied_drones_heliride_03 = getentarray( "allied_drones_heliride_04", "targetname" ); thread drone_flood_start( allied_drones_heliride_01, "allied_drones_heliride_01" ); thread drone_flood_start( allied_drones_heliride_02, "allied_drones_heliride_02" ); thread drone_flood_start( allied_drones_heliride_03, "allied_drones_heliride_03" ); thread drone_flood_start( allied_drones_heliride_03, "allied_drones_heliride_04" ); /*----------------------- SPAWN AND SETUP PLAYER BLACKHAWK -------------------------*/ player_blackhawk_setup(); level.blackhawk Vehicle_SetSpeed( 5 ); heli_roof_approach_01_end = getent( "heli_roof_approach_01_end", "targetname" ); level.blackhawk SetLookAtEnt( heli_roof_approach_01_end ); //level.blackhawk.animname = "blackhawk"; //level.blackhawk assign_animtree(); /*----------------------- PLAYER BLACKHAWK LANDS -------------------------*/ flag_wait( "roof_littlebird_lifted_off" ); level.blackhawk clearlookatent(); heli_roof_approach_01 = getent( "heli_roof_approach_01", "targetname" ); level.blackhawk thread vehicle_paths( heli_roof_approach_01 ); level.blackhawk Vehicle_SetSpeed( 100 ); level.blackhawk thread vehicle_heli_land( getent( "heli_roof_land_01", "script_noteworthy" ) ); level.blackhawk waittill( "landed" ); flag_set( "blackhawk_landed" ); trigger_origin = level.blackhawk gettagorigin( "tag_player" ); trigger_radius = 160; trigger_height = 100; trigger_spawnflags = 0;// player only triggerApproach = spawn( "trigger_radius", trigger_origin, trigger_spawnflags, trigger_radius, trigger_height ); thread team_leader_gets_on_blackhawk( triggerApproach ); /*----------------------- WAIT FOR PLAYER TO APPROACH GUN...MUST BE FACING CHOPPER -------------------------*/ trigger_origin = level.blackhawk gettagorigin( "tag_player" ); trigger_radius = 40; trigger_height = 100; trigger_spawnflags = 0;// player only level.blackhawk.trigger = spawn( "trigger_radius", trigger_origin, trigger_spawnflags, trigger_radius, trigger_height ); balackHawkOrigin = level.blackhawk gettagorigin( "TAG_ORIGIN" ); while( true ) { level.blackhawk.trigger waittill( "trigger" ); if ( within_fov( level.player geteye(), level.player getPlayerAngles(), balackHawkOrigin, level.cosine[ "90" ] ) ) break; } flag_set( "player_getting_on_minigun" ); if ( getdvarint( "r_dcburning_culldist" ) == 1 ) { setculldist( 20000 ); } flag_set( "obj_heli_mount_complete" ); thread player_blackhawk_health_tweaks(); maps\_friendlyfire::TurnOff(); level.disable_destructible_bad_places = true; //disables all badplaces for destructibles so AI won't wig out while player is lighting shit up /*----------------------- KILLSPAWNERS -------------------------*/ killSpawner( 7 ); killSpawner( 8 ); killSpawner( 10 ); //level.player enableinvulnerability(); volume_roof = getent( "volume_roof", "targetname" ); aAI_to_delete = volume_roof get_ai_touching_volume( "axis" ); array_thread( aAI_to_delete, ::AI_delete ); delaythread( 1.5,::delete_squad ); /*----------------------- SEAKNIGHTS FLY FROM EVAC SITE -------------------------*/ roof_seaknight_01 = getent( "roof_seaknight_01", "targetname" ); roof_seaknight_02 = getent( "roof_seaknight_02", "targetname" ); roof_seaknight_01 notify( "spawn" ); roof_seaknight_02 notify( "spawn" ); roof_seaknight_01 thread notify_delay( "play_anim", 1 ); roof_seaknight_02 thread notify_delay( "play_anim", 1 ); /*----------------------- PLAYER LERPED ONTO MINIGUN -------------------------*/ player_lerped_onto_minigun(); music_stop( 5 ); flag_wait( "roof_heli_about_to_be_owned" ); flag_set( "player_heli_ready_to_take_off" ); thread autosave_by_name( "heli_ride_01" ); /*----------------------- WW2 MEMORIAL HELIS SPAWNED -------------------------*/ ww2_heli = spawn_vehicle_from_targetname( "ww2_heli" ); //ww2_trucks = spawn_vehicles_from_targetname( "ww2_trucks" ); /*----------------------- START HELI RIDE -------------------------*/ path_player_heli = getstruct( "path_player_heli", "targetname" ); level.blackhawk vehicle_liftoff( 76 ); level.blackhawk player_blackhawk_default_params(); level.blackhawk thread player_blackhawk_default_params(); level.blackhawk thread vehicle_paths( path_player_heli ); /*----------------------- TRENCH AMBIENT - ABRAMS DESTROYED -------------------------*/ abrams_street = getent( "abrams_street", "targetname" ); abrams_street delete(); m1a1_heliride_01 = spawn_vehicle_from_targetname_and_drive( "m1a1_heliride_01" ); m1a1_heliride_02 = spawn_vehicle_from_targetname_and_drive( "m1a1_heliride_02" ); javelin_source_org = getent( m1a1_heliride_01.script_linkto, "script_linkname" ); newMissile = MagicBullet( "javelin_dcburn", javelin_source_org.origin, m1a1_heliride_01.origin ); newMissile thread javelin_earthquake(); //custom function to ensure an earthquake on impact newMissile Missile_SetTargetEnt( m1a1_heliride_01 ); newMissile Missile_SetFlightmodeTop(); //Code added this command so we could make the Javelin do an arc instead of a straight line humvee_heliride_01 = spawn_vehicle_from_targetname( "humvee_heliride_01" ); /*----------------------- FLYING OVER TRENCHES AND WASH MONUMNET -------------------------*/ flag_wait( "player_heli_02" ); level.blackhawk Vehicle_SetSpeed( 75 ); level.littlebird_wingman_02 vehicle_setSpeed( 70 ); array_thread( level.effects_commerce, ::pauseEffect ); array_thread( level.effects_bunker, ::pauseEffect ); /*----------------------- ARMED LITTLEBIRD SWITCHES PATH -------------------------*/ eNode = getstruct( "helipath_to_ww2_littlebird_wingman_armed", "targetname" ); sSpawnerTargetname = "littlebird_wingman_armed"; level.littlebird_wingman_armed = level.littlebird_wingman_armed heli_teleport_to_newpath( sSpawnerTargetname, eNode ); level.littlebird_wingman_armed Vehicle_SetSpeed( 100 ); /*----------------------- WINGMEN LITTLEBIRDS SWITCH PATHS -------------------------*/ level.littlebird_wingman_02 vehicle_delete(); level.littlebird_wingman_02 = spawn_vehicle_from_targetname_and_drive( "littlebird_wingman_02_drone_roof" ); eNode = getstruct( "helipath_to_ww2_littlebird_wingman_01", "targetname" ); sSpawnerTargetname = "littlebird_wingman_01"; level.littlebird_wingman_01 = level.littlebird_wingman_01 heli_teleport_to_newpath( sSpawnerTargetname, eNode ); level.littlebird_wingman_01 Vehicle_SetSpeed( 55 ); /*----------------------- AXIS DRONES NEAR WW2 -------------------------*/ axis_ww2_drones_01 = getentarray( "axis_ww2_drones_01", "targetname" ); axis_ww2_drones_02 = getentarray( "axis_ww2_drones_02", "targetname" ); axis_ww2_drones_03 = getentarray( "axis_ww2_drones_03", "targetname" ); axis_ww2_drones_04 = getentarray( "axis_ww2_drones_04", "targetname" ); thread drone_flood_start( axis_ww2_drones_01, "axis_ww2_drones_01" ); thread drone_flood_start( axis_ww2_drones_02, "axis_ww2_drones_02" ); thread drone_flood_start( axis_ww2_drones_03, "axis_ww2_drones_03" ); thread drone_flood_start( axis_ww2_drones_04, "axis_ww2_drones_04" ); /*----------------------- DELETE ALL AI -------------------------*/ waittillframeend; aAI = getaiarray(); assertex( level.littlebird_wingman_02.riders.size > 0, "the riders for level.littlebird_wingman_02 are not in level.littlebird_wingman_02.riders" ); excluders = level.littlebird_wingman_02.riders; array_thread( aAI,::AI_delete, excluders ); /*----------------------- SPAWN WW2 ENEMIES -------------------------*/ activate_trigger( "spawner_ww2_guys", "targetname", level.player ); spawn_trigger_dummy( "dummy_spawner_ww2_street_guys" ); //flood spawner of guys near cars /*----------------------- MORTARS/ARTY -------------------------*/ level.noMaxMortarDist = true; level.playerMortarFovOffset = ( 0, 40, 0 ); level._effect[ "mortar" ][ "dirt" ] = loadfx( "explosions/artilleryExp_dirt_brown_2" ); //swap out trenches mortar effect with bigger one delaythread( 3, maps\_mortar::bog_style_mortar_on, 2 ); //same trenches mortars, but with bigger explosions flag_wait( "player_heli_03a" ); newMissile = MagicBullet( "javelin_dcburn", javelin_source_org.origin, humvee_heliride_01.origin ); newMissile thread javelin_earthquake(); //custom function to ensure an earthquake on impact newMissile Missile_SetTargetEnt( humvee_heliride_01 ); newMissile Missile_SetFlightmodeTop(); //Code added this command so we could make the Javelin do an arc instead of a straight line sam_launch_ww2 = getstruct( "sam_launch_ww2", "targetname" ); delaythread( 1.5,::sam_launch, 8, sam_launch_ww2, level.littlebird_wingman_02 ); //flag_wait( "player_heli_04" ); /*----------------------- FLYING PAST MONUMENT -------------------------*/ flag_wait( "player_heli_05" ); level.blackhawk Vehicle_SetSpeed( 90 ); thread gopath( humvee_heliride_01 ); level.littlebird_wingman_01 Vehicle_SetSpeed( 100 ); level.littlebird_wingman_02 Vehicle_SetSpeed( 100 ); level.littlebird_wingman_armed Vehicle_SetSpeed( 150 ); /*----------------------- LITTLEBIRD SHOT DOWN -------------------------*/ javelin_littlebird_monument = getstruct( "javelin_littlebird_monument", "targetname" ); newMissile2 = MagicBullet( "javelin_dcburn", javelin_littlebird_monument.origin, level.littlebird_wingman_02.origin ); newMissile2 Missile_SetTargetEnt( level.littlebird_wingman_02 ); littlebird_monument_crash = getstruct( "littlebird_monument_crash", "targetname" ); level.littlebird_wingman_02 thread maps\dcburning_fx::littlebird_monument_crash( littlebird_monument_crash ); /*----------------------- STRAFING RUN PATH TO WW2 MEMORIAL -------------------------*/ eNode = getstruct( "helipath_to_ww2_strafing_littlebird_wingman_armed", "targetname" ); sSpawnerTargetname = "littlebird_wingman_armed"; level.littlebird_wingman_armed = level.littlebird_wingman_armed heli_teleport_to_newpath( sSpawnerTargetname, eNode ); level.littlebird_wingman_armed Vehicle_SetSpeed( 90 ); flag_wait( "player_heli_06" ); thread drone_flood_stop( "allied_drones_heliride_01" ); thread drone_flood_stop( "allied_drones_heliride_02" ); thread drone_flood_stop( "allied_drones_heliride_03" ); thread drone_flood_stop( "allied_drones_heliride_04" ); /*----------------------- WW2 MEMORIAL -------------------------*/ flag_wait( "player_heli_10" ); level.player.ignoreme = true; level.blackhawk Vehicle_SetSpeed( 25 ); activate_trigger( "spawner_ww2_guys_middle", "targetname", level.player ); level.littlebird_wingman_armed Vehicle_SetSpeed( 120 ); /*----------------------- PASSING THROUGH SMOKE -------------------------*/ flag_wait( "player_heli_10a" ); level.createRpgRepulsors = false; //don't allow AI to miss on the first shot like they do on the ground bmps_heli_ride_ww2_02 = spawn_vehicles_from_targetname_and_drive( "bmps_heli_ride_ww2_02" ); activate_trigger( "spawner_ww2_guys_end", "targetname", level.player ); flag_wait( "player_heli_10b" ); //level.player disableinvulnerability(); level.player.ignoreme = false; flag_wait( "player_heli_10c" ); array_thread( level.effects_trenches, ::pauseEffect ); /*----------------------- WW2 HELI LIFT OFF -------------------------*/ if ( isdefined( ww2_heli ) ) ww2_heli thread notify_delay( "liftoff", 3 ); /*----------------------- BTR80s -------------------------*/ flag_wait( "player_heli_14" ); //bmps_heli_ride_ww2_01 = spawn_vehicles_from_targetname_and_drive( "bmps_heli_ride_ww2_01" ); wait( .5 ); level.blackhawk Vehicle_SetSpeed( 50 ); //bmps_heli_ride_ww2_03 = spawn_vehicles_from_targetname_and_drive( "bmps_heli_ride_ww2_03" ); /*----------------------- WW2 MEMORIAL STREET - STOP FLOODSPAWNER AND AXIS DRONES -------------------------*/ crows_nest_bmps = get_vehicle_array( "crows_nest_bmps", "script_noteworthy" ); foreach( vehicle in crows_nest_bmps ) { if ( isdefined( vehicle ) ) { vehicle maps\_vehicle::godoff(); vehicle vehicle_delete(); } } flag_wait( "player_heli_15" ); level.blackhawk Vehicle_SetSpeed( 30 ); killspawner( 11 ); thread drone_flood_stop( "axis_ww2_drones_01" ); thread drone_flood_stop( "axis_ww2_drones_02" ); thread drone_flood_stop( "axis_ww2_drones_03" ); thread drone_flood_stop( "axis_ww2_drones_04" ); flag_wait( "player_heli_16" ); level.blackhawk Vehicle_SetSpeed( 20 ); } sam_launch( iNum, sourceEnt, destEnt ) { destEnt endon( "death" ); targetOffset = ( 0, 0, 250 ); targetOrg = spawn( "script_origin", destEnt.origin ); destEnt thread delete_on_death( targetOrg ); targetOrg.origin = destEnt.origin; targetOrg.angles = destEnt.angles; targetOrg linkTo( destEnt, "tag_origin", targetOffset, ( 0, 0, 0 ) ); targetOrg thread ent_cleanup( destEnt ); attractor = Missile_CreateAttractorEnt( targetOrg, 8000, 3000 ); while( iNum > 0 ) { magicBullet( "slamraam_missile_dcburning", sourceEnt.origin, destEnt.origin ); wait( .25 ); iNum--; } if( isdefined( targetOrg ) ) targetOrg delete(); } delete_squad() { array_thread( level.squad, ::AI_delete ); } team_leader_gets_on_blackhawk( triggerApproach ) { level.teamleader endon( "death" ); wait( 2 ); animEnt = spawn( "script_origin", level.blackhawk.origin ); animEnt.origin = level.blackhawk.origin; animEnt.angles = level.blackhawk.angles; //thread debug_message( "org", animEnt.origin, 9999, animEnt ); ent = spawnstruct(); ent.entity = animEnt; ent.up = -100; ent.right = -72; ent.forward = -50; ent.yaw = 180; ent translate_local(); animEnt linkto( level.blackhawk ); level.teamleader notify( "stop_teleport_hack" ); animEnt anim_generic_reach( level.teamleader, "leader_blackhawk_getin" ); level.teamleader setGoalPos( level.teamleader.origin ); level.teamleader.goalradius = 16; triggerApproach waittill( "trigger" ); animEnt anim_generic_reach( level.teamleader, "leader_blackhawk_getin" ); level.teamleader linkto( animEnt ); animEnt anim_generic( level.teamleader, "leader_blackhawk_getin" ); animEnt thread anim_generic_loop( level.teamleader, "leader_blackhawk_idle", "stop_idle" ); } AI_rooftop_helirider_think() { self endon( "death" ); self thread try_to_magic_bullet_shield(); self.neverEnableCQB = true; //self.fixednode = false; self.goalradius = 16; self.baseaccuracy = 1000; self.attackeraccuracy = 0; //makes any AI attacking him have shitty accuracy flag_wait( "blackhawk_landed" ); wait( 1 ); animEnt = spawn( "script_origin", level.blackhawk.origin ); animEnt.origin = level.blackhawk.origin; animEnt.angles = level.blackhawk.angles; //thread debug_message( "org", animEnt.origin, 9999, animEnt ); ent = spawnstruct(); ent.entity = animEnt; ent.up = -100; ent.right = 78; ent.forward = 21; //ent.yaw = 180; ent translate_local(); animEnt linkto( level.blackhawk ); animEnt anim_generic_reach( self, "redshirt_blackhawk_getin" ); self linkto( animEnt ); animEnt anim_generic( self, "redshirt_blackhawk_getin" ); animEnt thread anim_generic_loop( self, "redshirt_blackhawk_idle", "stop_idle" ); } player_lerped_onto_minigun( nolerp ) { level.player allowcrouch( false ); level.player allowprone( false ); level.player allowsprint( false ); level.player allowjump( false ); level.blackhawk maps\_blackhawk_minigun::player_mount_blackhawk_gun( nolerp ); level.onHeli = true; //setsaveddvar( "sm_sunSampleSizeNear", 1 );// air //setsaveddvar( "sm_sunShadowScale", 0.5 );// optimized for air } try_to_teleport_friendlies_to_roof( eNode ) { assert( isdefined( eNode ) ); //in case key friendlies got left behind level endon( "player_getting_on_minigun" ); self endon( "death" ); self endon( "stop_teleport_hack" ); fDistSquared = 300 * 300; while( isdefined( self ) ) { wait( .1 ); if ( distancesquared( level.player.origin, self.origin ) < fDistSquared ) continue; playerEye = level.player getEye(); if ( within_fov( playerEye, level.player.angles, self.origin + ( 0, 0, 32 ), level.cosine[ "90" ] ) ) continue; else break; } self forceTeleport( eNode.origin, eNode.angles ); self notify( "end_melee" ); self disable_ai_color(); self setgoalnode( eNode ); } player_blackhawk_setup( heliNode ) { level.blackhawk = spawn_vehicle_from_targetname_and_drive( "heli_player" ); level.blackhawk thread player_blackhawk_think(); if ( isdefined( heliNode ) ) { level.blackhawk Vehicle_Teleport( heliNode.origin, heliNode.angles ); level.blackhawk thread vehicle_paths( heliNode ); ////level.player.origin = level.blackhawk.origin; level.blackhawk useby( level.player ); level.blackhawk player_blackhawk_default_params(); //level.blackhawk maps\_blackhawk_minigun::player_mount_blackhawk_gun(); } } player_blackhawk_default_params() { level.blackhawk cleargoalyaw(); level.blackhawk Vehicle_SetSpeed( 30 ); level.blackhawk sethoverparams( 32, 10, 3 ); level.blackhawk setmaxpitchroll( 5, 10 ); } vehicle_ww2_enemy_helis_think() { //Called from spawn_func self endon( "death" ); /*----------------------- HELI SETUP -------------------------*/ //move closest crash location to the heli's origin so it doesn't clip into the ground aCrashLocations = maps\_vehicle::get_unused_crash_locations(); eCrashLoc = getClosest( self.origin, aCrashLocations ); eCrashLoc.origin = self.origin; self.perferred_crash_location = eCrashLoc; /*----------------------- HELI LIFTOFF -------------------------*/ self waittill( "liftoff" ); self thread ground_heli_kill_player(); ePath = getstruct( self.script_Linkto, "script_linkname" ); dist = distance( self.origin, ePath.origin ); self Vehicle_SetSpeed( 10 ); self vehicle_liftoff( dist ); self Vehicle_SetSpeed( 50 ); self thread vehicle_paths( ePath ); } ground_heli_kill_player() { self endon( "death" ); level.player endon( "death" ); self ent_flag_init( "stop_firing" ); while ( ( isalive( self ) ) && ( !ent_flag( "stop_firing" ) ) ) { wait( .5 ); self SetLookAtEnt( level.player ); if ( !within_fov( self.origin, self.angles, level.player.origin + ( 0, 0, 32 ), level.cosine[ "35" ] ) ) { self notify( "stop_firing_turret" ); continue; } self thread vehicle_heli_fire_turret( level.player ); } self notify( "stop_firing_turret" ); self clearLookAtEnt(); } heli_at4_sequence() { flag_wait( "player_getting_on_minigun" ); spawner = getent( "roof_rocket_guy", "targetname" ); roof_rocket_guy = spawner spawn_ai( true ); roof_rocket_guy thread AI_ignored_and_oblivious_on(); roof_rocket_guy thread try_to_magic_bullet_shield(); reference = spawner; reference anim_generic_first_frame( roof_rocket_guy, roof_rocket_guy.animation ); roof_rocket_guy attach( "weapon_stinger", "TAG_INHAND" ); reference thread anim_generic( roof_rocket_guy, roof_rocket_guy.animation ); roof_rocket_guy setAnimTime( level.scr_anim[ "generic" ][ roof_rocket_guy.animation ], .6 ); heli_roof = spawn_vehicle_from_targetname_and_drive ( "heli_roof" ); heli_roof thread heli_roof_think(); heli_roof SetLookAtEnt( level.player ); org = spawn( "script_origin", heli_roof.origin + ( 0, 0, -20 ) ); org linkto( heli_roof ); org thread ent_cleanup( heli_roof ); attractor = Missile_CreateAttractorEnt( org, 2000, 10000, roof_rocket_guy ); roof_rocket_guy waittillmatch( "single anim", "fire" ); earthquake( .3, .5, level.player.origin, 1600 ); org_hand = roof_rocket_guy gettagorigin( "TAG_INHAND" ); magicbullet( "stinger", org_hand, org.origin ); flag_set( "roof_heli_about_to_be_owned" ); heli_roof thread heli_roof_death_failsafe(); roof_rocket_guy waittillmatch( "single anim", "end" ); org_hand = roof_rocket_guy gettagorigin( "TAG_INHAND" ); angles_hand = roof_rocket_guy gettagangles( "TAG_INHAND" ); roof_rocket_guy detach( "weapon_stinger", "TAG_INHAND" ); model_at4 = spawn( "script_model", org_hand ); model_at4 setmodel( "weapon_stinger" ); roof_rocket_guy thread delete_on_death( model_at4 ); model_at4.angles = angles_hand; //reference thread anim_generic_loop( roof_rocket_guy, "AT4_idle", "stop_idle" ); eNode = getnode( "at4_guy_retreat", "targetname" ); roof_rocket_guy setgoalnode( eNode ); roof_rocket_guy thread stop_magic_bullet_shield(); roof_rocket_guy thread AI_ignored_and_oblivious_off(); roof_rocket_guy.health = 1; } heli_roof_think() { self.immuneToBlackhawk = true; self waittill( "death" ); flag_set( "roof_heli_owned" ); earthquake( 0.6, 1.2, level.player.origin, 1600 ); level.player PlayRumbleOnEntity( "damage_heavy" ); } heli_roof_death_failsafe() { self endon( "death" ); wait( 1.8 ); self notify( "damage", 5000, level.player, undefined, undefined, "MOD_PROJECTILE" ); } player_blackhawk_think() { flag_set( "player_heli_spawned" ); self maps\_vehicle::godon(); } littlebird_wingman_02_think() { flag_wait( "player_approaching_outer_balcony" ); /*----------------------- SPAWN LITTLEBIRD AND RIDERS TO NODES -------------------------*/ aRoof_riders_left = array_spawn( getentarray( "littlebird_roof_riders_left", "targetname" ) ); array_thread( aRoof_riders_left,::AI_ignored_and_oblivious_on ); array_thread( aRoof_riders_left,::magic_bullet_shield ); aRoof_riders_right = array_spawn( getentarray( "littlebird_roof_riders_right", "targetname" ) ); array_thread( aRoof_riders_right,::AI_ignored_and_oblivious_on ); array_thread( aRoof_riders_right,::magic_bullet_shield ); level.littlebird_wingman_02 = spawn_vehicle_from_targetname( "littlebird_wingman_02" ); level.littlebird_wingman_02 thread gopath(); // you'll send this node off to some commands to get the nodes contained in the stage prefab pickup_node_before_stage = getstruct( "pickup_node_before_stage", "script_noteworthy" ); level.littlebird_wingman_02 set_stage( pickup_node_before_stage, aRoof_riders_left, "left" ); level.littlebird_wingman_02 set_stage( pickup_node_before_stage, aRoof_riders_right, "right" ); /*----------------------- LITTLEBIRD LANDS BEFORE PLAYER GETS THERE -------------------------*/ //touch_down happens when the vehicle paths into the vehicle node contained in the prefabs/script_gags/littlebird_stage_load.map prefab level.littlebird_wingman_02 waittill( "touch_down" ); /*----------------------- MAKE LEFT RIDERS GET ON BEFORE PLAYER GETS THERE -------------------------*/ level.littlebird_wingman_02 thread load_side( "left", aRoof_riders_left ); level.littlebird_wingman_02 thread load_side( "right", aRoof_riders_right ); /*----------------------- SETUP HELI AND HAVE IT CIRCLE PLAYER BLACKHAWK -------------------------*/ flag_wait( "player_approach_commerce_roof_01" ); level.littlebird_wingman_01 = spawn_vehicle_from_targetname( "littlebird_wingman_01" ); level.littlebird_wingman_01 thread vehicle_ai_event( "idle_alert_to_casual" ); thread gopath( level.littlebird_wingman_01 ); /*----------------------- MAKE RIGHT RIDERS GET ON WHEN PLAYER ARRIVES -------------------------*/ while ( level.littlebird_wingman_02.riders.size < 6 ) wait( .1 ); thread flag_set( "roof_littlebird_lifted_off" ); /*----------------------- LITTLEBIRD TAKES OFF AND CIRCLES -------------------------*/ //wait( .5 ); //level.littlebird_wingman_02 vehicle_ai_event( "idle_alert" ); level.littlebird_wingman_02 thread vehicle_liftoff( 3 ); //level.littlebird_wingman_02 vehicle_ai_event( "idle_alert_to_casual" ); heli_roof_loop_01 = getstruct( "heli_roof_loop_01", "targetname" ); wait( 1 ); level.littlebird_wingman_02 thread vehicle_paths( heli_roof_loop_01 ); level.littlebird_wingman_02 setmaxpitchroll( 20, 50 ); wait( 2 ); level.littlebird_wingman_02 vehicle_ai_event( "idle_alert_to_casual" ); level.littlebird_wingman_02 Vehicle_SetSpeed( 25 ); } littlebird_wingman_armed_think() { flag_wait( "player_approach_commerce_roof_02" ); level.littlebird_wingman_armed = spawn_vehicle_from_targetname_and_drive( "littlebird_wingman_armed" ); level.littlebird_wingman_armed Vehicle_SetSpeed( 25 ); //littlebird_wingman_armed thread maps\_attack_heli::heli_spotlight_on(); //littlebird_wingman_armed thread maps\_attack_heli::heli_spotlight_random_targets_on(); wingman_roof_node_01 = getstruct( "wingman_roof_node_01", "script_noteworthy" ); wingman_roof_node_01 waittill( "trigger" ); //littlebird_wingman_armed SetLookAtEnt( level.blackhawk ); roof_target_for_helis = getent( "roof_target_for_helis", "targetname" ); level.littlebird_wingman_armed SetLookAtEnt( roof_target_for_helis ); level.littlebird_wingman_armed Vehicle_SetSpeed( 10 ); /*----------------------- SWITCH PATH WHEN PLAYER GETS ON BLACKHAWK -------------------------*/ waittillframeend; foreach ( turret in level.littlebird_wingman_armed.mgturret ) { turret SetMode( "auto_nonai" ); //turret StartFiring(); } flag_wait( "player_getting_on_minigun" ); //littlebird_wingman_armed mgoff(); foreach ( turret in level.littlebird_wingman_armed.mgturret ) { turret SetMode( "manual" ); turret StopFiring(); } } /**************************************************************************** HELI RIDE 2 ****************************************************************************/ AA_heli_ride2() { thread AAA_sequence_heli_ride2(); thread dialogue_heli_ride2(); flag_wait( "player_crash_starting" ); thread maps\dc_crashsite::AA_crash_site_init(); flag_wait( "player_crash_done" ); level.player setViewmodel( "viewhands_us_army_dmg" ); } dialogue_heli_ride2() { //flag_wait( "player_heli_18" ); //Little Bird Pilot 1 Overlord, this is Dagger Two-One. We've taken some of the heat off the evac site - //radio_dialogue( "dcburn_lbp1_takenheatoff" ); flag_wait( "player_heli_18a" ); //Black Hawk Pilot Incoming! Incoming! radio_dialogue_overlap( "dcburn_bhp_incoming" ); //flag_wait( "littlebird_wingman_02_crash_start" ); //Little Bird Pilot 1 Dagger Two, SAM launch! Break left break left!!! //radio_dialogue( "dcburn_lbp1_breakleftbreakleft" ); flag_wait( "player_heli_18d" ); //Sgt. Foley Overlord, we're hit, but still in the air. We've got a massive SAM battery dead ahead...we're going in!! radio_dialogue( "dcburn_mcy_stillintheair" ); flag_wait( "player_heli_19" ); //Black Hawk Pilot RPG teams! 12 o'clock!!! //radio_dialogue( "dcburn_bhp_rpgteams" ); //Black Hawk Pilot We're losing attitude control…!!! radio_dialogue( "dcburn_bhp_attitudecontrol" ); //Ranger 2 32 2 We're bleeding hydraulic fluid, I'm losin' the tail rotor! //radio_dialogue( "dcburn_ar2_hydraulicfluid" ); //Sgt. Foley Take us up!!! If we're goin' down we're taking those SAM sites with us!!! radio_dialogue( "dcburn_mcy_takeusup" ); flag_wait( "player_heli_20" ); //Black Hawk Pilot Multiple fire teams spotted! struggling with the controls, keeping it aloft, still flying helicopter radio //radio_dialogue( "dcburn_bhp_fireteams" ); //Little Bird Pilot 1 Overlord, Dagger Two-two and Two-three are down. I repeat, Dagger Two-Two and Two-Three are down, over. //radio_dialogue( "dcburn_lbp1_22and23aredown" ); //Little Bird Pilot 1 Foot mobiles...take em out. //radio_dialogue( "dcburn_lbp1_footmobiles" ); //Black Hawk Pilot RPG teams in sight...I want you to pull that trigger till they don't get up. //radio_dialogue( "dcburn_bhp_dontgetup" ); //Little Bird Pilot 1 SAM launch! Hang on!! radio_dialogue( "dcburn_lbp1_samlaunch" ); flag_wait( "player_crash_starting" ); wait ( .3 ); //Little Bird Pilot 1 We're hit! Mayday mayday, this is Dagger Two-One, we are going down at grid square Papa Bravo, 2 niner 2, 1 7 8. I repeat, we are going down. soundOrg = spawn_tag_origin(); soundOrg linkTo( level.player ); soundOrg thread play_sound_on_tag_endon_death( "dcburn_lbp1_maydaymayday", "tag_origin" ); flag_wait( "player_heli_crash" ); soundOrg notify( "death" ); soundOrg delete(); //Little Bird Pilot 1 Brace for impact! //radio_dialogue( "dcburn_lbp1_braceforimpact" ); } AAA_sequence_heli_ride2() { flag_wait( "player_heli_18" ); thread autosave_now(); //level.player enableinvulnerability(); level.blackhawk Vehicle_SetSpeed( 70 ); if ( isdefined( level.littlebird_wingman_armed ) ) level.littlebird_wingman_armed vehicle_delete(); if ( isdefined( level.littlebird_wingman_01 ) ) level.littlebird_wingman_01 vehicle_delete(); if ( isdefined( level.littlebird_wingman_02 ) ) level.littlebird_wingman_02 vehicle_delete(); /*----------------------- CLEANUP AI -------------------------*/ vehicles_to_delete = getentarray( "vehicles_crowsnest_defend", "targetname" ); foreach( vehicle in vehicles_to_delete ) { if ( isdefined( vehicle ) ) { vehicle delete(); } } /*----------------------- LITTLEBIRD CRASH SETUP -------------------------*/ littlebird_wingman_02_drone_crash = spawn_vehicle_from_targetname_and_drive( "littlebird_wingman_02_drone_crash" ); littlebird_wingman_02_drone_crash Vehicle_SetSpeed( 70 ); //littlebird_wingman_02_drone_crash SetAcceleration( 100 ); targetOffset = ( 0, 0, 250 ); targetOrg = spawn( "script_origin", littlebird_wingman_02_drone_crash.origin ); targetOrg.origin = littlebird_wingman_02_drone_crash.origin; targetOrg.angles = littlebird_wingman_02_drone_crash.angles; targetOrg linkTo( littlebird_wingman_02_drone_crash, "tag_origin", targetOffset, ( 0, 0, 0 ) ); targetOrg thread ent_cleanup( littlebird_wingman_02_drone_crash ); attractor = Missile_CreateAttractorEnt( targetOrg, 8000, 3000 ); /*----------------------- LITTLEBIRD CRASHES -------------------------*/ missile_org_lincoln = getent( "missile_org_lincoln", "targetname" ); //flag_wait( "littlebird_wingman_02_crash_start" ); //LerpViewAngleClamp(