forked from root-cause/v-decompiled-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
am_hold_up.c
21825 lines (19848 loc) · 506 KB
/
am_hold_up.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;
var uLocal_19 = 0;
var uLocal_20 = 0;
float fLocal_21 = 0f;
float fLocal_22 = 0f;
float fLocal_23 = 0f;
var uLocal_24 = 0;
var uLocal_25 = 0;
float fLocal_26 = 0f;
var uLocal_27 = 0;
var uLocal_28 = 0;
var uLocal_29 = 0;
float fLocal_30 = 0f;
float fLocal_31 = 0f;
var uLocal_32 = 0;
var uLocal_33 = 0;
int iLocal_34 = 0;
var uLocal_35 = 0;
var uLocal_36 = 0;
var uLocal_37 = 0;
int iLocal_38 = 0;
int iLocal_39 = 0;
int iLocal_40 = 0;
int iLocal_41 = 0;
var uLocal_42 = 0;
var uLocal_43 = 0;
var uLocal_44 = 0;
var uLocal_45 = 0;
var uLocal_46 = 0;
var uLocal_47 = 0;
var uLocal_48 = 0;
var uLocal_49 = 0;
var uLocal_50 = 0;
var uLocal_51 = 0;
var uLocal_52 = 0;
var uLocal_53 = 0;
var uLocal_54 = 0;
var uLocal_55 = 0;
var uLocal_56 = 0;
var uLocal_57 = 0;
var uLocal_58 = 0;
var uLocal_59 = 0;
var uLocal_60 = 0;
float fLocal_61 = 0f;
var uLocal_62 = 0;
var uLocal_63 = 0;
var uLocal_64 = 0;
var uLocal_65 = 0;
var uLocal_66 = 0;
var uLocal_67 = 0;
var uLocal_68 = 0;
var uLocal_69 = 0;
var uLocal_70 = 0;
var uLocal_71 = 0;
var uLocal_72 = 0;
var uLocal_73 = 0;
var uLocal_74 = 0;
var uLocal_75 = 0;
var uLocal_76 = 0;
var uLocal_77 = 0;
var uLocal_78 = 0;
var uLocal_79 = 0;
var uLocal_80 = 0;
var uLocal_81 = 0;
var uLocal_82 = 0;
var uLocal_83 = 0;
var uLocal_84 = 0;
var uLocal_85 = 0;
var uLocal_86 = 0;
var uLocal_87 = 0;
struct<75> Local_88 = { 0, 0, 3, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1101004800, 0 } ;
struct<10> Local_163[32];
struct<54> Local_484 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0 } ;
var uLocal_538 = 0;
var uLocal_539 = 0;
int iLocal_540 = 0;
char* sLocal_541 = NULL;
int iLocal_542 = 0;
struct<3> Local_543 = { 0, 0, 0 } ;
struct<3> Local_546 = { 0, 0, 0 } ;
float fLocal_549 = 0f;
int iLocal_550 = 0;
struct<3> Local_551 = { 0, 0, 0 } ;
struct<3> Local_554 = { 0, 0, 0 } ;
int iLocal_557 = 0;
var uLocal_558 = 0;
int iLocal_559 = 0;
int iLocal_560 = 0;
int iLocal_561 = 0;
int iLocal_562 = 0;
int iLocal_563 = 0;
int iLocal_564 = 0;
int iLocal_565 = 0;
int iLocal_566 = 0;
struct<3> Local_567 = { 0, 0, 0 } ;
float fLocal_570 = 0f;
struct<3> Local_571 = { 0, 0, 0 } ;
float fLocal_574 = 0f;
int iLocal_575 = 0;
int iLocal_576 = 0;
int iLocal_577 = 0;
int iLocal_578 = 0;
var uLocal_579 = 0;
var uLocal_580 = 0;
var uLocal_581 = 0;
var uLocal_582 = 0;
int iLocal_583 = 0;
int iLocal_584 = 0;
int iLocal_585 = 0;
int iLocal_586 = 0;
struct<3> Local_587 = { 0, 0, 0 } ;
struct<3> Local_590 = { 0, 0, 0 } ;
struct<3> Local_593 = { 0, 0, 0 } ;
struct<3> Local_596 = { 0, 0, 0 } ;
float fLocal_599 = 0f;
struct<3> Local_600 = { 0, 0, 0 } ;
struct<3> Local_603 = { 0, 0, 0 } ;
float fLocal_606 = 0f;
var uLocal_607 = 16;
var uLocal_608 = 0;
var uLocal_609 = 0;
var uLocal_610 = 0;
var uLocal_611 = 0;
var uLocal_612 = 0;
var uLocal_613 = 0;
var uLocal_614 = 0;
var uLocal_615 = 0;
var uLocal_616 = 0;
var uLocal_617 = 0;
var uLocal_618 = 0;
var uLocal_619 = 0;
var uLocal_620 = 0;
var uLocal_621 = 0;
var uLocal_622 = 0;
var uLocal_623 = 0;
var uLocal_624 = 0;
var uLocal_625 = 0;
var uLocal_626 = 0;
var uLocal_627 = 0;
var uLocal_628 = 0;
var uLocal_629 = 0;
var uLocal_630 = 0;
var uLocal_631 = 0;
var uLocal_632 = 0;
var uLocal_633 = 0;
var uLocal_634 = 0;
var uLocal_635 = 0;
var uLocal_636 = 0;
var uLocal_637 = 0;
var uLocal_638 = 0;
var uLocal_639 = 0;
var uLocal_640 = 0;
var uLocal_641 = 0;
var uLocal_642 = 0;
var uLocal_643 = 0;
var uLocal_644 = 0;
var uLocal_645 = 0;
var uLocal_646 = 0;
var uLocal_647 = 0;
var uLocal_648 = 0;
var uLocal_649 = 0;
var uLocal_650 = 0;
var uLocal_651 = 0;
var uLocal_652 = 0;
var uLocal_653 = 0;
var uLocal_654 = 0;
var uLocal_655 = 0;
var uLocal_656 = 0;
var uLocal_657 = 0;
var uLocal_658 = 0;
var uLocal_659 = 0;
var uLocal_660 = 0;
var uLocal_661 = 0;
var uLocal_662 = 0;
var uLocal_663 = 0;
var uLocal_664 = 0;
var uLocal_665 = 0;
var uLocal_666 = 0;
var uLocal_667 = 0;
var uLocal_668 = 0;
var uLocal_669 = 0;
var uLocal_670 = 0;
var uLocal_671 = 0;
var uLocal_672 = 0;
var uLocal_673 = 0;
var uLocal_674 = 0;
var uLocal_675 = 0;
var uLocal_676 = 0;
var uLocal_677 = 0;
var uLocal_678 = 0;
var uLocal_679 = 0;
var uLocal_680 = 0;
var uLocal_681 = 0;
var uLocal_682 = 0;
var uLocal_683 = 0;
var uLocal_684 = 0;
var uLocal_685 = 0;
var uLocal_686 = 0;
var uLocal_687 = 0;
var uLocal_688 = 0;
var uLocal_689 = 0;
var uLocal_690 = 0;
var uLocal_691 = 0;
var uLocal_692 = 0;
var uLocal_693 = 0;
var uLocal_694 = 0;
var uLocal_695 = 0;
var uLocal_696 = 0;
var uLocal_697 = 0;
var uLocal_698 = 0;
var uLocal_699 = 0;
var uLocal_700 = 0;
var uLocal_701 = 0;
var uLocal_702 = 0;
var uLocal_703 = 0;
var uLocal_704 = 0;
var uLocal_705 = 0;
var uLocal_706 = 0;
var uLocal_707 = 0;
var uLocal_708 = 0;
var uLocal_709 = 0;
var uLocal_710 = 0;
var uLocal_711 = 0;
var uLocal_712 = 0;
var uLocal_713 = 0;
var uLocal_714 = 0;
var uLocal_715 = 0;
var uLocal_716 = 0;
var uLocal_717 = 0;
var uLocal_718 = 0;
var uLocal_719 = 0;
var uLocal_720 = 0;
var uLocal_721 = 0;
var uLocal_722 = 0;
var uLocal_723 = 0;
var uLocal_724 = 0;
var uLocal_725 = 0;
var uLocal_726 = 0;
var uLocal_727 = 0;
var uLocal_728 = 0;
var uLocal_729 = 0;
var uLocal_730 = 0;
var uLocal_731 = 0;
var uLocal_732 = 0;
var uLocal_733 = 0;
var uLocal_734 = 0;
var uLocal_735 = 0;
var uLocal_736 = 0;
var uLocal_737 = 0;
var uLocal_738 = 0;
var uLocal_739 = 0;
var uLocal_740 = 0;
var uLocal_741 = 0;
var uLocal_742 = 0;
var uLocal_743 = 0;
var uLocal_744 = 0;
var uLocal_745 = 0;
var uLocal_746 = 0;
var uLocal_747 = 0;
var uLocal_748 = 0;
var uLocal_749 = 0;
var uLocal_750 = 0;
var uLocal_751 = 0;
var uLocal_752 = 0;
var uLocal_753 = 0;
var uLocal_754 = 0;
var uLocal_755 = 0;
var uLocal_756 = 0;
var uLocal_757 = 0;
var uLocal_758 = 0;
var uLocal_759 = 0;
var uLocal_760 = 0;
var uLocal_761 = 0;
var uLocal_762 = 0;
var uLocal_763 = 0;
var uLocal_764 = 0;
var uLocal_765 = 0;
var uLocal_766 = 0;
var uLocal_767 = 0;
var uLocal_768 = 0;
var uLocal_769 = 0;
var uLocal_770 = 0;
var uLocal_771 = 0;
int iLocal_772[5] = { 0, 0, 0, 0, 0 };
int iLocal_778[5] = { 0, 0, 0, 0, 0 };
float fLocal_784 = 0f;
var uLocal_785 = 0;
var uLocal_786 = 0;
var uLocal_787 = 0;
var uLocal_788 = 0;
var uLocal_789 = 0;
var uLocal_790 = 0;
var uLocal_791 = 0;
var uLocal_792 = 0;
var uLocal_793 = 0;
var uLocal_794 = 0;
var uLocal_795 = 0;
var uLocal_796 = 0;
var uLocal_797 = 0;
var uLocal_798 = 0;
int iLocal_799 = 0;
int iLocal_800 = 0;
int iLocal_801 = 0;
int iLocal_802 = 0;
int iLocal_803 = 0;
int iLocal_804 = 0;
int iLocal_805 = 0;
int iLocal_806 = 0;
int iLocal_807 = 0;
struct<3> Local_808 = { 0, 0, 0 } ;
struct<21> ScriptParam_0 = { 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, -1 } ;
#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";
fLocal_21 = 80f;
fLocal_22 = 140f;
fLocal_23 = 180f;
fLocal_26 = 0f;
fLocal_30 = -0.0375f;
fLocal_31 = 0.17f;
iLocal_34 = 3;
iLocal_38 = 1;
iLocal_39 = 65;
iLocal_40 = 49;
iLocal_41 = 64;
fLocal_61 = ((0.05f + 0.275f) - 0.01f);
iLocal_542 = joaat("MP_M_ShopKeep_01");
iLocal_550 = -1;
iLocal_557 = -1;
iLocal_575 = joaat("prop_till_01");
iLocal_576 = SYSTEM::ROUND(Global_262145.f_2432 /* Tunable: LOW_HOLD_UPS_MODIFIER */);
iLocal_577 = SYSTEM::ROUND(Global_262145.f_2428 /* Tunable: HIGH_HOLD_UPS_MODIFIER */) + 1;
iLocal_578 = 1;
if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS())
{
if (!func_485(ScriptParam_0))
{
func_480();
}
if (func_479(1))
{
func_466(PLAYER::PLAYER_ID(), 0, 98816, 0);
}
}
while (true)
{
func_465();
if (func_457())
{
func_480();
}
func_446();
if (BitTest(Local_88.f_25, 6))
{
if (func_479(1))
{
func_466(PLAYER::PLAYER_ID(), 1, 0, 0);
func_443();
MISC::CLEAR_BIT(&(Local_484.f_53), 7);
func_442();
}
}
switch (func_441(NETWORK::PARTICIPANT_ID_TO_INT()))
{
case 0:
STREAMING::REQUEST_ANIM_DICT("mp_am_hold_up");
if (STREAMING::HAS_ANIM_DICT_LOADED("mp_am_hold_up"))
{
if (func_431())
{
GRAPHICS::REQUEST_STREAMED_TEXTURE_DICT(func_430(Local_484.f_0), false);
if (NETWORK::NETWORK_DOES_NETWORK_ID_EXIST(Local_88.f_0))
{
if (func_429() > 0)
{
if (!func_428(Local_88.f_0))
{
func_427(&uLocal_607, 3, NETWORK::NET_TO_PED(Local_88.f_0), &(Local_88.f_48), 1, 0);
func_426();
}
MISC::SET_BIT(&(Local_484.f_52), 22);
Global_1977840 = Local_484.f_0;
Local_163[NETWORK::PARTICIPANT_ID_TO_INT() /*10*/].f_4 = 2;
}
}
}
}
if (func_429() == 6)
{
Local_163[NETWORK::PARTICIPANT_ID_TO_INT() /*10*/].f_4 = 5;
}
break;
case 2:
func_274(&Local_484, Local_551, Local_554, &Local_88, &(Local_163[NETWORK::PARTICIPANT_ID_TO_INT() /*10*/]), ENTITY::IS_ENTITY_IN_ANGLED_AREA(NETWORK::NET_TO_PED(Local_88.f_0), Local_600, Local_603, fLocal_606, false, true, 0), 0);
func_267();
if (func_429() == 2)
{
func_136();
}
else if (func_429() == 6)
{
Local_163[NETWORK::PARTICIPANT_ID_TO_INT() /*10*/].f_4 = 5;
}
if (!ENTITY::IS_ENTITY_AT_COORD(PLAYER::PLAYER_PED_ID(), Local_590, 30f, 30f, 30f, false, true, 0))
{
Local_163[NETWORK::PARTICIPANT_ID_TO_INT() /*10*/].f_4 = 6;
}
break;
case 5:
func_135(&(Local_88.f_71));
if (func_134(&(Local_88.f_71)))
{
Local_163[NETWORK::PARTICIPANT_ID_TO_INT() /*10*/].f_4 = 6;
}
break;
case 4:
Local_163[NETWORK::PARTICIPANT_ID_TO_INT() /*10*/].f_4 = 6;
case 6:
func_55();
func_480();
break;
}
if (NETWORK::NETWORK_IS_HOST_OF_THIS_SCRIPT())
{
switch (func_429())
{
case 0:
if (!BitTest(Local_484.f_52, 16))
{
func_53(func_54(0));
func_53(func_54(1));
func_53(func_54(2));
STREAMING::REQUEST_ANIM_DICT("mp_am_hold_up");
if (STREAMING::HAS_ANIM_DICT_LOADED("mp_am_hold_up"))
{
if (func_431())
{
MISC::CLEAR_AREA(Local_551, 1.5f, false, true, false, true);
MISC::CLEAR_AREA(Local_546, 1.5f, false, true, false, true);
MISC::SET_BIT(&(Local_484.f_52), 16);
}
}
}
else if (func_51())
{
Local_88.f_13 = 2;
}
break;
case 2:
func_50();
func_47();
func_31();
func_30();
func_23();
func_22();
func_13();
func_12();
if (func_4())
{
func_1();
Local_88.f_13 = 6;
}
break;
case 6:
func_1();
break;
}
}
}
}
void func_1()//Position - 0x397
{
if (NETWORK::NETWORK_DOES_NETWORK_ID_EXIST(Local_88.f_14))
{
if (func_3(Local_88.f_14))
{
if (ENTITY::IS_ENTITY_ATTACHED(NETWORK::NET_TO_OBJ(Local_88.f_14)))
{
ENTITY::DETACH_ENTITY(NETWORK::NET_TO_OBJ(Local_88.f_14), true, true);
func_2(&(Local_88.f_14));
}
}
}
}
void func_2(var uParam0)//Position - 0x3DA
{
int iVar0;
if (NETWORK::NETWORK_DOES_ENTITY_EXIST_WITH_NETWORK_ID(*uParam0))
{
iVar0 = NETWORK::NET_TO_ENT(*uParam0);
ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&iVar0);
}
}
int func_3(int iParam0)//Position - 0x3FE
{
if (NETWORK::NETWORK_DOES_NETWORK_ID_EXIST(iParam0))
{
NETWORK::NETWORK_REQUEST_CONTROL_OF_NETWORK_ID(iParam0);
return NETWORK::NETWORK_HAS_CONTROL_OF_NETWORK_ID(iParam0);
}
return 0;
}
int func_4()//Position - 0x420
{
if (func_5())
{
return 1;
}
return 0;
}
int func_5()//Position - 0x434
{
if (BitTest(Local_88.f_25, 2))
{
return 1;
}
if (BitTest(Local_88.f_25, 3))
{
return 1;
}
if (!func_11())
{
if ((BitTest(Local_88.f_25, 11) || BitTest(Local_88.f_25, 19)) || (BitTest(Local_88.f_25, 9) && !BitTest(Local_88.f_25, 20)))
{
func_6(Local_484.f_50, 1, func_7());
return 1;
}
if (BitTest(Local_88.f_25, 18))
{
func_6(Local_484.f_50, 1, func_7());
return 1;
}
}
if (BitTest(Local_88.f_25, 18))
{
if (!BitTest(Local_88.f_26, 7))
{
func_6(Local_484.f_50, 1, func_7());
MISC::SET_BIT(&(Local_88.f_26), 7);
}
}
return 0;
}
void func_6(var uParam0, int iParam1, int iParam2)//Position - 0x4E9
{
struct<5> Var0;
Var0.f_0 = 1925046697;
Var0.f_1 = PLAYER::PLAYER_ID();
Var0.f_3 = uParam0;
Var0.f_4 = iParam1;
if (!iParam2 == 0)
{
SCRIPT::_SEND_TU_SCRIPT_EVENT_NEW(1, &Var0, 5, iParam2, Var0.f_0);
}
}
int func_7()//Position - 0x523
{
return func_8(NETWORK::NETWORK_GET_HOST_OF_SCRIPT(func_10(), -1, 0));
}
int func_8(int iParam0)//Position - 0x539
{
var uVar0;
if (func_9(iParam0))
{
MISC::SET_BIT(&uVar0, iParam0);
}
return uVar0;
}
int func_9(var uParam0)//Position - 0x554
{
int iVar0;
iVar0 = uParam0;
if (iVar0 < 0)
{
return 0;
}
if (iVar0 >= 32)
{
return 0;
}
return 1;
}
char* func_10()//Position - 0x576
{
switch (Global_2698640)
{
case 0:
return "freemode";
default:
}
return "freemode";
}
int func_11()//Position - 0x596
{
if ((BitTest(Local_88.f_25, 13) || BitTest(Local_88.f_25, 27)) || BitTest(Local_88.f_25, 28))
{
return 1;
}
return 0;
}
void func_12()//Position - 0x5C7
{
var uVar0;
if (!BitTest(Local_88.f_25, 21))
{
if (func_428(Local_88.f_0))
{
Local_88.f_74 = NETWORK::NETWORK_GET_DESTROYER_OF_NETWORK_ID(Local_88.f_0, &uVar0);
MISC::SET_BIT(&(Local_88.f_25), 21);
}
}
if (!BitTest(Local_88.f_25, 19))
{
if (BitTest(Local_88.f_25, 10) && Local_88.f_39 <= 0f)
{
MISC::SET_BIT(&(Local_88.f_25), 19);
}
}
if (!BitTest(Local_88.f_26, 17))
{
if (BitTest(Local_88.f_25, 20))
{
if (func_3(Local_88.f_14))
{
OBJECT::PREVENT_COLLECTION_OF_PORTABLE_PICKUP(NETWORK::NET_TO_OBJ(Local_88.f_14), false, false);
MISC::SET_BIT(&(Local_88.f_26), 17);
}
}
}
if (!BitTest(Local_88.f_25, 6))
{
if (Global_2738587.f_8 == 1)
{
MISC::SET_BIT(&(Local_88.f_25), 6);
MISC::SET_BIT(&(Local_88.f_25), 16);
}
}
}
int func_13()//Position - 0x682
{
int iVar0;
int iVar1;
if (!NETWORK::NETWORK_IS_HOST_OF_THIS_SCRIPT() || !BitTest(Local_88.f_27, 0))
{
return 0;
}
if (Local_88.f_68 != 6)
{
if (Local_88.f_68 > 0 && func_428(Local_88.f_16))
{
Local_88.f_68 = 6;
return 0;
}
switch (Local_88.f_68)
{
case 0:
if (!func_20(&uLocal_797, 10000, 0))
{
iVar0 = PED::GET_RANDOM_PED_AT_COORD(Local_600, 20f, 20f, 20f, -1);
if (!PED::IS_PED_INJURED(iVar0))
{
if (!ENTITY::IS_ENTITY_A_MISSION_ENTITY(iVar0))
{
iVar1 = ENTITY::GET_ENTITY_MODEL(iVar0);
if (((((((iVar1 != joaat("MP_M_Freemode_01") && iVar1 != joaat("MP_F_Freemode_01")) && !PED::IS_COP_PED_IN_AREA_3D(Local_600, 25f, 25f, 25f)) && !ENTITY::IS_ENTITY_AT_COORD(iVar0, Local_587, 1f, 1f, 2f, false, true, 0)) && !WEAPON::IS_PED_ARMED(iVar0, 7)) && !PED::IS_PED_IN_ANY_VEHICLE(iVar0, true)) && PED::IS_PED_HUMAN(iVar0)) && func_18(iVar1))
{
NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(iVar0);
if (NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(iVar0))
{
if (func_17(&(Local_88.f_16), iVar0, 1, 0))
{
WEAPON::GIVE_DELAYED_WEAPON_TO_PED(NETWORK::NET_TO_PED(Local_88.f_16), joaat("WEAPON_PISTOL"), 25000, false);
PED::SET_PED_KEEP_TASK(NETWORK::NET_TO_PED(Local_88.f_16), true);
Local_88.f_68 = 1;
MISC::SET_BIT(&(Local_88.f_27), 1);
PED::SET_PED_RELATIONSHIP_GROUP_HASH(NETWORK::NET_TO_PED(Local_88.f_16), Global_1837296);
PED::SET_PED_COMBAT_MOVEMENT(NETWORK::NET_TO_PED(Local_88.f_16), 2);
ENTITY::SET_ENTITY_HEALTH(NETWORK::NET_TO_PED(Local_88.f_16), SYSTEM::ROUND((200f * Global_262145.f_165 /* Tunable: AI_HEALTH */)), 0, 0);
func_427(&uLocal_607, 4, NETWORK::NET_TO_PED(Local_88.f_16), "StoreHero", 1, 0);
TASK::TASK_START_SCENARIO_IN_PLACE(NETWORK::NET_TO_PED(Local_88.f_16), func_16(), 0, true);
}
}
}
}
}
}
break;
case 1:
if ((BitTest(Local_88.f_25, 9) || BitTest(Local_88.f_25, 5)) || BitTest(Local_88.f_25, 4))
{
Local_88.f_68 = 2;
}
break;
case 2:
if (func_20(&(Local_88.f_69), 3000, 0) || (TASK::GET_SCRIPT_TASK_STATUS(NETWORK::NET_TO_PED(Local_88.f_16), joaat("SCRIPT_TASK_GO_TO_ENTITY")) != 0 && TASK::GET_SCRIPT_TASK_STATUS(NETWORK::NET_TO_PED(Local_88.f_16), joaat("SCRIPT_TASK_GO_TO_ENTITY")) != 1))
{
func_15(&(Local_88.f_69));
Local_88.f_68 = 3;
}
break;
case 3:
if (((BitTest(Local_88.f_25, 5) || BitTest(Local_88.f_27, 8)) || BitTest(Local_88.f_27, 9)) || func_20(&(Local_88.f_69), 5000, 0))
{
if (func_14() || func_20(&(Local_88.f_69), 5000, 0))
{
Local_88.f_68 = 4;
}
else
{
Local_88.f_68 = 5;
}
}
break;
case 4:
break;
case 5:
break;
}
}
return 1;
}
int func_14()//Position - 0x94D
{
if (BitTest(MISC::GET_RANDOM_INT_IN_RANGE(0, 65535), 0))
{
return 1;
}
return 0;
}
void func_15(var uParam0)//Position - 0x96B
{
uParam0->f_1 = 0;
}
char* func_16()//Position - 0x978
{
int iVar0;
iVar0 = MISC::GET_RANDOM_INT_IN_RANGE(0, 100);
if (iVar0 < 30)
{
return "WORLD_HUMAN_SMOKING";
}
if (iVar0 >= 30 && iVar0 < 70)
{
return "WORLD_HUMAN_HANG_OUT_STREET";
}
return "WORLD_HUMAN_STAND_MOBILE";
}
int func_17(var uParam0, int iParam1, bool bParam2, bool bParam3)//Position - 0x9B7
{
ENTITY::SET_ENTITY_AS_MISSION_ENTITY(iParam1, bParam2, bParam3);
*uParam0 = NETWORK::NETWORK_GET_NETWORK_ID_FROM_ENTITY(iParam1);
if (NETWORK::NETWORK_DOES_NETWORK_ID_EXIST(*uParam0))
{
if (bParam2)
{
NETWORK::SET_NETWORK_ID_EXISTS_ON_ALL_MACHINES(*uParam0, true);
}
return 1;
}
return 0;
}
int func_18(int iParam0)//Position - 0x9EE
{
if (((((((((((((((((((((((((((((((((((((((((((((((((((((((iParam0 == joaat("MP_M_Freemode_01") || iParam0 == joaat("MP_M_FIBSec_01")) || iParam0 == joaat("MP_S_M_Armoured_01")) || iParam0 == joaat("S_F_Y_AirHostess_01")) || iParam0 == joaat("S_F_Y_Baywatch_01")) || iParam0 == joaat("S_F_Y_Cop_01")) || iParam0 == joaat("S_F_Y_Ranger_01")) || iParam0 == joaat("S_F_Y_Scrubs_01")) || iParam0 == joaat("S_F_Y_Sheriff_01")) || iParam0 == joaat("S_M_M_Armoured_01")) || iParam0 == joaat("S_M_M_Armoured_02")) || iParam0 == joaat("S_M_M_Bouncer_01")) || iParam0 == joaat("S_M_M_CIASec_01")) || iParam0 == joaat("S_M_M_ChemSec_01")) || iParam0 == joaat("S_M_M_Doctor_01")) || iParam0 == joaat("S_M_M_FIBOffice_01")) || iParam0 == joaat("S_M_M_FIBOffice_02")) || iParam0 == joaat("S_M_M_HighSec_01")) || iParam0 == joaat("S_M_M_HighSec_02")) || iParam0 == joaat("S_M_M_Janitor")) || iParam0 == joaat("S_M_M_LSMetro_01")) || iParam0 == joaat("S_M_M_Marine_01")) || iParam0 == joaat("S_M_M_Marine_02")) || iParam0 == joaat("S_M_M_Paramedic_01")) || iParam0 == joaat("S_M_M_Pilot_01")) || iParam0 == joaat("S_M_M_Pilot_02")) || iParam0 == joaat("S_M_M_Postal_01")) || iParam0 == joaat("S_M_M_Postal_02")) || iParam0 == joaat("S_M_M_PrisGuard_01")) || iParam0 == joaat("S_M_M_Scientist_01")) || iParam0 == joaat("S_M_M_Security_01")) || iParam0 == joaat("S_M_M_UPS_01")) || iParam0 == joaat("S_M_M_UPS_02")) || iParam0 == joaat("S_M_Y_AirWorker")) || iParam0 == joaat("S_M_Y_ArmyMech_01")) || iParam0 == joaat("S_M_Y_BayWatch_01")) || iParam0 == joaat("S_M_Y_BlackOps_01")) || iParam0 == joaat("S_M_Y_BlackOps_02")) || iParam0 == joaat("S_M_Y_Cop_01")) || iParam0 == joaat("S_M_Y_Doorman_01")) || iParam0 == joaat("S_M_Y_Fireman_01")) || iParam0 == joaat("S_M_Y_Garbage")) || iParam0 == joaat("S_M_Y_HwayCop_01")) || iParam0 == joaat("S_M_Y_Marine_01")) || iParam0 == joaat("S_M_Y_Marine_02")) || iParam0 == joaat("S_M_Y_Marine_03")) || iParam0 == joaat("S_M_Y_Pilot_01")) || iParam0 == joaat("S_M_Y_Ranger_01")) || iParam0 == joaat("S_M_Y_Sheriff_01")) || iParam0 == joaat("S_M_Y_Swat_01")) || iParam0 == joaat("S_M_Y_USCG_01")) || iParam0 == joaat("S_M_Y_Valet_01")) || iParam0 == joaat("S_M_Y_Waiter_01")) || iParam0 == joaat("U_M_M_JewelSec_01")) || iParam0 == joaat("S_M_Y_Casino_01")) || func_19(iParam0))
{
return 0;
}
return 1;
}
int func_19(int iParam0)//Position - 0xD06
{
switch (iParam0)
{
case joaat("A_C_Boar"):
case joaat("A_C_Cat_01"):
case joaat("A_C_Chickenhawk"):
case joaat("A_C_Chimp"):
case joaat("A_C_Chimp_02"):
case joaat("A_C_Chop"):
case joaat("A_C_Cormorant"):
case joaat("A_C_Cow"):
case joaat("A_C_Coyote"):
case joaat("A_C_Crow"):
case joaat("A_C_Deer"):
case joaat("A_C_Dolphin"):
case joaat("A_C_Fish"):
case joaat("A_C_Hen"):
case joaat("A_C_HumpBack"):
case joaat("A_C_Husky"):
case joaat("A_C_KillerWhale"):
case joaat("A_C_MtLion"):
case joaat("A_C_Pig"):
case joaat("A_C_Pigeon"):
case joaat("A_C_Poodle"):
case joaat("A_C_Pug"):
case joaat("A_C_Rabbit_01"):
case joaat("A_C_Rabbit_02"):
case joaat("A_C_Rat"):
case joaat("A_C_Retriever"):
case joaat("A_C_Rhesus"):
case joaat("A_C_Rottweiler"):
case joaat("A_C_Seagull"):
case joaat("A_C_SharkHammer"):
case joaat("A_C_SharkTiger"):
case joaat("A_C_shepherd"):
case joaat("A_C_Stingray"):
case joaat("A_C_Westy"):
case joaat("IG_Orleans"):
return 1;
default:
}
return 0;
}
int func_20(var uParam0, int iParam1, bool bParam2)//Position - 0xDEC
{
if (iParam1 == -1)
{
return 1;
}
func_21(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_21(var uParam0, bool bParam1, bool bParam2)//Position - 0xE4A
{
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;
}
}
void func_22()//Position - 0xE8F
{
if (Local_88.f_32 == 0)
{
if (Local_88.f_3 >= 2 && Local_88.f_3 != 9)
{
Local_88.f_32 = EVENT::ADD_SHOCKING_EVENT_FOR_ENTITY(101 /*EVENT_SHOCKING_MUGGING*/, PLAYER::PLAYER_PED_ID(), 60000f);
}
}
}
void func_23()//Position - 0xEC7
{
float fVar0;
float fVar1;
float fVar2;
if (!BitTest(Local_88.f_1, 5))
{
if (Local_88.f_43 > 0)
{
func_27();
if (!BitTest(Local_88.f_1, 5))
{
return;
}
}
}
if (BitTest(Local_88.f_1, 1))
{
if (Local_88.f_2 == 3 && !BitTest(Local_88.f_25, 9))
{
Local_88.f_2 = 0;
}
MISC::CLEAR_BIT(&(Local_88.f_1), 1);
}
switch (Local_88.f_2)
{
case 0:
if ((((func_3(Local_88.f_0) && !func_428(Local_88.f_0)) && func_3(Local_88.f_17[Local_88.f_28])) && Local_88.f_3 != 8) && Local_88.f_3 != 7)
{
if (!PED::IS_PED_RAGDOLL(NETWORK::NET_TO_PED(Local_88.f_0)))
{
if (BitTest(Local_88.f_25, 9) || BitTest(Local_88.f_1, 4))
{
Local_88.f_2 = 2;
return;
}
if (!iLocal_540)
{
TASK::TASK_ACHIEVE_HEADING(NETWORK::NET_TO_PED(Local_88.f_0), Local_88.f_44, 1600);
iLocal_540 = 1;
}
if (func_20(&uLocal_787, 100, 0))
{
fVar0 = ENTITY::GET_ENTITY_HEADING(NETWORK::NET_TO_PED(Local_88.f_0));
fVar1 = (Local_88.f_44 - 10f);
fVar2 = (Local_88.f_44 + 10f);
if (fVar1 < 0f)
{
fVar2 = ((Local_88.f_44 - 10f) + 360f);
fVar1 = ((Local_88.f_44 + 10f) + 360f);
}
else if (fVar2 >= 360f)
{
fVar2 = ((Local_88.f_44 - 10f) - 360f);
fVar1 = ((Local_88.f_44 + 10f) - 360f);
}
if (((fVar0 < fVar2 && fVar0 > fVar1) && func_20(&uLocal_793, 1000, 0)) || func_20(&uLocal_793, 3125, 0))
{