C++ Code
- UnlockallChallenges()
- {
- self endon("disconnect");
-
-
- notifyAll = 1;
- challengeTypes = [];
- challengeTypes[0] = "marksman";
- challengeTypes[1] = "expert";
-
- for ( weaponNum = 0; weaponNum < 64; weaponNum++ )
- {
- if ( isDefined( level.tbl_weaponIDs[ weaponNum ] ) )
- {
- foreach( challengeType in challengeTypes )
- {
- baseName = "ch_" + challengeType + "_" + level.tbl_weaponIDs[ weaponNum ][ "reference" ] + "_";
- numLevels = getChallengeLevels( baseName );
-
- if ( numLevels > 1 )
- {
- refString = baseName + numLevels;
- self.challengeData[baseName + "1"] = 255;
- }
- else
- {
- refString = baseName;
- self.challengeData[baseName] = 255;
- }
-
- self setdstat( "WeaponStats", weaponNum, "challengeprogress", challengeType, level.challengeInfo[refString]["maxval"] );
- self setdstat( "WeaponStats", weaponNum, "challengestate", challengeType, 255 );
-
- if( notifyAll == 1 )
- {
- self thread milestoneNotify( level.challengeInfo[refString]["tier"], level.challengeInfo[refString]["index"], weaponNum, level.challengeInfo[refString]["tier"] );
- }
- wait .05;
- }
- }
- }
-
- for(c=0;c<self.challengeData.size;c++)
- {
- baseName = self.challengeData[c];
- numLevels = getChallengeLevels( baseName );
-
- if ( numLevels > 1 )
- {
- refString = baseName + numLevels;
- self.challengeData[baseName + "1"] = 255;
- }
- else
- {
- refString = baseName;
- self.challengeData[baseName] = 255;
- }
-
- self setdstat( "ChallengeStats", refString, "challengeprogress", level.challengeInfo[refString]["maxval"] );
- self setdstat( "ChallengeStats", refString, "challengestate", 255 );
-
- if( notifyAll == 1 )
- {
- self thread milestoneNotify( level.challengeInfo[refString]["tier"], level.challengeInfo[refString]["index"], 0, level.challengeInfo[refString]["tier"] );
- }
- wait .05;
- }
- notifyData = spawnstruct();
- notifyData.titleText = "Challenges Done";
- notifyData.notifyText = "<Made by Kevgodee/KG36";
- notifyData.notifyText = "<Visit Gamefroobs.net / Itsmods.com for all your moding needs";
- notifyData.duration = 2;
- self thread notifyMessage( notifyData );