Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
events.qh
Go to the documentation of this file.
1#pragma once
2
4
5// Register all possible hooks here
6
7// To use a hook, first register your mutator using REGISTER_MUTATOR,
8// then create your function using MUTATOR_HOOKFUNCTION
9
11#define params(i, o) \
12 i(entity, 0) /* player */ \
13 i(bool, 1) /* is_forced */ \
14 /**/
15MUTATOR_HOOKABLE(MakePlayerObserver, params);
16#undef params
17
18#define params(i, o) \
19 i(entity, 0) /* client wanting to spawn */ \
20 /**/
22#undef params
23
25#define params(i, o) \
26 i(entity, 0) /* player */ \
27 /**/
29#undef params
30
32#define params(i, o) \
33 i(entity, 0) /* player */ \
34 /**/
35MUTATOR_HOOKABLE(AutoJoinOnConnection, params);
36#undef params
37
39#define params(i, o) \
40 i(entity, 0) /* player */ \
41 /**/
42MUTATOR_HOOKABLE(ForbidRandomStartWeapons, params);
43#undef params
44
46#define params(i, o) \
47 i(entity, 0) /* player spawning */ \
48 i(entity, 1) /* spot that was used, or NULL */ \
49 /**/
51#undef params
52
54#define params(i, o) \
55 i(entity, 0) /* player spawning */ \
56 /**/
57MUTATOR_HOOKABLE(PlayerWeaponSelect, params);
58#undef params
59
61#define params(i, o) \
62 i(entity, 0) /* player */ \
63 i(int, 1) /* anim bits */ \
64 o(int, 1) \
65 /**/
67#undef params
68
70MUTATOR_HOOKABLE(reset_map_global, EV_NO_ARGS);
71
73MUTATOR_HOOKABLE(reset_map_players, EV_NO_ARGS);
74
76MUTATOR_HOOKABLE(PreferPlayerScore_Clear, EV_NO_ARGS);
77
79#define params(i, o) \
80 i(entity, 0) /* player */ \
81 /**/
83#undef params
84
86#define params(i, o) \
87 i(entity, 0) /* inflictor */ \
88 i(entity, 1) /* attacker */ \
89 i(entity, 2) /* target */ \
90 i(float, 3) /* deathtype */ \
91 i(float, 4) /* damage */ \
92 o(float, 4) /* damage */ \
93 /**/
95#undef params
96
98#define params(i, o) \
99 i(entity, 0) /* player */ \
100 /**/
102#undef params
103
105#define params(i, o) \
106 i(entity, 0) /* inflictor */ \
107 i(entity, 1) /* attacker */ \
108 i(entity, 2) /* target */ \
109 i(float, 3) /* deathtype */ \
110 i(entity, 4) /* wep entity */ \
111 o(bool, 5) /* anonymous killer */ \
112 /**/
113MUTATOR_HOOKABLE(ClientObituary, params);
114#undef params
115
117#define params(i, o) \
118 i(entity, 0) /* attacker */ \
119 i(entity, 1) /* target */ \
120 i(float, 2) /* deathtype */ \
121 i(int, 3) /* attacker kcount */ \
122 i(int, 4) /* targ killcount */ \
123 /**/
124MUTATOR_HOOKABLE(FragCenterMessage, params);
125#undef params
126
128#define params(i, o) \
129 i(entity, 0) /* victim */ \
130 i(entity, 1) /* attacker */ \
131 /**/
133#undef params
134
136#define params(i, o) \
137 i(string, 0) /* model */ \
138 i(string, 1) /* output */ \
139 o(string, 1) \
140 /**/
142#undef params
143
145#define params(i, o) \
146 i(string, 0) /* sound */ \
147 i(string, 1) /* output */ \
148 o(string, 1) \
149 /**/
151#undef params
152
154#define params(i, o) \
155 i(entity, 0) /* attacker */ \
156 i(entity, 1) /* target */ \
157 i(float, 2) /* frag score */ \
158 o(float, 2) \
159 i(float, 3) /* deathtype */ \
160 i(entity, 4) /* wep entity */ \
161 /**/
162MUTATOR_HOOKABLE(GiveFragsForKill, params);
163#undef params
164
166MUTATOR_HOOKABLE(MatchEnd_BeforeScores, EV_NO_ARGS);
167
170
173
178#define params(i, o) \
179 i(float, 0) /* mask of teams */ \
180 o(float, 0) \
181 i(string, 1) /* team entity name */ \
182 o(string, 1) \
183 i(entity, 2) /* player checked */ \
184 /**/
186#undef params
187
190
192#define params(i, o) \
193 i(float, 0) /* team index to count */ \
194 i(entity, 1) /* player to ignore */ \
195 o(float, 2) /* number of players in a team */ \
196 o(float, 3) /* number of bots in a team */ \
197 /**/
198MUTATOR_HOOKABLE(TeamBalance_GetTeamCount, params);
199#undef params
200
202#define params(i, o) \
203 i(entity, 0) /* player checked */ \
204 o(float, 1) /* bitmask of teams */ \
205 /**/
207#undef params
208
210#define params(i, o) \
211 i(int, 0) /* source team index */ \
212 i(int, 1) /* destination team index */ \
213 i(bool, 2) /* is looking for bot */ \
214 o(entity, 3) /* player to switch */ \
215 /**/
217#undef params
218
220#define params(i, o) \
221 i(entity, 0) /* spectatee */ \
222 i(entity, 1) /* client */ \
223 /**/
225#undef params
226
228#define params(i, o) \
229 i(entity, 0) /* player */ \
230 i(string, 1) /* escape */ \
231 i(string, 2) /* replacement */ \
232 o(string, 2) \
233 i(string, 3) /* message */ \
234 /**/
235MUTATOR_HOOKABLE(FormatMessage, params);
236#undef params
237
239#define params(i, o) \
240 i(entity, 0) /* player */ \
241 i(string, 1) /* message */ \
242 o(string, 1) \
243 /**/
244MUTATOR_HOOKABLE(PreFormatMessage, params);
245#undef params
246
248#define params(i, o) \
249 i(entity, 0) /* player */ \
250 i(entity, 1) /* weapon entity */ \
251 /**/
252MUTATOR_HOOKABLE(ForbidThrowCurrentWeapon, params);
253#undef params
254
256#define params(i, o) \
257 i(entity, 0) /* player */ \
258 i(int, 1) /* weapon id */ \
259 /**/
260MUTATOR_HOOKABLE(ForbidDropCurrentWeapon, params);
261#undef params
262
264
266#define params(i, o) \
267 i(float, 0) /* weapon rate */ \
268 o(float, 0) \
269 i(entity, 1) /* player */ \
270 /**/
271MUTATOR_HOOKABLE(WeaponRateFactor, params);
272#undef params
273
275#define params(i, o) \
276 i(float, 0) /* weapon speed */ \
277 o(float, 0) \
278 i(entity, 1) /* player */ \
279 /**/
280MUTATOR_HOOKABLE(WeaponSpeedFactor, params);
281#undef params
282
285
287#define params(i, o) \
288 i(entity, 0) /* waypoint */ \
289 i(entity, 1) /* player; other.enemy = spectator */ \
290 /**/
291MUTATOR_HOOKABLE(CustomizeWaypoint, params);
292#undef params
293
297#define params(i, o) \
298 i(entity, 0) /* item */ \
299 /**/
300MUTATOR_HOOKABLE(FilterItemDefinition, params);
301#undef params
302
306#define params(i, o) \
307 i(entity, 0) /* item */ \
308 /**/
310#undef params
311
313#define params(i, o) \
314 i(entity, 0) /* turret */ \
315 /**/
317#undef params
318
320#define params(i, o) \
321 i(entity, 0) /* turret */ \
322 /**/
324#undef params
325
327#define params(i, o) \
328 i(entity, 0) /* turret */ \
329 o(bool, 1) /* to fire or not to fire */ \
330 /**/
331MUTATOR_HOOKABLE(Turret_CheckFire, params);
332#undef params
333
335#define params(i, o) \
336 i(entity, 0) /* turret */ \
337 i(bool, 1) /* dual */ \
338 /**/
339MUTATOR_HOOKABLE(Turret_Plasma_Fire, params);
340#undef params
341
343#define params(i, o) \
344 i(entity, 0) /* entity */ \
345 /**/
346MUTATOR_HOOKABLE(OnEntityPreSpawn, params);
347#undef params
348
350#define params(i, o) \
351 i(entity, 0) /* player */ \
352 /**/
354#undef params
355
356// TODO: change this into a general PlayerPostThink hook?
357#define params(i, o) \
358 i(entity, 0) /* player */ \
359 /**/
361#undef params
362
374#define params(i, o) \
375 /**/ i(float, get_cvars_f) \
376 /**/ i(string, get_cvars_s) \
377 /**/
380MUTATOR_HOOKABLE(GetCvars, EV_NO_ARGS); // NOTE: Can't use EV_GetCvars because of `SZ_GetSpace: overflow`
381#undef params
382
384#define params(i, o) \
385 i(entity, 0) /* projectile owner */ \
386 i(entity, 1) /* projectile */ \
387 /**/
388MUTATOR_HOOKABLE(EditProjectile, params);
389#undef params
390
392#define params(i, o) \
393 i(entity, 0) /* monster */ \
394 /**/
396#undef params
397
399#define params(i, o) \
400 i(entity, 0) /* target */ \
401 i(entity, 1) /* attacker */ \
402 i(float, 2) /* deathtype */ \
403 /**/
405#undef params
406
408#define params(i, o) \
409 i(entity, 0) /* monster */ \
410 /**/
411MUTATOR_HOOKABLE(MonsterRemove, params);
412#undef params
413
415#define params(i, o) \
416 i(entity, 0) /* monster */ \
417 /**/
418MUTATOR_HOOKABLE(MonsterRespawn, params);
419#undef params
420
422#define params(i, o) \
423 i(entity, 0) /* monster */ \
424 i(string, 1) /* list of items to drop */ \
425 o(string, 1) \
426 i(entity, 2) /* attacker */ \
427 /**/
429MUTATOR_HOOKABLE(MonsterDropItem, params);
430#undef params
431
435#define params(i, o) \
436 i(entity, 0) /* monster */ \
437 i(float, 1) /* run speed */ \
438 o(float, 1) \
439 i(float, 2) /* walk speed */ \
440 o(float, 2) \
441 i(entity, 3) /* move target */ \
442 o(entity, 3) \
443 /**/
445#undef params
446
448MUTATOR_HOOKABLE(MonsterFindTarget, EV_NO_ARGS);
449
451#define params(i, o) \
452 i(entity, 0) /* monster */ \
453 i(entity, 1) /* target */ \
454 /**/
455MUTATOR_HOOKABLE(MonsterValidTarget, params);
456#undef params
457
461#define params(i, o) \
462 i(entity, 0) /* monster */ \
463 /**/
464MUTATOR_HOOKABLE(MonsterCheckBossFlag, params);
465#undef params
466
471#define params(i, o) \
472 i(entity, 0) /* caller */ \
473 o(string, 1) /* reason */ \
474 /**/
475MUTATOR_HOOKABLE(AllowMobSpawning, params);
476#undef params
477
479#define params(i, o) \
480 i(entity, 0) /* inflictor */ \
481 i(entity, 1) /* attacker */ \
482 i(entity, 2) /* target */ \
483 i(vector, 3) /* force (no out) */ \
484 i(float, 4) /* damage take */ \
485 o(float, 4) /* damage take */ \
486 i(float, 5) /* damage save */ \
487 o(float, 5) /* damage save */ \
488 i(float, 6) /* deathtype */ \
489 i(float, 7) /* damage */ \
490 /**/
491MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor, params);
492#undef params
493
498#define params(i, o) \
499 i(entity, 0) /* inflictor */ \
500 i(entity, 1) /* attacker */ \
501 i(entity, 2) /* target */ \
502 i(float, 3) /* deathtype */ \
503 i(float, 4) /* damage */ \
504 o(float, 4) /* damage */ \
505 i(float, 5) /* mirrordamage */ \
506 o(float, 5) /* mirrordamage */ \
507 i(vector, 6) /* force */ \
508 o(vector, 6) /* force */ \
509 i(entity, 7) /* weapon entity */ \
510 /**/
511MUTATOR_HOOKABLE(Damage_Calculate, params);
512#undef params
513
517#define params(i, o) \
518 i(entity, 0) /* attacker */ \
519 i(entity, 1) /* target */ \
520 i(float, 2) /* health */ \
521 i(float, 3) /* armor */ \
522 i(vector, 4) /* location */ \
523 i(int, 5) /* deathtype */ \
524 i(float, 6) /* potential_damage */ \
525 /**/
526MUTATOR_HOOKABLE(PlayerDamaged, params);
527#undef params
528
530#define params(i, o) \
531 i(entity, 0) /* actor */ \
532 i(entity, 1) /* weapon entity */ \
533 i(float, 2) /* ammo to take */ \
534 o(float, 2) \
535 /**/
537#undef params
538
540#define params(i, o) \
541 i(entity, 0) /* actor */ \
542 /**/
544#undef params
545
547#define params(i, o) \
548 i(entity, 0) /* player */ \
549 i(int, 1) /* old items */ \
550 /**/
551MUTATOR_HOOKABLE(PlayerPowerups, params);
552#undef params
553
555#define params(i, o) \
556 i(entity, 0) /* player */ \
557 /**/
558MUTATOR_HOOKABLE(SuperweaponsImmutable, params);
559#undef params
560
564#define params(i, o) \
565 i(entity, 0) /* player */ \
566 i(float, 1) /* max_mod */ \
567 o(float, 1) \
568 i(float, 2) /* regen_mod */ \
569 o(float, 2) \
570 i(float, 3) /* rot_mod */ \
571 o(float, 3) \
572 i(float, 4) /* limit_mod */ \
573 o(float, 4) \
574 i(float, 5) /* health_regen */ \
575 o(float, 5) \
576 i(float, 6) /* health_regenlinear */ \
577 o(float, 6) \
578 i(float, 7) /* health_rot */ \
579 o(float, 7) \
580 i(float, 8) /* health_rotlinear */ \
581 o(float, 8) \
582 i(float, 9) /* health_stable */ \
583 o(float, 9) \
584 i(float, 10) /* health_rotstable */ \
585 o(float, 10) \
586 /**/
588#undef params
589
594#define params(i, o) \
595 i(entity, 0) /* player */ \
596 /**/
598#undef params
599
601#define params(i, o) \
602 i(entity, 0) /* player */ \
603 /**/
604MUTATOR_HOOKABLE(PlayerIsInvisible, params);
605#undef params
606
634#define params(i, o) \
635 i(entity, 0) /* client sending the command */ \
636 i(string, 1) /* command name */ \
637 i(int, 2) /* argc (also, argv() can be used) */ \
638 i(string, 3) /* whole command, use only if you really have to */ \
639 /**/
641#undef params
642
646#define params(i, o) \
647 i(entity, 0) /* client sending the command */ \
648 i(string, 1) /* command name */ \
649 i(int, 2) /* argc (also, argv() can be used) */ \
650 i(string, 3) /* whole command, use only if you really have to */ \
651 /**/
652MUTATOR_HOOKABLE(ClientCommand_FloodControl, params);
653#undef params
654
656#define params(i, o) \
657 i(string, 0) /* command name */ \
658 i(int, 1) /* argc (also, argv() can be used) */ \
659 i(string, 2) /* whole command, use only if you really have to */ \
660 /**/
661MUTATOR_HOOKABLE(SV_ParseServerCommand, params);
662#undef params
663
667#define params(i, o) \
668 i(entity, 0) /* player wanting to spawn */ \
669 i(entity, 1) /* spot to be evaluated */ \
670 i(vector, 2) /* spot score, _x is priority, _y is "distance" */ \
671 o(vector, 2) \
672 /**/
674#undef params
675
678
679#define params(i, o) \
680 \
681 i(string, 0) \
682 o(string, 0) \
683 /**/
685#undef params
686
688#define params(i, o) \
689 i(entity, 0) /* item */ \
690 /**/
692#undef params
693
694#define params(i, o) \
695 i(entity, 0) /* map entity */ \
696 i(entity, 1) /* weapon info */ \
697 i(string, 2) /* replacement */ \
698 o(string, 2) \
699 /**/
700MUTATOR_HOOKABLE(SetWeaponreplace, params);
701#undef params
702
704#define params(i, o) \
705 i(entity, 0) /* item */ \
706 /**/
708#undef params
709
713#define params(i, o) \
714 i(entity, 0) /* bot */ \
715 i(entity, 1) /* target */ \
716 /**/
717MUTATOR_HOOKABLE(Bot_ForbidAttack, params);
718#undef params
719
723#define params(i, o) \
724 i(entity, 0) /* player */ \
725 /**/
726MUTATOR_HOOKABLE(PortalTeleport, params);
727#undef params
728
735#define params(i, o) \
736 i(entity, 0) /* the player who pressed impulse 33 */ \
737 /**/
739#undef params
740
744#define params(i, o) \
745 i(entity, 0) /* vehicle */ \
746 /**/
748#undef params
749
753#define params(i, o) \
754 i(entity, 0) /* player */ \
755 i(entity, 1) /* vehicle */ \
756 /**/
758#undef params
759
763#define params(i, o) \
764 i(entity, 0) /* vehicle */ \
765 i(entity, 1) /* player */ \
766 /**/
768#undef params
769
773#define params(i, o) \
774 i(entity, 0) /* player */ \
775 i(entity, 1) /* vehicle */ \
776 /**/
778#undef params
779
781#define params(i, o) \
782 i(entity, 0) /* player */ \
783 /**/
784MUTATOR_HOOKABLE(AbortSpeedrun, params);
785#undef params
786
788#define params(i, o) \
789 i(entity, 0) /* item */ \
790 i(entity, 1) /* toucher */ \
791 o(entity, 1) \
792 /**/
794#undef params
795
796enum
797{
798 MUT_ITEMTOUCH_CONTINUE, // return this flag to make the function continue as normal
799 MUT_ITEMTOUCH_RETURN, // return this flag to make the function return (handled entirely by mutator)
800 MUT_ITEMTOUCH_PICKUP // return this flag to have the item "picked up" and taken even after mutator handled it
801};
802
804#define params(i, o) \
805 i(entity, 0) /* item */ \
806 i(entity, 1) /* toucher */ \
807 /**/
809#undef params
810
811// The Resource hooks are often called by other hooks and to avoid conflicts
812// as much as possible their args start from ARGV_7
813
815#define params(i, o) \
816 i(entity, 7) /* checked entity */ \
817 i(entity, 8) /* resource type */ \
818 i(float, 9) /* limit */ \
819 o(float, 9) \
820 /**/
822#undef params
823
828#define params(i, o) \
829 i(entity, 7) /* checked entity */ \
830 i(entity, 8) /* resource type */ \
831 o(entity, 8) \
832 i(float, 9) /* amount */ \
833 o(float, 9) \
834 /**/
836#undef params
837
842#define params(i, o) \
843 i(entity, 7) /* checked entity */ \
844 i(entity, 8) /* resource type */ \
845 i(float, 9) /* amount */ \
846 /**/
847MUTATOR_HOOKABLE(ResourceAmountChanged, params);
848#undef params
849
854#define params(i, o) \
855 i(entity, 7) /* checked entity */ \
856 i(entity, 8) /* resource type */ \
857 i(float, 9) /* amount wasted */ \
858 /**/
859MUTATOR_HOOKABLE(ResourceWasted, params);
860#undef params
861
867#define params(i, o) \
868 i(entity, 7) /* receiver */ \
869 i(entity, 8) /* resource type */ \
870 o(entity, 8) \
871 i(float, 9) /* amount */ \
872 o(float, 9) \
873 /**/
875#undef params
876
881#define params(i, o) \
882 i(entity, 7) /* receiver */ \
883 i(entity, 8) /* resource type */ \
884 o(entity, 8) \
885 i(float, 9) /* amount */ \
886 o(float, 9) \
887 i(float, 10) /* limit */ \
888 o(float, 10) \
889 /**/
891#undef params
892
898#define params(i, o) \
899 i(entity, 7) /* receiver */ \
900 i(entity, 8) /* resource type */ \
901 o(entity, 8) \
902 i(float, 9) /* amount */ \
903 o(float, 9) \
904 /**/
906#undef params
907
912#define params(i, o) \
913 i(entity, 7) /* receiver */ \
914 i(entity, 8) /* resource type */ \
915 o(entity, 8) \
916 i(float, 9) /* amount */ \
917 o(float, 9) \
918 i(float, 10) /* limit */ \
919 o(float, 10) \
920 /**/
922#undef params
923
924// END Resource hooks
925
927#define params(i, o) \
928 i(entity, 0) /* player */ \
929 /**/
931#undef params
932
933#define params(i, o) \
934 i(entity, 0) /* bot */ \
935 /**/
936MUTATOR_HOOKABLE(HavocBot_ChooseRole, params);
937#undef params
938
940#define params(i, o) \
941 i(entity, 0) /* attacker */ \
942 i(entity, 1) /* target */ \
943 /**/
944MUTATOR_HOOKABLE(AccuracyTargetValid, params);
945#undef params
946
947enum
948{
949 MUT_ACCADD_VALID, // return this flag to make the function continue if target is a client
950 MUT_ACCADD_INVALID, // return this flag to make the function always continue
951 MUT_ACCADD_INDIFFERENT // return this flag to make the function always return
952};
953
955MUTATOR_HOOKABLE(ClearModelParams, EV_NO_ARGS);
956
958#define params(i, o) \
959 i(string, 0) /* input */ \
960 i(string, 1) /* command */ \
961 /**/
962MUTATOR_HOOKABLE(GetModelParams, params);
963#undef params
964
966#define params(i, o) \
967 i(entity, 0) /* player */ \
968 i(entity, 1) /* targ */ \
969 i(vector, 2) /* start pos */ \
970 i(vector, 3) /* end pos */ \
971 i(float, 4) /* damage */ \
972 o(float, 4) \
973 i(entity, 5) /* wep entity */ \
974 /**/
975MUTATOR_HOOKABLE(FireBullet_Hit, params);
976#undef params
977
978#define params(i, o) \
979 i(string, 0) /* model */ \
980 o(string, 0) \
981 i(int, 1) /* skin */ \
982 o(int, 1) \
983 i(entity, 2) /* player */ \
984 /**/
986#undef params
987
989MUTATOR_HOOKABLE(Scores_CountFragsRemaining, EV_NO_ARGS);
990
991#define params(i, o) \
992 i(entity, 0) /* hook */ \
993 i(int, 1) /* tarzan */ \
994 o(int, 1) \
995 i(entity, 2) /* pulling entity */ \
996 o(entity, 2) \
997 i(float, 3) /* velocity multiplier */ \
998 o(float, 3) \
999 /**/
1000MUTATOR_HOOKABLE(GrappleHookThink, params);
1001#undef params
1002
1003#define params(i, o) \
1004 i(entity, 0) /* buff */ \
1005 i(entity, 1) /* player */ \
1006 /**/
1007MUTATOR_HOOKABLE(BuffModel_Customize, params);
1008#undef params
1009
1011#define params(i, o) \
1012 i(entity, 0) /* buff */ \
1013 i(entity, 1) /* player */ \
1014 o(entity, 1) \
1015 /**/
1017#undef params
1018
1020
1022
1024
1025#define params(i, o) \
1026 i(int, 0) /* page */ \
1027 i(string, 1) /* record list */ \
1028 o(string, 1) \
1029 /**/
1031#undef params
1032
1033#define params(i, o) \
1034 i(entity, 0) /* player */ \
1035 /**/
1036MUTATOR_HOOKABLE(Race_FinalCheckpoint, params);
1037#undef params
1038
1040#define params(i, o) \
1041 i(entity, 0) /* player */ \
1042 i(float, 1) /* kill delay */ \
1043 o(float, 1) \
1044 /**/
1046#undef params
1047
1048#define params(i, o) \
1049 i(entity, 0) /* player */ \
1050 /**/
1052#undef params
1053
1054#define params(i, o) \
1055 i(entity, 0) /* client */ \
1056 i(entity, 1) /* target */ \
1057 o(entity, 1) \
1058 /**/
1060#undef params
1061
1062#define params(i, o) \
1063 i(entity, 0) /* client */ \
1064 i(entity, 1) /* target */ \
1065 o(entity, 1) \
1066 /**/
1068#undef params
1069
1070#define params(i, o) \
1071 i(entity, 0) /* client */ \
1072 i(entity, 1) /* target */ \
1073 o(entity, 1) \
1074 i(entity, 2) /* first */ \
1075 /**/
1077#undef params
1078
1079enum
1080{
1081 MUT_SPECPREV_CONTINUE, // return this flag to make the function continue as normal
1082 MUT_SPECPREV_RETURN, // return this flag to make the function return (handled entirely by mutator)
1083 MUT_SPECPREV_FOUND // return this flag to make the function continue without default functions (handled mostly by mutator)
1084};
1085
1087#define params(i, o) \
1088 i(int, 0) /* active real players */ \
1089 o(int, 0) \
1090 i(int, 1) /* real players */ \
1091 o(int, 1) \
1092 /**/
1094#undef params
1095
1096#define params(i, o) \
1097 i(entity, 0) /* player */ \
1098 /**/
1099MUTATOR_HOOKABLE(ClientCommand_Spectate, params);
1100#undef params
1101
1102enum
1103{
1104 MUT_SPECCMD_CONTINUE, // return this flag to make the function continue as normal
1105 MUT_SPECCMD_RETURN, // return this flag to make the function return (don't spectate)
1106 MUT_SPECCMD_FORCE // return this flag to force the player to spectate, even if they're not a player
1107};
1108
1109#define params(i, o) \
1110 i(float, 0) /* status */ \
1111 o(float, 0) \
1112 i(float, 1) /* time limit */ \
1113 i(float, 2) /* frag limit */ \
1114 /**/
1116#undef params
1117
1118#define params(i, o) \
1119 i(entity, 0) /* weapon info entity */ \
1120 i(float, 1) /* do want? */ \
1121 o(float, 1) \
1122 i(int, 2) /* want all guns */ \
1123 o(int, 2) \
1124 i(bool, 3) /* want mutator blocked */ \
1125 o(bool, 3) \
1126 /**/
1128#undef params
1129
1130#define params(i, o) \
1131 i(entity, 0) /* score field */ \
1132 i(float, 1) /* score */ \
1133 o(float, 1) \
1134 i(entity, 2) /* player */ \
1135 /**/
1136MUTATOR_HOOKABLE(AddPlayerScore, params);
1137#undef params
1138
1139#define params(i, o) \
1140 i(entity, 0) /* score field */ \
1141 i(float, 1) /* score */ \
1142 i(entity, 2) /* player */ \
1143 /**/
1144MUTATOR_HOOKABLE(AddedPlayerScore, params);
1145#undef params
1146
1147#define params(i, o) \
1148 i(entity, 0) /* player */ \
1149 /**/
1150MUTATOR_HOOKABLE(GetPlayerStatus, params);
1151#undef params
1152
1153#define params(i, o) \
1154 i(string, 0) /* arena */ \
1155 o(string, 0) \
1156 /**/
1157MUTATOR_HOOKABLE(SetWeaponArena, params);
1158#undef params
1159
1160#define params(i, o) \
1161 i(int, 0) /* weapon_stay */ \
1162 o(int, 0) \
1163 /**/
1164MUTATOR_HOOKABLE(SetWeaponStay, params);
1165#undef params
1166
1167#define params(i, o) \
1168 i(entity, 0) /* target */ \
1169 /**/
1170MUTATOR_HOOKABLE(DropSpecialItems, params);
1171#undef params
1172
1176#define params(i, o) \
1177 o(string, 0) /* reason */ \
1178 /**/
1179MUTATOR_HOOKABLE(AllowMobButcher, params);
1180#undef params
1181
1183
1184#define params(i, o) \
1185 i(entity, 0) /* waypoint */ \
1186 i(entity, 1) /* to */ \
1187 i(int, 2) /* send flags */ \
1188 o(int, 2) \
1189 i(int, 3) /* wp flag */ \
1190 o(int, 3) \
1191 /**/
1193#undef params
1194
1195#define params(i, o) \
1196 i(entity, 0) /* turret */ \
1197 i(entity, 1) /* target */ \
1198 i(int, 2) /* validate flags */ \
1199 o(float, 3) /* target score */ \
1200 /**/
1201MUTATOR_HOOKABLE(TurretValidateTarget, params);
1202#undef params
1203
1204#define params(i, o) \
1205 i(entity, 0) /* turret */ \
1206 /**/
1208#undef params
1209
1211
1212#define params(i, o) \
1213 i(entity, 0) /* projectile */ \
1214 i(entity, 1) /* attacker */ \
1215 /**/
1216MUTATOR_HOOKABLE(PrepareExplosionByDamage, params);
1217#undef params
1218
1220#define params(i, o) \
1221 i(string, 0) /* model */ \
1222 i(string, 1) /* output */ \
1223 o(string, 1) \
1224 /**/
1226#undef params
1227
1229#define params(i, o) \
1230 i(entity, 0) /* player */ \
1231 i(float, 1) /* current team index */ \
1232 i(float, 2) /* new team index */ \
1233 /**/
1234MUTATOR_HOOKABLE(Player_ChangeTeam, params);
1235#undef params
1236
1238#define params(i, o) \
1239 i(entity, 0) /* player */ \
1240 i(float, 1) /* old team index */ \
1241 i(float, 2) /* current team index */ \
1242 /**/
1243MUTATOR_HOOKABLE(Player_ChangedTeam, params);
1244#undef params
1245
1246#define params(i, o) \
1247 i(float, 0) /* id */ \
1248 i(float, 1) /* status */ \
1249 i(string, 2) /* data */ \
1250 /**/
1251MUTATOR_HOOKABLE(URI_GetCallback, params);
1252#undef params
1253
1255#define params(i, o) \
1256 i(entity, 0) /* player */ \
1257 /**/
1259#undef paramsv
1260
1262#define params(i, o) \
1263 i(entity, 0) /* player */ \
1264 /**/
1265MUTATOR_HOOKABLE(ForbidWeaponUse, params);
1266#undef params
1267
1269#define params(i, o) \
1270 i(entity, 0) /* player */ \
1271 i(entity, 1) /* newly created clone */ \
1272 i(bool, 2) /* keepvelocity? */ \
1273 /**/
1275#undef params
1276
1278#define params(i, o) \
1279 i(entity, 0) /* sender */ \
1280 i(int, 1) /* ret */ \
1281 o(int, 1) \
1282 i(string, 2) /* message */ \
1283 i(entity, 3) /* private msg target */ \
1284 i(int, 4) /* teamsay */ \
1285 /**/
1287#undef params
1288
1290#define params(i, o) \
1291 i(entity, 0) /* destination player */ \
1292 i(entity, 1) /* sender */ \
1293 /**/
1294MUTATOR_HOOKABLE(ChatMessageTo, params);
1295#undef params
1296
1300MUTATOR_HOOKABLE(ReadyRestart_Deny, EV_NO_ARGS);
1301
1303#define params(i, o) \
1304 i(entity, 0) /* turret */ \
1305 i(entity, 1) /* target */ \
1306 /**/
1307MUTATOR_HOOKABLE(FusionReactor_ValidTarget, params);
1308#undef params
1309
1310enum
1311{
1312 MUT_FUSREAC_TARG_CONTINUE, // return this flag to make the function continue as normal
1313 MUT_FUSREAC_TARG_VALID, // return this flag to make the function return true (valid target)
1314 MUT_FUSREAC_TARG_INVALID // return this flag to make the function return false (invalid target)
1315};
1316
1318#define params(i, o) \
1319 i(entity, 0) /* item */ \
1320 i(float, 1) /* respawn time */ \
1321 /**/
1323#undef params
1324
1326#define params(i, o) \
1327 i(entity, 0) /* player */ \
1328 /**/
1329MUTATOR_HOOKABLE(PlayerPhysics_UpdateStats, params);
1330#undef params
1331
1333#define params(i, o) \
1334 i(entity, 0) /* player */ \
1335 i(float, 1) /* maxspeed_mod */ \
1336 /**/
1337MUTATOR_HOOKABLE(PlayerPhysics_PostUpdateStats, params);
1338#undef params
1339
1341#define params(i, o) \
1342 i(entity, 0) /* bot */ \
1343 /**/
1345#undef params
1346
1348#define params(i, o) \
1349 i(entity, 0) /* player */ \
1350 /**/
1351MUTATOR_HOOKABLE(CalculateRespawnTime, params);
1352#undef params
1353
1355#define params(i, o) \
1356 i(entity, 0) /* caller */ \
1357 i(string, 1) /* first command */ \
1358 i(string, 2) /* vote command */ \
1359 i(float, 3) /* start position of vote command */ \
1360 i(float, 4) /* argument count */ \
1361 /**/
1362MUTATOR_HOOKABLE(VoteCommand_Parse, params);
1363#undef params
1364
1365enum
1366{
1367 MUT_VOTEPARSE_CONTINUE, // return this flag to make the function continue as normal
1368 MUT_VOTEPARSE_SUCCESS, // return 1 (vote parsed)
1369 MUT_VOTEPARSE_INVALID, // return -1 (vote parsed but counted as invalid, no action or vote)
1370 MUT_VOTEPARSE_UNACCEPTABLE // return 0 (vote parameter counted as unacceptable, warns caller)
1371};
1372
1374#define params(i, o) \
1375 i(int, 0) /* g_maxplayers */ \
1376 o(int, 0) \
1377 /**/
1379#undef params
1380
1382#define params(i, o) \
1383 i(entity, 0) /* player */ \
1384 i(string, 1) /* item codes */ \
1385 o(string, 1) \
1386 /**/
1387MUTATOR_HOOKABLE(LogDeath_AppendItemCodes, params);
1388#undef params
1389
1391#define params(i, o) \
1392 i(bool, 0) /* allow_rocketjump */ \
1393 o(bool, 0) \
1394 /**/
1395MUTATOR_HOOKABLE(AllowRocketJumping, params);
1396#undef params
1397
1399#define params(i, o) \
1400 i(entity, 0) /* player */ \
1401 /**/
1403#undef params
1404
1406#define params(i, o) \
1407 i(entity, 0) /* object */ \
1408 /**/
1409MUTATOR_HOOKABLE(Sandbox_DragAllowed, params);
1410#undef params
1411
1413MUTATOR_HOOKABLE(Sandbox_SaveAllowed, EV_NO_ARGS);
1414
1416#define params(i, o) \
1417 i(entity, 0) /* player */ \
1418 /**/
1419MUTATOR_HOOKABLE(Sandbox_EditAllowed, params);
1420#undef params
1421
1423#define params(i, o) \
1424 i(entity, 0) /* player */ \
1425 i(entity, 1) /* bubble */ \
1426 /**/
1427MUTATOR_HOOKABLE(ShowChatBubble, params);
1428#undef params
#define EV_NO_ARGS(i, o)
Definition base.qh:163
#define MUTATOR_HOOKABLE(name, params)
Definition base.qh:168
void TakeResourceWithLimit(entity receiver, Resource res_type, float amount, float limit)
Takes an entity some resource but not less than a limit.
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
#define params(i, o)
Called when a client command is parsed NOTE: hooks MUST start with if (MUTATOR_RETURNVALUE) return fa...
Definition events.qh:36
void GetCvars(entity this, entity store, int f)
#define ClientConnect
Definition _all.inc:243
#define ClientKill
Definition _all.inc:255
#define PlayerPreThink
Definition _all.inc:259
#define SV_ParseClientCommand
Definition _all.inc:290
#define SetChangeParms
Definition _all.inc:233
#define PutClientInServer
Definition _all.inc:251
#define ClientDisconnect
Definition _all.inc:247
#define SetNewParms
Definition _all.inc:229
bool SpectateSet(entity this)
Definition client.qc:1884
void SpectateCopy(entity this, entity spectatee)
Definition client.qc:1798
int GetPlayerLimit()
Definition client.qc:2154
void GetPressedKeys(entity this)
Definition client.qc:1766
void PlayerUseKey(entity this)
Definition client.qc:2634
void FixClientCvars(entity e)
Definition client.qc:1000
bool SpectateNext(entity this)
Definition client.qc:1986
void FixPlayermodel(entity player)
Definition client.qc:454
bool SpectatePrev(entity this)
Definition client.qc:2000
void Item_ScheduleRespawn(entity e)
Definition items.qc:386
void Item_RespawnCountdown(entity this)
Definition items.qc:258
string monster_loot
Definition events.qh:428
float get_cvars_f
Definition events.qh:378
@ MUT_FUSREAC_TARG_VALID
Definition events.qh:1313
@ MUT_FUSREAC_TARG_INVALID
Definition events.qh:1314
@ MUT_FUSREAC_TARG_CONTINUE
Definition events.qh:1312
@ MUT_VOTEPARSE_CONTINUE
Definition events.qh:1367
@ MUT_VOTEPARSE_UNACCEPTABLE
Definition events.qh:1370
@ MUT_VOTEPARSE_INVALID
Definition events.qh:1369
@ MUT_VOTEPARSE_SUCCESS
Definition events.qh:1368
@ MUT_SPECPREV_RETURN
Definition events.qh:1082
@ MUT_SPECPREV_CONTINUE
Definition events.qh:1081
@ MUT_SPECPREV_FOUND
Definition events.qh:1083
@ MUT_ACCADD_INDIFFERENT
Definition events.qh:951
@ MUT_ACCADD_INVALID
Definition events.qh:950
@ MUT_ACCADD_VALID
Definition events.qh:949
@ MUT_ITEMTOUCH_PICKUP
Definition events.qh:800
@ MUT_ITEMTOUCH_RETURN
Definition events.qh:799
@ MUT_ITEMTOUCH_CONTINUE
Definition events.qh:798
@ MUT_SPECCMD_RETURN
Definition events.qh:1105
@ MUT_SPECCMD_FORCE
Definition events.qh:1106
@ MUT_SPECCMD_CONTINUE
Definition events.qh:1104
string get_cvars_s
Definition events.qh:379
void CopyBody(entity this, float keepvelocity)
Definition player.qc:64
vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck, bool targetcheck)
void W_PlayStrengthSound(entity player)
Definition common.qc:40
void DecodeLevelParms(entity this)
Definition client.qc:987
void GiveResource(entity receiver, Resource res_type, float amount)
Gives an entity some resource.
float GetResourceLimit(entity e, Resource res_type)
Returns the maximum amount of the given resource.
void GiveResourceWithLimit(entity receiver, Resource res_type, float amount, float limit)
Gives an entity some resource but not more than a limit.
void TeamBalance_GetTeamCounts(entity balance, entity ignore)
Counts the number of players and various other information about each team.
Definition teamplay.qc:758
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings.
Definition teamplay.qc:424
int TeamBalance_FindBestTeams(entity balance, entity player, bool use_score)
Returns the bitmask of the teams that will make the game most balanced if the player joins any of the...
Definition teamplay.qc:928
entity TeamBalance_GetPlayerForTeamSwitch(int source_team_index, int destination_team_index, bool is_bot)
Returns the player who is the most suitable for switching between the given teams.
Definition teamplay.qc:1109
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
void W_Reload(entity actor,.entity weaponentity, float sent_ammo_min, Sound sent_sound)
void SetDefaultAlpha()
Definition world.qc:105
void CheckRules_World()
Definition world.qc:1733