3 const vector WIZARD_MIN = '-16 -16 -45';
4 const vector WIZARD_MAX = '16 16 16';
7 string WIZARD_MODEL = "models/monsters/wizard.mdl";
13 float autocvar_g_monster_wizard;
14 float autocvar_g_monster_wizard_health;
15 float autocvar_g_monster_wizard_speed_walk;
16 float autocvar_g_monster_wizard_speed_run;
17 float autocvar_g_monster_wizard_spike_damage;
18 float autocvar_g_monster_wizard_spike_edgedamage;
19 float autocvar_g_monster_wizard_spike_radius;
20 float autocvar_g_monster_wizard_spike_speed;
23 const float wizard_anim_hover = 0;
24 const float wizard_anim_fly = 1;
25 const float wizard_anim_magic = 2;
26 const float wizard_anim_pain = 3;
27 const float wizard_anim_death = 4;
29 void Wiz_FastExplode()
31 self.event_damage = func_null;
32 self.takedamage = DAMAGE_NO;
33 RadiusDamage (self, self.realowner, autocvar_g_monster_wizard_spike_damage, autocvar_g_monster_wizard_spike_edgedamage, autocvar_g_monster_wizard_spike_radius, world, 0, self.projectiledeathtype, other);
40 if(other == self.owner)
45 pointparticles(particleeffectnum("TE_WIZSPIKE"), self.origin, '0 0 0', 1);
53 vector dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
55 self.attack_finished_single = time + 0.2;
57 self.v_angle = self.angles;
58 makevectors (self.angles);
61 missile.owner = missile.realowner = self;
62 setsize (missile, '0 0 0', '0 0 0');
63 setorigin (missile, self.origin + v_forward * 14 + '0 0 30' + v_right * 14);
64 missile.enemy = self.enemy;
65 missile.nextthink = time + 3;
66 missile.think = Wiz_FastExplode;
67 missile.velocity = dir * autocvar_g_monster_wizard_spike_speed;
68 missile.avelocity = '300 300 300';
69 missile.solid = SOLID_BBOX;
70 missile.movetype = MOVETYPE_FLYMISSILE;
71 missile.touch = Wiz_FastTouch;
72 missile.projectiledeathtype = DEATH_MONSTER_SCRAG;
73 CSQCProjectile(missile, TRUE, PROJECTILE_CRYLINK, TRUE);
76 missile.owner = missile.realowner = self;
77 setsize (missile, '0 0 0', '0 0 0');
78 setorigin (missile, self.origin + v_forward * 14 + '0 0 30' + v_right * -14);
79 missile.enemy = self.enemy;
80 missile.nextthink = time + 3;
81 missile.touch = Wiz_FastTouch;
82 missile.solid = SOLID_BBOX;
83 missile.movetype = MOVETYPE_FLYMISSILE;
84 missile.think = Wiz_FastExplode;
85 missile.velocity = dir * autocvar_g_monster_wizard_spike_speed;
86 missile.avelocity = '300 300 300';
87 missile.projectiledeathtype = DEATH_MONSTER_SCRAG;
88 CSQCProjectile(missile, TRUE, PROJECTILE_CRYLINK, TRUE);
93 self.think = wizard_think;
94 self.nextthink = time + self.ticrate;
96 monster_move(autocvar_g_monster_wizard_speed_run, autocvar_g_monster_wizard_speed_walk, 300, wizard_anim_fly, wizard_anim_hover, wizard_anim_hover);
99 void wizard_fastattack ()
104 void wizard_dead_think()
106 self.think = wizard_dead_think;
107 self.nextthink = time + self.ticrate;
109 if(time >= self.ltime)
115 self.SendFlags |= MSF_MOVE; // keep up to date on the monster's location
120 Monster_CheckDropCvars ("wizard");
122 self.think = wizard_dead_think; // exception for wizard, as it needs to keep moving
123 self.ltime = time + 5;
124 self.nextthink = time + self.ticrate;
125 self.velocity_x = -200 + 400 * random();
126 self.velocity_y = -200 + 400 * random();
127 self.velocity_z = 100 + 100 * random();
129 monsters_setframe(wizard_anim_death);
131 monster_hook_death(); // for post-death mods
143 self.health = autocvar_g_monster_wizard_health * self.scale;
145 self.classname = "monster_wizard";
146 self.checkattack = GenericCheckAttack;
147 self.attack_ranged = Wiz_Missile;
148 self.nextthink = time + random() * 0.5 + 0.1;
149 self.movetype = MOVETYPE_FLY; // TODO: make it fly up/down
150 self.flags |= FL_FLY;
151 self.think = wizard_think;
152 self.sprite_height = 30;
154 monster_hook_spawn(); // for post-spawn mods
157 void spawnfunc_monster_wizard ()
159 if not(autocvar_g_monster_wizard) { remove(self); return; }
161 self.monster_spawnfunc = spawnfunc_monster_wizard;
163 if(Monster_CheckAppearFlags(self))
168 if not (monster_initialize(
169 "Scrag", MONSTER_SCRAG,
170 WIZARD_MIN, WIZARD_MAX,
172 wizard_die, wizard_spawn))
179 // compatibility with old spawns
180 void spawnfunc_monster_scrag () { spawnfunc_monster_wizard(); }