‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_arena.gsc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\callbacks_shared;
4 #using scripts\shared\system_shared;
5 #using scripts\shared\util_shared;
6 
7 #insert scripts\shared\shared.gsh;
8 
9 #using scripts\mp\teams\_teams;
10 
11 #namespace arena;
12 
13 ‪REGISTER_SYSTEM( "arena", &‪__init__, undefined )
14 
15 function ‪__init__()
16 {
18 }
19 
20 function ‪on_connect()
21 {
22  if( isdefined( self.pers["arenaInit"] ) && self.pers["arenaInit"] == 1 )
23  {
24  return;
25  }
26 
27  draftEnabled = ( GetGametypeSetting( "pregameDraftEnabled" ) == 1 );
28  voteEnabled = ( GetGametypeSetting( "pregameItemVoteEnabled" ) == 1 );
29 
30  if( !draftEnabled && !voteEnabled )
31  {
32  self ArenaBeginMatch();
33  }
34 
35  self.pers["arenaInit"] = 1;
36 }
37 
39 {
40  perSeasonWins = self GetDStat( "arenaPerSeasonStats", "wins" );
41  if( perSeasonWins >= GetDvarInt( "arena_seasonVetChallengeWins" ) )
42  {
43  arenaSlot = ArenaGetSlot();
44  currentSeason = self GetDStat( "arenaStats", arenaSlot, "season" );
45  seasonVetChallengeArrayCount = self GetDStatArrayCount( "arenaChallengeSeasons" );
46  for( i = 0; i < seasonVetChallengeArrayCount; i++ )
47  {
48  challengeSeason = self GetDStat( "arenaChallengeSeasons", i );
49  if( challengeSeason == currentSeason ) // don't add a single season more than once
50  {
51  return;
52  }
53 
54  if( challengeSeason == 0 )
55  {
56  self SetDStat( "arenaChallengeSeasons", i, currentSeason );
57  break;
58  }
59  }
60  }
61 }
62 
63 function ‪match_end( winner )
64 {
65  for( index = 0; index < level.players.size; index++ )
66  {
67  player = level.players[index];
68 
69  if( isdefined( player.pers["arenaInit"] ) && player.pers["arenaInit"] == 1 )
70  {
71  if( winner == "tie" )
72  {
73  player ArenaEndMatch( 0 );
74  }
75  else if( winner == player.pers["team"] )
76  {
77  player ArenaEndMatch( 1 );
79  }
80  else
81  {
82  player ArenaEndMatch( -1 );
83  }
84  }
85  }
86 }
87 
88 
‪update_arena_challenge_seasons
‪function update_arena_challenge_seasons()
Definition: _arena.gsc:38
‪match_end
‪function match_end(winner)
Definition: _arena.gsc:63
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪__init__
‪function __init__()
Definition: _arena.gsc:15
‪on_connect
‪function on_connect()
Definition: _arena.gsc:20