21 bool allow_any = (monster ==
"anyrandom");
23 if (monster ==
"random" || allow_any)
30 else if (monster !=
"")
33 FOREACH(Monsters, it != MON_Null && it.netname == monster,
40 if (!found && monster_id == MON_Null)
48 return spawnmonster(e,
"random", MON_Null, spawnedby, own, orig, respwn, removeifinvalid, moveflag);
52 e.realowner = spawnedby;
55 e.monster_moveflags = moveflag;
60 e.team = spawnedby.team;
62 e.monster_follow = own;
64 e.angles.y = spawnedby.angles.y;
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define FOREACH(list, cond, body)
const int MONSTER_TYPE_PASSIVE
doesn't target or chase enemies
const int MON_FLAG_HIDDEN
ERASEABLE void RandomSelection_Init()
#define RandomSelection_AddEnt(e, weight, priority)
entity RandomSelection_chosen_ent
bool Monster_Spawn(entity this, bool check_appear, Monster mon)
Setup the basic required properties for a monster.
const int MONSTERFLAG_NORESPAWN
monster doesn't respawn (revive)
const int MONSTERFLAG_SPAWNED
flag for spawned monsters
bool autocvar_g_monsters_owners
bool autocvar_g_monsters_teams
entity spawnmonster(entity e, string monster, Monster monster_id, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid, int moveflag)