1 #ifdef REGISTER_MONSTER
4 /* function */ m_wyvern,
5 /* spawnflags */ MONSTER_TYPE_FLY | MONSTER_SIZE_BROKEN | MON_FLAG_RANGED,
6 /* mins,maxs */ '-20 -20 -58', '20 20 20',
7 /* model */ "wizard.mdl",
8 /* netname */ "wyvern",
9 /* fullname */ _("Wyvern")
14 float autocvar_g_monster_wyvern_health;
15 float autocvar_g_monster_wyvern_attack_fireball_damage;
16 float autocvar_g_monster_wyvern_attack_fireball_edgedamage;
17 float autocvar_g_monster_wyvern_attack_fireball_damagetime;
18 float autocvar_g_monster_wyvern_attack_fireball_force;
19 float autocvar_g_monster_wyvern_attack_fireball_radius;
20 float autocvar_g_monster_wyvern_attack_fireball_speed;
21 float autocvar_g_monster_wyvern_speed_stop;
22 float autocvar_g_monster_wyvern_speed_run;
23 float autocvar_g_monster_wyvern_speed_walk;
25 const float wyvern_anim_hover = 0;
26 const float wyvern_anim_fly = 1;
27 const float wyvern_anim_magic = 2;
28 const float wyvern_anim_pain = 3;
29 const float wyvern_anim_death = 4;
31 void wyvern_fireball_explode()
36 pointparticles(particleeffectnum("fireball_explode"), self.origin, '0 0 0', 1);
38 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);
40 for(e = world; (e = findfloat(e, takedamage, DAMAGE_AIM)); ) if(vlen(e.origin - self.origin) <= (autocvar_g_monster_wyvern_attack_fireball_radius))
41 Fire_AddDamage(e, self, 5 * Monster_SkillModifier(), (autocvar_g_monster_wyvern_attack_fireball_damagetime), self.projectiledeathtype);
47 void wyvern_fireball_touch()
51 wyvern_fireball_explode();
54 void wyvern_fireball()
56 entity missile = spawn();
57 vector dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
59 monster_makevectors(self.enemy);
61 missile.owner = missile.realowner = self;
62 missile.solid = SOLID_TRIGGER;
63 missile.movetype = MOVETYPE_FLYMISSILE;
64 missile.projectiledeathtype = DEATH_MONSTER_WYVERN;
65 setsize(missile, '-6 -6 -6', '6 6 6');
66 setorigin(missile, self.origin + self.view_ofs + v_forward * 14);
67 missile.flags = FL_PROJECTILE;
68 missile.velocity = dir * (autocvar_g_monster_wyvern_attack_fireball_speed);
69 missile.avelocity = '300 300 300';
70 missile.nextthink = time + 5;
71 missile.think = wyvern_fireball_explode;
72 missile.enemy = self.enemy;
73 missile.touch = wyvern_fireball_touch;
74 CSQCProjectile(missile, true, PROJECTILE_FIREMINE, true);
77 float wyvern_attack(float attack_type)
81 case MONSTER_ATTACK_MELEE:
82 case MONSTER_ATTACK_RANGED:
84 self.attack_finished_single = time + 1.2;
95 void spawnfunc_monster_wyvern()
97 self.classname = "monster_wyvern";
99 if(!monster_initialize(MON_WYVERN)) { remove(self); return; }
102 // compatibility with old spawns
103 void spawnfunc_monster_wizard() { spawnfunc_monster_wyvern(); }
105 float m_wyvern(float req)
111 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);
116 self.frame = wyvern_anim_death;
117 self.velocity_x = -200 + 400 * random();
118 self.velocity_y = -200 + 400 * random();
119 self.velocity_z = 100 + 100 * random();
124 if(!self.health) self.health = (autocvar_g_monster_wyvern_health);
126 self.monster_loot = spawnfunc_item_cells;
127 self.monster_attackfunc = wyvern_attack;
128 self.frame = wyvern_anim_hover;
134 precache_model("models/monsters/wizard.mdl");
144 float m_wyvern(float req)
158 #endif // REGISTER_MONSTER