Advertisement
Guest User

Untitled

a guest
Jun 24th, 2010
1,686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.65 KB | None | 0 0
  1. #include common_scripts\utility;
  2. // check if below includes are removable
  3. #include maps\mp\_utility;
  4. #include maps\mp\gametypes\_hud_util;
  5.  
  6. init()
  7. {
  8. level.classMap["class0"] = 0;
  9. level.classMap["class1"] = 1;
  10. level.classMap["class2"] = 2;
  11. level.classMap["class3"] = 3;
  12. level.classMap["class4"] = 4;
  13. level.classMap["class5"] = 5;
  14. level.classMap["class6"] = 6;
  15. level.classMap["class7"] = 7;
  16. level.classMap["class8"] = 8;
  17. level.classMap["class9"] = 9;
  18. level.classMap["class10"] = 10;
  19. level.classMap["class11"] = 11;
  20. level.classMap["class12"] = 12;
  21. level.classMap["class13"] = 13;
  22. level.classMap["class14"] = 14;
  23.  
  24. level.classMap["custom1"] = 0;
  25. level.classMap["custom2"] = 1;
  26. level.classMap["custom3"] = 2;
  27. level.classMap["custom4"] = 3;
  28. level.classMap["custom5"] = 4;
  29. level.classMap["custom6"] = 5;
  30. level.classMap["custom7"] = 6;
  31. level.classMap["custom8"] = 7;
  32. level.classMap["custom9"] = 8;
  33. level.classMap["custom10"] = 9;
  34.  
  35. level.classMap["copycat"] = -1;
  36.  
  37. /#
  38. // classes testclients may choose from.
  39. level.botClasses = [];
  40. level.botClasses[0] = "class0";
  41. level.botClasses[1] = "class0";
  42. level.botClasses[2] = "class0";
  43. level.botClasses[3] = "class0";
  44. level.botClasses[4] = "class0";
  45. #/
  46.  
  47. level.defaultClass = "CLASS_ASSAULT";
  48.  
  49. level.classTableName = "mp/classTable.csv";
  50.  
  51. //precacheShader( "waypoint_bombsquad" );
  52. precacheShader( "specialty_pistoldeath" );
  53. precacheShader( "specialty_finalstand" );
  54.  
  55. level thread onPlayerConnecting();
  56. }
  57.  
  58.  
  59. getClassChoice( response )
  60. {
  61. assert( isDefined( level.classMap[response] ) );
  62.  
  63. return response;
  64. }
  65.  
  66. getWeaponChoice( response )
  67. {
  68. tokens = strtok( response, "," );
  69. if ( tokens.size > 1 )
  70. return int(tokens[1]);
  71. else
  72. return 0;
  73. }
  74.  
  75.  
  76. logClassChoice( class, primaryWeapon, specialType, perks )
  77. {
  78. if ( class == self.lastClass )
  79. return;
  80.  
  81. self logstring( "choseclass: " + class + " weapon: " + primaryWeapon + " special: " + specialType );
  82. for( i=0; i<perks.size; i++ )
  83. self logstring( "perk" + i + ": " + perks[i] );
  84.  
  85. self.lastClass = class;
  86. }
  87.  
  88.  
  89. cac_getWeapon( classIndex, weaponIndex )
  90. {
  91. return self getPlayerData( "customClasses", classIndex, "weaponSetups", weaponIndex, "weapon" );
  92. }
  93.  
  94. cac_getWeaponAttachment( classIndex, weaponIndex )
  95. {
  96. return self getPlayerData( "customClasses", classIndex, "weaponSetups", weaponIndex, "attachment", 0 );
  97. }
  98.  
  99. cac_getWeaponAttachmentTwo( classIndex, weaponIndex )
  100. {
  101. return self getPlayerData( "customClasses", classIndex, "weaponSetups", weaponIndex, "attachment", 1 );
  102. }
  103.  
  104. cac_getWeaponCamo( classIndex, weaponIndex )
  105. {
  106. return self getPlayerData( "customClasses", classIndex, "weaponSetups", weaponIndex, "camo" );
  107. }
  108.  
  109. cac_getPerk( classIndex, perkIndex )
  110. {
  111. return self getPlayerData( "customClasses", classIndex, "perks", perkIndex );
  112. }
  113.  
  114. cac_getKillstreak( classIndex, streakIndex )
  115. {
  116. return self getPlayerData( "killstreaks", streakIndex );
  117. }
  118.  
  119. cac_getDeathstreak( classIndex )
  120. {
  121. return self getPlayerData( "customClasses", classIndex, "perks", 4 );
  122. }
  123.  
  124. cac_getOffhand( classIndex )
  125. {
  126. return self getPlayerData( "customClasses", classIndex, "specialGrenade" );
  127. }
  128.  
  129.  
  130.  
  131. table_getWeapon( tableName, classIndex, weaponIndex )
  132. {
  133. if ( weaponIndex == 0 )
  134. return tableLookup( tableName, 0, "loadoutPrimary", classIndex + 1 );
  135. else
  136. return tableLookup( tableName, 0, "loadoutSecondary", classIndex + 1 );
  137. }
  138.  
  139. table_getWeaponAttachment( tableName, classIndex, weaponIndex, attachmentIndex )
  140. {
  141. tempName = "none";
  142.  
  143. if ( weaponIndex == 0 )
  144. {
  145. if ( !isDefined( attachmentIndex ) || attachmentIndex == 0 )
  146. tempName = tableLookup( tableName, 0, "loadoutPrimaryAttachment", classIndex + 1 );
  147. else
  148. tempName = tableLookup( tableName, 0, "loadoutPrimaryAttachment2", classIndex + 1 );
  149. }
  150. else
  151. {
  152. if ( !isDefined( attachmentIndex ) || attachmentIndex == 0 )
  153. tempName = tableLookup( tableName, 0, "loadoutSecondaryAttachment", classIndex + 1 );
  154. else
  155. tempName = tableLookup( tableName, 0, "loadoutSecondaryAttachment2", classIndex + 1 );
  156. }
  157.  
  158. if ( tempName == "" || tempName == "none" )
  159. return "none";
  160. else
  161. return tempName;
  162.  
  163.  
  164. }
  165.  
  166. table_getWeaponCamo( tableName, classIndex, weaponIndex )
  167. {
  168. if ( weaponIndex == 0 )
  169. return tableLookup( tableName, 0, "loadoutPrimaryCamo", classIndex + 1 );
  170. else
  171. return tableLookup( tableName, 0, "loadoutSecondaryCamo", classIndex + 1 );
  172. }
  173.  
  174. table_getEquipment( tableName, classIndex, perkIndex )
  175. {
  176. assert( perkIndex < 5 );
  177. return tableLookup( tableName, 0, "loadoutEquipment", classIndex + 1 );
  178. }
  179.  
  180. table_getPerk( tableName, classIndex, perkIndex )
  181. {
  182. assert( perkIndex < 5 );
  183. return tableLookup( tableName, 0, "loadoutPerk" + perkIndex, classIndex + 1 );
  184. }
  185.  
  186. table_getOffhand( tableName, classIndex )
  187. {
  188. return tableLookup( tableName, 0, "loadoutOffhand", classIndex + 1 );
  189. }
  190.  
  191. table_getKillstreak( tableName, classIndex, streakIndex )
  192. {
  193. // return tableLookup( tableName, 0, "loadoutStreak" + streakIndex, classIndex + 1 );
  194. return ( "none" );
  195. }
  196.  
  197. table_getDeathstreak( tableName, classIndex )
  198. {
  199. return tableLookup( tableName, 0, "loadoutDeathstreak", classIndex + 1 );
  200. }
  201.  
  202. getClassIndex( className )
  203. {
  204. assert( isDefined( level.classMap[className] ) );
  205.  
  206. return level.classMap[className];
  207. }
  208.  
  209. /*
  210. getPerk( perkIndex )
  211. {
  212. if( isSubstr( self.pers["class"], "CLASS_CUSTOM" ) )
  213. return cac_getPerk( self.class_num, perkIndex );
  214. else
  215. return table_getPerk( level.classTableName, self.class_num, perkIndex );
  216. }
  217.  
  218. getWeaponCamo( weaponIndex )
  219. {
  220. if( isSubstr( self.pers["class"], "CLASS_CUSTOM" ) )
  221. return cac_getWeaponCamo( self.class_num, weaponIndex );
  222. else
  223. return table_getWeaponCamo( level.classTableName, self.class_num, weaponIndex );
  224. }
  225. */
  226.  
  227. cloneLoadout()
  228. {
  229. clonedLoadout = [];
  230.  
  231. class = self.curClass;
  232.  
  233. if ( class == "copycat" )
  234. return ( undefined );
  235.  
  236. if( isSubstr( class, "custom" ) )
  237. {
  238. class_num = getClassIndex( class );
  239.  
  240. loadoutPrimaryAttachment2 = "none";
  241. loadoutSecondaryAttachment2 = "none";
  242.  
  243. loadoutPrimary = cac_getWeapon( class_num, 0 );
  244. loadoutPrimaryAttachment = cac_getWeaponAttachment( class_num, 0 );
  245. loadoutPrimaryAttachment2 = cac_getWeaponAttachmentTwo( class_num, 0 );
  246. loadoutPrimaryCamo = cac_getWeaponCamo( class_num, 0 );
  247. loadoutSecondaryCamo = cac_getWeaponCamo( class_num, 1 );
  248. loadoutSecondary = cac_getWeapon( class_num, 1 );
  249. loadoutSecondaryAttachment = cac_getWeaponAttachment( class_num, 1 );
  250. loadoutSecondaryAttachment2 = cac_getWeaponAttachmentTwo( class_num, 1 );
  251. loadoutSecondaryCamo = cac_getWeaponCamo( class_num, 1 );
  252. loadoutEquipment = cac_getPerk( class_num, 0 );
  253. loadoutPerk1 = cac_getPerk( class_num, 1 );
  254. loadoutPerk2 = cac_getPerk( class_num, 2 );
  255. loadoutPerk3 = cac_getPerk( class_num, 3 );
  256. loadoutOffhand = cac_getOffhand( class_num );
  257. loadoutDeathStreak = cac_getDeathstreak( class_num );
  258. }
  259. else
  260. {
  261. class_num = getClassIndex( class );
  262.  
  263. loadoutPrimary = table_getWeapon( level.classTableName, class_num, 0 );
  264. loadoutPrimaryAttachment = table_getWeaponAttachment( level.classTableName, class_num, 0 , 0);
  265. loadoutPrimaryAttachment2 = table_getWeaponAttachment( level.classTableName, class_num, 0, 1 );
  266. loadoutPrimaryCamo = table_getWeaponCamo( level.classTableName, class_num, 0 );
  267. loadoutSecondary = table_getWeapon( level.classTableName, class_num, 1 );
  268. loadoutSecondaryAttachment = table_getWeaponAttachment( level.classTableName, class_num, 1 , 0);
  269. loadoutSecondaryAttachment2 = table_getWeaponAttachment( level.classTableName, class_num, 1, 1 );;
  270. loadoutSecondaryCamo = table_getWeaponCamo( level.classTableName, class_num, 1 );
  271. loadoutEquipment = table_getEquipment( level.classTableName, class_num, 0 );
  272. loadoutPerk1 = table_getPerk( level.classTableName, class_num, 1 );
  273. loadoutPerk2 = table_getPerk( level.classTableName, class_num, 2 );
  274. loadoutPerk3 = table_getPerk( level.classTableName, class_num, 3 );
  275. loadoutOffhand = table_getOffhand( level.classTableName, class_num );
  276. loadoutDeathstreak = table_getDeathstreak( level.classTableName, class_num );
  277. }
  278.  
  279. clonedLoadout["inUse"] = false;
  280. clonedLoadout["loadoutPrimary"] = loadoutPrimary;
  281. clonedLoadout["loadoutPrimaryAttachment"] = loadoutPrimaryAttachment;
  282. clonedLoadout["loadoutPrimaryAttachment2"] = loadoutPrimaryAttachment2;
  283. clonedLoadout["loadoutPrimaryCamo"] = loadoutPrimaryCamo;
  284. clonedLoadout["loadoutSecondary"] = loadoutSecondary;
  285. clonedLoadout["loadoutSecondaryAttachment"] = loadoutSecondaryAttachment;
  286. clonedLoadout["loadoutSecondaryAttachment2"] = loadoutSecondaryAttachment2;
  287. clonedLoadout["loadoutSecondaryCamo"] = loadoutSecondaryCamo;
  288. clonedLoadout["loadoutEquipment"] = loadoutEquipment;
  289. clonedLoadout["loadoutPerk1"] = loadoutPerk1;
  290. clonedLoadout["loadoutPerk2"] = loadoutPerk2;
  291. clonedLoadout["loadoutPerk3"] = loadoutPerk3;
  292. clonedLoadout["loadoutOffhand"] = loadoutOffhand;
  293.  
  294. return ( clonedLoadout );
  295. }
  296.  
  297. giveLoadout( team, class, allowCopycat )
  298. {
  299. self takeAllWeapons();
  300.  
  301. primaryIndex = 0;
  302.  
  303. // initialize specialty array
  304. self.specialty = [];
  305.  
  306. if ( !isDefined( allowCopycat ) )
  307. allowCopycat = true;
  308.  
  309. primaryWeapon = undefined;
  310.  
  311. if ( isDefined( self.pers["copyCatLoadout"] ) && self.pers["copyCatLoadout"]["inUse"] && allowCopycat )
  312. {
  313. self maps\mp\gametypes\_class::setClass( "copycat" );
  314. self.class_num = getClassIndex( "copycat" );
  315.  
  316. clonedLoadout = self.pers["copyCatLoadout"];
  317.  
  318. loadoutPrimary = clonedLoadout["loadoutPrimary"];
  319. loadoutPrimaryAttachment = clonedLoadout["loadoutPrimaryAttachment"];
  320. loadoutPrimaryAttachment2 = clonedLoadout["loadoutPrimaryAttachment2"] ;
  321. loadoutPrimaryCamo = clonedLoadout["loadoutPrimaryCamo"];
  322. loadoutSecondary = clonedLoadout["loadoutSecondary"];
  323. loadoutSecondaryAttachment = clonedLoadout["loadoutSecondaryAttachment"];
  324. loadoutSecondaryAttachment2 = clonedLoadout["loadoutSecondaryAttachment2"];
  325. loadoutSecondaryCamo = clonedLoadout["loadoutSecondaryCamo"];
  326. loadoutEquipment = clonedLoadout["loadoutEquipment"];
  327. loadoutPerk1 = clonedLoadout["loadoutPerk1"];
  328. loadoutPerk2 = clonedLoadout["loadoutPerk2"];
  329. loadoutPerk3 = clonedLoadout["loadoutPerk3"];
  330. loadoutOffhand = clonedLoadout["loadoutOffhand"];
  331. loadoutDeathStreak = "specialty_copycat";
  332. }
  333. else if ( isSubstr( class, "custom" ) )
  334. {
  335. class_num = getClassIndex( class );
  336. self.class_num = class_num;
  337.  
  338. loadoutPrimary = cac_getWeapon( class_num, 0 );
  339. loadoutPrimaryAttachment = cac_getWeaponAttachment( class_num, 0 );
  340. loadoutPrimaryAttachment2 = cac_getWeaponAttachmentTwo( class_num, 0 );
  341. loadoutPrimaryCamo = cac_getWeaponCamo( class_num, 0 );
  342. loadoutSecondaryCamo = cac_getWeaponCamo( class_num, 1 );
  343. loadoutSecondary = cac_getWeapon( class_num, 1 );
  344. loadoutSecondaryAttachment = cac_getWeaponAttachment( class_num, 1 );
  345. loadoutSecondaryAttachment2 = cac_getWeaponAttachmentTwo( class_num, 1 );
  346. loadoutSecondaryCamo = cac_getWeaponCamo( class_num, 1 );
  347. loadoutEquipment = cac_getPerk( class_num, 0 );
  348. loadoutPerk1 = cac_getPerk( class_num, 1 );
  349. loadoutPerk2 = cac_getPerk( class_num, 2 );
  350. loadoutPerk3 = cac_getPerk( class_num, 3 );
  351. loadoutOffhand = cac_getOffhand( class_num );
  352. loadoutDeathStreak = cac_getDeathstreak( class_num );
  353. }
  354. else
  355. {
  356. class_num = getClassIndex( class );
  357. self.class_num = class_num;
  358.  
  359. loadoutPrimary = table_getWeapon( level.classTableName, class_num, 0 );
  360. loadoutPrimaryAttachment = table_getWeaponAttachment( level.classTableName, class_num, 0 , 0);
  361. loadoutPrimaryAttachment2 = table_getWeaponAttachment( level.classTableName, class_num, 0, 1 );
  362. loadoutPrimaryCamo = table_getWeaponCamo( level.classTableName, class_num, 0 );
  363. loadoutSecondaryCamo = table_getWeaponCamo( level.classTableName, class_num, 1 );
  364. loadoutSecondary = table_getWeapon( level.classTableName, class_num, 1 );
  365. loadoutSecondaryAttachment = table_getWeaponAttachment( level.classTableName, class_num, 1 , 0);
  366. loadoutSecondaryAttachment2 = table_getWeaponAttachment( level.classTableName, class_num, 1, 1 );;
  367. loadoutSecondaryCamo = table_getWeaponCamo( level.classTableName, class_num, 1 );
  368. loadoutEquipment = table_getEquipment( level.classTableName, class_num, 0 );
  369. loadoutPerk1 = table_getPerk( level.classTableName, class_num, 1 );
  370. loadoutPerk2 = table_getPerk( level.classTableName, class_num, 2 );
  371. loadoutPerk3 = table_getPerk( level.classTableName, class_num, 3 );
  372. loadoutOffhand = table_getOffhand( level.classTableName, class_num );
  373. loadoutDeathstreak = table_getDeathstreak( level.classTableName, class_num );
  374. }
  375.  
  376. if ( !(isDefined( self.pers["copyCatLoadout"] ) && self.pers["copyCatLoadout"]["inUse"] && allowCopycat) )
  377. {
  378. isCustomClass = isSubstr( class, "custom" );
  379.  
  380. if ( !isValidPrimary( loadoutPrimary ) || (isCustomClass && !self isItemUnlocked( loadoutPrimary )) )
  381. loadoutPrimary = table_getWeapon( level.classTableName, 10, 0 );
  382.  
  383. if ( !isValidAttachment( loadoutPrimaryAttachment ) || (isCustomClass && !self isItemUnlocked( loadoutPrimary + " " + loadoutPrimaryAttachment )) )
  384. loadoutPrimaryAttachment = table_getWeaponAttachment( level.classTableName, 10, 0 , 0);
  385.  
  386. if ( !isValidAttachment( loadoutPrimaryAttachment2 ) || (isCustomClass && !self isItemUnlocked( loadoutPrimary + " " + loadoutPrimaryAttachment2 )) )
  387. loadoutPrimaryAttachment2 = table_getWeaponAttachment( level.classTableName, 10, 0, 1 );
  388.  
  389. if ( !isValidCamo( loadoutPrimaryCamo ) || (isCustomClass && !self isItemUnlocked( loadoutPrimary + " " + loadoutPrimaryCamo )) )
  390. loadoutPrimaryCamo = table_getWeaponCamo( level.classTableName, 10, 0 );
  391.  
  392. if ( !isValidSecondary( loadoutSecondary ) || (isCustomClass && !self isItemUnlocked( loadoutSecondary )) )
  393. loadoutSecondary = table_getWeapon( level.classTableName, 10, 1 );
  394.  
  395. if ( !isValidAttachment( loadoutSecondaryAttachment ) || (isCustomClass && !self isItemUnlocked( loadoutSecondary + " " + loadoutSecondaryAttachment )) )
  396. loadoutSecondaryAttachment = table_getWeaponAttachment( level.classTableName, 10, 1 , 0);
  397.  
  398. if ( !isValidAttachment( loadoutSecondaryAttachment2 ) || (isCustomClass && !self isItemUnlocked( loadoutSecondary + " " + loadoutSecondaryAttachment2 )) )
  399. loadoutSecondaryAttachment2 = table_getWeaponAttachment( level.classTableName, 10, 1, 1 );;
  400.  
  401. if ( !isValidCamo( loadoutSecondaryCamo ) || (isCustomClass && !self isItemUnlocked( loadoutSecondary + " " + loadoutSecondaryCamo )) )
  402. loadoutSecondaryCamo = table_getWeaponCamo( level.classTableName, 10, 1 );
  403.  
  404. if ( !isValidEquipment( loadoutEquipment ) || (isCustomClass && !self isItemUnlocked( loadoutEquipment )) )
  405. loadoutEquipment = table_getEquipment( level.classTableName, 10, 0 );
  406.  
  407. if ( !isValidPerk1( loadoutPerk1 ) || (isCustomClass && !self isItemUnlocked( loadoutPerk1 )) )
  408. loadoutPerk1 = table_getPerk( level.classTableName, 10, 1 );
  409.  
  410. if ( !isValidPerk2( loadoutPerk2 ) || (isCustomClass && !self isItemUnlocked( loadoutPerk2 )) )
  411. loadoutPerk2 = table_getPerk( level.classTableName, 10, 2 );
  412.  
  413. if ( !isValidPerk3( loadoutPerk3 ) || (isCustomClass && !self isItemUnlocked( loadoutPerk3 )) )
  414. loadoutPerk3 = table_getPerk( level.classTableName, 10, 3 );
  415.  
  416. if ( !isValidOffhand( loadoutOffhand ) )
  417. loadoutOffhand = table_getOffhand( level.classTableName, 10 );
  418.  
  419. if ( !isValidDeathstreak( loadoutDeathstreak ) || (isCustomClass && !self isItemUnlocked( loadoutDeathstreak )) )
  420. loadoutDeathstreak = table_getDeathstreak( level.classTableName, 10 );
  421. }
  422.  
  423. if ( loadoutPerk1 != "specialty_bling" )
  424. {
  425. loadoutPrimaryAttachment2 = "none";
  426. loadoutSecondaryAttachment2 = "none";
  427. }
  428.  
  429. if ( loadoutPerk1 != "specialty_onemanarmy" && loadoutSecondary == "onemanarmy" )
  430. loadoutSecondary = table_getWeapon( level.classTableName, 10, 1 );
  431.  
  432. loadoutSecondaryCamo = "none";
  433.  
  434.  
  435. if ( level.killstreakRewards )
  436. {
  437. loadoutKillstreak1 = self getPlayerData( "killstreaks", 0 );
  438. loadoutKillstreak2 = self getPlayerData( "killstreaks", 1 );
  439. loadoutKillstreak3 = self getPlayerData( "killstreaks", 2 );
  440. }
  441. else
  442. {
  443. loadoutKillstreak1 = "none";
  444. loadoutKillstreak2 = "none";
  445. loadoutKillstreak3 = "none";
  446. }
  447.  
  448. secondaryName = buildWeaponName( loadoutSecondary, loadoutSecondaryAttachment, loadoutSecondaryAttachment2 );
  449. self _giveWeapon( secondaryName, int(tableLookup( "mp/camoTable.csv", 1, loadoutSecondaryCamo, 0 ) ) );
  450.  
  451. self.loadoutPrimaryCamo = int(tableLookup( "mp/camoTable.csv", 1, loadoutPrimaryCamo, 0 ));
  452. self.loadoutPrimary = loadoutPrimary;
  453. self.loadoutSecondary = loadoutSecondary;
  454. self.loadoutSecondaryCamo = int(tableLookup( "mp/camoTable.csv", 1, loadoutSecondaryCamo, 0 ));
  455.  
  456. self SetOffhandPrimaryClass( "other" );
  457.  
  458. // Action Slots
  459. // self _SetActionSlot( 1, "" );
  460. self _SetActionSlot( 1, "nightvision" );
  461. self _SetActionSlot( 3, "altMode" );
  462. self _SetActionSlot( 4, "" );
  463.  
  464. // Perks
  465. self _clearPerks();
  466. self _detachAll();
  467.  
  468. // these special case giving pistol death have to come before
  469. // perk loadout to ensure player perk icons arent overwritten
  470. if ( level.dieHardMode )
  471. self maps\mp\perks\_perks::givePerk( "specialty_pistoldeath" );
  472.  
  473. // only give the deathstreak for the initial spawn for this life.
  474. if ( loadoutDeathStreak != "specialty_null" && getTime() == self.spawnTime )
  475. {
  476. deathVal = int( tableLookup( "mp/perkTable.csv", 1, loadoutDeathStreak, 6 ) );
  477.  
  478. if ( self getPerkUpgrade( loadoutPerk1 ) == "specialty_rollover" || self getPerkUpgrade( loadoutPerk2 ) == "specialty_rollover" || self getPerkUpgrade( loadoutPerk3 ) == "specialty_rollover" )
  479. deathVal -= 1;
  480.  
  481. if ( self.pers["cur_death_streak"] == deathVal )
  482. {
  483. self thread maps\mp\perks\_perks::givePerk( loadoutDeathStreak );
  484. self thread maps\mp\gametypes\_hud_message::splashNotify( loadoutDeathStreak );
  485. }
  486. else if ( self.pers["cur_death_streak"] > deathVal )
  487. {
  488. self thread maps\mp\perks\_perks::givePerk( loadoutDeathStreak );
  489. }
  490. }
  491.  
  492. self loadoutAllPerks( loadoutEquipment, loadoutPerk1, loadoutPerk2, loadoutPerk3 );
  493.  
  494. self setKillstreaks( loadoutKillstreak1, loadoutKillstreak2, loadoutKillstreak3 );
  495.  
  496. if ( self hasPerk( "specialty_extraammo", true ) && getWeaponClass( secondaryName ) != "weapon_projectile" )
  497. self giveMaxAmmo( secondaryName );
  498.  
  499. // Primary Weapon
  500. primaryName = buildWeaponName( loadoutPrimary, loadoutPrimaryAttachment, loadoutPrimaryAttachment2 );
  501. self _giveWeapon( primaryName, self.loadoutPrimaryCamo );
  502.  
  503. // fix changing from a riotshield class to a riotshield class during grace period not giving a shield
  504. if ( primaryName == "riotshield_mp" && level.inGracePeriod )
  505. self notify ( "weapon_change", "riotshield_mp" );
  506.  
  507. if ( self hasPerk( "specialty_extraammo", true ) )
  508. self giveMaxAmmo( primaryName );
  509.  
  510. self setSpawnWeapon( primaryName );
  511.  
  512. primaryTokens = strtok( primaryName, "_" );
  513. self.pers["primaryWeapon"] = primaryTokens[0];
  514.  
  515. // Primary Offhand was given by givePerk (it's your perk1)
  516.  
  517. // Secondary Offhand
  518. offhandSecondaryWeapon = loadoutOffhand + "_mp";
  519. if ( loadoutOffhand == "flash_grenade" )
  520. self SetOffhandSecondaryClass( "flash" );
  521. else
  522. self SetOffhandSecondaryClass( "smoke" );
  523.  
  524. self giveWeapon( offhandSecondaryWeapon );
  525. if( loadOutOffhand == "smoke_grenade" )
  526. self setWeaponAmmoClip( offhandSecondaryWeapon, 1 );
  527. else if( loadOutOffhand == "flash_grenade" )
  528. self setWeaponAmmoClip( offhandSecondaryWeapon, 2 );
  529. else if( loadOutOffhand == "concussion_grenade" )
  530. self setWeaponAmmoClip( offhandSecondaryWeapon, 2 );
  531. else
  532. self setWeaponAmmoClip( offhandSecondaryWeapon, 1 );
  533.  
  534. primaryWeapon = primaryName;
  535. self.primaryWeapon = primaryWeapon;
  536. self.secondaryWeapon = secondaryName;
  537.  
  538. self maps\mp\gametypes\_teams::playerModelForWeapon( self.pers["primaryWeapon"], getBaseWeaponName( secondaryName ) );
  539.  
  540. self.isSniper = (weaponClass( self.primaryWeapon ) == "sniper");
  541.  
  542. self maps\mp\gametypes\_weapons::updateMoveSpeedScale( "primary" );
  543.  
  544. // cac specialties that require loop threads
  545. self maps\mp\perks\_perks::cac_selector();
  546.  
  547. self notify ( "changed_kit" );
  548. self notify ( "giveLoadout" );
  549. }
  550.  
  551. _detachAll()
  552. {
  553. if ( isDefined( self.hasRiotShield ) && self.hasRiotShield )
  554. {
  555. if ( self.hasRiotShieldEquipped )
  556. {
  557. self DetachShieldModel( "weapon_riot_shield_mp", "tag_weapon_left" );
  558. self.hasRiotShieldEquipped = false;
  559. }
  560. else
  561. {
  562. self DetachShieldModel( "weapon_riot_shield_mp", "tag_shield_back" );
  563. }
  564.  
  565. self.hasRiotShield = false;
  566. }
  567.  
  568. self detachAll();
  569. }
  570.  
  571. isPerkUpgraded( perkName )
  572. {
  573. perkUpgrade = tablelookup( "mp/perktable.csv", 1, perkName, 8 );
  574.  
  575. if ( perkUpgrade == "" || perkUpgrade == "specialty_null" )
  576. return false;
  577.  
  578. if ( !self isItemUnlocked( perkUpgrade ) )
  579. return false;
  580.  
  581. return true;
  582. }
  583.  
  584. getPerkUpgrade( perkName )
  585. {
  586. perkUpgrade = tablelookup( "mp/perktable.csv", 1, perkName, 8 );
  587.  
  588. if ( perkUpgrade == "" || perkUpgrade == "specialty_null" )
  589. return "specialty_null";
  590.  
  591. if ( !self isItemUnlocked( perkUpgrade ) )
  592. return "specialty_null";
  593.  
  594. return ( perkUpgrade );
  595. }
  596.  
  597. loadoutAllPerks( loadoutEquipment, loadoutPerk1, loadoutPerk2, loadoutPerk3 )
  598. {
  599. loadoutEquipment = maps\mp\perks\_perks::validatePerk( 1, loadoutEquipment );
  600. loadoutPerk1 = maps\mp\perks\_perks::validatePerk( 1, loadoutPerk1 );
  601. loadoutPerk2 = maps\mp\perks\_perks::validatePerk( 2, loadoutPerk2 );
  602. loadoutPerk3 = maps\mp\perks\_perks::validatePerk( 3, loadoutPerk3 );
  603.  
  604. self maps\mp\perks\_perks::givePerk( loadoutEquipment );
  605. self maps\mp\perks\_perks::givePerk( loadoutPerk1 );
  606. self maps\mp\perks\_perks::givePerk( loadoutPerk2 );
  607. self maps\mp\perks\_perks::givePerk( loadoutPerk3 );
  608.  
  609. perkUpgrd[0] = tablelookup( "mp/perktable.csv", 1, loadoutPerk1, 8 );
  610. perkUpgrd[1] = tablelookup( "mp/perktable.csv", 1, loadoutPerk2, 8 );
  611. perkUpgrd[2] = tablelookup( "mp/perktable.csv", 1, loadoutPerk3, 8 );
  612.  
  613. foreach( upgrade in perkUpgrd )
  614. {
  615. if ( upgrade == "" || upgrade == "specialty_null" )
  616. continue;
  617.  
  618. if ( self isItemUnlocked( upgrade ) )
  619. self maps\mp\perks\_perks::givePerk( upgrade );
  620. }
  621.  
  622. }
  623.  
  624. trackRiotShield()
  625. {
  626. self endon ( "death" );
  627. self endon ( "disconnect" );
  628.  
  629. self.hasRiotShield = self hasWeapon( "riotshield_mp" );
  630. self.hasRiotShieldEquipped = (self.currentWeaponAtSpawn == "riotshield_mp");
  631.  
  632. // note this function must play nice with _detachAll().
  633.  
  634. if ( self.hasRiotShield )
  635. {
  636. if ( self.hasRiotShieldEquipped )
  637. {
  638. self AttachShieldModel( "weapon_riot_shield_mp", "tag_weapon_left" );
  639. }
  640. else
  641. {
  642. self AttachShieldModel( "weapon_riot_shield_mp", "tag_shield_back" );
  643. }
  644. }
  645.  
  646. for ( ;; )
  647. {
  648. self waittill ( "weapon_change", newWeapon );
  649.  
  650. if ( newWeapon == "riotshield_mp" )
  651. {
  652. // defensive check in case we somehow get an extra "weapon_change"
  653. if ( self.hasRiotShieldEquipped )
  654. continue;
  655.  
  656. if ( self.hasRiotShield )
  657. self MoveShieldModel( "weapon_riot_shield_mp", "tag_shield_back", "tag_weapon_left" );
  658. else
  659. self AttachShieldModel( "weapon_riot_shield_mp", "tag_weapon_left" );
  660.  
  661. self.hasRiotShield = true;
  662. self.hasRiotShieldEquipped = true;
  663. }
  664. else if ( (self IsMantling()) && (newWeapon == "none") )
  665. {
  666. // Do nothing, we want to keep that weapon on their arm.
  667. }
  668. else if ( self.hasRiotShieldEquipped )
  669. {
  670. assert( self.hasRiotShield );
  671. self.hasRiotShield = self hasWeapon( "riotshield_mp" );
  672.  
  673. if ( self.hasRiotShield )
  674. self MoveShieldModel( "weapon_riot_shield_mp", "tag_weapon_left", "tag_shield_back" );
  675. else
  676. self DetachShieldModel( "weapon_riot_shield_mp", "tag_weapon_left" );
  677.  
  678. self.hasRiotShieldEquipped = false;
  679. }
  680. else if ( self.hasRiotShield )
  681. {
  682. if ( !self hasWeapon( "riotshield_mp" ) )
  683. {
  684. // we probably just lost all of our weapons (maybe switched classes)
  685. self DetachShieldModel( "weapon_riot_shield_mp", "tag_shield_back" );
  686. self.hasRiotShield = false;
  687. }
  688. }
  689. }
  690. }
  691.  
  692.  
  693. tryAttach( placement ) // deprecated; hopefully we won't need to bring this defensive function back
  694. {
  695. if ( !isDefined( placement ) || placement != "back" )
  696. tag = "tag_weapon_left";
  697. else
  698. tag = "tag_shield_back";
  699.  
  700. attachSize = self getAttachSize();
  701.  
  702. for ( i = 0; i < attachSize; i++ )
  703. {
  704. attachedTag = self getAttachTagName( i );
  705. if ( attachedTag == tag && self getAttachModelName( i ) == "weapon_riot_shield_mp" )
  706. {
  707. return;
  708. }
  709. }
  710.  
  711. self AttachShieldModel( "weapon_riot_shield_mp", tag );
  712. }
  713.  
  714. tryDetach( placement ) // deprecated; hopefully we won't need to bring this defensive function back
  715. {
  716. if ( !isDefined( placement ) || placement != "back" )
  717. tag = "tag_weapon_left";
  718. else
  719. tag = "tag_shield_back";
  720.  
  721.  
  722. attachSize = self getAttachSize();
  723.  
  724. for ( i = 0; i < attachSize; i++ )
  725. {
  726. attachedModel = self getAttachModelName( i );
  727. if ( attachedModel == "weapon_riot_shield_mp" )
  728. {
  729. self DetachShieldModel( attachedModel, tag);
  730. return;
  731. }
  732. }
  733. return;
  734. }
  735.  
  736.  
  737.  
  738. buildWeaponName( baseName, attachment1, attachment2 )
  739. {
  740. if ( !isDefined( level.letterToNumber ) )
  741. level.letterToNumber = makeLettersToNumbers();
  742.  
  743. // disable bling when perks are disabled
  744. if ( getDvarInt ( "scr_game_perks" ) == 0 )
  745. {
  746. attachment2 = "none";
  747.  
  748. if ( baseName == "onemanarmy" )
  749. return ( "beretta_mp" );
  750. }
  751.  
  752. weaponName = baseName;
  753. attachments = [];
  754.  
  755. if ( attachment1 != "none" && attachment2 != "none" )
  756. {
  757. if ( level.letterToNumber[attachment1[0]] < level.letterToNumber[attachment2[0]] )
  758. {
  759.  
  760. attachments[0] = attachment1;
  761. attachments[1] = attachment2;
  762.  
  763. }
  764. else if ( level.letterToNumber[attachment1[0]] == level.letterToNumber[attachment2[0]] )
  765. {
  766. if ( level.letterToNumber[attachment1[1]] < level.letterToNumber[attachment2[1]] )
  767. {
  768. attachments[0] = attachment1;
  769. attachments[1] = attachment2;
  770. }
  771. else
  772. {
  773. attachments[0] = attachment2;
  774. attachments[1] = attachment1;
  775. }
  776. }
  777. else
  778. {
  779. attachments[0] = attachment2;
  780. attachments[1] = attachment1;
  781. }
  782. }
  783. else if ( attachment1 != "none" )
  784. {
  785. attachments[0] = attachment1;
  786. }
  787. else if ( attachment2 != "none" )
  788. {
  789. attachments[0] = attachment2;
  790. }
  791.  
  792. foreach ( attachment in attachments )
  793. {
  794. weaponName += "_" + attachment;
  795. }
  796.  
  797. if ( !isValidWeapon( weaponName + "_mp" ) )
  798. return ( baseName + "_mp" );
  799. else
  800. return ( weaponName + "_mp" );
  801. }
  802.  
  803.  
  804. makeLettersToNumbers()
  805. {
  806. array = [];
  807.  
  808. array["a"] = 0;
  809. array["b"] = 1;
  810. array["c"] = 2;
  811. array["d"] = 3;
  812. array["e"] = 4;
  813. array["f"] = 5;
  814. array["g"] = 6;
  815. array["h"] = 7;
  816. array["i"] = 8;
  817. array["j"] = 9;
  818. array["k"] = 10;
  819. array["l"] = 11;
  820. array["m"] = 12;
  821. array["n"] = 13;
  822. array["o"] = 14;
  823. array["p"] = 15;
  824. array["q"] = 16;
  825. array["r"] = 17;
  826. array["s"] = 18;
  827. array["t"] = 19;
  828. array["u"] = 20;
  829. array["v"] = 21;
  830. array["w"] = 22;
  831. array["x"] = 23;
  832. array["y"] = 24;
  833. array["z"] = 25;
  834.  
  835. return array;
  836. }
  837.  
  838. setKillstreaks( streak1, streak2, streak3 )
  839. {
  840. self.killStreaks = [];
  841.  
  842. if ( self _hasPerk( "specialty_hardline" ) )
  843. modifier = -1;
  844. else
  845. modifier = 0;
  846.  
  847. /*if ( streak1 == "none" && streak2 == "none" && streak3 == "none" )
  848. {
  849. streak1 = "uav";
  850. streak2 = "precision_airstrike";
  851. streak3 = "helicopter";
  852. }*/
  853.  
  854. killStreaks = [];
  855.  
  856. if ( streak1 != "none" )
  857. {
  858. //if ( !level.splitScreen )
  859. streakVal = int( tableLookup( "mp/killstreakTable.csv", 1, streak1, 4 ) );
  860. //else
  861. // streakVal = int( tableLookup( "mp/killstreakTable.csv", 1, streak1, 5 ) );
  862. killStreaks[streakVal + modifier] = streak1;
  863. }
  864.  
  865. if ( streak2 != "none" )
  866. {
  867. //if ( !level.splitScreen )
  868. streakVal = int( tableLookup( "mp/killstreakTable.csv", 1, streak2, 4 ) );
  869. //else
  870. // streakVal = int( tableLookup( "mp/killstreakTable.csv", 1, streak2, 5 ) );
  871. killStreaks[streakVal + modifier] = streak2;
  872. }
  873.  
  874. if ( streak3 != "none" )
  875. {
  876. //if ( !level.splitScreen )
  877. streakVal = int( tableLookup( "mp/killstreakTable.csv", 1, streak3, 4 ) );
  878. //else
  879. // streakVal = int( tableLookup( "mp/killstreakTable.csv", 1, streak3, 5 ) );
  880. killStreaks[streakVal + modifier] = streak3;
  881. }
  882.  
  883. // foreach doesn't loop through numbers arrays in number order; it loops through the elements in the order
  884. // they were added. We'll use this to fix it for now.
  885. maxVal = 0;
  886. foreach ( streakVal, streakName in killStreaks )
  887. {
  888. if ( streakVal > maxVal )
  889. maxVal = streakVal;
  890. }
  891.  
  892. for ( streakIndex = 0; streakIndex <= maxVal; streakIndex++ )
  893. {
  894. if ( !isDefined( killStreaks[streakIndex] ) )
  895. continue;
  896.  
  897. streakName = killStreaks[streakIndex];
  898.  
  899. self.killStreaks[ streakIndex ] = killStreaks[ streakIndex ];
  900. }
  901. // end lameness
  902.  
  903. // defcon rollover
  904. maxRollOvers = 10;
  905. newKillstreaks = self.killstreaks;
  906. for ( rollOver = 1; rollOver <= maxRollOvers; rollOver++ )
  907. {
  908. foreach ( streakVal, streakName in self.killstreaks )
  909. {
  910. newKillstreaks[ streakVal + (maxVal*rollOver) ] = streakName + "-rollover" + rollOver;
  911. }
  912. }
  913.  
  914. self.killstreaks = newKillstreaks;
  915. }
  916.  
  917.  
  918. replenishLoadout() // used by ammo hardpoint.
  919. {
  920. team = self.pers["team"];
  921. class = self.pers["class"];
  922.  
  923. weaponsList = self GetWeaponsListAll();
  924. for( idx = 0; idx < weaponsList.size; idx++ )
  925. {
  926. weapon = weaponsList[idx];
  927.  
  928. self giveMaxAmmo( weapon );
  929. self SetWeaponAmmoClip( weapon, 9999 );
  930.  
  931. if ( weapon == "claymore_mp" || weapon == "claymore_detonator_mp" )
  932. self setWeaponAmmoStock( weapon, 2 );
  933. }
  934.  
  935. if ( self getAmmoCount( level.classGrenades[class]["primary"]["type"] ) < level.classGrenades[class]["primary"]["count"] )
  936. self SetWeaponAmmoClip( level.classGrenades[class]["primary"]["type"], level.classGrenades[class]["primary"]["count"] );
  937.  
  938. if ( self getAmmoCount( level.classGrenades[class]["secondary"]["type"] ) < level.classGrenades[class]["secondary"]["count"] )
  939. self SetWeaponAmmoClip( level.classGrenades[class]["secondary"]["type"], level.classGrenades[class]["secondary"]["count"] );
  940. }
  941.  
  942.  
  943. onPlayerConnecting()
  944. {
  945. for(;;)
  946. {
  947. level waittill( "connected", player );
  948.  
  949. if ( !isDefined( player.pers["class"] ) )
  950. {
  951. player.pers["class"] = "";
  952. }
  953. player.class = player.pers["class"];
  954. player.lastClass = "";
  955. player.detectExplosives = false;
  956. player.bombSquadIcons = [];
  957. player.bombSquadIds = [];
  958. }
  959. }
  960.  
  961.  
  962. fadeAway( waitDelay, fadeDelay )
  963. {
  964. wait waitDelay;
  965.  
  966. self fadeOverTime( fadeDelay );
  967. self.alpha = 0;
  968. }
  969.  
  970.  
  971. setClass( newClass )
  972. {
  973. self.curClass = newClass;
  974. }
  975.  
  976. getPerkForClass( perkSlot, className )
  977. {
  978. class_num = getClassIndex( className );
  979.  
  980. if( isSubstr( className, "custom" ) )
  981. return cac_getPerk( class_num, perkSlot );
  982. else
  983. return table_getPerk( level.classTableName, class_num, perkSlot );
  984. }
  985.  
  986.  
  987. classHasPerk( className, perkName )
  988. {
  989. return( getPerkForClass( 0, className ) == perkName || getPerkForClass( 1, className ) == perkName || getPerkForClass( 2, className ) == perkName );
  990. }
  991.  
  992. isValidPrimary( refString )
  993. {
  994. switch ( refString )
  995. {
  996. case "riotshield":
  997. case "ak47":
  998. case "m16":
  999. case "m4":
  1000. case "fn2000":
  1001. case "masada":
  1002. case "famas":
  1003. case "fal":
  1004. case "scar":
  1005. case "tavor":
  1006. case "mp5k":
  1007. case "uzi":
  1008. case "p90":
  1009. case "kriss":
  1010. case "ump45":
  1011. case "barrett":
  1012. case "wa2000":
  1013. case "m21":
  1014. case "cheytac":
  1015. case "rpd":
  1016. case "sa80":
  1017. case "mg4":
  1018. case "m240":
  1019. case "aug":
  1020. return true;
  1021. default:
  1022. assertMsg( "Replacing invalid primary weapon: " + refString );
  1023. return false;
  1024. }
  1025. }
  1026.  
  1027. isValidSecondary( refString )
  1028. {
  1029. switch ( refString )
  1030. {
  1031. case "beretta":
  1032. case "usp":
  1033. case "deserteagle":
  1034. case "coltanaconda":
  1035. case "glock":
  1036. case "beretta393":
  1037. case "pp2000":
  1038. case "tmp":
  1039. case "m79":
  1040. case "rpg":
  1041. case "at4":
  1042. case "stinger":
  1043. case "javelin":
  1044. case "ranger":
  1045. case "model1887":
  1046. case "striker":
  1047. case "aa12":
  1048. case "m1014":
  1049. case "spas12":
  1050. case "onemanarmy":
  1051. return true;
  1052. default:
  1053. assertMsg( "Replacing invalid secondary weapon: " + refString );
  1054. return false;
  1055. }
  1056. }
  1057.  
  1058. isValidAttachment( refString )
  1059. {
  1060. switch ( refString )
  1061. {
  1062. case "none":
  1063. case "acog":
  1064. case "reflex":
  1065. case "silencer":
  1066. case "grip":
  1067. case "gl":
  1068. case "akimbo":
  1069. case "thermal":
  1070. case "shotgun":
  1071. case "heartbeat":
  1072. case "fmj":
  1073. case "rof":
  1074. case "xmags":
  1075. case "eotech":
  1076. case "tactical":
  1077. return true;
  1078. default:
  1079. assertMsg( "Replacing invalid equipment weapon: " + refString );
  1080. return false;
  1081. }
  1082. }
  1083.  
  1084. isValidCamo( refString )
  1085. {
  1086. switch ( refString )
  1087. {
  1088. case "none":
  1089. case "woodland":
  1090. case "desert":
  1091. case "arctic":
  1092. case "digital":
  1093. case "red_urban":
  1094. case "red_tiger":
  1095. case "blue_tiger":
  1096. case "orange_fall":
  1097. return true;
  1098. default:
  1099. assertMsg( "Replacing invalid camo: " + refString );
  1100. return false;
  1101. }
  1102. }
  1103.  
  1104. isValidEquipment( refString )
  1105. {
  1106. switch ( refString )
  1107. {
  1108. case "frag_grenade_mp":
  1109. case "semtex_mp":
  1110. case "throwingknife_mp":
  1111. case "specialty_tacticalinsertion":
  1112. case "specialty_blastshield":
  1113. case "claymore_mp":
  1114. case "c4_mp":
  1115. return true;
  1116. default:
  1117. assertMsg( "Replacing invalid equipment: " + refString );
  1118. return false;
  1119. }
  1120. }
  1121.  
  1122.  
  1123. isValidOffhand( refString )
  1124. {
  1125. switch ( refString )
  1126. {
  1127. case "flash_grenade":
  1128. case "concussion_grenade":
  1129. case "smoke_grenade":
  1130. return true;
  1131. default:
  1132. assertMsg( "Replacing invalid offhand: " + refString );
  1133. return false;
  1134. }
  1135. }
  1136.  
  1137. isValidPerk1( refString )
  1138. {
  1139. switch ( refString )
  1140. {
  1141. case "specialty_marathon":
  1142. case "specialty_fastreload":
  1143. case "specialty_scavenger":
  1144. case "specialty_bling":
  1145. case "specialty_onemanarmy":
  1146. return true;
  1147. default:
  1148. assertMsg( "Replacing invalid perk1: " + refString );
  1149. return false;
  1150. }
  1151. }
  1152.  
  1153. isValidPerk2( refString )
  1154. {
  1155. switch ( refString )
  1156. {
  1157. case "specialty_bulletdamage":
  1158. case "specialty_lightweight":
  1159. case "specialty_hardline":
  1160. case "specialty_coldblooded":
  1161. case "specialty_explosivedamage":
  1162. return true;
  1163. default:
  1164. assertMsg( "Replacing invalid perk2: " + refString );
  1165. return false;
  1166. }
  1167. }
  1168.  
  1169. isValidPerk3( refString )
  1170. {
  1171. switch ( refString )
  1172. {
  1173. case "specialty_extendedmelee":
  1174. case "specialty_bulletaccuracy":
  1175. case "specialty_localjammer":
  1176. case "specialty_heartbreaker":
  1177. case "specialty_detectexplosive":
  1178. return true;
  1179. default:
  1180. assertMsg( "Replacing invalid perk3: " + refString );
  1181. return false;
  1182. }
  1183. }
  1184.  
  1185. isValidDeathStreak( refString )
  1186. {
  1187. switch ( refString )
  1188. {
  1189. case "specialty_copycat":
  1190. return true;
  1191. default:
  1192. assertMsg( "Replacing invalid death streak: " + refString );
  1193. return false;
  1194. }
  1195. }
  1196.  
  1197. isValidWeapon( refString )
  1198. {
  1199. if ( !isDefined( level.weaponRefs ) )
  1200. {
  1201. level.weaponRefs = [];
  1202.  
  1203. foreach ( weaponRef in level.weaponList )
  1204. level.weaponRefs[ weaponRef ] = true;
  1205. }
  1206.  
  1207. if ( isDefined( level.weaponRefs[ refString ] ) )
  1208. return true;
  1209.  
  1210. assertMsg( "Replacing invalid weapon/attachment combo: " + refString );
  1211.  
  1212. return false;
  1213. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement