4 REGISTER_MONSTER_SIMPLE(
6 /* spawnflags */ MONSTER_TYPE_FLY | MONSTER_SIZE_BROKEN | MON_FLAG_RANGED,
7 /* mins,maxs */ '-20 -20 -58', '20 20 20',
8 /* model */ "wizard.mdl",
9 /* netname */ "wyvern",
10 /* fullname */ _("Wyvern")
13 this.monster_func = m_wyvern;
18 float autocvar_g_monster_wyvern_health;
19 float autocvar_g_monster_wyvern_attack_fireball_damage;
20 float autocvar_g_monster_wyvern_attack_fireball_edgedamage;
21 float autocvar_g_monster_wyvern_attack_fireball_damagetime;
22 float autocvar_g_monster_wyvern_attack_fireball_force;
23 float autocvar_g_monster_wyvern_attack_fireball_radius;
24 float autocvar_g_monster_wyvern_attack_fireball_speed;
25 float autocvar_g_monster_wyvern_speed_stop;
26 float autocvar_g_monster_wyvern_speed_run;
27 float autocvar_g_monster_wyvern_speed_walk;
29 const float wyvern_anim_hover = 0;
30 const float wyvern_anim_fly = 1;
31 const float wyvern_anim_magic = 2;
32 const float wyvern_anim_pain = 3;
33 const float wyvern_anim_death = 4;
35 void wyvern_fireball_explode()
40 pointparticles(particleeffectnum("fireball_explode"), self.origin, '0 0 0', 1);
42 RadiusDamage(self, self.realowner, (autocvar_g_monster_wyvern_attack_fireball_damage), (autocvar_g_monster_wyvern_attack_fireball_edgedamage), (autocvar_g_monster_wyvern_attack_fireball_force), world, world, (autocvar_g_monster_wyvern_attack_fireball_radius), self.projectiledeathtype, world);
44 for(e = world; (e = findfloat(e, takedamage, DAMAGE_AIM)); ) if(vlen(e.origin - self.origin) <= (autocvar_g_monster_wyvern_attack_fireball_radius))
45 Fire_AddDamage(e, self, 5 * Monster_SkillModifier(), (autocvar_g_monster_wyvern_attack_fireball_damagetime), self.projectiledeathtype);
51 void wyvern_fireball_touch()
55 wyvern_fireball_explode();
58 void wyvern_fireball()
60 entity missile = spawn();
61 vector dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
63 monster_makevectors(self.enemy);
65 missile.owner = missile.realowner = self;
66 missile.solid = SOLID_TRIGGER;
67 missile.movetype = MOVETYPE_FLYMISSILE;
68 missile.projectiledeathtype = DEATH_MONSTER_WYVERN;
69 setsize(missile, '-6 -6 -6', '6 6 6');
70 setorigin(missile, self.origin + self.view_ofs + v_forward * 14);
71 missile.flags = FL_PROJECTILE;
72 missile.velocity = dir * (autocvar_g_monster_wyvern_attack_fireball_speed);
73 missile.avelocity = '300 300 300';
74 missile.nextthink = time + 5;
75 missile.think = wyvern_fireball_explode;
76 missile.enemy = self.enemy;
77 missile.touch = wyvern_fireball_touch;
78 CSQCProjectile(missile, true, PROJECTILE_FIREMINE, true);
81 float wyvern_attack(float attack_type)
85 case MONSTER_ATTACK_MELEE:
86 case MONSTER_ATTACK_RANGED:
88 self.attack_finished_single = time + 1.2;
99 void spawnfunc_monster_wyvern()
101 self.classname = "monster_wyvern";
103 if(!monster_initialize(MON_WYVERN.monsterid)) { remove(self); return; }
106 // compatibility with old spawns
107 void spawnfunc_monster_wizard() { spawnfunc_monster_wyvern(); }
109 float m_wyvern(float req)
115 monster_move((autocvar_g_monster_wyvern_speed_run), (autocvar_g_monster_wyvern_speed_walk), (autocvar_g_monster_wyvern_speed_stop), wyvern_anim_fly, wyvern_anim_hover, wyvern_anim_hover);
120 self.frame = wyvern_anim_death;
121 self.velocity_x = -200 + 400 * random();
122 self.velocity_y = -200 + 400 * random();
123 self.velocity_z = 100 + 100 * random();
128 if(!self.health) self.health = (autocvar_g_monster_wyvern_health);
130 self.monster_loot = spawnfunc_item_cells;
131 self.monster_attackfunc = wyvern_attack;
132 self.frame = wyvern_anim_hover;
138 precache_model("models/monsters/wizard.mdl");
148 float m_wyvern(float req)