-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathnpc_heavyweapons.sp
3414 lines (2969 loc) · 102 KB
/
npc_heavyweapons.sp
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
//Thanks to sigsegv for his reversing work
#include <sdktools>
#include <sdkhooks>
#include <tf2_stocks>
#include <PathFollower>
#include <PathFollower_Nav>
#include <dhooks>
#include <dynamic>
#pragma newdecls required;
#define RAD2DEG(%1) ((%1) * (180.0 / FLOAT_PI))
#define DEG2RAD(%1) ((%1) * FLOAT_PI / 180.0)
#define EF_BONEMERGE (1 << 0)
#define EF_PARENT_ANIMATES (1 << 9)
#define TF_WEAPON_PRIMARY_MODE 0
#define TF_WEAPON_SECONDARY_MODE 1
//int g_iPathLaserModelIndex = -1;
ConVar g_hDebug;
ConVar g_hAimRate;
ConVar g_hHeadSteadyRate;
ConVar g_hSaccadeSpeed;
ConVar g_hHeadResettleAngle;
ConVar g_hHeadResettleTime;
ConVar g_hHeadAimSettleDuration;
char gibs[][] =
{
"models/bots/gibs/heavybot_gib_boss_head.mdl",
"models/bots/gibs/heavybot_gib_boss_arm.mdl",
"models/bots/gibs/heavybot_gib_boss_arm2.mdl",
"models/bots/gibs/heavybot_gib_boss_chest.mdl",
"models/bots/gibs/heavybot_gib_boss_leg.mdl",
"models/bots/gibs/heavybot_gib_boss_leg2.mdl",
"models/bots/gibs/heavybot_gib_boss_pelvis.mdl"
}
enum ParticleAttachment
{
PATTACH_ABSORIGIN = 0, // Create at absorigin, but don't follow
PATTACH_ABSORIGIN_FOLLOW, // Create at absorigin, and update to follow the entity
PATTACH_CUSTOMORIGIN, // Create at a custom origin, but don't follow
PATTACH_POINT, // Create on attachment point, but don't follow
PATTACH_POINT_FOLLOW, // Create on attachment point, and update to follow the entity
PATTACH_WORLDORIGIN, // Used for control points that don't attach to an entity
PATTACH_ROOTBONE_FOLLOW, // Create at the root bone of the entity, and update to follow
MAX_PATTACH_TYPES,
};
//SDKCalls
Handle g_hMyNextBotPointer;
Handle g_hGetLocomotionInterface;
Handle g_hGetBodyInterface;
Handle g_hGetVisionInterface;
Handle g_hGetPrimaryKnownThreat;
Handle g_hAddKnownEntity;
Handle g_hGetKnownEntity;
Handle g_hGetKnown;
Handle g_hUpdatePosition;
Handle g_hUpdateVisibilityStatus;
Handle g_hRun;
Handle g_hApproach;
Handle g_hFaceTowards;
Handle g_hResetSequence;
Handle g_hGetVelocity;
Handle g_hSetVelocity;
Handle g_hStudioFrameAdvance;
Handle g_hJump;
Handle g_hDispatchAnimEvents;
Handle g_hGetMaxAcceleration;
Handle g_hGetGroundSpeed;
Handle g_hGetVectors;
Handle g_hGetGroundMotionVector;
Handle g_hLookupPoseParameter;
Handle g_hSetPoseParameter;
Handle g_hGetPoseParameter;
Handle g_hLookupSequence;
Handle g_hSDKWorldSpaceCenter;
Handle g_hStudio_FindAttachment;
Handle g_hGetAttachment;
Handle g_hAddGestureSequence;
//Stuck detection
Handle g_hStuckMonitor;
Handle g_hClearStuckStatus;
Handle g_hIsStuck;
//PluginBot DHooks
Handle g_hGetEntity;
Handle g_hGetBot;
//DHooks
Handle g_hGetCurrencyValue;
Handle g_hHandleAnimEvent;
Handle g_hGetFrictionSideways;
Handle g_hGetStepHeight;
Handle g_hGetGravity;
Handle g_hGetGroundNormal;
Handle g_hShouldCollideWith;
Handle g_hGetSolidMask;
Handle g_hStartActivity;
public Plugin myinfo =
{
name = "[TF2] Heavy NPC",
author = "Pelipoika",
description = "",
version = "1.0",
url = ""
};
// Firing states.
enum
{
AC_STATE_IDLE = 0,
AC_STATE_STARTFIRING,
AC_STATE_FIRING,
AC_STATE_SPINNING,
AC_STATE_DRYFIRE
};
// LookAtPriorityType
enum
{
BORING = 0,
INTERESTING = 1,
IMPORTANT = 2,
CRITICAL = 3,
OVERRIDE_ALL = 4,
};
ArrayList arrayList;
/*
TODO:
- Make a member leaving the squad not spam a shitton of errors.
- Happens because for some reason when a squad member leaves it also deletes the m_Members array
- https://github.com/sigsegv-mvm/mvm-reversed/blob/3c60e2448fa660ab513b2c455eec33f33cedeac5/server/tf/bot/behavior/squad/tf_bot_escort_squad_leader.cpp#L45
*/
methodmap BaseNPC
{
public BaseNPC(float vecPos[3], float vecAng[3], const char[] model, const char[] modelscale = "1.0", const char[] health = "5000", bool bGroundNormal = true)
{
int npc = CreateEntityByName("base_boss");
DispatchKeyValueVector(npc, "origin", vecPos);
DispatchKeyValueVector(npc, "angles", vecAng);
DispatchKeyValue(npc, "model", model);
DispatchKeyValue(npc, "modelscale", modelscale);
DispatchKeyValue(npc, "health", health);
DispatchSpawn(npc);
CreateParticle("ghost_appearation", vecPos, vecAng);
Address pNB = SDKCall(g_hMyNextBotPointer, npc);
Address pLocomotion = SDKCall(g_hGetLocomotionInterface, pNB);
DHookRaw(g_hGetStepHeight, true, pLocomotion);
DHookRaw(g_hGetGravity, true, pLocomotion);
DHookRaw(g_hShouldCollideWith, true, pLocomotion);
DHookRaw(g_hGetMaxAcceleration, true, pLocomotion);
DHookRaw(g_hGetFrictionSideways, true, pLocomotion);
if(bGroundNormal)
DHookRaw(g_hGetGroundNormal, true, pLocomotion)
Address pBody = SDKCall(g_hGetBodyInterface, pNB);
//Collide with the correct stuff
DHookRaw(g_hGetSolidMask, true, pBody);
//Allow jumping
DHookRaw(g_hStartActivity, true, pBody);
//Don't drop money.
DHookEntity(g_hGetCurrencyValue, true, npc);
//Animevents
DHookEntity(g_hHandleAnimEvent, true, npc);
//trigger_hurts hurt and spawn doors open for us, etc.
SetEntityFlags(npc, FL_CLIENT|FL_FAKECLIENT|FL_NPC);
//Don't ResolvePlayerCollisions.
SetEntData(npc, FindSendPropInfo("CTFBaseBoss", "m_lastHealthPercentage") + 28, false, 4, true);
//Don't bleed.
SetEntProp(npc, Prop_Data, "m_bloodColor", -1);
//Play robot impact particles and death sound.
SDKHook(npc, SDKHook_OnTakeDamageAlive, OnBotDamaged);
ActivateEntity(npc);
char strName[64];
Format(strName, sizeof(strName), "basenpc_%x", EntIndexToEntRef(npc));
Dynamic brain = Dynamic();
brain.SetBool("Pathing", false);
brain.SetInt ("Weapon", INVALID_ENT_REFERENCE);
brain.SetFloat("MoveSpeed", 150.0);
brain.SetFloat("OutOfRange", 400.0);
brain.SetName(strName);
//Upper body anims
brain.SetFloat("m_flGoalFeetYaw", 0.0);
brain.SetFloat("m_flCurrentFeetYaw", 0.0);
brain.SetFloat("m_flLastAimTurnTime", 0.0);
brain.SetFloat("m_flEyeYaw", 0.0);
//Attack
brain.SetFloat("m_flNextPrimaryAttack", 0.0);
brain.SetFloat("m_flNextSecondaryAttack", 0.0);
brain.SetFloat("m_flTimeWeaponIdle", 0.0);
brain.SetInt("m_iWeaponState", AC_STATE_IDLE);
brain.SetInt("m_iMinigunSoundCur", -1);
brain.SetInt("m_iWeaponMode", TF_WEAPON_PRIMARY_MODE);
brain.SetInt("m_pMuzzleEffect", INVALID_ENT_REFERENCE);
//Head movement
brain.SetVector("m_angLastEyeAngles", NULL_VECTOR);
brain.SetVector("m_vecAimTarget", NULL_VECTOR);
brain.SetVector("m_vecTargetVelocity", NULL_VECTOR);
brain.SetVector("m_vecLastEyeVectors", NULL_VECTOR);
brain.SetFloat("m_ctAimTracking", -1.0);
brain.SetFloat("m_ctAimDuration", -1.0);
brain.SetFloat("m_ctResettle", -1.0);
brain.SetFloat("m_itAimStart", -1.0);
brain.SetFloat("m_itHeadSteady", -1.0);
brain.SetInt("m_iAimPriority", BORING);
brain.SetInt("m_hAimTarget", -1);
brain.SetBool("m_bHeadOnTarget", false);
brain.SetBool("m_bSightedIn", false);
//Squad stuff
brain.SetFloat("m_ctRecomputePath", 0.0);
brain.SetVector("m_vecLeaderGoalDirection", NULL_VECTOR);
brain.SetFloat("m_flFormationError", 0.0);
brain.SetBool("m_bIsInFormation", false);
brain.SetDynamic("m_Squad", view_as<Dynamic>(INVALID_DYNAMIC_OBJECT));
return view_as<BaseNPC>(npc);
}
property int index
{
public get()
{
return view_as<int>(this);
}
}
public Dynamic GetBrainInterface()
{
char strName[64];
Format(strName, sizeof(strName), "basenpc_%x", EntIndexToEntRef(this.index));
Dynamic brain = Dynamic.FindByName(strName);
if(!brain.IsValid)
{
AcceptEntityInput(this.index, "Kill");
}
return brain;
}
public Address GetLocomotionInterface()
{
Address pNB = SDKCall(g_hMyNextBotPointer, this.index);
return SDKCall(g_hGetLocomotionInterface, pNB);
}
public Address GetBodyInterface()
{
Address pNB = SDKCall(g_hMyNextBotPointer, this.index);
return SDKCall(g_hGetBodyInterface, pNB);
}
public Address GetVisionInterface()
{
Address pNB = SDKCall(g_hMyNextBotPointer, this.index);
return SDKCall(g_hGetVisionInterface, pNB);
}
public bool IsStuck()
{
return SDKCall(g_hIsStuck, this.GetLocomotionInterface());
}
public int GetTeam()
{
return GetEntProp(this.index, Prop_Send, "m_iTeamNum");
}
property bool Pathing
{
public get()
{
bool Pathing = false;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
Pathing = brain.GetBool("Pathing");
}
return Pathing;
}
public set(bool path)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetBool("Pathing", path);
path ? PF_StartPathing(this.index) : PF_StopPathing(this.index);
}
}
}
property int Weapon
{
public get()
{
int ent = INVALID_ENT_REFERENCE;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
ent = EntRefToEntIndex(brain.GetInt("Weapon"));
}
return ent;
}
public set(int weapon)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetInt("Weapon", EntIndexToEntRef(weapon));
}
}
}
property int m_pMuzzleEffect
{
public get()
{
int ent = INVALID_ENT_REFERENCE;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
ent = EntRefToEntIndex(brain.GetInt("m_pMuzzleEffect"));
}
return ent;
}
public set(int m_pMuzzleEffect)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetInt("m_pMuzzleEffect", EntIndexToEntRef(m_pMuzzleEffect));
}
}
}
property float MoveSpeed
{
public get()
{
float speed = 0.0;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
speed = brain.GetFloat("MoveSpeed");
}
return speed;
}
public set(float speed)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetFloat("MoveSpeed", speed);
}
}
}
property float OutOfRange
{
public get()
{
float range = 0.0;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
range = brain.GetFloat("OutOfRange");
}
return range;
}
public set(float range)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetFloat("OutOfRange", range);
}
}
}
//Weapon
property float m_flNextPrimaryAttack
{
public get()
{
float m_flNextPrimaryAttack = 0.0;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
m_flNextPrimaryAttack = brain.GetFloat("m_flNextPrimaryAttack");
}
return m_flNextPrimaryAttack;
}
public set(float m_flNextPrimaryAttack)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetFloat("m_flNextPrimaryAttack", m_flNextPrimaryAttack);
}
}
}
property float m_flNextSecondaryAttack
{
public get()
{
float m_flNextSecondaryAttack = 0.0;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
m_flNextSecondaryAttack = brain.GetFloat("m_flNextSecondaryAttack");
}
return m_flNextSecondaryAttack;
}
public set(float m_flNextSecondaryAttack)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetFloat("m_flNextSecondaryAttack", m_flNextSecondaryAttack);
}
}
}
property float m_flTimeWeaponIdle
{
public get()
{
float m_flTimeWeaponIdle = 0.0;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
m_flTimeWeaponIdle = brain.GetFloat("m_flTimeWeaponIdle");
}
return m_flTimeWeaponIdle;
}
public set(float m_flTimeWeaponIdle)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetFloat("m_flTimeWeaponIdle", m_flTimeWeaponIdle);
}
}
}
property int m_iWeaponState
{
public get()
{
int m_iWeaponState = AC_STATE_IDLE;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
m_iWeaponState = brain.GetInt("m_iWeaponState");
}
return m_iWeaponState;
}
public set(int m_iWeaponState)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetInt("m_iWeaponState", m_iWeaponState);
}
}
}
property int m_iMinigunSoundCur
{
public get()
{
int m_iMinigunSoundCur = -1;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
m_iMinigunSoundCur = brain.GetInt("m_iMinigunSoundCur");
}
return m_iMinigunSoundCur;
}
public set(int m_iMinigunSoundCur)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetInt("m_iMinigunSoundCur", m_iMinigunSoundCur);
}
}
}
property int m_iWeaponMode
{
public get()
{
int m_iWeaponMode = AC_STATE_IDLE;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
m_iWeaponMode = brain.GetInt("m_iWeaponMode");
}
return m_iWeaponMode;
}
public set(int m_iWeaponMode)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetInt("m_iWeaponMode", m_iWeaponMode);
}
}
}
//Animation
property float m_flGoalFeetYaw
{
public get()
{
float m_flGoalFeetYaw = 0.0;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
m_flGoalFeetYaw = brain.GetFloat("m_flGoalFeetYaw");
}
return m_flGoalFeetYaw;
}
public set(float m_flGoalFeetYaw)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetFloat("m_flGoalFeetYaw", m_flGoalFeetYaw);
}
}
}
property float m_flCurrentFeetYaw
{
public get()
{
float m_flCurrentFeetYaw = 0.0;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
m_flCurrentFeetYaw = brain.GetFloat("m_flCurrentFeetYaw");
}
return m_flCurrentFeetYaw;
}
public set(float m_flCurrentFeetYaw)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetFloat("m_flCurrentFeetYaw", m_flCurrentFeetYaw);
}
}
}
property float m_flLastAimTurnTime
{
public get()
{
float m_flLastAimTurnTime = 0.0;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
m_flLastAimTurnTime = brain.GetFloat("m_flLastAimTurnTime");
}
return m_flLastAimTurnTime;
}
public set(float m_flLastAimTurnTime)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetFloat("m_flLastAimTurnTime", m_flLastAimTurnTime);
}
}
}
property float m_flEyeYaw
{
public get()
{
float m_flEyeYaw = 0.0;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
m_flEyeYaw = brain.GetFloat("m_flEyeYaw");
}
return m_flEyeYaw;
}
public set(float m_flEyeYaw)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetFloat("m_flEyeYaw", m_flEyeYaw);
}
}
}
property float m_flEyePitch
{
public get()
{
float m_flEyePitch = 0.0;
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
m_flEyePitch = brain.GetFloat("m_flEyePitch");
}
return m_flEyePitch;
}
public set(float m_flEyePitch)
{
Dynamic brain = this.GetBrainInterface();
if(brain.IsValid)
{
brain.SetFloat("m_flEyePitch", m_flEyePitch);
}
}
}
public bool Getm_angLastEyeAngles(float[3] value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_angLastEyeAngles");
if (offset == INVALID_DYNAMIC_OFFSET)
SetFailState("A serious error occured in Dynamic!");
}
this.GetBrainInterface().GetVectorByOffset(offset, value);
return true;
}
public void Setm_angLastEyeAngles(const float[3] value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_angLastEyeAngles");
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().SetVector("m_angLastEyeAngles", value);
return;
}
}
this.GetBrainInterface().SetVectorByOffset(offset, value);
}
public bool Getm_vecAimTarget(float[3] value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_vecAimTarget");
if (offset == INVALID_DYNAMIC_OFFSET)
SetFailState("A serious error occured in Dynamic!");
}
this.GetBrainInterface().GetVectorByOffset(offset, value);
return true;
}
public void Setm_vecAimTarget(const float[3] value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_vecAimTarget");
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().SetVector("m_vecAimTarget", value);
return;
}
}
this.GetBrainInterface().SetVectorByOffset(offset, value);
}
public bool Getm_vecTargetVelocity(float[3] value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_vecTargetVelocity");
if (offset == INVALID_DYNAMIC_OFFSET)
SetFailState("A serious error occured in Dynamic!");
}
this.GetBrainInterface().GetVectorByOffset(offset, value);
return true;
}
public void Setm_vecTargetVelocity(const float[3] value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_vecTargetVelocity");
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().SetVector("m_vecTargetVelocity", value);
return;
}
}
this.GetBrainInterface().SetVectorByOffset(offset, value);
}
public bool Getm_vecLastEyeVectors(float[3] value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_vecLastEyeVectors");
if (offset == INVALID_DYNAMIC_OFFSET)
SetFailState("A serious error occured in Dynamic!");
}
this.GetBrainInterface().GetVectorByOffset(offset, value);
return true;
}
public void Setm_vecLastEyeVectors(const float[3] value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_vecLastEyeVectors");
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().SetVector("m_vecLastEyeVectors", value);
return;
}
}
this.GetBrainInterface().SetVectorByOffset(offset, value);
}
//Aim
property float m_ctAimTracking
{
public get()
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_ctAimTracking");
if (offset == INVALID_DYNAMIC_OFFSET)
SetFailState("A serious error occured in Dynamic!");
}
return this.GetBrainInterface().GetFloatByOffset(offset);
}
public set(float value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_ctAimTracking");
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().SetFloat("m_ctAimTracking", value);
return;
}
}
this.GetBrainInterface().SetFloatByOffset(offset, value);
}
}
property float m_ctAimDuration
{
public get()
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_ctAimDuration");
if (offset == INVALID_DYNAMIC_OFFSET)
SetFailState("A serious error occured in Dynamic!");
}
return this.GetBrainInterface().GetFloatByOffset(offset);
}
public set(float value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_ctAimDuration");
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().SetFloat("m_ctAimDuration", value);
return;
}
}
this.GetBrainInterface().SetFloatByOffset(offset, value);
}
}
property float m_ctResettle
{
public get()
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_ctResettle");
if (offset == INVALID_DYNAMIC_OFFSET)
SetFailState("A serious error occured in Dynamic!");
}
return this.GetBrainInterface().GetFloatByOffset(offset);
}
public set(float value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_ctResettle");
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().SetFloat("m_ctResettle", value);
return;
}
}
this.GetBrainInterface().SetFloatByOffset(offset, value);
}
}
property float m_itAimStart
{
public get()
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_itAimStart");
if (offset == INVALID_DYNAMIC_OFFSET)
SetFailState("A serious error occured in Dynamic!");
}
return this.GetBrainInterface().GetFloatByOffset(offset);
}
public set(float value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_itAimStart");
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().SetFloat("m_itAimStart", value);
return;
}
}
this.GetBrainInterface().SetFloatByOffset(offset, value);
}
}
property float m_itHeadSteady
{
public get()
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_itHeadSteady");
if (offset == INVALID_DYNAMIC_OFFSET)
SetFailState("A serious error occured in Dynamic!");
}
return this.GetBrainInterface().GetFloatByOffset(offset);
}
public set(float value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_itHeadSteady");
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().SetFloat("m_itHeadSteady", value);
return;
}
}
this.GetBrainInterface().SetFloatByOffset(offset, value);
}
}
property int m_iAimPriority
{
public get()
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_iAimPriority");
if (offset == INVALID_DYNAMIC_OFFSET)
SetFailState("A serious error occured in Dynamic!");
}
return this.GetBrainInterface().GetIntByOffset(offset);
}
public set(int value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_iAimPriority");
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().SetInt("m_iAimPriority", value);
return;
}
}
this.GetBrainInterface().SetIntByOffset(offset, value);
}
}
property int m_hAimTarget
{
public get()
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_hAimTarget");
if (offset == INVALID_DYNAMIC_OFFSET)
SetFailState("A serious error occured in Dynamic!");
}
return this.GetBrainInterface().GetIntByOffset(offset);
}
public set(int value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_hAimTarget");
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().SetInt("m_hAimTarget", value);
return;
}
}
this.GetBrainInterface().SetIntByOffset(offset, value);
}
}
property bool m_bHeadOnTarget
{
public get()
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_bHeadOnTarget");
if (offset == INVALID_DYNAMIC_OFFSET)
SetFailState("A serious error occured in Dynamic!");
}
return this.GetBrainInterface().GetBoolByOffset(offset);
}
public set(bool value)
{
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().GetMemberOffset("m_bHeadOnTarget");
if (offset == INVALID_DYNAMIC_OFFSET)
{
offset = this.GetBrainInterface().SetBool("m_bHeadOnTarget", value);
return;
}
}
this.GetBrainInterface().SetBoolByOffset(offset, value);
}