1 #using scripts\shared\audio_shared;
2 #using scripts\shared\callbacks_shared;
3 #using scripts\shared\exploder_shared;
4 #using scripts\shared\filter_shared;
5 #using scripts\shared\footsteps_shared;
6 #using scripts\shared\system_shared;
7 #using scripts\shared\util_shared;
8 #using scripts\shared\vehicle_shared;
9 #using scripts\shared\vehicles\_driving_fx;
10 #using scripts\shared\abilities\gadgets\_gadget_vision_pulse;
12 #insert scripts\shared\shared.gsh;
14 #using scripts\shared\weapons\_sticky_grenade;
16 #using scripts\mp\killstreaks\_ai_tank;
17 #using scripts\mp\killstreaks\_airsupport;
18 #using scripts\mp\killstreaks\_helicopter;
19 #using scripts\mp\killstreaks\_qrdrone;
20 #using scripts\mp\killstreaks\_rcbomb;
21 #using scripts\shared\_burnplayer;
22 #using scripts\mp\_callbacks;
23 #using scripts\mp\_util;
24 #using scripts\mp\_vehicle;
26 #using scripts\mp\gametypes\_globallogic;
27 #using scripts\mp\gametypes\_globallogic_actor;
47 level.callbackPlayAIFootstep = &footsteps::playaifootstep;
48 level.callbackPlayLightLoopExploder = &exploder::playlightloopexploder;
57 /# println(
"*** Client script VM : Local client connect " + localClientNum ); #/
59 if ( isdefined( level.characterCustomizationSetup ) )
61 [[ level.characterCustomizationSetup ]]( localclientnum );
69 self endon(
"entityshutdown" );
70 self notify(
"playerspawned_callback" );
71 self endon(
"playerspawned_callback" );
73 player = GetLocalPlayer(localClientNum);
75 if ( isdefined( level.infraredVisionset ) )
77 player SetInfraredVisionset( level.infraredVisionset );
80 if ( isdefined( level._playerspawned_override ) )
82 self thread [[level._playerspawned_override]]( localClientNum );
86 /# PrintLn(
"Player spawned" ); #/
87 if (
self isLocalPlayer() )
95 self endon(
"entityshutdown" );
99 if( isdefined( level._clientFaceAnimOnPlayerSpawned ) )
101 self thread [[level._clientFaceAnimOnPlayerSpawned]](localClientNum);
105 if ( isdefined( level._entityspawned_override ) )
107 self thread [[level._entityspawned_override]]( localClientNum );
111 if ( !isdefined(
self.type ) )
113 /# println(
"Entity type undefined!" ); #/
117 if (
self.type ==
"missile" )
119 if( isdefined( level._custom_weapon_CB_Func ) )
121 self thread [[level._custom_weapon_CB_Func]]( localClientNum );
124 else if (
self.type ==
"vehicle" ||
self.type ==
"helicopter" ||
self.type ==
"plane" )
126 if( isdefined(level._customVehicleCBFunc) )
128 self thread [[level._customVehicleCBFunc]](localClientNum);
134 if (
self.type ==
"plane" ||
self.type ==
"helicopter" )
144 if(
self.type ==
"helicopter" )
151 if (
self.type ==
"actor" )
153 if( isdefined(level._customActorCBFunc) )
155 self thread [[level._customActorCBFunc]](localClientNum);
160 function airsupport( localClientNum, x, y, z, type, yaw, team, teamfaction, owner, exittype, time, height )
163 switch( teamFaction )
166 teamfaction =
"vietcong";
173 teamfaction =
"japanese";
176 teamfaction =
"marines";
179 teamfaction =
"specops";
182 teamfaction =
"russian";
185 /# println(
"Warning: Invalid team char provided, defaulted to marines" ); #/
186 /# println(
"Teamfaction received: " + teamFaction +
"\n" ); #/
187 teamfaction =
"marines";
203 /# println(
"Invalid team used with playclientAirstike/napalm: " + team +
"\n"); #/
208 data = spawnstruct();
214 direction = ( 0, yaw, 0 );
215 data.direction = direction;
216 data.flyHeight = height;
220 planeHalfDistance = 12000;
221 data.planeHalfDistance = planeHalfDistance;
222 data.startPoint = pos + VectorScale( anglestoforward( direction ), -1 * planeHalfDistance );
223 data.endPoint = pos + VectorScale( anglestoforward( direction ), planeHalfDistance );
224 data.planeModel =
"t5_veh_air_b52";
225 data.flyBySound =
"null";
226 data.washSound =
"veh_b52_flyby_wash";
227 data.apexTime = 6145;
229 data.flySpeed = 2000;
230 data.flyTime = ( ( planeHalfDistance * 2 ) / data.flySpeed );
231 planeType =
"airstrike";
234 else if ( type ==
"n" )
236 planeHalfDistance = 24000;
237 data.planeHalfDistance = planeHalfDistance;
238 data.startPoint = pos + VectorScale( anglestoforward( direction ), -1 * planeHalfDistance );
239 data.endPoint = pos + VectorScale( anglestoforward( direction ), planeHalfDistance );
241 data.flyBySound =
"null";
242 data.washSound =
"evt_us_napalm_wash";
243 data.apexTime = 2362;
244 data.exitType = exitType;
245 data.flySpeed = 7000;
246 data.flyTime = ( ( planeHalfDistance * 2 ) / data.flySpeed );
247 planeType =
"napalm";
254 println(
"Unhandled airsupport type, only A (airstrike) and N (napalm) supported" );
266 function callback_stunned( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
268 self.stunned = newVal;
270 /# PrintLn(
"stunned_callback"); #/
274 self notify(
"stunned");
278 self notify(
"not_stunned");
282 function callback_emp( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
286 /# PrintLn(
"emp_callback"); #/
294 self notify(
"not_emp");
298 function callback_proximity( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
300 self.enemyInProximity = newVal;