-
Notifications
You must be signed in to change notification settings - Fork 0
/
bescript.psc
2045 lines (1965 loc) · 118 KB
/
bescript.psc
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
ScriptName BEScript Extends Quest
{ Standard script for Boarding Encounter quests. }
;-- Structs -----------------------------------------
Struct GenericCrewDatum
ActorBase CrewActor
{ The Actor to spawn. }
Float ActorLevelModChanceEasy = 0.5
{ Default=0.5. Chance the actor's aiLevelMod will be 0, Easy. }
Float ActorLevelModChanceMedium = 0.5
{ Default=0.5. Chance the actor's aiLevelMod will be 1, Medium. If not Easy or Medium, the actor will be 2, Hard. }
Int InstancesToSpawn = -1
{ Default=-1 (Unlimited). The maximum number of instances of this actor to spawn on this ship. }
EndStruct
Struct ModuleDatum
ObjectReference moduleRef
ObjectReference shipCrewSpawnMarkerRef01
ObjectReference shipCrewSpawnMarkerRef02
ObjectReference shipCrewSpawnMarkerRef03
ObjectReference shipCrewSpawnMarkerRef04
ObjectReference shipCrewSpawnMarkerRef05
ObjectReference shipTurretSpawnMarkerRef01
ObjectReference shipTurretSpawnMarkerRef02
ObjectReference shipTurretSpawnMarkerRef03
ObjectReference shipTurretSpawnMarkerRef04
ObjectReference shipTurretSpawnMarkerRef05
ObjectReference shipComputerRef
EndStruct
;-- Variables ---------------------------------------
Actor[] BEAliasCorpses
Int CONST_Aggression_VeryAggressive = 2 Const
Int CONST_BEObjective_KillEnemyCrewObj = 20 Const
Int CONST_BEObjective_LeaveShip = 255 Const
Int CONST_BEObjective_Startup = 10 Const
Int CONST_BEObjective_TakeOverEnemyShipObj = 30 Const
Float CONST_BoardingUpdateTimerDelay = 4.0 Const
Int CONST_BoardingUpdateTimerID = 1 Const
Int CONST_Confidence_Foolhardy = 4 Const
Int CONST_LockLevel_Inaccessible = 254 Const
Int CONST_Suspicious_DetectedActor = 2 Const
Float CONST_TakeoffUpdateTimerDelay = 2.0 Const
Int CONST_TakeoffUpdateTimerID = 2 Const
Int CONST_WaitUntilInitializedTimeoutDelay = 120 Const
Actor[] HeatLeeches
Bool ShouldLandingRampsBeOpenOnLoad
ObjectReference[] allCrewSpawnPoints
Float crewSizePercent
Int crewSuspiciousState
Bool disembarkersShouldHaveWeaponsUnequipped
Cell enemyShipCell
ObjectReference enemyShipCockpit
Faction enemyShipCrimeFaction
ObjectReference enemyShipHazard
Location enemyShipInteriorLoc
spaceshipreference enemyShipRef
Int genericCrewSize
Bool hasFinishedSetupDisembarking
Bool hasInitialized
Bool hasPlayerBoardedEnemyShip
Bool hasSetupDisembarking
Bool hasSpawnedCaptain
Bool hasStartedDisembarking
Bool isDropshipEncounter
Bool isReadyForTakeoff
Bool isSurfaceEncounter
Int maxSimultaneousBoarders
bescript:moduledatum[] moduleData
Actor player
ObjectReference playerShipCockpitRef
ObjectReference playerShipDockingDoorRef
Location playerShipInteriorLoc
ObjectReference[] playerShipModulesAllRefs
spaceshipreference playerShipRef
Actor[] potentialBoarders
Actor[] remainingBoarders
Actor[] robots
Bool shouldAbortBoarding
Bool shouldShutdownOnTakeoff
Actor[] turrets
;-- Guards ------------------------------------------
;*** WARNING: Guard declaration syntax is EXPERIMENTAL, subject to change
Guard BECrewGuard
Guard DisembarkingGuard
Guard SpaceshipCrewDecrementGuard
;-- Properties --------------------------------------
Group QuestProperties collapsedonbase
Bool Property ShutDownOnUndock = False Auto
{ DEFAULT=False. Should this quest shut down when the target ship undocks?
This should be FALSE for most Boarding Encounters-- you want the quest to continue to run until the target ship unloads. Otherwise, if you undock, then re-dock, a new and potentially different Boarding Encounter will start. }
Bool Property ShutDownOnUnload = True Auto
{ DEFAULT=True. Should this quest shut down when the target ship unloads?
This should be TRUE for most Boarding Encounters-- you want the quest to shut down when the target ship unloads so it and the target ship can be cleaned up. }
Bool Property ShutDownOnTakeover = True Auto
{ DEFAULT=True. Should this quest shut down if the player takes over the enemy ship?
This should be TRUE for most Boarding Encounters-- the encounter should not remain active once a player has taken over the ship. }
Int Property StageToSetOnBoarding = -1 Auto Const
{ DEFAULT=-1. If >=0, stage to set when the player boards the enemy ship for the first time. }
Int Property StageToSetWhenAllCrewDead = -1 Auto Const
{ Default=-1. If >=0, stage to set when all of the enemy ship's crew has been killed. }
EndGroup
Group CrewProperties
Bool Property ShouldCrewStartInCombat = True Auto Const
{ DEFAULT=True. Is this a hostile boarding encounter?
If True, the crew will start in the Suspicious state, and Companions will play a combat-oriented line when boarding the enemy ship. Does not apply to Surface Encounters. }
Bool Property ShouldSpawnCrew = True Auto Const
{ DEFAULT=True. Should this BE spawn generic crew ? }
Bool Property ShouldSpawnCaptain = True Auto Const
{ DEFAULT=True. Should this BE spawn a generic captain? }
bescript:genericcrewdatum Property CaptainData Auto
{ When a BE spawns its generic crew, if at least one actor is alive (SpaceshipCrew actor value >= 1, adjusted by any mods below), and ShouldSpawnCaptain=True,
the first actor to be spawned will be this Captain. One and only one Captain is spawned (InstancesToSpawn will be ignored).
The Captain will be added to the AllCrew, GenericCrew, and Captain aliases. }
bescript:genericcrewdatum[] Property CrewData Auto
{ When a BE spawns its generic crew, it determines how many slots it has to fill based on the SpaceshipCrew actor value (and any mods below), then cycles
through CrewData until it's spawned the required number of actors, or until it runs out of actors it can spawn.
Crew are added to the AllCrew and GenericCrew aliases. }
Float Property CrewCountPercent = 1.0 Auto Const
{ DEFAULT=1.0. Multiply SpaceshipCrew by this value before spawning crew. Use 0.5 if you want half the normal crew, etc.
NOTE: The SpaceshipCrew count is visible to players during space battles, so you should only modify this for surface encounters or very unusual space encounters,
since players will be expecting a specific number of enemies. }
Int Property CrewCountOverride = -1 Auto Const
{ OPTIONAL, DEFAULT=-1. If >=0, set the number of crew members to spawn to this value. If set, CrewCountMod and the SpaceshipCrew actor value are ignored.
NOTE: The SpaceshipCrew count is visible to players during space battles, so you should only modify this for surface encounters or very unusual space encounters,
since players will be expecting a specific number of enemies. }
Int Property CrewSpawnPattern = 1 Auto Const
{ DEFAULT=1. When spawning generic crew, what pattern should we spawn them in?
0=FILL. Select a module, fill all of its spawn points, move on to the next module, repeat.
1=HALF FILL. Select a module, fill half of its spawn points, move on to the next module, repeat. Spawn excess crew randomly.
2=SPREAD. Select a module, fill one spawn point in it, move on to the next module, repeat. Spawn excess crew randomly.
3=RANDOM. Select spawn points completely at random. }
Bool Property ShouldSpawnCorpses = True Auto Const
{ DEFAULT=True. Should this BE spawn generic corpses? }
bescript:genericcrewdatum[] Property CorpseData Auto
{ OPTIONAL. When a BE spawns its generic crew corpses, it determines how many slots it has to fill based on the SpaceshipCrew actor value (Max-Current)(and any mods below),
then cycles through CrewCorpseData (if any) until it's spawned the required number of actors, or runs out of actors it can spawn.
If CrewCorpseData=None, it just continues using the remaining actors in CrewData. }
Float Property CorpseCountPercent = 1.0 Auto Const
{ DEFAULT=1.0. Multiply the number of corpses to spawn CorpseCountPercent before spawning corpses.
Use 0.5 if you want half the normal number of corpses, etc. }
Int Property CorpseCountOverride = -1 Auto Const
{ OPTIONAL; DEFAULT=-1. If >=0, set the number of crew corpses to spawn to this value. If set, CorpseCountMod and the SpaceshipCrew actor value are ignored. }
Int Property CorpseSpawnPattern = 0 Auto Const
{ DEFAULT=1. When spawning crew corpses, what pattern should we spawn them in?
0=FILL. Select a module, fill all of its spawn points, move on to the next module, repeat.
1=HALF FILL. Select a module, fill half of its spawn points, move on to the next module, repeat. Spawn excess crew randomly.
2=SPREAD. Select a module, fill one spawn point in it, move on to the next module, repeat. Spawn excess crew randomly.
3=RANDOM. Select spawn points completely at random. }
EndGroup
Group TurretProperties collapsedonbase
Float Property TurretSpawnChance = 0.0 Auto Const
{ DEFAULT=0. Chance that this BE will spawn turrets at all; 0=Never, 1=Always, 0.5=Half the time. }
Float Property TurretModulePercentChance = 0.5 Auto Const
{ Default=0.5. If this ship has turrets, what percentage of modules should have them?
The actual number of turrets in each module will be randomly selected between the Min and Max values for that size of module. }
bescript:genericcrewdatum Property TurretData Auto Const
{ If this ship has turrets, the data for the turrets to spawn. }
Int Property TurretsToSpawnMin_Small = 1 Auto Const
{ DEFAULT=1. Min turrets to spawn in a Small module that we select to have turrets. }
Int Property TurretsToSpawnMax_Small = 1 Auto Const
{ DEFAULT=1. Min turrets to spawn in a Small module that we select to have turrets. }
Int Property TurretsToSpawnMin_Large = 2 Auto Const
{ DEFAULT=1. Min turrets to spawn in a Small module that we select to have turrets. }
Int Property TurretsToSpawnMax_Large = 3 Auto Const
{ DEFAULT=1. Min turrets to spawn in a Small module that we select to have turrets. }
Bool Property ShouldTurretsStartUnconscious = False Auto Const
{ DEFAULT=False. If True, spawned turrets will be set unconscious. }
Bool Property ShouldTurretsStartFriendlyToPlayer = False Auto Const
{ DEFAULT=False. If True, spawned turrets will be set friendly to the player. }
EndGroup
Group ComputerProperties collapsedonbase
Float Property GenericComputersEnableChance = 1.0 Auto Const
{ DEFAULT=0. Chance that this BE will enable generic computers if robots and/or turrets have spawned.
0=Never, 1=Always, 0.5=Half the time. }
Float Property GenericComputersModulePercentChance = 0.25 Auto Const
{ DEFAULT=0.5. If we're enabling generic computers, what percentage of modules should have them? }
Int Property GenericComputersMax = -1 Auto Const
{ DEFAULT=-1. Maximum number of generic computers to enable. (-1 for no cap.) }
Int Property GenericComputerRobotLinkStatus = 0 Auto Const
{ DEFAULT=0. Which Computers should get LinkTerminalRobot links to control their robots?
0=All Computers
1=Cockpit Computer Only
2=No Computers }
Int Property GenericComputerTurretLinkStatus = 0 Auto Const
{ DEFAULT=0. Which Computers should get LinkTerminalTurret links to control their robots?
0=All Computers
1=Cockpit Computer Only
2=No Computers }
Bool Property ForceEnableCockpitComputer = False Auto Const
{ DEFAULT=False. If True, absolutely always enable the computer in the cockpit. }
Bool Property ForceEnableGenericComputers = False Auto Const
{ DEFAULT=False. If True, always enable generic computers, even if we don't have any robots or turrets
to link them to. Any BE setting this to True is responsible for making sure they have content. }
Bool Property ShouldEnableGenericComputerCockpit = True Auto Const
{ DEFAULT=True. If we're enabling Generic Computers, should we always enable the cockpit computer? }
Bool Property ShouldPreferGenericComputerThematicModules = True Auto Const
{ DEFAULT=True. If we're enabling Generic Computers, should we always prefer computers in Computer Core
and Engineering-themed modules, all other restrictions permitting? }
Float Property GenericComputerLockPercentChance_Cockpit = 0.0 Auto Const
{ DEFAULT=0.0. Chance that the cockpit's generic computer is locked. }
Float Property GenericComputerLockPercentChance_General = 0.5 Auto Const
{ DEFAULT=0.5. Chance that any other generic computer is locked. }
Float Property GenericComputerLinkedContainerLockPercentChance = 1.0 Auto Const
{ DEFAULT=1.0. Additional chance that a generic computer's linked container will be locked.
This is on top of the base chance of locking any given container, and uses the container min and max lock levels. }
Int Property GenericComputerLockLevelMin = 1 Auto Const
{ DEFAULT=1. Minimum lock level for generic computers we decide to lock. (1=Novice, 2=Advanced, 3=Expert, 4=Master) }
Int Property GenericComputerLockLevelMax = 2 Auto Const
{ DEFAULT=4. Maximum lock level for generic computers we decide to lock. (1=Novice, 2=Advanced, 3=Expert, 4=Master) }
EndGroup
Group ShipProperties collapsedonbase
Bool Property ShouldSupportCrewCriticalHit Auto Const
{ DEFAULT=False. If True, if a Crew Critical Hit occurs, this ship will decompress and kill its crew. If False, nothing will happen. }
Hazard Property ShipHazard Auto
{ DEFAULT=None. If set, this hazard will be active throughout the ship. SetShipHazard and ClearShipHazard can be used to change or remove it. }
Hazard[] Property PotentialHazards Auto Const
{ Default=None. If set, if ShipHazard is None, a PotentialHazard will be selected at random to become the ShipHazard. }
Float Property PotentialHazardChance = 1.0 Auto Const
{ Default=1.0. The chance that one of PotentialHazard's Hazards will be used. The default 1.0 means that if ShipHazard is None and PotentialHazards is filled, one will always be used. }
Bool Property ShouldHaveOxygenAtmosphere = True Auto
{ DEFAULT=True. If True, this ship will have a normal atmosphere. If False, the ship will have no oxygen if it is in space or on a planet with no oxygen. }
Float Property ShipGravity = -1.0 Auto
{ DEFAULT=-1. If >= 0, Overrides the ship's default gravity. SetShipGravity can be used to change it. }
Float Property ShipGravityModPercentChance = 1.0 Auto
{ DEFAULT=1. The chance that ShipGravity's Gravity Override will be used. The default 1.0 means that ShipGravity will always be used, 0.5 would apply it half the time, etc. }
Bool Property ShouldOverrideGravityOnlyInSpace = True Auto Const
{ DEFAULT=True. If True, ShipGravity's override will be used for docking encounters, and ignored for landing encounters, which is usually what you want.
If False, it will be used for both. Use with caution. }
Faction Property OwnerFaction Auto
{ DEFAULT=None. If set, this faction will be set as the owner faction of the ship's interior. Items in the cell will be owned, and taking them will be theft.
Note that this faction must have the 'Can be owner' flag set on the Faction in order for ownership to work. If set, UseAutomaticOwnershipSystem is ignored.
If this is initially none, but the automatic ownership system sets a faction as this ship's owner, that faction is forced into OwnerFaction. }
Bool Property UseAutomaticOwnershipSystem = True Auto Const
{ DEFAULT=True. If True, if the ship is in one of the factions in BEAutomaticOwnershipFactionList, the ship's interior will be set owned by that faction. }
Bool Property ShouldAutoOpenLandingRamp = True Auto Const
{ DEFAULT=True. If True, this ship will automatically open its landing ramp once it has finished landing and spawned disembarking actors (if any). }
Bool Property PlayHostileAlarmUponBoarding = True Auto Const
{ DEFAULT=True. If True, this ship will play a hostile alarm sound on boarding. }
EndGroup
Group ShipLootAndLockProperties collapsedonbase
Bool Property ShouldSpawnLoot = True Auto Const
{ DEFAULT=True. Should this BE spawn standard boarding encounter loot in the Captain's Locker on the cockpit/bridge? }
Float Property ContainersEnabledPercent = 0.5 Auto Const
{ DEFAULT=True. Percent of generic containers on the ship to enable. }
Bool Property ShouldLockDoors = True Auto Const
{ DEFAULT=True. If this ship has doors in its LockableDoors collection, should we lock some of them?
LockableDoors should contain only optional internal doors on the ship-- doors to loot closets and side rooms that,
if locked, won't obstruct the critical path to the cockpit-- so locking them should always be safe from that perspective. }
Float Property LockPercentChance = 0.5 Auto Const
{ DEFAULT=0.5. If ShouldLockDoors, the percent chance any given door in LockableDoors will be locked (0-1.0). }
Int Property LockLevelMin = 1 Auto Const
{ DEFAULT=1. Minimum lock level for doors we decide to lock. (1=Novice, 2=Advanced, 3=Expert, 4=Master) }
Int Property LockLevelMax = 2 Auto Const
{ DEFAULT=4. Maximum lock level for doors we decide to lock. (1=Novice, 2=Advanced, 3=Expert, 4=Master) }
Bool Property ShouldSpawnContraband = True Auto Const
{ DEFAULT=True. If the ship is part of a qualifying faction, should this BE spawn contraband at small item markers? }
Float Property ContrabandChancePercent = 0.5 Auto Const
{ DEFAULT=0.5. Chance that the ship will have any contraband at all, if it's in a qualifying faction. }
Int Property ContrabandMin = 1 Auto Const
{ DEFAULT=1. Minimum amount of contraband to be found on the boarded ship. Contraband will not exceed the number of spawn markers or ContrabandMax. }
Int Property ContrabandMax = 3 Auto Const
{ DEFAULT=3. Maximum amount of contraband to be found on boarded ship }
EndGroup
Group DisembarkingProperties collapsedonbase
Bool Property ShouldSetupDisembarkingOnLanding = True Auto Const
{ Default=True. If we have disembarking actors, spawned or placed, should they disembark as soon as the ship lands? If False, you will need to manually trigger disembarking by calling SetupDisembarking. }
Bool Property ShouldAddDisembarkersToAllCrew = False Auto Const
{ Default=False. Should we add our disembarking actors, spawned or placed, to the AllCrew RefCollectionAlias? }
Bool Property ShouldSpawnDisembarkers = False Auto Const
{ Default=False. Should this BE spawn generic disembarking actors? Only works for Surface BEs; will be ignored for Docking BEs. }
Bool Property ShouldForceDisembarkersWeaponsEquipped = False Auto Const
{ Default=False. Should we force disembarkers to wait with weapons equipped?
By default, actors in non-civilian factions will have their weapons equipped.
This property overrides all other properties and keywords and will be respected. }
Bool Property ShouldForceDisembarkersWeaponsUnequipped = False Auto Const
{ Default=False. Should we force disembarkers to wait with weapons unequipped?
By default, actors in civilian factions will have their weapons unequipped.
This property overrides all other properties and keywords (except Equipped). }
Int Property DisembarkersToSpawn = 0 Auto Const
{ If we do want to spawn generic disembarking actors, how many? }
bescript:genericcrewdatum[] Property DisembarkerData Auto
{ OPTIONAL. When a BE spawns its disembarkers, it cycles through DisembarkerData (if any) until it's spawned the required number of actors, or runs out of actors it can spawn.
If DisembarkerData=None, it just continues using the remaining actors in CrewData. }
EndGroup
Group BoardingProperties collapsedonbase
Bool Property ShouldBoardPlayersShip = False Auto Const
{ DEFAULT=False. If true, the enemy ship's crew will attempt to board the player's ship. }
RefCollectionAlias Property GenericBoarders Auto Const
{ Mandatory if ShouldBoardPlayersShip; Optional otherwise.
RefCollectionAlias to push boarders into. Responsible for packaging them to attack the player's ship. }
ReferenceAlias Property PlayerShipDockingDoor Auto Const
{ Mandatory if ShouldBoardPlayerShip; Optional otherwise.
The load door in the player's ship leading to the enemy ship. }
ReferenceAlias Property PlayerShipCockpit Auto Const
{ Mandatory if ShouldBoardPlayersShip; Optional otherwise.
The player's cockpit module. }
RefCollectionAlias Property PlayerShipModulesAll Auto Const
{ Mandatory if ShouldBoardPlayersShip; Optional otherwise.
RefCollection of all of the modules on the player's ship. }
Float Property MaxPercentOfCrewToBoard = 0.5 Auto Const
{ DEFAULT=0.5. If ShouldBoardPlayersShip, the maximum percentage of the enemy ship's crew that will board the player's ship.
After MaxPercentOfCrewToBoard have tried to board, the player will have to board the enemy ship to take out the rest-- we don't want
to completely depopulate it. }
Float Property MaxSimultaneousBoardersPercent = 0.5 Auto Const
{ DEFAULT=0.5. If ShouldBoardPlayersShip, a cap on the number of enemies that can board the player's ship simultaneously, expressed as a percentage
of the player's ship's SpaceshipCrewRating value. This prevents, say 25 pirates from piling into the Frontier. }
Int Property MinBoardingWaveSize = 2 Auto Const
{ DEFAULT=2. The minimum wave size for a wave of enemies boarding the player's ship. }
Int Property MaxBoardingWaveSize = 6 Auto Const
{ DEFAULT=6. The maximum wave size for a wave of enemies boarding the player's ship. }
EndGroup
Group HeatLeachProperties collapsedonbase
Float Property HeatLeechChance = 0.0 Auto Const
{ Default=0. Percent chance that random Heat Leeches will spawn on this ship, 0.0-1.0. }
Int Property MinHeatLeaches = 1 Auto Const
{ Default=1. If HeatLeechChance > 0 and we do want to spawn Heat Leeches, the minimum number to spawn. }
Int Property MaxHeatLeaches = 3 Auto Const
{ Default=3. If HeatLeechChance > 0 and we do want to spawn Heat Leeches, the maximum number to spawn. }
EndGroup
Group BEObjectiveProperties collapsedonbase
Bool Property ShouldUseBEObjective = True Auto
{ Default=True. Should BE_Objective run for this ship, provided all of the aliases below are filled? }
Quest Property BE_Objective Auto Const mandatory
{ Autofill: The BE_Objective quest. }
GlobalVariable Property BEObjective_OnceOnly_Global Auto Const mandatory
{ Autofill: The BEObjective_OnceOnly_Global. }
GlobalVariable Property BEObjective_OnceOnly_DoneGlobal Auto Const mandatory
{ Autofill: The BEObjective_OnceOnly_DoneGlobal. }
ReferenceAlias Property BEObjective_EnemyShip Auto Const
{ BEObjective's EnemyShip alias. If not filled, BE_Objective will not start. }
ReferenceAlias Property BEObjective_EnemyShipPilotSeat Auto Const
{ BEObjective's EnemyShipPilotSeat alias. If not filled, BE_Objective will not start. }
ReferenceAlias Property BEObjective_EnemyShipLoadDoor Auto Const
{ BEObjective's EnemyShipLoadDoor alias. If not filled, BE_Objective will not start. }
RefCollectionAlias Property BEObjective_AllCrew Auto Const
{ BEObjective's AllCrew alias. }
EndGroup
Group AutofillProperties collapsedonbase
sq_parentscript Property SQ_Parent Auto Const mandatory
reparentscript Property RE_Parent Auto Const mandatory
ReferenceAlias Property PlayerShip Auto Const mandatory
ReferenceAlias Property EnemyShip Auto Const mandatory
ReferenceAlias Property ModuleCockpit Auto Const
ReferenceAlias Property Captain Auto Const
ReferenceAlias Property CaptainSpawnMarker Auto Const
ReferenceAlias Property CaptainsLocker Auto Const mandatory
ReferenceAlias Property LandingDeckControlMarker Auto Const mandatory
ReferenceAlias Property PlayerShipLoadDoor Auto Const mandatory
RefCollectionAlias Property AllCrew Auto Const mandatory
RefCollectionAlias Property AllModules Auto Const mandatory
RefCollectionAlias Property GenericCrew Auto Const mandatory
RefCollectionAlias Property GenericCorpses Auto Const mandatory
RefCollectionAlias Property GenericRobots Auto Const mandatory
RefCollectionAlias Property GenericTurrets Auto Const mandatory
RefCollectionAlias Property DisembarkingCrew Auto Const mandatory
RefCollectionAlias Property EmbarkingCrew Auto Const mandatory
RefCollectionAlias Property Computers Auto Const mandatory
RefCollectionAlias Property Containers Auto Const mandatory
RefCollectionAlias Property LockableDoors Auto Const mandatory
RefCollectionAlias Property SmallItemSpawnMarkers Auto Const mandatory
RefCollectionAlias Property Contraband Auto Const mandatory
RefCollectionAlias Property CrewSpawnMarkers Auto Const mandatory
RefCollectionAlias Property CombatTargets Auto Const
LocationAlias Property PlayerShipInteriorLocation Auto Const mandatory
LocationAlias Property EnemyShipInteriorLocation Auto Const mandatory
LocationAlias Property EnemyShipExteriorLocation Auto Const mandatory
GlobalVariable Property BE_ShipCrewSizeSmall Auto Const mandatory
GlobalVariable Property BE_ShipCrewSizeMedium Auto Const mandatory
GlobalVariable Property BE_ForceNextGravityOverride Auto Const mandatory
Keyword Property LinkShipModule Auto Const mandatory
Keyword Property LinkShipModuleCrewSpawn Auto Const mandatory
Keyword Property LinkShipModuleTurretSpawn Auto Const mandatory
Keyword Property LinkShipModuleComputer Auto Const mandatory
Keyword Property LinkShipLoadDoor Auto Const mandatory
Keyword Property LinkHazardVolume Auto Const mandatory
Keyword Property LinkCombatTravelTarget Auto Const mandatory
Keyword Property LinkTerminalRobot Auto Const mandatory
Keyword Property LinkTerminalTurret Auto Const mandatory
Keyword Property LinkTerminalContainer Auto Const mandatory
Keyword Property BEEncounterTypeDocking Auto Const mandatory
Keyword Property BEEncounterTypeSurface Auto Const mandatory
Keyword Property BEMarkerInUseKeyword Auto Const mandatory
Keyword Property BEBoarderPlayerShipCockpitLink Auto Const mandatory
Keyword Property BEBoarderPlayerShipModuleLink Auto Const mandatory
Keyword Property BEDropship Auto Const mandatory
Keyword Property BEDisembarkerLink Auto Const mandatory
Keyword Property BEDisembarkerForceWeaponsEquipped Auto Const mandatory
Keyword Property BEDisembarkerForceWeaponsUnequipped Auto Const mandatory
Keyword Property BECrewAttackerKeyword Auto Const mandatory
Keyword Property BECrewDefenderKeyword Auto Const mandatory
Keyword Property BENoCrewKeyword Auto Const mandatory
Keyword Property BESurfaceCrewSize_NoCrew Auto Const mandatory
Keyword Property BENoTakeoverObjectiveKeyword Auto Const mandatory
Keyword Property BENoAutomaticOwnershipKeyword Auto Const mandatory
Keyword Property BEHostileBoardingEncounterKeyword Auto Const mandatory
Keyword Property ActorTypeTurret Auto Const mandatory
Keyword Property ActorTypeRobot Auto Const mandatory
Keyword Property ENV_Loc_NotSealedEnvironment Auto Const mandatory
Keyword Property DynamicallyLinkedDoorTeleportMarkerKeyword Auto Const mandatory
Keyword Property LootSafeKeyword Auto Const mandatory
Keyword Property SpaceshipPreventRampOpenOnLanding Auto Const
Faction Property REPlayerFriend Auto Const mandatory
FormList Property BEAutomaticOwnershipFactionList Auto Const mandatory
FormList Property BECivilianShipFactionList Auto Const mandatory
FormList Property BEContrabandShipFactionList Auto Const mandatory
FormList Property BEHazardKeywordList Auto Const
FormList Property BEHazardFormList Auto Const
ActorBase Property ParasiteA_HeatLeech Auto Const mandatory
ActorValue Property Aggression Auto Const mandatory
ActorValue Property Confidence Auto Const mandatory
ActorValue Property Suspicious Auto Const mandatory
ActorValue Property SpaceshipCrew Auto Const mandatory
ActorValue Property SpaceshipCrewRating Auto Const mandatory
ActorValue Property SpaceshipCriticalHitCrew Auto Const mandatory
ActorValue Property BEBoarderCapturedModule Auto Const mandatory
ActorValue Property BEWaitingForLandingRampValue Auto Const mandatory
ActorValue Property BEDisembarkWithWeaponsDrawnValue Auto Const mandatory
LocationRefType Property Ship_CrewSpawn_RefType Auto Const mandatory
LocationRefType Property Ship_TurretSpawn_RefType Auto Const mandatory
LocationRefType Property Ship_Computer_RefType Auto Const mandatory
LocationRefType Property Ship_Module_Computer_RefType Auto Const mandatory
LocationRefType Property Ship_Module_Engineering_RefType Auto Const mandatory
LocationRefType Property Ship_Module_Small_RefType Auto Const mandatory
LocationRefType Property Ship_Module_Large_RefType Auto Const mandatory
LeveledItem Property LL_BE_ShipCaptainsLockerLoot_Small Auto Const mandatory
LeveledItem Property LL_BE_ShipCaptainsLockerLoot_Medium Auto Const mandatory
LeveledItem Property LL_BE_ShipCaptainsLockerLoot_Large Auto Const mandatory
LeveledItem Property Loot_LPI_Contraband_Any Auto Const mandatory
sq_playershipscript Property SQ_PlayerShip Auto Const
wwiseevent Property OBJ_Alarm_BoardingAlert Auto Const
EndGroup
Group DebugProperties
Bool Property UseSecondLinkedRefAsCombatTravelTarget = False Auto Const
Bool Property ShowTraces = True Auto Const
EndGroup
Int Property CONST_SpawnPattern_Fill = 0 Auto Const hidden
Int Property CONST_SpawnPattern_Half = 1 Auto Const hidden
Int Property CONST_SpawnPattern_Spread = 2 Auto Const hidden
Int Property CONST_SpawnPattern_Random = 3 Auto Const hidden
Int Property CONST_SpawnPrioritization_None = 0 Auto Const hidden
Int Property CONST_SpawnPrioritization_CockpitLargeSmall = 1 Auto Const hidden
Int Property CONST_GenericComputerLinkStatus_All = 0 Auto Const hidden
Int Property CONST_GenericComputerLinkStatus_CockpitOnly = 1 Auto Const hidden
Int Property CONST_GenericComputerLinkStatus_None = 2 Auto Const hidden
;-- Functions ---------------------------------------
Event OnQuestStarted()
player = Game.GetPlayer() ; #DEBUG_LINE_NO:566
playerShipInteriorLoc = PlayerShipInteriorLocation.GetLocation() ; #DEBUG_LINE_NO:567
enemyShipInteriorLoc = EnemyShipInteriorLocation.GetLocation() ; #DEBUG_LINE_NO:568
enemyShipRef = EnemyShip.GetRef() as spaceshipreference ; #DEBUG_LINE_NO:569
enemyShipCockpit = ModuleCockpit.GetRef() ; #DEBUG_LINE_NO:570
enemyShipCell = enemyShipCockpit.GetParentCell() ; #DEBUG_LINE_NO:571
enemyShipCrimeFaction = enemyShipRef.GetCrimeFaction() ; #DEBUG_LINE_NO:572
isSurfaceEncounter = enemyShipRef.GetWorldspace() == None ; #DEBUG_LINE_NO:573
isSurfaceEncounter = !isSurfaceEncounter ; #DEBUG_LINE_NO:573
isDropshipEncounter = enemyShipRef.HasKeyword(BEDropship) ; #DEBUG_LINE_NO:574
allCrewSpawnPoints = new ObjectReference[0] ; #DEBUG_LINE_NO:575
robots = new Actor[0] ; #DEBUG_LINE_NO:576
turrets = new Actor[0] ; #DEBUG_LINE_NO:577
BEAliasCorpses = new Actor[0] ; #DEBUG_LINE_NO:578
If isDropshipEncounter ; #DEBUG_LINE_NO:581
ShutDownOnUnload = False ; #DEBUG_LINE_NO:583
Else ; #DEBUG_LINE_NO:
If isSurfaceEncounter ; #DEBUG_LINE_NO:589
If ShowTraces ; #DEBUG_LINE_NO:
; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
enemyShipRef.SetExteriorLoadDoorInaccessible(False) ; #DEBUG_LINE_NO:592
EndIf ; #DEBUG_LINE_NO:
If ShouldCrewStartInCombat && !isSurfaceEncounter ; #DEBUG_LINE_NO:595
crewSuspiciousState = CONST_Suspicious_DetectedActor ; #DEBUG_LINE_NO:596
enemyShipRef.AddKeyword(BEHostileBoardingEncounterKeyword) ; #DEBUG_LINE_NO:597
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
Self.RegisterForRemoteEvent(player as ScriptObject, "OnLocationChange") ; #DEBUG_LINE_NO:602
Self.RegisterForRemoteEvent(enemyShipCockpit as ScriptObject, "OnCellLoad") ; #DEBUG_LINE_NO:603
Self.RegisterForRemoteEvent(enemyShipRef as ScriptObject, "OnLoad") ; #DEBUG_LINE_NO:604
Self.RegisterForCustomEvent(SQ_PlayerShip as ScriptObject, "sq_playershipscript_SQ_PlayerShipChanged") ; #DEBUG_LINE_NO:605
If ShouldSupportCrewCriticalHit && !isSurfaceEncounter && !Self.CheckForCrewCriticalHit() ; #DEBUG_LINE_NO:606
Self.RegisterForActorValueChangedEvent(enemyShipRef as ObjectReference, SpaceshipCriticalHitCrew) ; #DEBUG_LINE_NO:607
EndIf ; #DEBUG_LINE_NO:
If ShutDownOnUndock ; #DEBUG_LINE_NO:609
Self.RegisterForRemoteEvent(enemyShipRef as ScriptObject, "OnShipUndock") ; #DEBUG_LINE_NO:610
EndIf ; #DEBUG_LINE_NO:
If ShutDownOnUnload ; #DEBUG_LINE_NO:612
Self.RegisterForRemoteEvent(enemyShipRef as ScriptObject, "OnUnload") ; #DEBUG_LINE_NO:613
EndIf ; #DEBUG_LINE_NO:
If isSurfaceEncounter ; #DEBUG_LINE_NO:617
SQ_PlayerShip.ClearLandingZone(enemyShipRef) ; #DEBUG_LINE_NO:618
EndIf ; #DEBUG_LINE_NO:
If !isDropshipEncounter ; #DEBUG_LINE_NO:621
Self.BuildModuleData() ; #DEBUG_LINE_NO:623
If OwnerFaction != None ; #DEBUG_LINE_NO:626
enemyShipCell.SetFactionOwner(OwnerFaction) ; #DEBUG_LINE_NO:627
ElseIf UseAutomaticOwnershipSystem && !enemyShipRef.HasKeyword(BENoAutomaticOwnershipKeyword) ; #DEBUG_LINE_NO:628
Faction[] ownerFactions = BEAutomaticOwnershipFactionList.GetArray(False) as Faction[] ; #DEBUG_LINE_NO:629
Bool ownerFound = False ; #DEBUG_LINE_NO:630
Int i = 0 ; #DEBUG_LINE_NO:631
While !ownerFound && i < ownerFactions.Length ; #DEBUG_LINE_NO:632
If enemyShipRef.IsInFaction(ownerFactions[i]) ; #DEBUG_LINE_NO:633
enemyShipCell.SetFactionOwner(ownerFactions[i]) ; #DEBUG_LINE_NO:634
OwnerFaction = ownerFactions[i] ; #DEBUG_LINE_NO:635
ownerFound = True ; #DEBUG_LINE_NO:636
EndIf ; #DEBUG_LINE_NO:
i += 1 ; #DEBUG_LINE_NO:638
EndWhile ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
If OwnerFaction != None ; #DEBUG_LINE_NO:641
enemyShipCell.SetOffLimits(True) ; #DEBUG_LINE_NO:642
EndIf ; #DEBUG_LINE_NO:
crewSizePercent = enemyShipRef.GetValue(SpaceshipCrew) / enemyShipRef.GetBaseValue(SpaceshipCrew) ; #DEBUG_LINE_NO:646
If ShouldSpawnCrew && CrewData != None ; #DEBUG_LINE_NO:647
genericCrewSize = Self.SetupGenericCrew(CrewData, CrewCountPercent, CrewCountOverride, CrewSpawnPattern, CONST_SpawnPrioritization_CockpitLargeSmall, False) ; #DEBUG_LINE_NO:648
Int spaceshipCrewValue = enemyShipRef.GetValue(SpaceshipCrew) as Int ; #DEBUG_LINE_NO:650
If genericCrewSize < spaceshipCrewValue ; #DEBUG_LINE_NO:651
If ShowTraces ; #DEBUG_LINE_NO:
; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
enemyShipRef.SetValue(SpaceshipCrew, genericCrewSize as Float) ; #DEBUG_LINE_NO:655
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
If ShouldSpawnCorpses ; #DEBUG_LINE_NO:658
If CorpseData == None ; #DEBUG_LINE_NO:659
CorpseData = CrewData ; #DEBUG_LINE_NO:660
EndIf ; #DEBUG_LINE_NO:
If CorpseData != None ; #DEBUG_LINE_NO:662
Self.SetupGenericCrew(CorpseData, CorpseCountPercent, CorpseCountOverride, CorpseSpawnPattern, CONST_SpawnPrioritization_None, True) ; #DEBUG_LINE_NO:663
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
If TurretData != None && TurretSpawnChance > 0.0 && TurretModulePercentChance > 0.0 && Utility.RandomFloat(0.0, 1.0) < TurretSpawnChance ; #DEBUG_LINE_NO:666
Int turretsSpawned = Self.SetupTurrets() ; #DEBUG_LINE_NO:667
enemyShipRef.SetValue(SpaceshipCrew, enemyShipRef.GetValue(SpaceshipCrew) + turretsSpawned as Float) ; #DEBUG_LINE_NO:668
EndIf ; #DEBUG_LINE_NO:
If HeatLeechChance > 0.0 && Utility.RandomFloat(0.0, 1.0) < HeatLeechChance ; #DEBUG_LINE_NO:670
Self.SetupHeatLeeches() ; #DEBUG_LINE_NO:671
EndIf ; #DEBUG_LINE_NO:
Keyword[] hazardKeywords = BEHazardKeywordList.GetArray(False) as Keyword[] ; #DEBUG_LINE_NO:675
Hazard[] hazardType = BEHazardFormList.GetArray(False) as Hazard[] ; #DEBUG_LINE_NO:676
Int I = 0 ; #DEBUG_LINE_NO:677
Bool hazardChosen = False ; #DEBUG_LINE_NO:678
While I < hazardKeywords.Length && hazardChosen == False ; #DEBUG_LINE_NO:679
If enemyShipRef.HasKeyword(hazardKeywords[I]) ; #DEBUG_LINE_NO:680
ShipHazard = hazardType[I] ; #DEBUG_LINE_NO:681
hazardChosen = True ; #DEBUG_LINE_NO:682
EndIf ; #DEBUG_LINE_NO:
I += 1 ; #DEBUG_LINE_NO:684
EndWhile ; #DEBUG_LINE_NO:
If ShipHazard == None && PotentialHazards != None && PotentialHazards.Length > 0 && Utility.RandomFloat(0.0, 1.0) < PotentialHazardChance ; #DEBUG_LINE_NO:686
ShipHazard = PotentialHazards[Utility.RandomInt(0, PotentialHazards.Length - 1)] ; #DEBUG_LINE_NO:687
EndIf ; #DEBUG_LINE_NO:
If ShipHazard != None ; #DEBUG_LINE_NO:689
Self.SetShipHazard(ShipHazard) ; #DEBUG_LINE_NO:690
EndIf ; #DEBUG_LINE_NO:
If !ShouldHaveOxygenAtmosphere ; #DEBUG_LINE_NO:694
enemyShipInteriorLoc.AddKeyword(ENV_Loc_NotSealedEnvironment) ; #DEBUG_LINE_NO:695
EndIf ; #DEBUG_LINE_NO:
If ShipGravity >= 0.0 && ShipHazard == None ; #DEBUG_LINE_NO:699
If ShipGravityModPercentChance < 0.0 || ShipGravityModPercentChance >= 1.0 || Utility.RandomFloat(0.0, 1.0) < ShipGravityModPercentChance ; #DEBUG_LINE_NO:700
Self.SetShipGravity(ShipGravity) ; #DEBUG_LINE_NO:702
ElseIf BE_ForceNextGravityOverride != None && BE_ForceNextGravityOverride.GetValue() >= 0.0 ; #DEBUG_LINE_NO:703
Self.SetShipGravity(BE_ForceNextGravityOverride.GetValue()) ; #DEBUG_LINE_NO:705
BE_ForceNextGravityOverride.SetValue(-1.0) ; #DEBUG_LINE_NO:706
Else ; #DEBUG_LINE_NO:
Self.SetShipGravity(1.0) ; #DEBUG_LINE_NO:708
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
If Self.CheckForCrewCriticalHit() ; #DEBUG_LINE_NO:713
Self.DecompressShipAndKillCrew() ; #DEBUG_LINE_NO:714
EndIf ; #DEBUG_LINE_NO:
ObjectReference[] containerRefs = commonarrayfunctions.CopyAndRandomizeObjArray(Containers.GetArray()) ; #DEBUG_LINE_NO:718
Int containerDisableCount = (containerRefs.Length as Float * (1.0 - ContainersEnabledPercent)) as Int ; #DEBUG_LINE_NO:719
I = 0 ; #DEBUG_LINE_NO:720
While I < containerRefs.Length ; #DEBUG_LINE_NO:721
If I < containerDisableCount ; #DEBUG_LINE_NO:722
containerRefs[I].DisableNoWait(False) ; #DEBUG_LINE_NO:723
ElseIf containerRefs[I].HasKeyword(LootSafeKeyword) ; #DEBUG_LINE_NO:724
containerRefs[I].Lock(True, False, True) ; #DEBUG_LINE_NO:725
containerRefs[I].SetLockLevel(Utility.RandomInt(LockLevelMin, LockLevelMax) * 25) ; #DEBUG_LINE_NO:726
EndIf ; #DEBUG_LINE_NO:
I += 1 ; #DEBUG_LINE_NO:728
EndWhile ; #DEBUG_LINE_NO:
If ShouldSpawnContraband ; #DEBUG_LINE_NO:732
Float RandomFloat = Utility.RandomFloat(0.0, 1.0) ; #DEBUG_LINE_NO:733
If RandomFloat <= ContrabandChancePercent ; #DEBUG_LINE_NO:734
Faction[] contrabandShipFactions = BEContrabandShipFactionList.GetArray(False) as Faction[] ; #DEBUG_LINE_NO:736
I = 0 ; #DEBUG_LINE_NO:737
Bool contrabandFactionFound = False ; #DEBUG_LINE_NO:738
While I < contrabandShipFactions.Length && contrabandFactionFound == False ; #DEBUG_LINE_NO:739
If enemyShipRef.IsInFaction(contrabandShipFactions[I]) ; #DEBUG_LINE_NO:740
Self.SpawnContraband() ; #DEBUG_LINE_NO:741
contrabandFactionFound = True ; #DEBUG_LINE_NO:742
EndIf ; #DEBUG_LINE_NO:
I += 1 ; #DEBUG_LINE_NO:744
EndWhile ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
If ShouldLockDoors ; #DEBUG_LINE_NO:750
I = 0 ; #DEBUG_LINE_NO:751
While I < LockableDoors.GetCount() ; #DEBUG_LINE_NO:752
If Utility.RandomFloat(0.0, 1.0) < LockPercentChance ; #DEBUG_LINE_NO:753
ObjectReference currentDoor = LockableDoors.GetAt(I) ; #DEBUG_LINE_NO:754
currentDoor.Lock(True, False, True) ; #DEBUG_LINE_NO:755
currentDoor.SetLockLevel(Utility.RandomInt(LockLevelMin, LockLevelMax) * 25) ; #DEBUG_LINE_NO:756
EndIf ; #DEBUG_LINE_NO:
I += 1 ; #DEBUG_LINE_NO:758
EndWhile ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
Self.SetupComputers() ; #DEBUG_LINE_NO:763
EndIf ; #DEBUG_LINE_NO:
If isSurfaceEncounter ; #DEBUG_LINE_NO:767
ObjectReference[] myDisembarkers = enemyShipRef.GetRefsLinkedToMe(BEDisembarkerLink, None) ; #DEBUG_LINE_NO:769
If ShowTraces ; #DEBUG_LINE_NO:
; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
DisembarkingCrew.AddArray(myDisembarkers) ; #DEBUG_LINE_NO:773
If ShouldSpawnDisembarkers ; #DEBUG_LINE_NO:776
If DisembarkerData == None ; #DEBUG_LINE_NO:777
DisembarkerData = CrewData ; #DEBUG_LINE_NO:778
EndIf ; #DEBUG_LINE_NO:
Self.SpawnGenericActors(DisembarkerData, DisembarkersToSpawn, None, False, True) ; #DEBUG_LINE_NO:780
EndIf ; #DEBUG_LINE_NO:
If ShouldForceDisembarkersWeaponsEquipped ; #DEBUG_LINE_NO:784
disembarkersShouldHaveWeaponsUnequipped = False ; #DEBUG_LINE_NO:785
ElseIf ShouldForceDisembarkersWeaponsUnequipped ; #DEBUG_LINE_NO:
disembarkersShouldHaveWeaponsUnequipped = True ; #DEBUG_LINE_NO:787
ElseIf enemyShipRef.HasKeyword(BEDisembarkerForceWeaponsUnequipped) ; #DEBUG_LINE_NO:788
disembarkersShouldHaveWeaponsUnequipped = False ; #DEBUG_LINE_NO:789
ElseIf enemyShipRef.HasKeyword(BEDisembarkerForceWeaponsEquipped) ; #DEBUG_LINE_NO:790
disembarkersShouldHaveWeaponsUnequipped = True ; #DEBUG_LINE_NO:791
ElseIf OwnerFaction != None ; #DEBUG_LINE_NO:794
disembarkersShouldHaveWeaponsUnequipped = BECivilianShipFactionList.Find(OwnerFaction as Form) >= 0 ; #DEBUG_LINE_NO:795
Else ; #DEBUG_LINE_NO:
Faction[] civilianShipFactions = BECivilianShipFactionList.GetArray(False) as Faction[] ; #DEBUG_LINE_NO:797
Int i = 0 ; #DEBUG_LINE_NO:798
While !disembarkersShouldHaveWeaponsUnequipped && i < civilianShipFactions.Length ; #DEBUG_LINE_NO:799
If enemyShipRef.IsInFaction(civilianShipFactions[i]) ; #DEBUG_LINE_NO:800
disembarkersShouldHaveWeaponsUnequipped = True ; #DEBUG_LINE_NO:801
EndIf ; #DEBUG_LINE_NO:
i += 1 ; #DEBUG_LINE_NO:803
EndWhile ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
If ShouldSetupDisembarkingOnLanding ; #DEBUG_LINE_NO:808
Self.RegisterForRemoteEvent(enemyShipRef as ScriptObject, "OnShipLanding") ; #DEBUG_LINE_NO:809
Self.RegisterForRemoteEvent(enemyShipRef as ScriptObject, "OnShipRampDown") ; #DEBUG_LINE_NO:810
Self.SetupDisembarking() ; #DEBUG_LINE_NO:811
Else ; #DEBUG_LINE_NO:
Self.RegisterForRemoteEvent(enemyShipRef as ScriptObject, "OnShipLanding") ; #DEBUG_LINE_NO:813
If ShouldAutoOpenLandingRamp && enemyShipRef.IsLanded() ; #DEBUG_LINE_NO:814
Self.SetEnemyShipLandingRampsOpenState(ShouldAutoOpenLandingRamp) ; #DEBUG_LINE_NO:815
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
If ShouldBoardPlayersShip ; #DEBUG_LINE_NO:821
playerShipRef = PlayerShip.GetRef() as spaceshipreference ; #DEBUG_LINE_NO:823
playerShipDockingDoorRef = PlayerShipDockingDoor.GetRef() ; #DEBUG_LINE_NO:824
playerShipCockpitRef = PlayerShipCockpit.GetRef() ; #DEBUG_LINE_NO:825
playerShipModulesAllRefs = PlayerShipModulesAll.GetArray() ; #DEBUG_LINE_NO:826
maxSimultaneousBoarders = Math.Max(Math.Round(playerShipRef.GetValue(SpaceshipCrewRating) * MaxSimultaneousBoardersPercent) as Float, MinBoardingWaveSize as Float) as Int ; #DEBUG_LINE_NO:827
Int remainingBoardersCount = Math.Round(GenericCrew.GetCount() as Float * MaxPercentOfCrewToBoard) ; #DEBUG_LINE_NO:833
Int potentialBoardersCount = GenericCrew.GetCount() - remainingBoardersCount ; #DEBUG_LINE_NO:834
remainingBoarders = new Actor[remainingBoardersCount] ; #DEBUG_LINE_NO:835
potentialBoarders = new Actor[potentialBoardersCount] ; #DEBUG_LINE_NO:836
Int i = GenericCrew.GetCount() - 1 ; #DEBUG_LINE_NO:837
While i >= 0 && remainingBoardersCount > 0 ; #DEBUG_LINE_NO:838
remainingBoarders[remainingBoardersCount - 1] = GenericCrew.GetAt(i) as Actor ; #DEBUG_LINE_NO:839
remainingBoardersCount -= 1 ; #DEBUG_LINE_NO:840
i -= 1 ; #DEBUG_LINE_NO:841
EndWhile ; #DEBUG_LINE_NO:
While i >= 0 && potentialBoardersCount > 0 ; #DEBUG_LINE_NO:843
potentialBoarders[potentialBoardersCount - 1] = GenericCrew.GetAt(i) as Actor ; #DEBUG_LINE_NO:844
potentialBoardersCount -= 1 ; #DEBUG_LINE_NO:845
i -= 1 ; #DEBUG_LINE_NO:846
EndWhile ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
hasInitialized = True ; #DEBUG_LINE_NO:851
If ShouldBoardPlayersShip ; #DEBUG_LINE_NO:854
Self.RegisterForRemoteEvent(enemyShipRef as ScriptObject, "OnShipDock") ; #DEBUG_LINE_NO:855
If enemyShipRef.IsDocked() ; #DEBUG_LINE_NO:856
Self.UnregisterForRemoteEvent(enemyShipRef as ScriptObject, "OnShipDock") ; #DEBUG_LINE_NO:857
Self.UpdateBoarding() ; #DEBUG_LINE_NO:858
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
Self.RegisterForCustomEvent(SQ_Parent as ScriptObject, "sq_parentscript_SQ_BEForceStop") ; #DEBUG_LINE_NO:863
SQ_Parent.SendBEStartedEvent(enemyShipRef as ObjectReference, Self) ; #DEBUG_LINE_NO:866
If ShowTraces ; #DEBUG_LINE_NO:
; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndEvent
Function BuildModuleData()
ObjectReference[] modulesWithCrew = AllModules.GetArray() ; #DEBUG_LINE_NO:875
Float startTime = Utility.GetCurrentRealTime() ; #DEBUG_LINE_NO:876
Int I = 0 ; #DEBUG_LINE_NO:877
While I < modulesWithCrew.Length ; #DEBUG_LINE_NO:878
If modulesWithCrew[I].HasKeyword(BENoCrewKeyword) || !modulesWithCrew[I].HasLocRefType(Ship_Module_Small_RefType) && modulesWithCrew[I] != enemyShipCockpit ; #DEBUG_LINE_NO:879
modulesWithCrew.remove(I, 1) ; #DEBUG_LINE_NO:880
I -= 1 ; #DEBUG_LINE_NO:881
EndIf ; #DEBUG_LINE_NO:
I += 1 ; #DEBUG_LINE_NO:883
EndWhile ; #DEBUG_LINE_NO:
moduleData = new bescript:moduledatum[modulesWithCrew.Length] ; #DEBUG_LINE_NO:885
I = 0 ; #DEBUG_LINE_NO:886
While I < moduleData.Length ; #DEBUG_LINE_NO:887
ObjectReference currentModuleRef = modulesWithCrew[I] ; #DEBUG_LINE_NO:888
ObjectReference[] crewSpawnRefs = currentModuleRef.GetRefsLinkedToMe(LinkShipModuleCrewSpawn, None) ; #DEBUG_LINE_NO:889
ObjectReference[] turretSpawnRefs = currentModuleRef.GetRefsLinkedToMe(LinkShipModuleTurretSpawn, None) ; #DEBUG_LINE_NO:890
ObjectReference[] computerRefs = currentModuleRef.GetRefsLinkedToMe(LinkShipModuleComputer, None) ; #DEBUG_LINE_NO:891
bescript:moduledatum currentModuleData = new bescript:moduledatum ; #DEBUG_LINE_NO:892
currentModuleData.moduleRef = currentModuleRef ; #DEBUG_LINE_NO:893
If crewSpawnRefs.Length >= 1 ; #DEBUG_LINE_NO:894
currentModuleData.shipCrewSpawnMarkerRef01 = crewSpawnRefs[0] ; #DEBUG_LINE_NO:895
If crewSpawnRefs.Length >= 2 ; #DEBUG_LINE_NO:896
currentModuleData.shipCrewSpawnMarkerRef02 = crewSpawnRefs[1] ; #DEBUG_LINE_NO:897
If crewSpawnRefs.Length >= 3 ; #DEBUG_LINE_NO:898
currentModuleData.shipCrewSpawnMarkerRef03 = crewSpawnRefs[2] ; #DEBUG_LINE_NO:899
If crewSpawnRefs.Length >= 4 ; #DEBUG_LINE_NO:900
currentModuleData.shipCrewSpawnMarkerRef04 = crewSpawnRefs[3] ; #DEBUG_LINE_NO:901
If crewSpawnRefs.Length >= 5 ; #DEBUG_LINE_NO:902
currentModuleData.shipCrewSpawnMarkerRef05 = crewSpawnRefs[4] ; #DEBUG_LINE_NO:903
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
Int j = 0 ; #DEBUG_LINE_NO:909
While j < crewSpawnRefs.Length ; #DEBUG_LINE_NO:910
allCrewSpawnPoints.add(crewSpawnRefs[j], 1) ; #DEBUG_LINE_NO:911
j += 1 ; #DEBUG_LINE_NO:912
EndWhile ; #DEBUG_LINE_NO:
If turretSpawnRefs.Length >= 1 ; #DEBUG_LINE_NO:914
currentModuleData.shipTurretSpawnMarkerRef01 = turretSpawnRefs[0] ; #DEBUG_LINE_NO:915
If turretSpawnRefs.Length >= 2 ; #DEBUG_LINE_NO:916
currentModuleData.shipTurretSpawnMarkerRef02 = turretSpawnRefs[1] ; #DEBUG_LINE_NO:917
If turretSpawnRefs.Length >= 3 ; #DEBUG_LINE_NO:918
currentModuleData.shipTurretSpawnMarkerRef03 = turretSpawnRefs[2] ; #DEBUG_LINE_NO:919
If turretSpawnRefs.Length >= 4 ; #DEBUG_LINE_NO:920
currentModuleData.shipTurretSpawnMarkerRef04 = turretSpawnRefs[3] ; #DEBUG_LINE_NO:921
If turretSpawnRefs.Length >= 5 ; #DEBUG_LINE_NO:922
currentModuleData.shipTurretSpawnMarkerRef05 = turretSpawnRefs[4] ; #DEBUG_LINE_NO:923
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
If computerRefs.Length >= 1 ; #DEBUG_LINE_NO:929
currentModuleData.shipComputerRef = computerRefs[0] ; #DEBUG_LINE_NO:930
EndIf ; #DEBUG_LINE_NO:
moduleData[I] = currentModuleData ; #DEBUG_LINE_NO:932
I += 1 ; #DEBUG_LINE_NO:933
EndWhile ; #DEBUG_LINE_NO:
If allCrewSpawnPoints.Length == 0 ; #DEBUG_LINE_NO:935
allCrewSpawnPoints = CrewSpawnMarkers.GetArray() ; #DEBUG_LINE_NO:937
EndIf ; #DEBUG_LINE_NO:
modulesWithCrew = AllModules.GetArray() ; #DEBUG_LINE_NO:941
EndFunction
Event Actor.OnLocationChange(Actor akSource, Location akOldLoc, Location akNewLoc)
If akSource == Game.GetPlayer() ; #DEBUG_LINE_NO:948
If akNewLoc == enemyShipInteriorLoc ; #DEBUG_LINE_NO:949
If ShouldUseBEObjective ; #DEBUG_LINE_NO:951
If enemyShipRef.HasKeyword(BENoTakeoverObjectiveKeyword) ; #DEBUG_LINE_NO:955
ShouldUseBEObjective = False ; #DEBUG_LINE_NO:957
ElseIf enemyShipRef.HasKeyword(BESurfaceCrewSize_NoCrew) ; #DEBUG_LINE_NO:958
ShouldUseBEObjective = False ; #DEBUG_LINE_NO:960
ElseIf BEObjective_OnceOnly_Global.GetValue() == 1.0 && BEObjective_OnceOnly_DoneGlobal.GetValue() == 1.0 ; #DEBUG_LINE_NO:961
ShouldUseBEObjective = False ; #DEBUG_LINE_NO:963
ElseIf BEObjective_EnemyShip == None || BEObjective_EnemyShipPilotSeat == None || BEObjective_EnemyShipLoadDoor == None || BEObjective_AllCrew == None ; #DEBUG_LINE_NO:964
ShouldUseBEObjective = False ; #DEBUG_LINE_NO:966
Else ; #DEBUG_LINE_NO:
BE_Objective.SetStage(CONST_BEObjective_Startup) ; #DEBUG_LINE_NO:969
BEObjective_EnemyShip.ForceRefTo(enemyShipRef as ObjectReference) ; #DEBUG_LINE_NO:970
BEObjective_EnemyShip.RefillDependentAliases() ; #DEBUG_LINE_NO:971
If BEObjective_EnemyShipPilotSeat.GetRef() == None || BEObjective_EnemyShipLoadDoor.GetRef() == None ; #DEBUG_LINE_NO:974
ShouldUseBEObjective = False ; #DEBUG_LINE_NO:975
Else ; #DEBUG_LINE_NO:
If enemyShipRef.GetValue(SpaceshipCrew) > 0.0 ; #DEBUG_LINE_NO:977
Int I = 0 ; #DEBUG_LINE_NO:979
While I < AllCrew.GetCount() ; #DEBUG_LINE_NO:980
Actor current = AllCrew.GetAt(I) as Actor ; #DEBUG_LINE_NO:981
If !current.IsDead() ; #DEBUG_LINE_NO:982
BEObjective_AllCrew.AddRef(current as ObjectReference) ; #DEBUG_LINE_NO:983
EndIf ; #DEBUG_LINE_NO:
I += 1 ; #DEBUG_LINE_NO:985
EndWhile ; #DEBUG_LINE_NO:
If BEObjective_AllCrew.GetCount() == 0 ; #DEBUG_LINE_NO:987
; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
If BEObjective_AllCrew.GetCount() > 0 ; #DEBUG_LINE_NO:991
(BEObjective_EnemyShipPilotSeat as beobjectiveblockpilotseatscript).BlockTakeover(Self) ; #DEBUG_LINE_NO:992
BE_Objective.SetStage(CONST_BEObjective_KillEnemyCrewObj) ; #DEBUG_LINE_NO:993
Else ; #DEBUG_LINE_NO:
If ShipGravity < 1.0 ; #DEBUG_LINE_NO:996
(BEObjective_EnemyShipPilotSeat as beobjectiveblockpilotseatscript).BlockTakeover(Self) ; #DEBUG_LINE_NO:997
EndIf ; #DEBUG_LINE_NO:
BE_Objective.SetStage(CONST_BEObjective_TakeOverEnemyShipObj) ; #DEBUG_LINE_NO:999
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
ElseIf akOldLoc == enemyShipInteriorLoc ; #DEBUG_LINE_NO:1005
If ShouldUseBEObjective ; #DEBUG_LINE_NO:1007
BE_Objective.SetStage(CONST_BEObjective_LeaveShip) ; #DEBUG_LINE_NO:1008
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndEvent
Function RegisterBEAliasActor(Actor BEAliasActor, Bool startsDead, Bool shouldIncludeInCrew, Bool shouldIncludeAtFrontOfBoardingParty, Bool shouldIncludeAtBackOfBoardingParty)
Self.WaitUntilInitialized() ; #DEBUG_LINE_NO:1018
Guard BECrewGuard ;*** WARNING: Experimental syntax, may be incorrect: Guard ; #DEBUG_LINE_NO:1019
If startsDead ; #DEBUG_LINE_NO:1020
BEAliasCorpses.add(BEAliasActor, 1) ; #DEBUG_LINE_NO:1022
If BEAliasActor.Is3DLoaded() ; #DEBUG_LINE_NO:1023
RE_Parent.KillWithForceNoWait(BEAliasActor, None, True) ; #DEBUG_LINE_NO:1024
EndIf ; #DEBUG_LINE_NO:
Else ; #DEBUG_LINE_NO:
Self.RegisterForRemoteEvent(BEAliasActor as ScriptObject, "OnDying") ; #DEBUG_LINE_NO:1028
EndIf ; #DEBUG_LINE_NO:
If AllCrew.Find(BEAliasActor as ObjectReference) < 0 ; #DEBUG_LINE_NO:1030
If shouldIncludeInCrew ; #DEBUG_LINE_NO:1033
If !startsDead && !BEAliasActor.IsDead() ; #DEBUG_LINE_NO:1035
AllCrew.AddRef(BEAliasActor as ObjectReference) ; #DEBUG_LINE_NO:1036
If ShouldUseBEObjective && (BEObjective_EnemyShip.GetRef() == enemyShipRef as ObjectReference) ; #DEBUG_LINE_NO:1037
BEObjective_AllCrew.AddRef(BEAliasActor as ObjectReference) ; #DEBUG_LINE_NO:1038
EndIf ; #DEBUG_LINE_NO:
BEAliasActor.AddKeyword(BECrewDefenderKeyword) ; #DEBUG_LINE_NO:1040
EndIf ; #DEBUG_LINE_NO:
BEAliasActor.SetValue(Suspicious, crewSuspiciousState as Float) ; #DEBUG_LINE_NO:1043
If BEAliasActor.HasKeyword(ActorTypeRobot) ; #DEBUG_LINE_NO:1045
If robots.Length > 0 ; #DEBUG_LINE_NO:1046
robots[robots.Length - 1].SetLinkedRef(BEAliasActor as ObjectReference, LinkTerminalRobot, True) ; #DEBUG_LINE_NO:1047
EndIf ; #DEBUG_LINE_NO:
robots.add(BEAliasActor, 1) ; #DEBUG_LINE_NO:1049
EndIf ; #DEBUG_LINE_NO:
If AllCrew.GetCount() > genericCrewSize ; #DEBUG_LINE_NO:1053
Actor crewToReplace = None ; #DEBUG_LINE_NO:1054
If !ShouldBoardPlayersShip ; #DEBUG_LINE_NO:1055
If GenericCrew.GetCount() > 0 ; #DEBUG_LINE_NO:1056
crewToReplace = GenericCrew.GetAt(GenericCrew.GetCount() - 1) as Actor ; #DEBUG_LINE_NO:1057
EndIf ; #DEBUG_LINE_NO:
ElseIf ShouldBoardPlayersShip && potentialBoarders.Length > 0 ; #DEBUG_LINE_NO:1059
crewToReplace = potentialBoarders[potentialBoarders.Length - 1] ; #DEBUG_LINE_NO:1060
potentialBoarders.remove(potentialBoarders.Length - 1, 1) ; #DEBUG_LINE_NO:1061
ElseIf ShouldBoardPlayersShip && remainingBoarders.Length > 0 ; #DEBUG_LINE_NO:1062
crewToReplace = remainingBoarders[remainingBoarders.Length - 1] ; #DEBUG_LINE_NO:1063
remainingBoarders.remove(remainingBoarders.Length - 1, 1) ; #DEBUG_LINE_NO:1064
EndIf ; #DEBUG_LINE_NO:
If crewToReplace != None ; #DEBUG_LINE_NO:1067
GenericCrew.RemoveRef(crewToReplace as ObjectReference) ; #DEBUG_LINE_NO:1068
AllCrew.RemoveRef(crewToReplace as ObjectReference) ; #DEBUG_LINE_NO:1069
If ShouldUseBEObjective && (BEObjective_EnemyShip.GetRef() == enemyShipRef as ObjectReference) ; #DEBUG_LINE_NO:1070
BEObjective_AllCrew.RemoveRef(crewToReplace as ObjectReference) ; #DEBUG_LINE_NO:1071
EndIf ; #DEBUG_LINE_NO:
crewToReplace.DisableNoWait(False) ; #DEBUG_LINE_NO:1073
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
If ShouldBoardPlayersShip && remainingBoarders != None ; #DEBUG_LINE_NO:1079
If shouldIncludeAtFrontOfBoardingParty ; #DEBUG_LINE_NO:1080
remainingBoarders.insert(BEAliasActor, 0) ; #DEBUG_LINE_NO:1081
ElseIf shouldIncludeAtBackOfBoardingParty ; #DEBUG_LINE_NO:
remainingBoarders.add(BEAliasActor, 1) ; #DEBUG_LINE_NO:1083
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndGuard ;*** WARNING: Experimental syntax, may be incorrect: EndGuard ; #DEBUG_LINE_NO:
EndFunction
Event OnTimer(Int timerID)
If timerID == CONST_BoardingUpdateTimerID ; #DEBUG_LINE_NO:1090
Self.UpdateBoarding() ; #DEBUG_LINE_NO:1091
ElseIf timerID == CONST_TakeoffUpdateTimerID ; #DEBUG_LINE_NO:1092
Self.UpdateTakeoff() ; #DEBUG_LINE_NO:1093
EndIf ; #DEBUG_LINE_NO:
EndEvent
Event Actor.OnDying(Actor akSender, ObjectReference akKiller)
Self.TryToDecrementSpaceshipCrew(akSender, False) ; #DEBUG_LINE_NO:1100
If GenericBoarders != None ; #DEBUG_LINE_NO:1102
If GenericBoarders.Find(akSender as ObjectReference) >= 0 ; #DEBUG_LINE_NO:1103
GenericBoarders.RemoveRef(akSender as ObjectReference) ; #DEBUG_LINE_NO:1104
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
If ShowTraces ; #DEBUG_LINE_NO:
; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndEvent
Function RemoveHackedActors(Actor[] actorsToRemove)
Int I = 0 ; #DEBUG_LINE_NO:1114
While I < actorsToRemove.Length ; #DEBUG_LINE_NO:1115
Actor currentActor = actorsToRemove[I] ; #DEBUG_LINE_NO:1116
Self.TryToDecrementSpaceshipCrew(currentActor, True) ; #DEBUG_LINE_NO:1117
If ShowTraces ; #DEBUG_LINE_NO:
; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
I += 1 ; #DEBUG_LINE_NO:1122
EndWhile ; #DEBUG_LINE_NO:
EndFunction
Function TryToDecrementSpaceshipCrew(Actor actorToProcess, Bool omitIfDead)
Guard SpaceshipCrewDecrementGuard ;*** WARNING: Experimental syntax, may be incorrect: Guard ; #DEBUG_LINE_NO:1127
If AllCrew.Find(actorToProcess as ObjectReference) >= 0 && (!omitIfDead || !actorToProcess.IsDead()) ; #DEBUG_LINE_NO:1128
enemyShipRef.ModValue(SpaceshipCrew, -1.0) ; #DEBUG_LINE_NO:1129
If enemyShipRef.GetValue(SpaceshipCrew) <= 0.0 ; #DEBUG_LINE_NO:1130
If StageToSetWhenAllCrewDead >= 0 ; #DEBUG_LINE_NO:1131
Self.SetStage(StageToSetWhenAllCrewDead) ; #DEBUG_LINE_NO:1132
EndIf ; #DEBUG_LINE_NO:
Self.SendCustomEvent("bescript_BEAllCrewDead", None) ; #DEBUG_LINE_NO:1134
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndGuard ;*** WARNING: Experimental syntax, may be incorrect: EndGuard ; #DEBUG_LINE_NO:
EndFunction
Event SQ_ParentScript.SQ_NativeTerminalActor_Unconscious(sq_parentscript source, Var[] akArgs)
Actor targetActor = akArgs[1] as Actor ; #DEBUG_LINE_NO:1144
If robots.find(targetActor, 0) >= 0 ; #DEBUG_LINE_NO:1145
Self.RemoveHackedActors(robots) ; #DEBUG_LINE_NO:1146
ElseIf turrets.find(targetActor, 0) >= 0 ; #DEBUG_LINE_NO:1147
Self.RemoveHackedActors(turrets) ; #DEBUG_LINE_NO:1148
EndIf ; #DEBUG_LINE_NO:
EndEvent
Event SQ_ParentScript.SQ_NativeTerminalActor_Ally(sq_parentscript source, Var[] akArgs)
Actor targetActor = akArgs[1] as Actor ; #DEBUG_LINE_NO:1153
If robots.find(targetActor, 0) >= 0 ; #DEBUG_LINE_NO:1154
Self.RemoveHackedActors(robots) ; #DEBUG_LINE_NO:1155
ElseIf turrets.find(targetActor, 0) >= 0 ; #DEBUG_LINE_NO:1156
Self.RemoveHackedActors(turrets) ; #DEBUG_LINE_NO:1157
EndIf ; #DEBUG_LINE_NO:
EndEvent
Event SQ_ParentScript.SQ_NativeTerminalActor_Frenzy(sq_parentscript source, Var[] akArgs)
Actor targetActor = akArgs[1] as Actor ; #DEBUG_LINE_NO:1162
If robots.find(targetActor, 0) >= 0 ; #DEBUG_LINE_NO:1163
Self.RemoveHackedActors(robots) ; #DEBUG_LINE_NO:1164
ElseIf turrets.find(targetActor, 0) >= 0 ; #DEBUG_LINE_NO:1165
Self.RemoveHackedActors(turrets) ; #DEBUG_LINE_NO:1166
EndIf ; #DEBUG_LINE_NO:
EndEvent
Event OnActorValueChanged(ObjectReference source, ActorValue akActorValue)
If (source == enemyShipRef as ObjectReference) && akActorValue == SpaceshipCriticalHitCrew && Self.CheckForCrewCriticalHit() ; #DEBUG_LINE_NO:1171
Self.UnregisterForActorValueChangedEvent(enemyShipRef as ObjectReference, SpaceshipCriticalHitCrew) ; #DEBUG_LINE_NO:1172
Self.DecompressShipAndKillCrew() ; #DEBUG_LINE_NO:1173
EndIf ; #DEBUG_LINE_NO:
EndEvent
Event SpaceshipReference.OnShipDock(spaceshipreference source, Bool abComplete, spaceshipreference akDocking, spaceshipreference akParent)
If abComplete && ShouldBoardPlayersShip ; #DEBUG_LINE_NO:1178
Self.UnregisterForRemoteEvent(enemyShipRef as ScriptObject, "OnShipDock") ; #DEBUG_LINE_NO:1179
Self.UpdateBoarding() ; #DEBUG_LINE_NO:1180
EndIf ; #DEBUG_LINE_NO:
EndEvent
Event SpaceshipReference.OnShipLanding(spaceshipreference source, Bool abComplete)
If abComplete ; #DEBUG_LINE_NO:1185
If ShouldSetupDisembarkingOnLanding ; #DEBUG_LINE_NO:1186
Self.SetupDisembarking() ; #DEBUG_LINE_NO:1187
ElseIf ShouldAutoOpenLandingRamp ; #DEBUG_LINE_NO:
Self.SetEnemyShipLandingRampsOpenState(True) ; #DEBUG_LINE_NO:1189
EndIf ; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
EndEvent
Event SpaceshipReference.OnShipRampDown(spaceshipreference source)
Self.SetupDisembarking() ; #DEBUG_LINE_NO:1195
EndEvent
Event SpaceshipReference.OnShipUndock(spaceshipreference source, Bool abComplete, spaceshipreference akUndocking, spaceshipreference akParent)
shouldAbortBoarding = True ; #DEBUG_LINE_NO:1200
If abComplete && ShutDownOnUndock ; #DEBUG_LINE_NO:1202
If ShowTraces ; #DEBUG_LINE_NO:
; #DEBUG_LINE_NO:
EndIf ; #DEBUG_LINE_NO:
Self.CleanupAndStop() ; #DEBUG_LINE_NO:1206
EndIf ; #DEBUG_LINE_NO:
EndEvent
Event ObjectReference.OnUnload(ObjectReference source)
If ShutDownOnUnload ; #DEBUG_LINE_NO:1212