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 ()
106 Monster_CheckDropCvars ("wizard");
108 self.think = monster_dead_think;
109 self.nextthink = time + self.ticrate;
110 self.ltime = time + 5;
111 self.velocity_x = -200 + 400 * random();
112 self.velocity_y = -200 + 400 * random();
113 self.velocity_z = 100 + 100 * random();
115 monsters_setframe(wizard_anim_death);
117 monster_hook_death(); // for post-death mods
129 self.health = autocvar_g_monster_wizard_health * self.scale;
131 self.classname = "monster_wizard";
132 self.checkattack = GenericCheckAttack;
133 self.attack_ranged = Wiz_Missile;
134 self.nextthink = time + random() * 0.5 + 0.1;
135 self.movetype = MOVETYPE_FLY; // TODO: make it fly up/down
136 self.flags |= FL_FLY;
137 self.think = wizard_think;
138 self.sprite_height = 30;
140 monster_setupsounds("wizard");
142 monster_hook_spawn(); // for post-spawn mods
145 void spawnfunc_monster_wizard ()
147 if not(autocvar_g_monster_wizard) { remove(self); return; }
149 self.monster_spawnfunc = spawnfunc_monster_wizard;
151 if(Monster_CheckAppearFlags(self))
156 if not (monster_initialize(
157 "Scrag", MONSTER_SCRAG,
158 WIZARD_MIN, WIZARD_MAX,
160 wizard_die, wizard_spawn))
167 // compatibility with old spawns
168 void spawnfunc_monster_scrag () { spawnfunc_monster_wizard(); }