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
175#define params(i, o) \
176 i(float, 0) /* mask of teams */ \
177 o(float, 0) \
178 i(string, 1) /* team entity name */ \
179 o(string, 1) \
180 i(entity, 2) /* player checked */ \
181 /**/
183#undef params
184
187
189#define params(i, o) \
190 i(float, 0) /* team index to count */ \
191 i(entity, 1) /* player to ignore */ \
192 o(float, 2) /* number of players in a team */ \
193 o(float, 3) /* number of bots in a team */ \
194 /**/
195MUTATOR_HOOKABLE(TeamBalance_GetTeamCount, params);
196#undef params
197
199#define params(i, o) \
200 i(entity, 0) /* player checked */ \
201 o(float, 1) /* bitmask of teams */ \
202 /**/
204#undef params
205
207#define params(i, o) \
208 i(int, 0) /* source team index */ \
209 i(int, 1) /* destination team index */ \
210 i(bool, 2) /* is looking for bot */ \
211 o(entity, 3) /* player to switch */ \
212 /**/
214#undef params
215
217#define params(i, o) \
218 i(entity, 0) /* spectatee */ \
219 i(entity, 1) /* client */ \
220 /**/
222#undef params
223
225#define params(i, o) \
226 i(entity, 0) /* player */ \
227 i(string, 1) /* escape */ \
228 i(string, 2) /* replacement */ \
229 o(string, 2) \
230 i(string, 3) /* message */ \
231 /**/
232MUTATOR_HOOKABLE(FormatMessage, params);
233#undef params
234
236#define params(i, o) \
237 i(entity, 0) /* player */ \
238 i(string, 1) /* message */ \
239 o(string, 1) \
240 /**/
241MUTATOR_HOOKABLE(PreFormatMessage, params);
242#undef params
243
245#define params(i, o) \
246 i(entity, 0) /* player */ \
247 i(entity, 1) /* weapon entity */ \
248 /**/
249MUTATOR_HOOKABLE(ForbidThrowCurrentWeapon, params);
250#undef params
251
253#define params(i, o) \
254 i(entity, 0) /* player */ \
255 i(int, 1) /* weapon id */ \
256 /**/
257MUTATOR_HOOKABLE(ForbidDropCurrentWeapon, params);
258#undef params
259
261
263#define params(i, o) \
264 i(float, 0) /* weapon rate */ \
265 o(float, 0) \
266 i(entity, 1) /* player */ \
267 /**/
268MUTATOR_HOOKABLE(WeaponRateFactor, params);
269#undef params
270
272#define params(i, o) \
273 i(float, 0) /* weapon speed */ \
274 o(float, 0) \
275 i(entity, 1) /* player */ \
276 /**/
277MUTATOR_HOOKABLE(WeaponSpeedFactor, params);
278#undef params
279
282
284#define params(i, o) \
285 i(entity, 0) /* waypoint */ \
286 i(entity, 1) /* player; other.enemy = spectator */ \
287 /**/
288MUTATOR_HOOKABLE(CustomizeWaypoint, params);
289#undef params
290
294#define params(i, o) \
295 i(entity, 0) /* item */ \
296 /**/
297MUTATOR_HOOKABLE(FilterItemDefinition, params);
298#undef params
299
303#define params(i, o) \
304 i(entity, 0) /* item */ \
305 /**/
307#undef params
308
310#define params(i, o) \
311 i(entity, 0) /* turret */ \
312 /**/
314#undef params
315
317#define params(i, o) \
318 i(entity, 0) /* turret */ \
319 /**/
321#undef params
322
324#define params(i, o) \
325 i(entity, 0) /* turret */ \
326 o(bool, 1) /* to fire or not to fire */ \
327 /**/
328MUTATOR_HOOKABLE(Turret_CheckFire, params);
329#undef params
330
332#define params(i, o) \
333 i(entity, 0) /* turret */ \
334 i(bool, 1) /* dual */ \
335 /**/
336MUTATOR_HOOKABLE(Turret_Plasma_Fire, params);
337#undef params
338
340#define params(i, o) \
341 i(entity, 0) /* entity */ \
342 /**/
343MUTATOR_HOOKABLE(OnEntityPreSpawn, params);
344#undef params
345
347#define params(i, o) \
348 i(entity, 0) /* player */ \
349 /**/
351#undef params
352
353// TODO: change this into a general PlayerPostThink hook?
354#define params(i, o) \
355 i(entity, 0) /* player */ \
356 /**/
358#undef params
359
371#define params(i, o) \
372 /**/ i(float, get_cvars_f) \
373 /**/ i(string, get_cvars_s) \
374 /**/
377MUTATOR_HOOKABLE(GetCvars, EV_NO_ARGS); // NOTE: Can't use EV_GetCvars because of `SZ_GetSpace: overflow`
378#undef params
379
381#define params(i, o) \
382 i(entity, 0) /* projectile owner */ \
383 i(entity, 1) /* projectile */ \
384 /**/
385MUTATOR_HOOKABLE(EditProjectile, params);
386#undef params
387
389#define params(i, o) \
390 i(entity, 0) /* monster */ \
391 /**/
393#undef params
394
396#define params(i, o) \
397 i(entity, 0) /* target */ \
398 i(entity, 1) /* attacker */ \
399 i(float, 2) /* deathtype */ \
400 /**/
402#undef params
403
405#define params(i, o) \
406 i(entity, 0) /* monster */ \
407 /**/
408MUTATOR_HOOKABLE(MonsterRemove, params);
409#undef params
410
412#define params(i, o) \
413 i(entity, 0) /* monster */ \
414 /**/
415MUTATOR_HOOKABLE(MonsterRespawn, params);
416#undef params
417
419#define params(i, o) \
420 i(entity, 0) /* monster */ \
421 i(string, 1) /* list of items to drop */ \
422 o(string, 1) \
423 i(entity, 2) /* attacker */ \
424 /**/
426MUTATOR_HOOKABLE(MonsterDropItem, params);
427#undef params
428
432#define params(i, o) \
433 i(entity, 0) /* monster */ \
434 i(float, 1) /* run speed */ \
435 o(float, 1) \
436 i(float, 2) /* walk speed */ \
437 o(float, 2) \
438 i(entity, 3) /* move target */ \
439 o(entity, 3) \
440 /**/
442#undef params
443
445MUTATOR_HOOKABLE(MonsterFindTarget, EV_NO_ARGS);
446
448#define params(i, o) \
449 i(entity, 0) /* monster */ \
450 i(entity, 1) /* target */ \
451 /**/
452MUTATOR_HOOKABLE(MonsterValidTarget, params);
453#undef params
454
458#define params(i, o) \
459 i(entity, 0) /* monster */ \
460 /**/
461MUTATOR_HOOKABLE(MonsterCheckBossFlag, params);
462#undef params
463
468#define params(i, o) \
469 i(entity, 0) /* caller */ \
470 o(string, 1) /* reason */ \
471 /**/
472MUTATOR_HOOKABLE(AllowMobSpawning, params);
473#undef params
474
476#define params(i, o) \
477 i(entity, 0) /* inflictor */ \
478 i(entity, 1) /* attacker */ \
479 i(entity, 2) /* target */ \
480 i(vector, 3) /* force (no out) */ \
481 i(float, 4) /* damage take */ \
482 o(float, 4) /* damage take */ \
483 i(float, 5) /* damage save */ \
484 o(float, 5) /* damage save */ \
485 i(float, 6) /* deathtype */ \
486 i(float, 7) /* damage */ \
487 /**/
488MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor, params);
489#undef params
490
495#define params(i, o) \
496 i(entity, 0) /* inflictor */ \
497 i(entity, 1) /* attacker */ \
498 i(entity, 2) /* target */ \
499 i(float, 3) /* deathtype */ \
500 i(float, 4) /* damage */ \
501 o(float, 4) /* damage */ \
502 i(float, 5) /* mirrordamage */ \
503 o(float, 5) /* mirrordamage */ \
504 i(vector, 6) /* force */ \
505 o(vector, 6) /* force */ \
506 i(entity, 7) /* weapon entity */ \
507 /**/
508MUTATOR_HOOKABLE(Damage_Calculate, params);
509#undef params
510
514#define params(i, o) \
515 i(entity, 0) /* attacker */ \
516 i(entity, 1) /* target */ \
517 i(float, 2) /* health */ \
518 i(float, 3) /* armor */ \
519 i(vector, 4) /* location */ \
520 i(int, 5) /* deathtype */ \
521 i(float, 6) /* potential_damage */ \
522 /**/
523MUTATOR_HOOKABLE(PlayerDamaged, params);
524#undef params
525
527#define params(i, o) \
528 i(entity, 0) /* actor */ \
529 i(entity, 1) /* weapon entity */ \
530 i(float, 2) /* ammo to take */ \
531 o(float, 2) \
532 /**/
534#undef params
535
537#define params(i, o) \
538 i(entity, 0) /* actor */ \
539 /**/
541#undef params
542
544#define params(i, o) \
545 i(entity, 0) /* player */ \
546 i(int, 1) /* old items */ \
547 /**/
548MUTATOR_HOOKABLE(PlayerPowerups, params);
549#undef params
550
552#define params(i, o) \
553 i(entity, 0) /* player */ \
554 /**/
555MUTATOR_HOOKABLE(SuperweaponsImmutable, params);
556#undef params
557
561#define params(i, o) \
562 i(entity, 0) /* player */ \
563 i(float, 1) /* max_mod */ \
564 o(float, 1) \
565 i(float, 2) /* regen_mod */ \
566 o(float, 2) \
567 i(float, 3) /* rot_mod */ \
568 o(float, 3) \
569 i(float, 4) /* limit_mod */ \
570 o(float, 4) \
571 i(float, 5) /* health_regen */ \
572 o(float, 5) \
573 i(float, 6) /* health_regenlinear */ \
574 o(float, 6) \
575 i(float, 7) /* health_rot */ \
576 o(float, 7) \
577 i(float, 8) /* health_rotlinear */ \
578 o(float, 8) \
579 i(float, 9) /* health_stable */ \
580 o(float, 9) \
581 i(float, 10) /* health_rotstable */ \
582 o(float, 10) \
583 /**/
585#undef params
586
591#define params(i, o) \
592 i(entity, 0) /* player */ \
593 /**/
595#undef params
596
598#define params(i, o) \
599 i(entity, 0) /* player */ \
600 /**/
601MUTATOR_HOOKABLE(PlayerIsInvisible, params);
602#undef params
603
631#define params(i, o) \
632 i(entity, 0) /* client sending the command */ \
633 i(string, 1) /* command name */ \
634 i(int, 2) /* argc (also, argv() can be used) */ \
635 i(string, 3) /* whole command, use only if you really have to */ \
636 /**/
638#undef params
639
643#define params(i, o) \
644 i(entity, 0) /* client sending the command */ \
645 i(string, 1) /* command name */ \
646 i(int, 2) /* argc (also, argv() can be used) */ \
647 i(string, 3) /* whole command, use only if you really have to */ \
648 /**/
649MUTATOR_HOOKABLE(ClientCommand_FloodControl, params);
650#undef params
651
653#define params(i, o) \
654 i(string, 0) /* command name */ \
655 i(int, 1) /* argc (also, argv() can be used) */ \
656 i(string, 2) /* whole command, use only if you really have to */ \
657 /**/
658MUTATOR_HOOKABLE(SV_ParseServerCommand, params);
659#undef params
660
664#define params(i, o) \
665 i(entity, 0) /* player wanting to spawn */ \
666 i(entity, 1) /* spot to be evaluated */ \
667 i(vector, 2) /* spot score, _x is priority, _y is "distance" */ \
668 o(vector, 2) \
669 /**/
671#undef params
672
675
676#define params(i, o) \
677 \
678 i(string, 0) \
679 o(string, 0) \
680 /**/
682#undef params
683
687#define params(i, o) \
688 i(entity, 0) /* item */ \
689 /**/
691#undef params
692
693#define params(i, o) \
694 i(entity, 0) /* map entity */ \
695 i(entity, 1) /* weapon info */ \
696 i(string, 2) /* replacement */ \
697 o(string, 2) \
698 /**/
699MUTATOR_HOOKABLE(SetWeaponreplace, params);
700#undef params
701
703#define params(i, o) \
704 i(entity, 0) /* item */ \
705 /**/
707#undef params
708
712#define params(i, o) \
713 i(entity, 0) /* bot */ \
714 i(entity, 1) /* target */ \
715 /**/
716MUTATOR_HOOKABLE(Bot_ForbidAttack, params);
717#undef params
718
722#define params(i, o) \
723 i(entity, 0) /* player */ \
724 /**/
725MUTATOR_HOOKABLE(PortalTeleport, params);
726#undef params
727
734#define params(i, o) \
735 i(entity, 0) /* the player who pressed impulse 33 */ \
736 /**/
738#undef params
739
743#define params(i, o) \
744 i(entity, 0) /* vehicle */ \
745 /**/
747#undef params
748
752#define params(i, o) \
753 i(entity, 0) /* player */ \
754 i(entity, 1) /* vehicle */ \
755 /**/
757#undef params
758
762#define params(i, o) \
763 i(entity, 0) /* vehicle */ \
764 i(entity, 1) /* player */ \
765 /**/
767#undef params
768
772#define params(i, o) \
773 i(entity, 0) /* player */ \
774 i(entity, 1) /* vehicle */ \
775 /**/
777#undef params
778
780#define params(i, o) \
781 i(entity, 0) /* player */ \
782 /**/
783MUTATOR_HOOKABLE(AbortSpeedrun, params);
784#undef params
785
787#define params(i, o) \
788 i(entity, 0) /* item */ \
789 i(entity, 1) /* toucher */ \
790 o(entity, 1) \
791 /**/
793#undef params
794
795enum
796{
797 MUT_ITEMTOUCH_CONTINUE, // return this flag to make the function continue as normal
798 MUT_ITEMTOUCH_RETURN, // return this flag to make the function return (handled entirely by mutator)
799 MUT_ITEMTOUCH_PICKUP // return this flag to have the item "picked up" and taken even after mutator handled it
800};
801
803#define params(i, o) \
804 i(entity, 0) /* item */ \
805 i(entity, 1) /* toucher */ \
806 /**/
808#undef params
809
810// The Resource hooks are often called by other hooks and to avoid conflicts
811// as much as possible their args start from ARGV_7
812
814#define params(i, o) \
815 i(entity, 7) /* checked entity */ \
816 i(entity, 8) /* resource type */ \
817 i(float, 9) /* limit */ \
818 o(float, 9) \
819 /**/
821#undef params
822
827#define params(i, o) \
828 i(entity, 7) /* checked entity */ \
829 i(entity, 8) /* resource type */ \
830 o(entity, 8) \
831 i(float, 9) /* amount */ \
832 o(float, 9) \
833 /**/
835#undef params
836
841#define params(i, o) \
842 i(entity, 7) /* checked entity */ \
843 i(entity, 8) /* resource type */ \
844 i(float, 9) /* amount */ \
845 /**/
846MUTATOR_HOOKABLE(ResourceAmountChanged, params);
847#undef params
848
853#define params(i, o) \
854 i(entity, 7) /* checked entity */ \
855 i(entity, 8) /* resource type */ \
856 i(float, 9) /* amount wasted */ \
857 /**/
858MUTATOR_HOOKABLE(ResourceWasted, params);
859#undef params
860
866#define params(i, o) \
867 i(entity, 7) /* receiver */ \
868 i(entity, 8) /* resource type */ \
869 o(entity, 8) \
870 i(float, 9) /* amount */ \
871 o(float, 9) \
872 /**/
874#undef params
875
880#define params(i, o) \
881 i(entity, 7) /* receiver */ \
882 i(entity, 8) /* resource type */ \
883 o(entity, 8) \
884 i(float, 9) /* amount */ \
885 o(float, 9) \
886 i(float, 10) /* limit */ \
887 o(float, 10) \
888 /**/
890#undef params
891
897#define params(i, o) \
898 i(entity, 7) /* receiver */ \
899 i(entity, 8) /* resource type */ \
900 o(entity, 8) \
901 i(float, 9) /* amount */ \
902 o(float, 9) \
903 /**/
905#undef params
906
911#define params(i, o) \
912 i(entity, 7) /* receiver */ \
913 i(entity, 8) /* resource type */ \
914 o(entity, 8) \
915 i(float, 9) /* amount */ \
916 o(float, 9) \
917 i(float, 10) /* limit */ \
918 o(float, 10) \
919 /**/
921#undef params
922
923// END Resource hooks
924
926#define params(i, o) \
927 i(entity, 0) /* player */ \
928 /**/
930#undef params
931
932#define params(i, o) \
933 i(entity, 0) /* bot */ \
934 /**/
935MUTATOR_HOOKABLE(HavocBot_ChooseRole, params);
936#undef params
937
939#define params(i, o) \
940 i(entity, 0) /* attacker */ \
941 i(entity, 1) /* target */ \
942 /**/
943MUTATOR_HOOKABLE(AccuracyTargetValid, params);
944#undef params
945
946enum
947{
948 MUT_ACCADD_VALID, // return this flag to make the function continue if target is a client
949 MUT_ACCADD_INVALID, // return this flag to make the function always continue
950 MUT_ACCADD_INDIFFERENT // return this flag to make the function always return
951};
952
954MUTATOR_HOOKABLE(ClearModelParams, EV_NO_ARGS);
955
957#define params(i, o) \
958 i(string, 0) /* input */ \
959 i(string, 1) /* command */ \
960 /**/
961MUTATOR_HOOKABLE(GetModelParams, params);
962#undef params
963
965#define params(i, o) \
966 i(entity, 0) /* player */ \
967 i(entity, 1) /* targ */ \
968 i(vector, 2) /* start pos */ \
969 i(vector, 3) /* end pos */ \
970 i(float, 4) /* damage */ \
971 o(float, 4) \
972 i(entity, 5) /* wep entity */ \
973 /**/
974MUTATOR_HOOKABLE(FireBullet_Hit, params);
975#undef params
976
977#define params(i, o) \
978 i(string, 0) /* model */ \
979 o(string, 0) \
980 i(int, 1) /* skin */ \
981 o(int, 1) \
982 i(entity, 2) /* player */ \
983 /**/
985#undef params
986
988MUTATOR_HOOKABLE(Scores_CountFragsRemaining, EV_NO_ARGS);
989
990#define params(i, o) \
991 i(entity, 0) /* hook */ \
992 i(int, 1) /* tarzan */ \
993 o(int, 1) \
994 i(entity, 2) /* pulling entity */ \
995 o(entity, 2) \
996 i(float, 3) /* velocity multiplier */ \
997 o(float, 3) \
998 /**/
999MUTATOR_HOOKABLE(GrappleHookThink, params);
1000#undef params
1001
1002#define params(i, o) \
1003 i(entity, 0) /* buff */ \
1004 i(entity, 1) /* player */ \
1005 /**/
1006MUTATOR_HOOKABLE(BuffModel_Customize, params);
1007#undef params
1008
1010#define params(i, o) \
1011 i(entity, 0) /* buff */ \
1012 i(entity, 1) /* player */ \
1013 o(entity, 1) \
1014 /**/
1016#undef params
1017
1019
1021
1023
1024#define params(i, o) \
1025 i(int, 0) /* page */ \
1026 i(string, 1) /* record list */ \
1027 o(string, 1) \
1028 /**/
1030#undef params
1031
1032#define params(i, o) \
1033 i(entity, 0) /* player */ \
1034 /**/
1035MUTATOR_HOOKABLE(Race_FinalCheckpoint, params);
1036#undef params
1037
1039#define params(i, o) \
1040 i(entity, 0) /* player */ \
1041 i(float, 1) /* kill delay */ \
1042 o(float, 1) \
1043 /**/
1045#undef params
1046
1047#define params(i, o) \
1048 i(entity, 0) /* player */ \
1049 /**/
1051#undef params
1052
1053#define params(i, o) \
1054 i(entity, 0) /* client */ \
1055 i(entity, 1) /* target */ \
1056 o(entity, 1) \
1057 /**/
1059#undef params
1060
1061#define params(i, o) \
1062 i(entity, 0) /* client */ \
1063 i(entity, 1) /* target */ \
1064 o(entity, 1) \
1065 /**/
1067#undef params
1068
1069#define params(i, o) \
1070 i(entity, 0) /* client */ \
1071 i(entity, 1) /* target */ \
1072 o(entity, 1) \
1073 i(entity, 2) /* first */ \
1074 /**/
1076#undef params
1077
1078enum
1079{
1080 MUT_SPECPREV_CONTINUE, // return this flag to make the function continue as normal
1081 MUT_SPECPREV_RETURN, // return this flag to make the function return (handled entirely by mutator)
1082 MUT_SPECPREV_FOUND // return this flag to make the function continue without default functions (handled mostly by mutator)
1083};
1084
1086#define params(i, o) \
1087 i(int, 0) /* active real players */ \
1088 o(int, 0) \
1089 i(int, 1) /* real players */ \
1090 o(int, 1) \
1091 /**/
1093#undef params
1094
1095#define params(i, o) \
1096 i(entity, 0) /* player */ \
1097 /**/
1098MUTATOR_HOOKABLE(ClientCommand_Spectate, params);
1099#undef params
1100
1101enum
1102{
1103 MUT_SPECCMD_CONTINUE, // return this flag to make the function continue as normal
1104 MUT_SPECCMD_RETURN, // return this flag to make the function return (don't spectate)
1105 MUT_SPECCMD_FORCE // return this flag to force the player to spectate, even if they're not a player
1106};
1107
1108#define params(i, o) \
1109 i(float, 0) /* status */ \
1110 o(float, 0) \
1111 i(float, 1) /* time limit */ \
1112 i(float, 2) /* frag limit */ \
1113 /**/
1115#undef params
1116
1117#define params(i, o) \
1118 i(entity, 0) /* weapon info entity */ \
1119 i(float, 1) /* do want? */ \
1120 o(float, 1) \
1121 i(int, 2) /* want all guns */ \
1122 o(int, 2) \
1123 i(bool, 3) /* want mutator blocked */ \
1124 o(bool, 3) \
1125 /**/
1127#undef params
1128
1129#define params(i, o) \
1130 i(entity, 0) /* score field */ \
1131 i(float, 1) /* score */ \
1132 o(float, 1) \
1133 i(entity, 2) /* player */ \
1134 /**/
1135MUTATOR_HOOKABLE(AddPlayerScore, params);
1136#undef params
1137
1138#define params(i, o) \
1139 i(entity, 0) /* score field */ \
1140 i(float, 1) /* score */ \
1141 i(entity, 2) /* player */ \
1142 /**/
1143MUTATOR_HOOKABLE(AddedPlayerScore, params);
1144#undef params
1145
1146#define params(i, o) \
1147 i(entity, 0) /* player */ \
1148 /**/
1149MUTATOR_HOOKABLE(GetPlayerStatus, params);
1150#undef params
1151
1152#define params(i, o) \
1153 i(string, 0) /* arena */ \
1154 o(string, 0) \
1155 /**/
1156MUTATOR_HOOKABLE(SetWeaponArena, params);
1157#undef params
1158
1159#define params(i, o) \
1160 i(int, 0) /* weapon_stay */ \
1161 o(int, 0) \
1162 /**/
1163MUTATOR_HOOKABLE(SetWeaponStay, params);
1164#undef params
1165
1166#define params(i, o) \
1167 i(entity, 0) /* target */ \
1168 /**/
1169MUTATOR_HOOKABLE(DropSpecialItems, params);
1170#undef params
1171
1175#define params(i, o) \
1176 o(string, 0) /* reason */ \
1177 /**/
1178MUTATOR_HOOKABLE(AllowMobButcher, params);
1179#undef params
1180
1182
1183#define params(i, o) \
1184 i(entity, 0) /* waypoint */ \
1185 i(entity, 1) /* to */ \
1186 i(int, 2) /* send flags */ \
1187 o(int, 2) \
1188 i(int, 3) /* wp flag */ \
1189 o(int, 3) \
1190 /**/
1192#undef params
1193
1194#define params(i, o) \
1195 i(entity, 0) /* turret */ \
1196 i(entity, 1) /* target */ \
1197 i(int, 2) /* validate flags */ \
1198 o(float, 3) /* target score */ \
1199 /**/
1200MUTATOR_HOOKABLE(TurretValidateTarget, params);
1201#undef params
1202
1203#define params(i, o) \
1204 i(entity, 0) /* turret */ \
1205 /**/
1207#undef params
1208
1210
1211#define params(i, o) \
1212 i(entity, 0) /* projectile */ \
1213 i(entity, 1) /* attacker */ \
1214 /**/
1215MUTATOR_HOOKABLE(PrepareExplosionByDamage, params);
1216#undef params
1217
1219#define params(i, o) \
1220 i(string, 0) /* model */ \
1221 i(string, 1) /* output */ \
1222 o(string, 1) \
1223 /**/
1225#undef params
1226
1228#define params(i, o) \
1229 i(entity, 0) /* player */ \
1230 i(float, 1) /* current team index */ \
1231 i(float, 2) /* new team index */ \
1232 /**/
1233MUTATOR_HOOKABLE(Player_ChangeTeam, params);
1234#undef params
1235
1237#define params(i, o) \
1238 i(entity, 0) /* player */ \
1239 i(float, 1) /* old team index */ \
1240 i(float, 2) /* current team index */ \
1241 /**/
1242MUTATOR_HOOKABLE(Player_ChangedTeam, params);
1243#undef params
1244
1245#define params(i, o) \
1246 i(float, 0) /* id */ \
1247 i(float, 1) /* status */ \
1248 i(string, 2) /* data */ \
1249 /**/
1250MUTATOR_HOOKABLE(URI_GetCallback, params);
1251#undef params
1252
1254#define params(i, o) \
1255 i(entity, 0) /* player */ \
1256 /**/
1258#undef paramsv
1259
1261#define params(i, o) \
1262 i(entity, 0) /* player */ \
1263 /**/
1264MUTATOR_HOOKABLE(ForbidWeaponUse, params);
1265#undef params
1266
1268#define params(i, o) \
1269 i(entity, 0) /* player */ \
1270 i(entity, 1) /* newly created clone */ \
1271 i(bool, 2) /* keepvelocity? */ \
1272 /**/
1274#undef params
1275
1277#define params(i, o) \
1278 i(entity, 0) /* sender */ \
1279 i(int, 1) /* ret */ \
1280 o(int, 1) \
1281 i(string, 2) /* message */ \
1282 i(entity, 3) /* private msg target */ \
1283 /**/
1285#undef params
1286
1288#define params(i, o) \
1289 i(entity, 0) /* destination player */ \
1290 i(entity, 1) /* sender */ \
1291 /**/
1292MUTATOR_HOOKABLE(ChatMessageTo, params);
1293#undef params
1294
1298MUTATOR_HOOKABLE(ReadyRestart_Deny, EV_NO_ARGS);
1299
1301#define params(i, o) \
1302 i(entity, 0) /* turret */ \
1303 i(entity, 1) /* target */ \
1304 /**/
1305MUTATOR_HOOKABLE(FusionReactor_ValidTarget, params);
1306#undef params
1307
1308enum
1309{
1310 MUT_FUSREAC_TARG_CONTINUE, // return this flag to make the function continue as normal
1311 MUT_FUSREAC_TARG_VALID, // return this flag to make the function return true (valid target)
1312 MUT_FUSREAC_TARG_INVALID // return this flag to make the function return false (invalid target)
1313};
1314
1316#define params(i, o) \
1317 i(entity, 0) /* item */ \
1318 i(float, 1) /* respawn time */ \
1319 /**/
1321#undef params
1322
1324#define params(i, o) \
1325 i(entity, 0) /* player */ \
1326 /**/
1327MUTATOR_HOOKABLE(PlayerPhysics_UpdateStats, params);
1328#undef params
1329
1331#define params(i, o) \
1332 i(entity, 0) /* player */ \
1333 i(float, 1) /* maxspeed_mod */ \
1334 /**/
1335MUTATOR_HOOKABLE(PlayerPhysics_PostUpdateStats, params);
1336#undef params
1337
1339#define params(i, o) \
1340 i(entity, 0) /* bot */ \
1341 /**/
1343#undef params
1344
1346#define params(i, o) \
1347 i(entity, 0) /* player */ \
1348 /**/
1349MUTATOR_HOOKABLE(CalculateRespawnTime, params);
1350#undef params
1351
1353#define params(i, o) \
1354 i(entity, 0) /* caller */ \
1355 i(string, 1) /* first command */ \
1356 i(string, 2) /* vote command */ \
1357 i(float, 3) /* start position of vote command */ \
1358 i(float, 4) /* argument count */ \
1359 /**/
1360MUTATOR_HOOKABLE(VoteCommand_Parse, params);
1361#undef params
1362
1363enum
1364{
1365 MUT_VOTEPARSE_CONTINUE, // return this flag to make the function continue as normal
1366 MUT_VOTEPARSE_SUCCESS, // return 1 (vote parsed)
1367 MUT_VOTEPARSE_INVALID, // return -1 (vote parsed but counted as invalid, no action or vote)
1368 MUT_VOTEPARSE_UNACCEPTABLE // return 0 (vote parameter counted as unacceptable, warns caller)
1369};
1370
1372#define params(i, o) \
1373 i(int, 0) /* g_maxplayers */ \
1374 o(int, 0) \
1375 /**/
1377#undef params
1378
1380#define params(i, o) \
1381 i(entity, 0) /* player */ \
1382 i(string, 1) /* item codes */ \
1383 o(string, 1) \
1384 /**/
1385MUTATOR_HOOKABLE(LogDeath_AppendItemCodes, params);
1386#undef params
1387
1389#define params(i, o) \
1390 i(bool, 0) /* allow_rocketjump */ \
1391 o(bool, 0) \
1392 /**/
1393MUTATOR_HOOKABLE(AllowRocketJumping, params);
1394#undef params
1395
1397#define params(i, o) \
1398 i(entity, 0) /* player */ \
1399 /**/
1401#undef params
1402
1404#define params(i, o) \
1405 i(entity, 0) /* object */ \
1406 /**/
1407MUTATOR_HOOKABLE(Sandbox_DragAllowed, params);
1408#undef params
1409
1411MUTATOR_HOOKABLE(Sandbox_SaveAllowed, EV_NO_ARGS);
1412
1414#define params(i, o) \
1415 i(entity, 0) /* player */ \
1416 /**/
1417MUTATOR_HOOKABLE(Sandbox_EditAllowed, params);
1418#undef params
1419
1421#define params(i, o) \
1422 i(entity, 0) /* player */ \
1423 i(entity, 1) /* bubble */ \
1424 /**/
1425MUTATOR_HOOKABLE(ShowChatBubble, params);
1426#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:242
#define ClientKill
Definition _all.inc:254
#define PlayerPreThink
Definition _all.inc:258
#define SV_ParseClientCommand
Definition _all.inc:289
#define SetChangeParms
Definition _all.inc:232
#define PutClientInServer
Definition _all.inc:250
#define ClientDisconnect
Definition _all.inc:246
#define SetNewParms
Definition _all.inc:228
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:385
void Item_RespawnCountdown(entity this)
Definition items.qc:257
string monster_loot
Definition events.qh:425
float get_cvars_f
Definition events.qh:375
@ MUT_FUSREAC_TARG_VALID
Definition events.qh:1311
@ MUT_FUSREAC_TARG_INVALID
Definition events.qh:1312
@ MUT_FUSREAC_TARG_CONTINUE
Definition events.qh:1310
@ MUT_VOTEPARSE_CONTINUE
Definition events.qh:1365
@ MUT_VOTEPARSE_UNACCEPTABLE
Definition events.qh:1368
@ MUT_VOTEPARSE_INVALID
Definition events.qh:1367
@ MUT_VOTEPARSE_SUCCESS
Definition events.qh:1366
@ MUT_SPECPREV_RETURN
Definition events.qh:1081
@ MUT_SPECPREV_CONTINUE
Definition events.qh:1080
@ MUT_SPECPREV_FOUND
Definition events.qh:1082
@ MUT_ACCADD_INDIFFERENT
Definition events.qh:950
@ MUT_ACCADD_INVALID
Definition events.qh:949
@ MUT_ACCADD_VALID
Definition events.qh:948
@ MUT_ITEMTOUCH_PICKUP
Definition events.qh:799
@ MUT_ITEMTOUCH_RETURN
Definition events.qh:798
@ MUT_ITEMTOUCH_CONTINUE
Definition events.qh:797
@ MUT_SPECCMD_RETURN
Definition events.qh:1104
@ MUT_SPECCMD_FORCE
Definition events.qh:1105
@ MUT_SPECCMD_CONTINUE
Definition events.qh:1103
string get_cvars_s
Definition events.qh:376
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