prozac-qfcc/crusader.qc

305 lines
7.4 KiB
C++
Raw Normal View History

#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 =
{
self.current_menu = MENU_CRUSADER;
self.menu_count = MENU_REFRESH_RATE;
2001-07-17 05:58:10 +00:00
self.StatusRefreshTime = time + 1;
};
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)
{
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);
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)
{
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)
{
sprint(self, PRINT_HIGH, targ.netname, " already has that aura.\n");
2001-07-17 05:58:10 +00:00
return;
}
if (!(targ.job & JOB_CRUSADER))
2001-07-17 05:58:10 +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;
if (targ.aura == AURA_POWER)
2001-07-17 05:58:10 +00:00
strung = "Aura of Power.\n";
else if (targ.aura == AURA_RESISTANCE)
2001-07-17 05:58:10 +00:00
strung = "Aura of Resistance.\n";
else if (targ.aura == AURA_HASTE)
2001-07-17 05:58:10 +00:00
strung = "Aura of Haste.\n";
if (oldaur == AURA_POWER)
2001-07-17 05:58:10 +00:00
oldstrung = "Aura of Power";
else if (oldaur == AURA_RESISTANCE)
2001-07-17 05:58:10 +00:00
oldstrung = "Aura of Resistance";
else if (oldaur == AURA_HASTE)
2001-07-17 05:58:10 +00:00
oldstrung = "Aura of Haste";
if (oldaur == 0)
sprint(self, PRINT_HIGH, "You provide ", targ.netname, " with an ", strung);
2001-07-17 05:58:10 +00:00
else
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
}
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
// 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)
{
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)
{
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.job & JOB_CRUSADER))
2001-07-17 05:58:10 +00:00
{
// sound (targ, CHAN_ITEM, "auras/aura3.wav", 1, ATTN_NORM);
2001-07-17 05:58:10 +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;
targ.items = targ.items | IT_INVISIBILITY;
2001-07-17 05:58:10 +00:00
}
else
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;
if (!(self.weapons_carried & WEAP_MEDIKIT))
2001-07-17 05:58:10 +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)
{
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)
{
// 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)
sprint(te, PRINT_HIGH, self.netname, " restores you to full health\n");
2001-07-17 05:58:10 +00:00
else
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;
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;
if (!(self.weapons_carried & WEAP_MEDIKIT))
2001-07-17 05:58:10 +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)
{
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;
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)
{
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")
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")
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")
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")
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")
TF_T_Damage(te, self, self, 250, 0, TF_TD_OTHER);
2001-07-17 05:58:10 +00:00
}*/
if (IsMonsterNonArmy(te))
TF_T_Damage(te, self, self, 500, 0, TF_TD_OTHER);
2001-07-17 05:58:10 +00:00
else if (te.classname == "player")
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;
sprint(te, PRINT_HIGH, self.netname, " dispels you!\n");
2001-07-17 05:58:10 +00:00
oself = self;
if (te.current_menu == MENU_DEMON)
2001-07-17 05:58:10 +00:00
ResetMenu();
self = te;
self = oself;
// sound (te, CHAN_ITEM, "auras/aura3.wav", 1, ATTN_NORM);
2001-07-17 05:58:10 +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;
sound(self, CHAN_MUSIC, "misc/power.wav", 1, ATTN_NORM);
2001-07-17 05:58:10 +00:00
};