/
LibAMGT.galaxy
1908 lines (1660 loc) · 84.3 KB
/
LibAMGT.galaxy
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
include "TriggerLibs/NativeLib"
include "TriggerLibs/HeroesLib"
include "TriggerLibs/GameLib"
include "TriggerLibs/MapMechanicsLib"
include "TriggerLibs/AILib"
include "TriggerLibs/UILib"
include "TriggerLibs/StartingExperienceLib"
include "TriggerLibs/SoundLib"
include "LibAREN"
include "LibAMGT_h"
//--------------------------------------------------------------------------------------------------
// Library: ARM_GardenTerror
//--------------------------------------------------------------------------------------------------
// External Library Initialization
void libAMGT_InitLibraries () {
libNtve_InitVariables();
libCore_InitVariables();
libGame_InitVariables();
libMapM_InitVariables();
libAIAI_InitVariables();
libUIUI_InitVariables();
libStEx_InitVariables();
libSond_InitVariables();
libAREN_InitVariables();
}
// Variable Initialization
bool libAMGT_InitVariables_completed = false;
void libAMGT_InitVariables () {
int init_i;
int init_i1;
if (libAMGT_InitVariables_completed) {
return;
}
libAMGT_InitVariables_completed = true;
for (init_i = 0; init_i <= libAREN_gv_aRM_MechanicsCountToPick_C; init_i += 1) {
libAMGT_gv_aRMGardenLevelRegisteredMechIds[init_i] = libAREN_ge_ArenaMechanics_InvalidMechanic;
}
for (init_i = 0; init_i <= libAREN_gv_aRM_MechanicsCountToPick_C; init_i += 1) {
libAMGT_gv_aRMGardenLevels[init_i] = libAMGT_ge_ARMGardenLevel_None;
}
libAMGT_gv_victoryPlantTerrorUnitGroup = UnitGroupEmpty();
for (init_i = 0; init_i <= libAMGT_gv_aRMGardenMinionGroupMaxCount_C; init_i += 1) {
libAMGT_gv_aRMGardenMinionGroup[init_i].lv_units = UnitGroupEmpty();
}
libAMGT_gv_aRMGardenPanel.lv_gardenOfTerrorPanel = c_invalidDialogControlId;
libAMGT_gv_aRMGardenPanel.lv_gardenOfTerrorScorePanel = c_invalidDialogControlId;
libAMGT_gv_aRMGardenPanel.lv_gardenOfTerrorSeedsFrame = c_invalidDialogControlId;
for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
libAMGT_gv_aRMGardenPanel.lv_seedsCounts[init_i1] = c_invalidDialogControlId;
}
libAMGT_gv_aRMGardenPanel.lv_gardenOfTerrorGolemFrame = c_invalidDialogControlId;
libAMGT_gv_aRMGardenPanel.lv_gardenOfTerrorShamblersFrame = c_invalidDialogControlId;
for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
libAMGT_gv_aRMGardenPanel.lv_progressNotification[init_i1] = c_invalidDialogControlId;
}
for (init_i1 = 0; init_i1 <= libCore_gv_bALMaxTeams; init_i1 += 1) {
libAMGT_gv_aRMGardenPanel.lv_progressNotificationLabel[init_i1] = c_invalidDialogControlId;
}
}
// Presets
// Functions
int libAMGT_gf_ARMGardenCurrentLevel () {
// Automatic Variable Declarations
// Implementation
return libAMGT_gv_aRMGardenLevels[libAREN_gf_ArenaCurrentLevelIndex()];
}
void libAMGT_gf_ARMGardenAddLevel (int lp_level, region lp_levelRegion, trigger lp_levelStartCallback, text lp_levelName, string lp_levelImageOrder, string lp_levelImageChaos, text lp_levelInfo, region lp_cameraBoundsRegion) {
// Automatic Variable Declarations
// Implementation
libAMGT_gv_aRMGardenLevelCount += 1;
libAMGT_gv_aRMGardenLevelStartCallback[libAMGT_gv_aRMGardenLevelCount] = lp_levelStartCallback;
libAMGT_gv_aRMGardenLevels[libAMGT_gv_aRMGardenLevelCount] = lp_level;
libAREN_gf_ArenaRegisterMechanic(lp_levelName, lp_levelImageOrder, lp_levelImageChaos, lp_levelInfo, libAMGT_gt_ARMGardenLevelStart, lp_levelRegion, lp_cameraBoundsRegion);
libAMGT_gv_aRMGardenLevelRegisteredMechIds[libAMGT_gv_aRMGardenLevelCount] = libAREN_gf_LastregisteredArenaMechanic();
}
void libAMGT_gf_ARMGardenClearSpawnGroup () {
// Variable Declarations
int lv_itMinionIndex;
unit lv_indexMinion;
int lv_minionIndex;
int lv_itTerrorIndex;
unit lv_itVictoryPlantTerrorUnit;
unitgroup lv_mapSeeds;
unit lv_seed;
// Automatic Variable Declarations
unitgroup auto5A603A82_g;
int auto5A603A82_u;
int auto3F3D960F_ae;
const int auto3F3D960F_ai = 1;
int auto3F077E90_ae;
const int auto3F077E90_ai = 1;
unitgroup autoB5992B5A_g;
int autoB5992B5A_u;
int auto81F379DC_ae;
const int auto81F379DC_ai = 1;
unitgroup auto79A9540E_g;
int auto79A9540E_u;
// Variable Initialization
lv_mapSeeds = UnitGroupEmpty();
// Implementation
auto5A603A82_g = libAMGT_gv_victoryPlantTerrorUnitGroup;
auto5A603A82_u = UnitGroupCount(auto5A603A82_g, c_unitCountAll);
for (;; auto5A603A82_u -= 1) {
lv_itVictoryPlantTerrorUnit = UnitGroupUnitFromEnd(auto5A603A82_g, auto5A603A82_u);
if (lv_itVictoryPlantTerrorUnit == null) { break; }
UnitRemove(lv_itVictoryPlantTerrorUnit);
}
auto3F3D960F_ae = libAMGT_gv_aRMGardenMinionGroupCount;
lv_itMinionIndex = 1;
for ( ; ( (auto3F3D960F_ai >= 0 && lv_itMinionIndex <= auto3F3D960F_ae) || (auto3F3D960F_ai < 0 && lv_itMinionIndex >= auto3F3D960F_ae) ) ; lv_itMinionIndex += auto3F3D960F_ai ) {
auto3F077E90_ae = libAMGT_gv_aRMGardenMinionGroup[lv_itMinionIndex].lv_count;
lv_minionIndex = 1;
for ( ; ( (auto3F077E90_ai >= 0 && lv_minionIndex <= auto3F077E90_ae) || (auto3F077E90_ai < 0 && lv_minionIndex >= auto3F077E90_ae) ) ; lv_minionIndex += auto3F077E90_ai ) {
libAMGT_gv_aRMGardenMinionGroup[lv_itMinionIndex].lv_types[lv_minionIndex] = null;
}
autoB5992B5A_g = libAMGT_gv_aRMGardenMinionGroup[lv_itMinionIndex].lv_units;
autoB5992B5A_u = UnitGroupCount(autoB5992B5A_g, c_unitCountAll);
for (;; autoB5992B5A_u -= 1) {
lv_indexMinion = UnitGroupUnitFromEnd(autoB5992B5A_g, autoB5992B5A_u);
if (lv_indexMinion == null) { break; }
UnitRemove(lv_indexMinion);
}
UnitGroupClear(libAMGT_gv_aRMGardenMinionGroup[lv_itMinionIndex].lv_units);
libAMGT_gv_aRMGardenMinionGroup[lv_itMinionIndex].lv_count = 0;
libAMGT_gv_aRMGardenMinionGroup[lv_itMinionIndex].lv_spawning = false;
if ((libAMGT_gv_aRMGardenMinionGroup[lv_itMinionIndex].lv_iconUnit != null)) {
UnitRemove(libAMGT_gv_aRMGardenMinionGroup[lv_itMinionIndex].lv_iconUnit);
libAMGT_gv_aRMGardenMinionGroup[lv_itMinionIndex].lv_iconUnit = null;
}
libAMGT_gv_aRMGardenMinionGroup[lv_itMinionIndex].lv_defenderAIIndex = 0;
}
libAMGT_gv_aRMGardenMinionGroupCount = 0;
auto81F379DC_ae = libAMGT_gv_aRMGardenTerrorCount;
lv_itTerrorIndex = 1;
for ( ; ( (auto81F379DC_ai >= 0 && lv_itTerrorIndex <= auto81F379DC_ae) || (auto81F379DC_ai < 0 && lv_itTerrorIndex >= auto81F379DC_ae) ) ; lv_itTerrorIndex += auto81F379DC_ai ) {
UnitRemove(libAMGT_gv_aRMGardenTerrors[lv_itTerrorIndex].lv_terror);
libAMGT_gv_aRMGardenTerrors[lv_itTerrorIndex].lv_spawning = false;
libAMGT_gv_aRMGardenTerrors[lv_itTerrorIndex].lv_terror = null;
}
libAMGT_gv_aRMGardenTerrorCount = 0;
lv_mapSeeds = UnitGroup("ItemSeedPickup", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
auto79A9540E_g = lv_mapSeeds;
auto79A9540E_u = UnitGroupCount(auto79A9540E_g, c_unitCountAll);
for (;; auto79A9540E_u -= 1) {
lv_seed = UnitGroupUnitFromEnd(auto79A9540E_g, auto79A9540E_u);
if (lv_seed == null) { break; }
UnitRemove(lv_seed);
}
}
void libAMGT_gf_ARMGardenTurnOnOffNightSettings (bool lp_onOff) {
// Variable Declarations
actor lv_actorRegion;
// Automatic Variable Declarations
// Variable Initialization
// Implementation
ActorRegionCreate(null, "TriggerRegion", RegionEntireMap());
lv_actorRegion = libNtve_gf_ActorLastCreated();
if ((lp_onOff == true) && (libAMGT_gv_aRMGardenNightFallen == false)) {
libAMGT_gv_aRMGardenNightFallen = true;
ActorSend(libMapM_gv_mapMechanicControllerActor, "Signal Light2On");
ActorRegionSend(lv_actorRegion, c_actorIntersectAgainstRadiusContact, "Signal NightOn", "Doodad", "ScopeContains _StreetLamp");
libAMGT_gf_ARMGardenNightStart();
}
if ((lp_onOff == false) && (libAMGT_gv_aRMGardenNightFallen == true)) {
libAMGT_gv_aRMGardenNightFallen = false;
ActorSend(libMapM_gv_mapMechanicControllerActor, "Signal Light2Off");
ActorRegionSend(lv_actorRegion, c_actorIntersectAgainstRadiusContact, "Signal NightOff", "Doodad", "ScopeContains _StreetLamp");
libAMGT_gf_ARMGardenNightEnds();
}
ActorScopeKill(ActorScopeFromActor(lv_actorRegion));
}
void libAMGT_gf_ARMGardenNightStart () {
// Variable Declarations
int lv_itPlayer;
int lv_itGarden;
int lv_itTeam;
// Automatic Variable Declarations
// Variable Initialization
// Implementation
ActorSend(libMapM_gv_mapMechanicControllerActor, "Signal MM1On");
libCore_gv_mAPMapSoundtrack[1] = "MX_GardenOfTerror_Night_LVL_1";
libCore_gv_mAPMapSoundtrack[2] = "MX_GardenOfTerror_Night_LVL_10";
libCore_gv_mAPMapSoundtrack[3] = "MX_GardenOfTerror_Night_LVL_20";
if ((libSond_gf_SoundtrackIsIntroPlaying() == false)) {
libSond_gf_SoundtrackPlayMapSoundtrackAsDefaultSoundtrackForAllPlayers();
}
SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryAmbience, "Amb_2D_GardenOfTerror_Night", c_soundtrackCueAny, c_soundtrackIndexAny, true);
SoundChannelMute(PlayerGroupAll(), c_soundCategoryUser14, false);
SoundChannelMute(PlayerGroupAll(), c_soundCategorySPieces, true);
SoundChannelMute(PlayerGroupAll(), c_soundCategoryMessage, true);
}
void libAMGT_gf_ARMGardenNightEnds () {
// Variable Declarations
int lv_itPlayer;
int lv_itGroupIndex;
unit lv_itMinion;
int lv_itTeam;
// Automatic Variable Declarations
// Variable Initialization
// Implementation
libGame_gf_SendEventMapGardenOfTerrorNightEnds();
ActorSend(libMapM_gv_mapMechanicControllerActor, "Signal MM1Off");
SoundChannelMute(PlayerGroupAll(), c_soundCategoryUser14, true);
SoundChannelMute(PlayerGroupAll(), c_soundCategorySPieces, false);
SoundChannelMute(PlayerGroupAll(), c_soundCategoryMessage, false);
libCore_gv_mAPMapSoundtrack[1] = "MX_GardenOfTerror_Day_LVL_1";
libCore_gv_mAPMapSoundtrack[2] = "MX_GardenOfTerror_Day_LVL_10";
libCore_gv_mAPMapSoundtrack[3] = "MX_GardenOfTerror_Day_LVL_20";
if ((libSond_gf_SoundtrackIsIntroPlaying() == false)) {
libSond_gf_SoundtrackPlayMapSoundtrackAsDefaultSoundtrackForAllPlayers();
}
SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryAmbience, "Amb_2D_GardenOfTerror_Day", c_soundtrackCueAny, c_soundtrackIndexAny, false);
}
void libAMGT_gf_ARMGardenSpotlightController (int lp_level) {
// Automatic Variable Declarations
int auto24E96FDA_val;
// Implementation
auto24E96FDA_val = lp_level;
if (auto24E96FDA_val == 1) {
ActorSend(libMapM_gv_mapMechanicControllerActor, "Signal Light2Off");
ActorSend(libMapM_gv_mapMechanicControllerActor, "Signal Light3Off");
}
else if (auto24E96FDA_val == 2) {
ActorSend(libMapM_gv_mapMechanicControllerActor, "Signal Light2On");
ActorSend(libMapM_gv_mapMechanicControllerActor, "Signal Light3Off");
}
else if (auto24E96FDA_val == 3) {
ActorSend(libMapM_gv_mapMechanicControllerActor, "Signal Light3On");
ActorSend(libMapM_gv_mapMechanicControllerActor, "Signal Light2Off");
}
else {
}
}
void libAMGT_gf_ARMGardenDropSeeds (point lp_location, int lp_count, bool lp_forBoss) {
// Automatic Variable Declarations
int auto6B0DD956_n;
int auto6B0DD956_i;
// Implementation
if ((lp_count <= 0)) {
return ;
}
if ((lp_forBoss == true)) {
if ((lp_count > 1)) {
CatalogFieldValueSet(c_gameCatalogEffect, "PlantHorrorSpawnSeeds", "PeriodCount", libCore_gv_cOMPUTER_Neutral, IntToString(lp_count));
PlayerCreateEffectPoint(libCore_gv_cOMPUTER_Neutral, "PlantHorrorSpawnSeeds", lp_location);
}
else {
PlayerCreateEffectPoint(libCore_gv_cOMPUTER_Neutral, "PlantHorrorSpawnSeedsSingleFar", lp_location);
}
}
else {
auto6B0DD956_n = lp_count;
for (auto6B0DD956_i = 1; auto6B0DD956_i <= auto6B0DD956_n; auto6B0DD956_i += 1) {
PlayerCreateEffectPoint(libCore_gv_cOMPUTER_Neutral, "PlantHorrorSpawnSeedsSingleClose", lp_location);
}
}
}
void libAMGT_gf_ARMGardenSpawnMonsters () {
// Automatic Variable Declarations
int autoA6EA3F32_val;
// Implementation
autoA6EA3F32_val = libAMGT_gf_ARMGardenCurrentLevel();
if (autoA6EA3F32_val == libAMGT_ge_ARMGardenLevel_Level1) {
libAMGT_gf_ARMGardenL1SpawnNextTerror(0);
}
else if (autoA6EA3F32_val == libAMGT_ge_ARMGardenLevel_Level2) {
libAMGT_gf_ARMGardenL2SpawnNextTerror(0);
}
else if (autoA6EA3F32_val == libAMGT_ge_ARMGardenLevel_Level3) {
libAMGT_gf_ARMGardenL3SpawnTerror();
}
else {
}
libAMGT_gf_ARMGardenMinionDroppingSeeds();
libAMGT_gf_ARMGardenTerrorsDroppingSeeds();
}
void libAMGT_gf_ARMGardenVictorySequence (int lp_winningTeam, unit lp_loserTeamCore) {
// Variable Declarations
int lv_enemyTeam;
int lv_arenaLevel;
unit lv_fertileSoil;
int lv_plantTerrorOwner;
const fixed lv_coreAnimationWaitExplodeTime = 2.8;
const int lv_maxNumberOfShamblers_C = 9;
unit lv_plantTerror;
point lv_plantTerrorSpawnPoint;
point lv_coreLocation;
unit[lv_maxNumberOfShamblers_C + 1] lv_shamblers;
int lv_unit;
fixed lv_offsetAngle;
fixed lv_shamblerVarianceAngleUpperBound;
fixed lv_shamblerVarianceAngleLowerBound;
fixed lv_shamblerVarianceAngle;
fixed lv_shamblerVarianceRange;
int lv_shamblerTypeVariance;
// Automatic Variable Declarations
const int autoFD37F8C8_ae = lv_maxNumberOfShamblers_C;
const int autoFD37F8C8_ai = 1;
const int autoDC6876AC_ae = lv_maxNumberOfShamblers_C;
const int autoDC6876AC_ai = 1;
// Variable Initialization
lv_enemyTeam = libGame_gf_EnemyTeam(lp_winningTeam);
lv_arenaLevel = libAREN_gf_ArenaCurrentLevelIndex();
lv_fertileSoil = libAMGT_gv_fertilePlot[lv_enemyTeam][lv_arenaLevel];
lv_plantTerrorOwner = libGame_gf_ComputerPlayerInTeam(lp_winningTeam);
// Implementation
libAREN_gv_aRM_VictorySequencePlaying = true;
libAREN_gv_aRM_RoundWinningTeam = lp_winningTeam;
libAREN_gv_aRM_VictorySequenceDelay = 8.0;
libAREN_gf_ARM_RoundOver();
libStEx_gf_MoveUnit(lv_fertileSoil, libAMGT_gv_fertilePlotLocations[lv_enemyTeam][lv_arenaLevel], false);
lv_plantTerrorSpawnPoint = PointWithOffsetPolar(UnitGetPosition(lv_fertileSoil), 2.0, UnitGetFacing(lv_fertileSoil));
UnitBehaviorAdd(lv_fertileSoil, "HallOfStormsKnockbackImmunity", lv_fertileSoil, 1);
UnitSetOwner(lv_fertileSoil, lv_plantTerrorOwner, true);
libNtve_gf_PauseUnit(lv_fertileSoil, false);
UnitCreate(1, "VehiclePlantHorror", 0, lv_plantTerrorOwner, lv_plantTerrorSpawnPoint, UnitGetFacing(lv_fertileSoil), null);
lv_plantTerror = UnitLastCreated();
libNtve_gf_SendActorMessageToUnit(lv_plantTerror, "SetMinimapVisibility");
UnitBehaviorAdd(lv_plantTerror, "PlantHorrorVictorySequenceDisableAbilityBehavior", lv_plantTerror, 1);
UnitBehaviorAdd(lv_plantTerror, "VictorySequenceImmunetoStasisBehavior", lv_plantTerror, 1);
UnitBehaviorAdd(lv_plantTerror, "HallOfStormsKnockbackImmunity", lv_plantTerror, 1);
UnitWeaponAdd(lv_plantTerror, "VehiclePlantHorrorVictoryWeapon", null);
UnitWeaponRemove(lv_plantTerror, "VehiclePlantHorror");
libNtve_gf_MakeUnitInvulnerable(lv_plantTerror, true);
UnitGroupAdd(libAMGT_gv_victoryPlantTerrorUnitGroup, lv_plantTerror);
libNtve_gf_SendActorMessageToUnit(lp_loserTeamCore, "Create PlantHorrorVictorySequenceCoreFX");
libGame_gf_BuildingDiesCameraShake(libGame_gv_gameOver_CameraPanTime_C, "Medium", libCore_gv_activeHumanPlayers);
libNtve_gf_SendActorMessageToUnit(lv_fertileSoil, "Signal Victory");
lv_unit = 1;
for ( ; ( (autoFD37F8C8_ai >= 0 && lv_unit <= autoFD37F8C8_ae) || (autoFD37F8C8_ai < 0 && lv_unit >= autoFD37F8C8_ae) ) ; lv_unit += autoFD37F8C8_ai ) {
lv_offsetAngle += (360.0/lv_maxNumberOfShamblers_C);
lv_shamblerVarianceAngleLowerBound = (lv_offsetAngle - 35.0);
lv_shamblerVarianceAngleUpperBound = (lv_offsetAngle + 35.0);
lv_shamblerVarianceAngle = RandomFixed(lv_shamblerVarianceAngleLowerBound, lv_shamblerVarianceAngleUpperBound);
lv_shamblerVarianceRange = RandomFixed(6.0, 8.5);
lv_coreLocation = PointWithOffsetPolar(UnitGetPosition(lp_loserTeamCore), lv_shamblerVarianceRange, lv_shamblerVarianceAngle);
lv_shamblerTypeVariance = RandomInt(0, 1);
if ((lv_shamblerTypeVariance >= 1)) {
libNtve_gf_UnitCreateFacingPoint(1, "Shambler", 0, lv_plantTerrorOwner, lv_coreLocation, UnitGetPosition(lp_loserTeamCore), null);
}
else {
libNtve_gf_UnitCreateFacingPoint(1, "ShamblerRanged", 0, lv_plantTerrorOwner, lv_coreLocation, UnitGetPosition(lp_loserTeamCore), null);
}
UnitGroupAdd(libAMGT_gv_victoryPlantTerrorUnitGroup, UnitLastCreated());
UnitBehaviorAdd(UnitLastCreated(), "HallOfStormsKnockbackImmunity", UnitLastCreated(), 1);
UnitBehaviorAdd(UnitLastCreated(), "ShamblingHorrorVictorySequenceDamageLimiter", UnitLastCreated(), 1);
libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "SetShowStatusBar");
lv_shamblers[lv_unit] = UnitLastCreated();
}
Wait(3.5, c_timeGame);
UnitBehaviorAdd(lv_plantTerror, "PlantHorrorVictorySequenceDamageLimiter", lv_plantTerror, 1);
UnitBehaviorRemove(lv_plantTerror, "PlantHorrorBirth", 1);
UnitBehaviorRemove(lv_plantTerror, "PlantHorrorDeactivated", 1);
UnitBehaviorRemove(lv_plantTerror, "GenericVehicleBehaviorEmpty", 1);
UnitIssueOrder(lv_plantTerror, OrderTargetingUnit(AbilityCommand("StormVehicleAttack", 0), lp_loserTeamCore), c_orderQueueReplace);
lv_unit = 1;
for ( ; ( (autoDC6876AC_ai >= 0 && lv_unit <= autoDC6876AC_ae) || (autoDC6876AC_ai < 0 && lv_unit >= autoDC6876AC_ae) ) ; lv_unit += autoDC6876AC_ai ) {
UnitIssueOrder(lv_shamblers[lv_unit], OrderTargetingUnit(AbilityCommand("attack", 0), lp_loserTeamCore), c_orderQueueReplace);
}
}
void libAMGT_gf_ARMGardenAddMinionGroup (region lp_area, bool lp_aggro, string lp_extraIcon, int lp_side) {
// Variable Declarations
int lv_groupIndex;
unit lv_itMinion;
int lv_minionIndex;
// Automatic Variable Declarations
unitgroup auto843621A4_g;
int auto843621A4_u;
// Variable Initialization
// Implementation
if ((libAMGT_gv_aRMGardenMinionGroupCount >= libAMGT_gv_aRMGardenMinionGroupMaxCount_C)) {
UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringExternal("Param/Value/lib_AMGT_2C820F3A"));
return ;
}
libAMGT_gv_aRMGardenMinionGroupCount += 1;
libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_area = lp_area;
libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_aggro = lp_aggro;
libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_groupIcon = lp_extraIcon;
libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_side = lp_side;
auto843621A4_g = UnitGroup(null, libCore_gv_cOMPUTER_Hostile, lp_area, UnitFilter((1 << c_targetFilterCreep), (1 << (c_targetFilterHidden - 32)), (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32))), 0);
auto843621A4_u = UnitGroupCount(auto843621A4_g, c_unitCountAll);
for (;; auto843621A4_u -= 1) {
lv_itMinion = UnitGroupUnitFromEnd(auto843621A4_g, auto843621A4_u);
if (lv_itMinion == null) { break; }
libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_count += 1;
lv_minionIndex = libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_count;
libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_types[lv_minionIndex] = UnitGetType(lv_itMinion);
libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_positions[lv_minionIndex] = UnitGetPosition(lv_itMinion);
PointSetFacing(libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_positions[lv_minionIndex], UnitGetFacing(lv_itMinion));
UnitRemove(lv_itMinion);
}
libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_spawning = false;
libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_defenderAIIndex = 0;
if ((libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_iconUnit != null)) {
UnitRemove(libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_iconUnit);
libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_iconUnit = null;
}
UnitGroupClear(libAMGT_gv_aRMGardenMinionGroup[libAMGT_gv_aRMGardenMinionGroupCount].lv_units);
}
int libAMGT_gf_ARMGardenMinionGroupIndex (unit lp_minion) {
// Automatic Variable Declarations
// Implementation
return libCore_gf_IntegerStoredForUnit(lp_minion, 1);
}
trigger auto_libAMGT_gf_ARMGardenSpawnMinionGroupSingle_Trigger = null;
int auto_libAMGT_gf_ARMGardenSpawnMinionGroupSingle_lp_groupIndex;
bool auto_libAMGT_gf_ARMGardenSpawnMinionGroupSingle_lp_delay;
void libAMGT_gf_ARMGardenSpawnMinionGroupSingle (int lp_groupIndex, bool lp_delay) {
auto_libAMGT_gf_ARMGardenSpawnMinionGroupSingle_lp_groupIndex = lp_groupIndex;
auto_libAMGT_gf_ARMGardenSpawnMinionGroupSingle_lp_delay = lp_delay;
if (auto_libAMGT_gf_ARMGardenSpawnMinionGroupSingle_Trigger == null) {
auto_libAMGT_gf_ARMGardenSpawnMinionGroupSingle_Trigger = TriggerCreate("auto_libAMGT_gf_ARMGardenSpawnMinionGroupSingle_TriggerFunc");
}
TriggerExecute(auto_libAMGT_gf_ARMGardenSpawnMinionGroupSingle_Trigger, false, false);
}
bool auto_libAMGT_gf_ARMGardenSpawnMinionGroupSingle_TriggerFunc (bool testConds, bool runActions) {
int lp_groupIndex = auto_libAMGT_gf_ARMGardenSpawnMinionGroupSingle_lp_groupIndex;
bool lp_delay = auto_libAMGT_gf_ARMGardenSpawnMinionGroupSingle_lp_delay;
// Variable Declarations
int lv_itMinionIndex;
unitgroup lv_minionGroup;
unit lv_itMinion;
int lv_ping1;
int lv_ping2;
// Automatic Variable Declarations
int auto2A0FD6F8_ae;
const int auto2A0FD6F8_ai = 1;
unitgroup autoA68113C3_g;
int autoA68113C3_u;
// Variable Initialization
lv_minionGroup = UnitGroupEmpty();
lv_ping1 = c_invalidPingId;
lv_ping2 = c_invalidPingId;
// Implementation
if ((libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_spawning == true)) {
return true;
}
libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_spawning = true;
if ((lp_delay == true)) {
Wait(RandomFixed(3.0, 4.0), c_timeGame);
}
else {
Wait(RandomFixed(0.0, 1.0), c_timeGame);
}
DialogControlSetVisible(libAMGT_gv_aRMGardenPanel.lv_gardenOfTerrorShamblersFrame, PlayerGroupAll(), true);
PingCreateFromData(PlayerGroupAll(), "StormArenaAlert", RegionGetCenter(libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_area));
PingSetColor(PingLastCreated(), Color(100.00, 100.00, 0.00));
PingSetTooltip(PingLastCreated(), StringExternal("Param/Value/lib_AMGT_D17D4BB9"));
PingSetScale(PingLastCreated(), 0.6);
lv_ping1 = PingLastCreated();
PingCreateFromData(PlayerGroupAll(), "StormObjective", RegionGetCenter(libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_area));
PingSetColor(PingLastCreated(), Color(100.00, 100.00, 0.00));
PingSetScale(PingLastCreated(), 0.6);
lv_ping2 = PingLastCreated();
SoundPlayForPlayer(SoundLink("ArenaMode_Crowd_Cheer_EventReady", -1), c_maxPlayers, PlayerGroupAll(), 100.0, 0.0);
if ((lp_delay == true)) {
Wait(2.0, c_timeGame);
}
auto2A0FD6F8_ae = (libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_count - UnitGroupCount(libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_units, c_unitCountAlive));
lv_itMinionIndex = 1;
for ( ; ( (auto2A0FD6F8_ai >= 0 && lv_itMinionIndex <= auto2A0FD6F8_ae) || (auto2A0FD6F8_ai < 0 && lv_itMinionIndex >= auto2A0FD6F8_ae) ) ; lv_itMinionIndex += auto2A0FD6F8_ai ) {
libNtve_gf_CreateUnitsAtPoint2(1, libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_types[lv_itMinionIndex], c_unitCreateIgnorePlacement, libCore_gv_cOMPUTER_Hostile, libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_positions[lv_itMinionIndex], null);
UnitGroupAdd(libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_units, UnitLastCreated());
libCore_gf_StoreIntegerForUnit(UnitLastCreated(), 1, lp_groupIndex);
libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "SetMinimapVisibilityAlways");
libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "SetMinimapVisibility");
UnitSetState(UnitLastCreated(), c_unitStateSelectable, false);
UnitSetState(UnitLastCreated(), c_unitStateStoppable, false);
UnitSetState(UnitLastCreated(), c_unitStateInvulnerable, true);
UnitSetState(UnitLastCreated(), c_unitStateStatusBar, false);
UnitSetState(UnitLastCreated(), c_unitStateTargetable, false);
AddUnitOfInterest(UnitLastCreated(), 0.0, 0.0, "KillShambler", libNtve_ge_GoalTeam_Both, 0);
}
Wait(2.0, c_timeGame);
autoA68113C3_g = libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_units;
autoA68113C3_u = UnitGroupCount(autoA68113C3_g, c_unitCountAll);
for (;; autoA68113C3_u -= 1) {
lv_itMinion = UnitGroupUnitFromEnd(autoA68113C3_g, autoA68113C3_u);
if (lv_itMinion == null) { break; }
UnitSetState(lv_itMinion, c_unitStateSelectable, true);
UnitSetState(lv_itMinion, c_unitStateStoppable, true);
UnitSetState(lv_itMinion, c_unitStateInvulnerable, false);
UnitSetState(lv_itMinion, c_unitStateStatusBar, true);
UnitSetState(lv_itMinion, c_unitStateTargetable, true);
}
Wait(0.0, c_timeGame);
if ((libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_defenderAIIndex == 0)) {
libAIAI_gf_StartDefenderAI(false, libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_units, libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_area, null, false);
libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_defenderAIIndex = libAIAI_gf_LastCreatedDefenderAI();
}
else {
libAIAI_gf_AddUnitsToDefenderAI(libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_defenderAIIndex, libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_units);
}
if ((libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_groupIcon != null)) {
libNtve_gf_CreateUnitsAtPoint2(1, "JungleCampIconUnit", c_unitCreateIgnorePlacement, libCore_gv_cOMPUTER_Hostile, RegionGetCenter(libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_area), null);
libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_iconUnit = UnitLastCreated();
libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), (("MinimapIcon " + (libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_groupIcon))));
libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "SetMinimapVisibility 1");
libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "SetMinimapVisibilityAlways 1");
libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "MinimapIconScale 0.500000");
libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "MinimapIconTintColor 255,180,90,218");
}
libAMGT_gv_aRMGardenMinionGroup[lp_groupIndex].lv_spawning = false;
Wait(3.0, c_timeGame);
if ((lv_ping1 != c_invalidPingId)) {
PingDestroy(lv_ping1);
}
if ((lv_ping2 != c_invalidPingId)) {
PingDestroy(lv_ping2);
}
return true;
}
trigger auto_libAMGT_gf_ARMGardenMinionDroppingSeeds_Trigger = null;
void libAMGT_gf_ARMGardenMinionDroppingSeeds () {
if (auto_libAMGT_gf_ARMGardenMinionDroppingSeeds_Trigger == null) {
auto_libAMGT_gf_ARMGardenMinionDroppingSeeds_Trigger = TriggerCreate("auto_libAMGT_gf_ARMGardenMinionDroppingSeeds_TriggerFunc");
}
TriggerExecute(auto_libAMGT_gf_ARMGardenMinionDroppingSeeds_Trigger, false, false);
}
bool auto_libAMGT_gf_ARMGardenMinionDroppingSeeds_TriggerFunc (bool testConds, bool runActions) {
// Variable Declarations
int lv_itGroup;
unit lv_itGroup2;
// Automatic Variable Declarations
int auto74B3434D_ae;
const int auto74B3434D_ai = 1;
unitgroup auto51F79180_g;
int auto51F79180_u;
// Variable Initialization
// Implementation
while (true) {
if ((libGame_gv_gameOver == true)) {
return true;
}
auto74B3434D_ae = libAMGT_gv_aRMGardenMinionGroupCount;
lv_itGroup = 1;
for ( ; ( (auto74B3434D_ai >= 0 && lv_itGroup <= auto74B3434D_ae) || (auto74B3434D_ai < 0 && lv_itGroup >= auto74B3434D_ae) ) ; lv_itGroup += auto74B3434D_ai ) {
auto51F79180_g = libAMGT_gv_aRMGardenMinionGroup[lv_itGroup].lv_units;
auto51F79180_u = UnitGroupCount(auto51F79180_g, c_unitCountAll);
for (;; auto51F79180_u -= 1) {
lv_itGroup2 = UnitGroupUnitFromEnd(auto51F79180_g, auto51F79180_u);
if (lv_itGroup2 == null) { break; }
if ((UnitIsAlive(lv_itGroup2) == false)) {
continue;
}
libAMGT_gf_ARMGardenMinionDropsSeeds(lv_itGroup2);
}
}
Wait(0.25, c_timeGame);
}
return true;
}
void libAMGT_gf_ARMGardenMinionDropsSeeds (unit lp_bossIndex) {
// Variable Declarations
int lv_droppedIndex;
int lv_dropIndex;
int lv_dropIndexMax;
int lv_itDrop;
int lv_itSeed;
fixed lv_percent;
// Automatic Variable Declarations
int auto214A1643_ae;
const int auto214A1643_ai = 1;
const int auto38417DDE_ae = libAMGT_gv_aRMGardenSeedsMinionPerHPDrop_C;
const int auto38417DDE_ai = 1;
// Variable Initialization
// Implementation
lv_percent = UnitGetPropertyFixed(lp_bossIndex, c_unitPropLifePercent, c_unitPropCurrent);
lv_droppedIndex = libCore_gf_IntegerStoredForUnit(lp_bossIndex, 2);
lv_dropIndexMax = ((libAMGT_gv_aRMGardenSeedsMinionStartHPPercent_C+FixedToInt(libAMGT_gv_aRMGardenSeedsMinionPerHPPercent_C)-1)/FixedToInt(libAMGT_gv_aRMGardenSeedsMinionPerHPPercent_C));
if ((UnitIsAlive(lp_bossIndex) == true)) {
lv_dropIndex = ((libAMGT_gv_aRMGardenSeedsMinionStartHPPercent_C+FixedToInt(libAMGT_gv_aRMGardenSeedsMinionPerHPPercent_C)-1-FixedToInt(lv_percent))/FixedToInt(libAMGT_gv_aRMGardenSeedsMinionPerHPPercent_C));
lv_dropIndex = MinI(lv_dropIndex, lv_dropIndexMax);
}
else {
lv_dropIndex = lv_dropIndexMax;
}
if ((lv_dropIndex > lv_droppedIndex)) {
libCore_gf_StoreIntegerForUnit(lp_bossIndex, 2, lv_dropIndex);
auto214A1643_ae = lv_dropIndex;
lv_itDrop = (lv_droppedIndex + 1);
for ( ; ( (auto214A1643_ai >= 0 && lv_itDrop <= auto214A1643_ae) || (auto214A1643_ai < 0 && lv_itDrop >= auto214A1643_ae) ) ; lv_itDrop += auto214A1643_ai ) {
lv_itSeed = 1;
for ( ; ( (auto38417DDE_ai >= 0 && lv_itSeed <= auto38417DDE_ae) || (auto38417DDE_ai < 0 && lv_itSeed >= auto38417DDE_ae) ) ; lv_itSeed += auto38417DDE_ai ) {
libAMGT_gf_ARMGardenDropSeeds(UnitGetPosition(lp_bossIndex), 1, false);
}
}
}
}
void libAMGT_gf_ARMGardenAddTerror (unit lp_terror, region lp_area) {
// Automatic Variable Declarations
// Implementation
libAMGT_gv_aRMGardenTerrorCount += 1;
libAMGT_gv_aRMGardenTerrors[libAMGT_gv_aRMGardenTerrorCount].lv_area = lp_area;
libAMGT_gv_aRMGardenTerrors[libAMGT_gv_aRMGardenTerrorCount].lv_position = UnitGetPosition(lp_terror);
PointSetFacing(libAMGT_gv_aRMGardenTerrors[libAMGT_gv_aRMGardenTerrorCount].lv_position, UnitGetFacing(lp_terror));
UnitRemove(lp_terror);
libAMGT_gv_aRMGardenTerrors[libAMGT_gv_aRMGardenTerrorCount].lv_terror = null;
libAMGT_gv_aRMGardenTerrors[libAMGT_gv_aRMGardenTerrorCount].lv_spawning = false;
}
trigger auto_libAMGT_gf_ARMGardenSpawnTerrorsSingle_Trigger = null;
int auto_libAMGT_gf_ARMGardenSpawnTerrorsSingle_lp_index;
void libAMGT_gf_ARMGardenSpawnTerrorsSingle (int lp_index) {
auto_libAMGT_gf_ARMGardenSpawnTerrorsSingle_lp_index = lp_index;
if (auto_libAMGT_gf_ARMGardenSpawnTerrorsSingle_Trigger == null) {
auto_libAMGT_gf_ARMGardenSpawnTerrorsSingle_Trigger = TriggerCreate("auto_libAMGT_gf_ARMGardenSpawnTerrorsSingle_TriggerFunc");
}
TriggerExecute(auto_libAMGT_gf_ARMGardenSpawnTerrorsSingle_Trigger, false, false);
}
bool auto_libAMGT_gf_ARMGardenSpawnTerrorsSingle_TriggerFunc (bool testConds, bool runActions) {
int lp_index = auto_libAMGT_gf_ARMGardenSpawnTerrorsSingle_lp_index;
// Variable Declarations
int lv_ping1;
int lv_ping2;
// Automatic Variable Declarations
// Variable Initialization
lv_ping1 = c_invalidPingId;
lv_ping2 = c_invalidPingId;
// Implementation
if ((libAMGT_gv_aRMGardenTerrors[lp_index].lv_spawning == true)) {
return true;
}
libAMGT_gv_aRMGardenTerrors[lp_index].lv_spawning = true;
DialogControlSetVisible(libAMGT_gv_aRMGardenPanel.lv_gardenOfTerrorGolemFrame, PlayerGroupAll(), true);
PingCreateFromData(PlayerGroupAll(), "StormArenaAlert", libAMGT_gv_aRMGardenTerrors[lp_index].lv_position);
PingSetColor(PingLastCreated(), Color(100.00, 100.00, 0.00));
PingSetTooltip(PingLastCreated(), StringExternal("Param/Value/lib_AMGT_95104AF5"));
PingSetScale(PingLastCreated(), 0.8);
lv_ping1 = PingLastCreated();
PingCreateFromData(PlayerGroupAll(), "StormObjective", libAMGT_gv_aRMGardenTerrors[lp_index].lv_position);
PingSetColor(PingLastCreated(), Color(100.00, 100.00, 0.00));
PingSetScale(PingLastCreated(), 0.8);
lv_ping2 = PingLastCreated();
SoundPlayForPlayer(SoundLink("ArenaMode_Crowd_Cheer_EventReady", -1), c_maxPlayers, PlayerGroupAll(), 100.0, 0.0);
Wait(2.0, c_timeGame);
libNtve_gf_CreateUnitsAtPoint2(1, "JunglePlantHorror", c_unitCreateIgnorePlacement, libCore_gv_cOMPUTER_Hostile, libAMGT_gv_aRMGardenTerrors[lp_index].lv_position, null);
libAMGT_gv_aRMGardenTerrors[lp_index].lv_terror = UnitLastCreated();
libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "MinimapIcon Assets\\Textures\\storm_ui_minimapicon_gardengolem.dds");
libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "SetMinimapVisibility 1");
libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "SetMinimapVisibilityAlways 1");
libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "MinimapIconScale 0.700000");
libAIAI_gf_StartDefenderAI(false, libNtve_gf_ConvertUnitToUnitGroup(UnitLastCreated()), libAMGT_gv_aRMGardenTerrors[lp_index].lv_area, null, false);
AddUnitOfInterest(UnitLastCreated(), 0.0, 0.0, "KillGardenTerror", libNtve_ge_GoalTeam_Both, 0);
Wait(10.0, c_timeGame);
PingDestroy(lv_ping1);
PingDestroy(lv_ping2);
libAMGT_gv_aRMGardenTerrors[lp_index].lv_spawning = false;
return true;
}
int libAMGT_gf_ARMGardenTerrorIndex (unit lp_terror) {
// Variable Declarations
int lv_itTerrorIndex;
// Automatic Variable Declarations
int auto05953537_ae;
const int auto05953537_ai = 1;
// Variable Initialization
// Implementation
auto05953537_ae = libAMGT_gv_aRMGardenTerrorCount;
lv_itTerrorIndex = 1;
for ( ; ( (auto05953537_ai >= 0 && lv_itTerrorIndex <= auto05953537_ae) || (auto05953537_ai < 0 && lv_itTerrorIndex >= auto05953537_ae) ) ; lv_itTerrorIndex += auto05953537_ai ) {
if ((libAMGT_gv_aRMGardenTerrors[lv_itTerrorIndex].lv_terror == lp_terror)) {
return lv_itTerrorIndex;
}
}
return 0;
}
trigger auto_libAMGT_gf_ARMGardenTerrorsDroppingSeeds_Trigger = null;
void libAMGT_gf_ARMGardenTerrorsDroppingSeeds () {
if (auto_libAMGT_gf_ARMGardenTerrorsDroppingSeeds_Trigger == null) {
auto_libAMGT_gf_ARMGardenTerrorsDroppingSeeds_Trigger = TriggerCreate("auto_libAMGT_gf_ARMGardenTerrorsDroppingSeeds_TriggerFunc");
}
TriggerExecute(auto_libAMGT_gf_ARMGardenTerrorsDroppingSeeds_Trigger, false, false);
}
bool auto_libAMGT_gf_ARMGardenTerrorsDroppingSeeds_TriggerFunc (bool testConds, bool runActions) {
// Variable Declarations
int lv_itGroup;
// Automatic Variable Declarations
int auto771AA39C_ae;
const int auto771AA39C_ai = 1;
// Variable Initialization
// Implementation
while (true) {
if ((libGame_gv_gameOver == true)) {
return true;
}
auto771AA39C_ae = libAMGT_gv_aRMGardenTerrorCount;
lv_itGroup = 1;
for ( ; ( (auto771AA39C_ai >= 0 && lv_itGroup <= auto771AA39C_ae) || (auto771AA39C_ai < 0 && lv_itGroup >= auto771AA39C_ae) ) ; lv_itGroup += auto771AA39C_ai ) {
if ((UnitIsAlive(libAMGT_gv_aRMGardenTerrors[lv_itGroup].lv_terror) == false)) {
continue;
}
libAMGT_gf_ARMGardenTerrorDropsSeeds(libAMGT_gv_aRMGardenTerrors[lv_itGroup].lv_terror);
}
Wait(0.25, c_timeGame);
}
return true;
}
void libAMGT_gf_ARMGardenTerrorDropsSeeds (unit lp_bossIndex) {
// Variable Declarations
int lv_itTerrorIndex;
int lv_droppedIndex;
int lv_dropIndex;
int lv_dropIndexMax;
int lv_itDrop;
int lv_itSeed;
fixed lv_percent;
point lv_dropLoc;
point lv_dropLocTemp;
// Automatic Variable Declarations
int autoF3E48E0A_ae;
const int autoF3E48E0A_ai = 1;
const int auto2C96026B_ae = libAMGT_gv_aRMGardenSeedsTerrorPerHPDrop_C;
const int auto2C96026B_ai = 1;
int autoA633DC79_ae;
const int autoA633DC79_ai = 1;
const int auto1FA089EA_n = 20;
int auto1FA089EA_i;
// Variable Initialization
// Implementation
lv_itTerrorIndex = libAMGT_gf_ARMGardenTerrorIndex(lp_bossIndex);
if ((lv_itTerrorIndex <= 0)) {
return ;
}
lv_percent = UnitGetPropertyFixed(lp_bossIndex, c_unitPropLifePercent, c_unitPropCurrent);
lv_droppedIndex = libCore_gf_IntegerStoredForUnit(lp_bossIndex, 2);
lv_dropIndexMax = ((libAMGT_gv_aRMGardenSeedsTerrorStartHPPercent_C+FixedToInt(libAMGT_gv_aRMGardenSeedsTerrorPerHPPercent_C)-1)/FixedToInt(libAMGT_gv_aRMGardenSeedsTerrorPerHPPercent_C));
if ((UnitIsAlive(lp_bossIndex) == true)) {
lv_dropIndex = ((libAMGT_gv_aRMGardenSeedsTerrorStartHPPercent_C+FixedToInt(libAMGT_gv_aRMGardenSeedsTerrorPerHPPercent_C)-1-FixedToInt(lv_percent))/FixedToInt(libAMGT_gv_aRMGardenSeedsTerrorPerHPPercent_C));
lv_dropIndex = MinI(lv_dropIndex, lv_dropIndexMax);
}
else {
lv_dropIndex = lv_dropIndexMax;
}
if ((lv_dropIndex > lv_droppedIndex)) {
libCore_gf_StoreIntegerForUnit(lp_bossIndex, 2, lv_dropIndex);
autoF3E48E0A_ae = lv_dropIndex;
lv_itDrop = (lv_droppedIndex + 1);
for ( ; ( (autoF3E48E0A_ai >= 0 && lv_itDrop <= autoF3E48E0A_ae) || (autoF3E48E0A_ai < 0 && lv_itDrop >= autoF3E48E0A_ae) ) ; lv_itDrop += autoF3E48E0A_ai ) {
lv_itSeed = 1;
for ( ; ( (auto2C96026B_ai >= 0 && lv_itSeed <= auto2C96026B_ae) || (auto2C96026B_ai < 0 && lv_itSeed >= auto2C96026B_ae) ) ; lv_itSeed += auto2C96026B_ai ) {
libAMGT_gf_ARMGardenDropSeeds(UnitGetPosition(lp_bossIndex), 1, true);
}
}
}
lv_droppedIndex = libCore_gf_IntegerStoredForUnit(lp_bossIndex, 3);
lv_dropIndexMax = 2;
if ((UnitIsAlive(lp_bossIndex) == true)) {
if ((lv_percent <= 30.0)) {
lv_dropIndex = 2;
}
else if ((lv_percent <= 70.0)) {
lv_dropIndex = 1;
}
else if (true) {
lv_dropIndex = 0;
}
}
else {
lv_dropIndex = lv_dropIndexMax;
}
if ((lv_dropIndex > lv_droppedIndex)) {
libCore_gf_StoreIntegerForUnit(lp_bossIndex, 3, lv_dropIndex);
autoA633DC79_ae = lv_dropIndex;
lv_itDrop = (lv_droppedIndex + 1);
for ( ; ( (autoA633DC79_ai >= 0 && lv_itDrop <= autoA633DC79_ae) || (autoA633DC79_ai < 0 && lv_itDrop >= autoA633DC79_ae) ) ; lv_itDrop += autoA633DC79_ai ) {
lv_dropLoc = null;
for (auto1FA089EA_i = 1; auto1FA089EA_i <= auto1FA089EA_n; auto1FA089EA_i += 1) {
lv_dropLocTemp = PointWithOffsetPolar(UnitGetPosition(lp_bossIndex), RandomFixed(5.0, 6.5), libNtve_gf_RandomAngle());
if ((RegionContainsPoint(libAMGT_gv_aRMGardenTerrors[lv_itTerrorIndex].lv_area, lv_dropLocTemp) == true)) {
lv_dropLoc = lv_dropLocTemp;
break;
}
}
if ((lv_dropLoc == null)) {
lv_dropLoc = PointWithOffsetPolar(UnitGetPosition(lp_bossIndex), RandomFixed(2.0, 3.0), libNtve_gf_RandomAngle());
}
libNtve_gf_CreateUnitsWithDefaultFacing(1, "RegenGlobeNeutral", c_unitCreateIgnorePlacement, libCore_gv_cOMPUTER_Neutral, lv_dropLoc, null);
}
}
}
void libAMGT_gf_ARMGardenL1SpawnNextTerror (int lp_lastTerror) {
// Automatic Variable Declarations
int autoD1845EC1_val;
int auto015DF750_val;
// Implementation
if (((libGame_gv_gameOver == true) || (libAMGT_gf_ARMGardenCurrentLevel() != libAMGT_ge_ARMGardenLevel_Level1))) {
return ;
}
autoD1845EC1_val = lp_lastTerror;
if (autoD1845EC1_val == 1) {
libAMGT_gv_aRMGardenL1TerrorSpawnIndex = 2;
}
else if (autoD1845EC1_val == 2) {
libAMGT_gv_aRMGardenL1TerrorSpawnIndex = 3;
}
else if (autoD1845EC1_val == 3) {
libAMGT_gv_aRMGardenL1TerrorSpawnIndex = 1;
}
else {
libAMGT_gv_aRMGardenL1TerrorSpawnIndex = 1;
}
auto015DF750_val = libAMGT_gv_aRMGardenL1TerrorSpawnIndex;
if (auto015DF750_val == 1) {
libAMGT_gf_ARMGardenSpawnMinionGroupSingle(1, true);
libAMGT_gf_ARMGardenSpawnMinionGroupSingle(2, true);
libAMGT_gf_ARMGardenSpawnTerrorsSingle(1);
}
else if (auto015DF750_val == 2) {
libAMGT_gf_ARMGardenSpawnMinionGroupSingle(3, true);
libAMGT_gf_ARMGardenSpawnMinionGroupSingle(4, true);
libAMGT_gf_ARMGardenSpawnTerrorsSingle(2);
}
else if (auto015DF750_val == 3) {
libAMGT_gf_ARMGardenSpawnTerrorsSingle(3);
}
else {
}
}
trigger auto_libAMGT_gf_ARMGardenL2SpawnNextTerror_Trigger = null;
int auto_libAMGT_gf_ARMGardenL2SpawnNextTerror_lp_lastTerror;
void libAMGT_gf_ARMGardenL2SpawnNextTerror (int lp_lastTerror) {
auto_libAMGT_gf_ARMGardenL2SpawnNextTerror_lp_lastTerror = lp_lastTerror;
if (auto_libAMGT_gf_ARMGardenL2SpawnNextTerror_Trigger == null) {
auto_libAMGT_gf_ARMGardenL2SpawnNextTerror_Trigger = TriggerCreate("auto_libAMGT_gf_ARMGardenL2SpawnNextTerror_TriggerFunc");
}
TriggerExecute(auto_libAMGT_gf_ARMGardenL2SpawnNextTerror_Trigger, false, false);
}
bool auto_libAMGT_gf_ARMGardenL2SpawnNextTerror_TriggerFunc (bool testConds, bool runActions) {
int lp_lastTerror = auto_libAMGT_gf_ARMGardenL2SpawnNextTerror_lp_lastTerror;
// Variable Declarations
int lv_nextTerror;
bool lv_shamblerGroupsSpawned;
// Automatic Variable Declarations
int autoF49CDDDF_val;
// Variable Initialization
// Implementation
if (((libGame_gv_gameOver == true) || (libAMGT_gf_ARMGardenCurrentLevel() != libAMGT_ge_ARMGardenLevel_Level2))) {
return true;
}
autoF49CDDDF_val = lp_lastTerror;
if (autoF49CDDDF_val == 1) {
lv_nextTerror = 2;
}
else if (autoF49CDDDF_val == 2) {
lv_nextTerror = 1;
}
else {
lv_nextTerror = 1;
}
libAMGT_gf_ARMGardenSpawnTerrorsSingle(lv_nextTerror);
Wait(2.0, c_timeGame);
while (true) {
if ((libGame_gv_gameOver == true)) {
return true;
}
if ((UnitGetPropertyFixed(libAMGT_gv_aRMGardenTerrors[lv_nextTerror].lv_terror, c_unitPropLifePercent, c_unitPropCurrent) <= 50.0) && (lv_shamblerGroupsSpawned == false)) {
libAMGT_gf_ARMGardenSpawnMinionGroupSingle(1, true);
libAMGT_gf_ARMGardenSpawnMinionGroupSingle(2, true);
lv_shamblerGroupsSpawned = true;
}
else if ((UnitIsAlive(libAMGT_gv_aRMGardenTerrors[lv_nextTerror].lv_terror) == false)) {
Wait(5.0, c_timeGame);
libAMGT_gf_ARMGardenL2SpawnNextTerror(lv_nextTerror);
return true;
}
Wait(0.5, c_timeGame);
}
return true;
}
void libAMGT_gf_ARMGardenL3SpawnTerror () {
// Variable Declarations
int lv_itMinionGroupIndex;
// Automatic Variable Declarations
int auto641C40A5_ae;
const int auto641C40A5_ai = 1;
// Variable Initialization