ew-progs/ew/monsters/necro.qc

739 lines
30 KiB
C++
Raw Permalink Normal View History

2011-09-06 00:00:00 +00:00
/*
==============================================================================
Necromancer
coded by Michael Rogers a.k.a Xsniper
http://xsniper.virtualave.net/
some code done by iD software
==============================================================================
*/
$cd /models/enemies
$origin 0 0 24
$base base
$skin base
$frame idle001 idle002 idle003 idle004 idle005 idle006 idle007 idle008 idle009 idle010
$frame idle011 idle012 idle013 idle014 idle015 idle016 idle017 idle018 idle019 idle020
$frame idle021 idle022 idle023 idle024 idle025 idle026 idle027 idle028 idle029 idle030
$frame idle031 idle032 idle033 idle034 idle035 idle036 idle037 idle038 idle039 idle040
$frame idle041 idle042 idle043 idle044 idle045 idle046 idle047 idle048 idle049 idle050
$frame idle051 idle052 idle053 idle054 idle055 idle056 idle057 idle058 idle059 idle060
$frame fly001 fly002 fly003 fly004 fly005 fly006 fly007 fly008 fly009 fly010
$frame fly011 fly012 fly013 fly014 fly015 fly016 fly017 fly018 fly019 fly020
$frame summon001 summon002 summon003 summon004 summon005 summon006 summon007 summon008 summon009 summon010
$frame summon011 summon012 summon013 summon014 summon015 summon016 summon017 summon018 summon019 summon020
$frame summon021 summon022 summon023 summon024 summon025 summon026 summon027 summon028 summon029 summon030
$frame summon031 summon032 summon033 summon034 summon035 summon036 summon037 summon038 summon039 summon040
$frame summon041 summon042 summon043 summon044 summon045 summon046 summon047 summon048 summon049 summon050
$frame summon051 summon052 summon053 summon054 summon055 summon056 summon057 summon058 summon059 summon060
$frame summon061 summon062 summon063 summon064 summon065 summon066 summon067 summon068 summon069 summon070
$frame attack001 attack002 attack003 attack004 attack005 attack006 attack007 attack008 attack009 attack010
$frame attack011 attack012 attack013 attack014 attack015 attack016 attack017 attack018 attack019 attack020
$frame pain001 pain002 pain003 pain004
$frame death001 death002 death003 death004 death005 death006 death007 death008 death009 death010
$frame death011 death012 death013 death014 death015 death016 death017 death018 death019 death020
$frame death021 death022 death023 death024 death025 death026 death027 death028 death029 death030
$frame death031 death032 death033 death034 death035 death036 death037 death038 death039 death040
$frame death041 death042 death043 death044 death045 death046 death047 death048 death049 death050
$frame death051 death052 death053 death054 death055 death056 death057 death058 death059 death060
$frame death061 death062 death063 death064 death065 death066 death067 death068 death069 death070
$frame death071 death072 death073 death074 death075 death076 death077 death078
void() necro_run1;
void() necro_side1;
/*
=================
NecromancerCheckAttack
=================
*/
float() NecromancerCheckAttack =
{
local vector spot1, spot2;
local entity targ;
local float chance;
if (time < self.attack_finished)
return FALSE;
if (!enemy_vis)
return FALSE;
if (enemy_range == RANGE_FAR)
{
if (self.attack_state != AS_STRAIGHT)
{
self.attack_state = AS_STRAIGHT;
necro_run1 ();
}
return FALSE;
}
targ = self.enemy;
// see if any entities are in the way of the shot
spot1 = self.origin + self.view_ofs;
spot2 = targ.origin + targ.view_ofs;
traceline (spot1, spot2, FALSE, self);
if (trace_ent != targ)
{ // don't have a clear shot, so move to a side
if (self.attack_state != AS_STRAIGHT)
{
self.attack_state = AS_STRAIGHT;
necro_run1 ();
}
return FALSE;
}
if (enemy_range == RANGE_MELEE)
chance = 0.9;
else if (enemy_range == RANGE_NEAR)
chance = 0.6;
else if (enemy_range == RANGE_MID)
chance = 0.2;
else
chance = 0;
if (random () < chance)
{
self.attack_state = AS_MISSILE;
return TRUE;
}
if (enemy_range == RANGE_MID)
{
if (self.attack_state != AS_STRAIGHT)
{
self.attack_state = AS_STRAIGHT;
necro_run1 ();
}
}
else
{
if (self.attack_state != AS_SLIDING)
{
self.attack_state = AS_SLIDING;
necro_side1 ();
}
}
return FALSE;
};
/*
=================
NecromancerAttackFinished
=================
*/
float() NecromancerAttackFinished =
{
if (enemy_range >= RANGE_MID || !enemy_vis)
{
self.attack_state = AS_STRAIGHT;
self.think = necro_run1;
}
else
{
self.attack_state = AS_SLIDING;
self.think = necro_side1;
}
};
/*
==============================================================================
FAST ATTACKS
==============================================================================
*/
void() necro_idlesound =
{
local float r;
r = random();
if (self.waitmin < time)
{
self.waitmin = time + 2;
if ( r <= 0.20)
sound (self, CHAN_VOICE, "enemy/apprent/idle1.wav", 1, ATTN_IDLE);
else if ( r <= 0.40)
sound (self, CHAN_VOICE, "enemy/apprent/idle2.wav", 1, ATTN_IDLE);
else if ( r <= 0.60)
sound (self, CHAN_VOICE, "enemy/apprent/idle3.wav", 1, ATTN_IDLE);
else if ( r <= 0.80)
sound (self, CHAN_VOICE, "enemy/apprent/idle4.wav", 1, ATTN_IDLE);
else
sound (self, CHAN_VOICE, "enemy/apprent/idle5.wav", 1, ATTN_IDLE);
}
return;
};
void(vector spot) create_dwellerbot;
/*
====================
necro_check_summon
Check to see if we can summon a dweller
====================
*/
float() necro_check_summon =
{
local vector start, end;
//set up angles stuff
self.v_angle = self.angles;
makevectors (self.angles);
//we need to check for walls so that we don't summon the dweller inside them
// Check in front of the necromancer for a wall
start = self.origin;
end = (start + (v_forward * 80)) - '0 0 20';
// Check 80 Quake units infront and 20 units down
traceline (start, end, TRUE, self);
// If there is a wall or obstacle then return NOSUMMON
if (trace_fraction != 1.0)
return (0); //NOSUMMON
return (1); //SUMMON
};
/*
====================
necro_summon_dweller
The necromancer will summon dwellers from beyond the grave
====================
*/
void() necro_summon_dweller =
{
//set up angles stuff
self.v_angle = self.angles;
makevectors (self.angles);
create_dwellerbot((self.origin + (v_forward * 80)) - '0 0 20'); //create dweller infront of him
};
//===========================================================================
void() necro_idle001 =[ $idle001, necro_idle002 ] {ai_stand();};
void() necro_idle002 =[ $idle002, necro_idle003 ] {ai_stand();};
void() necro_idle003 =[ $idle003, necro_idle004 ] {ai_stand();};
void() necro_idle004 =[ $idle004, necro_idle005 ] {ai_stand();};
void() necro_idle005 =[ $idle005, necro_idle006 ] {ai_stand();};
void() necro_idle006 =[ $idle006, necro_idle007 ] {ai_stand();};
void() necro_idle007 =[ $idle007, necro_idle008 ] {ai_stand();};
void() necro_idle008 =[ $idle008, necro_idle009 ] {ai_stand();};
void() necro_idle009 =[ $idle009, necro_idle010 ] {ai_stand();};
void() necro_idle010 =[ $idle010, necro_idle011 ] {ai_stand();};
void() necro_idle011 =[ $idle011, necro_idle012 ] {ai_stand();};
void() necro_idle012 =[ $idle012, necro_idle013 ] {ai_stand();};
void() necro_idle013 =[ $idle013, necro_idle014 ] {ai_stand();};
void() necro_idle014 =[ $idle014, necro_idle015 ] {ai_stand();};
void() necro_idle015 =[ $idle015, necro_idle016 ] {ai_stand();};
void() necro_idle016 =[ $idle016, necro_idle017 ] {ai_stand();};
void() necro_idle017 =[ $idle017, necro_idle018 ] {ai_stand();};
void() necro_idle018 =[ $idle018, necro_idle019 ] {ai_stand();};
void() necro_idle019 =[ $idle019, necro_idle020 ] {ai_stand();};
void() necro_idle020 =[ $idle020, necro_idle021 ] {ai_stand();};
void() necro_idle021 =[ $idle021, necro_idle022 ] {ai_stand();};
void() necro_idle022 =[ $idle022, necro_idle023 ] {ai_stand();};
void() necro_idle023 =[ $idle023, necro_idle024 ] {ai_stand();};
void() necro_idle024 =[ $idle024, necro_idle025 ] {ai_stand();};
void() necro_idle025 =[ $idle025, necro_idle026 ] {ai_stand();};
void() necro_idle026 =[ $idle026, necro_idle027 ] {ai_stand();};
void() necro_idle027 =[ $idle027, necro_idle028 ] {ai_stand();};
void() necro_idle028 =[ $idle028, necro_idle029 ] {ai_stand();};
void() necro_idle029 =[ $idle029, necro_idle030 ] {ai_stand();};
void() necro_idle030 =[ $idle030, necro_idle031 ] {ai_stand();};
void() necro_idle031 =[ $idle031, necro_idle032 ] {ai_stand();};
void() necro_idle032 =[ $idle032, necro_idle033 ] {ai_stand();};
void() necro_idle033 =[ $idle033, necro_idle034 ] {ai_stand();};
void() necro_idle034 =[ $idle034, necro_idle035 ] {ai_stand();};
void() necro_idle035 =[ $idle035, necro_idle036 ] {ai_stand();};
void() necro_idle036 =[ $idle036, necro_idle037 ] {ai_stand();};
void() necro_idle037 =[ $idle037, necro_idle038 ] {ai_stand();};
void() necro_idle038 =[ $idle038, necro_idle039 ] {ai_stand();};
void() necro_idle039 =[ $idle039, necro_idle040 ] {ai_stand();};
void() necro_idle040 =[ $idle040, necro_idle041 ] {ai_stand();};
void() necro_idle041 =[ $idle041, necro_idle042 ] {ai_stand();};
void() necro_idle042 =[ $idle042, necro_idle043 ] {ai_stand();};
void() necro_idle043 =[ $idle043, necro_idle044 ] {ai_stand();};
void() necro_idle044 =[ $idle044, necro_idle045 ] {ai_stand();};
void() necro_idle045 =[ $idle045, necro_idle046 ] {ai_stand();};
void() necro_idle046 =[ $idle046, necro_idle047 ] {ai_stand();};
void() necro_idle047 =[ $idle047, necro_idle048 ] {ai_stand();};
void() necro_idle048 =[ $idle048, necro_idle049 ] {ai_stand();};
void() necro_idle049 =[ $idle049, necro_idle050 ] {ai_stand();};
void() necro_idle050 =[ $idle050, necro_idle051 ] {ai_stand();};
void() necro_idle051 =[ $idle051, necro_idle052 ] {ai_stand();};
void() necro_idle052 =[ $idle052, necro_idle053 ] {ai_stand();};
void() necro_idle053 =[ $idle053, necro_idle054 ] {ai_stand();};
void() necro_idle054 =[ $idle054, necro_idle055 ] {ai_stand();};
void() necro_idle055 =[ $idle055, necro_idle056 ] {ai_stand();};
void() necro_idle056 =[ $idle056, necro_idle057 ] {ai_stand();};
void() necro_idle057 =[ $idle057, necro_idle058 ] {ai_stand();};
void() necro_idle058 =[ $idle058, necro_idle059 ] {ai_stand();};
void() necro_idle059 =[ $idle059, necro_idle060 ] {ai_stand();};
void() necro_idle060 =[ $idle060, necro_idle001 ] {ai_stand();};
//===========================================================================
void() necro_fly001 =[ $fly001, necro_fly002 ]
{
ai_walk(8);
necro_idlesound();
};
void() necro_fly002 =[ $fly002, necro_fly003 ] {ai_walk(8);};
void() necro_fly003 =[ $fly003, necro_fly004 ] {ai_walk(8);};
void() necro_fly004 =[ $fly004, necro_fly005 ] {ai_walk(8);};
void() necro_fly005 =[ $fly005, necro_fly006 ] {ai_walk(8);};
void() necro_fly006 =[ $fly006, necro_fly007 ] {ai_walk(8);};
void() necro_fly007 =[ $fly007, necro_fly008 ] {ai_walk(8);};
void() necro_fly008 =[ $fly008, necro_fly009 ] {ai_walk(8);};
void() necro_fly009 =[ $fly009, necro_fly010 ] {ai_walk(8);};
void() necro_fly010 =[ $fly010, necro_fly011 ] {ai_walk(8);};
void() necro_fly011 =[ $fly011, necro_fly012 ] {ai_walk(8);};
void() necro_fly012 =[ $fly012, necro_fly013 ] {ai_walk(8);};
void() necro_fly013 =[ $fly013, necro_fly014 ] {ai_walk(8);};
void() necro_fly014 =[ $fly014, necro_fly015 ] {ai_walk(8);};
void() necro_fly015 =[ $fly015, necro_fly016 ] {ai_walk(8);};
void() necro_fly016 =[ $fly016, necro_fly017 ] {ai_walk(8);};
void() necro_fly017 =[ $fly017, necro_fly018 ] {ai_walk(8);};
void() necro_fly018 =[ $fly018, necro_fly019 ] {ai_walk(8);};
void() necro_fly019 =[ $fly019, necro_fly020 ] {ai_walk(8);};
void() necro_fly020 =[ $fly020, necro_fly001 ] {ai_walk(8);};
//===========================================================================
void() necro_side1 =[ $fly001, necro_side2 ]
{
ai_run(8);
necro_idlesound();
};
void() necro_side2 =[ $fly002, necro_side3 ] {ai_run(8);};
void() necro_side3 =[ $fly003, necro_side4 ] {ai_run(8);};
void() necro_side4 =[ $fly004, necro_side5 ] {ai_run(8);};
void() necro_side5 =[ $fly005, necro_side6 ] {ai_run(8);};
void() necro_side6 =[ $fly006, necro_side7 ] {ai_run(8);};
void() necro_side7 =[ $fly007, necro_side8 ] {ai_run(8);};
void() necro_side8 =[ $fly008, necro_side9 ] {ai_run(8);};
void() necro_side9 =[ $fly009, necro_side10 ] {ai_run(8);};
void() necro_side10 =[ $fly010, necro_side11 ] {ai_run(8);};
void() necro_side11 =[ $fly011, necro_side12 ] {ai_run(8);};
void() necro_side12 =[ $fly012, necro_side13 ] {ai_run(8);};
void() necro_side13 =[ $fly013, necro_side14 ] {ai_run(8);};
void() necro_side14 =[ $fly014, necro_side15 ] {ai_run(8);};
void() necro_side15 =[ $fly015, necro_side16 ] {ai_run(8);};
void() necro_side16 =[ $fly016, necro_side17 ] {ai_run(8);};
void() necro_side17 =[ $fly017, necro_side18 ] {ai_run(8);};
void() necro_side18 =[ $fly018, necro_side19 ] {ai_run(8);};
void() necro_side19 =[ $fly019, necro_side20 ] {ai_run(8);};
void() necro_side20 =[ $fly020, necro_side1 ] {ai_run(8);};
//===========================================================================
void() necro_run1 =[ $fly001, necro_run2 ]
{
ai_run(16);
necro_idlesound();
};
void() necro_run2 =[ $fly002, necro_run3 ] {ai_run(16);};
void() necro_run3 =[ $fly003, necro_run4 ] {ai_run(16);};
void() necro_run4 =[ $fly004, necro_run5 ] {ai_run(16);};
void() necro_run5 =[ $fly005, necro_run6 ] {ai_run(16);};
void() necro_run6 =[ $fly006, necro_run7 ] {ai_run(16);};
void() necro_run7 =[ $fly007, necro_run8 ] {ai_run(16);};
void() necro_run8 =[ $fly008, necro_run9 ] {ai_run(16);};
void() necro_run9 =[ $fly009, necro_run10 ] {ai_run(16);};
void() necro_run10 =[ $fly010, necro_run11 ] {ai_run(16);};
void() necro_run11 =[ $fly011, necro_run12 ] {ai_run(16);};
void() necro_run12 =[ $fly012, necro_run13 ] {ai_run(16);};
void() necro_run13 =[ $fly013, necro_run14 ] {ai_run(16);};
void() necro_run14 =[ $fly014, necro_run15 ] {ai_run(16);};
void() necro_run15 =[ $fly015, necro_run16 ] {ai_run(16);};
void() necro_run16 =[ $fly016, necro_run17 ] {ai_run(16);};
void() necro_run17 =[ $fly017, necro_run18 ] {ai_run(16);};
void() necro_run18 =[ $fly018, necro_run19 ] {ai_run(16);};
void() necro_run19 =[ $fly019, necro_run20 ] {ai_run(16);};
void() necro_run20 =[ $fly020, necro_run1 ] {ai_run(16);};
//===========================================================================
void() necro_acid1 =[ $attack001, necro_acid2 ]
{
ai_face();
Apprent_StartMissile(0);
};
void() necro_acid2 =[ $attack002, necro_acid3 ] {ai_face();};
void() necro_acid3 =[ $attack003, necro_acid4 ] {ai_face();};
void() necro_acid4 =[ $attack004, necro_acid5 ] {ai_face();};
void() necro_acid5 =[ $attack005, necro_acid6 ] {ai_face();};
void() necro_acid6 =[ $attack006, necro_acid7 ] {ai_face();};
void() necro_acid7 =[ $attack007, necro_acid8 ] {ai_face();};
void() necro_acid8 =[ $attack008, necro_acid9 ] {ai_face();};
void() necro_acid9 =[ $attack009, necro_acid10 ] {ai_face();};
void() necro_acid10 =[ $attack010, necro_acid11 ] {ai_face();};
void() necro_acid11 =[ $attack011, necro_acid12 ] {ai_face();};
void() necro_acid12 =[ $attack012, necro_acid13 ] {ai_face();};
void() necro_acid13 =[ $attack013, necro_acid14 ] {ai_face();};
void() necro_acid14 =[ $attack014, necro_acid15 ] {ai_face();};
void() necro_acid15 =[ $attack015, necro_acid16 ] {ai_face();};
void() necro_acid16 =[ $attack016, necro_acid17 ] {ai_face();};
void() necro_acid17 =[ $attack017, necro_acid18 ] {ai_face();};
void() necro_acid18 =[ $attack018, necro_acid19 ] {ai_face();};
void() necro_acid19 =[ $attack019, necro_acid20 ] {ai_face();};
void() necro_acid20 =[ $attack020, necro_run1 ]
{
ai_face();
SUB_AttackFinished(2);
NecromancerAttackFinished ();
};
//===========================================================================
void() necro_skull1 =[ $attack001, necro_skull2 ]
{
ai_face();
Apprent_StartMissile(1);
};
void() necro_skull2 =[ $attack002, necro_skull3 ] {ai_face();};
void() necro_skull3 =[ $attack003, necro_skull4 ] {ai_face();};
void() necro_skull4 =[ $attack004, necro_skull5 ] {ai_face();};
void() necro_skull5 =[ $attack005, necro_skull6 ] {ai_face();};
void() necro_skull6 =[ $attack006, necro_skull7 ] {ai_face();};
void() necro_skull7 =[ $attack007, necro_skull8 ] {ai_face();};
void() necro_skull8 =[ $attack008, necro_skull9 ] {ai_face();};
void() necro_skull9 =[ $attack009, necro_skull10 ] {ai_face();};
void() necro_skull10 =[ $attack010, necro_skull11 ] {ai_face();};
void() necro_skull11 =[ $attack011, necro_skull12 ] {ai_face();};
void() necro_skull12 =[ $attack012, necro_skull13 ] {ai_face();};
void() necro_skull13 =[ $attack013, necro_skull14 ] {ai_face();};
void() necro_skull14 =[ $attack014, necro_skull15 ] {ai_face();};
void() necro_skull15 =[ $attack015, necro_skull16 ] {ai_face();};
void() necro_skull16 =[ $attack016, necro_skull17 ] {ai_face();};
void() necro_skull17 =[ $attack017, necro_skull18 ] {ai_face();};
void() necro_skull18 =[ $attack018, necro_skull19 ] {ai_face();};
void() necro_skull19 =[ $attack019, necro_skull20 ] {ai_face();};
void() necro_skull20 =[ $attack020, necro_run1 ]
{
ai_face();
SUB_AttackFinished(2);
NecromancerAttackFinished ();
};
//===========================================================================
void() necro_summon001 =[ $summon001, necro_summon002 ] {ai_face();};
void() necro_summon002 =[ $summon002, necro_summon003 ] {};
void() necro_summon003 =[ $summon003, necro_summon004 ] {};
void() necro_summon004 =[ $summon004, necro_summon005 ] {};
void() necro_summon005 =[ $summon005, necro_summon006 ] {};
void() necro_summon006 =[ $summon006, necro_summon007 ] {};
void() necro_summon007 =[ $summon007, necro_summon008 ] {};
void() necro_summon008 =[ $summon008, necro_summon009 ] {};
void() necro_summon009 =[ $summon009, necro_summon010 ] {};
void() necro_summon010 =[ $summon010, necro_summon011 ] {};
void() necro_summon011 =[ $summon011, necro_summon012 ] {};
void() necro_summon012 =[ $summon012, necro_summon013 ] {};
void() necro_summon013 =[ $summon013, necro_summon014 ] {};
void() necro_summon014 =[ $summon014, necro_summon015 ] {};
void() necro_summon015 =[ $summon015, necro_summon016 ] {};
void() necro_summon016 =[ $summon016, necro_summon017 ] {};
void() necro_summon017 =[ $summon017, necro_summon018 ] {};
void() necro_summon018 =[ $summon018, necro_summon019 ] {};
void() necro_summon019 =[ $summon019, necro_summon020 ] {};
void() necro_summon020 =[ $summon020, necro_summon021 ] {necro_summon_dweller();};
void() necro_summon021 =[ $summon021, necro_summon022 ] {};
void() necro_summon022 =[ $summon022, necro_summon023 ] {};
void() necro_summon023 =[ $summon023, necro_summon024 ] {};
void() necro_summon024 =[ $summon024, necro_summon025 ] {};
void() necro_summon025 =[ $summon025, necro_summon026 ] {};
void() necro_summon026 =[ $summon026, necro_summon027 ] {};
void() necro_summon027 =[ $summon027, necro_summon028 ] {};
void() necro_summon028 =[ $summon028, necro_summon029 ] {};
void() necro_summon029 =[ $summon029, necro_summon030 ] {};
void() necro_summon030 =[ $summon030, necro_summon031 ] {};
void() necro_summon031 =[ $summon031, necro_summon032 ] {};
void() necro_summon032 =[ $summon032, necro_summon033 ] {};
void() necro_summon033 =[ $summon033, necro_summon034 ] {};
void() necro_summon034 =[ $summon034, necro_summon035 ] {};
void() necro_summon035 =[ $summon035, necro_summon036 ] {};
void() necro_summon036 =[ $summon036, necro_summon037 ] {};
void() necro_summon037 =[ $summon037, necro_summon038 ] {};
void() necro_summon038 =[ $summon038, necro_summon039 ] {};
void() necro_summon039 =[ $summon039, necro_summon040 ] {};
void() necro_summon040 =[ $summon040, necro_summon041 ] {};
void() necro_summon041 =[ $summon041, necro_summon042 ] {};
void() necro_summon042 =[ $summon042, necro_summon043 ] {};
void() necro_summon043 =[ $summon043, necro_summon044 ] {};
void() necro_summon044 =[ $summon044, necro_summon045 ] {};
void() necro_summon045 =[ $summon045, necro_summon046 ] {};
void() necro_summon046 =[ $summon046, necro_summon047 ] {};
void() necro_summon047 =[ $summon047, necro_summon048 ] {};
void() necro_summon048 =[ $summon048, necro_summon049 ] {};
void() necro_summon049 =[ $summon049, necro_summon050 ] {};
void() necro_summon050 =[ $summon050, necro_summon051 ] {};
void() necro_summon051 =[ $summon051, necro_summon052 ] {};
void() necro_summon052 =[ $summon052, necro_summon053 ] {};
void() necro_summon053 =[ $summon053, necro_summon054 ] {};
void() necro_summon054 =[ $summon054, necro_summon055 ] {};
void() necro_summon055 =[ $summon055, necro_summon056 ] {};
void() necro_summon056 =[ $summon056, necro_summon057 ] {};
void() necro_summon057 =[ $summon057, necro_summon058 ] {};
void() necro_summon058 =[ $summon058, necro_summon059 ] {};
void() necro_summon059 =[ $summon059, necro_summon060 ] {};
void() necro_summon060 =[ $summon060, necro_summon061 ] {};
void() necro_summon061 =[ $summon061, necro_summon062 ] {};
void() necro_summon062 =[ $summon062, necro_summon063 ] {};
void() necro_summon063 =[ $summon063, necro_summon064 ] {};
void() necro_summon064 =[ $summon064, necro_summon065 ] {};
void() necro_summon065 =[ $summon065, necro_summon066 ] {};
void() necro_summon066 =[ $summon066, necro_summon067 ] {};
void() necro_summon067 =[ $summon067, necro_summon068 ] {};
void() necro_summon068 =[ $summon068, necro_summon069 ] {};
void() necro_summon069 =[ $summon069, necro_summon070 ] {};
void() necro_summon070 =[ $summon070, necro_run1 ] {};
//===========================================================================
void() necro_pain1 =[ $pain001, necro_pain2 ] {};
void() necro_pain2 =[ $pain002, necro_pain3 ] {};
void() necro_pain3 =[ $pain003, necro_pain4 ] {};
void() necro_pain4 =[ $pain004, necro_run1 ] {};
void(entity attacker, float damage) necro_Pain =
{
sound (self, CHAN_VOICE, "enemy/apprent/pain.wav", 1, ATTN_NORM);
if (random()*70 > damage)
return; // didn't flinch
necro_pain1 ();
};
//===========================================================================
void() necro_death1 =[ $death001, necro_death2 ]
{
self.velocity_x = -200 + 400*random();
self.velocity_y = -200 + 400*random();
self.velocity_z = 100 + 100*random();
self.flags = self.flags - (self.flags & FL_ONGROUND);
sound (self, CHAN_VOICE, "enemy/apprent/death.wav", 1, ATTN_NORM);
};
void() necro_death2 =[ $death002, necro_death3 ] {};
void() necro_death3 =[ $death003, necro_death4 ] {};
void() necro_death4 =[ $death004, necro_death5 ] {};
void() necro_death5 =[ $death005, necro_death6 ] {};
void() necro_death6 =[ $death006, necro_death7 ] {};
void() necro_death7 =[ $death007, necro_death8 ] {};
void() necro_death8 =[ $death008, necro_death9 ] {};
void() necro_death9 =[ $death009, necro_death10 ] {};
void() necro_death10 =[ $death010, necro_death11 ] {};
void() necro_death11 =[ $death011, necro_death12 ] {};
void() necro_death12 =[ $death012, necro_death13 ] {};
void() necro_death13 =[ $death013, necro_death14 ] {};
void() necro_death14 =[ $death014, necro_death15 ] {};
void() necro_death15 =[ $death015, necro_death16 ] {};
void() necro_death16 =[ $death016, necro_death17 ] {};
void() necro_death17 =[ $death017, necro_death18 ] {};
void() necro_death18 =[ $death018, necro_death19 ] {};
void() necro_death19 =[ $death019, necro_death20 ] {};
void() necro_death20 =[ $death020, necro_death21 ] {};
void() necro_death21 =[ $death021, necro_death22 ] {};
void() necro_death22 =[ $death022, necro_death23 ] {};
void() necro_death23 =[ $death023, necro_death24 ] {};
void() necro_death24 =[ $death024, necro_death25 ] {};
void() necro_death25 =[ $death025, necro_death26 ] {};
void() necro_death26 =[ $death026, necro_death27 ] {};
void() necro_death27 =[ $death027, necro_death28 ] {};
void() necro_death28 =[ $death028, necro_death29 ] {};
void() necro_death29 =[ $death029, necro_death30 ] {};
void() necro_death30 =[ $death030, necro_death31 ] {};
void() necro_death31 =[ $death031, necro_death32 ] {};
void() necro_death32 =[ $death032, necro_death33 ] {};
void() necro_death33 =[ $death033, necro_death34 ] {};
void() necro_death34 =[ $death034, necro_death35 ] {};
void() necro_death35 =[ $death035, necro_death36 ] {};
void() necro_death36 =[ $death036, necro_death37 ] {};
void() necro_death37 =[ $death037, necro_death38 ] {};
void() necro_death38 =[ $death038, necro_death39 ] {};
void() necro_death39 =[ $death039, necro_death40 ] {};
void() necro_death40 =[ $death040, necro_death41 ] {};
void() necro_death41 =[ $death041, necro_death42 ] {};
void() necro_death42 =[ $death042, necro_death43 ] {};
void() necro_death43 =[ $death043, necro_death44 ] {};
void() necro_death44 =[ $death044, necro_death45 ] {};
void() necro_death45 =[ $death045, necro_death46 ] {};
void() necro_death46 =[ $death046, necro_death47 ] {};
void() necro_death47 =[ $death047, necro_death48 ] {};
void() necro_death48 =[ $death048, necro_death49 ] {};
void() necro_death49 =[ $death049, necro_death50 ] {};
void() necro_death50 =[ $death050, necro_death51 ] {};
void() necro_death51 =[ $death051, necro_death52 ] {};
void() necro_death52 =[ $death052, necro_death53 ] {};
void() necro_death53 =[ $death053, necro_death54 ] {};
void() necro_death54 =[ $death054, necro_death55 ] {};
void() necro_death55 =[ $death055, necro_death56 ] {};
void() necro_death56 =[ $death056, necro_death57 ] {};
void() necro_death57 =[ $death057, necro_death58 ] {};
void() necro_death58 =[ $death058, necro_death59 ] {};
void() necro_death59 =[ $death059, necro_death60 ] {};
void() necro_death60 =[ $death060, necro_death61 ] {};
void() necro_death61 =[ $death061, necro_death62 ] {};
void() necro_death62 =[ $death062, necro_death63 ] {};
void() necro_death63 =[ $death063, necro_death64 ] {};
void() necro_death64 =[ $death064, necro_death65 ] {};
void() necro_death65 =[ $death065, necro_death66 ] {};
void() necro_death66 =[ $death066, necro_death67 ] {};
void() necro_death67 =[ $death067, necro_death68 ] {};
void() necro_death68 =[ $death068, necro_death69 ] {};
void() necro_death69 =[ $death069, necro_death70 ] {};
void() necro_death70 =[ $death070, necro_death71 ] {};
void() necro_death71 =[ $death071, necro_death72 ] {};
void() necro_death72 =[ $death072, necro_death73 ] {};
void() necro_death73 =[ $death073, necro_death74 ] {};
void() necro_death74 =[ $death074, necro_death75 ] {};
void() necro_death75 =[ $death075, necro_death76 ] {};
void() necro_death76 =[ $death076, necro_death77 ] {};
void() necro_death77 =[ $death077, necro_death78 ] {};
void() necro_death78 =[ $death078, necro_death78 ]
{
//necro leaves a big mess when he dies so lets blow him up at the end of it all
T_RadiusDamage (self, self, 120, world);
sound (self, CHAN_VOICE, "enemy/apprent/death.wav", 1, ATTN_NORM);
self.origin = self.origin - 8*normalize(self.velocity);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_TAREXPLOSION);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
BecomeExplosion ();
};
void() necro_die =
{
//this seemed important
self.solid = SOLID_NOT;
//go into death animation
necro_death1 ();
};
//===========================================================================
void() necro_Missile =
{
local float r;
//set random value to r
r = random();
//Three attack types, choose between Acid attack, Skull Blast, or Summon Dweller
if (r >= 0.65)
{
if (necro_check_summon() == 1)
necro_summon001();
}
else
{
if (r >= 0.33)
necro_acid1();
else
necro_skull1();
}
};
//===========================================================================
void() necro_precache =
{
//necromancer graphics
precache_model ("models/enemies/necro.md2");
precache_model ("models/weapons/gfx/acid.mdl");
precache_model ("models/weapons/gfx/skullblast.md2");
//necromancer sounds
precache_sound ("enemy/apprent/ability.wav");
precache_sound ("enemy/apprent/death.wav");
precache_sound ("enemy/apprent/idle1.wav");
precache_sound ("enemy/apprent/idle2.wav");
precache_sound ("enemy/apprent/idle3.wav");
precache_sound ("enemy/apprent/idle4.wav");
precache_sound ("enemy/apprent/idle5.wav");
precache_sound ("enemy/apprent/pain.wav");
precache_sound ("enemy/apprent/sight.wav");
precache_sound ("weapons/demon/acidhit1.wav");
precache_sound ("weapons/demon/acidhit2.wav");
precache_sound ("weapons/lock4.wav"); //used for missile touch function
//dweller precaches
precache_model ("models/enemies/dweller.md2");
precache_sound ("enemy/dweller/alert1.wav");
precache_sound ("enemy/dweller/attack1.wav");
precache_sound ("enemy/dweller/miss.wav");
precache_sound ("enemy/dweller/pain1.wav");
precache_sound ("enemy/dweller/pain2.wav");
precache_sound ("enemy/dweller/pain3.wav");
precache_sound ("enemy/dweller/rage.wav");
};
/*EWED monster_necromancer (1 0 0) (-16 -16 -24) (16 16 40) Ambush
*/
void() monster_necromancer =
{
if (deathmatch)
{
remove(self);
return;
}
//if we are put in the level directly then call necro_precache
if (self.classname != "monster_wizard")
necro_precache();
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "models/enemies/necro.md2");
setsize (self, '-16 -16 -24', '16 16 40');
// setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
self.health = set_health(80);
self.speed = set_speed(0); //variable velocity system, not a factor for flying monster
self.dtype = 3; //dodge type teleport
self.th_stand = necro_idle001;
self.th_walk = necro_fly001;
self.th_run = necro_run1;
self.th_missile = necro_Missile;
self.th_pain = necro_Pain;
self.th_die = necro_die;
//my new classname is?
self.classname = "monster_necromancer";
//set up our monflag
self.monflag = "TRUE";
flymonster_start ();
};