forked from root-cause/v-decompiled-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
am_mp_arcade_peds.c
6475 lines (5690 loc) · 114 KB
/
am_mp_arcade_peds.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#region Local Var
var uLocal_0 = 0;
var uLocal_1 = 0;
int iLocal_2 = 0;
int iLocal_3 = 0;
int iLocal_4 = 0;
int iLocal_5 = 0;
int iLocal_6 = 0;
int iLocal_7 = 0;
int iLocal_8 = 0;
int iLocal_9 = 0;
int iLocal_10 = 0;
int iLocal_11 = 0;
float fLocal_12 = 0f;
var uLocal_13 = 0;
var uLocal_14 = 0;
int iLocal_15 = 0;
char* sLocal_16 = NULL;
var uLocal_17 = 0;
var uLocal_18 = 0;
int iLocal_19 = 0;
float fLocal_20 = 0f;
var uLocal_21 = 0;
var uLocal_22 = 0;
var uLocal_23 = 0;
float fLocal_24 = 0f;
float fLocal_25 = 0f;
var uLocal_26 = 0;
var uLocal_27 = 0;
var uLocal_28 = 0;
float fLocal_29 = 0f;
float fLocal_30 = 0f;
float fLocal_31 = 0f;
var uLocal_32 = 0;
var uLocal_33 = 0;
var uLocal_34 = 0;
var uLocal_35 = 0;
var uLocal_36 = 0;
int iLocal_37 = 0;
int iLocal_38 = 0;
int iLocal_39 = 0;
int iLocal_40 = 0;
var uLocal_41 = 0;
var uLocal_42 = 0;
var uLocal_43 = 0;
var uLocal_44 = 0;
struct<395> Local_45 = { 17, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ;
var uLocal_440 = 0;
var uLocal_441 = 0;
var uLocal_442 = 0;
var uLocal_443 = 0;
var uLocal_444 = 0;
var uLocal_445 = 0;
var uLocal_446 = 0;
struct<30> Local_447 = { 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ;
struct<3> ScriptParam_0 = { 0, 0, 0 } ;
#endregion
void __EntryFunction__()//Position - 0x0
{
iLocal_2 = 1;
iLocal_3 = 134;
iLocal_4 = 134;
iLocal_5 = 1;
iLocal_6 = 1;
iLocal_7 = 1;
iLocal_8 = 134;
iLocal_9 = 1;
iLocal_10 = 12;
iLocal_11 = 12;
fLocal_12 = 0.001f;
iLocal_15 = -1;
sLocal_16 = "NULL";
iLocal_19 = 3;
fLocal_20 = 0f;
fLocal_24 = -0.0375f;
fLocal_25 = 0.17f;
fLocal_29 = 80f;
fLocal_30 = 140f;
fLocal_31 = 180f;
iLocal_37 = 1;
iLocal_38 = 65;
iLocal_39 = 49;
iLocal_40 = 64;
func_189();
if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS())
{
func_185();
}
else
{
func_182();
}
func_177(ScriptParam_0);
func_165();
func_160(1);
func_159();
while (true)
{
func_158();
if (func_146())
{
func_182();
}
func_2();
func_1();
}
}
void func_1()//Position - 0xBB
{
float fVar0;
if (!Local_45.f_380 || !Local_45.f_381)
{
return;
}
if (Local_45.f_391)
{
if (AUDIO::IS_STREAM_PLAYING())
{
AUDIO::STOP_STREAM();
}
Local_45.f_376 = 0;
}
else
{
if (Local_45.f_376 == 0)
{
if (Local_447.f_1 != 0)
{
if (AUDIO::LOAD_STREAM("Walla_Normal", "DLC_H3_Arcade_Walla_Sounds"))
{
Local_45.f_376++;
}
}
}
if (Local_45.f_376 == 1)
{
AUDIO::PLAY_STREAM_FROM_POSITION(2729.5894f, -383.9195f, -48.9951f);
Local_45.f_376++;
}
if (Local_45.f_376 == 2)
{
if (AUDIO::IS_STREAM_PLAYING())
{
fVar0 = (SYSTEM::TO_FLOAT(Local_447.f_1) / 6f);
AUDIO::SET_VARIABLE_ON_STREAM("PedDensity", fVar0);
Local_45.f_376++;
}
}
}
}
void func_2()//Position - 0x17E
{
int iVar0;
iVar0 = 0;
while (iVar0 < func_138())
{
if (func_137(&(Local_45[iVar0 /*22*/]), iVar0))
{
if (!ENTITY::DOES_ENTITY_EXIST(Local_45[iVar0 /*22*/]))
{
func_111(&(Local_45[iVar0 /*22*/]), iVar0);
}
else if (ENTITY::IS_ENTITY_DEAD(Local_45[iVar0 /*22*/], false))
{
func_110(&(Local_45[iVar0 /*22*/]));
}
func_99(&(Local_45[iVar0 /*22*/]), iVar0);
func_87(&(Local_45[iVar0 /*22*/]));
func_28(&(Local_45[iVar0 /*22*/]), iVar0);
}
iVar0++;
}
func_26();
func_24();
func_21();
func_10();
func_8();
func_3();
Local_45.f_377 = 0;
}
void func_3()//Position - 0x21F
{
if (func_7(&(Local_447.f_24)) && func_5(&(Local_447.f_24), 15000, 0))
{
func_4(&(Local_447.f_24));
}
if (func_7(&(Local_447.f_26)) && func_5(&(Local_447.f_26), 15000, 0))
{
func_4(&(Local_447.f_26));
}
if (func_7(&(Local_447.f_28)) && func_5(&(Local_447.f_28), 15000, 0))
{
func_4(&(Local_447.f_28));
}
if (func_7(&(Local_45.f_394)) && func_5(&(Local_45.f_394), 15000, 0))
{
func_4(&(Local_45.f_394));
}
}
void func_4(var uParam0)//Position - 0x2C3
{
uParam0->f_1 = 0;
}
int func_5(var uParam0, int iParam1, bool bParam2)//Position - 0x2D0
{
if (iParam1 == -1)
{
return 1;
}
func_6(uParam0, bParam2, 0);
if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS() && !bParam2)
{
if (MISC::ABSI(NETWORK::GET_TIME_DIFFERENCE(NETWORK::GET_NETWORK_TIME(), *uParam0)) >= iParam1)
{
return 1;
}
}
else if (MISC::ABSI(NETWORK::GET_TIME_DIFFERENCE(MISC::GET_GAME_TIMER(), *uParam0)) >= iParam1)
{
return 1;
}
return 0;
}
void func_6(var uParam0, bool bParam1, bool bParam2)//Position - 0x32E
{
if (uParam0->f_1 == 0)
{
if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS() && !bParam1)
{
if (!bParam2)
{
*uParam0 = NETWORK::GET_NETWORK_TIME();
}
else
{
*uParam0 = NETWORK::GET_NETWORK_TIME_ACCURATE();
}
}
else
{
*uParam0 = MISC::GET_GAME_TIMER();
}
uParam0->f_1 = 1;
}
}
bool func_7(var uParam0)//Position - 0x373
{
return uParam0->f_1;
}
void func_8()//Position - 0x37F
{
if (Local_447.f_9 == 0 && func_9(Local_45[4 /*22*/]))
{
PED::SET_PED_CAPSULE(Local_45[4 /*22*/], 0.5f);
}
}
int func_9(int iParam0)//Position - 0x3AD
{
if (ENTITY::DOES_ENTITY_EXIST(iParam0))
{
if (!ENTITY::IS_ENTITY_DEAD(iParam0, false))
{
return 1;
}
}
return 0;
}
void func_10()//Position - 0x3CE
{
int iVar0;
if (!Global_1579702)
{
return;
}
if (!BitTest(Local_45.f_375, 1))
{
if (Local_45.f_391 != func_18(Local_45.f_379))
{
Local_45.f_391 = func_18(Local_45.f_379);
MISC::SET_BIT(&(Local_45.f_375), 1);
}
}
else
{
if (Local_45.f_391)
{
func_17();
}
else
{
func_11();
}
if (Local_45.f_391 != func_18(Local_45.f_379))
{
Local_45.f_391 = func_18(Local_45.f_379);
iVar0 = 5;
while (iVar0 <= (func_138() - 1))
{
MISC::CLEAR_BIT(&(Local_45[iVar0 /*22*/].f_5), 0);
MISC::CLEAR_BIT(&(Local_45[iVar0 /*22*/].f_5), 1);
iVar0++;
}
}
}
}
void func_11()//Position - 0x47B
{
int iVar0;
int iVar1;
iVar1 = 0;
iVar0 = 5;
while (iVar0 <= (func_138() - 1))
{
if (func_137(&(Local_45[iVar0 /*22*/]), iVar0))
{
if (ENTITY::DOES_ENTITY_EXIST(Local_45[iVar0 /*22*/]) && (TASK::GET_SCRIPT_TASK_STATUS(Local_45[iVar0 /*22*/], joaat("SCRIPT_TASK_PERFORM_SEQUENCE")) == 1 || TASK::GET_SCRIPT_TASK_STATUS(Local_45[iVar0 /*22*/], joaat("SCRIPT_TASK_SYNCHRONIZED_SCENE")) == 1))
{
if (!BitTest(Local_45[iVar0 /*22*/].f_5, 1))
{
if (func_12(&(Local_45[iVar0 /*22*/]), 1))
{
MISC::SET_BIT(&(Local_45[iVar0 /*22*/].f_5), 1);
}
}
else
{
iVar1++;
}
}
}
else
{
iVar1++;
}
iVar0++;
}
if (iVar1 == (func_138() - 5))
{
iVar0 = 5;
while (iVar0 <= (func_138() - 1))
{
MISC::CLEAR_BIT(&(Local_45[iVar0 /*22*/].f_5), 1);
iVar0++;
}
MISC::CLEAR_BIT(&(Local_45.f_375), 1);
}
}
int func_12(var uParam0, bool bParam1)//Position - 0x55A
{
func_16(uParam0);
if (NETWORK::IS_TIME_LESS_THAN(NETWORK::GET_NETWORK_TIME(), uParam0->f_4))
{
func_15(uParam0, bParam1);
}
else
{
func_13(uParam0, bParam1);
MISC::CLEAR_BIT(&(uParam0->f_5), 0);
return 1;
}
return 0;
}
void func_13(var uParam0, bool bParam1)//Position - 0x598
{
if (ENTITY::DOES_ENTITY_EXIST(*uParam0))
{
if (bParam1)
{
ENTITY::SET_ENTITY_ALPHA(*uParam0, 255, false);
func_14(uParam0, 255);
}
else
{
ENTITY::SET_ENTITY_ALPHA(*uParam0, 0, false);
func_14(uParam0, 0);
}
}
}
void func_14(var uParam0, int iParam1)//Position - 0x5D4
{
int iVar0;
iVar0 = 0;
while (iVar0 < 2)
{
if (ENTITY::DOES_ENTITY_EXIST(uParam0->f_1[iVar0]))
{
ENTITY::SET_ENTITY_ALPHA(uParam0->f_1[iVar0], iParam1, false);
}
iVar0++;
}
}
void func_15(var uParam0, bool bParam1)//Position - 0x60C
{
int iVar0;
int iVar1;
if (ENTITY::DOES_ENTITY_EXIST(*uParam0))
{
iVar0 = MISC::ABSI(NETWORK::GET_TIME_DIFFERENCE(NETWORK::GET_NETWORK_TIME(), uParam0->f_4));
iVar1 = SYSTEM::ROUND(((SYSTEM::TO_FLOAT(iVar0) / 750f) * 255f));
if (bParam1)
{
iVar1 = (255 - SYSTEM::ROUND(((SYSTEM::TO_FLOAT(iVar0) / 750f) * 255f)));
}
ENTITY::SET_ENTITY_ALPHA(*uParam0, iVar1, false);
func_14(uParam0, iVar1);
}
}
void func_16(var uParam0)//Position - 0x67A
{
if (!BitTest(uParam0->f_5, 0))
{
uParam0->f_4 = NETWORK::GET_TIME_OFFSET(NETWORK::GET_NETWORK_TIME(), 750);
MISC::SET_BIT(&(uParam0->f_5), 0);
}
}
void func_17()//Position - 0x6A4
{
int iVar0;
int iVar1;
iVar1 = 0;
iVar0 = 5;
while (iVar0 <= (func_138() - 1))
{
if (func_137(&(Local_45[iVar0 /*22*/]), iVar0))
{
if (!BitTest(Local_45[iVar0 /*22*/].f_5, 1))
{
if (func_12(&(Local_45[iVar0 /*22*/]), 0))
{
MISC::SET_BIT(&(Local_45[iVar0 /*22*/].f_5), 1);
}
}
else
{
iVar1++;
}
}
else
{
iVar1++;
}
iVar0++;
}
if (iVar1 == (func_138() - 5))
{
iVar0 = 5;
while (iVar0 <= (func_138() - 1))
{
MISC::CLEAR_BIT(&(Local_45[iVar0 /*22*/].f_5), 1);
func_110(&(Local_45[iVar0 /*22*/]));
iVar0++;
}
MISC::CLEAR_BIT(&(Local_45.f_375), 1);
}
}
int func_18(int iParam0)//Position - 0x753
{
if (iParam0 == func_20() || !func_19(iParam0))
{
return 0;
}
return BitTest(Global_1845263[iParam0 /*877*/].f_267.f_431.f_1, 29);
}
bool func_19(int iParam0)//Position - 0x78A
{
return Global_1845263[iParam0 /*877*/].f_267.f_431 != 0;
}
int func_20()//Position - 0x7A3
{
return -1;
}
void func_21()//Position - 0x7AC
{
if (func_23())
{
if (!BitTest(Local_45.f_375, 0))
{
func_22(0);
MISC::SET_BIT(&(Local_45.f_375), 0);
}
}
else if (BitTest(Local_45.f_375, 0))
{
func_22(1);
MISC::CLEAR_BIT(&(Local_45.f_375), 0);
}
}
void func_22(bool bParam0)//Position - 0x7F1
{
int iVar0;
iVar0 = 0;
while (iVar0 < func_138())
{
if (ENTITY::DOES_ENTITY_EXIST(Local_45[iVar0 /*22*/]))
{
ENTITY::SET_ENTITY_VISIBLE(Local_45[iVar0 /*22*/], bParam0, false);
}
iVar0++;
}
}
bool func_23()//Position - 0x828
{
return BitTest(Global_1970490, 1);
}
void func_24()//Position - 0x836
{
if (Global_1579706)
{
func_22(1);
func_25(1);
Local_45.f_385 = 0;
Global_1579706 = 0;
}
else if (!Local_45.f_385)
{
if (CUTSCENE::IS_CUTSCENE_PLAYING())
{
func_22(0);
func_25(0);
Local_45.f_385 = 1;
}
}
}
void func_25(bool bParam0)//Position - 0x87D
{
if (ENTITY::DOES_ENTITY_EXIST(Local_45.f_382))
{
ENTITY::SET_ENTITY_VISIBLE(Local_45.f_382, bParam0, false);
}
if (ENTITY::DOES_ENTITY_EXIST(Local_45.f_383))
{
ENTITY::SET_ENTITY_VISIBLE(Local_45.f_383, bParam0, false);
}
if (ENTITY::DOES_ENTITY_EXIST(Local_45.f_384))
{
ENTITY::SET_ENTITY_VISIBLE(Local_45.f_384, bParam0, false);
}
}
void func_26()//Position - 0x8CD
{
int iVar0;
int iVar1;
if (!Global_1579702)
{
iVar1 = 0;
iVar0 = 0;
while (iVar0 < func_138())
{
if ((((((ENTITY::DOES_ENTITY_EXIST(Local_45[iVar0 /*22*/]) && (TASK::GET_SCRIPT_TASK_STATUS(Local_45[iVar0 /*22*/], joaat("SCRIPT_TASK_PERFORM_SEQUENCE")) == 1 || TASK::GET_SCRIPT_TASK_STATUS(Local_45[iVar0 /*22*/], joaat("SCRIPT_TASK_SYNCHRONIZED_SCENE")) == 1)) || Local_45[iVar0 /*22*/].f_17) || Local_45[iVar0 /*22*/].f_9 > Local_447.f_1) || ((Local_45.f_390 && !Local_45[iVar0 /*22*/].f_18) && !Global_1579707)) || ((!Local_45.f_390 && Local_45[iVar0 /*22*/].f_18) && !Global_1579707)) || (!func_27(iVar0) && Local_45.f_391))
{
iVar1++;
}
iVar0++;
}
if (iVar1 == func_138())
{
Global_1579702 = 1;
}
}
}
bool func_27(int iParam0)//Position - 0x9C2
{
return iParam0 <= 4;
}
void func_28(var uParam0, int iParam1)//Position - 0x9CE
{
if (func_77(iParam1, 0))
{
func_64(uParam0, iParam1);
func_29(uParam0, iParam1);
}
}
void func_29(var uParam0, int iParam1)//Position - 0x9F0
{
if (NETWORK::NETWORK_IS_HOST_OF_THIS_SCRIPT())
{
if (func_63(iParam1))
{
func_56(uParam0, iParam1);
func_39(uParam0, iParam1);
func_30(uParam0, iParam1);
}
}
}
void func_30(var uParam0, int iParam1)//Position - 0xA20
{
switch (iParam1)
{
case 0:
if (uParam0->f_8 == 11 || uParam0->f_8 == 12)
{
if (Local_447.f_13 != Global_1579712)
{
Local_447.f_13 = Global_1579712;
if (!Local_447.f_13)
{
if (func_37(uParam0, iParam1) && !func_36(iParam1, 1))
{
func_33(5, 0);
func_32(&(Local_447.f_16), 0, 0);
}
}
}
}
break;
case 2:
if ((((Local_447.f_7 == 3 && Local_45.f_386 == 4) && Global_1579711 != 0) && !func_36(2, 0)) && !BitTest(uParam0->f_5, 13))
{
if (func_31(PLAYER::PLAYER_ID()))
{
func_33(13, 2);
MISC::SET_BIT(&(uParam0->f_5), 13);
}
else
{
Global_1579711 = 0;
}
}
break;
}
}
int func_31(int iParam0)//Position - 0xAFD
{
if (iParam0 != func_20())
{
return BitTest(Global_1845263[iParam0 /*877*/].f_267.f_431.f_2, 27);
}
return 0;
}
void func_32(var uParam0, bool bParam1, bool bParam2)//Position - 0xB26
{
if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS() && !bParam1)
{
if (!bParam2)
{
*uParam0 = NETWORK::GET_NETWORK_TIME();
}
else
{
*uParam0 = NETWORK::GET_NETWORK_TIME_ACCURATE();
}
}
else
{
*uParam0 = MISC::GET_GAME_TIMER();
}
uParam0->f_1 = 1;
}
void func_33(int iParam0, int iParam1)//Position - 0xB63
{
struct<5> Var0;
int iVar5;
Var0.f_0 = -528513542;
Var0.f_1 = PLAYER::PLAYER_ID();
Var0.f_3 = iParam0;
Var0.f_4 = iParam1;
iVar5 = func_34(1);
if (!iVar5 == 0)
{
SCRIPT::_SEND_TU_SCRIPT_EVENT_NEW(1, &Var0, 5, iVar5, Var0.f_0);
}
}
var func_34(int iParam0)//Position - 0xBA4
{
var uVar0;
int iVar1;
int iVar2;
iVar1 = 0;
while (iVar1 < NETWORK::NETWORK_GET_MAX_NUM_PARTICIPANTS())
{
if (NETWORK::NETWORK_IS_PARTICIPANT_ACTIVE(PLAYER::INT_TO_PARTICIPANTINDEX(iVar1)))
{
iVar2 = NETWORK::NETWORK_GET_PLAYER_INDEX(PLAYER::INT_TO_PARTICIPANTINDEX(iVar1));
if (func_35(iVar2, 0, 0))
{
if (iVar2 != PLAYER::PLAYER_ID() || iParam0)
{
MISC::SET_BIT(&uVar0, iVar2);
}
}
}
iVar1++;
}
return uVar0;
}
int func_35(int iParam0, bool bParam1, bool bParam2)//Position - 0xC01
{
int iVar0;
iVar0 = iParam0;
if (iVar0 != -1)
{
if (NETWORK::NETWORK_IS_PLAYER_ACTIVE(iParam0))
{
if (bParam1)
{
if (!PLAYER::IS_PLAYER_PLAYING(iParam0))
{
return 0;
}
}
if (bParam2)
{
if (iVar0 == Global_2672741.f_3)
{
return Global_2672741.f_2;
}
else if (Global_2657921[iVar0 /*463*/] != 4)
{
return 0;
}
}
return 1;
}
}
return 0;
}
int func_36(int iParam0, bool bParam1)//Position - 0xC61
{
int iVar0;
iVar0 = 0;
if (func_9(Local_45[iParam0 /*22*/]))
{
if (AUDIO::IS_ANY_SPEECH_PLAYING(Local_45[iParam0 /*22*/]))
{
iVar0 = 1;
}
}
if (bParam1)
{
switch (iParam0)
{
case 0:
if ((Local_45.f_378 == iParam0 && func_7(&(Local_45.f_394))) || func_7(&(Local_447.f_24)))
{
iVar0 = 1;
}
break;
case 2:
if ((Local_45.f_378 == iParam0 && func_7(&(Local_45.f_394))) || func_7(&(Local_447.f_26)))
{
iVar0 = 1;
}
break;
case 3:
if ((Local_45.f_378 == iParam0 && func_7(&(Local_45.f_394))) || func_7(&(Local_447.f_28)))
{
iVar0 = 1;
}
break;
}
}
return iVar0;
}
int func_37(var uParam0, int iParam1)//Position - 0xD33
{
int iVar0;
int iVar1;
iVar0 = 0;
while (iVar0 < NETWORK::NETWORK_GET_MAX_NUM_PARTICIPANTS())
{
if (NETWORK::NETWORK_IS_PARTICIPANT_ACTIVE(PLAYER::INT_TO_PARTICIPANTINDEX(iVar0)))
{
iVar1 = NETWORK::NETWORK_GET_PLAYER_INDEX(PLAYER::INT_TO_PARTICIPANTINDEX(iVar0));
if (func_35(iVar1, 1, 1))
{
if (func_9(PLAYER::PLAYER_PED_ID()))
{
if (MISC::GET_DISTANCE_BETWEEN_COORDS(ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED(iVar1), true), uParam0->f_13, true) < func_38(iParam1))
{
return 1;
}
}
}
}
iVar0++;
}
return 0;
}
float func_38(int iParam0)//Position - 0xDA4
{
switch (iParam0)
{
case 0:
case 1:
return 5f;
default:
}
return 7f;
}
void func_39(var uParam0, int iParam1)//Position - 0xDC4
{
switch (iParam1)
{
case 0:
func_43(uParam0, iParam1);
break;
case 2:
func_42(uParam0, iParam1);
break;
case 3:
func_40(uParam0, iParam1);
break;
}
}
void func_40(var uParam0, int iParam1)//Position - 0xE06
{
bool bVar0;
bool bVar1;
if (func_7(&(Local_447.f_22)) && func_5(&(Local_447.f_22), Local_447.f_5, 0))
{
if (func_37(uParam0, iParam1))
{
bVar0 = true;
if (Local_447.f_7 == 3)
{
bVar0 = false;
}
if (((bVar0 && !func_36(2, 0)) && !func_36(3, 0)) || (!bVar0 && !func_36(3, 0)))
{
func_33(Local_447.f_21, 3);
bVar1 = func_41(Local_447.f_21, iParam1);
MISC::SET_BIT(&Local_447, bVar1);
func_4(&(Local_447.f_22));
Local_447.f_21 = 0;
}
else
{
func_32(&(Local_447.f_22), 0, 0);
}
}
else
{
func_32(&(Local_447.f_22), 0, 0);
}
}
}
int func_41(int iParam0, int iParam1)//Position - 0xEC5
{
switch (iParam1)
{
case 0:
switch (iParam0)
{
case 7:
return 1;
case 8:
return 2;
case 9:
return 3;
case 10:
return 4;
case 6:
return 0;
default:
}
break;
case 2:
switch (iParam0)
{
case 6:
return 5;
case 11:
return 6;
case 12:
return 7;
default:
}
break;
case 3:
switch (iParam0)
{
case 6:
return 8;
default:
}
break;
}
return -1;
}
void func_42(var uParam0, int iParam1)//Position - 0xF60
{
bool bVar0;
bool bVar1;
if (func_7(&(Local_447.f_19)) && func_5(&(Local_447.f_19), Local_447.f_4, 0))
{
if (func_37(uParam0, iParam1))
{
bVar0 = true;
if (Local_447.f_7 == 3)
{
bVar0 = false;
}
if (((bVar0 && !func_36(2, 0)) && !func_36(3, 0)) || (!bVar0 && !func_36(2, 0)))
{
func_33(Local_447.f_18, 2);
bVar1 = func_41(Local_447.f_18, iParam1);
MISC::SET_BIT(&Local_447, bVar1);
func_4(&(Local_447.f_19));
Local_447.f_18 = 0;
}
else
{
func_32(&(Local_447.f_19), 0, 0);
}
}
else
{
func_32(&(Local_447.f_19), 0, 0);
}
}
}
void func_43(var uParam0, int iParam1)//Position - 0x101F
{
bool bVar0;
bool bVar1;
if (func_7(&(Local_447.f_16)) && func_5(&(Local_447.f_16), Local_447.f_3, 0))
{
if (func_37(uParam0, iParam1))
{
if (!func_36(iParam1, 1))
{
bVar0 = true;