‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_contracts.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\scoreevents_shared;
7 #using scripts\shared\system_shared;
8 #using scripts\shared\util_shared;
9 #using scripts\shared\weapons\_weapon_utils;
10 
11 #using scripts\mp\_util;
12 #using scripts\mp\_challenges;
13 #using scripts\mp\gametypes\_globallogic;
14 #using scripts\mp\gametypes\_globallogic_score;
15 #using scripts\mp\gametypes\_loadout;
16 
17 #insert scripts\shared\shared.gsh;
18 
19 #using scripts\mp\_util;
20 
21 #insert scripts\mp\_bonuscard.gsh;
22 #insert scripts\mp\_contracts.gsh;
23 
24 #define DEFAULT_DAILY_CRYPTOKEYS 10 // look for dvar loot_cryptokeyCost
25 #define DEFAULT_WEEKLY_CRYPTOKEYS 30 // look for dvar loot_cryptokeyCost
26 #define DEFAULT_CRYPTOKEY_LOOTXP 100
27 
28 #define ATTACHMENT_COUNT_FOR_LOADED_WEAPON_KILL 4
29 
30 #define MAX_CONTRACT_SLOTS 10 // should coincide with contracts array size on mp_stats.ddl
31 #define FIRST_UNASSIGNED_CONTRACT_SLOT 3
32 #define DEFAULT_DEBUG_CONTRACT_SLOT MAX_CONTRACT_SLOTS - 1
33 
34 // contract string table and columns
35 #define CONTRACT_TABLE "gamedata/tables/mp/mp_contractTable.csv"
36 #define INDEX_COL 0
37 #define TARGET_VALUE_COL 2
38 #define NAME_STRING_COL 3
39 #define TITLE_OVERRIDE_COL 4
40 #define CONTRACT_TYPE 5
41 #define CK_COST_COL 6
42 #define CALLING_CARD_STAT_COL 7 // mp_stats.ddl, PlayerStatsList[ <stat_name> ]
43 #define WEAPON_CAMO_STAT_COL 8 // mp_stats.ddl, PlayerStatsList[ <stat_name> ]
44 #define ABSOLUTE_STAT_PATH_COL 9 // mp_stats.ddl
45 
46 // table index values from mp_contractTable.csv
47 
48 // weekly contracts
49 #define BIG_TOTAL_WINS_INDEX 1
50 #define BIG_OBJECTIVE_WINS_INDEX 2
51 #define BIG_MEDALS_SPECIALIST_ABILITIES_INDEX 3
52 #define BIG_KILLS_INDEX 4
53 #define BIG_SCORE_INDEX 5
54 #define ATTACKER_DEFENDER_KILLS_INDEX 6
55 #define BIG_KILLS_SPECIALIST_WEAPON_INDEX 7
56 #define BIG_KILLS_KILLSTREAK_INDEX 8
57 
58 // daily contracts
59 #define TOTAL_WINS_INDEX 1000
60 #define ARENA_WINS_INDEX 1001
61 #define TDM_WINS_INDEX 1002
62 #define BALL_WINS_INDEX 1003
63 #define ESCORT_WINS_INDEX 1004
64 #define CONF_WINS_INDEX 1005
65 #define SD_WINS_INDEX 1006
66 #define KOTH_WINS_INDEX 1007
67 #define DOM_WINS_INDEX 1008
68 #define SCORE_INDEX 1009
69 #define KILLS_KILLSTREAK_INDEX 1010
70 #define KILLSTREAK_SCORE_INDEX 1011
71 #define KILLS_SPECIALIST_WEAPON_INDEX 1012
72 #define MEDALS_SPECIALIST_ABILITIES_INDEX 1013
73 #define SPECIALIST_KILLED_INDEX 1014
74 #define KILLS_INDEX 1015
75 #define HEADSHOTS_INDEX 1016
76 #define KILLED_DEFENDER_INDEX 1017
77 #define KILLED_ATTACKER_INDEX 1018
78 #define AR_KILL_INDEX 1019
79 #define SMG_KILL_INDEX 1020
80 #define SNIPER_KILL_INDEX 1021
81 #define LMG_KILL_INDEX 1022
82 #define SHOTGUN_KILL_INDEX 1023
83 #define PISTOL_KILL_INDEX 1024
84 #define LOADED_WEAPON_KILL_INDEX 1025
85 #define CTF_WINS_INDEX 1026
86 #define DEM_WINS_INDEX 1027
87 #define DM_WINS_INDEX 1028
88 #define CLEAN_WINS_INDEX 1029
89 
90 // special contracts
91 #define HUGE_SMG_KILL_INDEX 3000
92 #define HUGE_AR_KILL_INDEX 3001
93 #define HUGE_SHOTGUN_KILL_INDEX 3002
94 #define HUGE_LMG_KILL_INDEX 3003
95 #define HUGE_SNIPER_KILL_INDEX 3004
96 #define HUGE_MELEE_WEAPON_KILL_INDEX 3005
97 #define HUGE_KILLS_SPECIALIST_WEAPON_INDEX 3006
98 #define HUGE_TOTAL_WINS_INDEX 3007
99 #define HUGE_TOTAL_WINS_INDEX_2 3008
100 #define HUGE_TOTAL_WINS_INDEX_3 3009
101 #define HUGE_TOTAL_WINS_INDEX_GRAND_SLAM 3010
102 #define HUGE_TOTAL_WINS_INDEX_4 3011
103 #define HUGE_TOTAL_WINS_INDEX_5 3012
104 #define HUGE_TOTAL_WINS_INDEX_6 3013
105 #define HUGE_TOTAL_WINS_INDEX_7 3014
106 #define HUGE_TOTAL_WINS_INDEX_8 3015
107 
108 #namespace contracts;
109 
110 #precache( "eventstring", "mp_daily_challenge_complete" );
111 #precache( "eventstring", "mp_weekly_challenge_complete" );
112 #precache( "eventstring", "mp_special_contract_complete" );
113 
114 ‪REGISTER_SYSTEM( "contracts", &‪__init__, undefined )
115 
116 function ‪__init__()
117 {
119 }
120 
122 {
123  if ( !isdefined( level.ChallengesCallbacks ) )
124  {
125  level.ChallengesCallbacks = [];
126  }
127 
128  ‪util::init_player_contract_events(); // must always initialize
129 
130  waittillframeend;
131 
132  if ( ‪can_process_contracts() )
133  {
140 
148  ‪util::register_player_contract_event( "earned_specialist_ability_medal", &‪on_hero_ability_medal );
149 
150  // globallogic::registerOtherLootXPAwards( &award_loot_xp ); // intentionally commented out, will use mp_loot_xp_due instead for now
151  }
152 
154 }
155 
157 {
159 }
160 
162 {
164 }
165 
167 {
168  player = self;
169 
170  if ( ‪can_process_contracts() )
171  {
172  player ‪setup_player_contracts();
173  }
174 }
175 
177 {
178  if ( GetDvarInt( "contracts_enabled_mp", 1 ) == 0 ) // mp contracts kill switch
179  return false;
180 
182 }
183 
185 {
186  player = self;
187 
188  player.pers["contracts"] = [];
189 
190  // no need to setup active contracts for bots
191  if ( player ‪util::is_bot() )
192  return;
193 
194  for( slot = 0; slot < ‪MAX_CONTRACT_SLOTS; slot++ )
195  {
196  if ( ‪get_contract_stat( slot, "active" ) && !‪get_contract_stat( slot, "award_given" ) )
197  {
198  contract_index = ‪get_contract_stat( slot, "index" );
199  player.pers["contracts"][contract_index] = SpawnStruct();
200  player.pers["contracts"][contract_index].slot = slot;
201  table_row = TableLookupRowNum( ‪CONTRACT_TABLE, ‪INDEX_COL, contract_index );
202  player.pers["contracts"][contract_index].table_row = table_row;
203  player.pers["contracts"][contract_index].target_value = int( TableLookupColumnForRow( ‪CONTRACT_TABLE, table_row, ‪TARGET_VALUE_COL ) );
204  player.pers["contracts"][contract_index].calling_card_stat = TableLookupColumnForRow( ‪CONTRACT_TABLE, table_row, ‪CALLING_CARD_STAT_COL );
205  player.pers["contracts"][contract_index].weapon_camo_stat = TableLookupColumnForRow( ‪CONTRACT_TABLE, table_row, ‪WEAPON_CAMO_STAT_COL );
206  player.pers["contracts"][contract_index].absolute_stat_path = TableLookupColumnForRow( ‪CONTRACT_TABLE, table_row, ‪ABSOLUTE_STAT_PATH_COL );
207  }
208  }
209 }
210 
211 function ‪is_contract_active( challenge_index )
212 {
213  if ( !isPlayer( self ) )
214  return false;
215 
216  if ( !isdefined( self.pers["contracts"] ) )
217  return false;
218 
219  if ( !isdefined( self.pers["contracts"][challenge_index] ) )
220  return false;
221 
222  // sanity check... better than causing an SRE
223  if ( self.pers["contracts"][challenge_index].table_row == -1 )
224  return false;
225 
226  return true;
227 }
228 
229 function ‪on_hero_ability_kill( ability, victimAbility )
230 {
231  player = self;
232 
233  if ( !isdefined( player ) || !isplayer( player ) )
234  return;
235 }
236 
238 {
239  player = self;
240 
241  if ( !isdefined( player ) || !isplayer( player ) )
242  return;
243 
246 }
247 
248 function ‪on_hero_ability_multikill( killcount, ability )
249 {
250  player = self;
251 
252  if ( !isdefined( player ) || !isplayer( player ) )
253  return;
254 }
255 
256 function ‪on_hero_weapon_multikill( killcount, weapon )
257 {
258  player = self;
259 
260  if ( !isdefined( player ) || !isplayer( player ) )
261  return;
262 }
263 
264 function ‪on_player_score( delta_score )
265 {
266  self ‪add_stat( ‪SCORE_INDEX, delta_score );
267  self ‪add_stat( ‪BIG_SCORE_INDEX, delta_score );
268 }
269 
270 function ‪on_killstreak_score( delta_score, killstreak_purchased )
271 {
272  if ( killstreak_purchased )
273  {
274  self ‪add_stat( ‪KILLSTREAK_SCORE_INDEX, delta_score );
275  }
276 }
277 
278 function ‪contract_kills( data )
279 {
280  victim = data.victim;
281  attacker = data.attacker;
282  player = attacker;
283  weapon = data.weapon;
284  time = data.time;
285 
286  if ( !isdefined( weapon ) || ( weapon == level.weaponNone ) )
287  return;
288 
289  if ( !isdefined( player ) || !isplayer( player ) )
290  return;
291 
292  player ‪add_stat( ‪KILLS_INDEX );
294 
295  if ( weapon.isHeroWeapon === true )
296  {
300  }
301 
302  isKillstreak = isdefined( data.eInflictor ) && isdefined( data.eInflictor.killstreakid );
303  if ( !isKillstreak && isdefined( level.isKillstreakWeapon ) )
304  {
305  isKillstreakWeapon = [[level.isKillstreakWeapon]]( weapon );
306  }
307 
308  if ( isKillstreak || ( isKillstreakWeapon === true ) )
309  {
312  }
313 
314  statItemIndex = weapon.statIndex;
315 
316  if ( player isItemPurchased( statItemIndex ) )
317  {
318  weaponClass = ‪util::getWeaponClass( weapon );
319 
320  switch ( weaponClass ) // aka group in mp_statsTable
321  {
322  case "weapon_assault":
323  player ‪add_stat( ‪AR_KILL_INDEX );
325  break;
326 
327  case "weapon_smg":
328  player ‪add_stat( ‪SMG_KILL_INDEX );
330  break;
331 
332  case "weapon_sniper":
335  break;
336 
337  case "weapon_lmg":
338  player ‪add_stat( ‪LMG_KILL_INDEX );
340  break;
341 
342  case "weapon_cqb":
345  break;
346 
347  case "weapon_pistol":
349  break;
350 
351  case "weapon_knife":
353  break;
354 
355  default:
356  break;
357  }
358 
359  total_unlocked = player GetTotalUnlockedWeaponAttachments( weapon );
360  if ( total_unlocked >= ‪ATTACHMENT_COUNT_FOR_LOADED_WEAPON_KILL )
361  {
363  }
364  }
365 }
366 
367 function ‪add_stat( contract_index, delta )
368 {
369  if ( self ‪is_contract_active( contract_index ) )
370  {
371  self ‪add_active_stat( contract_index, delta );
372  }
373 }
374 
375 function ‪add_active_stat( contract_index, delta = 1 )
376 {
377  slot = self.pers["contracts"][contract_index].slot;
378  target_value = self.pers["contracts"][contract_index].target_value;
379 
380  old_progress = ‪get_contract_stat( slot, "progress" );
381  new_progress = old_progress + delta;
382 
383  if ( new_progress > target_value )
384  new_progress = target_value;
385 
386  if ( new_progress != old_progress )
387  self ‪set_contract_stat( slot, "progress", new_progress );
388 
389  just_completed = false;
390  if ( old_progress < target_value && target_value <= new_progress )
391  {
392  just_completed = true;
393 
394  // notify contract achieved
395  event = &"mp_weekly_challenge_complete";
396  display_rewards = false;
397 
398  if ( slot == ‪MP_CONTRACT_DAILY_SLOT )
399  {
400  event = &"mp_daily_challenge_complete";
401  display_rewards = true;
402 
404  self ‪set_contract_stat( ‪MP_CONTRACT_DAILY_SLOT, "award_given", 1 );
405  }
406  else if ( slot == ‪MP_CONTRACT_WEEKLY_SLOT_A || slot == ‪MP_CONTRACT_WEEKLY_SLOT_B )
407  {
408  other_slot = ‪MP_CONTRACT_WEEKLY_SLOT_B;
409  if ( slot == ‪MP_CONTRACT_WEEKLY_SLOT_B )
410  {
411  other_slot = ‪MP_CONTRACT_WEEKLY_SLOT_A;
412  }
413 
414  foreach ( c_index,c_data in self.pers["contracts"] )
415  {
416  if ( c_data.slot == other_slot )
417  {
418  if ( c_data.target_value <= ‪get_contract_stat( other_slot, "progress" ) )
419  {
420  display_rewards = true;
421 
423  self ‪set_contract_stat( ‪MP_CONTRACT_WEEKLY_SLOT_A, "award_given", 1 );
424  self ‪set_contract_stat( ‪MP_CONTRACT_WEEKLY_SLOT_B, "award_given", 1 );
425  }
426 
427  break;
428  }
429  }
430  }
431  else if ( slot == ‪MP_CONTRACT_SPECIAL_SLOT )
432  {
433  event = &"mp_special_contract_complete";
434  display_rewards = true;
435 
436  absolute_stat_path = self.pers["contracts"][contract_index].absolute_stat_path;
437  if ( absolute_stat_path != "" )
438  {
439  ‪set_contract_award_stat_from_path( absolute_stat_path, true );
440  }
441 
442  calling_card_stat = self.pers["contracts"][contract_index].calling_card_stat;
443  if ( calling_card_stat != "" )
444  {
445  ‪set_contract_award_stat( "calling_card", calling_card_stat );
446  }
447 
448  weapon_camo_stat = self.pers["contracts"][contract_index].weapon_camo_stat;
449  if ( weapon_camo_stat != "" )
450  {
451  ‪set_contract_award_stat( "weapon_camo", weapon_camo_stat );
452  }
453 
454  self ‪set_contract_stat( ‪MP_CONTRACT_SPECIAL_SLOT, "award_given", 1 );
455  }
456 
457 
458  self LUINotifyEvent( event, 2, contract_index, display_rewards );
459  }
460 }
461 
462 function ‪get_contract_stat( slot, stat_name )
463 {
464  return self GetDStat( "contracts", slot, stat_name );
465 }
466 
467 function ‪set_contract_stat( slot, stat_name, stat_value )
468 {
469  return self SetDStat( "contracts", slot, stat_name, stat_value );
470 }
471 
472 function ‪set_contract_award_stat( award_type, stat_name, stat_value = 1 )
473 {
474  // award_type is unused for now as we use PlayerStatsList for now
475 
476  return self AddPlayerStat( stat_name, stat_value );
477 }
478 
479 function ‪set_contract_award_stat_from_path( stat_path, stat_value )
480 {
481  stat_path_array = StrTok( stat_path, " " );
482 
483  string_path_1 = "";
484  string_path_2 = "";
485  string_path_3 = "";
486  string_path_4 = "";
487  string_path_5 = "";
488 
489  switch( stat_path_array.size )
490  {
491  case 5:
492  string_path_5 = stat_path_array[4];
493  if( StrIsNumber( string_path_5 ) )
494  {
495  string_path_5 = Int( string_path_5 );
496  }
497  case 4:
498  string_path_4 = stat_path_array[3];
499  if( StrIsNumber( string_path_4 ) )
500  {
501  string_path_4 = Int( string_path_4 );
502  }
503  case 3:
504  string_path_3 = stat_path_array[2];
505  if( StrIsNumber( string_path_3 ) )
506  {
507  string_path_3 = Int( string_path_3 );
508  }
509  case 2:
510  string_path_2 = stat_path_array[1];
511  if( StrIsNumber( string_path_2 ) )
512  {
513  string_path_2 = Int( string_path_2 );
514  }
515  case 1:
516  string_path_1 = stat_path_array[0];
517  if( StrIsNumber( string_path_1 ) )
518  {
519  string_path_1 = Int( string_path_1 );
520  }
521  }
522 
523  switch( stat_path_array.size )
524  {
525  case 1:
526  return self SetDStat( string_path_1, stat_value );
527  break;
528  case 2:
529  return self SetDStat( string_path_1, string_path_2, stat_value );
530  break;
531  case 3:
532  return self SetDStat( string_path_1, string_path_2, string_path_3, stat_value );
533  break;
534  case 4:
535  return self SetDStat( string_path_1, string_path_2, string_path_3, string_path_4, stat_value );
536  break;
537  case 5:
538  return self SetDStat( string_path_1, string_path_2, string_path_3, string_path_4, string_path_5, stat_value );
539  break;
540  default:
541  AssertMsg( "Stat path depth of " + stat_path_array.size + " is too large. Limit to 5 deep" );
542  break;
543  }
544 }
545 
546 function ‪award_loot_xp_due( amount )
547 {
548  if ( !isdefined( self ) )
549  return;
550 
551  if ( amount <= 0 )
552  return;
553 
554  current_amount = ‪VAL( self GetDStat( "mp_loot_xp_due" ), 0 );
555  new_amount = current_amount + amount;
556  self SetDStat( "mp_loot_xp_due", new_amount );
557 }
558 
559 function ‪get_hero_weapon_mask( attacker, weapon )
560 {
561  if ( !isdefined( weapon ) )
562  return 0;
563 
564  if ( isdefined( weapon.isHeroWeapon ) && !weapon.isHeroWeapon )
565  return 0;
566 
567  switch( weapon.name )
568  {
569  case "hero_minigun":
570  case "hero_minigun_body3":
571  return 1; // note: heroWeaponMask needs to stay unique and consistent for function across TUs and FFOTDs
572  break;
573  case "hero_flamethrower":
574  return 1 << 1;
575  break;
576  case "hero_lightninggun":
577  case "hero_lightninggun_arc":
578  return 1 << 2;
579  break;
580  case "hero_chemicalgelgun":
581  case "hero_firefly_swarm":
582  return 1 << 3;
583  break;
584  case "hero_pineapplegun":
585  case "hero_pineapple_grenade":
586  return 1 << 4;
587  break;
588  case "hero_armblade":
589  return 1 << 5;
590  break;
591  case "hero_bowlauncher":
592  case "hero_bowlauncher2":
593  case "hero_bowlauncher3":
594  case "hero_bowlauncher4":
595  return 1 << 6;
596  break;
597  case "hero_gravityspikes":
598  return 1 << 7;
599  break;
600  case "hero_annihilator":
601  return 1 << 8;
602  break;
603  default:
604  return 0;
605  }
606 }
607 
608 function ‪get_hero_ability_mask( ability )
609 {
610  if ( !isdefined( ability ) )
611  return 0;
612 
613  switch( ability.name )
614  {
615  case "gadget_clone":
616  return 1; // note: heroAbilityMask needs to stay unique and consistent for functions across TUs and FFOTDs
617  break;
618  case "gadget_heat_wave":
619  return 1 << 1;
620  break;
621  case "gadget_flashback":
622  return 1 << 2;
623  break;
624  case "gadget_resurrect":
625  return 1 << 3;
626  break;
627  case "gadget_armor":
628  return 1 << 4;
629  break;
630  case "gadget_camo":
631  return 1 << 5;
632  break;
633  case "gadget_vision_pulse":
634  return 1 << 6;
635  break;
636  case "gadget_speed_burst":
637  return 1 << 7;
638  break;
639  case "gadget_combat_efficiency":
640  return 1 << 8;
641  break;
642  default:
643  return 0;
644  }
645 }
646 
647 function ‪contract_game_ended( data )
648 {
649  // TODO: award challenge award here: maybe
650 }
651 
652 function ‪contract_win( winner )
653 {
665 
666  if ( ‪util::is_objective_game( level.gametype ) )
667  {
669  }
670 
671  if ( IsArenaMode() )
672  {
674  }
675 
676  ‪gametype_win( winner );
677 }
678 
679 function ‪gametype_win( winner )
680 {
681  switch ( level.gametype )
682  {
683  case "tdm":
684  winner ‪add_stat( ‪TDM_WINS_INDEX );
685  break;
686 
687  case "ball":
689  break;
690 
691  case "escort":
693  break;
694 
695  case "conf":
697  break;
698 
699  case "sd":
700  winner ‪add_stat( ‪SD_WINS_INDEX );
701  break;
702 
703  case "koth":
705  break;
706 
707  case "dom":
708  winner ‪add_stat( ‪DOM_WINS_INDEX );
709  break;
710 
711  case "ctf":
712  winner ‪add_stat( ‪CTF_WINS_INDEX );
713  break;
714 
715  case "dem":
716  winner ‪add_stat( ‪DEM_WINS_INDEX );
717  break;
718 
719  case "dm":
720  winner ‪add_stat( ‪DM_WINS_INDEX );
721  break;
722 
723  case "clean":
725  break;
726 
727  default:
728  break;
729  }
730 }
731 
733 {
736 }
737 
739 {
742 }
743 
745 {
746  self ‪add_stat( ‪HEADSHOTS_INDEX, 1 );
747 }
748 
750 {
751  player = self;
752 
753  if ( !isdefined( player.pers["contracts"] ) )
754  return 0;
755 
756  loot_xp = 0;
757 
758  //
759  // daily contract
760  //
761  daily_slot = ‪MP_CONTRACT_DAILY_SLOT;
762  if ( ‪get_contract_stat( daily_slot, "active" ) && !‪get_contract_stat( daily_slot, "award_given" ) )
763  {
764  if ( ‪contract_slot_met( daily_slot ) )
765  {
766  loot_xp += player ‪award_daily_contract();
767  player ‪set_contract_stat( daily_slot, "award_given", 1 );
768  }
769  }
770 
771  //
772  // weekly contract
773  //
774  weekly_slot_A = ‪MP_CONTRACT_WEEKLY_SLOT_A;
775  weekly_slot_B = ‪MP_CONTRACT_WEEKLY_SLOT_B;
776  if ( ‪get_contract_stat( weekly_slot_A, "active" ) && !‪get_contract_stat( weekly_slot_A, "award_given" ) &&
777  ‪get_contract_stat( weekly_slot_B, "active" ) && !‪get_contract_stat( weekly_slot_B, "award_given" ) )
778  {
779  if ( ‪contract_slot_met( weekly_slot_A ) && ‪contract_slot_met( weekly_slot_B ) )
780  {
781  loot_xp += player ‪award_weekly_contract();
782  player ‪set_contract_stat( weekly_slot_A, "award_given", 1 );
783  player ‪set_contract_stat( weekly_slot_B, "award_given", 1 );
784  }
785  }
786 
787  return loot_xp;
788 }
789 
790 function ‪contract_slot_met( slot )
791 {
792  player = self;
793 
794  contract_index = ‪get_contract_stat( slot, "index" );
795 
796  if ( !isdefined( player.pers["contracts"][contract_index] ) )
797  return false;
798 
799  progress = player ‪get_contract_stat( slot, "progress" );
800  target_value = player.pers["contracts"][contract_index].target_value;
801 
802  return ( progress >= target_value );
803 }
804 
806 {
807  return GetDvarInt( "daily_contract_cryptokey_reward_count", ‪DEFAULT_DAILY_CRYPTOKEYS ) * GetDvarInt( "loot_cryptokeyCost", ‪DEFAULT_CRYPTOKEY_LOOTXP );
808 }
809 
811 {
813 
814  return GetDvarInt( "weekly_contract_cryptokey_reward_count", ‪DEFAULT_WEEKLY_CRYPTOKEYS ) * GetDvarInt( "loot_cryptokeyCost", ‪DEFAULT_CRYPTOKEY_LOOTXP );
815 }
816 
818 {
819  contract_count = self GetDStat( "blackjack_contract_count" );
820  reward_count = GetDvarInt( "weekly_contract_blackjack_contract_reward_count", 1 );
821  self SetDStat( "blackjack_contract_count", contract_count + reward_count );
822 }
‪gametype_win
‪function gametype_win(winner)
Definition: _contracts.gsc:679
‪HUGE_SNIPER_KILL_INDEX
‪#define HUGE_SNIPER_KILL_INDEX
Definition: _contracts.gsc:95
‪can_process_contracts
‪function can_process_contracts()
Definition: _contracts.gsc:176
‪HUGE_TOTAL_WINS_INDEX_4
‪#define HUGE_TOTAL_WINS_INDEX_4
Definition: _contracts.gsc:102
‪getWeaponClass
‪function getWeaponClass(weapon)
Definition: util_shared.gsc:2676
‪HUGE_LMG_KILL_INDEX
‪#define HUGE_LMG_KILL_INDEX
Definition: _contracts.gsc:94
‪DEFAULT_WEEKLY_CRYPTOKEYS
‪#define DEFAULT_WEEKLY_CRYPTOKEYS
Definition: _contracts.gsc:25
‪HUGE_TOTAL_WINS_INDEX_5
‪#define HUGE_TOTAL_WINS_INDEX_5
Definition: _contracts.gsc:103
‪is_bot
‪function is_bot()
Definition: util_shared.gsc:2488
‪KILLS_KILLSTREAK_INDEX
‪#define KILLS_KILLSTREAK_INDEX
Definition: _contracts.gsc:69
‪CALLING_CARD_STAT_COL
‪#define CALLING_CARD_STAT_COL
Definition: _contracts.gsc:42
‪start_gametype
‪function start_gametype()
Definition: _contracts.gsc:121
‪HUGE_TOTAL_WINS_INDEX_8
‪#define HUGE_TOTAL_WINS_INDEX_8
Definition: _contracts.gsc:106
‪HUGE_TOTAL_WINS_INDEX
‪#define HUGE_TOTAL_WINS_INDEX
Definition: _contracts.gsc:98
‪on_hero_ability_kill
‪function on_hero_ability_kill(ability, victimAbility)
Definition: _contracts.gsc:229
‪on_offender_kill
‪function on_offender_kill()
Definition: _contracts.gsc:732
‪__init__
‪function __init__()
Definition: _contracts.gsc:116
‪BIG_OBJECTIVE_WINS_INDEX
‪#define BIG_OBJECTIVE_WINS_INDEX
Definition: _contracts.gsc:50
‪contract_game_ended
‪function contract_game_ended(data)
Definition: _contracts.gsc:647
‪TARGET_VALUE_COL
‪#define TARGET_VALUE_COL
Definition: _contracts.gsc:37
‪SCORE_INDEX
‪#define SCORE_INDEX
Definition: _contracts.gsc:68
‪HUGE_TOTAL_WINS_INDEX_2
‪#define HUGE_TOTAL_WINS_INDEX_2
Definition: _contracts.gsc:99
‪BALL_WINS_INDEX
‪#define BALL_WINS_INDEX
Definition: _contracts.gsc:62
‪HUGE_TOTAL_WINS_INDEX_3
‪#define HUGE_TOTAL_WINS_INDEX_3
Definition: _contracts.gsc:100
‪MP_CONTRACT_SPECIAL_SLOT
‪#define MP_CONTRACT_SPECIAL_SLOT
Definition: _contracts.gsh:15
‪ESCORT_WINS_INDEX
‪#define ESCORT_WINS_INDEX
Definition: _contracts.gsc:63
‪award_blackjack_contract
‪function award_blackjack_contract()
Definition: _contracts.gsc:817
‪contract_slot_met
‪function contract_slot_met(slot)
Definition: _contracts.gsc:790
‪get_hero_ability_mask
‪function get_hero_ability_mask(ability)
Definition: _contracts.gsc:608
‪on_start_gametype
‪function on_start_gametype(func, obj)
Definition: callbacks_shared.csc:285
‪MP_CONTRACT_WEEKLY_SLOT_A
‪#define MP_CONTRACT_WEEKLY_SLOT_A
Definition: _contracts.gsh:12
‪SD_WINS_INDEX
‪#define SD_WINS_INDEX
Definition: _contracts.gsc:65
‪get_contract_stat
‪function get_contract_stat(slot, stat_name)
Definition: _contracts.gsc:462
‪SMG_KILL_INDEX
‪#define SMG_KILL_INDEX
Definition: _contracts.gsc:79
‪VAL
‪#define VAL(__var, __default)
Definition: shared.gsh:272
‪DEFAULT_CRYPTOKEY_LOOTXP
‪#define DEFAULT_CRYPTOKEY_LOOTXP
Definition: _contracts.gsc:26
‪ARENA_WINS_INDEX
‪#define ARENA_WINS_INDEX
Definition: _contracts.gsc:60
‪on_defender_kill
‪function on_defender_kill()
Definition: _contracts.gsc:738
‪on_player_connect
‪function on_player_connect()
Definition: _contracts.gsc:166
‪register_hero_ability_multikill_event
‪function register_hero_ability_multikill_event(event_func)
Definition: scoreevents_shared.gsc:331
‪is_contract_active
‪function is_contract_active(challenge_index)
Definition: _contracts.gsc:211
‪MEDALS_SPECIALIST_ABILITIES_INDEX
‪#define MEDALS_SPECIALIST_ABILITIES_INDEX
Definition: _contracts.gsc:72
‪set_contract_award_stat_from_path
‪function set_contract_award_stat_from_path(stat_path, stat_value)
Definition: _contracts.gsc:479
‪BIG_KILLS_INDEX
‪#define BIG_KILLS_INDEX
Definition: _contracts.gsc:52
‪get_hero_weapon_mask
‪function get_hero_weapon_mask(attacker, weapon)
Definition: _contracts.gsc:559
‪setup_player_contracts
‪function setup_player_contracts()
Definition: _contracts.gsc:184
‪registerChallengesCallback
‪function registerChallengesCallback(callback, func)
Definition: challenges_shared.gsc:166
‪on_hero_weapon_multikill
‪function on_hero_weapon_multikill(killcount, weapon)
Definition: _contracts.gsc:256
‪KILLED_ATTACKER_INDEX
‪#define KILLED_ATTACKER_INDEX
Definition: _contracts.gsc:77
‪HEADSHOTS_INDEX
‪#define HEADSHOTS_INDEX
Definition: _contracts.gsc:75
‪MAX_CONTRACT_SLOTS
‪#define MAX_CONTRACT_SLOTS
Definition: _contracts.gsc:30
‪contract_win
‪function contract_win(winner)
Definition: _contracts.gsc:652
‪on_hero_ability_medal
‪function on_hero_ability_medal()
Definition: _contracts.gsc:237
‪on_hero_ability_multikill
‪function on_hero_ability_multikill(killcount, ability)
Definition: _contracts.gsc:248
‪WEAPON_CAMO_STAT_COL
‪#define WEAPON_CAMO_STAT_COL
Definition: _contracts.gsc:43
‪TOTAL_WINS_INDEX
‪#define TOTAL_WINS_INDEX
Definition: _contracts.gsc:59
‪canProcessChallenges
‪function canProcessChallenges()
Definition: challenges_shared.gsc:133
‪KOTH_WINS_INDEX
‪#define KOTH_WINS_INDEX
Definition: _contracts.gsc:66
‪MP_CONTRACT_WEEKLY_SLOT_B
‪#define MP_CONTRACT_WEEKLY_SLOT_B
Definition: _contracts.gsh:13
‪BIG_MEDALS_SPECIALIST_ABILITIES_INDEX
‪#define BIG_MEDALS_SPECIALIST_ABILITIES_INDEX
Definition: _contracts.gsc:51
‪HUGE_SMG_KILL_INDEX
‪#define HUGE_SMG_KILL_INDEX
Definition: _contracts.gsc:91
‪PISTOL_KILL_INDEX
‪#define PISTOL_KILL_INDEX
Definition: _contracts.gsc:83
‪DM_WINS_INDEX
‪#define DM_WINS_INDEX
Definition: _contracts.gsc:87
‪CONTRACT_TABLE
‪#define CONTRACT_TABLE
Definition: _contracts.gsc:35
‪KILLSTREAK_SCORE_INDEX
‪#define KILLSTREAK_SCORE_INDEX
Definition: _contracts.gsc:70
‪HUGE_MELEE_WEAPON_KILL_INDEX
‪#define HUGE_MELEE_WEAPON_KILL_INDEX
Definition: _contracts.gsc:96
‪award_weekly_contract
‪function award_weekly_contract()
Definition: _contracts.gsc:810
‪award_daily_contract
‪function award_daily_contract()
Definition: _contracts.gsc:805
‪LOADED_WEAPON_KILL_INDEX
‪#define LOADED_WEAPON_KILL_INDEX
Definition: _contracts.gsc:84
‪DEFAULT_DAILY_CRYPTOKEYS
‪#define DEFAULT_DAILY_CRYPTOKEYS
Definition: _contracts.gsc:24
‪award_loot_xp
‪function award_loot_xp()
Definition: _contracts.gsc:749
‪BIG_KILLS_SPECIALIST_WEAPON_INDEX
‪#define BIG_KILLS_SPECIALIST_WEAPON_INDEX
Definition: _contracts.gsc:55
‪init_player_contract_events
‪function init_player_contract_events()
Definition: _util.gsc:1141
‪TDM_WINS_INDEX
‪#define TDM_WINS_INDEX
Definition: _contracts.gsc:61
‪CTF_WINS_INDEX
‪#define CTF_WINS_INDEX
Definition: _contracts.gsc:85
‪register_hero_weapon_multikill_event
‪function register_hero_weapon_multikill_event(event_func)
Definition: scoreevents_shared.gsc:339
‪CONF_WINS_INDEX
‪#define CONF_WINS_INDEX
Definition: _contracts.gsc:64
‪BIG_TOTAL_WINS_INDEX
‪#define BIG_TOTAL_WINS_INDEX
Definition: _contracts.gsc:49
‪add_active_stat
‪function add_active_stat(contract_index, delta=1)
Definition: _contracts.gsc:375
‪HUGE_KILLS_SPECIALIST_WEAPON_INDEX
‪#define HUGE_KILLS_SPECIALIST_WEAPON_INDEX
Definition: _contracts.gsc:97
‪SNIPER_KILL_INDEX
‪#define SNIPER_KILL_INDEX
Definition: _contracts.gsc:80
‪MP_CONTRACT_DAILY_SLOT
‪#define MP_CONTRACT_DAILY_SLOT
Definition: _contracts.gsh:14
‪registerContractWinEvent
‪function registerContractWinEvent(event)
Definition: _globallogic_score.gsc:1178
‪set_contract_stat
‪function set_contract_stat(slot, stat_name, stat_value)
Definition: _contracts.gsc:467
‪HUGE_AR_KILL_INDEX
‪#define HUGE_AR_KILL_INDEX
Definition: _contracts.gsc:92
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪register_hero_ability_kill_event
‪function register_hero_ability_kill_event(event_func)
Definition: scoreevents_shared.gsc:323
‪award_loot_xp_due
‪function award_loot_xp_due(amount)
Definition: _contracts.gsc:546
‪on_killstreak_score
‪function on_killstreak_score(delta_score, killstreak_purchased)
Definition: _contracts.gsc:270
‪CLEAN_WINS_INDEX
‪#define CLEAN_WINS_INDEX
Definition: _contracts.gsc:88
‪ABSOLUTE_STAT_PATH_COL
‪#define ABSOLUTE_STAT_PATH_COL
Definition: _contracts.gsc:44
‪SPECIALIST_KILLED_INDEX
‪#define SPECIALIST_KILLED_INDEX
Definition: _contracts.gsc:73
‪is_objective_game
‪function is_objective_game(game_type)
Definition: _util.gsc:1205
‪KILLED_DEFENDER_INDEX
‪#define KILLED_DEFENDER_INDEX
Definition: _contracts.gsc:76
‪on_headshot_kill
‪function on_headshot_kill()
Definition: _contracts.gsc:744
‪HUGE_TOTAL_WINS_INDEX_7
‪#define HUGE_TOTAL_WINS_INDEX_7
Definition: _contracts.gsc:105
‪SHOTGUN_KILL_INDEX
‪#define SHOTGUN_KILL_INDEX
Definition: _contracts.gsc:82
‪AR_KILL_INDEX
‪#define AR_KILL_INDEX
Definition: _contracts.gsc:78
‪KILLS_SPECIALIST_WEAPON_INDEX
‪#define KILLS_SPECIALIST_WEAPON_INDEX
Definition: _contracts.gsc:71
‪register_player_contract_event
‪function register_player_contract_event(event_name, event_func, max_param_count=0)
Definition: _util.gsc:1147
‪DOM_WINS_INDEX
‪#define DOM_WINS_INDEX
Definition: _contracts.gsc:67
‪HUGE_SHOTGUN_KILL_INDEX
‪#define HUGE_SHOTGUN_KILL_INDEX
Definition: _contracts.gsc:93
‪add_stat
‪function add_stat(contract_index, delta)
Definition: _contracts.gsc:367
‪BIG_KILLS_KILLSTREAK_INDEX
‪#define BIG_KILLS_KILLSTREAK_INDEX
Definition: _contracts.gsc:56
‪set_contract_award_stat
‪function set_contract_award_stat(award_type, stat_name, stat_value=1)
Definition: _contracts.gsc:472
‪HUGE_TOTAL_WINS_INDEX_GRAND_SLAM
‪#define HUGE_TOTAL_WINS_INDEX_GRAND_SLAM
Definition: _contracts.gsc:101
‪KILLS_INDEX
‪#define KILLS_INDEX
Definition: _contracts.gsc:74
‪HUGE_TOTAL_WINS_INDEX_6
‪#define HUGE_TOTAL_WINS_INDEX_6
Definition: _contracts.gsc:104
‪DEM_WINS_INDEX
‪#define DEM_WINS_INDEX
Definition: _contracts.gsc:86
‪ATTACHMENT_COUNT_FOR_LOADED_WEAPON_KILL
‪#define ATTACHMENT_COUNT_FOR_LOADED_WEAPON_KILL
Definition: _contracts.gsc:28
‪on_connect
‪function on_connect()
Definition: _arena.gsc:20
‪INDEX_COL
‪#define INDEX_COL
Definition: _contracts.gsc:36
‪contract_kills
‪function contract_kills(data)
Definition: _contracts.gsc:278
‪ATTACKER_DEFENDER_KILLS_INDEX
‪#define ATTACKER_DEFENDER_KILLS_INDEX
Definition: _contracts.gsc:54
‪LMG_KILL_INDEX
‪#define LMG_KILL_INDEX
Definition: _contracts.gsc:81
‪on_killed_hero_weapon_enemy
‪function on_killed_hero_weapon_enemy()
Definition: _contracts.gsc:161
‪on_killed_hero_ability_enemy
‪function on_killed_hero_ability_enemy()
Definition: _contracts.gsc:156
‪on_player_score
‪function on_player_score(delta_score)
Definition: _contracts.gsc:264
‪BIG_SCORE_INDEX
‪#define BIG_SCORE_INDEX
Definition: _contracts.gsc:53