burc_2004

tank_drop_powerups

Jul 13th, 2015
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tank_drop_powerups()
  2. {
  3.     flag_wait( "start_zombie_round_logic" );
  4.     a_drop_nodes = [];
  5.     i = 0;
  6.     while ( i < 3 )
  7.     {
  8.         drop_num = i + 1;
  9.         a_drop_nodes[ i ] = getvehiclenode( "tank_powerup_drop_" + drop_num, "script_noteworthy" );
  10.         a_drop_nodes[ i ].next_drop_round = level.round_number + i;
  11.         s_drop = getstruct( "tank_powerup_drop_" + drop_num, "targetname" );
  12.         a_drop_nodes[ i ].drop_pos = s_drop.origin;
  13.         i++;
  14.     }
  15.     a_possible_powerups = array( "nuke", "full_ammo", "zombie_blood", "insta_kill", "fire_sale", "double_points" );
  16.     while ( 1 )
  17.     {
  18.         self ent_flag_wait( "tank_moving" );
  19.         _a129 = a_drop_nodes;
  20.         _k129 = getFirstArrayKey( _a129 );
  21.         while ( isDefined( _k129 ) )
  22.         {
  23.             node = _a129[ _k129 ];
  24.             dist_sq = distance2dsquared( node.origin, self.origin );
  25.             if ( dist_sq < 250000 )
  26.             {
  27.                 a_players = get_players_on_tank( 1 );
  28.                 if ( a_players.size > 0 )
  29.                 {
  30.                     if ( level.staff_part_count[ "elemental_staff_lightning" ] == 0 && level.round_number >= node.next_drop_round )
  31.                     {
  32.                         str_powerup = random( a_possible_powerups );
  33.                         level thread maps/mp/zombies/_zm_powerups::specific_powerup_drop( str_powerup, node.drop_pos );
  34.                         node.next_drop_round = level.round_number + randomintrange( 8, 12 );
  35.                         break;
  36.                     }
  37.                     else
  38.                     {
  39.                         level notify( "sam_clue_tank" );
  40.                     }
  41.                 }
  42.             }
  43.             _k129 = getNextArrayKey( _a129, _k129 );
  44.         }
  45.         wait 2;
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment