Gord

Random GT with AA Drop/Delete Trigger

Feb 13th, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 16.52 KB | None | 0 0
  1. define vars global {
  2.     integer0 as integer = 0
  3.     integer1 as integer = 1
  4.     no priority {
  5.         player0 as player
  6.     }
  7. }
  8.  
  9. define vars object {
  10.     object0 as object
  11. }
  12.  
  13. define vars team {
  14.     no priority {
  15.         integer0 as integer = 0
  16.     }
  17. }
  18.  
  19. define event_handler round_start {
  20.     if game.teams_enabled = 0 {
  21.         toggle_automatic_scoring(false)
  22.     }
  23.     global.integer1 = 1
  24. }
  25.  
  26. define event_handler pregame {
  27.     game.symmetry = 1
  28. }
  29.  
  30. define event_handler tick {
  31.     for each current_team0 in teams {
  32.         toggle_fireteam(current_team0, false)
  33.         toggle_team_respawn_in_vehicle(current_team0, false)
  34.     }
  35.     for each current_player0 in players {
  36.         if global.player0 = none and game.score_limit > 0 and game.teams_enabled = 0 and current_player0.score >= game.score_limit {
  37.             actionAC(current_player0, 0.5019531)
  38.             global.player0 = current_player0
  39.         }
  40.     }
  41.     for each current_player0 in players {
  42.         rank = 0
  43.         temp_integer1 = 0
  44.         tied = 0
  45.         if game.teams_enabled = 1 {
  46.             temp_team0 = current_player0.team
  47.             if temp_team0.score > 0 {
  48.                 rank = get_team_rank(current_player0.team)
  49.                 if rank = 1 {
  50.                     tied = teams_tied_for_first_place()
  51.                     if tied = 0 {
  52.                         temp_integer1 = 1
  53.                     }
  54.                 }
  55.             }
  56.         }
  57.         if game.teams_enabled = 0 and current_player0.score > 0 {
  58.             rank = get_rank(current_player0)
  59.             if rank = 1 {
  60.                 tied = players_tied_for_first_place()
  61.                 if tied = 0 {
  62.                     temp_integer1 = 1
  63.                 }
  64.             }
  65.         }
  66.         if temp_integer1 = 1 {
  67.             apply_traits(current_player0, traits.leader_traits)
  68.         }
  69.     }
  70.     for each current_team0 in teams {
  71.         if global.integer0 = 0 and game.score_limit != 0 and game.teams_enabled = 1 {
  72.             temp_integer3 = options.kill_points * 5
  73.             temp_integer4 = temp_integer3 * 2
  74.             temp_integer5 = game.score_limit - temp_integer3
  75.             temp_integer6 = game.score_limit - options.kill_points
  76.             if game.score_limit >= temp_integer4 and current_team0.score < temp_integer6 and current_team0.score >= temp_integer5 {
  77.                 submit_incident(incidents.slayer_5kills_to_win_hb, current_team0, current_team0)
  78.                 global.integer0 = 1
  79.             }
  80.         }
  81.     }
  82.     for each current_team0 in teams {
  83.         if game.teams_enabled = 1 and game.score_limit != 0 and current_team0.integer0 = 0 {
  84.             temp_integer7 = game.score_limit - options.kill_points
  85.             if current_team0.score < game.score_limit and current_team0.score >= temp_integer7 {
  86.                 submit_incident(incidents.next_kill_wins, current_team0, current_team0)
  87.                 current_team0.integer0 = 1
  88.             }
  89.         }
  90.     }
  91.     for each current_player0 in players {
  92.         if options.solo_kill_bonus != 0 and player_check_killer_type(current_player0, 4) {
  93.             temp_integer8 = 0
  94.             temp_player0 = current_player0
  95.             for each current_player1 in players {
  96.                 if player_assisted(current_player1, temp_player0) {
  97.                     temp_integer8 = 1
  98.                 }
  99.             }
  100.             if temp_integer8 = 0 {
  101.                 killer = get_killer(temp_player0) or current_player0
  102.                 killer.score += options.solo_kill_bonus
  103.                 if game.teams_enabled = 1 {
  104.                     killer.team.score += options.solo_kill_bonus
  105.                 }
  106.                 if game.score_limit > 0 {
  107.                     if game.teams_enabled = 1 {
  108.                         temp_team1 = killer.team
  109.                         if temp_team1.score >= game.score_limit {
  110.                             actionAC(killer, 0.5019531)
  111.                         }
  112.                     }
  113.                     if game.teams_enabled = 0 and killer.score >= game.score_limit {
  114.                         actionAC(killer, 0.5019531)
  115.                     }
  116.                 }
  117.             }
  118.         }
  119.     }
  120.     if global.integer1 = 1 {
  121.         global.integer1 = 0
  122.         if game.teams_enabled = 0 {
  123.             set_medal_points(medals.everything_else_kill, options.kill_points, 1)
  124.             set_medal_points(medals.grenade_kill, options.kill_points, 1)
  125.             set_medal_points(medals.plasma_kill, options.kill_points, 1)
  126.             set_medal_points(medals.supercombine_kill, options.kill_points, 1)
  127.             set_medal_points(medals.sword_kill, options.kill_points, 1)
  128.             set_medal_points(medals.hammer_kill, options.kill_points, 1)
  129.             set_medal_points(medals.rocket_kill, options.kill_points, 1)
  130.             set_medal_points(medals.fuel_rod_kill, options.kill_points, 1)
  131.             set_medal_points(medals.sniper_kill, options.kill_points, 1)
  132.             set_medal_points(medals.binary_rifle_kill, options.kill_points, 1)
  133.             set_medal_points(medals.beam_rifle_kill, options.kill_points, 1)
  134.             set_medal_points(medals.railgun_kill, options.kill_points, 1)
  135.             set_medal_points(medals.splaser_kill, options.kill_points, 1)
  136.             set_medal_points(medals.melee_kill, options.kill_points, 1)
  137.             set_medal_points(medals.revenge, options.revenge_bonus, 1)
  138.             temp_integer9 = options.kill_points + options.headshot_bonus
  139.             set_medal_points(medals.headshot_kill, temp_integer9, 1)
  140.             temp_integer10 = options.kill_points + options.pummel_bonus
  141.             set_medal_points(medals.beatdown_kill, temp_integer10, 1)
  142.             temp_integer11 = options.kill_points + options.splatter_bonus
  143.             set_medal_points(medals.splatter_kill, temp_integer11, 1)
  144.             temp_integer12 = options.kill_points + options.vehicle_kill_bonus
  145.             set_medal_points(medals.vehicle_kill, temp_integer12, 1)
  146.             temp_integer13 = options.kill_points + options.assassination_bonus
  147.             set_medal_points(medals.assassination_kill, temp_integer13, 1)
  148.             set_medal_points(medals.airsassination_kill, temp_integer13, 1)
  149.             set_medal_points(medals.assist, options.assist_points, 1)
  150.             set_medal_points(medals.emp_assist, options.assist_points, 1)
  151.             set_medal_points(medals.wheelman, options.assist_points, 1)
  152.             set_medal_points(medals.vehicle_destroy_assist, options.assist_points, 1)
  153.             set_medal_points(medals.distraction, options.assist_points, 1)
  154.         }
  155.     }
  156.     for each current_team0 in teams {
  157.         temp_integer14 = game.score_limit
  158.         temp_integer15 = options.kill_points * 10
  159.         temp_integer14 -= temp_integer15
  160.         if current_team0.score >= temp_integer14 {
  161.             disable_join_in_progress(true)
  162.         }
  163.     }
  164.     for each current_player0 in players {
  165.         temp_integer16 = game.score_limit
  166.         temp_integer17 = options.kill_points * 5
  167.         temp_integer16 -= temp_integer17
  168.         if current_player0.score >= temp_integer16 {
  169.             disable_join_in_progress(true)
  170.         }
  171.     }
  172.     if game.round_duration > 0 and timer_is_zero(timers.round_timer) {
  173.         end_round()
  174.     }
  175.     for each current_object0 in objects {
  176.         if object_matches_type(current_object0, object_types.reflective_shield) or object_matches_type(current_object0, object_types.jet_pack_equipment) or object_matches_type(current_object0, object_types.thruster_pack_equipment) or object_matches_type(current_object0, object_types.xray) or object_matches_type(current_object0, object_types.hologram_equipment) or object_matches_type(current_object0, object_types.active_camo_equipment) or object_matches_type(current_object0, object_types.regen_field_equipment) or object_matches_type(current_object0, object_types.auto_turret) {
  177.             if current_object0.object0 != none {
  178.                 get_owner_player_biped(current_object0, temp_object0)
  179.                 if current_object0.object0 != temp_object0 {
  180.                     delete_object(current_object0)
  181.                 }
  182.             }
  183.             if current_object0.object0 = none {
  184.                 get_owner_player_biped(current_object0, current_object0.object0)
  185.             }
  186.         }
  187.     }
  188. }
  189.  
  190. define event_handler incident {
  191.     if incident_submitted(incidents.round_beginning) {
  192.         global.integer1 = 1
  193.     }
  194.     if incident_submitted(incidents.player_joined) or incident_submitted(incidents.player_rejoined) or incident_submitted(incidents.player_activated) {
  195.         cause_player = get_cause_player()
  196.         if game.score_limit != 0 and game.teams_enabled = 1 {
  197.             set_objective(cause_player, strings.kill_players_on, game.score_limit)
  198.         }
  199.         if game.score_limit != 0 and game.teams_enabled = 0 {
  200.             set_objective(cause_player, strings.score_points_by, game.score_limit)
  201.         }
  202.         if game.score_limit = 0 and game.teams_enabled = 1 {
  203.             set_objective(cause_player, strings.kill_players_on_1)
  204.         }
  205.         if game.score_limit = 0 and game.teams_enabled = 0 {
  206.             set_objective(cause_player, strings.score_points_by_1)
  207.         }
  208.         set_loadout_palette(cause_player, 1)
  209.     }
  210.     if incident_submitted(incidents.player_activated) {
  211.         cause_player = get_cause_player()
  212.         if game.teams_enabled = 0 and options.hidden_gametype = 0 {
  213.             submit_incident(incidents.slayer_infinity_rumble_start, cause_player, none)
  214.         }
  215.         if game.teams_enabled = 1 and options.hidden_gametype = 0 {
  216.             submit_incident(incidents.slayer_infinity_team_start, cause_player, none)
  217.         }
  218.         if game.teams_enabled = 1 and options.hidden_gametype = 7 {
  219.             submit_incident(incidents.swat_team_start, cause_player, none)
  220.         }
  221.         if game.teams_enabled = 0 and options.hidden_gametype = 7 {
  222.             submit_incident(incidents.swat_ffa_start, cause_player, none)
  223.         }
  224.         if game.teams_enabled = 1 and options.hidden_gametype = 2 {
  225.             submit_incident(incidents.slayer_pro_team_start, cause_player, none)
  226.         }
  227.         if game.teams_enabled = 0 and options.hidden_gametype = 2 {
  228.             submit_incident(incidents.slayer_pro_ffa_start, cause_player, none)
  229.         }
  230.     }
  231.     if incident_submitted(incidents.game_over_win) {
  232.         cause_player = get_cause_player()
  233.         submit_incident(incidents.game_complete_slayer_win, cause_player, cause_player)
  234.     }
  235.     if incident_submitted(incidents.game_over_lose) or incident_submitted(incidents.game_over_tie) {
  236.         cause_player = get_cause_player()
  237.         submit_incident(incidents.game_complete_slayer, cause_player, cause_player)
  238.     }
  239.     if incident_submitted(incidents.kill) {
  240.         cause_player = get_cause_player()
  241.         if options.ladder_bonus != 0 {
  242.             temp_integer18 = 0
  243.             temp_integer19 = 0
  244.             affected_player = get_affected_player()
  245.             if game.teams_enabled = 0 {
  246.                 temp_integer19 = cause_player.score
  247.                 temp_integer18 = affected_player.score
  248.             }
  249.             if game.teams_enabled = 1 {
  250.                 temp_team2 = cause_player.team
  251.                 temp_team3 = affected_player.team
  252.                 temp_integer19 = temp_team2.score
  253.                 temp_integer18 = temp_team3.score
  254.             }
  255.             if temp_integer19 < temp_integer18 {
  256.                 cause_player.score += options.ladder_bonus
  257.                 if game.teams_enabled = 1 {
  258.                     cause_player.team.score += options.ladder_bonus
  259.                 }
  260.             }
  261.         }
  262.         if game.teams_enabled = 1 {
  263.             cause_player.team.score += options.kill_points
  264.         }
  265.         if options.spree_bonus != 0 {
  266.             kills = get_consecutive_kills(cause_player)
  267.             if kills >= 5 {
  268.                 cause_player.score += options.spree_bonus
  269.                 if game.teams_enabled = 1 {
  270.                     cause_player.team.score += options.spree_bonus
  271.                 }
  272.             }
  273.         }
  274.     }
  275.     if incident_submitted(incidents.assist) or incident_submitted(incidents.emp_assist) or incident_submitted(incidents.driver_assist_gunner) or incident_submitted(incidents.vehicle_destroy_assist) or incident_submitted(incidents.distraction) {
  276.         cause_player = get_cause_player()
  277.         if game.teams_enabled = 1 {
  278.             cause_player.team.score += options.assist_points
  279.         }
  280.     }
  281.     if options.death_points != 0 and incident_submitted(incidents.death) {
  282.         cause_player = get_cause_player()
  283.         cause_player.score += options.death_points
  284.         if game.teams_enabled = 1 {
  285.             cause_player.team.score += options.death_points
  286.         }
  287.     }
  288.     if options.betrayal_points != 0 and incident_submitted(incidents.kill_betrayal) {
  289.         cause_player = get_cause_player()
  290.         cause_player.score += options.betrayal_points
  291.         if game.teams_enabled = 1 {
  292.             cause_player.team.score += options.betrayal_points
  293.         }
  294.     }
  295.     if options.suicide_bonus != 0 and incident_submitted(incidents.suicide) {
  296.         cause_player = get_cause_player()
  297.         cause_player.score += options.suicide_bonus
  298.         if game.teams_enabled = 1 {
  299.             cause_player.team.score += options.suicide_bonus
  300.         }
  301.     }
  302.     if options.headshot_bonus != 0 and incident_submitted(incidents.headshot_kill) {
  303.         cause_player = get_cause_player()
  304.         if game.teams_enabled = 1 {
  305.             cause_player.team.score += options.headshot_bonus
  306.         }
  307.     }
  308.     if options.pummel_bonus != 0 and incident_submitted(incidents.melee_kill) or incident_submitted(incidents.assassination_kill) {
  309.         cause_player = get_cause_player()
  310.         if game.teams_enabled = 1 {
  311.             cause_player.team.score += options.pummel_bonus
  312.         }
  313.     }
  314.     if options.assassination_bonus != 0 and incident_submitted(incidents.finishing_move_kill) or incident_submitted(incidents.airsassination) {
  315.         cause_player = get_cause_player()
  316.         if game.teams_enabled = 1 {
  317.             cause_player.team.score += options.assassination_bonus
  318.         }
  319.     }
  320.     if options.vehicle_kill_bonus != 0 and incident_submitted(incidents.enemy_vehicle_kill) {
  321.         cause_player = get_cause_player()
  322.         if game.teams_enabled = 1 {
  323.             cause_player.team.score += options.vehicle_kill_bonus
  324.         }
  325.     }
  326.     if options.splatter_bonus != 0 and incident_submitted(incidents.splatter_kill) {
  327.         cause_player = get_cause_player()
  328.         if game.teams_enabled = 1 {
  329.             cause_player.team.score += options.splatter_bonus
  330.         }
  331.     }
  332.     if options.sticky_bonus != 0 and incident_submitted(incidents.sticky_grenade_kill) {
  333.         cause_player = get_cause_player()
  334.         cause_player.score += options.sticky_bonus
  335.         if game.teams_enabled = 1 {
  336.             cause_player.team.score += options.sticky_bonus
  337.         }
  338.     }
  339.     if options.revenge_bonus != 0 and incident_submitted(incidents.revenge_kill) {
  340.         cause_player = get_cause_player()
  341.         if game.teams_enabled = 1 {
  342.             cause_player.team.score += options.revenge_bonus
  343.         }
  344.     }
  345.     if incident_submitted(incidents.minutes_remaining_3) {
  346.         disable_join_in_progress(true)
  347.     }
  348.     if game.teams_enabled = 1 and game.score_limit > 0 and incident_submitted(incidents.kill) or incident_submitted(incidents.assist) or incident_submitted(incidents.emp_assist) or incident_submitted(incidents.driver_assist_gunner) or incident_submitted(incidents.vehicle_destroy_assist) or incident_submitted(incidents.distraction) or incident_submitted(incidents.death) or incident_submitted(incidents.kill_betrayal) or incident_submitted(incidents.suicide) or incident_submitted(incidents.headshot_kill) or incident_submitted(incidents.melee_kill) or incident_submitted(incidents.assassination_kill) or incident_submitted(incidents.finishing_move_kill) or incident_submitted(incidents.airsassination) or incident_submitted(incidents.enemy_vehicle_kill) or incident_submitted(incidents.splatter_kill) or incident_submitted(incidents.sticky_grenade_kill) or incident_submitted(incidents.revenge_kill) or incident_submitted(incidents.multikill_x5) {
  349.         cause_player = get_cause_player()
  350.         temp_team4 = cause_player.team
  351.         if temp_team4.score >= game.score_limit {
  352.             actionAC(cause_player, 0.5019531)
  353.         }
  354.     }
  355. }
  356.  
  357. define event_handler host_change {
  358.     global.integer1 = 1
  359.     if game.teams_enabled = 0 {
  360.         toggle_automatic_scoring(false)
  361.     }
  362. }
Advertisement
Add Comment
Please, Sign In to add comment