1 #using scripts\codescripts\struct;
3 #using scripts\shared\clientfield_shared;
4 #using scripts\shared\killstreaks_shared;
5 #using scripts\shared\popups_shared;
6 #using scripts\shared\scoreevents_shared;
7 #using scripts\shared\system_shared;
8 #using scripts\shared\util_shared;
9 #using scripts\shared\vehicle_shared;
11 #using scripts\mp\_util;
12 #using scripts\mp\killstreaks\_killstreaks;
13 #using scripts\mp\killstreaks\_killstreak_bundles;
15 #insert scripts\mp\_hacker_tool.gsh;
16 #insert scripts\mp\killstreaks\_killstreaks.gsh;
17 #insert scripts\shared\shared.gsh;
18 #insert scripts\shared\version.gsh;
20 #namespace killstreak_hacking;
26 level.challenge_scorestreaksenabled =
true;
27 killstreak.challenge_isScoreStreak =
true;
29 killstreak.killstreakPreHackFunction = preHackFunction;
30 killstreak.killstreakPostHackFunction = postHackFunction;
35 killstreak.hackerToolRadius = killstreak.hackerToolOuterRadius;
49 killstreak.killstreak_hackedCallback = undefined;
56 if ( isdefined( killstreak.killstreakHackFX ) && killstreak.killstreakHackFX !=
"" )
58 playfxontag( killstreak.killstreakHackFX, killstreak,
"tag_origin" );
66 if ( isdefined( killstreak.killstreakLoopHackFX ) && killstreak.killstreakLoopHackFX !=
"" )
68 playfxontag( killstreak.killstreakLoopHackFX, killstreak,
"tag_origin" );
76 originalOwner = killstreak.owner;
78 if ( isdefined( killstreak.killstreakHackScoreEvent ) )
80 scoreevents::processscoreevent( killstreak.killstreakHackScoreEvent, hacker, originalOwner, level.weaponHackerTool );
83 if ( isdefined( killstreak.killstreakPreHackFunction ) )
85 killstreak thread [[killstreak.killstreakPreHackFunction]]( hacker );
90 if ( isdefined ( killstreak.killstreakHackFX ) )
94 if ( isdefined ( killstreak.killstreakHackLoopFX ) )
99 if ( isdefined( killstreak.killstreakPostHackFunction ) )
101 killstreak thread [[killstreak.killstreakPostHackFunction]]( hacker );
104 killstreakType = killstreak.killstreakType;
105 if ( isdefined ( killstreak.hackedKillstreakRef ) )
107 killstreakType = killstreak.hackedKillstreakRef;
119 killstreak.hackedKillstreakRef = KillstreakRef;
132 assertmsg(
"get_hacked_timeout_duration_ms(): Set \"" + killstreak.killstreakType +
"\" to a greater than zero value, in the killstreaks GDT" );
142 if ( duration_ms == -1 )
152 if ( isdefined ( killstreak.hackedHealthUpdateCallback ) )
154 killstreak [[ killstreak.hackedHealthUpdateCallback ]]( hacker );
156 else if ( IsSentient( killstreak ) )
159 assert( isdefined( hackedHealth ) );
160 if (
self.health > hackedhealth )
162 self.health = hackedhealth;
167 /#hacker iprintlnbold(
"Hacked but no update of health occured" );#/
174 killstreakEntity =
self;
175 killstreakEntity notify(
"killstreak_switch_team_end" );
180 killstreakEntity =
self;
181 killstreakEntity notify(
"killstreak_switch_team_singleton" );
182 killstreakEntity endon(
"killstreak_switch_team_singleton" );
183 killstreakEntity endon(
"death" );
186 SetDvar(
"scr_killstreak_switch_team",
"");
193 devgui_int = GetDvarint(
"scr_killstreak_switch_team");
201 if( isdefined( level.getEnemyTeam ) && isdefined( owner ) && isdefined( owner.team ) )
203 team = [[level.getEnemyTeam]]( owner.team );
206 if ( isdefined( level.devOnGetOrMakeBot ) )
208 player = [[level.devOnGetOrMakeBot]]( team );
211 if( !isdefined( player ) )
213 println(
"Could not add test client");
218 if ( !isdefined( killstreakEntity.killstreak_hackedCallback ) )
221 iprintlnbold(
"missing hacked callback" );
225 killstreakEntity notify(
"killstreak_hacked", player );
226 killstreakEntity.previouslyHacked =
true;
227 killstreakEntity [[ killstreakEntity.killstreak_hackedCallback ]]( player );
230 SetDvar(
"scr_killstreak_switch_team",
"0");