3 // MONSTER PLUGIN SYSTEM
4 entity monster_info[MON_MAXCOUNT];
5 entity dummy_monster_info;
7 void register_monster(float id, float(float) func, float monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname)
10 monster_info[id - 1] = e = spawn();
11 e.classname = "monster_info";
13 e.netname = shortname;
14 e.monster_name = mname;
15 e.monster_func = func;
17 e.spawnflags = monsterflags;
20 e.model = strzone(strcat("models/monsters/", modelname));
26 float m_null(float dummy) { return 0; }
27 void register_monsters_done()
29 dummy_monster_info = spawn();
30 dummy_monster_info.classname = "monster_info";
31 dummy_monster_info.monsterid = 0; // you can recognize dummies by this
32 dummy_monster_info.netname = "";
33 dummy_monster_info.monster_name = "Monster";
34 dummy_monster_info.monster_func = m_null;
35 dummy_monster_info.mdl = "";
36 dummy_monster_info.mins = '-0 -0 -0';
37 dummy_monster_info.maxs = '0 0 0';
38 dummy_monster_info.model = "";
40 entity get_monsterinfo(float id)
43 if(id < MON_FIRST || id > MON_LAST)
44 return dummy_monster_info;
45 m = monster_info[id - 1];
48 return dummy_monster_info;