#include maps\mp\_utility; #include common_scripts\utility; #include maps\mp\gametypes\_hud_util; init() { level.ospreySettings = []; if ( level.script == "mp_character_room" ) return; level.ospreySettings[ "escort_airdrop" ] = SpawnStruct(); level.ospreySettings[ "escort_airdrop" ].vehicle = "osprey_mp"; level.ospreySettings[ "escort_airdrop" ].modelBase = "vehicle_v22_osprey_body_mp"; level.ospreySettings[ "escort_airdrop" ].modelBlades = "vehicle_v22_osprey_blades_mp"; level.ospreySettings[ "escort_airdrop" ].tagHatchL = "tag_le_door_attach"; level.ospreySettings[ "escort_airdrop" ].tagHatchR = "tag_ri_door_attach"; level.ospreySettings[ "escort_airdrop" ].tagDropCrates = "tag_turret_attach"; level.ospreySettings[ "escort_airdrop" ].prompt = &"KILLSTREAKS_DEFEND_AIRDROP_PACKAGES"; level.ospreySettings[ "escort_airdrop" ].name = &"KILLSTREAKS_ESCORT_AIRDROP"; level.ospreySettings[ "escort_airdrop" ].weaponInfo = "osprey_minigun_mp"; level.ospreySettings[ "escort_airdrop" ].heliType = "osprey"; level.ospreySettings[ "escort_airdrop" ].dropType = "airdrop_escort"; level.ospreySettings[ "escort_airdrop" ].maxHealth = level.heli_maxhealth * 2; level.ospreySettings[ "escort_airdrop" ].timeOut = 60.0; level.ospreySettings[ "osprey_gunner" ] = SpawnStruct(); level.ospreySettings[ "osprey_gunner" ].vehicle = "osprey_player_mp"; level.ospreySettings[ "osprey_gunner" ].modelBase = "vehicle_v22_osprey_body_mp"; level.ospreySettings[ "osprey_gunner" ].modelBlades = "vehicle_v22_osprey_blades_mp"; level.ospreySettings[ "osprey_gunner" ].tagHatchL = "tag_le_door_attach"; level.ospreySettings[ "osprey_gunner" ].tagHatchR = "tag_ri_door_attach"; level.ospreySettings[ "osprey_gunner" ].tagDropCrates = "tag_turret_attach"; level.ospreySettings[ "osprey_gunner" ].prompt = &"KILLSTREAKS_DEFEND_AIRDROP_PACKAGES"; level.ospreySettings[ "osprey_gunner" ].name = &"KILLSTREAKS_OSPREY_GUNNER"; level.ospreySettings[ "osprey_gunner" ].weaponInfo = "osprey_player_minigun_mp"; level.ospreySettings[ "osprey_gunner" ].heliType = "osprey_gunner"; level.ospreySettings[ "osprey_gunner" ].dropType = "airdrop_osprey_gunner"; level.ospreySettings[ "osprey_gunner" ].maxHealth = level.heli_maxhealth * 2; level.ospreySettings[ "osprey_gunner" ].timeOut = 75.0; foreach ( ospreyInfo in level.ospreySettings ) { level.chopper_fx["explode"]["death"][ ospreyInfo.modelBase ] = LoadFX( "fx/explosions/helicopter_explosion_osprey" ); level.chopper_fx["explode"]["air_death"][ ospreyInfo.modelBase ] = LoadFX( "fx/explosions/helicopter_explosion_osprey_air_mp" ); level.chopper_fx["anim"]["blades_anim_up"][ ospreyInfo.modelBase ] = LoadFX( "fx/props/osprey_blades_anim_up" ); level.chopper_fx["anim"]["blades_anim_down"][ ospreyInfo.modelBase ] = LoadFX( "fx/props/osprey_blades_anim_down" ); level.chopper_fx["anim"]["blades_static_up"][ ospreyInfo.modelBase ] = LoadFX( "fx/props/osprey_blades_up" ); level.chopper_fx["anim"]["blades_static_down"][ ospreyInfo.modelBase ] = LoadFX( "fx/props/osprey_blades_default" ); level.chopper_fx["anim"]["hatch_left_static_up"][ ospreyInfo.modelBase ] = LoadFX( "fx/props/osprey_bottom_door_left_default" ); level.chopper_fx["anim"]["hatch_left_anim_down"][ ospreyInfo.modelBase ] = LoadFX( "fx/props/osprey_bottom_door_left_anim_open" ); level.chopper_fx["anim"]["hatch_left_static_down"][ ospreyInfo.modelBase ] = LoadFX( "fx/props/osprey_bottom_door_left_up" ); level.chopper_fx["anim"]["hatch_left_anim_up"][ ospreyInfo.modelBase ] = LoadFX( "fx/props/osprey_bottom_door_left_anim_close" ); level.chopper_fx["anim"]["hatch_right_static_up"][ ospreyInfo.modelBase ] = LoadFX( "fx/props/osprey_bottom_door_right_default" ); level.chopper_fx["anim"]["hatch_right_anim_down"][ ospreyInfo.modelBase ] = LoadFX( "fx/props/osprey_bottom_door_right_anim_open" ); level.chopper_fx["anim"]["hatch_right_static_down"][ ospreyInfo.modelBase ] = LoadFX( "fx/props/osprey_bottom_door_right_up" ); level.chopper_fx["anim"]["hatch_right_anim_up"][ ospreyInfo.modelBase ] = LoadFX( "fx/props/osprey_bottom_door_right_anim_close" ); } //maps\mp\killstreaks\_helicopter::makeHeliType( "osprey", "fx/explosions/helicopter_explosion_cobra_low", ::defaultLightFX ); //maps\mp\killstreaks\_helicopter::addAirExplosion( "osprey", "fx/explosions/aerial_explosion_cobra_low_mp" ); //level.chopper_fx["smoke"]["signal_smoke_30sec"] = LoadFX( "fx/smoke/signal_smoke_airdrop_30sec" ); level.air_support_locs = []; level.killStreakFuncs["escort_airdrop"] = ::tryUseEscortAirdrop; level.killStreakFuncs["osprey_gunner"] = ::tryUseOspreyGunner; /# SetDevDvarIfUninitialized( "scr_ospreygunner_timeout", level.ospreySettings[ "osprey_gunner" ].timeOut ); #/ } tryUseEscortAirdrop( lifeId, streakName ) { numIncomingVehicles = 1; if ( IsDefined( level.chopper ) ) { self iPrintLnBold( &"KILLSTREAKS_AIR_SPACE_TOO_CROWDED" ); return false; } if( currentActiveVehicleCount() >= maxVehiclesAllowed() || level.fauxVehicleCount + numIncomingVehicles >= maxVehiclesAllowed() ) { self iPrintLnBold( &"KILLSTREAKS_TOO_MANY_VEHICLES" ); return false; } /# heightEnt = GetEnt( "airstrikeheight", "targetname" ); assertEx( IsDefined( heightEnt ), "NO HEIGHT ENT IN LEVEL: Don't know what this means, ask Ned or Jordan" ); if ( !IsDefined(heightEnt) ) return false; #/ if ( self isKillStreakDenied() ) { return false; } // increment the faux vehicle count before we spawn the vehicle so no other vehicles try to spawn incrementFauxVehicleCount(); /# // let bots use the full functionality of the killstreak usage if( IsDefined( self.pers[ "isBot" ] ) && self.pers[ "isBot" ] ) return true; #/ // select location result = self maps\mp\killstreaks\_airdrop::beginAirdropViaMarker( lifeId, "escort_airdrop" ); if ( !IsDefined( result ) || !result ) { self notify( "markerDetermined" ); // decrement the faux vehicle count since this failed to spawn decrementFauxVehicleCount(); return false; } // self maps\mp\_matchdata::logKillstreakEvent( "escort_airdrop", self.origin ); return true; } tryUseOspreyGunner( lifeId, streakName ) { numIncomingVehicles = 1; if ( IsDefined( level.chopper ) ) { self iPrintLnBold( &"KILLSTREAKS_AIR_SPACE_TOO_CROWDED" ); return false; } if( currentActiveVehicleCount() >= maxVehiclesAllowed() || level.fauxVehicleCount + numIncomingVehicles >= maxVehiclesAllowed() ) { self iPrintLnBold( &"KILLSTREAKS_TOO_MANY_VEHICLES" ); return false; } /# heightEnt = GetEnt( "airstrikeheight", "targetname" ); assertEx( IsDefined( heightEnt ), "NO HEIGHT ENT IN LEVEL: Don't know what this means, ask Ned or Jordan" ); if ( !IsDefined(heightEnt) ) return false; #/ // increment the faux vehicle count before we spawn the vehicle so no other vehicles try to spawn incrementFauxVehicleCount(); // select location result = self selectDropLocation( lifeId, "osprey_gunner", "compass_objpoint_osprey_friendly", "compass_objpoint_osprey_enemy", &"KILLSTREAKS_SELECT_MOBILE_MORTAR_LOCATION" ); if ( !IsDefined( result ) || !result ) { // decrement the faux vehicle count since this failed to spawn decrementFauxVehicleCount(); return false; } self maps\mp\_matchdata::logKillstreakEvent( "osprey_gunner", self.origin ); return true; } finishSupportEscortUsage( lifeId, location, directionYaw, ospreyType ) { self notify( "used" ); direction = ( 0, directionYaw, 0 ); planeHalfDistance = 12000; heightEnt = GetEnt( "airstrikeheight", "targetname" ); flyHeight = heightEnt.origin[2]; startNode = level.heli_start_nodes[ randomInt( level.heli_start_nodes.size ) ]; pathStart = startNode.origin; //pathStart = location + ( AnglesToForward( direction ) * ( -1 * planeHalfDistance ) ); //pathStart += (0,0,flyHeight); pathGoal = (location[0], location[1], flyHeight); //pathGoal = location + (0,0,flyHeight); pathEnd = location + ( AnglesToForward( direction ) * planeHalfDistance ); forward = vectorToAngles( pathGoal - pathStart ); guardPosition = location; location = (location[0], location[1], flyHeight); airShip = createAirship( self, lifeId, pathStart, forward, location, ospreyType ); pathStart = startNode; self useSupportEscortAirdrop( lifeId, airShip, pathStart, pathGoal, pathEnd, flyHeight, guardPosition ); } finishOspreyGunnerUsage( lifeId, location, directionYaw, ospreyType ) { self notify( "used" ); direction = ( 0, directionYaw, 0 ); planeHalfDistance = 12000; heightEnt = GetEnt( "airstrikeheight", "targetname" ); flyHeight = heightEnt.origin[2]; startNode = level.heli_start_nodes[ randomInt( level.heli_start_nodes.size ) ]; pathStart = startNode.origin; //pathStart = location + ( AnglesToForward( direction ) * ( -1 * planeHalfDistance ) ); //pathStart += (0,0,flyHeight); pathGoal = (location[0], location[1], flyHeight); //pathGoal = location + (0,0,flyHeight); pathEnd = location + ( AnglesToForward( direction ) * planeHalfDistance ); forward = vectorToAngles( pathGoal - pathStart ); location = (location[0], location[1], flyHeight); airShip = createAirship( self, lifeId, pathStart, forward, location, ospreyType ); pathStart = startNode; self useOspreyGunner( lifeId, airShip, pathStart, pathGoal, pathEnd, flyHeight ); } stopSelectionWatcher() { self waittill( "stop_location_selection", reason ); switch( reason ) { case "cancel_location": case "death": case "disconnect": case "emp": case "weapon_change": self notify ( "customCancelLocation" ); break; } } selectDropLocation( lifeId, ospreyType, icon_friendly, icon_enemy, instruction_text ) { self endon( "customCancelLocation" ); locIndex = undefined; targetSize = level.mapSize / 6.46875; // 138 in 720 if ( level.splitscreen ) targetSize *= 1.5; self _beginLocationSelection( ospreyType, "map_artillery_selector", false, 500 ); self thread stopSelectionWatcher(); self waittill( "confirm_location", location, directionYaw ); self stopLocationSelection( false ); // init rideable killstreak self setUsingRemote( ospreyType ); result = self maps\mp\killstreaks\_killstreaks::initRideKillstreak( ospreyType ); if ( result != "success" ) { if ( result != "disconnect" ) self clearUsingRemote(); return false; } if( IsDefined( level.chopper ) ) { self clearUsingRemote(); self iPrintLnBold( &"KILLSTREAKS_AIR_SPACE_TOO_CROWDED" ); return false; } else if( currentActiveVehicleCount() >= maxVehiclesAllowed() || level.fauxVehicleCount >= maxVehiclesAllowed() ) { self clearUsingRemote(); self iPrintLnBold( &"KILLSTREAKS_TOO_MANY_VEHICLES" ); return false; } self thread finishOspreyGunnerUsage( lifeId, location, directionYaw, ospreyType ); return true; } showIcons( icon_friendly, icon_enemy, instruction_text, num_icons ) { msg = self maps\mp\gametypes\_hud_util::createFontString( "bigfixed", 0.5 ); msg maps\mp\gametypes\_hud_util::setPoint( "CENTER", "CENTER", 0 , -150 ); msg setText( instruction_text ); self.locationObjectives = []; for ( i=0; i bestHeight ) { bestHeight = trace["position"][2]; /# //self thread drawLine( centerPoint, trace["position"], 120 ); #/ } } self.bestHeight = bestHeight + 300; switch( GetDvar( "mapname" ) ) { // DLC: special casing because it was clipping into trees case "mp_morningwood": self.bestHeight += 600; break; // DLC: special casing because the user can throw the canister off the edge or select a location off the edge case "mp_overwatch": spawns = level.spawnPoints; lowestSpawn = spawns[0]; highestSpawn = spawns[0]; foreach( spawn in spawns ) { if ( spawn.origin[2] < lowestSpawn.origin[2] ) lowestSpawn = spawn; if ( spawn.origin[2] > highestSpawn.origin[2] ) highestSpawn = spawn; } // make sure the bestHeight isn't below the lowestSpawn, we're subtracting 100 just to make sure we don't get a false positive if( bestHeight < lowestSpawn.origin[2] - 100 ) { self.bestHeight = highestSpawn.origin[2] + 900; } break; } /# //self thread drawLine( centerPoint, ( centerPoint[0], centerPoint[1], self.bestHeight ), 120 ); #/ } airshipFlyDefense( owner, pathStart, pathGoal, pathEnd, flyHeight, guardPosition ) { self notify( "airshipFlyDefense"); self endon( "airshipFlyDefense" ); self endon( "helicopter_removed" ); self endon( "death" ); self endon( "leaving" ); // go to where the user selected to drop the packages self thread getBestHeight( pathGoal ); // use the helicopter entrance to avoid collisions with things self maps\mp\killstreaks\_helicopter::heli_fly_simple_path( pathStart ); // store this for the rise and leave self.pathGoal = pathGoal; dropForward = self.angles; //self Vehicle_SetSpeedImmediate( 75, 50, 50 ); self SetYawSpeed( 30, 30, 30, .3 ); curOrg = self.origin; yaw = self.angles[1]; forward = self.angles[0]; //pathGoal += AnglesToForward( (0,yaw,0) )* 1.02; self.timeOut = level.ospreySettings[ self.ospreyType ].timeOut; self setVehGoalPos( pathGoal, 1 ); startTime = GetTime(); self waittill ( "goal" ); endTime = ( GetTime() - startTime ) * 0.001; self.timeOut -= endTime; // pitch props up self thread airShipPitchPropsUp(); dropPos = pathGoal * (1,1,0); dropPos += (0,0,self.bestHeight); self Vehicle_SetSpeed( 25, 10, 10 ); self SetYawSpeed( 20, 10, 10, .3 ); self setVehGoalPos( dropPos, 1 ); startTime = GetTime(); self waittill ( "goal" ); endTime = ( GetTime() - startTime ) * 0.001; self.timeOut -= endTime; self SetHoverParams( 65, 50, 50 ); self ospreyDropCratesLowImpulse( 1, level.ospreySettings[ self.ospreyType ].tagDropCrates, dropPos ); //thread move about and do stuff and things self thread killGuysNearCrates( guardPosition ); //// hang out if ( IsDefined( owner ) ) owner waittill_any_timeout( self.timeOut, "disconnect" ); self waittill( "leaving" ); self notify( "osprey_leaving" ); //// rise //self setVehGoalPos( pathGoal, 1 ); //self waittill ( "goal" ); // pitch props down self thread airShipPitchPropsDown(); //self Vehicle_SetSpeed( 80, 60 ); //self SetYawSpeed( 180, 180, 180, .3 ); // //// make sure it doesn't fly away backwards //endEnt = Spawn( "script_origin", pathEnd ); //if( IsDefined( endEnt ) ) //{ // self SetLookAtEnt( endEnt ); // endEnt thread wait_and_delete( 3.0 ); //} //self setVehGoalPos( (pathEnd + (0,0,1000)) * 4, 1 ); //wait( 6 ); // //self Vehicle_SetSpeed( 130, 60 ); // //wait( 10 ); //self delete(); } wait_and_delete( waitTime ) { self endon( "death" ); level endon( "game_ended" ); wait( waitTime ); self delete(); } killGuysNearCrates( guardPosition ) { self endon( "osprey_leaving" ); self endon ( "helicopter_removed" ); self endon ( "death" ); targetCenter = guardPosition; //targetCenter = GetGroundPosition( dropPos, 2, 20000, self.origin[2] ); /# //self thread drawLine( dropPos, targetCenter, 120 ); #/ for( ;; ) { foreach( player in level.players ) { wait ( 0.05); if( !IsDefined( self ) ) return; if ( !IsDefined( player ) ) continue; if ( !isReallyAlive(player) ) continue; if ( !self.owner isEnemy( player ) ) continue; if( player _hasPerk( "specialty_blindeye" ) ) continue; if ( DistanceSquared( targetCenter, player.origin ) > 500000 ) continue; self thread aiShootPlayer( player, targetCenter ); self waitForConfirmation(); } } } aiShootPlayer( targetPlayer, center ) { self notify( "aiShootPlayer" ); self endon( "aiShootPlayer" ); self endon ( "helicopter_removed" ); self endon ( "leaving" ); targetPlayer endon( "death" ); self SetTurretTargetEnt( targetPlayer ); self SetLookAtEnt( targetPlayer ); self thread targetDeathWaiter( targetPlayer ); numShots = 6; vollies = 2; for ( ;; ) { numShots--; self FireWeapon( "tag_flash", targetPlayer ); wait ( .15); if ( numShots <= 0 ) { vollies--; numShots = 6; if ( distanceSquared( targetPlayer.origin, center ) > 500000 || vollies <= 0 || !isReallyAlive(targetPlayer) ) { self notify ("abandon_target"); return; } wait (1); } } } targetDeathWaiter( targetPlayer ) { self endon ( "abandon_target" ); self endon ( "leaving" ); self endon ( "helicopter_removed" ); targetPlayer waittill( "death" ); self notify( "target_killed" ); } waitForConfirmation() { self endon ( "helicopter_removed" ); self endon ( "leaving" ); self endon ( "target_killed" ); self endon ( "abandon_target" ); for( ;; ) { wait 0.05; } } airshipFlyGunner( owner, pathStart, pathGoal, pathEnd, flyHeight ) { self notify( "airshipFlyGunner"); self endon( "airshipFlyGunner" ); self endon( "helicopter_removed" ); self endon( "death" ); self endon( "leaving" ); // go to where the user selected to drop the packages self thread getBestHeight( pathGoal ); // use the helicopter entrance to avoid collisions with things self maps\mp\killstreaks\_helicopter::heli_fly_simple_path( pathStart ); self thread maps\mp\killstreaks\_helicopter::heli_leave_on_timeout( level.ospreySettings[ self.ospreyType ].timeOut ); dropForward = self.angles; //self Vehicle_SetSpeedImmediate( 75, 50, 50 ); self SetYawSpeed( 30, 30, 30, .3 ); curOrg = self.origin; yaw = self.angles[1]; forward = self.angles[0]; //pathGoal += ( AnglesToForward( self.angles ) * 1000 ); /# //self thread drawLine( pathGoal, NewPathGoal, 120 ); #/ //leaveTime = 6.0; //self.timeOut = level.ospreySettings[ self.ospreyType ].timeOut - leaveTime; self.timeOut = level.ospreySettings[ self.ospreyType ].timeOut; self setVehGoalPos( pathGoal, 1 ); startTime = GetTime(); self waittill ( "goal" ); endTime = ( GetTime() - startTime ) * 0.001; self.timeOut -= endTime; // pitch props up self thread airShipPitchPropsUp(); dropPos = pathGoal * (1,1,0); dropPos += (0,0,self.bestHeight); self Vehicle_SetSpeed( 25, 10, 10 ); self SetYawSpeed( 20, 10, 10, .3 ); self setVehGoalPos( dropPos, 1 ); startTime = GetTime(); self waittill ( "goal" ); endTime = ( GetTime() - startTime ) * 0.001; self.timeOut -= endTime; //dropOrigin = self GetTagOrigin( "TAG_DOOR_REAR_ATTACH" ); self ospreyDropCrates( 1, level.ospreySettings[ self.ospreyType ].tagDropCrates, dropPos ); // hang out waitTime = 1.0; if ( IsDefined( owner ) ) owner waittill_any_timeout( waitTime, "disconnect" ); self.timeOut -= waitTime; // rise self setVehGoalPos( pathGoal, 1 ); startTime = GetTime(); self waittill ( "goal" ); endTime = ( GetTime() - startTime ) * 0.001; self.timeOut -= endTime; // circle or use attack areas attackAreas = getEntArray( "heli_attack_area", "targetname" ); loopNode = level.heli_loop_nodes[ randomInt( level.heli_loop_nodes.size ) ]; if ( attackAreas.size ) self thread maps\mp\killstreaks\_helicopter::heli_fly_well( attackAreas ); else self thread maps\mp\killstreaks\_helicopter::heli_fly_loop_path( loopNode ); //// move towards the center of the map and circle 2 times at 45 degree increments //cycles = ( 360 * 2 ) / 45; // //self SetYawSpeed( 30, 10, 10, .3 ); ////moveForward = AnglesToForward( self.angles ) * -1000; ////moveToPoint = self.origin + ( moveForward[0], moveForward[1], 0 ); //moveToPoint = ( level.mapCenter[0], level.mapCenter[1], self.origin[2] ); //self setVehGoalPos( moveToPoint, 1 ); //waitTime = 3.0; //wait( waitTime ); //self.timeOut -= waitTime; // //waitTime = self.timeOut / cycles; //self SetYawSpeed( 20, 10, 10, .3 ); //for( i = 0; i < cycles; i++ ) //{ // moveForward = AnglesToForward( self.angles ) * 1000; // moveRight = AnglesToRight( self.angles ) * 1000; // moveAngles = moveForward + moveRight; // moveToPoint = self.origin + ( moveAngles[0], moveAngles[1], 0 ); // self setVehGoalPos( moveToPoint, 0 ); // wait( waitTime ); //} self waittill( "leaving" ); // pitch props down and leave self thread airShipPitchPropsDown(); //self Vehicle_SetSpeed( 80, 60 ); //self SetYawSpeed( 180, 180, 180, .3 ); // //self setVehGoalPos( ( pathEnd + ( 0, 0, 1000 ) ) * 4, 0 ); //waitTime = leaveTime; //wait( waitTime ); //if ( IsDefined( owner ) ) //{ // owner TakeWeapon( "heli_remote_mp" ); // self notify( "helicopter_done" ); //} //self Vehicle_SetSpeed( 130, 60 ); // //wait( 10 ); //self delete(); } ospreyDropCratesLowImpulse( timeBetween, dropFromTag, dropPos ) { // pitch hatch down self thread airShipPitchHatchDown(); self waittill( "hatch_down" ); level notify( "escort_airdrop_started", self ); // drop first crate //pathStart = self GetTagOrigin( dropFromTag ) + ( AnglesToForward( self.angles ) * 100 ) + ( 0, 0, 50 ); //dropImpulse = AnglesToForward( self.angles ) * -200; //crateType[0] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( level.osprey_location, self.dropType, dropPos, false, undefined, pathStart, dropImpulse + (randomInt(10),randomInt(10),randomInt(10)) ); crateType[0] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( undefined, self.dropType, undefined, false, undefined, self.origin, (randomInt(10),randomInt(10),randomInt(10)), undefined, dropFromTag ); wait( 0.05 ); self notify( "drop_crate" ); // drop second create wait( timeBetween ); //pathStart = self GetTagOrigin( dropFromTag ) + ( AnglesToForward( self.angles ) * 100 ) + ( 0, 0, 50 ); //dropImpulse = AnglesToForward( self.angles ) * -200; //crateType[1] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( level.osprey_location, self.dropType, dropPos, false, undefined, pathStart, dropImpulse + (randomInt(20),randomInt(20),randomInt(20)), crateType ); crateType[1] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( undefined, self.dropType, undefined, false, undefined, self.origin, (RandomInt(100),randomInt(100),randomInt(100)), crateType, dropFromTag ); wait( 0.05 ); self notify( "drop_crate" ); // drop third crate wait( timeBetween ); //pathStart = self GetTagOrigin( dropFromTag ) + ( AnglesToForward( self.angles ) * 100 ) + ( 0, 0, 50 ); //dropImpulse = AnglesToForward( self.angles ) * -200; //crateType[2] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( level.osprey_location, self.dropType, dropPos, false, undefined, pathStart, dropImpulse + (randomInt(10),randomInt(10),randomInt(10)), crateType ); crateType[2] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( undefined, self.dropType, undefined, false, undefined, self.origin, (randomInt(50),randomInt(50),randomInt(50)), crateType, dropFromTag ); wait( 0.05 ); self notify( "drop_crate" ); // drop fourth create wait( timeBetween ); //pathStart = self GetTagOrigin( dropFromTag ) + ( AnglesToForward( self.angles ) * 100 ) + ( 0, 0, 50 ); //dropImpulse = AnglesToForward( self.angles ) * -200; //crateType[3] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( level.osprey_location, self.dropType, dropPos, false, undefined, pathStart, dropImpulse + (randomInt(20),randomInt(20),randomInt(20)), crateType ); crateType[3] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( undefined, self.dropType, undefined, false, undefined, self.origin, (RandomIntRange(-100, 0),RandomIntRange(-100, 0),RandomIntRange(-100, 0)), crateType, dropFromTag ); wait( 0.05 ); self notify( "drop_crate" ); // drop fifth create wait( timeBetween ); //pathStart = self GetTagOrigin( dropFromTag ) + ( AnglesToForward( self.angles ) * 100 ) + ( 0, 0, 50 ); //dropImpulse = AnglesToForward( self.angles ) * -200; //self thread maps\mp\killstreaks\_airdrop::dropTheCrate( level.osprey_location, self.dropType, dropPos, false, undefined, pathStart, dropImpulse + (randomInt(10),randomInt(10),randomInt(10)), crateType ); self thread maps\mp\killstreaks\_airdrop::dropTheCrate( undefined, self.dropType, undefined, false, undefined, self.origin, (RandomIntRange(-50, 0),RandomIntRange(-50, 0),RandomIntRange(-50, 0)), crateType, dropFromTag ); wait( 0.05 ); self notify( "drop_crate" ); // pitch hatch up wait( 1.0 ); self thread airShipPitchHatchUp(); } ospreyDropCrates( timeBetween, dropFromTag, dropPos ) { // pitch hatch down self thread airShipPitchHatchDown(); self waittill( "hatch_down" ); // drop first crate //pathStart = self GetTagOrigin( dropFromTag ) + ( AnglesToForward( self.angles ) * 100 ) + ( 0, 0, 50 ); //dropImpulse = AnglesToForward( self.angles ) * -200; //crateType[0] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( level.osprey_location, self.dropType, dropPos, false, undefined, pathStart, dropImpulse + (randomInt(10),randomInt(10),randomInt(10)) ); crateType[0] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( undefined, self.dropType, undefined, false, undefined, self.origin, (randomInt(10),randomInt(10),randomInt(10)), undefined, dropFromTag ); wait( 0.05 ); self.timeOut -= 0.05; self notify( "drop_crate" ); // drop second create wait( timeBetween ); self.timeOut -= timeBetween; //pathStart = self GetTagOrigin( dropFromTag ) + ( AnglesToForward( self.angles ) * 100 ) + ( 0, 0, 50 ); //dropImpulse = AnglesToForward( self.angles ) * -200; //crateType[1] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( level.osprey_location, self.dropType, dropPos, false, undefined, pathStart, dropImpulse + (randomInt(50),randomInt(50),randomInt(50)), crateType ); crateType[1] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( undefined, self.dropType, undefined, false, undefined, self.origin, (randomInt(100),randomInt(100),randomInt(100)), crateType, dropFromTag ); wait( 0.05 ); self.timeOut -= 0.05; self notify( "drop_crate" ); // drop third crate wait( timeBetween ); self.timeOut -= timeBetween; //pathStart = self GetTagOrigin( dropFromTag ) + ( AnglesToForward( self.angles ) * 100 ) + ( 0, 0, 50 ); //dropImpulse = AnglesToForward( self.angles ) * -200; //crateType[2] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( level.osprey_location, self.dropType, dropPos, false, undefined, pathStart, dropImpulse + (randomInt(25),randomInt(25),randomInt(25)), crateType ); crateType[2] = self thread maps\mp\killstreaks\_airdrop::dropTheCrate( undefined, self.dropType, undefined, false, undefined, self.origin, (randomInt(50),randomInt(50),randomInt(50)), crateType, dropFromTag ); wait( 0.05 ); self.timeOut -= 0.05; self notify( "drop_crate" ); // pitch hatch up wait( 1.0 ); self thread airShipPitchHatchUp(); } endRide( airShip ) { if ( IsDefined( self.escort_prompt ) ) self.escort_prompt destroyElem(); self RemoteCameraSoundscapeOff(); self ThermalVisionOff(); self ThermalVisionFOFOverlayOff(); self unlink(); self clearUsingRemote(); if ( getDvarInt( "camera_thirdPerson" ) ) self setThirdPersonDOF( true ); self VisionSetThermalForPlayer( game["thermal_vision"], 0 ); if ( IsDefined( airShip ) ) airShip VehicleTurretControlOff( self ); self notify ( "heliPlayer_removed" ); self SwitchToWeapon( self getLastWeapon() ); self TakeWeapon( "heli_remote_mp" ); } endRideOnAirshipDone( airShip ) { self endon ( "disconnect" ); airShip waittill ( "helicopter_done" ); self endRide( airShip ); }