2001-07-23 20:52:47 +00:00
|
|
|
|
#include "defs.qh"
|
|
|
|
|
#include "menu.qh"
|
2001-07-17 05:58:10 +00:00
|
|
|
|
/*=======================================================//
|
|
|
|
|
// crusader.QC - CustomTF 3.2.OfN - 30/1/2001 - //
|
|
|
|
|
// by Sergio Fuma<6D>a Grunwaldt - OfteN aka superCOCK2000 //
|
|
|
|
|
=========================================================//
|
|
|
|
|
This is all the crusader stuff created by SB-1 tech
|
|
|
|
|
=========================================================*/
|
|
|
|
|
|
|
|
|
|
void() JobCrusader =
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
self.current_menu = MENU_CRUSADER;
|
|
|
|
|
self.menu_count = MENU_REFRESH_RATE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
self.StatusRefreshTime = time + 1;
|
|
|
|
|
};
|
|
|
|
|
|
2001-07-26 16:44:48 +00:00
|
|
|
|
vector(vector veca, vector vecb) crossproduct;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
entity (entity crusader) Crusader_FindIdiot =
|
|
|
|
|
{
|
|
|
|
|
local entity guy;
|
|
|
|
|
local entity matched;
|
|
|
|
|
local vector store;
|
|
|
|
|
local float matchlevel, oldmatch;
|
|
|
|
|
|
|
|
|
|
matchlevel = 0;
|
|
|
|
|
matched = crusader;
|
|
|
|
|
oldmatch = 0;
|
|
|
|
|
|
|
|
|
|
guy = findradius(crusader.origin, 250);
|
|
|
|
|
while (guy)
|
|
|
|
|
{
|
|
|
|
|
if (guy.classname == "player")
|
|
|
|
|
{
|
|
|
|
|
store = normalize(guy.origin - crusader.origin);
|
|
|
|
|
matchlevel = crusader.v_angle * store;
|
|
|
|
|
if (matchlevel > oldmatch)
|
|
|
|
|
{
|
|
|
|
|
matched = guy;
|
|
|
|
|
oldmatch = matchlevel;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
guy = guy.chain;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (oldmatch > 0.2)
|
|
|
|
|
return matched;
|
|
|
|
|
else
|
|
|
|
|
return crusader;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void(float aur) AddAura =
|
|
|
|
|
{
|
|
|
|
|
local float amount;
|
|
|
|
|
local entity targ;
|
|
|
|
|
|
|
|
|
|
amount = time - self.job_finished;
|
|
|
|
|
if (amount > 60)
|
|
|
|
|
amount = 60;
|
|
|
|
|
|
|
|
|
|
if (amount < 15)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "You don't have enough mana to bestow an aura\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
/* makevectors(self.v_angle);
|
2001-07-23 20:52:47 +00:00
|
|
|
|
traceline(self.origin, self.origin + (v_forward * 200), FALSE, self);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
targ = Crusader_FindIdiot(self);
|
|
|
|
|
|
|
|
|
|
if (self == targ)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "There is nobody there to bestow an aura upon\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (targ.aura == aur)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, targ.netname, " already has that aura.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (!(targ.job & JOB_CRUSADER))
|
2001-07-17 05:58:10 +00:00
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
// sound (targ, CHAN_ITEM, "auras/aura3.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
local string strung;
|
|
|
|
|
local float oldaur;
|
|
|
|
|
local string oldstrung;
|
|
|
|
|
|
|
|
|
|
oldaur = targ.aura;
|
|
|
|
|
targ.aura = aur;
|
|
|
|
|
targ.crusader_inspirator = self;
|
|
|
|
|
amount = amount - 15;
|
|
|
|
|
self.job_finished = time - amount;
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (targ.aura == AURA_POWER)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
strung = "Aura of Power.\n";
|
2001-07-23 20:52:47 +00:00
|
|
|
|
else if (targ.aura == AURA_RESISTANCE)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
strung = "Aura of Resistance.\n";
|
2001-07-23 20:52:47 +00:00
|
|
|
|
else if (targ.aura == AURA_HASTE)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
strung = "Aura of Haste.\n";
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (oldaur == AURA_POWER)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
oldstrung = "Aura of Power";
|
2001-07-23 20:52:47 +00:00
|
|
|
|
else if (oldaur == AURA_RESISTANCE)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
oldstrung = "Aura of Resistance";
|
2001-07-23 20:52:47 +00:00
|
|
|
|
else if (oldaur == AURA_HASTE)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
oldstrung = "Aura of Haste";
|
|
|
|
|
|
|
|
|
|
if (oldaur == 0)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "You provide ", targ.netname, " with an ", strung);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "You replace ", targ.netname, "'s ", oldstrung, " with an ", strung);
|
|
|
|
|
sprint(targ, PRINT_HIGH, self.netname, " bestows upon you an ", strung);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
2001-07-23 20:52:47 +00:00
|
|
|
|
else //if (targ.job & JOB_CRUSADER)
|
|
|
|
|
sprint(self, PRINT_HIGH, targ.netname, " is a Crusader and their Aura of Righteousness may not be replaced.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
//else
|
2001-07-23 20:52:47 +00:00
|
|
|
|
// sprint(self, PRINT_HIGH, "You may only bestow an aura upon a player\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void() CrusaderAddInvisibility =
|
|
|
|
|
{
|
|
|
|
|
local float amount;
|
|
|
|
|
local entity targ;
|
|
|
|
|
|
|
|
|
|
amount = time - self.job_finished;
|
|
|
|
|
if (amount > 60)
|
|
|
|
|
amount = 60;
|
|
|
|
|
|
|
|
|
|
if (amount < 45)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "You don't have enough mana to grant invisibility\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
targ = Crusader_FindIdiot(self);
|
|
|
|
|
|
|
|
|
|
if (self == targ)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "There is nobody there to bestow an aura upon\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (!(targ.job & JOB_CRUSADER))
|
2001-07-17 05:58:10 +00:00
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
// sound (targ, CHAN_ITEM, "auras/aura3.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "You provide ", targ.netname, " with powers of invisibility! They will be invisible for the next 10 seconds!\n");
|
|
|
|
|
sprint(targ, PRINT_HIGH, self.netname, " grants you an Aura of Invisibility! You will be fully invisibile for the next 10 seconds!\n");
|
|
|
|
|
targ.aura = AURA_INVIS;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
targ.aura_time = time + 10;
|
|
|
|
|
amount = amount - 45;
|
|
|
|
|
self.job_finished = time - amount;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
targ.items = targ.items | IT_INVISIBILITY;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "You cannot bestow invisibility upon another Crusader\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void() CrusaderMassHeal =
|
|
|
|
|
{
|
|
|
|
|
local entity te;
|
|
|
|
|
local float amount;
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (!(self.weapons_carried & WEAP_MEDIKIT))
|
2001-07-17 05:58:10 +00:00
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "You cannot perform mass heal without a medikit\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
amount = time - self.job_finished;
|
|
|
|
|
if (amount > 60)
|
|
|
|
|
amount = 60;
|
|
|
|
|
|
|
|
|
|
if (amount < 20)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "You don't have enough mana to perform a mass heal\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
te = findradius(self.origin, 600);
|
|
|
|
|
while (te)
|
|
|
|
|
{
|
|
|
|
|
if (te.classname == "player")
|
|
|
|
|
if (Teammate(te.team_no, self.team_no))
|
|
|
|
|
if (te.health < te.max_health)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
// sound (te, CHAN_ITEM, "auras/aura3.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
te.health = te.max_health;
|
|
|
|
|
if (self != te)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(te, PRINT_HIGH, self.netname, " restores you to full health\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(te, PRINT_HIGH, "Your deity restores you to full health\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
te = te.chain;
|
|
|
|
|
}
|
|
|
|
|
amount = amount - 20;
|
|
|
|
|
self.job_finished = time - amount;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sound(self, CHAN_MUSIC, "items/r_item2.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
float(entity doc, entity patient, vector org) CureAdverseEffects;
|
|
|
|
|
|
|
|
|
|
void() CrusaderMassCure =
|
|
|
|
|
{
|
|
|
|
|
local entity te;
|
|
|
|
|
local float amount;
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (!(self.weapons_carried & WEAP_MEDIKIT))
|
2001-07-17 05:58:10 +00:00
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "You cannot perform mass cure without a medikit\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
amount = time - self.job_finished;
|
|
|
|
|
if (amount > 60)
|
|
|
|
|
amount = 60;
|
|
|
|
|
|
|
|
|
|
if (amount < 20)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "You don't have enough mana to perform a mass cure\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
te = findradius(self.origin, 600);
|
|
|
|
|
while (te)
|
|
|
|
|
{
|
|
|
|
|
if (te.classname == "player")
|
|
|
|
|
if (Teammate(te.team_no, self.team_no))
|
|
|
|
|
CureAdverseEffects(self, te, te.origin);
|
|
|
|
|
|
|
|
|
|
te = te.chain;
|
|
|
|
|
}
|
|
|
|
|
amount = amount - 20;
|
|
|
|
|
self.job_finished = time - amount;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sound(self, CHAN_MUSIC, "items/health1.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void() CrusaderDispel =
|
|
|
|
|
{
|
|
|
|
|
local entity te;
|
|
|
|
|
local float amount;
|
|
|
|
|
|
|
|
|
|
amount = time - self.job_finished;
|
|
|
|
|
if (amount > 60)
|
|
|
|
|
amount = 60;
|
|
|
|
|
|
|
|
|
|
if (amount < 30)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "You don't have enough mana to dispel evil\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
te = findradius(self.origin, 1000);
|
|
|
|
|
while (te)
|
|
|
|
|
{
|
|
|
|
|
if (!Teammate(self.team_no, te.team_no))
|
|
|
|
|
/*if (te.classname == "monster_demon1")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
TF_T_Damage(te, self, self, 500, 0, TF_TD_OTHER);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
else if (te.classname == "monster_shambler")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
TF_T_Damage(te, self, self, 830, 0, TF_TD_OTHER);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
else if (coop)
|
|
|
|
|
{
|
|
|
|
|
if (te.classname == "monster_zombie")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
TF_T_Damage(te, self, self, 200, 0, TF_TD_OTHER);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
else if (te.classname == "monster_wizard")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
TF_T_Damage(te, self, self, 200, 0, TF_TD_OTHER);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
else if (te.classname == "monster_shalrath")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
TF_T_Damage(te, self, self, 250, 0, TF_TD_OTHER);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}*/
|
|
|
|
|
if (IsMonsterNonArmy(te))
|
2001-07-23 20:52:47 +00:00
|
|
|
|
TF_T_Damage(te, self, self, 500, 0, TF_TD_OTHER);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
else if (te.classname == "player")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (te.job & JOB_WARLOCK)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
{
|
|
|
|
|
local entity oself;
|
|
|
|
|
|
|
|
|
|
te.attack_finished = time + 5;
|
|
|
|
|
te.job_finished = time + 25;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(te, PRINT_HIGH, self.netname, " dispels you!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
oself = self;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (te.current_menu == MENU_DEMON)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
ResetMenu();
|
|
|
|
|
self = te;
|
|
|
|
|
self = oself;
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
// sound (te, CHAN_ITEM, "auras/aura3.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
deathmsg = DMSG_DISPEL;
|
|
|
|
|
TF_T_Damage(te, self, self, 25, 0, TF_TD_OTHER);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
te = te.chain;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
amount = amount - 30;
|
|
|
|
|
self.job_finished = time - amount;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sound(self, CHAN_MUSIC, "misc/power.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|