prozac-qfcc/haxxx.qc

1352 lines
43 KiB
C++
Raw Normal View History

#include "defs.qh"
#include "menu.qh"
2001-07-17 05:58:10 +00:00
/*=======================================================//
// haxxx.QC - CustomTF 3.2.OfN - 30/1/2001 - //
// Idea and base code by SB-1 tech, rewritten by often //
//=======================================================//
// Hacker related stuff //
//=======================================================*/
void(float input) SBInitiateInterface;
string(entity thebuilding) GetBuildingName;
float(float input) IntToExp;
float (entity hacked) GetICELevel;
float() CheckHaxxx;
void(entity ignore, string st, string st2, string st3, string st4, string st5, string st6) teamsprint6;
void () Menu_Friend_Hax =
{
if (self.demon_two == world) // safety
{
sprint(self,PRINT_HIGH,"You have lost the connection!\n");
2001-07-17 05:58:10 +00:00
ResetMenu();
return;
}
local string st,st2,st3,st4,st5,st6,st7;
st6="\n\nCom<EFBFBD>Link <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
st7=" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n";
st5="\n\n<EFBFBD>.. Hack-Repair <20>8 sec<65>\n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ";
st4="";
st2="\n.. Add <20><><EFBFBD><EFBFBD><EFBFBD> <20> ICE <20>20 sec<65>";
if (!visible2x(self,self.demon_two)) st6="\n\nLost connection with target!\n";
/* else
{
local float dist;
dist = vlen(self.origin - self.demon_two.origin);
if (dist > HAX_UNSTABLEDIST)
2001-07-17 05:58:10 +00:00
{
st6="\n\nUnstable connection with target!\n";
}
}*/
if (Teammate(self.demon_two.real_owner.team_no, self.team_no))
{
if (self.demon_two.classname == "building_dispenser")
{
st7="Target<EFBFBD> Friendly Dispenser\n\n";
st=".. Improve capacity <20>15 sec<65>"; // DONE
st3="\n<EFBFBD>.. Enhance armour <20>10 sec<65>"; // DONE
}
else if (self.demon_two.classname == "building_sentrygun")
{
st7="Target<EFBFBD> Friendly Sentry Gun\n\n";
st=".. Improve capacity <20>10 sec<65>"; // DONE - increase shells only
st3="\n<EFBFBD>.. Enhance armour <20>25 sec<65>";
st4="\n<EFBFBD>.. Enhance circuits <20>30 sec<65>"; // DONE
}
else if (self.demon_two.classname == "building_tesla")
{
st7="Target<EFBFBD> Friendly Tesla Sentry\n\n";
st=".. Improve capacity <20>10 sec<65>"; // DONE
st3="\n<EFBFBD>.. Enhance armour <20>25 sec<65>"; // DONE
st4="\n<EFBFBD>.. Enhance circuits <20>30 sec<65>"; //\n<>.. Add TractorBeam <20>20 sec<65>");
}
else if (self.demon_two.classname == "building_camera")
{
st7="Target<EFBFBD> Friendly Camera\n\n";
st=".. Improve sensors <20>20 sec<65>"; // DONE
st3="\n<EFBFBD>.. Enhance armour <20>20 sec<65>"; // DONE
}
else if (self.demon_two.classname == "building_sensor")
{
st7="Target<EFBFBD> Friendly Motion Sensor\n\n";
st=".. Improve range <20>20 sec<65>"; // DONE
st3="\n<EFBFBD>.. Enhance armour <20>10 sec<65>"; // DONE
st4="\n<EFBFBD>.. Add spy revealer <20>25 sec<65>"; // DONE
}
else if (self.demon_two.classname == "building_teleporter")
{
st7="Target<EFBFBD> Friendly Teleporter\n\n";
st=".. Improve capacity <20>5 sec<65>"; // DONE
st3="\n<EFBFBD>.. Enhance armour <20>20 sec<65>"; // DONE
st4="\n<EFBFBD>.. Increase range <20>30 sec<65>"; // DONE
}
else if (self.demon_two.classname == "building_fieldgen")
{
st7="Target<EFBFBD> Friendly Field Generator\n\n";
st= ".. Improve capacity <20>10 sec<65>"; // DONE
st3="\n<EFBFBD>.. Enhance armour <20>15 sec<65>"; // DONE
st4="\n<EFBFBD>.. Increase range <20>20 sec<65>"; // DONE
}
}
if (self.demon_two.num_mines & IMPROVED_ONE)
2001-07-17 05:58:10 +00:00
{
st="";
}
if (self.demon_two.num_mines & IMPROVED_TWO)
2001-07-17 05:58:10 +00:00
{
st2="\n.. Add <20><><EFBFBD><EFBFBD><EFBFBD> <20> ICE <20>25 sec<65>";
if (self.demon_two.num_mines & IMPROVED_FIVE)
2001-07-17 05:58:10 +00:00
{
st2="\n.. Add <20><><EFBFBD><EFBFBD><EFBFBD> <20> ICE <20>30 sec<65>";
if (self.demon_two.num_mines & IMPROVED_SIX)
2001-07-17 05:58:10 +00:00
st2="\n";
}
}
if (self.demon_two.num_mines & IMPROVED_THREE)
2001-07-17 05:58:10 +00:00
{
st3="\n";
}
if (self.demon_two.classname != "building_sensor")
{
if (self.demon_two.num_mines & IMPROVED_FOUR)
2001-07-17 05:58:10 +00:00
{
st4="\n";
}
}
else
{
if (self.demon_two.num_mines & IMPROVED_FOUR)
2001-07-17 05:58:10 +00:00
{
if (self.demon_two.num_mines & IMPROVED_SEVEN)
2001-07-17 05:58:10 +00:00
st4="\n";
else
st4="\n<EFBFBD>.. Thief revealer <20>25 sec<65>";
}
}
CenterPrint7(self,st7,st,st2,st3,st4,st5,st6);
};
void(float inp) Menu_FriendHax_Inp =
{
if (self.classname != "player" || self.demon_two == world)
return;
if (inp == 10)
{
self.impulse=0;
self.demon_two=world;
ResetMenu();
return;
}
if (inp == 8)
{
self.impulse=0;
SBInitiateInterface(inp);
ResetMenu();
return;
}
if (inp < 5 && inp > 0)
{
if (inp == 4)
{
if (self.demon_two.classname == "building_sensor")
{
if (self.demon_two.num_mines & IMPROVED_FOUR)
2001-07-17 05:58:10 +00:00
inp = 7; // already has spy revealer so go for thief, check if it already has thief revealer below..
}
else if (self.demon_two.classname == "building_dispenser" || self.demon_two.classname == "building_camera")
/*self.demon_two.classname != "building_sentrygun" &&
self.demon_two.classname != "building_sensor" &&
self.demon_two.classname != "building_teleporter" &&
self.demon_two.classname != "building_tesla")*/
return;
}
if (inp == 2 && self.demon_two.num_mines & IMPROVED_SIX)
2001-07-17 05:58:10 +00:00
return; // device completelly iced, so do nothing
if (self.demon_two.num_mines & IntToExp(inp) && inp != 2) // exclude ICE's
return; // device already has this hack done, so do nothing
SBInitiateInterface(inp);
ResetMenu();
self.impulse = 0;
}
};
void(float inp) Menu_EnemyHax_Inp =
{
if (self.classname != "player" || self.demon_two == world)
return;
if (inp == 10)
{
self.impulse=0;
self.demon_two=world;
ResetMenu();
return;
}
if (inp < 5 && inp > 0)
{
if (self.demon_two.is_malfunctioning & IntToExp(inp))
return;
SBInitiateInterface(inp);
ResetMenu();
self.impulse = 0;
}
};
void () Menu_Enemy_Hax =
{
if (self.demon_two == world) // safety
{
sprint(self,PRINT_HIGH,"You have lost the connection!\n");
2001-07-17 05:58:10 +00:00
ResetMenu();
return;
}
local string st,st2,st3,st4,st5,st6,st7;
st=st2=st3=st4=st5=st6=st7="";
2001-07-17 05:58:10 +00:00
st6="\n\nCom<EFBFBD>Link <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
st5="\n\n<EFBFBD>.. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ";
st7=" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n\n";
if (!visible2x(self,self.demon_two)) st6="\n\nLost connection with target!\n";
else
{
local float dist;
dist = vlen(self.origin - self.demon_two.origin);
if (dist > HAX_UNSTABLEDIST)
2001-07-17 05:58:10 +00:00
{
st6="\n\nUnstable connection with target!\n";
}
}
if (!Teammate(self.demon_two.real_owner.team_no, self.team_no))
{
if (self.demon_two.classname == "building_dispenser")
{
st7="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD> Dispenser\n\n";
st=".. Disable <20>3 sec<65>";
st2="\n.. Booby trap <20>6 sec<65>";
st3="\n<EFBFBD>.. No production <20>3 sec<65>";
st4="\n<EFBFBD>.. Subtle bomb <20>4 sec<65>";
}
else if (self.demon_two.classname == "building_sentrygun")
{
st7="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD> Sentry Gun\n\n";
st=".. Incapacitate <20>3 sec<65>";
st2="\n.. Reduce accuracy <20>5 sec<65>";
st3="\n<EFBFBD>.. RL malfunction <20>4 sec<65>";
st4="\n<EFBFBD>.. Hostile takeover <20>12 sec<65>";
}
else if (self.demon_two.classname == "building_tesla")
{
st7="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD> Tesla Sentry\n\n";
st=".. Incapacitate <20>8 sec<65>";
st2="\n.. Reduce output <20>6 sec<65>";
st3="\n<EFBFBD>.. Overload <20>7 sec<65>";
st4="\n<EFBFBD>.. Hostile takeover <20>15 sec<65>";
}
else if (self.demon_two.classname == "building_camera")
{
st7="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD> Camera\n\n";
st=".. Disable comms <20>5 sec<65>";
st2="\n.. Disable speaker <20>2 sec<65>";
st3="\n<EFBFBD>.. Sensor ghosts <20>6 sec<65>";
st4="\n<EFBFBD>.. Hostile takeover <20>5 sec<65>";
}
else if (self.demon_two.classname == "building_sensor")
{
st7="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD> Motion Sensor\n\n";
st=".. Disable sound <20>5 sec<65>";
st2="\n.. Disable light <20>5 sec<65>";
st3="\n<EFBFBD>.. Deactivate <20>5 sec<65>";
st4="\n<EFBFBD>.. Hostile takeover <20>5 sec<65>";
}
else if (self.demon_two.classname == "building_teleporter")
{
st7="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD> Teleporter\n\n";
st=".. Item stripper <20>3 sec<65>";
st2="\n.. Void location <20>7 sec<65>";
st3="\n<EFBFBD>.. Target builder <20>5 sec<65>";
st4="\n<EFBFBD>.. Disable <20>2 sec<65>";
}
else if (self.demon_two.classname == "building_fieldgen")
{
st7="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD> Field Generator\n\n";
st=".. Corrupt Generator <20>3 sec<65>";
st2="\n.. Engineer Trap <20>7 sec<65>";
st3="\n<EFBFBD>.. Reduce Output <20>5 sec<65>";
st4="\n<EFBFBD>.. Disable <20>2 sec<65>";
}
}
if (self.demon_two.is_malfunctioning & SCREWUP_ONE)
2001-07-17 05:58:10 +00:00
{
st="";
}
if (self.demon_two.is_malfunctioning & SCREWUP_TWO)
2001-07-17 05:58:10 +00:00
{
st2="\n";
}
if (self.demon_two.is_malfunctioning & SCREWUP_THREE)
2001-07-17 05:58:10 +00:00
{
st3="\n";
}
if (self.demon_two.is_malfunctioning & SCREWUP_FOUR)
2001-07-17 05:58:10 +00:00
{
st4="\n";
}
CenterPrint7(self,st7,st,st2,st3,st4,st5,st6);
};
/*
===============
SBFireInterface
Uses the Cyber Interface on whatever you're looking at.
OfN - Rewritten
===============
*/
void() SBFireInterface =
{
if (CheckHaxxx() == FALSE) return;
2001-07-17 05:58:10 +00:00
local entity oself;
local entity targ;
local float hackThis;
targ = self.martyr_enemy;
hackThis = self.has_camera;
oself = self;
self = self.owner;
oself.think = SUB_Remove;
oself.nextthink = 0.1;
dremove(oself);
self.is_haxxxoring = 0;
self.tfstate = self.tfstate - (self.tfstate & TFSTATE_CANT_MOVE);
2001-07-17 05:58:10 +00:00
TeamFortress_SetSpeed(self);
if (hackThis == -2)
{
sprint(self, PRINT_HIGH, "Hack aborted.\n");
2001-07-17 05:58:10 +00:00
return;
}
if (targ.classname == "player" && (targ.cutf_items & CUTF_CYBERAUG))
2001-07-17 05:58:10 +00:00
{
if (!Teammate(targ.team_no, self.team_no))
{
targ.is_malfunctioning = 1;
sprint(targ, PRINT_HIGH, "Oh no! Your cybernetic augmentations are malfunctioning!\n");
sprint(self, PRINT_HIGH, "You tamper with ", targ.netname, "'s cybernetic augmentations.\n");
2001-07-17 05:58:10 +00:00
}
else if (Teammate(targ.team_no,self.team_no) && targ.is_malfunctioning)
{
targ.is_malfunctioning = 0;
sprint(targ, PRINT_HIGH, self.netname, " adjusts your cybernetics to work properly again.\n");
sprint(self, PRINT_HIGH, "You readjust ", targ.netname, "'s CyberAugs to work properly again.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (IsBuilding(targ))
{
if (!Teammate(targ.real_owner.team_no, self.team_no) && GetICELevel(targ)==1 && random() < 0.2)
{
sprint(self, PRINT_HIGH, "This device has a level 1 ICE, it's not easy to hack!\n");
//sprint(targ.real_owner, PRINT_HIGH,"Somebody tried to hack your stuff...\n");
2001-07-17 05:58:10 +00:00
return;
}
if (!Teammate(targ.real_owner.team_no, self.team_no) && GetICELevel(targ)==2)
{
sprint(self, PRINT_HIGH, "This device is hack-protected.\n");
sprint(targ.real_owner, PRINT_HIGH,"Somebody just tried to hack your stuff...\n");
2001-07-17 05:58:10 +00:00
return;
}
if (!Teammate(targ.real_owner.team_no, self.team_no) && GetICELevel(targ)==3)
{
sprint(self, PRINT_HIGH, "This device is hack-protected with a level 3 ICE!\n");
deathmsg=DMSG_ANTIHACK;
TF_T_Damage(self, self, targ, self.health + 50, TF_TD_IGNOREARMOUR, TF_TD_OTHER);
2001-07-17 05:58:10 +00:00
sound (self, CHAN_MISC, "effects/crunch.wav", 1, ATTN_NONE);
2001-07-17 05:58:10 +00:00
return;
}
else if (!Teammate(targ.real_owner.team_no, self.team_no))
{
sprint(self, PRINT_HIGH, "You make a few adjustments...\n");
if (hackThis == SCREWUP_ONE)
2001-07-17 05:58:10 +00:00
{
targ.is_malfunctioning = targ.is_malfunctioning | SCREWUP_ONE;
2001-07-17 05:58:10 +00:00
if (targ.classname == "building_sentrygun") //
sprint(self, PRINT_HIGH, "The sentrygun is now incapacitated.\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_tesla")
sprint(self, PRINT_HIGH, "The tesla won't shoot any more.\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_sensor")
sprint(self, PRINT_HIGH, "Better when it doesn't make so much noise.\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_dispenser")
sprint(self, PRINT_HIGH, "This is one dispenser that won't dispense any more.\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_camera")
sprint(self, PRINT_HIGH, "The camera won't be reporting to its owner any longer, but to all outward appearances remains the same.\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_teleporter")
sprint(self, PRINT_HIGH, "The teleporter will now strip the items off all who enter...\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_fieldgen")
{
sprint(self, PRINT_HIGH, "The field generator is now rigged to hurt teammates...\n");
targ.martyr_enemy = self;
if (targ.fieldgen_hasfield)
targ.fieldgen_field.martyr_enemy = self;
}
2001-07-17 05:58:10 +00:00
}
else if (hackThis == SCREWUP_TWO)
2001-07-17 05:58:10 +00:00
{
targ.is_malfunctioning = targ.is_malfunctioning | SCREWUP_TWO;
2001-07-17 05:58:10 +00:00
if (targ.classname == "building_sentrygun")
sprint(self, PRINT_HIGH, "The sentrygun's accuracy is now reduced.\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_tesla")
sprint(self, PRINT_HIGH, "This tesla won't put out enough amperage to hurt a fly.\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_camera")
sprint(self, PRINT_HIGH, "The camera is silenced.\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_sensor")
sprint(self, PRINT_HIGH, "That glow was always pretty annoying anyway.\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_dispenser")
{
sprint(self, PRINT_HIGH, "The dispenser is now rigged to explode!\n");
2001-07-17 05:58:10 +00:00
targ.martyr_enemy = self;
}
else if (targ.classname == "building_teleporter")
{
sprint(self, PRINT_HIGH, "Entering this teleporter could be unhealthy...\n");
2001-07-17 05:58:10 +00:00
targ.martyr_enemy = self;
}
else if (targ.classname == "building_fieldgen")
{
sprint(self, PRINT_HIGH, "Better not use spanner on this one...\n");
2001-07-17 05:58:10 +00:00
targ.martyr_enemy = self;
}
}
else if (hackThis == SCREWUP_THREE)
2001-07-17 05:58:10 +00:00
{
targ.is_malfunctioning = targ.is_malfunctioning | SCREWUP_THREE;
2001-07-17 05:58:10 +00:00
if (targ.classname == "building_sentrygun")
sprint(self, PRINT_HIGH, "The sentrygun rocket launcher will now malfunction...\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_tesla")
sprint(self, PRINT_HIGH, "The tesla may experience some technical difficulties the next time it fires...\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_camera")
sprint(self, PRINT_HIGH, "This camera will be reading ghosts now...\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_dispenser")
sprint(self, PRINT_HIGH, "The dispenser will no longer regenerate ammo.\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_teleporter")
sprint(self, PRINT_HIGH, "The teleporter will now teleport directly to its builder!\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_sensor")
sprint(self, PRINT_HIGH, "The sensor is now off.\n");
2001-07-17 05:58:10 +00:00
else if (targ.classname == "building_fieldgen")
sprint(self, PRINT_HIGH, "The field generator won't hurt too much now.\n");
2001-07-17 05:58:10 +00:00
}
else if (hackThis == SCREWUP_FOUR)
2001-07-17 05:58:10 +00:00
{
if (targ.classname != "building_dispenser" && targ.classname != "building_teleporter" && targ.classname != "building_fieldgen")
{
local string st;
st=GetBuildingName(targ);
sprint(targ.real_owner, PRINT_HIGH,"You've lost the control of your ");
sprint(targ.real_owner, PRINT_HIGH, st);
sprint(targ.real_owner, PRINT_HIGH, "!!\n");
2001-07-17 05:58:10 +00:00
sprint (self, PRINT_HIGH, "The ");
sprint (self, PRINT_HIGH, st);
sprint (self,PRINT_HIGH," is now yours!\n");
2001-07-17 05:58:10 +00:00
teamprefixsprint(self.team_no,self);
teamsprint6(self,self.netname," hacked ",targ.real_owner.netname,"'s ",st,", now it's ours!\n");
teamprefixsprint(targ.real_owner.team_no,targ.real_owner);
teamsprint6(targ.real_owner,targ.real_owner.netname," has lost the control of his ",st,"!\n","","");
if (targ.classname == "building_sentrygun")
{
targ.real_owner.has_sentry = FALSE;
self.has_sentry = TRUE;
2001-07-17 05:58:10 +00:00
}
else if (targ.classname == "building_tesla")
{
targ.real_owner.has_tesla = FALSE;
self.has_tesla = TRUE;
2001-07-17 05:58:10 +00:00
}
else if (targ.classname == "building_camera")
{
targ.real_owner.has_camera = FALSE;
self.has_camera = TRUE;
2001-07-17 05:58:10 +00:00
}
else if (targ.classname == "building_sensor")
{
targ.real_owner.has_sensor = FALSE;
self.has_sensor = TRUE;
2001-07-17 05:58:10 +00:00
}
targ.real_owner = self;
targ.team_no = self.team_no;
}
else if (targ.classname == "building_fieldgen")
{
sprint(self, PRINT_HIGH, "The field generator is now disabled.\n");
targ.is_malfunctioning = SCREWUP_FOUR;
2001-07-17 05:58:10 +00:00
}
else if (targ.classname == "building_teleporter")
{
sprint(self, PRINT_HIGH, "The teleporter is now broken.\n");
targ.is_malfunctioning = SCREWUP_FOUR;
2001-07-17 05:58:10 +00:00
}
else if (targ.classname == "building_dispenser")
{
sprint(self, PRINT_HIGH, "The dispenser will explode when someone attempts to withdraw armour!\n");
2001-07-17 05:58:10 +00:00
targ.martyr_enemy = self;
targ.is_malfunctioning = SCREWUP_FOUR;
2001-07-17 05:58:10 +00:00
}
}
else
{
sprint(self, PRINT_HIGH, "Your attempt at hacking fails.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (Teammate(targ.team_no,self.team_no) && hackThis == -1)
{
if (targ.is_malfunctioning)
{
targ.is_malfunctioning = 0;
sprint(self, PRINT_HIGH, "You correct the machine's malfunction.\n");
2001-07-17 05:58:10 +00:00
local string st;
st=GetBuildingName(targ);
if (self!=targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, "your ");
sprint(targ.real_owner, PRINT_HIGH, st);
sprint(targ.real_owner, PRINT_HIGH," has been fixed by ");
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH, "\n");
2001-07-17 05:58:10 +00:00
teamprefixsprintbi(self.team_no,self,targ.real_owner);
teamsprintbi(self,targ.real_owner,targ.real_owner.netname,"'s malfunctioning ",st," has been fixed by ",self.netname,"\n");
}
else
{
teamprefixsprint(self.team_no,self);
teamsprint6(self,self.netname, " fixes his malfuntioning ",st,"\n","","");
}
}
else
{
sprint(self, PRINT_HIGH, "There is nothing wrong with this machine.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (Teammate(targ.team_no,self.team_no))
{
//FRIENDLY IMPROVEMENTS
targ.num_mines = targ.num_mines | hackThis;
local string st;
st=GetBuildingName(targ);
sprint(self, PRINT_HIGH, "You make a few adjustments...\n");
2001-07-17 05:58:10 +00:00
if (hackThis == IMPROVED_ONE)
2001-07-17 05:58:10 +00:00
{
if (targ.classname=="building_sensor")
{
sprint(self, PRINT_HIGH, "The sensor has greater detection range now.\n");
2001-07-17 05:58:10 +00:00
if (self != targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH,"your motion sensor has greater detection range thanks to ");
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH, ".\n");
2001-07-17 05:58:10 +00:00
}
}
else if (targ.classname=="building_camera")
{
sprint(self, PRINT_HIGH, "The camera has greater range of view now.\n");
2001-07-17 05:58:10 +00:00
if (self != targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH," hacked your camera, it has better sensors now.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (targ.classname=="building_tesla")
{
targ.maxammo_cells=targ.maxammo_cells*2;
sprint(self, PRINT_HIGH, "The tesla has extra cells capacity now.\n");
2001-07-17 05:58:10 +00:00
if (self != targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH," hacked your tesla, it has extra capacity for cells now.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (targ.classname=="building_sentrygun")
{
targ.maxammo_shells=targ.maxammo_shells*2;
sprint(self, PRINT_HIGH, "The sentry gun has greater ammo capacity for shells now.\n");
2001-07-17 05:58:10 +00:00
if (self != targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH," hacked your sentry gun, it has extra capacity for shells now.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (targ.classname=="building_dispenser")
{
sprint(self, PRINT_HIGH, "The dispenser capacity was increased.\n");
2001-07-17 05:58:10 +00:00
if (self != targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH," hacked your dispenser to increase its capacity.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (targ.classname=="building_teleporter")
{
targ.maxammo_cells=targ.maxammo_cells*2;
sprint(self, PRINT_HIGH, "The teleporter cells capacity was increased.\n");
2001-07-17 05:58:10 +00:00
if (self != targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH," hacked your teleporter to increase its cells capacity.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (targ.classname=="building_fieldgen")
{
targ.maxammo_cells=targ.maxammo_cells*2;
sprint(self, PRINT_HIGH, "The field generator cells capacity was increased.\n");
2001-07-17 05:58:10 +00:00
if (self != targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH," hacked your field generator to increase its cells capacity.\n");
2001-07-17 05:58:10 +00:00
}
}
}
else if (hackThis == IMPROVED_TWO) //- ICE level 1
2001-07-17 05:58:10 +00:00
{
sprint(self, PRINT_HIGH, "You add a <20><><EFBFBD><EFBFBD><EFBFBD> <20> ICE to the ");
sprint(self, PRINT_HIGH, st);
sprint(self, PRINT_HIGH,".\n");
2001-07-17 05:58:10 +00:00
if (self!=targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH," adds a <20><><EFBFBD><EFBFBD><EFBFBD> <20> ICE to your ");
sprint(targ.real_owner, PRINT_HIGH, st);
sprint(targ.real_owner, PRINT_HIGH, ".\n");
2001-07-17 05:58:10 +00:00
}
}
else if (hackThis == IMPROVED_FIVE) //- ICE level 2
2001-07-17 05:58:10 +00:00
{
sprint(self, PRINT_HIGH, "You add a <20><><EFBFBD><EFBFBD><EFBFBD> <20> ICE to the ");
sprint(self, PRINT_HIGH, st);
sprint(self, PRINT_HIGH,".\n");
2001-07-17 05:58:10 +00:00
if (self!=targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH," adds a <20><><EFBFBD><EFBFBD><EFBFBD> <20> ICE to your ");
sprint(targ.real_owner, PRINT_HIGH, st);
sprint(targ.real_owner, PRINT_HIGH, ".\n");
2001-07-17 05:58:10 +00:00
}
}
else if (hackThis == IMPROVED_SIX) //- ICE level 3
2001-07-17 05:58:10 +00:00
{
sprint(self, PRINT_HIGH, "You add a <20><><EFBFBD><EFBFBD><EFBFBD> <20> ICE to the ");
sprint(self, PRINT_HIGH, st);
sprint(self, PRINT_HIGH,".\n");
2001-07-17 05:58:10 +00:00
if (self!=targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH," adds a <20><><EFBFBD><EFBFBD><EFBFBD> <20> ICE to your ");
sprint(targ.real_owner, PRINT_HIGH, st);
sprint(targ.real_owner, PRINT_HIGH, ".\n");
2001-07-17 05:58:10 +00:00
}
}
else if (hackThis == IMPROVED_THREE)
2001-07-17 05:58:10 +00:00
{
sprint(self, PRINT_HIGH, "You enhance the armour of the ");
sprint(self, PRINT_HIGH, st);
sprint(self, PRINT_HIGH,".\n");
2001-07-17 05:58:10 +00:00
if (self!=targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH," enhances the armour of your ");
sprint(targ.real_owner, PRINT_HIGH, st);
sprint(targ.real_owner, PRINT_HIGH, ".\n");
2001-07-17 05:58:10 +00:00
}
local float num;
num = targ.health / targ.max_health;
if (num < 0) // this shouldn't happen, but I got a report that it did
num = 0;
targ.max_health = targ.max_health * 2;
targ.health = num * targ.max_health;
2001-07-17 05:58:10 +00:00
}
else if (hackThis == IMPROVED_SEVEN)
2001-07-17 05:58:10 +00:00
{
if (targ.classname=="building_sensor")
{
sprint(self, PRINT_HIGH, "The sensor will be able to uncover thieves now.\n");
2001-07-17 05:58:10 +00:00
if (self!=targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, "your motion sensor can now uncover thieves after ");
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH, "'s hack.\n");
2001-07-17 05:58:10 +00:00
}
}
}
else if (hackThis == IMPROVED_FOUR)
2001-07-17 05:58:10 +00:00
{
if (targ.classname=="building_sensor")
{
sprint(self, PRINT_HIGH, "The sensor will be able to uncover spies now.\n");
2001-07-17 05:58:10 +00:00
if (self!=targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, "your motion sensor can now detect spies after ");
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH, "'s hack.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (targ.classname=="building_teleporter")
{
sprint(self, PRINT_HIGH, "The teleporter had its range increased.\n");
2001-07-17 05:58:10 +00:00
if (self!=targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, "your teleporter had its range increased by ");
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH, "'s hack.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (targ.classname=="building_fieldgen")
{
sprint(self, PRINT_HIGH, "The field generator had its range increased.\n");
2001-07-17 05:58:10 +00:00
if (self!=targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, "your field generator had its range increased by ");
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH, "'s hack.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (targ.classname=="building_tesla")
{
sprint(self, PRINT_HIGH, "The tesla has a better chip-set now.\n");
2001-07-17 05:58:10 +00:00
if (self!=targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH, " enhances your tesla main circuits.\n");
2001-07-17 05:58:10 +00:00
}
}
else if (targ.classname=="building_sentrygun")
{
sprint(self, PRINT_HIGH, "The sentry gun has a better chip-set now.\n");
2001-07-17 05:58:10 +00:00
if (self!=targ.real_owner)
{
sprint(targ.real_owner, PRINT_HIGH, self.netname);
sprint(targ.real_owner, PRINT_HIGH, " enhances your sentry gun main circuits.\n");
2001-07-17 05:58:10 +00:00
}
}
}
else
{
sprint(self, PRINT_HIGH, "OfteN: BUG! unknown hack value BUG! (wtf u hacked)\n");
2001-07-17 05:58:10 +00:00
RPrint(self.netname);
RPrint(" just made an unknown hack. (bug)");
}
}
}
//else
// sprint(self, PRINT_HIGH, "There is nothing there to hack!\n");
2001-07-17 05:58:10 +00:00
};
float(float input) IntToExp =
{
if (input == 1) return 1;
if (input == 2) return 2;
if (input == 3) return 4;
if (input == 4) return 8;
if (input == 5) return 16;
if (input == 6) return 32;
if (input == 7) return 64;
//if (input == 8) return 128;
return 0;
};
float(entity hacked, float r) ReturnFHackDelay;
// SB hax0r tool - Cyber Interface
// OfN - Rewritten
void(float input) SBInitiateInterface =
{
local entity te;
if (!visible2x(self,self.demon_two))
{
sprint(self, PRINT_HIGH, "You are not connected to the target.\n");
2001-07-17 05:58:10 +00:00
self.demon_two=world;
return;
}
// DOUBLE CHECK, THIS ONE AFTER MENU, THE OTHER ON JOB_HACKER //
if (self.is_feigning)
{
sprint(self, PRINT_HIGH, "You cannot hack while feigning.\n");
2001-07-17 05:58:10 +00:00
return;
}
if (self.is_detpacking || self.is_toffingadet)
{
sprint(self, PRINT_HIGH, "You can't hack something while setting a detpack.\n");
2001-07-17 05:58:10 +00:00
return;
}
if (self.is_building)
{
sprint(self, PRINT_HIGH, "You can't hack while building!\n");
2001-07-17 05:58:10 +00:00
return;
}
// DOUBLE CHECK, THIS ONE AFTER MENU, THE OTHER ON JOB_HACKER //
self.is_haxxxoring = 1;
te = spawn();
te.owner = self;
te.classname = "timer";
te.origin = self.demon_two.origin;
te.nextthink = time + 1;
te.has_holo = self.demon_two.team_no; // checked on think to break hacking if changes of team
te.has_camera = IntToExp(input);
if (!Teammate(self.demon_two.team_no,self.team_no))
{
te.heat = ReturnHackDelay(self.demon_two, input);
if (GetICELevel(self.demon_two)==1) // if it has a level1 ice add more delay to the hack
te.heat=te.heat*2.5;
local string st;
st=GetBuildingName(self.demon_two);
teamprefixsprint(self.team_no,self);
teamsprint6(self,self.netname," started to hack ",self.demon_two.real_owner.netname,"'s ",st,"\n");
local float dist;
dist = vlen(self.origin - self.demon_two.origin);
if (dist > HAX_UNSTABLEDIST)
2001-07-17 05:58:10 +00:00
{
sprint(self,PRINT_HIGH,"Connection unstable, it will take longer...");
2001-07-17 05:58:10 +00:00
te.heat=te.heat*2;
}
}
else
{
te.heat = ReturnFHackDelay(self.demon_two, input);
if (input==2 && self.demon_two.num_mines & IMPROVED_TWO)
2001-07-17 05:58:10 +00:00
{
te.has_camera=IMPROVED_FIVE;
if (self.demon_two.num_mines & IMPROVED_FIVE)
te.has_camera=IMPROVED_SIX;
2001-07-17 05:58:10 +00:00
}
if (input==8) te.has_camera=-1;
}
te.martyr_enemy = self.demon_two;
te.think = SBHackDotTimerThink;
self.tfstate = self.tfstate | TFSTATE_CANT_MOVE;
2001-07-17 05:58:10 +00:00
TeamFortress_SetSpeed(self);
sprint (self, PRINT_HIGH, "You immerse yourself in the cybernet...\n");
2001-07-17 05:58:10 +00:00
makeImmune(self,time + te.heat); //- OfN - WORKS? yup
te.ltime = te.heat;
self.demon_two=te;
};
float (entity hacked) GetICELevel =
{
local float retval;
retval=0;
if (hacked.num_mines & IMPROVED_TWO)
2001-07-17 05:58:10 +00:00
retval=1;
if (hacked.num_mines & IMPROVED_FIVE)
2001-07-17 05:58:10 +00:00
retval=2;
if (hacked.num_mines & IMPROVED_SIX)
2001-07-17 05:58:10 +00:00
retval=3;
return retval;
};
float(entity hacked, float r) ReturnHackDelay =
{
if (hacked.classname == "player")
return 5; // cyberaug hack
else if (hacked.classname == "building_dispenser")
{
if (r == 1)
return 3;
else if (r == 2)
return 6;
else if (r == 3)
return 3;
else
return 4;
}
else if (hacked.classname == "building_sentrygun")
{
if (r == 1)
return 3;
else if (r == 2)
return 5;
else if (r == 3)
return 4;
else
return 12;
}
else if (hacked.classname == "building_tesla")
{
if (r == 1)
return 8;
else if (r == 2)
return 6;
else if (r == 3)
return 7;
else
return 15;
}
else if (hacked.classname == "building_sensor")
return 5;
else if (hacked.classname == "building_camera")
{
if (r == 1)
return 5;
else if (r == 2)
return 2;
else if (r == 3)
return 6;
else
return 5;
}
else if (hacked.classname == "building_teleporter")
{
if (r == 1)
return 3;
else if (r == 2)
return 7;
else if (r == 3)
return 5;
else
return 2;
}
else if (hacked.classname == "building_fieldgen")
{
if (r == 1)
return 3;
else if (r == 2)
return 7;
else if (r == 3)
return 5;
else
return 2;
}
};
float(entity hacked, float r) ReturnFHackDelay =
{
if (hacked.classname == "player")
return 5; // cyberaug hack
else if (r == 8) return 8; // repairing..
else if (r == 2 && IsBuilding(hacked))
{
if (!(hacked.num_mines & IMPROVED_TWO))
2001-07-17 05:58:10 +00:00
return 20; // level 1 ICE lasts for 20 seconds always
if (!(hacked.num_mines & IMPROVED_FIVE))
2001-07-17 05:58:10 +00:00
return 25; // level 2 ICE lasts for 25 seconds always
if (!(hacked.num_mines & IMPROVED_SIX))
2001-07-17 05:58:10 +00:00
return 30;
}
else if (hacked.classname == "building_dispenser")
{
if (r == 1)
return 15;
// else if (r == 2)
// return 30;
else //if (r == 3)
return 10;
//else
// return 8;
}
else if (hacked.classname == "building_sentrygun")
{
if (r == 1)
return 10;
// else if (r == 2)
// return 30;
else if (r == 3)
return 25;
else
return 30;
}
else if (hacked.classname == "building_tesla")
{
if (r == 1)
return 10;
// else if (r == 2)
// return 30;
else if (r == 3)
return 25;
else
return 30;
}
else if (hacked.classname == "building_sensor")
{
if (r == 1)
return 20;
// else if (r == 2)
// return 30;
else if (r == 3)
return 10;
else //if (r == 4)
return 25;
//else
// return 8;
}
else if (hacked.classname == "building_camera")
{
if (r == 1)
return 20;
// else if (r == 2)
// return 30;
else // if (r == 3)
return 20;
//else
// return 8;
}
else if (hacked.classname == "building_teleporter")
{
if (r == 1)
return 5;
// else if (r == 2)
// return 30;
else if (r == 3)
return 20;
else// if (r == 4)
return 30;
//else
// return 8;
}
else if (hacked.classname == "building_fieldgen")
{
if (r == 1)
return 10;
// else if (r == 2)
// return 30;
else if (r == 3)
return 15;
else// if (r == 4)
return 20;
//else
// return 8;
}
return 999; // hehe, punishment to the bug generator :)
};
float() CheckHaxxx =
{
local float retval;
retval = TRUE;
2001-07-17 05:58:10 +00:00
if (self.martyr_enemy == world) // BUG!
retval = FALSE;
2001-07-17 05:58:10 +00:00
else if (!(IsBuilding(self.martyr_enemy))) // BUG! 2
retval = FALSE;
2001-07-17 05:58:10 +00:00
else if (self.martyr_enemy.health <= 0)
{
sprint (self.owner, PRINT_HIGH, "Your target has been destroyed!\n");
2001-07-17 05:58:10 +00:00
if (self.has_camera != -2)
{
deathmsg=DMSG_CYBERNET;
TF_T_Damage(self.owner, self.owner, self.martyr_enemy, self.owner.health + 10, TF_TD_IGNOREARMOUR, TF_TD_OTHER);
sound (self.owner, CHAN_MISC, "effects/crunch.wav", 1, ATTN_NONE);
2001-07-17 05:58:10 +00:00
}
retval = FALSE;
2001-07-17 05:58:10 +00:00
}
else if (self.martyr_enemy.team_no != self.has_holo) // target switched team? if so.. abort
{
sprint (self.owner, PRINT_HIGH, "The communication has been lost!\n");
retval = FALSE;
2001-07-17 05:58:10 +00:00
}
else if (self.has_camera == -2)
{
retval = TRUE;
2001-07-17 05:58:10 +00:00
}
else if (Teammate(self.martyr_enemy.team_no,self.owner.team_no) && self.martyr_enemy.num_mines & self.has_camera && self.has_camera != -1)
{
sprint (self.owner, PRINT_HIGH, "Somebody improved that first.\n");
retval = FALSE;
2001-07-17 05:58:10 +00:00
}
else if (!Teammate(self.martyr_enemy.team_no,self.owner.team_no) && self.martyr_enemy.is_malfunctioning & self.has_camera)
{
sprint (self.owner, PRINT_HIGH, "Somebody screwed that up first! heh\n");
retval = FALSE;
2001-07-17 05:58:10 +00:00
}
if (!retval)
{
self.owner.is_haxxxoring = 0;
self.owner.tfstate = self.tfstate - (self.tfstate & TFSTATE_CANT_MOVE);
2001-07-17 05:58:10 +00:00
TeamFortress_SetSpeed(self.owner);
self.think = SUB_Remove;
self.nextthink = time + 0.1;
dremove(self);
}
return retval;
};
void() SBHackDotTimerThink =
{
if (CheckHaxxx() == FALSE) return;
2001-07-17 05:58:10 +00:00
local vector org;
if (random() < 0.4) //-ofn was 0.3
{
org = self.martyr_enemy.origin;
if (self.martyr_enemy.classname == "building_tesla" && self.martyr_enemy.tf_items & NIT_TURRET)
2001-07-17 05:58:10 +00:00
org_z = org_z - 7; // - 32;
else if (self.martyr_enemy.classname == "building_tesla")
org_z = org_z + 7; // + 32;
else if (self.martyr_enemy.classname == "building_sentrygun" && self.martyr_enemy.tf_items & NIT_TURRET)
2001-07-17 05:58:10 +00:00
org_z = org_z - 16;
else if (self.martyr_enemy.classname == "building_sentrygun")
org_z = org_z + 16;
else if (self.martyr_enemy.classname == "building_dispenser")
org_z = org_z + 16;
else if (self.martyr_enemy.classname == "building_fieldgen")
org_z = org_z + 32;
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_GUNSHOT);
2001-07-25 21:10:26 +00:00
WriteByte (MSG_MULTICAST, 3);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
2001-07-25 21:10:26 +00:00
multicast (org, MULTICAST_PVS);
2001-07-17 05:58:10 +00:00
}
self.heat = self.heat - 1;
if (self.heat <= 0)
{
SBFireInterface();
return;
}
self.nextthink = time + 1;
};
void() JobHacker =
{
local vector source;
if (self.is_haxxxoring)
{
if (self.demon_two.has_camera == -2) return; // if we ralready aborting a hack...
sprint(self, PRINT_HIGH, "Aborting hack...\n");
2001-07-17 05:58:10 +00:00
self.demon_two.heat = 1 + 2 * random();
self.demon_two.has_camera = -2;
return;
}
if (self.is_feigning)
{
sprint(self, PRINT_HIGH, "You cannot hack while feigning.\n");
2001-07-17 05:58:10 +00:00
return;
}
if (self.is_detpacking || self.is_toffingadet)
{
sprint(self, PRINT_HIGH, "You can't hack something while setting a detpack.\n");
2001-07-17 05:58:10 +00:00
return;
}
if (self.is_building)
{
sprint(self, PRINT_HIGH, "You can't hack while building!\n");
2001-07-17 05:58:10 +00:00
return;
}
source = self.origin + '0 0 16';
traceline (source, source + v_forward*500, FALSE, self);
2001-07-17 05:58:10 +00:00
if ( (IsBuilding(trace_ent) && trace_ent.classname != "building_sentrygun_base") || trace_ent.classname == "player")
{
if (!Teammate(trace_ent.team_no,self.team_no))
{
if (trace_ent.is_malfunctioning == SCREWUP_ONE + SCREWUP_TWO + SCREWUP_THREE + SCREWUP_FOUR)
2001-07-17 05:58:10 +00:00
{
sprint(self, PRINT_HIGH, "You couldn't possibly screw that up more than it already is.\n");
2001-07-17 05:58:10 +00:00
return;
}
else if (IsBuilding(trace_ent) && trace_ent.classname != "building_sentrygun_base")
{
self.current_menu = MENU_E_HACK;
self.menu_count = MENU_REFRESH_RATE;
2001-07-17 05:58:10 +00:00
}
}
else if (IsBuilding(trace_ent) && trace_ent.classname != "building_sentrygun_base")
{
self.current_menu = MENU_F_HACK;
self.menu_count = MENU_REFRESH_RATE;
2001-07-17 05:58:10 +00:00
}
self.demon_two = trace_ent;
if (trace_ent.classname=="player")
{
if (!(trace_ent.cutf_items & CUTF_CYBERAUG))
2001-07-17 05:58:10 +00:00
{
sprint(self, PRINT_HIGH, "You can't hack him.\n");
2001-07-17 05:58:10 +00:00
ResetMenu();
self.demon_two=world;
return;
}
sprint (self, PRINT_HIGH, "\nScanning for cyberaug equipment...\n");
2001-07-17 05:58:10 +00:00
SBInitiateInterface(0);
ResetMenu();
}
else
{
sprint (self, PRINT_HIGH, "\nEstablishing connection...\n");
2001-07-17 05:58:10 +00:00
local string st;
st=GetBuildingName(self.demon_two);
sprint (self, PRINT_HIGH, "Target <20><><EFBFBD><EFBFBD>: ");
sprint (self, PRINT_HIGH, st);
sprint (self, PRINT_HIGH, "\nTarget <20><><EFBFBD><EFBFBD><EFBFBD>: ");
sprint (self, PRINT_HIGH, self.demon_two.real_owner.netname);
2001-07-17 05:58:10 +00:00
if (Teammate(self.team_no,self.demon_two.team_no))
sprint (self, PRINT_HIGH, "\nFriendly device.\n");
2001-07-17 05:58:10 +00:00
else
sprint (self, PRINT_HIGH, "\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> device!\n");
2001-07-17 05:58:10 +00:00
}
}
else
{
sprint (self, PRINT_HIGH, "There is nothing there to hack!\n");
2001-07-17 05:58:10 +00:00
return;
}
};
//==================================================================
// NEEDED?
//_--------------
// called on any DIE routine for buildings to ensure nobody
// hacks unexistent machine, or eng tries to fix the building
// i think this can fix some strange crashes
/*
void(entity thebuilding) UpdateBuildingMenus =
{
local entity te;
// find all players
te = find(world, classname, "player");
while (te)
{
if (te.job & JOB_HACKER) // a hacker?
2001-07-17 05:58:10 +00:00
if (!te.is_haxxxoring) // currently hacking? if so.. do nothing, he could be killed by building
if (te.demon_two == thebuilding) // this is our target?
if (te.current_menu == MENU_E_HACK || te.current_menu == MENU_F_HACK) // and we have the hack menu?
2001-07-17 05:58:10 +00:00
{ // then reset his menu
te.demon_two = world;
if (te.StatusBarSize == 0)
CenterPrint(te, "\n");
else
te.StatusRefreshTime = time + 0.1;
te.menu_count = MENU_REFRESH_RATE;
te.current_menu = MENU_DEFAULT;
2001-07-17 05:58:10 +00:00
}
if (te.building == thebuilding) // put the eng building to wolrd, and player_menu will reset it
te.building = world;
te = find(te, classname, "player");
}
};
*/