-
Notifications
You must be signed in to change notification settings - Fork 0
/
AURA.lua
1346 lines (1229 loc) · 48 KB
/
AURA.lua
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
--@name Aura (Eve Online Project)
--@author Rouing
--@requiresv lib/setSubMaterialB.txt
--@model models/lt_c/holograms/console_hr.mdl
--@updater STEAM_0:1:29347854
--@class processor
--@autoupdate
--[[
THIS IS NO WHERE NEAR FINISHED
IF YOU HAVE FEEDBACK TELL ME
]]--
-- I dont like botsay. I made my own bot say
function bsay(e)
printColor(Color(255,0,0),"[AI] ",Color(100,100,255),"Aura",Color(255,255,255),": ",e)
--chat.botSayAlliance("Aura",e)
--chat.botSay("Arua",e)
end
if SERVER then -- Server Side
-- Server Side Libraries
local ply = _G.player
-- Constants
local SELF = ents.self()
local OWNER = SELF:owner()
local NAME = OWNER:name()
local MAP = serverinfo.map()
-- This is the name of your ship
-- Define this using a constant value
-- and placing it on the ship with
-- A string (name of ship)
local SHIPNAME
--[[
These are the tables that hold data the processor will use
Each one will only be populated it if the corrisponding
Entity is found
]]--
local WARPPOSITIONS = {}
local BEAMPOSITIONS = {}
local SHIELDDIR = {}
local TORPEDOTYPES = {}
local TARGETTYPES = {}
-- Array of functions tables
local AURA = {}
local LETTERS = {}
AURA.Status = "green" -- We always start at green status
AURA.UTILITY = {}
AURA.COMMANDS = {}
AURA.COMMANDS.NOARG = {} -- 0 Args
AURA.COMMANDS.ONEARG = {} -- 1 Arg
AURA.COMMANDS.TWOARG = {} -- 2 Args
AURA.COMMANDS.THREEARG = {} -- 3 Args
-- Array of interfaceable ents
AURA.INTERFACEABLE = {}
AURA.INTERFACEABLE.Lights = {}
AURA.INTERFACEABLE.Emitters = {}
AURA.INTERFACEABLE.Turrets = {}
AURA.INTERFACEABLE.Torpedos = {}
AURA.INTERFACEABLE.Launchers = {}
AURA.INTERFACEABLE.Forcefields = {}
AURA.INTERFACEABLE.PROPS = {}
AURA.INTERFACEABLE.GPSs = {}
AURA.INTERFACEABLE.Gyros = {}
AURA.INTERFACEABLE.Keepers = {}
AURA.INTERFACEABLE.Sound = {}
AURA.INTERFACEABLE.LPRecievers = {}
AURA.INTERFACEABLE.ShipCannons = {}
-- The target information
AURA.Target = {}
AURA.Target.Entity = nil
AURA.Target.Status = nil
-- Ship information stored in a table.
-- This will be constantly updated at any time that seems best.
-- This is more of a caching service for modules
AURA.DATA = {}
AURA.DATA.SCHP = 0
AURA.DATA.SCPlating = 0
AURA.DATA.SCArmor = 0
AURA.DATA.ShieldHP = 0
AURA.DATA.ShieldFront = 0
AURA.DATA.ShieldBack = 0
AURA.DATA.ShieldLeft = 0
AURA.DATA.ShieldRight = 0
AURA.DATA.ShieldTop = 0
AURA.DATA.ShieldBottom = 0
AURA.DATA.ShieldOn = 0
AURA.DATA.LSOn = 0
AURA.DATA.CloakOn = 0
AURA.DATA.JammerOn = 0
AURA.DATA.FFOn = 0
-- Sound information
AURA.SOUNDS = {}
AURA.SOUNDS.RedAlert = "st/misc/tng_redalert.wav"
AURA.SOUNDS.BlueAlert = "st/misc/bluealert.wav"
AURA.SOUNDS.AbandonShip = "st/misc/abandon_ship.wav"
AURA.SOUNDS.IntruderAlert = "st/misc/intruder_alert.wav"
AURA.SOUNDS.YellowAlert = "st/shuttlecraft/yellowalert.wav"
AURA.SOUNDS.Error = "st/shuttlecraft/computer_error.mp3"
AURA.SOUNDS.Deny = "st/shuttlecraft/computer_deny.wav"
-- These are the WARPDRIVE positions. (Per Map basis)
function AURA.populateWarpPositions(map)
if map == "sb_galaxies" then
WARPPOSITIONS.shakur = Vector(-7076.469,-9152.125,10060.281)
WARPPOSITIONS.desert = Vector(10813.469,-7631.781,-8541.219)
WARPPOSITIONS.hiigara = Vector(7144.75,5267.938,-4660.031)
WARPPOSITIONS.lava = Vector(-9891.5,-1500,-3800)
WARPPOSITIONS.milk = Vector(-10500,2500,700)
WARPPOSITIONS.pegasus = Vector(1703.844,-8593.844,9143.375)
WARPPOSITIONS.universe = Vector(4691,-8842,-11000)
WARPPOSITIONS.hangar = Vector(5227,-7711,8866)
WARPPOSITIONS.earth = Vector(-304,6238,9813)
WARPPOSITIONS.moon = Vector(-4938,13441,10444)
WARPPOSITIONS.build = Vector(13069,14057,-15282)
WARPPOSITIONS.previous = Vector(0,0,0)
end
end
-- These are the transport pad positions
function AURA.populateBeamPositions(map)
if map == "sb_galaxies" then
BEAMPOSITIONS.shakur = Vector(-5825,-4099,6848)
BEAMPOSITIONS.desert = Vector(10767,-13104,-9280)
BEAMPOSITIONS.hiigara = Vector(7144.75,5267.938,-4660.031)
BEAMPOSITIONS.lava = Vector(-11164,608,-4640)
BEAMPOSITIONS.hangar = Vector(11583,-7472,9088)
BEAMPOSITIONS.earth = Vector(3048,8243,8080)
BEAMPOSITIONS.moon = Vector(-3483,13548,9952)
BEAMPOSITIONS.build = Vector(13069,14057,-15282)
end
end
-- These are the indexes the shield uses to direct power
function AURA.popluateShieldDirections()
SHIELDDIR.balance = -1
SHIELDDIR.everywhere = -1
SHIELDDIR.normal = 0
SHIELDDIR.fore = 1
SHIELDDIR.front = 1
SHIELDDIR.aft = 2
SHIELDDIR.back = 2
SHIELDDIR.port = 3
SHIELDDIR.starboard = 4
SHIELDDIR.dorsal = 5
SHIELDDIR.top = 5
SHIELDDIR.ventral = 6
SHIELDDIR.bottom = 6
end
-- These are the types of torpedos
function AURA.populateTorpedoTypes()
TORPEDOTYPES.photon = 1
TORPEDOTYPES.quantum = 2
TORPEDOTYPES.plasma = 3
TORPEDOTYPES.transphasic = 4
TORPEDOTYPES.chroniton = 5
TORPEDOTYPES.transphasic_chroniton = 6
TORPEDOTYPES.biomolecular = 7
end
-- These are the target types you can pick from
function AURA.populateTargetTypes()
TARGETTYPES.glider = "sg_vehicle_glider"
TARGETTYPES.f302 = "sg_vehicle_f302"
TARGETTYPES.dest = "sg_vehicle_shuttle"
TARGETTYPES.gateg = "sg_vehicle_gate_glider"
TARGETTYPES.teltac = "sg_vehicle_teltac"
TARGETTYPES.jumper = "puddle_jumper"
TARGETTYPES.core = "ship_core"
TARGETTYPES.node = "stargazer_node"
TARGETTYPES.gyro = "gyropod_advanced"
TARGETTYPES.sgshield = "shield_generator"
TARGETTYPES.shield = "st_shield_emitter"
TARGETTYPES.zpm = "zpm_mk3"
TARGETTYPES.ag3 = "ag_3"
TARGETTYPES.drive = "ship_drive"
TARGETTYPES.sbepdrive = "warpdrive"
TARGETTYPES.turret = "gmod_wire_turret"
TARGETTYPES.ring = "ring_base_ancient"
TARGETTYPES.sat = "stargate_asuran"
TARGETTYPES.rotaty = "sf-rotatybase"
TARGETTYPES.prop = "prop_physics"
TARGETTYPES.npc = "npc_*"
TARGETTYPES.ragdoll = "prop_ragdoll"
TARGETTYPES.grenade = "grenade_ar2"
TARGETTYPES.stargate = "stargate_*"
TARGETTYPES.jamming = "jamming_device"
TARGETTYPES.ball = "sent_ball"
TARGETTYPES.shuttle = "st_shuttle_type11"
TARGETTYPES.e2 = "gmod_wire_expression2"
TARGETTYPES.collector = "stargazer_water_core_collector"
TARGETTYPES.borg = "box_*"
TARGETTYPES.hoverball = "gmod_hoverball"
end
-- Letters Table
function AURA.populateLetters()
LETTERS.A = "models/sprops/misc/alphanum/alphanum_a.mdl"
LETTERS.B = "models/sprops/misc/alphanum/alphanum_b.mdl"
LETTERS.C = "models/sprops/misc/alphanum/alphanum_c.mdl"
LETTERS.D = "models/sprops/misc/alphanum/alphanum_d.mdl"
LETTERS.E = "models/sprops/misc/alphanum/alphanum_e.mdl"
LETTERS.F = "models/sprops/misc/alphanum/alphanum_f.mdl"
LETTERS.G = "models/sprops/misc/alphanum/alphanum_g.mdl"
LETTERS.H = "models/sprops/misc/alphanum/alphanum_h.mdl"
LETTERS.I = "models/sprops/misc/alphanum/alphanum_i.mdl"
LETTERS.J = "models/sprops/misc/alphanum/alphanum_j.mdl"
LETTERS.K = "models/sprops/misc/alphanum/alphanum_k.mdl"
LETTERS.L = "models/sprops/misc/alphanum/alphanum_l.mdl"
LETTERS.M = "models/sprops/misc/alphanum/alphanum_m.mdl"
LETTERS.N = "models/sprops/misc/alphanum/alphanum_n.mdl"
LETTERS.O = "models/sprops/misc/alphanum/alphanum_o.mdl"
LETTERS.P = "models/sprops/misc/alphanum/alphanum_p.mdl"
LETTERS.Q = "models/sprops/misc/alphanum/alphanum_q.mdl"
LETTERS.R = "models/sprops/misc/alphanum/alphanum_r.mdl"
LETTERS.S = "models/sprops/misc/alphanum/alphanum_s.mdl"
LETTERS.T = "models/sprops/misc/alphanum/alphanum_t.mdl"
LETTERS.U = "models/sprops/misc/alphanum/alphanum_u.mdl"
LETTERS.V = "models/sprops/misc/alphanum/alphanum_v.mdl"
LETTERS.W = "models/sprops/misc/alphanum/alphanum_w.mdl"
LETTERS.X = "models/sprops/misc/alphanum/alphanum_x.mdl"
LETTERS.Y = "models/sprops/misc/alphanum/alphanum_y.mdl"
LETTERS.Z = "models/sprops/misc/alphanum/alphanum_z.mdl"
LETTERS.a = "models/sprops/misc/alphanum/alphanum_l_a.mdl"
LETTERS.b = "models/sprops/misc/alphanum/alphanum_l_b.mdl"
LETTERS.c = "models/sprops/misc/alphanum/alphanum_l_c.mdl"
LETTERS.d = "models/sprops/misc/alphanum/alphanum_l_d.mdl"
LETTERS.e = "models/sprops/misc/alphanum/alphanum_l_e.mdl"
LETTERS.f = "models/sprops/misc/alphanum/alphanum_l_f.mdl"
LETTERS.g = "models/sprops/misc/alphanum/alphanum_l_g.mdl"
LETTERS.h = "models/sprops/misc/alphanum/alphanum_l_h.mdl"
LETTERS.i = "models/sprops/misc/alphanum/alphanum_l_i.mdl"
LETTERS.j = "models/sprops/misc/alphanum/alphanum_l_j.mdl"
LETTERS.k = "models/sprops/misc/alphanum/alphanum_l_k.mdl"
LETTERS.l = "models/sprops/misc/alphanum/alphanum_l_l.mdl"
LETTERS.m = "models/sprops/misc/alphanum/alphanum_l_m.mdl"
LETTERS.n = "models/sprops/misc/alphanum/alphanum_l_n.mdl"
LETTERS.o = "models/sprops/misc/alphanum/alphanum_l_o.mdl"
LETTERS.p = "models/sprops/misc/alphanum/alphanum_l_p.mdl"
LETTERS.q = "models/sprops/misc/alphanum/alphanum_l_q.mdl"
LETTERS.r = "models/sprops/misc/alphanum/alphanum_l_r.mdl"
LETTERS.s = "models/sprops/misc/alphanum/alphanum_l_s.mdl"
LETTERS.t = "models/sprops/misc/alphanum/alphanum_l_t.mdl"
LETTERS.u = "models/sprops/misc/alphanum/alphanum_l_u.mdl"
LETTERS.v = "models/sprops/misc/alphanum/alphanum_l_v.mdl"
LETTERS.w = "models/sprops/misc/alphanum/alphanum_l_w.mdl"
LETTERS.x = "models/sprops/misc/alphanum/alphanum_l_x.mdl"
LETTERS.y = "models/sprops/misc/alphanum/alphanum_l_y.mdl"
LETTERS.z = "models/sprops/misc/alphanum/alphanum_l_z.mdl"
LETTERS["0"] = "models/sprops/misc/alphanum/alphanum_0.mdl"
LETTERS["1"] = "models/sprops/misc/alphanum/alphanum_1.mdl"
LETTERS["2"] = "models/sprops/misc/alphanum/alphanum_2.mdl"
LETTERS["3"] = "models/sprops/misc/alphanum/alphanum_3.mdl"
LETTERS["4"] = "models/sprops/misc/alphanum/alphanum_4.mdl"
LETTERS["5"] = "models/sprops/misc/alphanum/alphanum_5.mdl"
LETTERS["6"] = "models/sprops/misc/alphanum/alphanum_6.mdl"
LETTERS["7"] = "models/sprops/misc/alphanum/alphanum_7.mdl"
LETTERS["8"] = "models/sprops/misc/alphanum/alphanum_8.mdl"
LETTERS["9"] = "models/sprops/misc/alphanum/alphanum_9.mdl"
LETTERS["."] = "models/sprops/misc/alphanum/alphanum_prd.mdl"
LETTERS[" "] = "models/sprops/cuboids/height06/size_1/cube_6x6x6.mdl"
LETTERS["{"] = "models/sprops/misc/alphanum/alphanum_lcbracket.mdl"
LETTERS["}"] = "models/sprops/misc/alphanum/alphanum_rcbracket.mdl"
LETTERS["["] = "models/sprops/misc/alphanum/alphanum_lbracket.mdl"
LETTERS["]"] = "models/sprops/misc/alphanum/alphanum_rbracket.mdl"
LETTERS["("] = "models/sprops/misc/alphanum/alphanum_lpar.mdl"
LETTERS[")"] = "models/sprops/misc/alphanum/alphanum_rpar.mdl"
LETTERS["&"] = "models/sprops/misc/alphanum/alphanum_and.mdl"
LETTERS["#"] = "models/sprops/misc/alphanum/alphanum_pdsign.mdl"
LETTERS[":"] = "models/sprops/misc/alphanum/alphanum_colon.mdl"
LETTERS["\""] = "models/sprops/misc/alphanum/alphanum_quote.mdl"
LETTERS["\'"] = "models/sprops/misc/alphanum/alphanum_quote.mdl"
LETTERS["-"] = "models/sprops/misc/alphanum/alphanum_min.mdl"
LETTERS["+"] = "models/sprops/misc/alphanum/alphanum_plu.mdl"
LETTERS["="] = "models/sprops/misc/alphanum/alphanum_equal.mdl"
end
-- UTILITY BLOCK
--[[
This is a set of functions that make my life easier or
cannot be classified. They have a utility purpose and
provide easy access to specific functions
]]--
--These are timer based utilites
function AURA.UTILITY.findInShip()
local LSCore = AURA.INTERFACEABLE.LSCore
if LSCore then
local Plys = find.allPlayers(function(E) return faction.getFaction(OWNER) ~= faction.getFaction(E) and E:getEnvironmentData().Entity == LSCore end)
for I = 1, #Plys do
AURA.COMMANDS.beam(Plys[I],"shakur")
chat.tell(Plys[I],Color(255,0,0),"[AI] ",Color(100,100,255),"Aura",Color(255,255,255),": ","You have no authorization to be here!")
end
else
bsay("A LS Core is required to find players in the ship!")
timer.stop("FindInShip")
end
end
timer.create("FindInShip",3,0,function() AURA.UTILITY.findInShip() end)
function AURA.UTILITY.targetDamageStatusChanged()
if AURA.Target.Entity and AURA.Target.Entity:isValid() then
if AURA.Target.Status then
TAR = AURA.Target.Entity
if TAR ~= "player" then
TAR = TAR:owner()
end
if TAR:hasDamageEnabled() ~= AURA.Target.Status then
AURA.Target.Status = TAR:hasDamageEnabled()
bsay(TAR:name() .. " has changed their damage status to: " .. tostring(AURA.Target.Status))
end
end
else
timer.stop("CheckDamageStatus")
end
end
timer.create("CheckDamageStatus",3,0,function() AURA.UTILITY.targetDamageStatusChanged() end)
function AURA.UTILITY.drawLetters() -- VERY COMPLICATED FOR WHAT IT DOES
if SHIPNAME then -- check to see if SHIPNAME was defined
local Name = SHIPNAME:explode("") -- Name of Ship (explode letter by letter)
local temp = {} -- This is an array used for centering
local length = 0 -- Length of the name after holos created
for x = 1, #AURA.INTERFACEABLE.GPSs do -- For loop for each gps
local GPS = AURA.INTERFACEABLE.GPSs[x] -- current gps
local last = nil -- last letter (holo entity)
local size = 0 -- size of the current holo(s)
temp[x] = {} -- new array for a 3d array
for i = 1, #Name do -- for each letter in the name
local LETTER = LETTERS[Name[i]] -- current letter (see: LETTERS table)
timer.simple(i*0.05, function() -- prevent high ops
last = holograms.create(GPS:toWorld(Vector(0,size,0)), GPS:toWorld(Angle(0,-90,90)), LETTER, 3) -- create the holo
if last:model() == LETTERS[" "] then -- if its a space
last:setAlpha(0) -- set it to 0 alpha
end -- end
size = last:obbSize().z + size -- size (used in this for loop)
length = last:obbSize().z + length -- length (used in centering)
temp[x][i]=last -- assign the holo to the 3d array (used in centering)
end) -- end (timer)
end -- end (second for loop)
end -- end (first for loop)
timer.simple(#Name*0.1, function() -- for centering
for i = 1, #temp do -- for each full holo
for x = 1, #temp[i] do -- for each letter in the current full holo
local cur = temp[i][x] -- current letter
cur:setPos(cur:toWorld(Vector(((length/#temp)/2),0,0))) -- center it
cur:setParent(SELF)
-- Equation: length / # of gps (due to the fact that for some reason it adds more and more for each gps)
-- then devide all that by half
end -- end (second for loop)
end -- end (first for loop)
end) -- end (timer)
end -- end nil check if statement
end -- end (function)
function AURA.UTILITY.positionKeepers(e)
if #AURA.INTERFACEABLE.Keepers == 0 or #AURA.INTERFACEABLE.Gyros == 0 then
return nil
end
if e == "Startup" then
for i = 1, #AURA.INTERFACEABLE.Keepers do
if AURA.INTERFACEABLE.Gyros[i] ~= nil then
local Cur = AURA.INTERFACEABLE.Keepers[i]
local CurG = AURA.INTERFACEABLE.Gyros[i]
local Base = holograms.create(CurG:getPos(),CurG:getAngles(),"models/madman07/ship_rail/ship_stand.mdl",1)
local Ball = holograms.create(CurG:toWorld(Vector(0,0,19)),CurG:getAngles(),"models/sprops/geometry/sphere_48.mdl")
Base:setScale(0.5)
Ball:setMaterial("Zup/ramps/ramp_metal")
Base:setParent(CurG)
Ball:setParent(CurG)
Cur:setPos(CurG:toWorld(Vector(0,0,19)))
end
end
else
for i = 1, #AURA.INTERFACEABLE.Keepers do
local Cur = AURA.INTERFACEABLE.Keepers[i]
Cur:setAng((e - Cur:pos()):Angle() + Angle(90,0,0))
end
end
end
function AURA.UTILITY.positionCannons(e)
if #AURA.INTERFACEABLE.ShipCannons == 0 or #AURA.INTERFACEABLE.LPRecievers == 0 then
return nil
end
if e == "Startup" then
for i = 1, #AURA.INTERFACEABLE.ShipCannons do
if AURA.INTERFACEABLE.LPRecievers[i] then
local Cur = AURA.INTERFACEABLE.ShipCannons[i]
local CurR = AURA.INTERFACEABLE.LPRecievers[i]
local Base = holograms.create(CurR:getPos(),CurR:getAngles(),"models/madman07/ship_rail/ship_stand.mdl",1)
local Ball = holograms.create(CurR:toWorld(Vector(0,0,19)),Angle(0,0,0),"models/sprops/geometry/sphere_48.mdl")
Base:setScale(0.5)
Ball:setMaterial("Boba_Fett/textures/atlantiswall_blue")
Ball:setParent(CurR)
Base:setParent(CurR)
AURA.INTERFACEABLE.ShipCannons[i] = Ball
Cur:setPos(CurR:toWorld(Vector(0,0,-150)))
Cur:setAng(CurR:toWorld(Angle(-90,0,0)))
Cur:setAlpha(0)
end
end
else
for i = 1, #AURA.INTERFACEABLE.ShipCannons do
local Cur = AURA.INTERFACEABLE.ShipCannons[i]
Cur:setAng((e - Cur:pos()):Angle() + Angle(180,0,0))
end
end
end
-- Find all the entites that we can interface with
function AURA.UTILITY.findInterfaceableEnts()
bsay("Finding entites I can interface with..") -- Notify player
local Constrained = SELF:getConstraints(
function(E)
class = E:class()
if class == "prop_physics" then
-- I am using this for submaterials/skins
if string.find(v:model(),"modbridge/core") then
if AURA.INTERFACEABLE.PROPS.Modbridge == nil then
AURA.INTERFACEABLE.PROPS.Modbridge = {}
end
AURA.INTERFACEABLE.PROPS.Modbridge[#AURA.INTERFACEABLE.PROPS.Modbridge + 1 or 1] = v
elseif v:model() == "models/lt_c/holo_keypad.mdl" then
if AURA.INTERFACEABLE.PROPS.Keypads == nil then
AURA.INTERFACEABLE.PROPS.Keypads = {}
end
AURA.INTERFACEABLE.PROPS.Keypads[#AURA.INTERFACEABLE.PROPS.Keypads + 1 or 1] = v
end
elseif class == "gmod_wire_gps" then
if not LETTERS.A then -- Check to see if the table is populated by calling upon a letter
AURA.populateLetters()
end
AURA.INTERFACEABLE.GPSs[#AURA.INTERFACEABLE.GPSs + 1] = v
elseif class == "gmod_wire_value" then
SHIPNAME = v:getWirelink()["1"]
elseif class == "ship_core" and not AURA.INTERFACEABLE.Core then
AURA.INTERFACEABLE.Core = v
elseif class == "st_shield_emitter" and not AURA.INTERFACEABLE.Shield then
AURA.INTERFACEABLE.Shield = v
AURA.populateWarpPositions(MAP)
elseif (class == "ship_drive" or class == "quantum_slipstream_drive") and not AURA.INTERFACEABLE.Drive then
AURA.INTERFACEABLE.Drive = v
AURA.popluateShieldDirections()
elseif (class == "cloaking_generator" or class == "st_cloaking_device") and not AURA.INTERFACEABLE.Cloak then
AURA.INTERFACEABLE.Cloak = v
AURA.DATA.CloakOn = v:getWirelink()["Active"]
elseif class == "computer_core" and not AURA.INTERFACEABLE.ComputerCore then
AURA.INTERFACEABLE.ComputerCore = v
elseif class == "jamming_device" and not AURA.INTERFACEABLE.Jammer then
AURA.INTERFACEABLE.Jammer = v
elseif class == "stargazer_ls_core" and not AURA.INTERFACEABLE.LSCore then
AURA.INTERFACEABLE.LSCore = v
AURA.DATA.LSOn = v:getWirelink()["Active"]
if SHIPNAME ~= nil then
v:getWirelink()["Name"] = SHIPNAME
end
elseif class == "gmod_wire_teleporter" and not AURA.INTERFACEABLE.Adjuster then
AURA.INTERFACEABLE.Adjuster = v
elseif class == "transporter_pad" and not AURA.INTERFACEABLE.TransporterPad then
AURA.INTERFACEABLE.TransporterPad = v
AURA.populateBeamPositions(MAP)
elseif class == "gmod_wire_light" then
AURA.INTERFACEABLE.Lights[#AURA.INTERFACEABLE.Lights + 1] = v
elseif class == "sensor_array" and not AURA.INTERFACEABLE.SensorArray then
AURA.INTERFACEABLE.SensorArray = v
elseif class == "phaser_emitter" or class == "beam_emitter"
or class == "pulse_phaser_emitter" or class == "ship_laser" then
AURA.INTERFACEABLE.Emitters[#AURA.INTERFACEABLE.Emitters + 1] = v
elseif class == "ship_turret_base" then
AURA.INTERFACEABLE.Turrets[#AURA.INTERFACEABLE.Turrets + 1] = v
elseif class == "torpedo_launcher" then
AURA.INTERFACEABLE.Torpedos[#AURA.INTERFACEABLE.Torpedos + 1] = v
elseif class == "heavy_missile_pod" then
AURA.INTERFACEABLE.Launchers[#AURA.INTERFACEABLE.Launchers + 1] = v
elseif class == "st_forcefield_emitter" then
AURA.INTERFACEABLE.Forcefields[#AURA.INTERFACEABLE.Forcefields + 1] = v
elseif class == "transporter" and not AURA.INTERFACEABLE.AsgardTransporter then
AURA.INTERFACEABLE.AsgardTransporter = v
AURA.populateBeamPositions(MAP)
elseif class == "tscm_tv" and not AURA.INTERFACEABLE.TV then
AURA.INTERFACEABLE.TV = v
elseif class == "gmod_wire_gyroscope" then
AURA.INTERFACEABLE.Gyros[#AURA.INTERFACEABLE.Gyros + 1] = v
elseif class == "keeper_emitter" then
AURA.INTERFACEABLE.Keepers[#AURA.INTERFACEABLE.Keepers + 1] = v
elseif class == "gmod_wire_soundemitter" then
AURA.INTERFACEABLE.Sound[#AURA.INTERFACEABLE.Sound + 1] = v
elseif class == "gmod_wire_las_receiver" then
AURA.INTERFACEABLE.LPRecievers[#AURA.INTERFACEABLE.LPRecievers + 1] = v
elseif class == "ship_cannon" then
AURA.INTERFACEABLE.ShipCannons[#AURA.INTERFACEABLE.ShipCannons + 1] = v
end
end
)
bsay("Finished finding interfaceable entities.")
end
function AURA.UTILITY.PlaySound(sound,time,e)
if e == nil then
for i = 1, #AURA.INTERFACEABLE.Sound do
local x = sounds.create(AURA.INTERFACEABLE.Sound[i],sound)
x:play()
timer.simple(time,function() x:stop() end)
end
end
local y = sounds.create(SELF,sound)
y:play()
timer.simple(time,function() y:stop() end)
end
-- This is the commands.
-- UTILITY COMMANDS
function AURA.COMMANDS.FindModel()
local AE = OWNER:aimEntity()
if AE then
bsay("The model of that is " .. AE:model() .. ".")
else
bsay("Are you looking at something?")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Error,4,1)
end
end
function AURA.COMMANDS.FindClass()
local AE = OWNER:aimEntity()
if AE then
bsay("That would be an " .. AE:class())
else
bsay("Are you looking at something?")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Error,4,1)
end
end
function AURA.COMMANDS.FindOwner()
local AE = OWNER:aimEntity()
if AE then
bsay(AE:owner():name() .. " is the owner of that.")
else
bsay("Are you looking at something?")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Error,4,1)
end
end
function AURA.COMMANDS.FindWeight()
local AE = OWNER:aimEntity()
if AE then
bsay("The weight of that is: " .. AE:getMass() .. ".")
else
bsay("Are you looking at something?")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Error,4,1)
end
end
function AURA.COMMANDS.FindColor()
local AE = OWNER:aimEntity()
if AE then
bsay("The color of that is: " .. AE:color() .. ".")
else
bsay("Are you looking at something?")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Error,4,1)
end
end
function AURA.COMMANDS.FindMaterial()
local AE = OWNER:aimEntity()
if AE then
bsay("The material of that is: " .. AE:material() .. ".")
else
bsay("Are you looking at something?")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Error,4,1)
end
end
-- Faction Commands
function AURA.COMMANDS.FindOnlineFaction()
local Friends = faction.getOnlineMembers()
if #Friends > 0 then
bsay("List of online fellow faction members:" .. Friends.toString() .. ".")
else
bsay("You currently have no faction members online.")
end
end
function AURA.COMMANDS.FindOnlineAllies()
local Allies = faction.getAlliedMembers()
if #Allies > 0 then
bsay("List of online allies:" .. table.toString(Allies,"Allies",true) .. ".")
else
bsay("You currently have no allies online.")
end
end
-- LIFE SUPPORT
function AURA.COMMANDS.LifeSupport(e)
local LifeSupportEmitter = AURA.INTERFACEABLE.LSCore
if LifeSupportEmitter then
AURA.DATA.LSOn = LifeSupportEmitter:getWirelink()["Active"]
if e == "status" then
if AURA.DATA.LSOn == 1 then
bsay("Life support is currently active.")
else
bsay("Life support is currently inactive.")
end
else
if e then
if AURA.DATA.LSOn == 1 then
bsay("Life Support is already enabled.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
else
bsay("Enabling Life Support.")
LifeSupportEmitter:getWirelink()["Activate"] = e
end
else
if AURA.DATA.LSOn == 0 then
bsay("Life Support is already disabled.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
else
bsay("Disabling Life Support.")
LifeSupportEmitter:getWirelink()["Activate"] = e
end
end
end
AURA.DATA.LSOn = LifeSupportEmitter:getWirelink()["Active"]
else
bsay("No Life Support Connected. Standing by.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
end
end
-- CLOAK
function AURA.COMMANDS.Cloak(e)
local CloakEmitter = AURA.INTERFACEABLE.Cloak
if CloakEmitter then
AURA.DATA.CloakOn = CloakEmitter:getWirelink()["Active"]
if e == "status" then
if AURA.DATA.CloakOn == 1 then
bsay("Cloak is currently active.")
else
bsay("Cloak is currently inactive.")
end
else
if e then
if AURA.DATA.CloakOn == 1 then
bsay("Cloak is already enabled.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
else
bsay("Enabling Cloak.")
CloakEmitter:getWirelink()["Activate"] = e
end
else
if AURA.DATA.CloakOn == 0 then
bsay("Cloak is already disabled.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
else
bsay("Disabling cloak.")
CloakEmitter:getWirelink()["Activate"] = e
end
end
end
AURA.DATA.CloakOn = CloakEmitter:getWirelink()["Active"]
else
bsay("No Cloak Connected. Standing by.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Error,4,1)
end
end
-- Jammer
function AURA.COMMANDS.Jammer(e)
local JammerEmitter = AURA.INTERFACEABLE.Jammer
if JammerEmitter then
AURA.DATA.JammerOn = JammerEmitter:getWirelink()["Active"]
if e == "status" then
if AURA.DATA.JammerOn == 1 then
bsay("Jammer is currently active.")
else
bsay("Jammer is currently inactive.")
end
else
if e then
if AURA.DATA.JammerOn == 1 then
bsay("Jammer is already enabled.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
else
bsay("Enabling jammer.")
JammerEmitter:getWirelink()["Activate"] = e
end
else
if AURA.DATA.JammerOn == 0 then
bsay("Jammer is already disabled.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
else
bsay("Disabling jammer.")
JammerEmitter:getWirelink()["Activate"] = e
end
end
end
AURA.DATA.JammerOn = JammerEmitter:getWirelink()["Active"]
else
bsay("No Jammer Connected. Standing by.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Error,4,1)
end
end
-- Forcefields
function AURA.COMMANDS.Forcefields(e)
local ForcefieldEmitters = AURA.INTERFACEABLE.Forcefields
if #ForcefieldEmitters > 0 then
AURA.DATA.FFOn = ForcefieldEmitters[1]:getWirelink()["Active"]
if e == "status" then
if AURA.DATA.FFOn == 1 then
bsay("Forcefields are currently active.")
else
bsay("Forcefields are currently inactive.")
end
else
if e then
if AURA.DATA.FFOn == 1 then
bsay("Forcefields is already enabled.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
else
bsay("Enabling forcefields.")
for i = 1, #ForcefieldEmitters do
local FF = ForcefieldEmitters[ i ]
if not FF then break end
FF:getWirelink()["Activate"] = e
end
end
else
if AURA.DATA.FFOn == 0 then
bsay("Forcefields is already disabled.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
else
bsay("Disabling forcefields.")
for i = 1, #ForcefieldEmitters do
local FF = ForcefieldEmitters[ i ]
if not FF then break end
FF:getWirelink()["Activate"] = e
end
end
end
end
AURA.DATA.FFOn = ForcefieldEmitters[1]:getWirelink()["Active"]
else
bsay("No Forcefields Connected. Standing by.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Error,4,1)
end
end
-- Shield
function AURA.COMMANDS.Shield(e)
local ShieldEmitter = AURA.INTERFACEABLE.Shield
if ShieldEmitter then
AURA.DATA.ShieldOn = ShieldEmitter:getWirelink()["Active"]
if SHIELDDIR[e] then
bsay("Divirting shield power to " .. e .. ".")
ShieldEmitter:getWirelink()["Divert Power"] = SHIELDDIR[e]
AURA.DATA.ShieldDiv = SHIELDDIR[e]
elseif e == "status" then
if SStatus == 1 then
bsay("Shield are currently active.")
else
bsay("Shield are currently inactive.")
end
else
if e == 1 then
if SStatus == 1 then
bsay("Shield is already enabled.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
else
bsay("Enabling Shield.")
ShieldEmitter:getWirelink()["Activate"] = e
end
else
if SStatus == 0 then
bsay("Shield is already disabled.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
else
bsay("Disabling Shield.")
ShieldEmitter:getWirelink()["Activate"] = e
end
end
end
AURA.DATA.ShieldOn = ShieldEmitter:getWirelink()["Active"]
else
bsay("No Shield Connected. Standing by.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Error,4,1)
end
end
-- STATUS
function AURA.COMMANDS.Status(e)
local ShieldEmitter = AURA.INTERFACEABLE.Shield
local ForcefieldEmitters = AURA.INTERFACEABLE.Forcefields
local Core = AURA.INTERFACEABLE.Core
if e == "green" then
if AURA.Status ~= "green" then
AURA.Status = "green"
bsay(SHIPNAME .. " is now at green status.")
AURA.INTERFACEABLE.Shield:getWirelink()["Activate"] = 0
AURA.DATA.ShieldOn = 0
if Core then
Core:getWirelink()["Enable Plating"] = 0
end
for i = 1, #AURA.INTERFACEABLE.Forcefields do
local FF = AURA.INTERFACEABLE.Forcefields[ i ]
if not FF then break end
FF:getWirelink()["Activate"] = 0
AURA.DATA.FFOn = 0
end
for i = 1, #AURA.INTERFACEABLE.PROPS.Modbridge do
local Prop = AURA.INTERFACEABLE.PROPS.Modbridge[i]
if not Prop then break end
setSubMaterialB(Prop,"cmats/light","cmats/light")
end
if #AURA.INTERFACEABLE.Lights > 0 then
for i = 1, #AURA.INTERFACEABLE.Lights do
local Light = AURA.INTERFACEABLE.Lights[i]
if not Light then break end
Light:getWirelink()["RGB"] = Vector(0,0,0)
end
end
else
bsay("The " .. SHIPNAME .. " is already at condition green.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
end
elseif e == "yellow" then
if AURA.Status ~= "yellow" then
AURA.Status = "yellow"
bsay(SHIPNAME .. " is now at yellow alert! Defences enabled.")
AURA.INTERFACEABLE.Shield:getWirelink()["Activate"] = 1
AURA.DATA.ShieldOn = 1
if Core then
Core:getWirelink()["Enable Plating"] = 1
end
for i = 1, #AURA.INTERFACEABLE.Forcefields do
local FF = AURA.INTERFACEABLE.Forcefields[ i ]
if not FF then break end
FF:getWirelink()["Activate"] = 1
AURA.DATA.FFOn = 1
end
for i = 1, #AURA.INTERFACEABLE.PROPS.Modbridge do
local Prop = AURA.INTERFACEABLE.PROPS.Modbridge[i]
if not Prop then break end
setSubMaterialB(Prop,"cmats/light","glow/yellow_light")
end
if #AURA.INTERFACEABLE.Lights > 0 then
for i = 1, #AURA.INTERFACEABLE.Lights do
local Light = AURA.INTERFACEABLE.Lights[i]
if not Light then break end
Light:getWirelink()["RGB"] = Vector(255,255,0)
end
end
AURA.UTILITY.PlaySound(AURA.SOUNDS.YellowAlert,3)
else
bsay("The " .. SHIPNAME .. " is already at yellow alert.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
end
elseif e == "red" then
if AURA.Status ~= "red" then
AURA.Status = "red"
bsay(SHIPNAME .. " is now at red alert!")
AURA.INTERFACEABLE.Shield:getWirelink()["Activate"] = 1
AURA.DATA.ShieldOn = 1
for i = 1, #AURA.INTERFACEABLE.Forcefields do
local FF = AURA.INTERFACEABLE.Forcefields[ i ]
if not FF then break end
FF:getWirelink()["Activate"] = 1
AURA.DATA.FFOn = 1
end
if Core then
Core:getWirelink()["Enable Plating"] = 1
end
for i = 1, #AURA.INTERFACEABLE.PROPS.Modbridge do
local Prop = AURA.INTERFACEABLE.PROPS.Modbridge[i]
if not Prop then break end
setSubMaterialB(Prop,"cmats/light","cmats/flash_red")
end
if #AURA.INTERFACEABLE.Lights > 0 then
for i = 1, #AURA.INTERFACEABLE.Lights do
local Light = AURA.INTERFACEABLE.Lights[i]
if not Light then break end
Light:getWirelink()["RGB"] = Vector(255,0,0)
end
end
AURA.UTILITY.PlaySound(AURA.SOUNDS.RedAlert,15)
else
bsay("The " .. SHIPNAME .. " is already at red alert.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
end
elseif (e == "blue") then
if (AURA.Status ~= "blue") then
AURA.Status = "blue"
bsay(SHIPNAME .. " is now at blue alert!")
AURA.INTERFACEABLE.Shield:getWirelink()["Activate"] = 0
AURA.DATA.ShieldOn = 0
if Core then
Core:getWirelink()["Enable Plating"] = 1
end
for i = 1, #AURA.INTERFACEABLE.Forcefields do
local FF = AURA.INTERFACEABLE.Forcefields[ i ]
if not FF then break end
FF:getWirelink()["Activate"] = 1
AURA.DATA.FFOn = 1
end
for i = 1, #AURA.INTERFACEABLE.PROPS.Modbridge do
local Prop = AURA.INTERFACEABLE.PROPS.Modbridge[i]
if not Prop then break end
setSubMaterialB(Prop,"cmats/light","glow/flash_blue")
end
if #AURA.INTERFACEABLE.Lights > 0 then
for y = 1, #AURA.INTERFACEABLE.Lights do
local Light = AURA.INTERFACEABLE.Lights[y]
if not Light then break end
Light:getWirelink()["RGB"] = Vector(0,0,255)
end
end
AURA.UTILITY.PlaySound(AURA.SOUNDS.BlueAlert,15)
else
bsay("The " .. SHIPNAME .. " is already at blue alert.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Deny,4,1)
end
end
end
function AURA.COMMANDS.Beam(e,f)
local Asgard = AURA.INTERFACEABLE.AsgardTransporter
local Transporter = AURA.INTERFACEABLE.TransporterPad
if Asgard or Transporter then
local Destination = Vector(0,0,0)
local Origin = Vector(0,0,0)
local OEnt = nil
local BeamAll = 0
if BEAMPOSITIONS[f] ~= nil then
Destination = BEAMPOSITIONS[f]
elseif find.playerByName(f) ~= nil then
Destination = find.playerByName(f):toWorld(Vector(-100,0,0))
elseif f == "ship" then
Destination = Transporter:getPos()+Vector(0,0,10)
elseif f == "here" then
Destination = OWNER:aimPos()
else
bsay("Invalid destination.")
AURA.UTILITY.PlaySound(AURA.SOUNDS.Error,4,1)
end
if e == "me" then
OEnt = OWNER
Origin = OEnt:pos()
BeamAll = 0
elseif e == "that" then
OEnt = OWNER:aimEntity()
Origin = OEnt:pos()
BeamAll = 1