forked from WeakAuras/WeakAuras2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrototypes.lua
More file actions
2771 lines (2733 loc) · 77.9 KB
/
Prototypes.lua
File metadata and controls
2771 lines (2733 loc) · 77.9 KB
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
-- Lua APIs
local tinsert, tconcat, tremove, wipe = table.insert, table.concat, table.remove, wipe
local fmt, tostring, string_char = string.format, tostring, string.char
local select, pairs, next, type, unpack = select, pairs, next, type, unpack
local loadstring, assert, error = loadstring, assert, error
local setmetatable, getmetatable, rawset, rawget = setmetatable, getmetatable, rawset, rawget
local bit_band, bit_lshift, bit_rshift = bit.band, bit.lshift, bit.rshift
local WeakAuras = WeakAuras;
local L = WeakAuras.L;
-- @patch 6.0 compatibility quick fix
function GetMoPTalentInfo(t) return GetTalentInfo(ceil(t/3), (t-1)%3 +1, GetActiveSpecGroup()) end
WeakAuras.function_strings = {
count = [[
return function(count)
if(count %s %s) then
return true
else
return false
end
end
]],
count_fraction = [[
return function(count, max)
local fraction = count/max
if(fraction %s %s) then
return true
else
return false
end
end
]],
always = [[
return function()
return true
end
]]
};
WeakAuras.anim_function_strings = {
straight = [[
return function(progress, start, delta)
return start + (progress * delta)
end
]],
straightTranslate = [[
return function(progress, startX, startY, deltaX, deltaY)
return startX + (progress * deltaX), startY + (progress * deltaY)
end
]],
straightScale = [[
return function(progress, startX, startY, scaleX, scaleY)
return startX + (progress * (scaleX - startX)), startY + (progress * (scaleY - startY))
end
]],
straightColor = [[
return function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
return r1 + (progress * (r2 - r1)), g1 + (progress * (g2 - g1)), b1 + (progress * (b2 - b1)), a1 + (progress * (a2 - a1))
end
]],
circle = [[
return function(progress, startX, startY, deltaX, deltaY)
local angle = progress * 2 * math.pi
return startX + (deltaX * math.cos(angle)), startY + (deltaY * math.sin(angle))
end
]],
circle2 = [[
return function(progress, startX, startY, deltaX, deltaY)
local angle = progress * 2 * math.pi
return startX + (deltaX * math.sin(angle)), startY + (deltaY * math.cos(angle))
end
]],
spiral = [[
return function(progress, startX, startY, deltaX, deltaY)
local angle = progress * 2 * math.pi
return startX + (progress * deltaX * math.cos(angle)), startY + (progress * deltaY * math.sin(angle))
end
]],
spiralandpulse = [[
return function(progress, startX, startY, deltaX, deltaY)
local angle = (progress + 0.25) * 2 * math.pi
return startX + (math.cos(angle) * deltaX * math.cos(angle*2)), startY + (math.abs(math.cos(angle)) * deltaY * math.sin(angle*2))
end
]],
shake = [[
return function(progress, startX, startY, deltaX, deltaY)
local prog
if(progress < 0.25) then
prog = progress * 4
elseif(progress < .75) then
prog = 2 - (progress * 4)
else
prog = (progress - 1) * 4
end
return startX + (prog * deltaX), startY + (prog * deltaY)
end
]],
bounceDecay = [[
return function(progress, startX, startY, deltaX, deltaY)
local prog = (progress * 3.5) % 1
local bounce = math.ceil(progress * 3.5)
local bounceDistance = math.sin(prog * math.pi) * (bounce / 4)
return startX + (bounceDistance * deltaX), startY + (bounceDistance * deltaY)
end
]],
bounce = [[
return function(progress, startX, startY, deltaX, deltaY)
local bounceDistance = math.sin(progress * math.pi)
return startX + (bounceDistance * deltaX), startY + (bounceDistance * deltaY)
end
]],
flash = [[
return function(progress, start, delta)
local prog
if(progress < 0.5) then
prog = progress * 2
else
prog = (progress - 1) * 2
end
return start + (prog * delta)
end
]],
pulse = [[
return function(progress, startX, startY, scaleX, scaleY)
local angle = (progress * 2 * math.pi) - (math.pi / 2)
return startX + (((math.sin(angle) + 1)/2) * (scaleX - 1)), startY + (((math.sin(angle) + 1)/2) * (scaleY - 1))
end
]],
alphaPulse = [[
return function(progress, start, delta)
local angle = (progress * 2 * math.pi) - (math.pi / 2)
return start + (((math.sin(angle) + 1)/2) * delta)
end
]],
pulseColor = [[
return function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
local angle = (progress * 2 * math.pi) - (math.pi / 2)
local newProgress = ((math.sin(angle) + 1)/2);
return r1 + (newProgress * (r2 - r1)),
g1 + (newProgress * (g2 - g1)),
b1 + (newProgress * (b2 - b1)),
a1 + (newProgress * (a2 - a1))
end
]],
fauxspin = [[
return function(progress, startX, startY, scaleX, scaleY)
local angle = progress * 2 * math.pi
return math.cos(angle) * scaleX, startY + (progress * (scaleY - startY))
end
]],
fauxflip = [[
return function(progress, startX, startY, scaleX, scaleY)
local angle = progress * 2 * math.pi
return startX + (progress * (scaleX - startX)), math.cos(angle) * scaleY
end
]],
backandforth = [[
return function(progress, start, delta)
local prog
if(progress < 0.25) then
prog = progress * 4
elseif(progress < .75) then
prog = 2 - (progress * 4)
else
prog = (progress - 1) * 4
end
return start + (prog * delta)
end
]],
wobble = [[
return function(progress, start, delta)
local angle = progress * 2 * math.pi
return start + math.sin(angle) * delta
end
]],
hide = [[
return function()
return 0
end
]]
};
WeakAuras.anim_presets = {
-- Start and Finish
slidetop = {
type = "custom",
duration = 0.25,
use_translate = true,
x = 0, y = 50,
use_alpha = true,
alpha = 0
},
slideleft = {
type = "custom",
duration = 0.25,
use_translate = true,
x = -50,
y = 0,
use_alpha = true,
alpha = 0
},
slideright = {
type = "custom",
duration = 0.25,
use_translate = true,
x = 50,
y = 0,
use_alpha = true,
alpha = 0
},
slidebottom = {
type = "custom",
duration = 0.25,
use_translate = true,
x = 0,
y = -50,
use_alpha = true,
alpha = 0
},
fade = {
type = "custom",
duration = 0.25,
use_alpha = true,
alpha = 0
},
grow = {
type = "custom",
duration = 0.25,
use_scale = true,
scalex = 2,
scaley = 2,
use_alpha = true,
alpha = 0
},
shrink = {
type = "custom",
duration = 0.25,
use_scale = true,
scalex = 0,
scaley = 0,
use_alpha = true,
alpha = 0
},
spiral = {
type = "custom",
duration = 0.5,
use_translate = true,
x = 100,
y = 100,
translateType = "spiral",
use_alpha = true,
alpha = 0
},
bounceDecay = {
type = "custom",
duration = 1.5,
use_translate = true,
x = 50,
y = 50,
translateType = "bounceDecay",
use_alpha = true,
alpha = 0
},
-- Main
shake = {
type = "custom",
duration = 0.5,
use_translate = true,
x = 10,
y = 0,
translateType = "circle2"
},
spin = {
type = "custom",
duration = 1,
use_scale = true,
scalex = 1,
scaley = 1,
scaleType = "fauxspin"
},
flip = {
type = "custom",
duration = 1,
use_scale = true,
scalex = 1,
scaley = 1,
scaleType = "fauxflip"
},
wobble = {
type = "custom",
duration = 0.5,
use_rotate = true,
rotate = 3,
rotateType = "wobble"
},
pulse = {
type = "custom",
duration = 0.75,
use_scale = true,
scalex = 1.05,
scaley = 1.05,
scaleType = "pulse"
},
alphaPulse = {
type = "custom",
duration = 0.5,
use_alpha = true,
alpha = 0.5,
alphaType = "alphaPulse"
},
rotateClockwise = {
type = "custom",
duration = 4,
use_rotate = true,
rotate = -360
},
rotateCounterClockwise = {
type = "custom",
duration = 4,
use_rotate = true,
rotate = 360
},
spiralandpulse = {
type = "custom",
duration = 6,
use_translate = true,
x = 100,
y = 100,
translateType = "spiralandpulse"
},
circle = {
type = "custom",
duration = 4,
use_translate = true,
x = 100,
y = 100,
translateType = "circle"
},
orbit = {
type = "custom",
duration = 4,
use_translate = true,
x = 100,
y = 100,
translateType = "circle",
use_rotate = true,
rotate = 360
},
bounce = {
type = "custom",
duration = 0.6,
use_translate = true,
x = 0,
y = 25,
translateType = "bounce"
}
};
WeakAuras.class_ids = {}
local classID = 1;
local _, classFileName;
while(GetClassInfo(classID)) do
_, classFileName = GetClassInfo(classID)
WeakAuras.class_ids[classFileName] = classID;
classID = classID + 1;
end
WeakAuras.load_prototype = {
args = {
{
name = "combat",
display = L["In Combat"],
type = "tristate",
width = "normal",
init = "arg"
},
{
name = "never",
display = L["Never"],
type = "toggle",
width = "normal",
init = "false"
},
{
name = "petbattle",
display = L["In Pet Battle"],
type = "tristate",
init = "arg"
},
{
name = "name",
display = L["Player Name"],
type = "string",
init = "arg"
},
{
name = "realm",
display = L["Realm"],
type = "string",
init = "arg"
},
{
name = "class",
display = L["Player Class"],
type = "multiselect",
values = "class_types",
init = "arg"
},
{
name = "spec",
display = L["Talent Specialization"],
type = "multiselect",
values = function(trigger)
return function()
local single_class;
local min_specs = 4;
--First check to use if the Class load is on multi-select with only one class selected
--Also check the number of specs for each class selected in the multi-select and keep track of the minimum
--(i.e., 3 unless Druid is the only thing select, but this method is flexible in case another spec gets added to another class)
if(trigger.use_class == false and trigger.class and trigger.class.multi) then
local num_classes = 0;
for class in pairs(trigger.class.multi) do
single_class = class;
--If any checked class has only 3 specs, min_specs will become 3
min_specs = min(min_specs, GetNumSpecializationsForClassID(WeakAuras.class_ids[class]))
num_classes = num_classes + 1;
end
if(num_classes ~= 1) then
single_class = nil;
end
end
--If that is not the case, see if it is on single-select
if((not single_class) and trigger.use_class and trigger.class and trigger.class.single) then
single_class = trigger.class.single
end
--If a single specific class was found, load the specific list for it
if(single_class) then
return WeakAuras.spec_types_specific[single_class];
else
--List 4 specs if no class is specified, but if any multi-selected classes have less than 4 specs, list 3 instead
if(min_specs < 4) then
return WeakAuras.spec_types_reduced;
else
return WeakAuras.spec_types;
end
end
end
end,
init = "arg"
},
{
name = "talent",
display = L["Talent selected"],
type = "multiselect",
values = function(trigger)
return function()
local single_class;
--First check to use if the Class load is on multi-select with only one class selected
if(trigger.use_class == false and trigger.class and trigger.class.multi) then
local num_classes = 0;
for class in pairs(trigger.class.multi) do
single_class = class;
num_classes = num_classes + 1;
end
if(num_classes ~= 1) then
single_class = nil;
end
end
--If that is not the case, see if it is on single-select
if((not single_class) and trigger.use_class and trigger.class and trigger.class.single) then
single_class = trigger.class.single
end
--If a single specific class was found, load the specific list for it
if(single_class) then
return WeakAuras.talent_types_specific[single_class];
else
return WeakAuras.talent_types;
end
end
end,
-- @patch 6.0 compatibility quick fix
test = MAX_NUM_TALENTS and "select(5, GetTalentInfo(%d)) == true" or "select(4, GetMoPTalentInfo(%d)) == true"
},
{
name = "race",
display = L["Player Race"],
type = "multiselect",
values = "race_types",
init = "arg"
},
{
name = "level",
display = L["Player Level"],
type = "number",
init = "arg"
},
{
name = "zone",
display = L["Zone"],
type = "string",
init = "arg"
},
{
name = "size",
display = L["Instance Type"],
type = "multiselect",
values = "group_types",
init = "arg"
},
{
name = "difficulty",
display = L["Dungeon Difficulty"],
type = "multiselect",
values = "difficulty_types",
init = "arg"
},
{
name = "role",
display = L["Player Dungeon Role"],
type = "multiselect",
values = "role_types",
init = "arg"
},
}
};
WeakAuras.event_prototypes = {
["Combo Points"] = {
type = "status",
events = {
"UNIT_POWER",
"PLAYER_TARGET_CHANGED",
"PLAYER_FOCUS_CHANGED",
"UNIT_COMBO_POINTS"
},
force_events = true,
name = L["Combo Points"],
args = {
{
name = "combopoints",
display = L["Combo Points"],
type = "number",
init = "UnitInVehicle('player') and GetComboPoints('vehicle', 'target') or UnitPower('player', 4)"
}
},
durationFunc = function(trigger)
if UnitInVehicle('player') then
return GetComboPoints('vehicle', 'target'), 5, true;
else
return UnitPower('player', 4), 5, true;
end
end,
stacksFunc = function(trigger)
if UnitInVehicle('player') then
return GetComboPoints('vehicle', 'target');
else
return UnitPower('player', 4);
end
end,
automatic = true
},
["Unit Characteristics"] = {
type = "status",
events = {
"PLAYER_TARGET_CHANGED",
"PLAYER_FOCUS_CHANGED",
"UNIT_LEVEL",
"INSTANCE_ENCOUNTER_ENGAGE_UNIT"
},
force_events = true,
name = L["Unit Characteristics"],
init = function(trigger)
trigger.unit = trigger.unit or "target";
local ret = [[
local unit = unit or '%s';
local concernedUnit = '%s';
]];
return ret:format(trigger.unit, trigger.unit);
end,
args = {
{
name = "unit",
required = true,
display = L["Unit"],
type = "unit",
init = "arg",
values = "actual_unit_types_with_specific"
},
{
name = "name",
display = L["Name"],
type = "string",
init = "UnitName(unit)"
},
{
name = "class",
display = L["Class"],
type = "select",
init = "select(2, UnitClass(unit))",
values = "class_types"
},
{
name = "hostility",
display = L["Hostility"],
type = "select",
init = "UnitIsEnemy('player', unit) and 'hostile' or 'friendly'",
values = "hostility_types"
},
{
name = "character",
display = L["Character Type"],
type = "select",
init = "UnitIsPlayer(unit) and 'player' or 'npc'",
values = "character_types"
},
{
name = "level",
display = L["Level"],
type = "number",
init = "UnitLevel(unit)"
},
{
name = "attackable",
display = L["Attackable"],
type = "tristate",
init = "UnitCanAttack('player', unit) and true or false",
},
{
hidden = true,
test = "UnitExists(concernedUnit)"
}
},
automatic = true
},
["Health"] = {
type = "status",
events = {
"UNIT_HEALTH",
"PLAYER_TARGET_CHANGED",
"PLAYER_FOCUS_CHANGED",
"INSTANCE_ENCOUNTER_ENGAGE_UNIT",
"WA_DELAYED_PLAYER_ENTERING_WORLD"
},
force_events = {
"player",
"target",
"focus",
"pet"
},
name = L["Health"],
init = function(trigger)
trigger.unit = trigger.unit or "player";
local ret = [[
local unit = unit or '%s';
local concernedUnit = '%s';
]];
return ret:format(trigger.unit, trigger.unit);
end,
args = {
{
name = "unit",
required = true,
display = L["Unit"],
type = "unit",
init = "arg",
values = "actual_unit_types_with_specific"
},
{
name = "health",
display = L["Health"],
type = "number",
init = "UnitHealth(unit)"
},
{
name = "percenthealth",
display = L["Health (%)"],
type = "number",
init = "(UnitHealth(unit) / math.max(1, UnitHealthMax(unit))) * 100"
},
{
hidden = true,
test = "UnitExists(concernedUnit)"
}
},
durationFunc = function(trigger)
return UnitHealth(trigger.unit), UnitHealthMax(trigger.unit), true;
end,
nameFunc = function(trigger)
return UnitName(trigger.unit);
end,
automatic = true
},
["Power"] = {
type = "status",
events = {
"UNIT_POWER",
"PLAYER_TARGET_CHANGED",
"PLAYER_FOCUS_CHANGED",
"INSTANCE_ENCOUNTER_ENGAGE_UNIT",
"WA_DELAYED_PLAYER_ENTERING_WORLD"
},
force_events = {
"player",
"target",
"focus",
"pet"
},
name = L["Power"],
init = function(trigger)
trigger.unit = trigger.unit or "player";
local ret = [[
local unit = unit or '%s';
local concernedUnit = '%s';
]];
return ret:format(trigger.unit, trigger.unit);
end,
args = {
{
name = "unit",
required = true,
display = L["Unit"],
type = "unit",
init = "arg",
values = "actual_unit_types_with_specific"
},
{
name = "powertype",
-- required = true,
display = L["Power Type"],
type = "select",
values = "power_types",
init = "UnitPowerType(unit)"
},
{
name = "power",
display = L["Power"],
type = "number",
init = "UnitPower(unit)"
},
{
name = "percentpower",
display = L["Power (%)"],
type = "number",
init = "(UnitPower(unit) / math.max(1, UnitPowerMax(unit))) * 100;"
},
{
hidden = true,
test = "UnitExists(concernedUnit)"
}
},
durationFunc = function(trigger)
return UnitPower(trigger.unit), math.max(1, UnitPowerMax(trigger.unit)), "fastUpdate";
end,
automatic = true
},
["Holy Power"] = {
type = "status",
events = {
"UNIT_POWER",
"WA_DELAYED_PLAYER_ENTERING_WORLD"
},
force_events = true,
name = L["Holy Power"],
init = function(trigger)
trigger.unit = trigger.unit or "player";
local ret = [[
local unit = unit or '%s';
local concernedUnit = '%s';
]];
return ret:format(trigger.unit, trigger.unit);
end,
args = {
{
name = "power",
display = L["Holy Power"],
type = "number",
init = "UnitPower(unit, 9)"
},
},
durationFunc = function(trigger)
return UnitPower(trigger.unit, 9), UnitPowerMax(trigger.unit, 9), true;
end,
stacksFunc = function(trigger)
return UnitPower(trigger.unit, 9);
end,
automatic = true
},
["Demonic Fury"] = {
type = "status",
events = {
"UNIT_POWER",
"WA_DELAYED_PLAYER_ENTERING_WORLD"
},
force_events = true,
name = L["Demonic Fury"],
init = function(trigger)
trigger.unit = trigger.unit or "player";
local ret = [[
local unit = unit or '%s';
local concernedUnit = '%s';
]];
return ret:format(trigger.unit, trigger.unit);
end,
args = {
{
name = "power",
display = L["Demonic Fury"],
type = "number",
init = "UnitPower(unit, SPELL_POWER_DEMONIC_FURY)"
},
},
durationFunc = function(trigger)
return UnitPower(trigger.unit, SPELL_POWER_DEMONIC_FURY), math.max(1, UnitPowerMax(trigger.unit, SPELL_POWER_DEMONIC_FURY)), true;
end,
stacksFunc = function(trigger)
return UnitPower(trigger.unit, SPELL_POWER_DEMONIC_FURY);
end,
automatic = true
},
["Burning Embers"] = {
type = "status",
events = {
"UNIT_POWER",
"WA_DELAYED_PLAYER_ENTERING_WORLD"
},
force_events = true,
name = L["Burning Embers"],
init = function(trigger)
trigger.unit = trigger.unit or "player";
local ret = [[
local unit = unit or '%s';
local concernedUnit = '%s';
]];
return ret:format(trigger.unit, trigger.unit);
end,
args = {
{
name = "power",
display = L["Burning Embers"],
type = "number",
init = "UnitPower(unit, SPELL_POWER_BURNING_EMBERS)"
},
},
durationFunc = function(trigger)
return UnitPower(trigger.unit, SPELL_POWER_BURNING_EMBERS, true), math.max(1, UnitPowerMax(trigger.unit, SPELL_POWER_BURNING_EMBERS, true)), true;
end,
stacksFunc = function(trigger)
return UnitPower(trigger.unit, SPELL_POWER_BURNING_EMBERS, true);
end,
automatic = true
},
["Shadow Orbs"] = {
type = "status",
events = {
"UNIT_POWER",
"WA_DELAYED_PLAYER_ENTERING_WORLD"
},
force_events = true,
name = L["Shadow Orbs"],
init = function(trigger)
trigger.unit = trigger.unit or "player";
local ret = [[
local unit = unit or '%s';
local concernedUnit = '%s';
]];
return ret:format(trigger.unit, trigger.unit);
end,
args = {
{
name = "power",
display = L["Shadow Orbs"],
type = "number",
init = "UnitPower(unit, SPELL_POWER_SHADOW_ORBS)"
},
},
durationFunc = function(trigger)
return UnitPower(trigger.unit, SPELL_POWER_SHADOW_ORBS), math.max(1, UnitPowerMax(trigger.unit, SPELL_POWER_SHADOW_ORBS)), true;
end,
stacksFunc = function(trigger)
return UnitPower(trigger.unit, SPELL_POWER_SHADOW_ORBS);
end,
automatic = true
},
["Chi Power"] = {
type = "status",
events = {
"UNIT_POWER",
"WA_DELAYED_PLAYER_ENTERING_WORLD"
},
force_events = true,
name = L["Chi Power"],
init = function(trigger)
trigger.unit = trigger.unit or "player";
local ret = [[
local unit = unit or '%s';
local concernedUnit = '%s';
]];
return ret:format(trigger.unit, trigger.unit);
end,
args = {
{
name = "power",
display = L["Chi Power"],
type = "number",
init = "UnitPower(unit, SPELL_POWER_CHI)"
},
},
durationFunc = function(trigger)
return UnitPower(trigger.unit, SPELL_POWER_CHI), math.max(1, UnitPowerMax(trigger.unit, SPELL_POWER_CHI)), true;
end,
stacksFunc = function(trigger)
return UnitPower(trigger.unit, SPELL_POWER_CHI);
end,
automatic = true
},
["Alternate Power"] = {
type = "status",
events = {
"UNIT_POWER",
"PLAYER_TARGET_CHANGED",
"PLAYER_FOCUS_CHANGED"
},
force_events = {
"player",
"target",
"focus",
"pet"
},
name = L["Alternate Power"],
init = function(trigger)
trigger.unit = trigger.unit or "player";
local ret = [[
local unit = unit or '%s'
local concernedUnit = '%s'
local _, _, _, _, _, _, _, _, _, name = UnitAlternatePowerInfo('%s');
]]
return ret:format(trigger.unit, trigger.unit, trigger.unit);
end,
args = {
{
name = "unit",
required = true,
display = L["Unit"],
type = "unit",
init = "arg",
values = "actual_unit_types_with_specific"
},
{
name = "power",
display = L["Alternate Power"],
type = "number",
init = "UnitPower(unit, 10)"
},
{
hidden = true,
test = "UnitExists(concernedUnit) and name"
}
},
durationFunc = function(trigger)
return UnitPower(trigger.unit, 10), math.max(1, UnitPowerMax(trigger.unit, 10)), "fastUpdate";
end,
nameFunc = function(trigger)
local _, _, _, _, _, _, _, _, _, name = UnitAlternatePowerInfo(trigger.unit);
return name;
end,
iconFunc = function(trigger)
local icon = UnitAlternatePowerTextureInfo(trigger.unit, 0);
return icon;
end,
automatic = true
},
["Shards"] = {
type = "status",
events = {
"UNIT_POWER",
"WA_DELAYED_PLAYER_ENTERING_WORLD"
},
force_events = true,
name = L["Shards"],
init = function(trigger)
trigger.unit = trigger.unit or "player";
local ret = [[
local unit = unit or '%s';
local concernedUnit = '%s';
]];
return ret:format(trigger.unit, trigger.unit);
end,
args = {