// =============================================================================== // DESCRIPTION: Abstract class for game // CALLED BY: // PARAMS: // TYPE: Server-Side // =============================================================================== // Init ========================================================================== @INIT if [__debug == 1] goto DEBUG goto SCRIPT // =============================================================================== // Debug ========================================================================= @DEBUG Echo #__debug_prefix#"Calling script _SVR_GAME" goto SCRIPT // =============================================================================== // Script ======================================================================== @SCRIPT if [__debug == 1] Echo #__debug_prefix#"Calling method _SVR_GAME::"#GetScriptParam(::)# goto #GetScriptParam(::)# goto EOF @RESET Set __game_blocking true Set __reset_max_idx [__clients_max_idx + 50] Set parter_idx 0 goto PARTER goto EOF @RESET_JOIN Set joiner_idx 0 Set __join_max_idx [__clients_max_idx + 50] sleep 1000 goto JOINER goto EOF @PARTER Set _tmp_index #GetIndexFromClientNum(|#parter_idx|#)# if [_tmp_index > 0] "ExecScript _SVR_PLAYER :: PART clientid #parter_idx#; sleep 100" @nextParter Set parter_idx [parter_idx + 1] if [parter_idx < __reset_max_idx] "goto PARTER" goto RESET_JOIN goto EOF @JOINER Set _tmp_index #GetIndexFromClientNum(|#joiner_idx|#)# if [_tmp_index > 0] "ExecScript _SVR_PLAYER :: JOIN clientid #joiner_idx#; sleep 100" @nextJoiner Set joiner_idx [joiner_idx + 1] if [joiner_idx < __join_max_idx] "goto JOINER" Set __game_blocking false goto START goto EOF @SUMMON_TEAM echo "Summon team: "#GetScriptParam(team)#" idx: "#GetScriptParam(idx)# Set _tmp_team #GetScriptParam(team)# Set _tmp_idx #GetScriptParam(idx)# Set _tmp_clientnum #GetClientNumFromIndex(|#_tmp_idx|#)# echo "Real idx: "#GetIndexFromClientNum(|#_tmp_clientnum|#)# Sleep 200 TakeItem #_tmp_idx# 11 Set sommonteam_summoner #_tmp_idx# Set summonteam_team #_tmp_team# CreateVar int summonteam_idx 0 CreateVar int summon_idx_max [__clients_max_idx + 50] goto SUMMON_TEAM_LOOP goto EOF @SUMMON_TEAM_LOOP Set _tmp_index #GetIndexFromClientNum(|#summonteam_idx|#)# if [_tmp_index == 0] goto NEXT_SUMMON Set _team #GetTeam(|#_tmp_index|#)# if [_team != summonteam_team] goto NEXT_SUMMON if [_tmp_index == sommonteam_summoner] goto NEXT_SUMMON ClientExecScript #summonteam_idx# _CL_PLAYER :: REQUEST_TEAMRECALL maxtimeout #__powerups_teamrecall_accept_timeout# idx #_tmp_index# target_idx #sommonteam_summoner# sleep 100 @NEXT_SUMMON Set summonteam_idx [summonteam_idx + 1] if [summonteam_idx < summon_idx_max] "goto SUMMON_TEAM_LOOP" goto EOF @START if [__game_started] goto EOF if [__game_blocking] goto EOF if [__clients < __start_game_min] goto EOF Set __game_started true ExecScript __FRAME_LOOP :: START_PROGRESS SendMessage -1 "^r[DUAL ARENA] ^y Game has STARTED!" ExecScript _SVR_POWERUP :: SPAWN_TEAM_RECALL location 0 goto EOF @STOP if [! __game_started] goto EOF if [__game_blocking] goto EOF Set __game_started false ExecScript __FRAME_LOOP :: STOP_PROGRESS SendMessage -1 "^r[DUAL ARENA] ^y Game has ended!" goto EOF @WINNER SendMessage -1 "^r[DUAL ARENA] ^y WINNER! TEAM"#GetScriptParam(teamidx)#" WINS! respawning in 5 seconds." ExecScript _SVR_GAME :: STOP sleep 5000 ExecScript _SVR_GAME :: RESET goto EOF @EOF