‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_challenges.gsc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\callbacks_shared;
4 #using scripts\shared\challenges_shared;
5 #using scripts\shared\drown;
6 #using scripts\shared\system_shared;
7 #using scripts\shared\util_shared;
8 #using scripts\shared\weapons\_weapon_utils;
9 
10 #using scripts\mp\gametypes\_loadout;
11 
12 #insert scripts\shared\shared.gsh;
13 
14 #using scripts\mp\_util;
15 #using scripts\mp\killstreaks\_counteruav;
16 #using scripts\mp\killstreaks\_emp;
17 #using scripts\mp\killstreaks\_killstreaks;
18 #using scripts\mp\killstreaks\_satellite;
19 #using scripts\mp\killstreaks\_uav;
20 
21 
22 
23 #insert scripts\mp\_bonuscard.gsh;
24 
25 #define KILL_NEAR_PLANT_ENGINEER_HARDWIRED_CLOSE_ENOUGH_DISTANCE 400
26 
27 #namespace challenges;
28 
29 ‪REGISTER_SYSTEM( "challenges", &‪__init__, undefined )
30 
31 function ‪__init__()
32 {
35  level.heroAbilityActivateNearDeath = &‪heroAbilityActivateNearDeath;
36  level.callbackEndHeroSpecialistEMP = &‪callbackEndHeroSpecialistEMP;
37  level.capturedObjectiveFunction = &‪capturedObjectiveFunction;
38 }
39 
41 {
42  if ( !isdefined( level.ChallengesCallbacks ) )
43  {
44  level.ChallengesCallbacks = [];
45  }
46 
47  waittillframeend;
48 
49  if ( isdefined ( level.scoreEventGameEndCallback ) )
50  {
51  ‪challenges::registerChallengesCallback( "gameEnd",level.scoreEventGameEndCallback );
52  }
53 
55  {
58  }
59 
61 }
62 
64 {
67  self thread ‪spawnWatcher();
68  self thread ‪monitorReloads();
69  self thread ‪monitorGrenadeFire();
70 }
71 
73 {
74  self.pers["bulletStreak"] = 0;
75  self.pers["lastBulletKillTime"] = 0;
76  self.pers["stickExplosiveKill"] = 0;
77  self.pers["carepackagesCalled"] = 0;
78  self.pers["challenge_destroyed_air"] = 0;
79  self.pers["challenge_destroyed_ground"] = 0;
80  self.pers["challenge_anteup_earn"] = 0;
81  self.pers["specialistStatAbilityUsage"] = 0;
82  self.pers["canSetSpecialistStat"] = self isSpecialistUnlocked();
83  self.pers["activeKillstreaks"] = [];
84 }
85 
87 {
88  if ( !isdefined(self.pers["challenge_heroweaponkills"]) )
89  {
90  // intentionally using "used" hero weapon on connect to determine frequency of specialist usage
91  // which is the sum of "specialist ability" usage and "specialist weapon" usage.
92  heroWeaponName = self GetLoadoutItemRef( 0, "heroWeapon" );
93  heroWeapon = GetWeapon( heroWeaponName );
94  if ( heroWeapon == level.weaponNone )
95  {
96  heroAbilityName = self GetHeroAbilityName();
97  heroWeapon = GetWeapon( heroAbilityName );
98  }
99  if ( heroWeapon != level.weaponNone )
100  {
101  self addweaponstat( heroWeapon, "used", 1 );
102  }
103 
104  self.pers["challenge_heroweaponkills"] = 0;
105  }
106 }
107 
108 function ‪spawnWatcher()
109 {
110  self endon( "disconnect" );
111 
112  self.pers["killNemesis"] = 0;
113  self.pers["killsFastMagExt"] = 0;
114  self.pers["longshotsPerLife"] = 0;
115  self.pers["specialistStatAbilityUsage"] = 0;
116  self.challenge_defenderkillcount = 0;
117  self.challenge_offenderkillcount = 0;
118  self.challenge_offenderProjectileMultiKillcount = 0;
119  self.challenge_offenderComlinkKillcount = 0;
120  self.challenge_offenderSentryTurretKillCount = 0;
121  self.challenge_objectiveDefensiveKillcount = 0;
122  self.challenge_objectiveOffensiveKillcount = 0;
123  self.challenge_scavengedCount = 0;
124  self.challenge_resuppliedNameKills = 0;
125  self.challenge_objectiveDefensive = undefined;
126  self.challenge_objectiveOffensive = undefined;
127  self.challenge_lastsurvivewithflakfrom = undefined;
128  self.explosiveInfo = [];
129 
130  for(;;)
131  {
132  self waittill("spawned_player");
133 
134  self.weaponKillsThisSpawn = [];
135  self.attachmentKillsThisSpawn = [];
136  self.challenge_hatchetTossCount = 0;
137  self.challenge_hatchetkills = 0;
138  self.retreivedBlades = 0;
139  self.challenge_combatRobotAttackClientID = [];
140 
141  self thread watchDoubleJump();
142  self thread ‪watchJump();
143  self thread ‪watchSwimming();
144  self thread ‪watchWallrun();
145  self thread ‪watchSlide();
146  self thread ‪watchSprint();
147  self thread ‪watchScavengeLethal();
149  self thread ‪watchWeaponChangeComplete();
150  }
151 }
152 
154 {
155  self endon( "death" );
156  self endon( "disconnect" );
157 
158  self.challenge_scavengedCount = 0;
159 
160  for(;;)
161  {
162  self waittill( "scavenged_primary_grenade" );
163  self.challenge_scavengedCount++;
164  }
165 }
166 
168 {
169  self endon( "death" );
170  self endon( "disconnect" );
171 
172  self.challenge_doublejump_begin = 0;
173  self.challenge_doublejump_end = 0;
174  for(;;)
175  {
176  ret = ‪util::waittill_any_return( "doublejump_begin", "doublejump_end", "disconnect" );
177  switch( ret )
178  {
179  case "doublejump_begin":
180  self.challenge_doublejump_begin = gettime();
181  break;
182  case "doublejump_end":
183  self.challenge_doublejump_end = gettime();
184  break;
185  }
186  }
187 }
188 
189 function ‪watchJump()
190 {
191  self endon( "death" );
192  self endon( "disconnect" );
193 
194  self.challenge_jump_begin = 0;
195  self.challenge_jump_end = 0;
196  for(;;)
197  {
198  ret = ‪util::waittill_any_return( "jump_begin", "jump_end", "disconnect" );
199  switch( ret )
200  {
201  case "jump_begin":
202  self.challenge_jump_begin = gettime();
203  break;
204  case "jump_end":
205  self.challenge_jump_end = gettime();
206  break;
207  }
208  }
209 }
210 
212 {
213  self endon( "death" );
214  self endon( "disconnect" );
215 
216  self.challenge_swimming_begin = 0;
217  self.challenge_swimming_end = 0;
218  for(;;)
219  {
220  ret = ‪util::waittill_any_return( "swimming_begin", "swimming_end", "disconnect" );
221  switch( ret )
222  {
223  case "swimming_begin":
224  self.challenge_swimming_begin = gettime();
225  break;
226  case "swimming_end":
227  self.challenge_swimming_end = gettime();
228  break;
229  }
230  }
231 }
232 
233 function ‪watchWallrun()
234 {
235  self endon( "death" );
236  self endon( "disconnect" );
237 
238  self.challenge_wallrun_begin = 0;
239  self.challenge_wallrun_end = 0;
240  for(;;)
241  {
242  ret = ‪util::waittill_any_return( "wallrun_begin", "wallrun_end", "disconnect" );
243  switch( ret )
244  {
245  case "wallrun_begin":
246  self.challenge_wallrun_begin = gettime();
247  break;
248  case "wallrun_end":
249  self.challenge_wallrun_end = gettime();
250  break;
251  }
252  }
253 }
254 
255 function ‪watchSlide()
256 {
257  self endon( "death" );
258  self endon( "disconnect" );
259 
260  self.challenge_slide_begin = 0;
261  self.challenge_slide_end = 0;
262  for(;;)
263  {
264  ret = ‪util::waittill_any_return( "slide_begin", "slide_end", "disconnect" );
265  switch( ret )
266  {
267  case "slide_begin":
268  self.challenge_slide_begin = gettime();
269  break;
270  case "slide_end":
271  self.challenge_slide_end = gettime();
272  break;
273  }
274  }
275 }
276 
277 
278 function ‪watchSprint()
279 {
280  self endon( "death" );
281  self endon( "disconnect" );
282 
283  self.challenge_sprint_begin = 0;
284  self.challenge_sprint_end = 0;
285  for(;;)
286  {
287  ret = ‪util::waittill_any_return( "sprint_begin", "sprint_end", "disconnect" );
288  switch( ret )
289  {
290  case "sprint_begin":
291  self.challenge_sprint_begin = gettime();
292  break;
293  case "sprint_end":
294  self.challenge_sprint_end = gettime();
295  break;
296  }
297  }
298 }
299 
300 
301 
302 function ‪challengeKills( data )
303 {
304  victim = data.victim;
305  attacker = data.attacker;
306  time = data.time;
307  level.numKills++;
308  attacker.lastKilledPlayer = victim;
309  attackerDoubleJumping = data.attackerDoubleJumping;
310  attackerflashbackTime = data.attackerflashbackTime;
311  attackerHeroAbility = data.attackerHeroAbility;
312  attackerHeroAbilityActive = data.attackerHeroAbilityActive;
313  attackerSliding = data.attackerSliding;
314  attackerSpeedburst = data.attackerSpeedburst;
315  attackerTraversing = data.attackerTraversing;
316  attackerVisionPulseActivateTime = data.attackerVisionPulseActivateTime;
317  attackerVisionPulseArray = data.attackerVisionPulseArray;
318  attackerVisionPulseOrigin = data.attackerVisionPulseOrigin;
319  attackerVisionPulseOriginArray = data.attackerVisionPulseOriginArray;
320  attackerWallRunning = data.attackerWallRunning;
321  attackerWasConcussed = data.attackerWasConcussed;
322  attackerWasFlashed = data.attackerWasFlashed;
323  attackerWasHeatWaveStunned = data.attackerWasHeatWaveStunned;
324  attackerWasOnGround = data.attackerOnGround;
325  attackerWasUnderwater = data.attackerWasUnderwater;
326  attackerLastFastReloadTime = data.attackerLastFastReloadTime;
327  lastWeaponBeforeToss = data.lastWeaponBeforeToss;
328  meansOfDeath = data.sMeansOfDeath;
329  ownerWeaponAtLaunch = data.ownerWeaponAtLaunch;
330  victimBedOut = data.bledOut;
331  victimOrigin = data.victimOrigin;
332  victimCombatEfficiencyLastOnTime = data.victimCombatEfficiencyLastOnTime;
333  victimCombatEfficieny = data.victimCombatEfficieny;
334  victimElectrifiedBy = data.victimElectrifiedBy;
335  victimflashbackTime = data.victimflashbackTime;
336  victimHeroAbility = data.victimHeroAbility;
337  victimHeroAbilityActive = data.victimHeroAbilityActive;
338  victimSpeedburst = data.victimSpeedburst;
339  victimSpeedburstLastOnTime = data.victimSpeedburstLastOnTime;
340  victimVisionPulseActivateTime = data.victimVisionPulseActivateTime;
341  victimVisionPulseActivateTime = data.victimVisionPulseActivateTime;
342  victimVisionPulseArray = data.victimVisionPulseArray;
343  victimVisionPulseOrigin = data.victimVisionPulseOrigin;
344  victimVisionPulseOriginArray = data.victimVisionPulseOriginArray;
345  victimAttackersThisSpawn = data.victimAttackersThisSpawn;
346  victimWasDoubleJumping = data.victimWasDoubleJumping;
347  victimWasInSlamState = data.victimWasInSlamState;
348  victimWasLungingWithArmBlades = data.victimWasLungingWithArmBlades;
349  victimWasOnGround = data.victimOnGround;
350  victimWasUnderwater = data.wasUnderwater;
351  victimWasWallRunning = data.victimWasWallRunning;
352  victimLastStunnedBy = data.victimLastStunnedBy;
353  victimActiveProximityGrenades = data.victim.activeProximityGrenades;
354  victimActiveBouncingBetties = data.victim.activeBouncingBetties;
355  attackerLastFlashedBy = data.attackerLastFlashedBy;
356  attackerLastStunnedBy = data.attackerLastStunnedBy;
357  attackerLastStunnedTime = data.attackerLastStunnedTime;
358  attackerWasSliding = data.attackerWasSliding;
359  attackerWasSprinting = data.attackerWasSprinting;
360  wasDefusing = data.wasDefusing;
361  wasPlanting = data.wasPlanting;
362  inflictorOwnerWasSprinting = data.inflictorOwnerWasSprinting;
363  player = data.attacker;
364  playerOrigin = data.attackerOrigin;
365  weapon = data.weapon;
366 
367  victim_doublejump_begin = data.victim_doublejump_begin;
368  victim_doublejump_end = data.victim_doublejump_end;
369  victim_jump_begin = data.victim_jump_begin;
370  victim_jump_end = data.victim_jump_end;
371  victim_swimming_begin = data.victim_swimming_begin;
372  victim_swimming_end = data.victim_swimming_end;
373  victim_slide_begin = data.victim_slide_begin;
374  victim_slide_end = data.victim_slide_end;
375  victim_wallrun_begin = data.victim_wallrun_begin;
376  victim_wallrun_end = data.victim_wallrun_end;
377  victim_was_drowning = data.victim_was_drowning;
378 
379  attacker_doublejump_begin = data.attacker_doublejump_begin;
380  attacker_doublejump_end = data.attacker_doublejump_end;
381  attacker_jump_begin = data.attacker_jump_begin;
382  attacker_jump_end = data.attacker_jump_end;
383  attacker_swimming_begin = data.attacker_swimming_begin;
384  attacker_swimming_end = data.attacker_swimming_end;
385  attacker_slide_begin = data.attacker_slide_begin;
386  attacker_slide_end = data.attacker_slide_end;
387  attacker_wallrun_begin = data.attacker_wallrun_begin;
388  attacker_wallrun_end = data.attacker_wallrun_end;
389  attacker_was_drowning = data.attacker_was_drowning;
390  attacker_sprint_end = data.attacker_sprint_end;
391  attacker_sprint_begin = data.attacker_sprint_begin;
392 
393  attacker_wallRanTwoOppositeWallsNoGround = data.attacker_wallRanTwoOppositeWallsNoGround;
394 
395  inflictorIsCooked = data.inflictorIsCooked;
396  inflictorChallenge_hatchetTossCount = data.inflictorChallenge_hatchetTossCount;
397  inflictorOwnerWasSprinting = data.inflictorOwnerWasSprinting;
398  inflictorPlayerHasEngineerPerk = data.inflictorPlayerHasEngineerPerk;
399 
400  inflictor = data.eInflictor; // MAY ALREADY BE REMOVED
401 
402 
403  if ( !isdefined( data.weapon ) )
404  {
405  return;
406  }
407 
408  if ( !isdefined( player ) || !isplayer( player ) || ( weapon == level.weaponNone ) )
409  {
410  return;
411  }
412 
413  // getting the altweapon name is not ideal, but acceptable for BO3's current weapons in MP;
414  // TODO: add code-based accessor to parentWeaponName ("Stat Name" in APE)
415  weaponClass = ‪util::getWeaponClass( weapon );
416  baseWeapon = ‪getBaseWeapon( weapon );
417  baseWeaponItemIndex = GetBaseWeaponItemIndex( baseWeapon );
418  weaponPurchased = player isItemPurchased( baseWeaponItemIndex );
419  victimSupportIndex = victim.team;
420  playerSupportIndex = player.team;
421  if ( !level.teambased )
422  {
423  playerSupportIndex = player.entnum;
424  victimSupportIndex = victim.entnum;
425  }
426 
427  if ( meansOfDeath == "MOD_HEAD_SHOT" || meansOfDeath == "MOD_PISTOL_BULLET" || meansOfDeath == "MOD_RIFLE_BULLET" )
428  {
429  bulletKill = true;
430  }
431  else
432  {
433  bulletKill = false;
434  }
435 
436  if ( level.teambased )
437  {
438  if ( player.team == victim.team )
439  {
440  return;
441  }
442  }
443  else
444  {
445  if ( player == victim )
446  {
447  return;
448  }
449  }
450 
451  killstreak = ‪killstreaks::get_from_weapon( data.weapon );
452 
453  if ( !isdefined( killstreak ) )
454  {
455  player ‪processSpecialistChallenge( "kills" );
456  if ( weapon.isheroWeapon == true )
457  {
458  player ‪processSpecialistChallenge( "kills_weapon" );
459  player.heroWeaponKillsThisActivation++;
460  player.pers["challenge_heroweaponkills"]++;
461  if ( player.pers["challenge_heroweaponkills"] >= 6 )
462  {
463  player ‪processSpecialistChallenge( "kill_one_game_weapon" );
464  player.pers["challenge_heroweaponkills"] = 0;
465  }
466  }
467  }
468 
469  if ( bulletKill )
470  {
471  if ( weaponPurchased )
472  {
473  if ( weaponclass == "weapon_sniper" )
474  {
475  if ( isdefined ( victim.firstTimeDamaged ) && victim.firstTimeDamaged == time )
476  {
477  player AddPlayerStat( "kill_enemy_one_bullet_sniper", 1 );
478  player AddWeaponStat( weapon, "kill_enemy_one_bullet_sniper", 1 );
479  }
480  }
481  else if ( weaponclass == "weapon_cqb" )
482  {
483  if ( isdefined ( victim.firstTimeDamaged ) && victim.firstTimeDamaged == time )
484  {
485  player AddPlayerStat( "kill_enemy_one_bullet_shotgun", 1 );
486  player AddWeaponStat( weapon, "kill_enemy_one_bullet_shotgun", 1 );
487  }
488  }
489  }
490 
491  if ( ( time - data.attacker_swimming_end <= 2000 ) && ( time - data.attacker_doublejump_begin <= 2000 ) )
492  {
493  player AddPlayerStat( "kill_after_doublejump_out_of_water", 1 );
494  }
495 
496  if ( attackerWasSliding )
497  {
498  if ( attacker_doublejump_end == attacker_slide_begin )
499  {
500  player AddPlayerStat( "kill_while_sliding_from_doublejump", 1 );
501  }
502  }
503 
504  if ( ( player IsBonusCardActive( ‪BONUSCARD_PRIMARY_GUNFIGHTER_3, player.class_num ) ) && player IsItemPurchased( GetItemIndexFromRef( "bonuscard_primary_gunfighter_3" ) ) )
505  {
506  if ( isdefined( weapon.attachments ) && weapon.attachments.size == 6 )
507  {
508  player AddPlayerStat( "kill_with_gunfighter", 1 );
509  }
510  }
511 
512  //Check for the killstreak 5 challenge completion
513  checkkillstreak5( baseWeapon, player );
514 
515  if ( weapon.isDualWield && weaponPurchased )
516  {
517  ‪checkDualWield( baseWeapon, player, attacker, time, attackerwassprinting, attacker_sprint_end );
518  }
519 
520  if ( isdefined( weapon.attachments ) && weapon.attachments.size > 0 )
521  {
522  attachmentName = player GetWeaponOptic( weapon );
523 
524  if ( isdefined( attachmentName ) && attachmentName != "" && player WeaponHasAttachmentAndUnlocked( weapon, attachmentName ) )
525  {
526  if ( weapon.attachments.size > 5 && player AllWeaponAttachmentsUnlocked( weapon ) && !isdefined( attacker.tookWeaponFrom[ weapon ] ) )
527  {
528  player AddPlayerStat( "kill_optic_5_attachments", 1 );
529  }
530  if ( isdefined( player.attachmentKillsThisSpawn[ attachmentName ] ) )
531  {
532  player.attachmentKillsThisSpawn[ attachmentName ]++;
533  if ( player.attachmentKillsThisSpawn[ attachmentName ] == 5 )
534  {
535  player AddWeaponStat( weapon, "killstreak_5_attachment", 1 );
536  }
537  }
538  else
539  {
540  player.attachmentKillsThisSpawn[ attachmentName ] = 1;
541  }
542 
543  if ( ‪weapon_utils::isPistol( weapon.rootweapon ) )
544  {
545  if ( player weaponHasAttachmentAndUnlocked( weapon, "suppressed", "extbarrel" ) )
546  {
547  player AddPlayerStat( "kills_pistol_lasersight_suppressor_longbarrel", 1 );
548  }
549  }
550  }
551 
552  if ( player weaponHasAttachmentAndUnlocked( weapon, "suppressed" ) )
553  {
554  if ( attacker ‪util::has_hard_wired_perk_purchased_and_equipped() // hardwired
556  && attacker ‪util::has_jetquiet_perk_purchased_and_equipped() ) // blast suppressor
557  {
558  player AddPlayerStat( "kills_suppressor_ghost_hardwired_blastsuppressor", 1 );
559  }
560  }
561 
562  if ( player PlayerAds() == 1 )
563  {
564  if ( isdefined( player.smokeGrenadeTime ) && isdefined( player.smokeGrenadePosition ) )
565  {
566  if ( player.smokeGrenadeTime + 14000 > time )
567  {
568  if ( player ‪util::is_looking_at( player.smokeGrenadePosition ) || ( distancesquared( player.origin, player.smokeGrenadePosition ) < 200 * 200 ))
569  {
570  if ( player weaponHasAttachmentAndUnlocked( weapon, "ir" ) )
571  {
572  player AddPlayerStat( "kill_with_thermal_and_smoke_ads", 1 );
573  player AddWeaponStat( weapon, "kill_thermal_through_smoke", 1 );
574  }
575  }
576  }
577  }
578  }
579 
580  if ( weapon.attachments.size > 1 )
581  {
582  if ( player PlayerAds() == 1 )
583  {
584  if ( player weaponHasAttachmentAndUnlocked( weapon, "grip", "quickdraw" ) )
585  {
586  player AddPlayerStat( "kills_ads_quickdraw_and_grip", 1 );
587  }
588  if ( player weaponHasAttachmentAndUnlocked( weapon, "swayreduc", "stalker" ) )
589  {
590  player AddPlayerStat( "kills_ads_stock_and_cpu", 1 );
591  }
592  }
593  else
594  {
595  if ( player weaponHasAttachmentAndUnlocked( weapon, "rf", "steadyaim" ) )
596  {
598  {
599  player AddPlayerStat( "kills_hipfire_rapidfire_lasersights_fasthands", 1 );
600  }
601  }
602  }
603  if ( player weaponHasAttachmentAndUnlocked( weapon, "fastreload", "extclip" ) )
604  {
605  player.pers["killsFastMagExt"]++;
606  if ( player.pers["killsFastMagExt"] > 4 )
607  {
608  player AddPlayerStat( "kills_one_life_fastmags_and_extclip", 1 );
609  player.pers["killsFastMagExt"] = 0;
610  }
611  }
612  }
613 
614  if ( weapon.attachments.size > 2 )
615  {
616  if ( meansOfDeath == "MOD_HEAD_SHOT" )
617  {
618  if ( player weaponHasAttachmentAndUnlocked( weapon, "fmj", "damage", "extbarrel" ) )
619  {
620  player AddPlayerStat( "headshot_fmj_highcaliber_longbarrel", 1 );
621  }
622  }
623  }
624 
625  if ( weapon.attachments.size > 4 )
626  {
627  if ( player weaponHasAttachmentAndUnlocked( weapon, "extclip", "grip", "fastreload", "quickdraw", "stalker" ) )
628  {
629  player AddPlayerStat( "kills_extclip_grip_fastmag_quickdraw_stock", 1 );
630  }
631  }
632  }
633 
634  if ( victim_was_drowning && attacker_was_drowning )
635  {
636  player AddPlayerStat( "dr_lung", 1 );
637  }
638 
639  if ( isdefined( attackerLastFastReloadTime ) && ( time - attackerLastFastReloadTime <= 5000 ) && player WeaponHasAttachmentAndUnlocked( weapon, "fastreload" ) )
640  {
641  player AddPlayerStat( "kills_after_reload_fastreload", 1 );
642  }
643 
644  if ( victim.iDFlagsTime == time )
645  {
646  if ( victim.iDFlags & ‪IDFLAGS_PENETRATION )
647  {
648  player AddPlayerStat( "kill_enemy_through_wall", 1 );
649  if ( player weaponHasAttachmentAndUnlocked( weapon, "fmj" ) )
650  {
651  player AddPlayerStat( "kill_enemy_through_wall_with_fmj", 1 );
652  }
653  }
654  }
655 
656  if ( attacker_wallRanTwoOppositeWallsNoGround === true )
657  {
658  player AddPlayerStat( "kill_while_wallrunning_2_walls", 1 );
659  }
660 
661  // end if ( bulletkill )
662  }
663  else if ( ‪weapon_utils::isMeleeMOD( meansOfDeath ) && !isdefined( killstreak ) )
664  {
665  player AddPlayerStat( "melee", 1 );
666  if ( ‪weapon_utils::isPunch( weapon ) )
667  {
668  player AddPlayerStat( "kill_enemy_with_fists", 1 );
669  }
670 
671  //Check for the killstreak 5 challenge completion
672  checkkillstreak5( baseWeapon, player );
673  }
674  else
675  {
676  if ( weaponPurchased )
677  {
678  if ( weapon == player.grenadeTypePrimary )
679  {
680  if ( player.challenge_scavengedCount > 0 )
681  {
682  player.challenge_resuppliedNameKills++;
683  if ( player.challenge_resuppliedNameKills >= 3 )
684  {
685  player AddPlayerStat( "kills_3_resupplied_nade_one_life", 1 );
686  player.challenge_resuppliedNameKills = 0;
687  }
688  player.challenge_scavengedCount--;
689  }
690  }
691  if ( isdefined( inflictorIsCooked ) )
692  {
693  if ( inflictorIsCooked == true && weapon.rootweapon.name != "hatchet" )
694  {
695  player AddPlayerStat( "kill_with_cooked_grenade", 1 );
696  }
697  }
698 
699  if ( victimLastStunnedBy === player )
700  {
701  if ( weaponclass == "weapon_grenade" )
702  {
703  player AddPlayerStat( "kill_stun_lethal", 1 );
704  }
705  }
706 
707  if ( baseWeapon == level.weaponSpecialCrossbow )
708  {
709  if ( weapon.isDualWield ) // determined purchased
710  {
711  ‪checkDualWield( baseWeapon, player, attacker, time, attackerwassprinting, attacker_sprint_end );
712  }
713  }
714 
715  // for "energy" shotgun
716  if ( baseWeapon == level.weaponShotgunEnergy )
717  {
718  if ( isdefined ( victim.firstTimeDamaged ) && victim.firstTimeDamaged == time )
719  {
720  player AddPlayerStat( "kill_enemy_one_bullet_shotgun", 1 );
721  player AddWeaponStat( weapon, "kill_enemy_one_bullet_shotgun", 1 );
722  }
723  }
724  }
725 
726  if ( baseWeapon.forceDamageHitLocation || baseWeapon == level.weaponSpecialCrossbow || baseWeapon == level.weaponShotgunEnergy || baseWeapon == level.weaponSpecialDiscGun || baseWeapon == level.weaponBallisticKnife || baseWeapon == level.weaponLauncherEx41 )
727  {
728  //Check for the killstreak 5 challenge completion
729  checkkillstreak5( baseWeapon, player );
730  }
731  }
732 
733  if ( isdefined( attacker.tookWeaponFrom[ weapon ] ) && isdefined( attacker.tookWeaponFrom[ weapon ].previousOwner ) )
734  {
735  if ( !isdefined( attacker.tookWeaponFrom[ weapon ].previousOwner.team ) || attacker.tookWeaponFrom[ weapon ].previousOwner.team != player.team )
736  {
737  player AddPlayerStat( "kill_with_pickup", 1 );
738  }
739  }
740 
741  awarded_kill_enemy_that_blinded_you = false;
742 
743  playerHasTacticalMask = ‪loadout::hasTacticalMask( player );
744 
745  if ( attackerWasFlashed )
746  {
747  if ( attackerLastFlashedBy === victim && !playerHasTacticalMask )
748  {
749  player AddPlayerStat( "kill_enemy_that_blinded_you", 1 );
750  awarded_kill_enemy_that_blinded_you = true;
751  }
752  }
753 
754  if ( !awarded_kill_enemy_that_blinded_you && isdefined( attackerLastStunnedTime ) && attackerLastStunnedTime + 5000 > time )
755  {
756  if ( attackerLastStunnedBy === victim && !playerHasTacticalMask )
757  {
758  player AddPlayerStat( "kill_enemy_that_blinded_you", 1 );
759  awarded_kill_enemy_that_blinded_you = true;
760  }
761  }
762 
763  killedStunnedVictim = false;
764  if ( isdefined( victim.lastConcussedBy ) && victim.lastConcussedBy == attacker )
765  {
766  if ( victim.concussionEndTime > time )
767  {
768  if ( player ‪util::is_item_purchased( "concussion_grenade" ) )
769  {
770  player AddPlayerStat( "kill_concussed_enemy", 1 );
771  }
772  killedStunnedVictim = true;
773  player AddWeaponStat( GetWeapon( "concussion_grenade" ), "CombatRecordStat", 1 );
774  }
775  }
776 
777  if ( isdefined( victim.lastShockedBy ) && victim.lastShockedBy == attacker )
778  {
779  if ( victim.shockEndTime > time )
780  {
781  if ( player ‪util::is_item_purchased( "proximity_grenade" ) )
782  {
783  player AddPlayerStat( "kill_shocked_enemy", 1 );
784  }
785  player AddWeaponStat( GetWeapon( "proximity_grenade" ), "CombatRecordStat", 1 );
786  killedStunnedVictim = true;
787  if ( weapon.rootweapon.name == "bouncingbetty" )
788  {
789  player AddPlayerStat( "kill_trip_mine_shocked", 1 );
790  }
791  }
792 
793  }
794 
795  if ( victim ‪util::isFlashbanged() )
796  {
797  if ( isdefined( victim.lastFlashedBy ) && victim.lastFlashedBy == player )
798  {
799  killedStunnedVictim = true;
800  if ( player ‪util::is_item_purchased( "flash_grenade" ) )
801  {
802  player AddPlayerStat( "kill_flashed_enemy", 1 );
803  }
804  player AddWeaponStat( GetWeapon( "flash_grenade" ), "CombatRecordStat", 1 );
805  }
806  }
807 
808  if ( level.teamBased )
809  {
810  if ( ( !isDefined( player.pers["kill_every_enemy_with_specialist"] ) ) && ( level.playerCount[victim.pers["team"]] > 3 && player.pers["killed_players_with_specialist"].size >= level.playerCount[victim.pers["team"]] ) )
811  {
812  player AddPlayerStat( "kill_every_enemy", 1 );
813  player.pers["kill_every_enemy_with_specialist"] = true;
814  }
815 
816 
817  if ( isdefined( victimAttackersThisSpawn ) && IsArray( victimAttackersThisSpawn ) )
818  {
819  if ( victimAttackersThisSpawn.size > 5 )
820  {
821  attackerCount = 0;
822  foreach( attacking_player in victimAttackersThisSpawn )
823  {
824  if ( !isdefined( attacking_player ) )
825  continue;
826 
827  if ( attacking_player == attacker )
828  continue;
829 
830  if ( attacking_player.team != attacker.team )
831  continue;
832 
833  attackerCount++;
834  }
835 
836  if ( attackerCount > 4 )
837  {
838  // note: "kill_enemy_5_teammates_assists" should be awarded withing on life, not just assist
839  player AddPlayerStat( "kill_enemy_5_teammates_assists", 1 );
840  }
841  }
842  }
843  }
844 
845  if ( isdefined( killstreak ) )
846  {
847  if ( killstreak == "rcbomb" || killstreak == "inventory_rcbomb" )
848  {
849  if ( !victimWasOnGround || victimWasWallRunning )
850  {
851  player AddPlayerStat( "kill_wallrunner_or_air_with_rcbomb", 1 );
852  }
853  }
854 
855  if ( killstreak == "autoturret" || killstreak == "inventory_autoturret" )
856  {
857  if ( isdefined( inflictor ) && player ‪util::is_item_purchased( "killstreak_auto_turret" ) )
858  {
859  if ( !isdefined( inflictor.challenge_killcount ) )
860  {
861  inflictor.challenge_killcount = 0;
862  }
863 
864  inflictor.challenge_killcount++;
865  if ( inflictor.challenge_killcount == 5 )
866  {
867  player AddPlayerStat( "kills_auto_turret_5", 1 );
868  }
869  }
870  }
871  }
872 
873  if ( isdefined( victim.challenge_combatRobotAttackClientID[player.clientid] ) )
874  {
875  if ( !isdefined( inflictor ) || !isdefined( inflictor.killstreakType ) || !IsString( inflictor.killstreakType ) || ( inflictor.killstreakType != "combat_robot" ) )
876  {
877  player AddPlayerStat( "kill_enemy_who_damaged_robot", 1 );
878  }
879  }
880 
881  if ( player IsBonusCardActive( ‪BONUSCARD_DANGER_CLOSE, player.class_num ) && player ‪util::is_item_purchased( "bonuscard_danger_close" ) )
882  {
883  if ( weaponclass == "weapon_grenade" )
884  {
885  player AddBonusCardStat( ‪BONUSCARD_DANGER_CLOSE, "kills", 1, player.class_num );
886  }
887  if ( weapon.rootweapon.name == "hatchet" && inflictorChallenge_hatchetTossCount <= 2 )
888  {
889  player.challenge_hatchetkills++;
890  if ( player.challenge_hatchetkills == 2 )
891  {
892  player AddPlayerStat( "kills_first_throw_both_hatchets", 1 );
893  }
894  }
895  }
896 
897  player ‪trackKillstreakSupportKills( victim );
898 
899  // PERKS
900  if ( !isdefined( killstreak ) )
901  {
902  if ( attackerWasUnderwater )
903  {
904  player AddPlayerStat( "kill_while_underwater", 1 );
905  }
906 
907  if ( player ‪util::has_purchased_perk_equipped( "specialty_jetcharger" ) ) // afterburner
908  {
909  if ( ( attacker_doublejump_begin > attacker_doublejump_end || attacker_doublejump_end + 3000 > time )
910  || ( attacker_slide_begin > attacker_slide_end || attacker_slide_end + 3000 > time ) )
911  {
912  player AddPlayerStat( "kills_after_jumping_or_sliding", 1 );
913 
914  if ( player ‪util::has_purchased_perk_equipped( "specialty_overcharge" ) )
915  {
916  {
917  player AddPlayerStat( "kill_overclock_afterburner_specialist_weapon_after_thrust", 1 );
918  }
919  }
920  }
921  }
922 
923  trackedPlayer = false;
924  if ( player ‪util::has_purchased_perk_equipped( "specialty_tracker" ) )
925  {
926  if ( !victim hasPerk ( "specialty_trackerjammer" ) ) // hardwired
927  {
928  player AddPlayerStat( "kill_detect_tracker", 1 );
929  trackedPlayer = true;
930  }
931  }
932 
933  if ( player ‪util::has_purchased_perk_equipped( "specialty_detectnearbyenemies" ) ) // sixth sense
934  {
935  if ( !victim hasPerk ( "specialty_sixthsensejammer" ) )
936  {
937  player AddPlayerStat( "kill_enemy_sixth_sense", 1 );
938 
939  if ( player ‪util::has_purchased_perk_equipped( "specialty_loudenemies" ) ) // awareness
940  {
941  if ( !victim hasPerk ( "specialty_quieter" ) ) // dead silence
942  {
943  player AddPlayerStat( "kill_sixthsense_awareness", 1 );
944  }
945  }
946  }
947 
948  if ( trackedPlayer )
949  {
950  player AddPlayerStat( "kill_tracker_sixthsense", 1 );
951  }
952  }
953 
954  if ( weapon.isheroWeapon == true || attackerHeroAbilityActive )
955  {
956  if ( player ‪util::has_purchased_perk_equipped( "specialty_overcharge" ) ) // overclock
957  {
958  player AddPlayerStat( "kill_with_specialist_overclock", 1 );
959  }
960  }
961 
962  if ( player ‪util::has_purchased_perk_equipped( "specialty_gpsjammer" ) ) // ghost
963  {
964  if ( ‪uav::HasUAV( victimSupportIndex ) )
965  {
966  player AddPlayerStat( "kill_uav_enemy_with_ghost", 1 );
967  }
968 
969  if ( player ‪util::has_blind_eye_perk_purchased_and_equipped() ) // blindeye
970  {
971  activeKillstreaks = victim ‪killstreaks::getActiveKillstreaks();
972 
973  awarded_kill_blindeye_ghost_aircraft = false;
974  foreach( activeStreak in activeKillstreaks )
975  {
976  if ( awarded_kill_blindeye_ghost_aircraft )
977  break;
978 
979  switch( activeStreak.killstreakType )
980  {
981  case "sentinel":
982  case "helicopter_comlink":
983  case "drone_striked":
984  case "uav":
985  player AddPlayerStat( "kill_blindeye_ghost_aircraft", 1 );
986  awarded_kill_blindeye_ghost_aircraft = true;
987  break;
988  }
989  }
990  }
991  }
992  if ( player ‪util::has_purchased_perk_equipped( "specialty_flakjacket" ) )
993  {
994  if ( isdefined ( player.challenge_lastsurvivewithflakfrom ) && player.challenge_lastsurvivewithflakfrom == victim )
995  {
996  player AddPlayerStat( "kill_enemy_survive_flak", 1 );
997  }
998 
999 
1001  {
1002  recentlySurvivedFlak = false;
1003  if ( isdefined ( player.challenge_lastsurvivewithflaktime ) )
1004  {
1005  if ( ( player.challenge_lastsurvivewithflaktime + 3000 ) > time )
1006  {
1007  recentlySurvivedFlak = true;
1008  }
1009  }
1010  recentlyStunned = false;
1011  if ( isdefined( player.lastStunnedTime ) )
1012  {
1013  if ( player.lastStunnedTime + 2000 > time )
1014  {
1015  recentlyStunned = true;
1016  }
1017  }
1018  if ( recentlySurvivedFlak
1019  || ( player ‪util::isFlashbanged() )
1020  || recentlyStunned )
1021  {
1022  player AddPlayerStat( "kill_flak_tac_while_stunned", 1 );
1023  }
1024  }
1025  }
1026 
1027  if ( player ‪util::has_hard_wired_perk_purchased_and_equipped() ) // hard wired
1028  {
1029  if ( victim ‪counteruav::HasIndexActiveCounterUAV( victimSupportIndex ) || victim emp::hasactiveemp() )
1030  {
1031  player AddPlayerStat( "kills_counteruav_emp_hardline", 1 );
1032  }
1033  }
1034 
1036  {
1037  if ( player.scavenged )
1038  {
1039  player AddPlayerStat( "kill_after_resupply", 1 );
1040  if ( trackedPlayer )
1041  {
1042  player AddPlayerStat( "kill_scavenger_tracker_resupply", 1 );
1043  }
1044  }
1045  }
1046 
1047  if ( player ‪util::has_fast_hands_perk_purchased_and_equipped() ) // fasthands
1048  {
1049  if ( bulletKill )
1050  {
1051  if ( attackerWasSprinting || attacker_sprint_end + 3000 > time )
1052  {
1053  player AddPlayerStat( "kills_after_sprint_fasthands", 1 );
1054  if ( player ‪util::has_gung_ho_perk_purchased_and_equipped() ) // gungho
1055  {
1056  player AddPlayerStat( "kill_fasthands_gungho_sprint", 1 );
1057  }
1058  }
1059  }
1060  }
1061 
1062  if ( player ‪util::has_hard_wired_perk_purchased_and_equipped() ) // hardwired
1063  {
1064  if ( player ‪util::has_cold_blooded_perk_purchased_and_equipped() ) // cold blooded
1065  {
1066  player AddPlayerStat( "kill_hardwired_coldblooded", 1 );
1067  }
1068  }
1069 
1070 
1071  killedPlayerWithGungHo = false;
1072  if ( player ‪util::has_gung_ho_perk_purchased_and_equipped() ) // gung ho
1073  {
1074  if ( bulletKill )
1075  {
1076  killedPlayerWithGungHo = true;
1077  if ( attackerWasSprinting && player PlayerAds() != 1 )
1078  {
1079  player AddPlayerStat( "kill_hip_gung_ho", 1 );
1080  }
1081  }
1082  if ( weaponclass == "weapon_grenade" )
1083  {
1084  if ( isdefined( inflictorOwnerWasSprinting ) && inflictorOwnerWasSprinting == true )
1085  {
1086  killedPlayerWithGungHo = true;
1087  player AddPlayerStat( "kill_hip_gung_ho", 1 );
1088  }
1089  }
1090  }
1091 
1092  if ( player ‪util::has_jetquiet_perk_purchased_and_equipped() ) // blast surpressor
1093  {
1094  if ( attackerDoubleJumping || ( attacker_doublejump_end + 3000 > time ) )
1095  {
1096  player AddPlayerStat( "kill_blast_doublejump", 1 );
1097  if ( player ‪util::has_ghost_perk_purchased_and_equipped() ) // ghost
1098  {
1099  if ( ‪uav::HasUAV( victimSupportIndex ) )
1100  {
1101  player AddPlayerStat( "kill_doublejump_uav_engineer_hardwired", 1 );
1102  }
1103  }
1104  }
1105  }
1106  if ( player ‪util::has_awareness_perk_purchased_and_equipped() ) // awareness
1107  {
1108  player AddPlayerStat( "kill_awareness", 1 );
1109  }
1110 
1111  if ( killedStunnedVictim )
1112  {
1113  if ( player ‪util::has_tactical_mask_purchased_and_equipped() ) // tacmask
1114  {
1115  player AddPlayerStat( "kill_stunned_tacmask", 1 );
1116  if ( killedPlayerWithGungHo == true )
1117  {
1118  player AddPlayerStat( "kill_sprint_stunned_gungho_tac", 1 );
1119  }
1120  }
1121  }
1122 
1123  if ( player ‪util::has_ninja_perk_purchased_and_equipped() ) // dead silence
1124  {
1125  player AddPlayerStat( "kill_dead_silence", 1 );
1126 
1127  if ( distanceSquared( playerOrigin, victimOrigin ) < 120 * 120 )
1128  {
1129  if ( player ‪util::has_awareness_perk_purchased_and_equipped() ) // awareness
1130  {
1131  player AddPlayerStat( "kill_close_deadsilence_awareness", 1 );
1132  }
1133 
1134  if ( player ‪util::has_jetquiet_perk_purchased_and_equipped() ) // blast suppressr
1135  {
1136  player AddPlayerStat( "kill_close_blast_deadsilence", 1 );
1137  }
1138  }
1139  }
1140 
1141  greedCardsActive = 0;
1142  if ( player IsBonusCardActive( ‪BONUSCARD_PERK_1_GREED, player.class_num ) && player ‪util::is_item_purchased( "bonuscard_perk_1_greed" ) )
1143  {
1144  greedCardsActive++;
1145  }
1146  if ( player IsBonusCardActive( ‪BONUSCARD_PERK_2_GREED, player.class_num ) && player ‪util::is_item_purchased( "bonuscard_perk_2_greed" ) )
1147  {
1148  greedCardsActive++;
1149  }
1150  if ( player IsBonusCardActive( ‪BONUSCARD_PERK_3_GREED, player.class_num ) && player ‪util::is_item_purchased( "bonuscard_perk_3_greed" ) )
1151  {
1152  greedCardsActive++;
1153  }
1154 
1155  if ( greedCardsActive >= 2 )
1156  {
1157  player AddPlayerStat( "kill_2_greed_2_perks_each", 1 );
1158  }
1159 
1160  if ( player BonusCardActiveCount( player.class_num ) >= 2 )
1161  {
1162  player AddPlayerStat( "kill_2_wildcards", 1 );
1163  }
1164 
1165 
1166  gunfighterOverkillActive = false;
1167  if ( player IsBonusCardActive( ‪BONUSCARD_OVERKILL, player.class_num ) && player ‪util::is_item_purchased( "bonuscard_overkill" ) )
1168  {
1169  primaryAttachmentsTotal = 0;
1170  if ( isdefined( player.primaryLoadoutWeapon ) )
1171  primaryAttachmentsTotal = player.primaryLoadoutWeapon.attachments.size;
1172 
1173  secondaryAttachmentsTotal = 0;
1174  if ( isdefined( player.secondaryLoadoutWeapon ) )
1175  secondaryAttachmentsTotal = player.secondaryLoadoutWeapon.attachments.size;
1176 
1177  if ( primaryAttachmentsTotal + secondaryAttachmentsTotal >= 5 )
1178  {
1179  gunfighterOverkillActive = true;
1180  }
1181  }
1182 
1183  if ( ( isdefined (player.primaryLoadoutWeapon ) && weapon == player.primaryLoadoutWeapon )
1184  || ( isdefined (player.primaryLoadoutAltWeapon ) && weapon == player.primaryLoadoutAltWeapon ) )
1185  {
1186  if ( player IsBonusCardActive( ‪BONUSCARD_PRIMARY_GUNFIGHTER, player.class_num ) && player ‪util::is_item_purchased( "bonuscard_primary_gunfighter" ) )
1187  {
1188  player AddBonusCardStat( ‪BONUSCARD_PRIMARY_GUNFIGHTER, "kills", 1, player.class_num );
1189  player AddPlayerStat( "kill_with_loadout_weapon_with_3_attachments", 1 );
1190  }
1191  if ( isdefined( player.secondaryWeaponKill ) && player.secondaryWeaponKill == true )
1192  {
1193  player.primaryWeaponKill = false;
1194  player.secondaryWeaponKill = false;
1195  if ( player IsBonusCardActive( ‪BONUSCARD_OVERKILL, player.class_num ) && player ‪util::is_item_purchased( "bonuscard_overkill" ) )
1196  {
1197  player AddBonusCardStat( ‪BONUSCARD_OVERKILL, "kills", 1, player.class_num );
1198  player AddPlayerStat( "kill_with_both_primary_weapons", 1 );
1199  if ( gunfighterOverkillActive )
1200  {
1201  player AddPlayerStat( "kill_overkill_gunfighter_5_attachments", 1 );
1202  }
1203  }
1204  }
1205  else
1206  {
1207  player.primaryWeaponKill = true;
1208  }
1209  }
1210  else if ( ( isdefined( player.secondaryLoadoutWeapon ) && weapon == player.secondaryLoadoutWeapon )
1211  || ( isdefined( player.secondaryLoadoutAltWeapon ) && weapon == player.secondaryLoadoutAltWeapon ) )
1212  {
1213  if ( player IsBonusCardActive( ‪BONUSCARD_SECONDARY_GUNFIGHTER, player.class_num ) && player ‪util::is_item_purchased( "bonuscard_secondary_gunfighter" ) )
1214  {
1215  player AddBonusCardStat( ‪BONUSCARD_SECONDARY_GUNFIGHTER, "kills", 1, player.class_num );
1216  }
1217  if ( isdefined( player.primaryWeaponKill ) && player.primaryWeaponKill == true )
1218  {
1219  player.primaryWeaponKill = false;
1220  player.secondaryWeaponKill = false;
1221  if ( player IsBonusCardActive( ‪BONUSCARD_OVERKILL, player.class_num ) && player ‪util::is_item_purchased( "bonuscard_overkill" ) )
1222  {
1223  player AddBonusCardStat( ‪BONUSCARD_OVERKILL, "kills", 1, player.class_num );
1224  player AddPlayerStat( "kill_with_both_primary_weapons", 1 );
1225  if ( gunfighterOverkillActive )
1226  {
1227  player AddPlayerStat( "kill_overkill_gunfighter_5_attachments", 1 );
1228  }
1229  }
1230  }
1231  else
1232  {
1233  player.secondaryWeaponKill = true;
1234  }
1235  }
1236 
1238  {
1239  should_award_kill_near_plant_engineer_hardwired = false;
1240 
1241  if ( isdefined( victimActiveBouncingBetties ) )
1242  {
1243  foreach( bouncingBettyInfo in victimActiveBouncingBetties )
1244  {
1245  if ( !isdefined( bouncingBettyInfo ) || !isdefined( bouncingBettyInfo.origin ) )
1246  continue;
1247 
1248  if ( DistanceSquared( bouncingBettyInfo.origin, victimOrigin ) < ‪SQR( ‪KILL_NEAR_PLANT_ENGINEER_HARDWIRED_CLOSE_ENOUGH_DISTANCE ) )
1249  {
1250  should_award_kill_near_plant_engineer_hardwired = true;
1251  break;
1252  }
1253  }
1254  }
1255 
1256  if ( isdefined( victimActiveProximityGrenades ) && should_award_kill_near_plant_engineer_hardwired == false )
1257  {
1258  foreach( proximityGrenadeInfo in victimActiveProximityGrenades )
1259  {
1260  if ( !isdefined( proximityGrenadeInfo ) || !isdefined( proximityGrenadeInfo.origin ) )
1261  continue;
1262 
1263  if ( DistanceSquared( proximityGrenadeInfo.origin, victimOrigin ) < ‪SQR( ‪KILL_NEAR_PLANT_ENGINEER_HARDWIRED_CLOSE_ENOUGH_DISTANCE ) )
1264  {
1265  should_award_kill_near_plant_engineer_hardwired = true;
1266  break;
1267  }
1268  }
1269  }
1270 
1271  if ( should_award_kill_near_plant_engineer_hardwired )
1272  {
1273  player AddPlayerStat( "kill_near_plant_engineer_hardwired", 1 );
1274  }
1275  }
1276  }
1277  else // it was a killstreak
1278  {
1279  if ( weapon.name == "supplydrop" )
1280  {
1281  if (isdefined( inflictorPlayerHasEngineerPerk ) )
1282  {
1283  player AddPlayerStat( "kill_booby_trap_engineer", 1 );
1284  }
1285  }
1286  }
1287 
1288  if ( weapon.isHeroWeapon == true || attackerHeroAbilityActive || isdefined( killstreak ) )
1289  {
1290  if ( player ‪util::has_purchased_perk_equipped( "specialty_overcharge" ) // overclock
1291  && ( player ‪util::has_purchased_perk_equipped( "specialty_anteup" ) ) ) // anteup
1292  {
1293  player AddPlayerStat( "kill_anteup_overclock_scorestreak_specialist", 1 );
1294  }
1295  }
1296 }
1297 
1299 {
1300  if ( ‪canProcessChallenges() )
1301  {
1303  }
1304 }
1305 
1306 function ‪get_challenge_stat( stat_name )
1307 {
1308  return self GetDStat( "playerstatslist", stat_name, "challengevalue" );
1309 }
1310 
1311 function ‪force_challenge_stat( stat_name, stat_value )
1312 {
1313  // make the stat value and challenge value identical
1314  self SetDStat( "playerstatslist", stat_name, "statvalue", stat_value );
1315  self SetDStat( "playerstatslist", stat_name, "challengevalue", stat_value );
1316 }
1317 
1318 function ‪get_challenge_group_stat( group_name, stat_name )
1319 {
1320  return self GetDStat( "groupstats", group_name, "stats", stat_name, "challengevalue" );
1321 }
1322 
1324 {
1325  // use this method to fix up any challenge inconsistencies at spawn
1326 
1327  player = self;
1328 
1329  if ( !isdefined( player ) )
1330  return;
1331 
1332  if ( player.fix_challenge_stats_performed === true )
1333  return;
1334 
1335  player ‪fix_TU6_weapon_for_diamond( "special_crossbow_for_diamond" );
1336  player ‪fix_TU6_weapon_for_diamond( "melee_crowbar_for_diamond" );
1337  player ‪fix_TU6_weapon_for_diamond( "melee_sword_for_diamond" );
1338  player ‪fix_TU6_ar_garand();
1339  player ‪fix_TU6_pistol_shotgun();
1340  player ‪TU7_fix_100_percenter();
1341 
1342  player.fix_challenge_stats_performed = true;
1343 }
1344 
1345 function ‪fix_TU6_weapon_for_diamond( stat_name )
1346 {
1347  player = self;
1348 
1349  wepaon_for_diamond = player ‪get_challenge_stat( stat_name );
1350 
1351  if ( wepaon_for_diamond == 1 )
1352  {
1353  // valid values for X_for_diamond are 0, 2, and 3; TU5 has an issue for some challenges
1354  // where only 1 point was awarded if pistol diamond was awarded ( and some challenges where any secondary diamond camo was awwarded )
1355  // this fixes the issue by setting it to either zero or two
1356 
1357  secondary_mastery = player ‪get_challenge_stat( "secondary_mastery" );
1358 
1359  if ( secondary_mastery == 3 )
1360  {
1361  player ‪force_challenge_stat( stat_name, 2 );
1362  }
1363  else
1364  {
1365  player ‪force_challenge_stat( stat_name, 0 );
1366  }
1367  }
1368 }
1369 
1371 {
1372  player = self;
1373 
1374  group_weapon_assault = player ‪get_challenge_group_stat( "weapon_assault", "challenges" );
1375  weapons_mastery_assault = player ‪get_challenge_stat( "weapons_mastery_assault" );
1376 
1377  // earning weapons mastery on assault rifles prior to TU6 will exhibit an issue of not being able to obtain diamond camo for ar_garand
1378  // this fixes the issue by awarding ar_garand_for_diamond if weapons_mastery_assault was not obtained
1379 
1380  // 49 obtained from challenge 648 in statsmilestones3.csv
1381  if ( group_weapon_assault >= 49 && weapons_mastery_assault < 1 )
1382  {
1383  player ‪force_challenge_stat( "weapons_mastery_assault", 1 ); // intentionally forced stat here to avoid stat processing
1384 
1385  player AddPlayerStat( "ar_garand_for_diamond", 1 ); // now add stat with stat processing
1386  }
1387 }
1388 
1390 {
1391  player = self;
1392 
1393  group_weapon_pistol = player ‪get_challenge_group_stat( "weapon_pistol", "challenges" );
1394  secondary_mastery_pistol = player ‪get_challenge_stat( "secondary_mastery_pistol" );
1395 
1396  // see comments in fix_TU6_ar_garand for more related details
1397 
1398  // 21 obtained from challenge 649 in statsmilestones3.csv
1399  if ( group_weapon_pistol >= 21 && secondary_mastery_pistol < 1 )
1400  {
1401  player ‪force_challenge_stat( "secondary_mastery_pistol", 1 ); // intentionally forced stat here to avoid stat processing
1402 
1403  player AddPlayerStat( "pistol_shotgun_for_diamond", 1 ); // now add stat with stat processing
1404  }
1405 }
1406 
1407 function ‪completed_specific_challenge( target_value, challenge_name )
1408 {
1409  challenge_count = self ‪get_challenge_stat( challenge_name );
1410 
1411  return ( challenge_count >= target_value );
1412 }
1413 
1414 function ‪tally_completed_challenge( target_value, challenge_name )
1415 {
1416  return ( ( self ‪completed_specific_challenge( target_value, challenge_name ) ) ? 1 : 0 );
1417 }
1418 
1420 {
1422 }
1423 
1425 {
1426  player = self;
1427 
1428  // if mastery_perk_2 is compeleted, then no need to try to fix up
1429  mastery_perk_2 = player ‪get_challenge_stat( "mastery_perk_2" );
1430  if ( mastery_perk_2 >= 12 )
1431  return;
1432 
1433  // if earn_scorestreak_anteup has not been completed, no need to try to fix up
1434  if ( player ‪completed_specific_challenge( 200, "earn_scorestreak_anteup") == false )
1435  return;
1436 
1437  perk_2_tally = 1; // init to 1 because earn_scorestreak_anteup is already completed
1438 
1439  perk_2_tally += player ‪tally_completed_challenge( 100, "destroy_ai_scorestreak_coldblooded" ); //destroy_ai_scorestreak_coldblooded
1440  perk_2_tally += player ‪tally_completed_challenge( 100, "kills_counteruav_emp_hardline" ); //kills_counteruav_emp_hardline
1441  perk_2_tally += player ‪tally_completed_challenge( 200, "kill_after_resupply" ); //kill_after_resupply
1442  perk_2_tally += player ‪tally_completed_challenge( 100, "kills_after_sprint_fasthands" ); //kills_after_sprint_fasthands
1443  perk_2_tally += player ‪tally_completed_challenge( 200, "kill_detect_tracker" ); //kill_detect_tracker
1444  //perk_2_tally += player tally_completed_challenge( 200, "earn_scorestreak_anteup" ); //earn_scorestreak_anteup
1445  perk_2_tally += player ‪tally_completed_challenge( 10, "earn_5_scorestreaks_anteup" ); //earn_5_scorestreaks_anteup
1446  perk_2_tally += player ‪tally_completed_challenge( 25, "kill_scavenger_tracker_resupply" ); //kill_scavenger_tracker_resupply
1447  perk_2_tally += player ‪tally_completed_challenge( 25, "kill_hardwired_coldblooded" ); //kill_hardwired_coldblooded
1448  perk_2_tally += player ‪tally_completed_challenge( 25, "kill_anteup_overclock_scorestreak_specialist" ); //kill_anteup_overclock_scorestreak_specialist
1449  perk_2_tally += player ‪tally_completed_challenge( 50, "kill_fasthands_gungho_sprint" ); //kill_fasthands_gungho_sprint
1450  perk_2_tally += player ‪tally_completed_challenge( 50, "kill_tracker_sixthsense" ); //kill_tracker_sixthsense
1451 
1452  if ( mastery_perk_2 < perk_2_tally )
1453  {
1454  // award "mastery_perk_2"
1455  player AddPlayerStat( "mastery_perk_2", 1 );
1456  }
1457 }
1458 
1459 function ‪getBaseWeapon( weapon )
1460 {
1461  // TODO: need to get weapon stat name available from script (and make sure all stat names are populated properly for weapons)
1462  base_weapon_param = [[ level.get_base_weapon_param ]]( weapon ); // we have a "root" weapon after this executes
1463  base_weapon_param_name = ‪str_strip_lh_or_dw( base_weapon_param.name );
1464  base_weapon_param_name = ‪str_strip_lh_from_crossbow( base_weapon_param_name ); // unique case because of poor naming convention
1465  return GetWeapon( GetRefFromItemIndex( GetBaseWeaponItemIndex( GetWeapon( base_weapon_param_name ) ) ) );
1466 }
1467 
1469 {
1470  if ( StrEndsWith( str, "crossbowlh" ) )
1471  {
1472  return GetSubStr( str, 0, str.size - 2 );
1473  }
1474 
1475  return str;
1476 }
1477 
1478 function ‪str_strip_lh_or_dw( str )
1479 {
1480  if ( StrEndsWith( str, "_lh" ) || StrEndsWith( str, "_dw" ) )
1481  {
1482  return GetSubStr( str, 0, str.size - 3 );
1483  }
1484 
1485  return str;
1486 }
1487 
1488 function ‪checkKillStreak5( baseWeapon, player )
1489 {
1490  if ( isdefined( player.weaponKillsThisSpawn[ baseWeapon ] ) )
1491  {
1492  player.weaponKillsThisSpawn[ baseWeapon ]++;
1493  if ( ( player.weaponKillsThisSpawn[ baseWeapon ] ) % 5 == 0 )
1494  {
1495  player AddWeaponStat( baseWeapon, "killstreak_5", 1 );
1496  }
1497  }
1498  else
1499  {
1500  player.weaponKillsThisSpawn[ baseWeapon ] = 1;
1501  }
1502 }
1503 
1504 function ‪checkDualWield( baseWeapon, player, attacker, time, attackerWasSprinting, attacker_sprint_end )
1505 {
1506  // note: check weapon.isDualWield and weaponPurchased before calling checkDualWield for challenges.
1507  if ( attackerWasSprinting || ( attacker_sprint_end + 1000 > time ) )
1508  {
1510  {
1511  player AddPlayerStat( "kills_sprinting_dual_wield_and_gung_ho", 1 );
1512  }
1513  }
1514 }
1515 
1516 function ‪challengeGameEndMP( data )
1517 {
1518  player = data.player;
1519  winner = data.winner;
1520 
1521  if ( !isdefined( player ) )
1522  return;
1523 
1524  if ( ‪endedEarly( winner ) )
1525  return;
1526 
1527  if ( level.teambased )
1528  {
1529  winnerScore = game["teamScores"][winner];
1530  loserScore = ‪getLosersTeamScores( winner );
1531  }
1532 
1533  mostKillsLeastDeaths = true;
1534 
1535  for ( index = 0; index < level.placement["all"].size; index++ )
1536  {
1537  if ( level.placement["all"][index].deaths < player.deaths )
1538  {
1539  mostKillsLeastDeaths = false;
1540  }
1541  if ( level.placement["all"][index].kills > player.kills )
1542  {
1543  mostKillsLeastDeaths = false;
1544  }
1545  }
1546 
1547  if ( mostKillsLeastDeaths && player.kills > 0 && level.placement["all"].size > 3 )
1548  {
1549  if ( level.teambased )
1550  {
1551  playerIsWinner = ( player.team === winner );
1552  }
1553  else
1554  {
1555  // see if in top 3
1556  playerIsWinner = ( ( level.placement["all"][0] === winner ) || ( level.placement["all"][1] === winner ) || ( level.placement["all"][2] === winner ) );
1557  }
1558 
1559  if ( playerIsWinner )
1560  {
1561  player AddPlayerStat( "most_kills_least_deaths", 1 );
1562  }
1563  }
1564 }
1565 
1566 function ‪killedBaseOffender( objective, weapon )
1567 {
1568  self endon( "disconnect" );
1569  self AddPlayerStatWithGameType( "defends", 1 ); // awards the player for being a "defender" as they killed an offender
1570 
1571  self.challenge_offenderkillcount++;
1572 
1573  if ( !isdefined( self.challenge_objectiveOffensive ) || self.challenge_objectiveOffensive != objective )
1574  {
1575  self.challenge_objectiveOffensiveKillcount = 0;
1576  }
1577 
1578  self.challenge_objectiveOffensiveKillcount++;
1579  self.challenge_ObjectiveOffensive = objective;
1580 
1581  killstreak = ‪killstreaks::get_from_weapon( weapon );
1582 
1583  if ( isdefined( killstreak ) )
1584  {
1585  switch ( killstreak )
1586  {
1587  case "planemortar":
1588  case "inventory_planemortar":
1589  case "remote_missile":
1590  case "inventory_remote_missile":
1591  case "drone_strike":
1592  case "inventory_drone_strike":
1593  self.challenge_offenderProjectileMultiKillcount++;
1594  break;
1595  case "helicopter_comlink":
1596  case "inventory_helicopter_comlink":
1597  self.challenge_offenderComlinkKillcount++;
1598  break;
1599  case "combat_robot":
1600  case "inventory_combat_robot":
1601  self AddPlayerStat( "kill_attacker_with_robot_or_tank", 1 );
1602  break;
1603  case "inventory_autoturret":
1604  case "autoturret":
1605  self.challenge_offenderSentryTurretKillCount++;
1606  self AddPlayerStat( "kill_attacker_with_robot_or_tank", 1 );
1607  break;
1608  }
1609  }
1610 
1611  if ( self.challenge_offenderComlinkKillcount == 2 )
1612  {
1613  self AddPlayerStat( "kill_2_attackers_with_comlink", 1 );
1614  }
1615 
1616  if ( self.challenge_objectiveOffensiveKillcount > 4 )
1617  {
1618  self AddPlayerStatWithGameType( "multikill_5_attackers", 1 );
1619  self.challenge_objectiveOffensiveKillcount = 0;
1620  }
1621 
1622  if ( self.challenge_offenderSentryTurretKillCount > 2 )
1623  {
1624  self AddPlayerStat( "multikill_3_attackers_ai_tank", 1 );
1625  self.challenge_offenderSentryTurretKillCount = 0;
1626  }
1627 
1628  self ‪util::player_contract_event( "offender_kill" );
1629 
1630  self ‪waitTillTimeoutOrDeath( 4.0 );
1631 
1632  if ( self.challenge_offenderkillcount > 1 )
1633  {
1634  self AddPlayerStat( "double_kill_attackers", 1 );
1635  }
1636 
1637  self.challenge_offenderkillcount = 0;
1638 
1639  if ( self.challenge_offenderProjectileMultiKillcount >= 2 )
1640  {
1641  self AddPlayerStat( "multikill_2_objective_scorestreak_projectile", 1 );
1642  }
1643 
1644  self.challenge_offenderProjectileMultiKillcount = 0;
1645 }
1646 
1647 function ‪killedBaseDefender( objective )
1648 {
1649  self endon( "disconnect" );
1650  self AddPlayerStatWithGameType( "offends", 1 ); // awards the player for being an "offender" as they killed a defender
1651 
1652  if ( !isdefined( self.challenge_objectiveDefensive ) || self.challenge_objectiveDefensive != objective )
1653  {
1654  self.challenge_objectiveDefensiveKillcount = 0;
1655  }
1656 
1657  self.challenge_objectiveDefensiveKillcount++;
1658  self.challenge_ObjectiveDefensive = objective;
1659 
1660 
1661  self.challenge_defenderkillcount++;
1662 
1663  self ‪util::player_contract_event( "defender_kill" );
1664 
1665  self ‪waitTillTimeoutOrDeath( 4.0 );
1666 
1667  if ( self.challenge_defenderkillcount > 1 )
1668  {
1669  self AddPlayerStat( "double_kill_defenders", 1 );
1670  }
1671 
1672  self.challenge_defenderkillcount = 0;
1673 }
1674 
1676 {
1677  self endon( "death" );
1678  wait( ‪timeout );
1679 }
1680 
1682 {
1683  if ( level.gameType == "dm" )
1684  {
1685  self AddPlayerStat( "killstreak_30_no_scorestreaks", 1 );
1686  }
1687 }
1688 
1690 {
1691  if ( isdefined( self.heroAbility ) && self.pers["canSetSpecialistStat"] )
1692  {
1693  switch( self.heroAbility.name )
1694  {
1695  case "gadget_camo":
1696  case "gadget_armor":
1697  case "gadget_clone":
1698  case "gadget_speed_burst":
1699  case "gadget_vision_pulse":
1700  case "gadget_flashback":
1701  case "gadget_heat_wave":
1702  self thread ‪checkForHeroSurvival();
1703  break;
1704  }
1705  }
1706 }
1707 
1708 
1710 {
1711  self endon ("death");
1712  self endon ("disconnect");
1713 
1714  self ‪util::waittill_any_timeout( 8.0, "challenge_survived_from_death", "disconnect" );
1715 
1716  self AddPlayerStat( "death_dodger", 1 );
1717 }
1718 
1719 
1721 {
1722  empOwner = self ‪emp::EnemyEMPOwner();
1723  if ( isdefined( empOwner ) && IsPlayer( empOwner ) )
1724  {
1725  empOwner AddPlayerStat( "end_enemy_specialist_ability_with_emp", 1 );
1726  return;
1727  }
1728 
1729  if ( isdefined( self.empStartTime ) && self.empStartTime > ( getTime() - 100 ) )
1730  {
1731  if ( isdefined(self.empedBy) && IsPlayer( self.empedBy ) )
1732  {
1733  self.empedBy AddPlayerStat( "end_enemy_specialist_ability_with_emp", 1 );
1734  return;
1735  }
1736  }
1737 }
1738 
1739 
1740 
1742 {
1743  self.challenge_offenderComlinkKillcount = 0;
1744 }
1745 
1746 
1747 function ‪combat_robot_damage( eAttacker, combatRobotOwner )
1748 {
1749  if ( !isdefined( eAttacker.challenge_combatRobotAttackClientID[combatRobotOwner.clientid] ) )
1750  {
1751  eAttacker.challenge_combatRobotAttackClientID[combatRobotOwner.clientid] = spawnstruct();
1752  }
1753 }
1754 
1755 
1757 {
1758  if ( level.activePlayerEMPs[ self.entNum ] > 0 )
1759  {
1760  self AddWeaponStat( GetWeapon( "emp" ), "kills_while_active", 1 );
1761  }
1762 
1763  if ( ( level.activePlayerUAVs[ self.entNum ] > 0 ) && ( !isdefined( level.forceradar ) || level.forceRadar == false ) )
1764  {
1765  self AddWeaponStat( GetWeapon( "uav" ), "kills_while_active", 1 );
1766  }
1767 
1768  if ( level.activePlayerSatellites[ self.entNum ] > 0 )
1769  {
1770  self AddWeaponStat( GetWeapon( "satellite" ), "kills_while_active", 1 );
1771  }
1772 
1773  if ( level.activePlayerCounterUAVs[ self.entNum ] > 0 )
1774  {
1775  self AddWeaponStat( GetWeapon( "counteruav" ), "kills_while_active", 1 );
1776  }
1777 
1778  if ( isdefined( victim.lastMicrowavedBy ) && victim.lastMicrowavedBy == self )
1779  {
1780  self AddWeaponStat( GetWeapon( "microwave_turret" ), "kills_while_active", 1 );
1781  }
1782 }
1783 
1785 {
1786  self endon("disconnect");
1787  self endon("killMonitorReloads");
1788 
1789  while(1)
1790  {
1791  self waittill("reload");
1792  currentWeapon = self getCurrentWeapon();
1793  if ( currentWeapon == level.weaponNone )
1794  {
1795  continue;
1796  }
1797 
1798  time = getTime();
1799  self.lastReloadTime = time;
1800 
1801  if ( WeaponHasAttachment( currentWeapon, "fastreload" ) ) // aka fastmags or Fast Mags
1802  {
1803  self.lastFastReloadTime = time;
1804  }
1805  }
1806 }
1807 
1809 {
1810  self notify( "grenadeTrackingStart" );
1811 
1812  self endon( "grenadeTrackingStart" );
1813  self endon( "disconnect" );
1814 
1815  for (;;)
1816  {
1817  self waittill ( "grenade_fire", grenade, weapon );
1818 
1819  if ( !isdefined( grenade ) )
1820  {
1821  continue;
1822  }
1823 
1824  if ( weapon.rootweapon.name == "hatchet" )
1825  {
1826  self.challenge_hatchetTossCount++;
1827  grenade.challenge_hatchetTossCount = self.challenge_hatchetTossCount;
1828  }
1829  if ( self issprinting() )
1830  {
1831  grenade.ownerWasSprinting = true;
1832  }
1833  }
1834 }
1835 
1837 {
1838  self endon( "death" );
1839  self endon( "disconnect" );
1840  self endon( "joined_team" );
1841  self endon( "joined_spectators" );
1842 
1843  while( 1 )
1844  {
1845  self.heroWeaponKillsThisActivation = 0;
1846 
1847  self waittill( "weapon_change_complete" );
1848  }
1849 }
1850 
1851 function ‪longDistanceKillMP( weapon )
1852 {
1853  self AddWeaponStat( weapon, "longshot_kill", 1 );
1854  if ( self weaponHasAttachmentAndUnlocked( weapon, "extbarrel", "suppressed" ) )
1855  {
1856  if ( self GetWeaponOptic( weapon ) != "" )
1857  {
1858  self addPlayerStat( "long_shot_longbarrel_suppressor_optic", 1 );
1859  }
1860  }
1861 }
1862 
1863 
1865 {
1866  if ( self IsBonusCardActive( ‪BONUSCARD_TWO_TACTICALS, self.class_num ) && self ‪util::is_item_purchased( "bonuscard_two_tacticals" ) )
1867  {
1868  self AddPlayerStat( "capture_objective_tactician", 1 );
1869  }
1870 }
1871 
1873 {
1874  player = self;
1875  player endon( "death" );
1876  player endon( "disconnect" );
1877  player endon( "joined_team" );
1878  player endon( "joined_spectators" );
1879 
1880  self.wallRanTwoOppositeWallsNoGround = false;
1881 
1882  while ( 1 )
1883  {
1884  if ( !player IsWallRunning() )
1885  {
1886  self.wallRanTwoOppositeWallsNoGround = false;
1887  player waittill( "wallrun_begin" );
1888  }
1889 
1890  ret = player ‪util::waittill_any_return( "jump_begin", "wallrun_end", "disconnect", "joined_team", "joined_spectators" );
1891  if ( ret == "wallrun_end" )
1892  continue;
1893 
1894  wall_normal = player GetWallRunWallNormal();
1895 
1896  player waittill( "jump_end" );
1897 
1898  if ( !player IsWallRunning() )
1899  continue;
1900 
1901  last_wall_normal = wall_normal;
1902  wall_normal = player GetWallRunWallNormal();
1903 
1904  opposite_walls = ( VectorDot( wall_normal, last_wall_normal ) < -0.5 );
1905  if ( !opposite_walls )
1906  continue;
1907 
1908  player.wallRanTwoOppositeWallsNoGround = true;
1909 
1910  while ( player IsWallRunning() )
1911  {
1912  ret = player ‪util::waittill_any_return( "jump_end", "wallrun_end", "disconnect", "joined_team", "joined_spectators" );
1913 
1914  if ( ret == "wallrun_end" )
1915  break;
1916  }
1917 
1919 
1920  while ( !player IsOnGround() )
1921  {
1923  }
1924  }
1925 }
1926 
1927 function ‪processSpecialistChallenge( statName )
1928 {
1929  if ( self.pers["canSetSpecialistStat"] )
1930  {
1931  self AddSpecialistStat( statName, 1 );
1932  }
1933 }
1934 
1935 
1936 function ‪flakjacketProtectedMP( weapon, attacker )
1937 {
1938  if ( weapon.name == "claymore" )
1939  {
1940  self.flakJacketClaymore[ attacker.clientid ] = true;
1941  }
1942 
1943  self AddPlayerStat( "survive_with_flak", 1 );
1944  self.challenge_lastsurvivewithflakfrom = attacker;
1945  self.challenge_lastsurvivewithflaktime = getTime();
1946 }
1947 
‪has_purchased_perk_equipped
‪function has_purchased_perk_equipped(ref)
Definition: util_shared.gsc:4069
‪getBaseWeapon
‪function getBaseWeapon(weapon)
Definition: _challenges.gsc:1459
‪has_hacker_perk_purchased_and_equipped
‪function has_hacker_perk_purchased_and_equipped()
Definition: util_shared.gsc:4110
‪timeout
‪function timeout(n_time, func, arg1, arg2, arg3, arg4, arg5, arg6)
Definition: util_shared.csc:762
‪on_player_connect
‪function on_player_connect()
Definition: _challenges.gsc:63
‪killedBaseDefender
‪function killedBaseDefender(objective)
Definition: _challenges.gsc:1647
‪getWeaponClass
‪function getWeaponClass(weapon)
Definition: util_shared.gsc:2676
‪BONUSCARD_PERK_1_GREED
‪#define BONUSCARD_PERK_1_GREED
Definition: _bonuscard.gsh:9
‪checkDualWield
‪function checkDualWield(baseWeapon, player, attacker, time, attackerWasSprinting, attacker_sprint_end)
Definition: _challenges.gsc:1504
‪calledInComlinkChopper
‪function calledInComlinkChopper()
Definition: _challenges.gsc:1741
‪heroAbilityActivateNearDeath
‪function heroAbilityActivateNearDeath()
Definition: _challenges.gsc:1689
‪isPistol
‪function isPistol(weapon)
Definition: _weapon_utils.gsc:7
‪__init__
‪function __init__()
Definition: _challenges.gsc:31
‪killedBaseOffender
‪function killedBaseOffender(objective, weapon)
Definition: _challenges.gsc:1566
‪has_awareness_perk_purchased_and_equipped
‪function has_awareness_perk_purchased_and_equipped()
Definition: util_shared.gsc:4147
‪checkForHeroSurvival
‪function checkForHeroSurvival()
Definition: _challenges.gsc:1709
‪BONUSCARD_PERK_2_GREED
‪#define BONUSCARD_PERK_2_GREED
Definition: _bonuscard.gsh:10
‪endedEarly
‪function endedEarly(winner)
Definition: challenges_shared.gsc:1016
‪watchWallrun
‪function watchWallrun()
Definition: _challenges.gsc:233
‪watchSlide
‪function watchSlide()
Definition: _challenges.gsc:255
‪on_start_gametype
‪function on_start_gametype(func, obj)
Definition: callbacks_shared.csc:285
‪BONUSCARD_PRIMARY_GUNFIGHTER
‪#define BONUSCARD_PRIMARY_GUNFIGHTER
Definition: _bonuscard.gsh:4
‪player_contract_event
‪function player_contract_event(event_name, param1=undefined, param2=undefined, param3=undefined)
Definition: _util.gsc:1161
‪start_gametype
‪function start_gametype()
Definition: _challenges.gsc:40
‪capturedObjectiveFunction
‪function capturedObjectiveFunction()
Definition: _challenges.gsc:1864
‪waittill_any_return
‪function waittill_any_return(string1, string2, string3, string4, string5, string6, string7)
Definition: util_shared.csc:212
‪has_cold_blooded_perk_purchased_and_equipped
‪function has_cold_blooded_perk_purchased_and_equipped()
Definition: util_shared.gsc:4115
‪get_challenge_group_stat
‪function get_challenge_group_stat(group_name, stat_name)
Definition: _challenges.gsc:1318
‪checkKillStreak5
‪function checkKillStreak5(baseWeapon, player)
Definition: _challenges.gsc:1488
‪initChallengeData
‪function initChallengeData()
Definition: _challenges.gsc:72
‪BONUSCARD_DANGER_CLOSE
‪#define BONUSCARD_DANGER_CLOSE
Definition: _bonuscard.gsh:12
‪TU7_fix_mastery_perk_2
‪function TU7_fix_mastery_perk_2()
Definition: _challenges.gsc:1424
‪force_challenge_stat
‪function force_challenge_stat(stat_name, stat_value)
Definition: _challenges.gsc:1311
‪monitorGrenadeFire
‪function monitorGrenadeFire()
Definition: _challenges.gsc:1808
‪on_player_spawn
‪function on_player_spawn()
Definition: _challenges.gsc:1298
‪BONUSCARD_SECONDARY_GUNFIGHTER
‪#define BONUSCARD_SECONDARY_GUNFIGHTER
Definition: _bonuscard.gsh:7
‪has_ghost_perk_purchased_and_equipped
‪function has_ghost_perk_purchased_and_equipped()
Definition: util_shared.gsc:4098
‪BONUSCARD_OVERKILL
‪#define BONUSCARD_OVERKILL
Definition: _bonuscard.gsh:8
‪has_jetquiet_perk_purchased_and_equipped
‪function has_jetquiet_perk_purchased_and_equipped()
Definition: util_shared.gsc:4142
‪str_strip_lh_or_dw
‪function str_strip_lh_or_dw(str)
Definition: _challenges.gsc:1478
‪monitorReloads
‪function monitorReloads()
Definition: _challenges.gsc:1784
‪EnemyEMPOwner
‪function EnemyEMPOwner()
Definition: _emp.gsc:392
‪waittill_any_timeout
‪function waittill_any_timeout(n_timeout, string1, string2, string3, string4, string5)
Definition: util_shared.csc:423
‪SQR
‪#define SQR(__var)
Definition: shared.gsh:293
‪callbackEndHeroSpecialistEMP
‪function callbackEndHeroSpecialistEMP()
Definition: _challenges.gsc:1720
‪getActiveKillstreaks
‪function getActiveKillstreaks()
Definition: _killstreaks.gsc:2834
‪registerChallengesCallback
‪function registerChallengesCallback(callback, func)
Definition: challenges_shared.gsc:166
‪has_ninja_perk_purchased_and_equipped
‪function has_ninja_perk_purchased_and_equipped()
Definition: util_shared.gsc:4154
‪longDistanceKillMP
‪function longDistanceKillMP(weapon)
Definition: _challenges.gsc:1851
‪has_gung_ho_perk_purchased_and_equipped
‪function has_gung_ho_perk_purchased_and_equipped()
Definition: util_shared.gsc:4125
‪has_blind_eye_perk_purchased_and_equipped
‪function has_blind_eye_perk_purchased_and_equipped()
Definition: util_shared.gsc:4093
‪challengeKills
‪function challengeKills(data)
Definition: _challenges.gsc:302
‪canProcessChallenges
‪function canProcessChallenges()
Definition: challenges_shared.gsc:133
‪processSpecialistChallenge
‪function processSpecialistChallenge(statName)
Definition: _challenges.gsc:1927
‪IDFLAGS_PENETRATION
‪#define IDFLAGS_PENETRATION
Definition: shared.gsh:414
‪is_item_purchased
‪function is_item_purchased(ref)
Definition: util_shared.gsc:4063
‪completed_specific_challenge
‪function completed_specific_challenge(target_value, challenge_name)
Definition: _challenges.gsc:1407
‪BONUSCARD_TWO_TACTICALS
‪#define BONUSCARD_TWO_TACTICALS
Definition: _bonuscard.gsh:13
‪watchSwimming
‪function watchSwimming()
Definition: _challenges.gsc:211
‪watchSprint
‪function watchSprint()
Definition: _challenges.gsc:278
‪on_spawned
‪function on_spawned(func, obj)
Definition: callbacks_shared.csc:245
‪BONUSCARD_PERK_3_GREED
‪#define BONUSCARD_PERK_3_GREED
Definition: _bonuscard.gsh:11
‪watchScavengeLethal
‪function watchScavengeLethal()
Definition: _challenges.gsc:153
‪fix_challenge_stats_on_spawn
‪function fix_challenge_stats_on_spawn()
Definition: _challenges.gsc:1323
‪HasIndexActiveCounterUAV
‪function HasIndexActiveCounterUAV(team_or_entnum)
Definition: _counteruav.gsc:536
‪has_scavenger_perk_purchased_and_equipped
‪function has_scavenger_perk_purchased_and_equipped()
Definition: util_shared.gsc:4135
‪watchJump
‪function watchJump()
Definition: _challenges.gsc:189
‪get_from_weapon
‪function get_from_weapon(weapon)
Definition: _killstreaks.gsc:806
‪fix_TU6_pistol_shotgun
‪function fix_TU6_pistol_shotgun()
Definition: _challenges.gsc:1389
‪has_fast_hands_perk_purchased_and_equipped
‪function has_fast_hands_perk_purchased_and_equipped()
Definition: util_shared.gsc:4130
‪str_strip_lh_from_crossbow
‪function str_strip_lh_from_crossbow(str)
Definition: _challenges.gsc:1468
‪fix_TU6_weapon_for_diamond
‪function fix_TU6_weapon_for_diamond(stat_name)
Definition: _challenges.gsc:1345
‪get_challenge_stat
‪function get_challenge_stat(stat_name)
Definition: _challenges.gsc:1306
‪HasUAV
‪function HasUAV(team_or_entnum)
Definition: _uav.gsc:304
‪spawnWatcher
‪function spawnWatcher()
Definition: _challenges.gsc:108
‪combat_robot_damage
‪function combat_robot_damage(eAttacker, combatRobotOwner)
Definition: _challenges.gsc:1747
‪fix_TU6_ar_garand
‪function fix_TU6_ar_garand()
Definition: _challenges.gsc:1370
‪watchWallRunTwoOppositeWallsNoGround
‪function watchWallRunTwoOppositeWallsNoGround()
Definition: _challenges.gsc:1872
‪has_tactical_mask_purchased_and_equipped
‪function has_tactical_mask_purchased_and_equipped()
Definition: util_shared.gsc:4103
‪has_hard_wired_perk_purchased_and_equipped
‪function has_hard_wired_perk_purchased_and_equipped()
Definition: util_shared.gsc:4120
‪getLosersTeamScores
‪function getLosersTeamScores(winner)
Definition: challenges_shared.gsc:1033
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪tally_completed_challenge
‪function tally_completed_challenge(target_value, challenge_name)
Definition: _challenges.gsc:1414
‪watchWeaponChangeComplete
‪function watchWeaponChangeComplete()
Definition: _challenges.gsc:1836
‪isPunch
‪function isPunch(weapon)
Definition: _weapon_utils.gsc:28
‪addSpecialistUsedStatOnConnect
‪function addSpecialistUsedStatOnConnect()
Definition: _challenges.gsc:86
‪killstreak_30_noscorestreaks
‪function killstreak_30_noscorestreaks()
Definition: _challenges.gsc:1681
‪is_looking_at
‪function is_looking_at(ent_or_org, n_dot_range=0.67, do_trace=false, v_offset)
Definition: util_shared.gsc:1448
‪hasTacticalMask
‪function hasTacticalMask(player)
Definition: _loadout.gsc:1386
‪KILL_NEAR_PLANT_ENGINEER_HARDWIRED_CLOSE_ENOUGH_DISTANCE
‪#define KILL_NEAR_PLANT_ENGINEER_HARDWIRED_CLOSE_ENOUGH_DISTANCE
Definition: _challenges.gsc:25
‪challengeGameEndMP
‪function challengeGameEndMP(data)
Definition: _challenges.gsc:1516
‪trackKillstreakSupportKills
‪function trackKillstreakSupportKills(victim)
Definition: _challenges.gsc:1756
‪watchDoublejump
‪function watchDoublejump()
Definition: _challenges.gsc:167
‪on_connect
‪function on_connect()
Definition: _arena.gsc:20
‪BONUSCARD_PRIMARY_GUNFIGHTER_3
‪#define BONUSCARD_PRIMARY_GUNFIGHTER_3
Definition: _bonuscard.gsh:6
‪waitTillTimeoutOrDeath
‪function waitTillTimeoutOrDeath(timeout)
Definition: _challenges.gsc:1675
‪TU7_fix_100_percenter
‪function TU7_fix_100_percenter()
Definition: _challenges.gsc:1419
‪flakjacketProtectedMP
‪function flakjacketProtectedMP(weapon, attacker)
Definition: _challenges.gsc:1936
‪isFlashbanged
‪function isFlashbanged()
Definition: _util.gsc:703
‪isMeleeMOD
‪function isMeleeMOD(mod)
Definition: _weapon_utils.gsc:23
‪WAIT_SERVER_FRAME
‪#define WAIT_SERVER_FRAME
Definition: shared.gsh:265