]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/events.qh
Merge branch 'master' into Lyberta/TeamplayFixes_
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / events.qh
1 #pragma once
2
3 #include <common/mutators/base.qh>
4
5 // register all possible hooks here
6
7 /** called when a player becomes observer, after shared setup */
8 #define EV_MakePlayerObserver(i, o) \
9     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
10     /**/
11 MUTATOR_HOOKABLE(MakePlayerObserver, EV_MakePlayerObserver)
12
13 /** */
14 #define EV_PutClientInServer(i, o) \
15         /** client wanting to spawn */ i(entity, MUTATOR_ARGV_0_entity) \
16     /**/
17 MUTATOR_HOOKABLE(PutClientInServer, EV_PutClientInServer);
18
19 /**
20  * return true to prevent a spectator/observer to spawn as player
21  */
22  #define EV_ForbidSpawn(i, o) \
23     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
24     /**/
25 MUTATOR_HOOKABLE(ForbidSpawn, EV_ForbidSpawn);
26
27 /** called when a player spawns as player, after shared setup, before his weapon is chosen (so items may be changed in here) */
28 #define EV_PlayerSpawn(i, o) \
29         /** player spawning */ i(entity, MUTATOR_ARGV_0_entity) \
30     /** spot that was used, or NULL */ i(entity, MUTATOR_ARGV_1_entity) \
31     /**/
32 MUTATOR_HOOKABLE(PlayerSpawn, EV_PlayerSpawn);
33
34 /** called after a player's weapon is chosen so it can be overriden here */
35 #define EV_PlayerWeaponSelect(i, o) \
36         /** player spawning */ i(entity, MUTATOR_ARGV_0_entity) \
37     /**/
38 MUTATOR_HOOKABLE(PlayerWeaponSelect, EV_PlayerWeaponSelect);
39
40 /** called in reset_map */
41 #define EV_reset_map_global(i, o) \
42     /**/
43 MUTATOR_HOOKABLE(reset_map_global, EV_reset_map_global);
44
45 /** called in reset_map */
46 #define EV_reset_map_players(i, o) \
47     /**/
48 MUTATOR_HOOKABLE(reset_map_players, EV_reset_map_players);
49
50 /** returns 1 if clearing player score shall not be allowed */
51 #define EV_ForbidPlayerScore_Clear(i, o) \
52     /**/
53 MUTATOR_HOOKABLE(ForbidPlayerScore_Clear, EV_ForbidPlayerScore_Clear);
54
55 /** called when a player disconnects */
56 #define EV_ClientDisconnect(i, o) \
57     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
58     /**/
59 MUTATOR_HOOKABLE(ClientDisconnect, EV_ClientDisconnect);
60
61 /** called when a player dies to e.g. remove stuff he was carrying. */
62 #define EV_PlayerDies(i, o) \
63         /** inflictor           */ i(entity, MUTATOR_ARGV_0_entity) \
64     /** attacker        */ i(entity, MUTATOR_ARGV_1_entity) \
65     /** target                  */ i(entity, MUTATOR_ARGV_2_entity) \
66     /** deathtype       */ i(float,  MUTATOR_ARGV_3_float) \
67     /** damage          */ i(float,  MUTATOR_ARGV_4_float) \
68     /** damage                  */ o(float,  MUTATOR_ARGV_4_float) \
69     /**/
70 MUTATOR_HOOKABLE(PlayerDies, EV_PlayerDies);
71
72 /** allows overriding the frag centerprint messages */
73 #define EV_FragCenterMessage(i, o) \
74     /** attacker       */ i(entity, MUTATOR_ARGV_0_entity) \
75     /** target         */ i(entity, MUTATOR_ARGV_1_entity) \
76     /** deathtype      */ i(float, MUTATOR_ARGV_2_float) \
77     /** attacker kcount*/ i(int,  MUTATOR_ARGV_3_int) \
78     /** targ killcount */ i(int,  MUTATOR_ARGV_4_int) \
79     /**/
80 MUTATOR_HOOKABLE(FragCenterMessage, EV_FragCenterMessage);
81
82 /** called when a player dies to e.g. remove stuff he was carrying */
83 #define EV_PlayHitsound(i, o) \
84     /** victim */ i(entity, MUTATOR_ARGV_0_entity) \
85     /** attacker */ i(entity, MUTATOR_ARGV_1_entity) \
86     /**/
87 MUTATOR_HOOKABLE(PlayHitsound, EV_PlayHitsound);
88
89 /** called when an item model is about to be set, allows custom paths etc. */
90 #define EV_ItemModel(i, o) \
91     /** model       */ i(string, MUTATOR_ARGV_0_string) \
92     /** output      */ i(string, MUTATOR_ARGV_1_string) \
93     /**/               o(string, MUTATOR_ARGV_1_string) \
94     /**/
95 MUTATOR_HOOKABLE(ItemModel, EV_ItemModel);
96
97 /** called when an item sound is about to be played, allows custom paths etc. */
98 #define EV_ItemSound(i, o) \
99     /** sound       */ i(string, MUTATOR_ARGV_0_string) \
100     /** output      */ i(string, MUTATOR_ARGV_1_string) \
101     /**/               o(string, MUTATOR_ARGV_1_string) \
102     /**/
103 MUTATOR_HOOKABLE(ItemSound, EV_ItemSound);
104
105 /** called when someone was fragged by "self", and is expected to change frag_score to adjust scoring for the kill */
106 #define EV_GiveFragsForKill(i, o) \
107     /** attacker   */ i(entity, MUTATOR_ARGV_0_entity) \
108     /** target     */ i(entity, MUTATOR_ARGV_1_entity) \
109     /** frag score */ i(float, MUTATOR_ARGV_2_float) \
110     /**            */ o(float, MUTATOR_ARGV_2_float) \
111     /**/
112 MUTATOR_HOOKABLE(GiveFragsForKill, EV_GiveFragsForKill);
113
114 /** called when the match ends */
115 MUTATOR_HOOKABLE(MatchEnd, EV_NO_ARGS);
116
117 /** allows adjusting allowed teams */
118 #define EV_CheckAllowedTeams(i, o) \
119     /** mask of teams      */ i(float, MUTATOR_ARGV_0_float) \
120     /**/                      o(float, MUTATOR_ARGV_0_float) \
121     /** team entity name   */ i(string, MUTATOR_ARGV_1_string) \
122     /**/                      o(string, MUTATOR_ARGV_1_string) \
123     /** player checked     */ i(entity, MUTATOR_ARGV_2_entity) \
124     /**/
125 MUTATOR_HOOKABLE(CheckAllowedTeams, EV_CheckAllowedTeams);
126
127 /** copies variables for spectating "spectatee" to "this" */
128 #define EV_SpectateCopy(i, o) \
129     /** spectatee   */ i(entity, MUTATOR_ARGV_0_entity) \
130     /** client      */ i(entity, MUTATOR_ARGV_1_entity) \
131     /**/
132 MUTATOR_HOOKABLE(SpectateCopy, EV_SpectateCopy);
133
134 /** called when formatting a chat message to replace fancy functions */
135 #define EV_FormatMessage(i, o) \
136     /** player        */ i(entity, MUTATOR_ARGV_0_entity) \
137     /** escape        */ i(string, MUTATOR_ARGV_1_string) \
138     /** replacement   */ i(string, MUTATOR_ARGV_2_string) \
139     /**/                 o(string, MUTATOR_ARGV_2_string) \
140     /** message       */ i(string, MUTATOR_ARGV_3_string) \
141     /**/
142 MUTATOR_HOOKABLE(FormatMessage, EV_FormatMessage);
143
144 /** called before any formatting is applied, handy for tweaking the message before scripts get ahold of it */
145 #define EV_PreFormatMessage(i, o) \
146     /** player        */ i(entity, MUTATOR_ARGV_0_entity) \
147     /** message       */ i(string, MUTATOR_ARGV_1_string) \
148     /**/                 o(string, MUTATOR_ARGV_1_string) \
149     /**/
150 MUTATOR_HOOKABLE(PreFormatMessage, EV_PreFormatMessage);
151
152 /** returns true if throwing the current weapon shall not be allowed */
153 #define EV_ForbidThrowCurrentWeapon(i, o) \
154     /** player        */ i(entity, MUTATOR_ARGV_0_entity) \
155     /** weapon entity */ i(entity, MUTATOR_ARGV_1_entity) \
156     /**/
157 MUTATOR_HOOKABLE(ForbidThrowCurrentWeapon, EV_ForbidThrowCurrentWeapon);
158
159 /** returns true if dropping the current weapon shall not be allowed at any time including death */
160 #define EV_ForbidDropCurrentWeapon(i, o) \
161     /** player */        i(entity, MUTATOR_ARGV_0_entity) \
162     /** weapon id */     i(int, MUTATOR_ARGV_1_int) \
163     /**/
164 MUTATOR_HOOKABLE(ForbidDropCurrentWeapon, EV_ForbidDropCurrentWeapon);
165
166 /**  */
167 MUTATOR_HOOKABLE(SetDefaultAlpha, EV_NO_ARGS);
168
169 /** allows changing attack rate */
170 #define EV_WeaponRateFactor(i, o) \
171     /** weapon rate */  i(float, MUTATOR_ARGV_0_float) \
172     /**/                o(float, MUTATOR_ARGV_0_float) \
173     /** player */       i(entity, MUTATOR_ARGV_1_entity) \
174     /**/
175 MUTATOR_HOOKABLE(WeaponRateFactor, EV_WeaponRateFactor);
176
177 /** allows changing weapon speed (projectiles mostly) */
178 #define EV_WeaponSpeedFactor(i, o) \
179     /** weapon speed */ i(float, MUTATOR_ARGV_0_float) \
180     /**/                o(float, MUTATOR_ARGV_0_float) \
181     /** player */       i(entity, MUTATOR_ARGV_1_entity) \
182     /**/
183 MUTATOR_HOOKABLE(WeaponSpeedFactor, EV_WeaponSpeedFactor);
184
185 /** adjusts {warmup_}start_{items,weapons,ammo_{cells,plasma,rockets,nails,shells,fuel}} */
186 MUTATOR_HOOKABLE(SetStartItems, EV_NO_ARGS);
187
188 /** called every frame. customizes the waypoint for spectators */
189 #define EV_CustomizeWaypoint(i, o) \
190     /** waypoint                        */ i(entity, MUTATOR_ARGV_0_entity) \
191     /** player; other.enemy = spectator */ i(entity, MUTATOR_ARGV_1_entity) \
192     /**/
193 MUTATOR_HOOKABLE(CustomizeWaypoint, EV_CustomizeWaypoint);
194
195 /**
196  * checks if the current item may be spawned (.items and .weapons may be read and written to, as well as the ammo_ fields)
197  * return error to request removal
198  */
199 #define EV_FilterItem(i, o) \
200     /** item        */ i(entity, MUTATOR_ARGV_0_entity) \
201     /**/
202 MUTATOR_HOOKABLE(FilterItem, EV_FilterItem);
203
204 /** return error to request removal */
205 #define EV_TurretSpawn(i, o) \
206     /** turret        */ i(entity, MUTATOR_ARGV_0_entity) \
207     /**/
208 MUTATOR_HOOKABLE(TurretSpawn, EV_TurretSpawn);
209
210 /** return error to not attack */
211 #define EV_TurretFire(i, o) \
212     /** turret        */ i(entity, MUTATOR_ARGV_0_entity) \
213     /**/
214 MUTATOR_HOOKABLE(TurretFire, EV_TurretFire);
215
216 /** return error to not attack */
217 #define EV_Turret_CheckFire(i, o) \
218     /** turret                      */ i(entity, MUTATOR_ARGV_0_entity) \
219     /** to fire or not to fire      */ o(bool, MUTATOR_ARGV_1_bool) \
220     /**/
221 MUTATOR_HOOKABLE(Turret_CheckFire, EV_Turret_CheckFire);
222
223 /** return error to prevent entity spawn, or modify the entity */
224 #define EV_OnEntityPreSpawn(i, o) \
225    /** entity  */ i(entity, MUTATOR_ARGV_0_entity) \
226     /**/
227 MUTATOR_HOOKABLE(OnEntityPreSpawn, EV_OnEntityPreSpawn);
228
229 /** runs in the event loop for players; is called for ALL player entities, also bots, also the dead, or spectators */
230 #define EV_PlayerPreThink(i, o) \
231     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
232     /**/
233 MUTATOR_HOOKABLE(PlayerPreThink, EV_PlayerPreThink);
234
235 /** TODO change this into a general PlayerPostThink hook? */
236 #define EV_GetPressedKeys(i, o) \
237     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
238     /**/
239 MUTATOR_HOOKABLE(GetPressedKeys, EV_GetPressedKeys);
240
241 /** is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client */
242 #define EV_GetCvars(i, o) \
243     /**/ i(float, get_cvars_f) \
244     /**/ i(string, get_cvars_s) \
245     /**/
246 float get_cvars_f;
247 string get_cvars_s;
248 MUTATOR_HOOKABLE(GetCvars, EV_NO_ARGS); // NOTE: Can't use EV_GetCvars because of `SZ_GetSpace: overflow`
249
250 /** can edit any "just fired" projectile */
251 #define EV_EditProjectile(i, o) \
252     /** projectile owner */ i(entity, MUTATOR_ARGV_0_entity) \
253     /** projectile */ i(entity, MUTATOR_ARGV_1_entity) \
254     /**/
255 MUTATOR_HOOKABLE(EditProjectile, EV_EditProjectile);
256
257 /** called when a monster spawns */
258 #define EV_MonsterSpawn(i, o) \
259     /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
260     /**/
261 MUTATOR_HOOKABLE(MonsterSpawn, EV_MonsterSpawn);
262
263 /** called when a monster dies */
264 #define EV_MonsterDies(i, o) \
265     /** target       */ i(entity, MUTATOR_ARGV_0_entity) \
266     /** attacker     */ i(entity, MUTATOR_ARGV_1_entity) \
267     /** deathtype    */ i(float, MUTATOR_ARGV_2_float) \
268     /**/
269 MUTATOR_HOOKABLE(MonsterDies, EV_MonsterDies);
270
271 /** called when a monster dies */
272 #define EV_MonsterRemove(i, o) \
273     /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
274     /**/
275 MUTATOR_HOOKABLE(MonsterRemove, EV_MonsterRemove);
276
277 /** called when a monster wants to respawn */
278 #define EV_MonsterRespawn(i, o) \
279     /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
280     /**/
281 MUTATOR_HOOKABLE(MonsterRespawn, EV_MonsterRespawn);
282
283 /** called when a monster is dropping loot */
284 #define EV_MonsterDropItem(i, o) \
285     /* monster */                          i(entity, MUTATOR_ARGV_0_entity) \
286     /* item (can be removed or changed) */ i(entity, MUTATOR_ARGV_1_entity) \
287     /**/                                   o(entity, MUTATOR_ARGV_1_entity) \
288     /* attacker */                         i(entity, MUTATOR_ARGV_2_entity) \
289     /**/
290 .entity monster_loot;
291 MUTATOR_HOOKABLE(MonsterDropItem, EV_MonsterDropItem);
292
293 /**
294  * called when a monster moves
295  * returning true makes the monster stop
296  */
297 #define EV_MonsterMove(i, o) \
298     /** monster */       i(entity, MUTATOR_ARGV_0_entity) \
299     /** run speed */     i(float, MUTATOR_ARGV_1_float) \
300     /**/                 o(float, MUTATOR_ARGV_1_float) \
301     /** walk speed */    i(float, MUTATOR_ARGV_2_float) \
302     /**/                 o(float, MUTATOR_ARGV_2_float) \
303     /** move target */   i(entity, MUTATOR_ARGV_3_entity) \
304     /**/                 o(entity, MUTATOR_ARGV_3_entity) \
305     /**/
306 MUTATOR_HOOKABLE(MonsterMove, EV_MonsterMove);
307
308 /** called when a monster looks for another target */
309 MUTATOR_HOOKABLE(MonsterFindTarget, EV_NO_ARGS);
310
311 /**
312  * called when validating a monster's target
313  */
314 #define EV_MonsterValidTarget(i, o) \
315     /** monster */       i(entity, MUTATOR_ARGV_0_entity) \
316     /** target */        i(entity, MUTATOR_ARGV_1_entity) \
317     /**/
318 MUTATOR_HOOKABLE(MonsterValidTarget, EV_MonsterValidTarget);
319
320 /** called to change a random monster to a miniboss */
321 #define EV_MonsterCheckBossFlag(i, o) \
322     /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
323     /**/
324 MUTATOR_HOOKABLE(MonsterCheckBossFlag, EV_MonsterCheckBossFlag);
325
326 /**
327  * called when a player tries to spawn a monster
328  * return 1 to prevent spawning
329  * NOTE: requires reason if disallowed
330  */
331  #define EV_AllowMobSpawning(i, o) \
332     /** caller */ i(entity, MUTATOR_ARGV_0_entity) \
333     /** reason */ o(string, MUTATOR_ARGV_1_string) \
334     /**/
335 MUTATOR_HOOKABLE(AllowMobSpawning, EV_AllowMobSpawning);
336
337 /** called when a player gets damaged to e.g. remove stuff he was carrying. */
338 #define EV_PlayerDamage_SplitHealthArmor(i, o) \
339         /** inflictor           */ i(entity, MUTATOR_ARGV_0_entity) \
340     /** attacker        */ i(entity, MUTATOR_ARGV_1_entity) \
341     /** target                  */ i(entity, MUTATOR_ARGV_2_entity) \
342     /** force (no out)  */ i(vector, MUTATOR_ARGV_3_vector) \
343     /** damage take     */ i(float,  MUTATOR_ARGV_4_float) \
344     /** damage take     */ o(float,  MUTATOR_ARGV_4_float) \
345     /** damage save     */ i(float,  MUTATOR_ARGV_5_float) \
346     /** damage save     */ o(float,  MUTATOR_ARGV_5_float) \
347     /** deathtype               */ i(float,  MUTATOR_ARGV_6_float) \
348     /** damage              */ i(float,  MUTATOR_ARGV_7_float) \
349     /**/
350 MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor, EV_PlayerDamage_SplitHealthArmor);
351
352 /**
353  * called to adjust damage and force values which are applied to the player, used for e.g. strength damage/force multiplier
354  * i'm not sure if I should change this around slightly (Naming of the entities, and also how they're done in g_damage).
355  */
356 #define EV_Damage_Calculate(i, o) \
357     /** inflictor               */ i(entity, MUTATOR_ARGV_0_entity) \
358     /** attacker        */ i(entity, MUTATOR_ARGV_1_entity) \
359     /** target                  */ i(entity, MUTATOR_ARGV_2_entity) \
360     /** deathtype       */ i(float,  MUTATOR_ARGV_3_float) \
361     /** damage          */ i(float,  MUTATOR_ARGV_4_float) \
362     /** damage                  */ o(float,  MUTATOR_ARGV_4_float) \
363     /** mirrordamage    */ i(float,  MUTATOR_ARGV_5_float) \
364     /** mirrordamage    */ o(float,  MUTATOR_ARGV_5_float) \
365     /** force           */ i(vector, MUTATOR_ARGV_6_vector) \
366     /** force                   */ o(vector, MUTATOR_ARGV_6_vector) \
367     /**/
368 MUTATOR_HOOKABLE(Damage_Calculate, EV_Damage_Calculate);
369
370 /**
371  * Called when a player is damaged
372  */
373 #define EV_PlayerDamaged(i, o) \
374     /** attacker  */ i(entity, MUTATOR_ARGV_0_entity) \
375     /** target    */ i(entity, MUTATOR_ARGV_1_entity) \
376     /** health    */ i(float,    MUTATOR_ARGV_2_float) \
377     /** armor     */ i(float,    MUTATOR_ARGV_3_float) \
378     /** location  */ i(vector, MUTATOR_ARGV_4_vector) \
379     /** deathtype */ i(int,    MUTATOR_ARGV_5_int) \
380     /** potential_damage     */ i(float,    MUTATOR_ARGV_6_float) \
381     /**/
382 MUTATOR_HOOKABLE(PlayerDamaged, EV_PlayerDamaged);
383
384 /**
385  * Called by W_DecreaseAmmo
386  */
387 #define EV_W_DecreaseAmmo(i, o) \
388     /** actor */            i(entity, MUTATOR_ARGV_0_entity) \
389     /** weapon entity */    i(entity, MUTATOR_ARGV_1_entity) \
390     /**/
391 MUTATOR_HOOKABLE(W_DecreaseAmmo, EV_W_DecreaseAmmo);
392
393 /**
394  * Called by W_Reload
395  */
396 #define EV_W_Reload(i, o) \
397     /** actor */ i(entity, MUTATOR_ARGV_0_entity) \
398     /**/
399 MUTATOR_HOOKABLE(W_Reload, EV_W_Reload);
400
401 /** called at the end of player_powerups() in client.qc, used for manipulating the values which are set by powerup items. */
402 #define EV_PlayerPowerups(i, o) \
403     /** player */    i(entity, MUTATOR_ARGV_0_entity) \
404     /** old items */ i(int, MUTATOR_ARGV_1_int) \
405     /**/
406 MUTATOR_HOOKABLE(PlayerPowerups, EV_PlayerPowerups);
407
408 /**
409  * called every player think frame
410  * return 1 to disable regen
411  */
412  #define EV_PlayerRegen(i, o) \
413     /** player */               i(entity, MUTATOR_ARGV_0_entity) \
414     /** max_mod */              i(float, MUTATOR_ARGV_1_float) \
415     /**/                        o(float, MUTATOR_ARGV_1_float) \
416     /** regen_mod */            i(float, MUTATOR_ARGV_2_float) \
417     /**/                        o(float, MUTATOR_ARGV_2_float) \
418     /** rot_mod */              i(float, MUTATOR_ARGV_3_float) \
419     /**/                        o(float, MUTATOR_ARGV_3_float) \
420     /** limit_mod */            i(float, MUTATOR_ARGV_4_float) \
421     /**/                        o(float, MUTATOR_ARGV_4_float) \
422     /** health_regen */         i(float, MUTATOR_ARGV_5_float) \
423     /**/                        o(float, MUTATOR_ARGV_5_float) \
424     /** health_regenlinear */   i(float, MUTATOR_ARGV_6_float) \
425     /**/                        o(float, MUTATOR_ARGV_6_float) \
426     /** health_rot */           i(float, MUTATOR_ARGV_7_float) \
427     /**/                        o(float, MUTATOR_ARGV_7_float) \
428     /** health_rotlinear */     i(float, MUTATOR_ARGV_8_float) \
429     /**/                        o(float, MUTATOR_ARGV_8_float) \
430     /** health_stable */        i(float, MUTATOR_ARGV_9_float) \
431     /**/                        o(float, MUTATOR_ARGV_9_float) \
432     /** health_rotstable */     i(float, MUTATOR_ARGV_10_float) \
433     /**/                        o(float, MUTATOR_ARGV_10_float) \
434     /**/
435 MUTATOR_HOOKABLE(PlayerRegen, EV_PlayerRegen);
436
437 /**
438  * called when the use key is pressed
439  * if MUTATOR_RETURNVALUE is 1, don't do anything
440  * return 1 if the use key actually did something
441  */
442  #define EV_PlayerUseKey(i, o) \
443     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
444     /**/
445 MUTATOR_HOOKABLE(PlayerUseKey, EV_PlayerUseKey);
446
447 /**
448  * called when a client command is parsed
449  * NOTE: hooks MUST start with if (MUTATOR_RETURNVALUE) return false;
450  * NOTE: return true if you handled the command, return false to continue handling
451  * NOTE: THESE HOOKS MUST NEVER EVER CALL tokenize()
452  * // example:
453  * MUTATOR_HOOKFUNCTION(foo_SV_ParseClientCommand)
454  * {
455  *     if (MUTATOR_RETURNVALUE) // command was already handled?
456  *         return false;
457  *     if (cmd_name == "echocvar" && cmd_argc >= 2)
458  *     {
459  *         print(cvar_string(argv(1)), "\n");
460  *         return true;
461  *     }
462  *     if (cmd_name == "echostring" && cmd_argc >= 2)
463  *     {
464  *         print(substring(cmd_string, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), "\n");
465  *         return true;
466  *     }
467  *     return false;
468  * }
469  */
470 #define EV_SV_ParseClientCommand(i, o) \
471         /** client sending the command */       i(entity, MUTATOR_ARGV_0_entity) \
472     /** command name */                     i(string, MUTATOR_ARGV_1_string) \
473         /** argc (also, argv() can be used) */  i(int, MUTATOR_ARGV_2_int) \
474         /** whole command, use only if you really have to */ i(string, MUTATOR_ARGV_3_string) \
475     /**/
476 MUTATOR_HOOKABLE(SV_ParseClientCommand, EV_SV_ParseClientCommand);
477
478 /** please read EV_SV_ParseClientCommand description before using */
479 #define EV_SV_ParseServerCommand(i, o) \
480    /** command name */ i(string, MUTATOR_ARGV_0_string) \
481         /** argc (also, argv() can be used) */ i(int, MUTATOR_ARGV_1_int) \
482         /** whole command, use only if you really have to */ i(string, MUTATOR_ARGV_2_string) \
483     /**/
484 MUTATOR_HOOKABLE(SV_ParseServerCommand, EV_SV_ParseServerCommand);
485
486 /**
487  * called when a spawnpoint is being evaluated
488  * return 1 to make the spawnpoint unusable
489  */
490 #define EV_Spawn_Score(i, o) \
491     /** player wanting to spawn */ i(entity, MUTATOR_ARGV_0_entity) \
492     /** spot to be evaluated */ i(entity, MUTATOR_ARGV_1_entity) \
493     /** spot score, _x is priority, _y is "distance" */ i(vector, MUTATOR_ARGV_2_vector) \
494     /**/ o(vector, MUTATOR_ARGV_2_vector) \
495     /**/
496 MUTATOR_HOOKABLE(Spawn_Score, EV_Spawn_Score);
497
498 /** runs globally each server frame */
499 MUTATOR_HOOKABLE(SV_StartFrame, EV_NO_ARGS);
500
501 #define EV_SetModname(i, o) \
502     /** name of the mutator/mod if it warrants showing as such in the server browser */ \
503     /**/ i(string, MUTATOR_ARGV_0_string) \
504     /**/ o(string, MUTATOR_ARGV_0_string) \
505     /**/
506 MUTATOR_HOOKABLE(SetModname, EV_SetModname);
507
508 /**
509  * called for each item being spawned on a map, including dropped weapons
510  * return 1 to remove an item
511  */
512 #define EV_Item_Spawn(i, o) \
513     /** item */ i(entity, MUTATOR_ARGV_0_entity) \
514     /**/
515 MUTATOR_HOOKABLE(Item_Spawn, EV_Item_Spawn);
516
517 #define EV_SetWeaponreplace(i, o) \
518     /** map entity */  i(entity, MUTATOR_ARGV_0_entity) \
519     /** weapon info */ i(entity, MUTATOR_ARGV_1_entity) \
520     /** replacement */ i(string, MUTATOR_ARGV_2_string) \
521     /**/               o(string, MUTATOR_ARGV_2_string) \
522     /**/
523 MUTATOR_HOOKABLE(SetWeaponreplace, EV_SetWeaponreplace);
524
525 /** called when an item is about to respawn */
526 #define EV_Item_RespawnCountdown(i, o) \
527     /** item */   i(entity, MUTATOR_ARGV_0_entity) \
528     /**/
529 MUTATOR_HOOKABLE(Item_RespawnCountdown, EV_Item_RespawnCountdown);
530
531 /** called when a bot checks a target to attack */
532 #define EV_BotShouldAttack(i, o) \
533     /** bot */    i(entity, MUTATOR_ARGV_0_entity) \
534     /** target */ i(entity, MUTATOR_ARGV_1_entity) \
535     /**/
536 MUTATOR_HOOKABLE(BotShouldAttack, EV_BotShouldAttack);
537
538 /**
539  * called whenever a player goes through a portal gun teleport
540  * allows you to strip a player of an item if they go through the teleporter to help prevent cheating
541  */
542 #define EV_PortalTeleport(i, o) \
543     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
544     /**/
545 MUTATOR_HOOKABLE(PortalTeleport, EV_PortalTeleport);
546
547 /**
548  * called whenever a player uses impulse 33 (help me) in impulse.qc
549  * normally help me ping uses .waypointsprite_attachedforcarrier,
550  * but if your mutator uses something different then you can handle it
551  * in a special manner using this hook
552  */
553 #define EV_HelpMePing(i, o) \
554     /** the player who pressed impulse 33 */ i(entity, MUTATOR_ARGV_0_entity) \
555     /**/
556 MUTATOR_HOOKABLE(HelpMePing, EV_HelpMePing);
557
558 /**
559  * called when a vehicle initializes
560  * return true to remove the vehicle
561  */
562 #define EV_VehicleInit(i, o) \
563     /** vehicle */ i(entity, MUTATOR_ARGV_0_entity) \
564     /**/
565 MUTATOR_HOOKABLE(VehicleInit, EV_VehicleInit);
566
567 /**
568  * called when a player enters a vehicle
569  * allows mutators to set special settings in this event
570  */
571 #define EV_VehicleEnter(i, o) \
572     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
573     /** vehicle */ i(entity, MUTATOR_ARGV_1_entity) \
574     /**/
575 MUTATOR_HOOKABLE(VehicleEnter, EV_VehicleEnter);
576
577 /**
578  * called when a player touches a vehicle
579  * return true to stop player from entering the vehicle
580  */
581 #define EV_VehicleTouch(i, o) \
582     /** vehicle */ i(entity, MUTATOR_ARGV_0_entity) \
583     /** player */ i(entity, MUTATOR_ARGV_1_entity) \
584     /**/
585 MUTATOR_HOOKABLE(VehicleTouch, EV_VehicleTouch);
586
587 /**
588  * called when a player exits a vehicle
589  * allows mutators to set special settings in this event
590  */
591 #define EV_VehicleExit(i, o) \
592     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
593     /** vehicle */ i(entity, MUTATOR_ARGV_1_entity) \
594     /**/
595 MUTATOR_HOOKABLE(VehicleExit, EV_VehicleExit);
596
597 /** called when a speedrun is aborted and the player is teleported back to start position */
598 #define EV_AbortSpeedrun(i, o) \
599     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
600     /**/
601 MUTATOR_HOOKABLE(AbortSpeedrun, EV_AbortSpeedrun);
602
603 /** called at when a item is touched. Called early, can edit item properties. */
604 #define EV_ItemTouch(i, o) \
605     /** item */    i(entity, MUTATOR_ARGV_0_entity) \
606     /** toucher */ i(entity, MUTATOR_ARGV_1_entity) \
607     /**/           o(entity, MUTATOR_ARGV_1_entity) \
608     /**/
609 MUTATOR_HOOKABLE(ItemTouch, EV_ItemTouch);
610
611 enum {
612         MUT_ITEMTOUCH_CONTINUE, // return this flag to make the function continue as normal
613         MUT_ITEMTOUCH_RETURN, // return this flag to make the function return (handled entirely by mutator)
614         MUT_ITEMTOUCH_PICKUP // return this flag to have the item "picked up" and taken even after mutator handled it
615 };
616
617 /** called at when a player connect */
618 #define EV_ClientConnect(i, o) \
619     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
620     /**/
621 MUTATOR_HOOKABLE(ClientConnect, EV_ClientConnect);
622
623 #define EV_HavocBot_ChooseRole(i, o) \
624     /** bot */ i(entity, MUTATOR_ARGV_0_entity) \
625     /**/
626 MUTATOR_HOOKABLE(HavocBot_ChooseRole, EV_HavocBot_ChooseRole);
627
628 /** called when a target is checked for accuracy */
629 #define EV_AccuracyTargetValid(i, o) \
630     /** attacker */ i(entity, MUTATOR_ARGV_0_entity) \
631     /** target */ i(entity, MUTATOR_ARGV_1_entity) \
632     /**/
633 MUTATOR_HOOKABLE(AccuracyTargetValid, EV_AccuracyTargetValid);
634 enum {
635         MUT_ACCADD_VALID, // return this flag to make the function continue if target is a client
636         MUT_ACCADD_INVALID, // return this flag to make the function always continue
637         MUT_ACCADD_INDIFFERENT // return this flag to make the function always return
638 };
639
640 /** Called when clearing the global parameters for a model */
641 MUTATOR_HOOKABLE(ClearModelParams, EV_NO_ARGS);
642
643 /** Called when getting the global parameters for a model */
644 #define EV_GetModelParams(i, o) \
645     /** input */   i(string, MUTATOR_ARGV_0_string) \
646     /** command */ i(string, MUTATOR_ARGV_1_string) \
647     /**/
648 MUTATOR_HOOKABLE(GetModelParams, EV_GetModelParams);
649
650 /** called when a bullet has hit a target */
651 #define EV_FireBullet_Hit(i, o) \
652     /** player */       i(entity, MUTATOR_ARGV_0_entity) \
653     /** targ */         i(entity, MUTATOR_ARGV_1_entity) \
654     /** start pos */    i(vector, MUTATOR_ARGV_2_vector) \
655     /** end pos */      i(vector, MUTATOR_ARGV_3_vector) \
656     /** damage */       i(float, MUTATOR_ARGV_4_float) \
657     /**/                o(float, MUTATOR_ARGV_4_float) \
658     /** wep entity */   i(entity, MUTATOR_ARGV_5_entity) \
659     /**/
660 MUTATOR_HOOKABLE(FireBullet_Hit, EV_FireBullet_Hit);
661
662 #define EV_FixPlayermodel(i, o) \
663     /** model */    i(string, MUTATOR_ARGV_0_string) \
664     /**/            o(string, MUTATOR_ARGV_0_string) \
665     /** skin */     i(int, MUTATOR_ARGV_1_int) \
666     /**/            o(int, MUTATOR_ARGV_1_int) \
667     /** player */   i(entity, MUTATOR_ARGV_2_entity) \
668     /**/
669 MUTATOR_HOOKABLE(FixPlayermodel, EV_FixPlayermodel);
670
671 /** Return error to play frag remaining announcements */
672 MUTATOR_HOOKABLE(Scores_CountFragsRemaining, EV_NO_ARGS);
673
674 #define EV_GrappleHookThink(i, o) \
675     /** hook */                i(entity, MUTATOR_ARGV_0_entity) \
676     /** tarzan */              i(int, MUTATOR_ARGV_1_int) \
677     /**/                       o(int, MUTATOR_ARGV_1_int) \
678     /** pulling entity */      i(entity, MUTATOR_ARGV_2_entity) \
679     /**/                       o(entity, MUTATOR_ARGV_2_entity) \
680     /** velocity multiplier */ i(float, MUTATOR_ARGV_3_float) \
681     /**/                       o(float, MUTATOR_ARGV_3_float) \
682     /**/
683 MUTATOR_HOOKABLE(GrappleHookThink, EV_GrappleHookThink);
684
685 #define EV_BuffModel_Customize(i, o) \
686     /** buff */    i(entity, MUTATOR_ARGV_0_entity) \
687     /** player */  i(entity, MUTATOR_ARGV_1_entity) \
688     /**/
689 MUTATOR_HOOKABLE(BuffModel_Customize, EV_BuffModel_Customize);
690
691 /** called at when a buff is touched. Called early, can edit buff properties. */
692 #define EV_BuffTouch(i, o) \
693     /** buff */    i(entity, MUTATOR_ARGV_0_entity) \
694     /** player */  i(entity, MUTATOR_ARGV_1_entity) \
695     /**/           o(entity, MUTATOR_ARGV_1_entity) \
696     /**/
697 MUTATOR_HOOKABLE(BuffTouch, EV_BuffTouch);
698
699 MUTATOR_HOOKABLE(SetNewParms, EV_NO_ARGS);
700
701 MUTATOR_HOOKABLE(SetChangeParms, EV_NO_ARGS);
702
703 MUTATOR_HOOKABLE(DecodeLevelParms, EV_NO_ARGS);
704
705 #define EV_GetRecords(i, o) \
706     /** page */           i(int, MUTATOR_ARGV_0_int) \
707     /** record list */    i(string, MUTATOR_ARGV_1_string) \
708     /**/                  o(string, MUTATOR_ARGV_1_string) \
709     /**/
710 MUTATOR_HOOKABLE(GetRecords, EV_GetRecords);
711
712 #define EV_Race_FinalCheckpoint(i, o) \
713     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
714     /**/
715 MUTATOR_HOOKABLE(Race_FinalCheckpoint, EV_Race_FinalCheckpoint);
716
717 /** called when player triggered kill (or is changing teams), return error to not do anything */
718 #define EV_ClientKill(i, o) \
719     /** player */        i(entity, MUTATOR_ARGV_0_entity) \
720     /** kill delay */    i(float, MUTATOR_ARGV_1_float) \
721     /**/                 o(float, MUTATOR_ARGV_1_float) \
722     /**/
723 MUTATOR_HOOKABLE(ClientKill, EV_ClientKill);
724
725 #define EV_FixClientCvars(i, o) \
726     /** player */        i(entity, MUTATOR_ARGV_0_entity) \
727     /**/
728 MUTATOR_HOOKABLE(FixClientCvars, EV_FixClientCvars);
729
730 #define EV_SpectateSet(i, o) \
731     /** client */    i(entity, MUTATOR_ARGV_0_entity) \
732     /** target */    i(entity, MUTATOR_ARGV_1_entity) \
733     /**/             o(entity, MUTATOR_ARGV_1_entity) \
734     /**/
735 MUTATOR_HOOKABLE(SpectateSet, EV_SpectateSet);
736
737 #define EV_SpectateNext(i, o) \
738     /** client */    i(entity, MUTATOR_ARGV_0_entity) \
739     /** target */    i(entity, MUTATOR_ARGV_1_entity) \
740     /**/             o(entity, MUTATOR_ARGV_1_entity) \
741     /**/
742 MUTATOR_HOOKABLE(SpectateNext, EV_SpectateNext);
743
744 #define EV_SpectatePrev(i, o) \
745     /** client */    i(entity, MUTATOR_ARGV_0_entity) \
746     /** target */    i(entity, MUTATOR_ARGV_1_entity) \
747     /**/             o(entity, MUTATOR_ARGV_1_entity) \
748         /** first */     i(entity, MUTATOR_ARGV_2_entity) \
749     /**/
750 MUTATOR_HOOKABLE(SpectatePrev, EV_SpectatePrev);
751
752 enum {
753     MUT_SPECPREV_CONTINUE, // return this flag to make the function continue as normal
754     MUT_SPECPREV_RETURN, // return this flag to make the function return (handled entirely by mutator)
755     MUT_SPECPREV_FOUND // return this flag to make the function continue without default functions (handled mostly by mutator)
756 };
757
758 /** called when player triggered kill (or is changing teams), return error to not do anything */
759 #define EV_Bot_FixCount(i, o) \
760         /** active real players */  i(int, MUTATOR_ARGV_0_int) \
761         /**/                                            o(int, MUTATOR_ARGV_0_int) \
762     /** real players */                 i(int, MUTATOR_ARGV_1_int) \
763     /**/                                        o(int, MUTATOR_ARGV_1_int) \
764     /**/
765 MUTATOR_HOOKABLE(Bot_FixCount, EV_Bot_FixCount);
766
767 #define EV_ClientCommand_Spectate(i, o) \
768     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
769     /**/
770 MUTATOR_HOOKABLE(ClientCommand_Spectate, EV_ClientCommand_Spectate);
771
772 enum {
773     MUT_SPECCMD_CONTINUE, // return this flag to make the function continue as normal
774     MUT_SPECCMD_RETURN, // return this flag to make the function return (don't spectate)
775     MUT_SPECCMD_FORCE // return this flag to force the player to spectate, even if they're not a player
776 };
777
778 #define EV_CheckRules_World(i, o) \
779     /** status */    i(float, MUTATOR_ARGV_0_float) \
780     /**/             o(float, MUTATOR_ARGV_0_float) \
781     /* time limit */ i(float, MUTATOR_ARGV_1_float) \
782     /* frag limit */ i(float, MUTATOR_ARGV_2_float) \
783     /**/
784 MUTATOR_HOOKABLE(CheckRules_World, EV_CheckRules_World);
785
786 #define EV_WantWeapon(i, o) \
787     /** weapon info entity */    i(entity, MUTATOR_ARGV_0_entity) \
788     /** do want? */              i(float, MUTATOR_ARGV_1_float) \
789     /**/                         o(float, MUTATOR_ARGV_1_float) \
790     /** want all guns */         i(bool, MUTATOR_ARGV_2_bool) \
791     /**/                         o(bool, MUTATOR_ARGV_2_bool) \
792     /** want mutator blocked */  i(bool, MUTATOR_ARGV_3_bool) \
793     /**/                         o(bool, MUTATOR_ARGV_3_bool) \
794     /**/
795 MUTATOR_HOOKABLE(WantWeapon, EV_WantWeapon);
796
797 #define EV_AddPlayerScore(i, o) \
798     /** score field */  i(PlayerScoreField, MUTATOR_ARGV_0_entity) \
799     /** score */        i(float, MUTATOR_ARGV_1_float) \
800     /**/                o(float, MUTATOR_ARGV_1_float) \
801     /** player */       i(entity, MUTATOR_ARGV_2_entity) \
802     /**/
803 MUTATOR_HOOKABLE(AddPlayerScore, EV_AddPlayerScore);
804
805 #define EV_GetPlayerStatus(i, o) \
806     /** player */    i(entity, MUTATOR_ARGV_0_entity) \
807     /**/
808 MUTATOR_HOOKABLE(GetPlayerStatus, EV_GetPlayerStatus);
809
810 #define EV_SetWeaponArena(i, o) \
811     /** arena */     i(string, MUTATOR_ARGV_0_string) \
812     /**/             o(string, MUTATOR_ARGV_0_string) \
813     /**/
814 MUTATOR_HOOKABLE(SetWeaponArena, EV_SetWeaponArena);
815
816 #define EV_DropSpecialItems(i, o) \
817     /** target */ i(entity, MUTATOR_ARGV_0_entity) \
818     /**/
819 MUTATOR_HOOKABLE(DropSpecialItems, EV_DropSpecialItems);
820
821 /**
822  * called when an admin tries to kill all monsters
823  * return 1 to prevent spawning
824  */
825 #define EV_AllowMobButcher(i, o) \
826     /** reason */ o(string, MUTATOR_ARGV_0_string) \
827     /**/
828 MUTATOR_HOOKABLE(AllowMobButcher, EV_AllowMobButcher);
829
830 MUTATOR_HOOKABLE(ReadLevelCvars, EV_NO_ARGS);
831
832 #define EV_SendWaypoint(i, o) \
833         /** waypoint */     i(entity, MUTATOR_ARGV_0_entity) \
834         /** to */               i(entity, MUTATOR_ARGV_1_entity) \
835         /** send flags */   i(int, MUTATOR_ARGV_2_int) \
836         /**/                            o(int, MUTATOR_ARGV_2_int) \
837         /** wp flag */      i(int, MUTATOR_ARGV_3_int) \
838         /**/                            o(int, MUTATOR_ARGV_3_int) \
839     /**/
840 MUTATOR_HOOKABLE(SendWaypoint, EV_SendWaypoint);
841
842 #define EV_TurretValidateTarget(i, o) \
843     /** turret */          i(entity, MUTATOR_ARGV_0_entity) \
844     /** target */          i(entity, MUTATOR_ARGV_1_entity) \
845     /** validate flags */  i(int, MUTATOR_ARGV_2_int) \
846     /** target score */    o(float, MUTATOR_ARGV_3_float) \
847     /**/
848 MUTATOR_HOOKABLE(TurretValidateTarget, EV_TurretValidateTarget);
849
850 #define EV_TurretThink(i, o) \
851     /** turret */ i(entity, MUTATOR_ARGV_0_entity) \
852     /**/
853 MUTATOR_HOOKABLE(TurretThink, EV_TurretThink);
854
855 MUTATOR_HOOKABLE(Ent_Init, EV_NO_ARGS);
856
857 /** */
858 #define EV_PrepareExplosionByDamage(i, o) \
859     /** projectile */ i(entity, MUTATOR_ARGV_0_entity) \
860     /** attacker */   i(entity, MUTATOR_ARGV_1_entity) \
861     /**/
862 MUTATOR_HOOKABLE(PrepareExplosionByDamage, EV_PrepareExplosionByDamage);
863
864 /** called when a monster model is about to be set, allows custom paths etc. */
865 #define EV_MonsterModel(i, o) \
866         /** model */  i(string, MUTATOR_ARGV_0_string) \
867         /** output */ i(string, MUTATOR_ARGV_1_string) \
868         /**/              o(string, MUTATOR_ARGV_1_string) \
869     /**/
870 MUTATOR_HOOKABLE(MonsterModel, EV_MonsterModel);
871
872 /**
873  * Called before player changes their team. Return true to block team change.
874  */
875 #define EV_Player_ChangeTeam(i, o) \
876     /** player */         i(entity, MUTATOR_ARGV_0_entity) \
877         /** current team */   i(float, MUTATOR_ARGV_1_float) \
878         /** new team */       i(float, MUTATOR_ARGV_2_float) \
879     /**/
880 MUTATOR_HOOKABLE(Player_ChangeTeam, EV_Player_ChangeTeam);
881
882 /**
883  * Called after player has changed their team.
884  */
885 #define EV_Player_ChangedTeam(i, o) \
886     /** player */         i(entity, MUTATOR_ARGV_0_entity) \
887         /** old team */   i(float, MUTATOR_ARGV_1_float) \
888         /** current team */       i(float, MUTATOR_ARGV_2_float) \
889     /**/
890 MUTATOR_HOOKABLE(Player_ChangedTeam, EV_Player_ChangedTeam);
891
892 /**/
893 #define EV_URI_GetCallback(i, o) \
894         /** id */       i(float, MUTATOR_ARGV_0_float) \
895         /** status */   i(float, MUTATOR_ARGV_1_float) \
896         /** data */     i(string, MUTATOR_ARGV_2_string) \
897     /**/
898 MUTATOR_HOOKABLE(URI_GetCallback, EV_URI_GetCallback);
899
900 /**
901  * return true to prevent weapon use for a player
902  */
903  #define EV_ForbidWeaponUse(i, o) \
904     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
905     /**/
906 MUTATOR_HOOKABLE(ForbidWeaponUse, EV_ForbidWeaponUse);
907
908 /** called when creating a clone of the player (usually for corpses that stay after the player has re-spawned) */
909 #define EV_CopyBody(i, o) \
910     /** player */               i(entity, MUTATOR_ARGV_0_entity) \
911     /** newly created clone */  i(entity, MUTATOR_ARGV_1_entity) \
912     /** keepvelocity? */        i(bool, MUTATOR_ARGV_2_bool) \
913     /**/
914 MUTATOR_HOOKABLE(CopyBody, EV_CopyBody);
915
916 /** called when sending a chat message, ret argument can be changed to prevent the message */
917 #define EV_ChatMessage(i, o) \
918     /** sender */ i(entity, MUTATOR_ARGV_0_entity) \
919     /** ret */ i(int, MUTATOR_ARGV_1_int) \
920     /**/ o(int, MUTATOR_ARGV_1_int) \
921     /**/
922 MUTATOR_HOOKABLE(ChatMessage, EV_ChatMessage);
923
924 /** return true to prevent sending a chat (private, team or regular) message from reaching a certain player */
925 #define EV_ChatMessageTo(i, o) \
926     /** destination player */ i(entity, MUTATOR_ARGV_0_entity) \
927     /** sender */ i(entity, MUTATOR_ARGV_1_entity) \
928     /**/
929 MUTATOR_HOOKABLE(ChatMessageTo, EV_ChatMessageTo);
930
931 /** return true to just restart the match, for modes that don't support readyrestart */
932 MUTATOR_HOOKABLE(ReadyRestart_Deny, EV_NO_ARGS);
933
934 /** called when a fusion reactor is validating its target */
935 #define EV_FusionReactor_ValidTarget(i, o) \
936     /** turret */    i(entity, MUTATOR_ARGV_0_entity) \
937     /** target */    i(entity, MUTATOR_ARGV_1_entity) \
938     /**/
939 MUTATOR_HOOKABLE(FusionReactor_ValidTarget, EV_FusionReactor_ValidTarget);
940
941 enum {
942     MUT_FUSREAC_TARG_CONTINUE, // return this flag to make the function continue as normal
943     MUT_FUSREAC_TARG_VALID, // return this flag to make the function return true (valid target)
944     MUT_FUSREAC_TARG_INVALID // return this flag to make the function return false (invalid target)
945 };
946
947 /** return true to hide the 'teamnumbers are imbalanced' message */
948 #define EV_HideTeamNagger(i, o) \
949     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
950     /**/
951 MUTATOR_HOOKABLE(HideTeamNagger, EV_HideTeamNagger);
952
953 /** return true to show a waypoint while the item is spawning */
954 #define EV_Item_ScheduleRespawn(i, o) \
955     /** item */             i(entity, MUTATOR_ARGV_0_entity) \
956     /** respawn time */     i(float, MUTATOR_ARGV_1_float) \
957     /**/
958 MUTATOR_HOOKABLE(Item_ScheduleRespawn, EV_Item_ScheduleRespawn);
959
960 /** called before physics stats are set on a player, allows limited early customization */
961 #define EV_PlayerPhysics_UpdateStats(i, o) \
962     /** player */             i(entity, MUTATOR_ARGV_0_entity) \
963     /**/
964 MUTATOR_HOOKABLE(PlayerPhysics_UpdateStats, EV_PlayerPhysics_UpdateStats);
965
966 /** return true to use your own aim target (or none at all) */
967 #define EV_HavocBot_Aim(i, o) \
968     /** bot */ i(entity, MUTATOR_ARGV_0_entity) \
969     /**/
970 MUTATOR_HOOKABLE(HavocBot_Aim, EV_HavocBot_Aim);