#endif
#ifdef SVQC
#include <common/monsters/sv_spawn.qc>
+ #include <common/monsters/spawner.qc>
#endif
#include <common/monsters/monster/_mod.inc>
--- /dev/null
+#include "sv_spawn.qh"
+
+void spawner_use(entity this, entity actor, entity trigger)
+{
+ int moncount = 0;
+ IL_EACH(g_monsters, it.realowner == this,
+ {
+ ++moncount;
+ });
+
+ if(moncount >= this.count)
+ return;
+
+ entity e = spawn();
+ e.noalign = this.noalign;
+ e.angles = this.angles;
+ e.monster_skill = this.monster_skill;
+ e = spawnmonster(e, this.spawnmob, 0, this, this, this.origin, false, false, this.monster_moveflags);
+}
+
+spawnfunc(monster_spawner)
+{
+ if(!autocvar_g_monsters || !this.spawnmob || this.spawnmob == "") { delete(this); return; }
+
+ this.use = spawner_use;
+}
FIELD_SCALAR(fld, sound1) \
FIELD_SCALAR(fld, sounds) \
FIELD_SCALAR(fld, spawnflags) \
+ FIELD_SCALAR(fld, spawnmob) \
FIELD_SCALAR(fld, speed) \
FIELD_SCALAR(fld, strength) \
FIELD_SCALAR(fld, target2) \
}
// HACK: remove players/bots as goals, they can lead a bot to unexpected places (cliffs, lava, etc)
- // TODO: rate waypoints near the targetted player at that moment, instead of the player itthis
+ // TODO: rate waypoints near the targetted player at that moment, instead of the player itself
if(IS_PLAYER(this.goalcurrent))
navigation_poproute(this);