forked from secretrob/BanditsUserInterface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUI_Buffs.lua
1645 lines (1620 loc) · 74.2 KB
/
BUI_Buffs.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
local VampireStage={[135397]=1,[135399]=2,[135400]=3,[135402]=4}
local Passives={
-- [35771]=true,[35776]=true,[35783]=true,[35792]=true, --Vampirism stage
[91449]=true,[86075]=true,--Breda's Magnificent Mead
[40359]=true,--Fed on ally
[40525]=true,--Bit an ally
[43752]=true,--Soul Summons
[89683]=true,[66776]=true,[64210]=true,[77123]=true,[84364]=true,[84365]=true,[99463]=true,[99462]=true,[85502]=true,[85503]=true,[91369]=true,[118985]=true,[136348]=true,[152514]=true,[167846]=true,[181478]=true,--EXP Buff
[96118]=true,--Witchmother's Boon
[21676]=true,--Recall cooldown
[147687]=true,--Alliance Skill Gain Boost
[21798]=true,--Bounty timer
}
local buffFood={
[72822]={Health=true},[17407]={Health=true},[66551]={Health=true},[61259]={Health=true},[66124]={Health=true},[66125]={Health=true},[72816]={Health=true},[72824]={Health=true},[72957]={Health=true},[72960]={Health=true},[72962]={Health=true},[72819]={Health=true},[89971]={Health=true},
-- [17565]=true,[17567]=true,[17569]=true,[47049]=true,[47051]=true,[66576]=true,[17573]=true,[47050]=true,
[17577]={Magicka=true,Stamina=true},[61294]={Magicka=true,Stamina=true},[72961]={Magicka=true,Stamina=true},[84681]={Magicka=true,Stamina=true},[89955]={Magicka=true,Stamina=true},
[61257]={Health=true,Magicka=true},[72959]={Health=true,Magicka=true},[84731]={Health=true,Magicka=true},[84735]={Health=true,Magicka=true},[100498]={Health=true,Magicka=true},[107748]={Health=true,Magicka=true},[127531]={Health=true,Magicka=true},
[61261]={Stamina=true},[66129]={Stamina=true},[66130]={Stamina=true},[68412]={Stamina=true},[86673]={Stamina=true},
[66127]={Magicka=true},[66128]={Magicka=true},[68413]={Magicka=true},[66568]={Magicka=true},[61260]={Magicka=true},[84678]={Magicka=true},[84709]={Magicka=true},[84725]={Magicka=true},[84720]={Magicka=true},
[61341]=true,[61344]=true,[61340]=true,[61335]=true,[61345]=true,[66131]=true,[66132]=true,[66136]=true,[66137]=true,[66140]=true,[66141]=true,[17614]=true,[61350]=true,[84700]=true,[84704]=true,[100502]=true,[68416]=true,[86746]=true,[86559]=true,--Recovery
[68411]={Health=true,Magicka=true,Stamina=true},[17581]={Health=true,Magicka=true,Stamina=true},[61218]={Health=true,Magicka=true,Stamina=true},[85484]={Health=true,Magicka=true,Stamina=true},[100488]={Health=true,Magicka=true,Stamina=true},[127596]={Health=true,Magicka=true,Stamina=true},
[72956]={Health=true,Stamina=true},[61255]={Health=true,Stamina=true},[89957]={Health=true,Stamina=true},[107789]={Health=true,Stamina=true},[127572]={Health=true,Stamina=true},
}
local oakensoul={
[61665]="Major Brutality",
[61667]="Major Savagery",
[61687]="Major Sorcery",
[61689]="Major Prophecy",
[61694]="Major Resolve",
[61697]="Minor Fortitude",
[61704]="Minor Endurance",
[61706]="Minor Intellect",
[61708]="Minor Heroism",
[61710]="Minor Mending",
[61721]="Minor Protection",
[61737]="Empower",
[61744]="Minor Berserk",
[61746]="Minor Force",
[76617]="Minor Slayer",
[76618]="Minor Aegis",
[147417]="Minor Courage",
}
for id in pairs(buffFood) do Passives[id]=true end
for id in pairs(VampireStage) do Passives[id]=true end
local Active={
[93648]=true,--Fetcher Infection
}
--[[
local Reflection={
[21007]=true,[33741]=true,[33742]=true,[33743]=true,[21014]=true,[33745]=true,[33747]=true,[33749]=true,[21017]=true,[33753]=true,[33757]=true,[33759]=true, --Reflective Scale (DK)
[86135]=true,[86136]=true,[86137]=true,[86138]=true,[86139]=true,[86140]=true,[86141]=true,[86142]=true,[86143]=true,[86144]=true,[86145]=true,[86146]=true, --Crystallized Shield (Warden)
-- [79094]="Hindrance", --Calefactor
-- [93981]="Static Overcharge", --Calefactor
-- [93918]=true,--Optimize Automata (Calefactor)
[96007]=true,--Kinetic Shield (The Imperfect)
[87480]=true,--Nature's Preservation (Caillaoife)
[3349]=true,--Reflective Shadows (Hag)
[64824]=true,--Hardened Plates (Nyzchaleft)
}
local OffBalance,CcImmunity,ObImmunity
function BUI.ReticleIcons_Init(size)
-- /script d(zo_iconFormat(GetAbilityIcon(29552),28,28))
OffBalance={[62988]=zo_iconFormat(GetAbilityIcon(62988),size,size)}
local icon=zo_iconFormat(GetAbilityIcon(29552),size,size)
CcImmunity={
[38797]=zo_iconFormat(GetAbilityIcon(38797),size,size), --Forward Momentum
[38117]=zo_iconFormat(GetAbilityIcon(38117),size,size),
[29552]=icon,[41078]=icon,[41080]=icon,[41082]=icon,[39205]=icon,[41085]=icon,[41088]=icon,[41091]=icon,[39197]=icon,[41097]=icon,[41100]=icon,[41103]=icon, --Immovable
[45239]=zo_iconFormat("/esoui/art/icons/consumable_potion_008_type_005.dds",size,size),
}
ObImmunity={[102771]=zo_iconFormat(GetAbilityIcon(102771),size,size)}
end
--]]
local OWN_PENETR,TMP_PENETR,ICON_PENETR=0,0,nil
--local CD_ENCHANT,TIMER_ENCHANT,ICON_ENCHANT=9000,0
local WeaponSlot={EQUIP_SLOT_MAIN_HAND,EQUIP_SLOT_BACKUP_MAIN}
--local RoundedReticle={left={},right={},bottom={}}
local StacksTotal={
[51176]=5,--Twice-Fanged Serpent
[50978]=5,--Berserking Warrior
[110118]=20,--Siroria's Boon
[110504]=20,--Arms of Relequen
}
local ProcEffects={
[126924]={n=0,cd=10,name=GetAbilityName(126924),icon="esoui/art/icons/ability_mage_010.dds"}, --Hollowfang Thirst
[136098]={n=-1,cd=10,name=GetAbilityName(136098),icon="esoui/art/icons/ability_mage_010.dds"},[137995]={n=-1,cd=10,name=GetAbilityName(137995),icon="esoui/art/icons/ability_mage_010.dds"}, --Kyne's Blessing
[107141]={n=-2,cd=10,name=GetAbilityName(107141),icon="esoui/art/icons/ability_templar_rune_focus.dds"},[109084]={n=-2,cd=10,name=GetAbilityName(109084),icon="esoui/art/icons/ability_templar_rune_focus.dds"}, --Vestment of Olorime
[110067]={n=-3,cd=10,name=GetAbilityName(110067),icon="esoui/art/icons/ability_mage_010.dds"},[110143]={n=-3,cd=10,name=GetAbilityName(110143),icon="esoui/art/icons/ability_mage_010.dds"}, --Siroria's Boon
[99204]={n=-4,cd=18,name=GetAbilityName(99204),icon="esoui/art/icons/gear_clockwork_medium_head_a.dds"}, --Mechanical Acuity
[126941]={n=-5,cd=7,name=GetAbilityName(126941),icon="esoui/art/icons/death_recap_disease_melee.dds"}, --Maarselok
[21676]={n=-6,cd=600,name="Recall cooldown",icon="esoui/art/icons/ability_mage_025.dds",negative=true}, --Recall
[81036]={n=-7,cd=15,name=GetAbilityName(81036),icon="esoui/art/icons/pet_200_dwarven-ebonyyellow.dds"}, --Sentinel of Rkugamz
[21798]={n=-8,cd=0,name="Bounty timer",icon=GetAbilityIcon(29702),negative=true}, --Bounty timer
}
local UpdateCooldown=false
local Synergy_id={
[108799]=1,[108802]=1,[108821]=1,[108924]=1,--Shard, Orb
[48052]=1, -- Trial dummy / Blessed Shards
[95926]=1, -- Holy Shards (Luminous Shards)
[85434]=1, -- Combustion (Mystic or Unmorphed)
[63512]=1, -- Healing Combustion (Energy)
[108607]=2,--Conduit (Sorc)
[108824]=3,--Ritual (Templar)
[108826]=4,--Healing Seed (Warden)
[108794]=5,[108797]=5,--Bone Shield (Undaunted)
[108782]=6,[108787]=6,--Blood Altar (Undaunted)
[108788]=7,[108791]=7,[108792]=7,--Trapping Webs (Undaunted)
[108793]=8,--Radiate (Undaunted)
[48085]=9,--Charged Lightning (Sorc)
[108805]=10,--Shackle (DK)
[108807]=11,--Ignite (DK)
[108822]=12,[108823]=12,--Gravity Crush (Templar)
[108808]=13,--Hidden Refresh (NB)
[108814]=14,--Soul Leech (NB)
[125219]=15,--Unnerving Boneyard (Necr)
[125220]=16,--Agony Totem (Necr)
[58775]=17,--Feeding Frenzy
[142318]=18,--Sanguine Burst (Lady Thorn)
[94973]=1,[95926]=1,[95040]=1,[95042]=1,--Shard, Orb
[43769]=2,--Conduit (Sorc)
[22270]=3,--Ritual (Templar)
[85576]=4,--Healing Seed (Warden)
[39424]=5,[42196]=5,--Bone Shield (Undaunted)
[39519]=6,[41965]=6,--Blood Altar (Undaunted)
[39451]=7,[41997]=7,[42019]=7,--Trapping Webs (Undaunted)
[41840]=8,--Radiate (Undaunted)
[48085]=9,--Charged Lightning (Sorc)
[67717]=10,--Shackle (DK)
[48040]=11,--Ignite (DK)
[48938]=12,[48939]=12,--Gravity Crush (Templar)
[37729]=13,--Hidden Refresh (NB)
[25172]=14,--Soul Leech (NB)
[115567]=15,--Unnerving Boneyard (Necr)
[118610]=16,--Agony Totem (Necr)
[58813]=17,--Feeding Frenzy
[141971]=18,--Sanguine Burst (Lady Thorn)
[191080]=19, -- Runebreak (Arcanist)
[190646]=20, -- Passage Between Worlds (Arcanist)
}
local Synergy_Name={
[1]="Resource",
[2]="Conduit",
[3]="Ritual",
[4]="Healing Seed",
[5]="Bone Shield",
[6]="Blood Altar",
[7]="Trapping Webs",
[8]="Radiate",
[9]="Charged Lightning",
[10]="Shackle",
[11]="Ignite",
[12]="Gravity Crush",
[13]="Hidden Refresh",
[14]="Soul Leech",
[15]="Unnerving Boneyard",
[16]="Agony Totem",
[17]="Feeding Frenzy",
[18]="Sanguine Burst",
[19]="Runebreak",
[20]="Passage Between Worlds",
}
local Synergy_Texture={
[1]="/esoui/art/icons/ability_undaunted_004.dds",
[2]="/esoui/art/icons/ability_sorcerer_liquid_lightning.dds",
[3]="/esoui/art/icons/ability_templar_extended_ritual.dds",
[4]="/esoui/art/icons/ability_warden_007.dds",
[5]="/esoui/art/icons/ability_undaunted_005b.dds",
[6]="/esoui/art/icons/ability_undaunted_001_b.dds",
[7]="/esoui/art/icons/ability_undaunted_003_b.dds",
[8]="/esoui/art/icons/ability_undaunted_002_b.dds",
[9]="/esoui/art/icons/ability_sorcerer_storm_atronach.dds",
[10]="/esoui/art/icons/ability_dragonknight_006.dds",
[11]="/esoui/art/icons/ability_dragonknight_010.dds",
[12]="/esoui/art/icons/ability_templar_solar_disturbance.dds",
[13]="/esoui/art/icons/ability_nightblade_015.dds",
[14]="/esoui/art/icons/ability_nightblade_018.dds",
[15]="/esoui/art/icons/ability_necromancer_004.dds",
[16]="/esoui/art/icons/ability_necromancer_010_b.dds",
[17]="/esoui/art/icons/ability_werewolf_005_b.dds",
[18]="/esoui/art/icons/ability_u23_bloodball_chokeonit.dds",
[19]="/esoui/art/icons/ability_arcanist_004.dds",
[20]="/esoui/art/icons/ability_arcanist_016_b.dds",
}
for id,i in pairs(Synergy_id) do BUI.SynergyTexture[id]=Synergy_Texture[i] end
local prog_color,theme_color={.2,.5,.6,1}
local source_color={
[1]={.9,.2,.2,.6}, --Negative
[2]={.4,.4,.4,.6}, --Cast by player
[3]={.3,.8,.3,.6}, --Positive
}
local PotionIcon={
magicka="/esoui/art/icons/consumable_potion_002_type_005.dds",
stamina="/esoui/art/icons/consumable_potion_003_type_005.dds"
}
BUI.SynergyCd={}
BUI.Buffs ={
UpdateTime =200,
Effects ={},
Defaults ={
PlayerBuffs =true,
PlayerBuffSize =44,
BuffsImportant =true,
MinimumDuration =3,
CastbyPlayer =true,
PlayerBuffsAlign =CENTER,
BUI_BuffsP ={CENTER,CENTER,0,345},
--Passives
BuffsPassives ="On additional panel",
PassiveBuffSize =36,
PassiveProgress =false,
PassivePWidth =100,
PassivePSide ="left",
PassiveOakFilter=true,
BUI_BuffsPas ={BOTTOMRIGHT,BOTTOMRIGHT,0,0},
--TargetBuffs
TargetBuffs =true,
TargetBuffSize =44,
BuffsOtherHide =true,
TargetBuffsAlign =CENTER,
BUI_BuffsT ={CENTER,CENTER,0,-350},
--CustomBuffs
EnableCustomBuffs =false,
CustomBuffSize =44,
CustomBuffsDirection ="vertical",
CustomBuffsProgress =true,
CustomBuffsPWidth =120,
CustomBuffsPSide ="right",
BUI_BuffsC ={CENTER,CENTER,0,300},
CustomBuffs ={},
--SynergyCd
EnableSynergyCd =false,
SynergyCdSize =44,
SynergyCdDirection="vertical",
SynergyCdProgress =true,
SynergyCdPWidth =120,
SynergyCdPSide ="right",
BUI_BuffsS ={CENTER,CENTER,-300,200},
--Widgets
EnableWidgets =false,
WidgetsSize =44,
-- WidgetsProgress =false,
WidgetsPWidth =120,
WidgetPotion =true,
WidgetSound1 ="CrownCrates_Manifest_Chosen",
WidgetSound2 ="CrownCrates_Manifest_Selected",
Widgets ={
["Immovable"]=true,
["Major Resolve"]=true,
["Major Sorcery"]=true,
["Major Brutality"]=true,
["Major Courage"]=true,
-- ["Major Expedition"]=true,
[61919]=true,--Merciless Resolve
[61927]=true,--Relentless Focus
[46327]=true,--Crystal Fragment Proc
[110118]=true,[110142]=true,--Siroria's Boon
[110067]=true,[110143]=true,--Siroria cd
[107141]=true,[109084]=true,--Olirime cd
[104538]=true,--Dark Drain
-- [116742]=true,--Precision
[126941]=true,--Maarselok
},
--BlackList
EnableBlackList =true,
BuffsBlackList ={
[63601]=true,--ESO Plus Member
[76667]=true,--Roar of Alkosh
[14890]=true,--Block
}
},
HornAvailable={},
ColossusAvailable={},
BarrierAvailable={},
Horn={[40223]=true,[40224]=true},
Colossus={[122174]=true,[122395]=true,[122388]=true},
Barrier={[38573]=true,[40237]=true,[40239]=true},
MajorVulnerability={[122389]=true,[122177]=true},
Negate={[50108]=true},
AlertDoT={
[95230]=true,--Venom Injection (HoF)
[90409]=true,--Melting Point (HoF)
[101101]=true,--Trial by Fire (AS)
[84221]=true,--Sickening Poison (Velidreth)
-- [73244]=true,--Ruthless Salvo Bleed
[73807]=true,--Lunar Flare (Rage of S'Kinrai)
[75738]=true,--Lunar Flare (S'kinrai)
[112057]=true,--Fire Gauntlet (BRP)
-- [113164]=true,--Venomous Spit (BRP)
},
Important={
--Buff
[109976]=true,--Empower
[109966]=true,--Major Courage (SPC)
[109994]=true,[110020]=true,--Major Courage (Olorime)
[61459]=true,--Burning Spellweave
[75801]=true,[75804]=true,--Lunar, Shadow Blessing (Moondancer)
[67288]=true,--Scathing Mage
[40224]=true,--Horn
[34872]=true,--The Ravager
[46539]=true,--Major Force
[93120]=true,[93442]=true,--Major Slayer
[75770]=true,--Twilight Remedy
[75746]=true,--Clever Alchemist
[73024]=true,--Cruel Flurry (MSA)
[61771]=true,--Powerful Assault
[99204]=true,--Mechanical Acuity
[110118]=true,[110142]=true,--Siroria's Boon
[107141]=true,[109084]=true,--Vestment of Olirime
[116742]=true,--Precision
[122658]=true,--Seething Fury (DK)
--Debuff
[28301]=true,--CCImmunity
[62787]=true,--Major Breach
[81519]=true,--Infallible Aether
[75753]=true,--Line-Breaker(Alkosh)
[17906]=true,--Crusher
[38541]=true,[38254]=true,--Taunt
[95230]=true,--Venom Injection (HoF)
[90409]=true,--Melting Point (HoF)
[68871]=true,[68909]=true,[68910]=true,[69855]=true, --Volatile Poison (MSA Stage 7)
[90916]=true,--Scalded (HoF)
[84221]=true,--Sickening Poison (Velidreth)
[73244]=true,--Ruthless Salvo Bleed
[73807]=true,--Lunar Flare (Rage of S'Kinrai)
[75738]=true,--Lunar Flare (S'kinrai)
-- [110504]=true,--Arms of Relequen
[107082]=true,--Baneful Mark
[134599]=true,--Offbalance Immune
}
}
--Defaults
BUI:JoinTables(BUI.Defaults,BUI.Buffs.Defaults)
--BUI.Defaults.CustomBuffs=BUI.Buffs.Important
-- /script local _,progressionIndex=GetAbilityProgressionXPInfoFromAbilityId(40223) id=GetAbilityProgressionAbilityId(progressionIndex, 1, 4) d(GetAbilityName(id)..id)
function BUI.GetFoodBuff()
for i=1, GetNumBuffs("player") do
local _,_,_,_,_,_,_,_,_,_,id=GetUnitBuffInfo("player",i)
if buffFood[id] and type(buffFood[id])=="table" then
return buffFood[id],id
end
end
return {}
end
--Pets
local CombatPet={
--Familiars and Clannfears
[23304]=true,[30631]=true,[30636]=true,[30641]=true,[23319]=true,[30647]=true,[30652]=true,[30657]=true,[23316]=true,[30664]=true,[30669]=true,[30674]=true,
--Twilights
[24613]=true,[30581]=true,[30584]=true,[30587]=true,[24636]=true,[30592]=true,[30595]=true,[30598]=true,[24639]=true,[30618]=true,[30622]=true,[30626]=true,
--Bears
[85982]=true,[85983]=true,[85984]=true,[85985]=true,[85986]=true,[85987]=true,[85988]=true,[85989]=true,[85990]=true,[85991]=true,[85992]=true,[85993]=true,
}
function BUI.DismissPets()
for i=1, GetNumBuffs("player") do
local _,_,_,buffSlot,_,_,_,_,_,_,abilityId=GetUnitBuffInfo("player",i)
if CombatPet[abilityId] then CancelBuff(buffSlot) end
end
end
local function OakensoulEquipped()
if GetItemLinkItemId(GetItemLink(BAG_WORN, 11))==187658 or
GetItemLinkItemId(GetItemLink(BAG_WORN, 12))==187658 then return true end
return false
end
local function IsOakensoul(buffId)
if OakensoulEquipped() then
for id in pairs(oakensoul) do
if buffId==id then return true end
end
end
return false
end
local function OnPairChanged()
BUI.CurrentPair,_=GetActiveWeaponPairInfo()
if BUI.Vars.EnchantTimer~=3 then
CD_ENCHANT=9000/(GetItemTrait(BAG_WORN,WeaponSlot[BUI.CurrentPair])==4 and 2 or 1)
end
--ReticleResist
if BUI.Vars.ReticleResist~=3 or (BUI.Vars.EnableStats and BUI.Vars.StatsBuffs) then
OWN_PENETR=BUI.MainPower=="magicka" and GetPlayerStat(STAT_SPELL_PENETRATION) or GetPlayerStat(STAT_PHYSICAL_PENETRATION)
end
if BUI.Vars.NotificationsGroup then
local ult=GetSlotBoundId(8)
BUI.Buffs.HornAvailable[BUI.CurrentPair]=BUI.Buffs.Horn[ult]
BUI.Buffs.ColossusAvailable[BUI.CurrentPair]=BUI.Buffs.Colossus[ult]
BUI.Buffs.BarrierAvailable[BUI.CurrentPair]=BUI.Buffs.Barrier[ult]
--[[
if BUI.Buffs.HornAvailable[BUI.CurrentPair]==nil then
if BUI.Buffs.Horn[GetSlotBoundId(8)] then BUI.Buffs.HornAvailable[BUI.CurrentPair]=true
else BUI.Buffs.HornAvailable[BUI.CurrentPair]="No" end
end
--]]
end
end
local function OnPlayerActivated()
-- BUI.Buffs.HornAvailable={}
-- BUI.Buffs.ColossusAvailable={}
-- BUI.Buffs.BarrierAvailable={}
BUI.CallLater("Buffs_Activated",2000,OnPairChanged)
EVENT_MANAGER:UnregisterForEvent("BUI_Buffs", EVENT_PLAYER_ACTIVATED)
end
local function OnAbilitySlotted()
if not UpdateCooldown then
UpdateCooldown=true
BUI.CallLater("Buffs_AbilitySlotted",500,function()
if BUI.Vars.NotificationsGroup then
local ult=GetSlotBoundId(8)
BUI.Buffs.HornAvailable[BUI.CurrentPair]=BUI.Buffs.Horn[ult]
BUI.Buffs.ColossusAvailable[BUI.CurrentPair]=BUI.Buffs.Colossus[ult]
BUI.Buffs.BarrierAvailable[BUI.CurrentPair]=BUI.Buffs.Barrier[ult]
end
UpdateCooldown=false
end)
end
end
function BUI.Frames.PlayerBuffs_Init()
if BUI_BuffsP_Panel then BUI_BuffsP_Panel:SetHidden(true) end
if not BUI.Vars.PlayerBuffs then return end
local number =16
local fs =BUI.Vars.PlayerBuffSize/2.5 --16
local border =4
local space =3
local size =BUI.Vars.PlayerBuffSize
--Create the Self Buffs frame container
local ui =BUI.UI.Control( "BUI_BuffsP", BanditsUI, {(size+space)*number-space,size}, BUI.Vars.BUI_BuffsP, false)
ui.backdrop =BUI.UI.Backdrop( "BUI_BuffsP_BG", ui, "inherit", {CENTER,CENTER,0,0}, {0,0,0,0.4}, {0,0,0,1}, nil, true) --ui.backdrop:SetEdgeTexture("",16,4,4)
ui.label =BUI.UI.Label( "BUI_BuffsP_Label", ui.backdrop, "inherit", {CENTER,CENTER,0,0}, BUI.UI.Font("standard",20,true), nil, {1,1}, BUI.Loc("PBuffsLabel"))
ui:SetAlpha(BUI.Vars.FrameOpacityOut/100)
ui:SetDrawLayer(DT_HIGH)
ui:SetMovable(true)
ui:SetHandler("OnMouseUp", function(self) BUI.Menu:SaveAnchor(self) end)
ui.base =BUI.UI.Control( "BUI_BuffsP_Panel", ui, {size,size}, {BUI.Vars.PlayerBuffsAlign,BUI.Vars.PlayerBuffsAlign,0,0}, false)
local anchor ={LEFT,LEFT,0,0,ui.base}
--Iterate over Buffs
for i=1, number do
local ability =BUI.UI.Backdrop( "BUI_BuffsP"..i, ui.base, {size,size}, anchor, theme_color, theme_color, BUI.abilityframe, true)
ability:SetDrawLayer(0) ability:SetEdgeTexture("",8,4,4)
-- local ability =BUI.UI.Statusbar("BUI_BuffsP"..i, ui.base, {size,size}, anchor, {1,1,1,1},texture, false)
ability.icon =BUI.UI.Statusbar("BUI_BuffsP"..i.."_Icon", ability, {size-border,size-border}, {CENTER,CENTER,0,0}, {1,1,1,1},'', false)
ability.icon:SetDrawLayer(0)
ability.label =BUI.UI.Label( "BUI_BuffsP"..i.."_Label", ability, {size,size}, {TOP,TOP,0,0}, BUI.UI.Font(BUI.Vars.FrameFont1,fs-2,true), nil, {1,2}, '', false)
ability.label:SetDrawLayer(1)
ability.timer =BUI.UI.Label( "BUI_BuffsP"..i.."_Timer", ability, {fs*4,fs}, {BOTTOM,BOTTOM,0,-5}, BUI.UI.Font(BUI.Vars.FrameFont1,fs,true,true), nil, {1,2}, '', false)
ability.timer:SetDrawLayer(1)
ability.count =BUI.UI.Label( "BUI_BuffsP"..i.."_Count", ability, {fs*2,fs}, {TOPRIGHT,TOPRIGHT,0,0}, BUI.UI.Font(BUI.Vars.FrameFont1,fs,true,true), nil, {2,2}, '', false)
ability.count:SetDrawLayer(2)
--Extra settings
ability.index=i
ability:SetMouseEnabled(true)
ability:SetHandler("OnMouseDown", function(self,button) BUI.Buffs.ButtonHandler(self,button) end)
ability:SetHandler("OnMouseEnter", BUI.Buffs.ShowTooltip)
ability:SetHandler("OnMouseExit", function()ClearTooltip(InformationTooltip)end)
anchor={LEFT,RIGHT,space,0,ability}
end
end
function BUI.Frames.CustomBuffs_Init()
local number =12
for i=1, number do control=_G["BUI_BuffsC"..i] if control~=nil then control:SetHidden(true) end end
if not BUI.Vars.EnableCustomBuffs then return end
local fs =BUI.Vars.CustomBuffSize/2.5 --16
local border =4
local space =3
local w =BUI.Vars.CustomBuffsPWidth
local size =BUI.Vars.CustomBuffSize
local ph =size<=36 and 8 or math.floor(size/4)
local dimensions =BUI.Vars.CustomBuffsDirection=="horisontal" and {(size+space)*number-space,size} or {size+space+w,(size+space)*number-space}
local side =BUI.Vars.CustomBuffsPSide=="right"
--Create the Self Buffs frame container
local ui =BUI.UI.Control( "BUI_BuffsC", BanditsUI, dimensions, BUI.Vars.BUI_BuffsC, false)
ui.backdrop =BUI.UI.Backdrop( "BUI_BuffsC_BG", ui, "inherit", {CENTER,CENTER,0,0}, {0,0,0,0.4}, {0,0,0,1}, nil, true) --ui.backdrop:SetEdgeTexture("",16,4,4)
ui.label =BUI.UI.Label( "BUI_BuffsC_Label", ui.backdrop, "inherit", {CENTER,CENTER,0,0}, BUI.UI.Font("standard",20,true), nil, {1,1}, BUI.Loc("CBuffsLabel"))
ui:SetAlpha(BUI.Vars.FrameOpacityOut/100)
ui:SetDrawLayer(DT_HIGH)
ui:SetMovable(true)
ui:SetHandler("OnMouseUp", function(self) BUI.Menu:SaveAnchor(self) end)
ui.base =BUI.UI.Control("BUI_BuffsC_Base", ui, dimensions, {TOPLEFT,TOPLEFT,0,0})
--Iterate over Buffs
local anchor ={BOTTOMLEFT,BOTTOMLEFT,0,0,ui.base}
local bar_texture=side and "/BanditsUserInterface/textures/theme/progressbar_right_2.dds" or "/BanditsUserInterface/textures/theme/progressbar_left_2.dds"
for i=1, number do
local ability =BUI.UI.Control( "BUI_BuffsC"..i, ui.base, {size,size}, anchor, true)
ability.bg =BUI.UI.Backdrop( "BUI_BuffsC"..i.."_BG", ability, {size,size}, {CENTER,CENTER,0,0}, theme_color, theme_color, BUI.abilityframe, false)
ability.bg:SetDrawLayer(0) ability.bg:SetEdgeTexture("",8,4,4)
ability.icon =BUI.UI.Statusbar("BUI_BuffsC"..i.."_Icon", ability.bg, {size-border,size-border}, {CENTER,CENTER,0,0}, {1,1,1,1},'', false)
ability.icon:SetDrawLayer(0)
ability.label =BUI.UI.Label( "BUI_BuffsC"..i.."_Label", ability, {size,size}, {TOPLEFT,TOPLEFT,0,0}, BUI.UI.Font(BUI.Vars.FrameFont1,fs-2,true), nil, {1,2}, '', false)
ability.label:SetDrawLayer(1)
ability.timer =BUI.UI.Label( "BUI_BuffsC"..i.."_Timer", ability, {fs*4,fs}, {BOTTOM,BOTTOM,0,-5}, BUI.UI.Font(BUI.Vars.FrameFont1,fs,true,true), nil, {1,2}, '', false)
ability.timer:SetDrawLayer(1)
ability.count =BUI.UI.Label( "BUI_BuffsC"..i.."_Count", ability, {fs*2,fs}, {TOPRIGHT,TOPRIGHT,0,0}, BUI.UI.Font(BUI.Vars.FrameFont1,fs,true,true), nil, {2,2}, '', false)
ability.count:SetDrawLayer(2)
anchor=side and {LEFT,RIGHT,space,0} or {RIGHT,LEFT,-space,0}
ability.progress =BUI.UI.Backdrop("BUI_BuffsC"..i.."_Progress", ability, {w,ph}, anchor, {0,0,0,0}, {1,1,1,1}, nil, (not BUI.Vars.CustomBuffsProgress or BUI.Vars.CustomBuffsDirection=="horisontal"))
ability.progress:SetEdgeTexture(bar_texture,32,4,4) ability.progress:SetEdgeColor(unpack(theme_color))
if ph>8 then
ability.pbg =BUI.UI.Backdrop("BUI_BuffsC"..i.."_pBg", ability.progress, {w-4,ph-4}, {TOPLEFT,TOPLEFT,2,2}, {0,0,0,1}, {0,0,0,0}, nil, false)
else
if ability.pbg then ability.pbg:SetHidden(true) end
end
ability.name =BUI.UI.Label( "BUI_BuffsC"..i.."_Name", ability.progress, {w,fs-2}, {BOTTOMLEFT,TOPLEFT,0,-space}, BUI.UI.Font("standard",fs-2,true), nil, {side and 0 or 2,2}, '', false)
anchor=side and {LEFT,LEFT,2,0} or {RIGHT,RIGHT,-2,0}
ability.bar =BUI.UI.Statusbar("BUI_BuffsC"..i.."_Bar", ability.progress, {w-4,ph-4}, anchor, prog_color, BUI.Textures[BUI.Vars.FramesTexture], false)
--Extra settings
ability.index=i
ability.custom=true
ability:SetMouseEnabled(true)
ability:SetHandler("OnMouseDown", function(self,button) BUI.Buffs.ButtonHandler(self,button) end)
ability:SetHandler("OnMouseEnter", BUI.Buffs.ShowTooltip)
ability:SetHandler("OnMouseExit", function()ClearTooltip(InformationTooltip)end)
anchor=BUI.Vars.CustomBuffsDirection=="horisontal" and {LEFT,RIGHT,space,0,ability} or {BOTTOM,TOP,0,-space,ability}
end
end
function BUI.Frames.SynergyCd_Init()
local number =4
for i=1, number do control=_G["BUI_BuffsS"..i] if control~=nil then control:SetHidden(true) end end
if not BUI.Vars.EnableSynergyCd then return end
local fs =BUI.Vars.SynergyCdSize/2.5 --16
local border =6
local space =3
local w =BUI.Vars.SynergyCdPWidth
local size =BUI.Vars.SynergyCdSize
local dimensions =BUI.Vars.SynergyCdDirection=="horisontal" and {(size+space)*number-space,size} or {size+space+w,(size+space)*number-space}
local side =BUI.Vars.SynergyCdPSide=="right"
--Create the Self Buffs frame container
local ui =BUI.UI.Control( "BUI_BuffsS", BanditsUI, dimensions, BUI.Vars.BUI_BuffsS, false)
ui.backdrop =BUI.UI.Backdrop( "BUI_BuffsS_BG", ui, "inherit", {CENTER,CENTER,0,0}, {0,0,0,0.4}, {0,0,0,1}, nil, true) --ui.backdrop:SetEdgeTexture("",16,4,4)
ui.label =BUI.UI.Label( "BUI_BuffsS_Label", ui.backdrop, "inherit", {CENTER,CENTER,0,0}, BUI.UI.Font("standard",20,true), nil, {1,1}, BUI.Loc("SBuffsLabel"))
ui:SetAlpha(BUI.Vars.FrameOpacityOut/100)
ui:SetDrawLayer(DT_HIGH)
ui:SetMovable(true)
ui:SetHandler("OnMouseUp", function(self) BUI.Menu:SaveAnchor(self) end)
ui.base =BUI.UI.Control("BUI_BuffsS_Base", ui, dimensions, {TOPLEFT,TOPLEFT,0,0})
--Iterate over Buffs
local anchor ={BOTTOMLEFT,BOTTOMLEFT,0,0,ui.base}
local bar_texture=side and "/BanditsUserInterface/textures/theme/progressbar_right_2.dds" or "/BanditsUserInterface/textures/theme/progressbar_left_2.dds"
for i=1, number do
local ability =BUI.UI.Control( "BUI_BuffsS"..i, ui.base, {size,size}, anchor, true)
ability.bg =BUI.UI.Backdrop( "BUI_BuffsS"..i.."_BG", ability, {size,size}, {CENTER,CENTER,0,0}, {0,0,0,0}, theme_color, nil, false)
ability.bg:SetDrawLayer(0) ability.bg:SetEdgeTexture("",8,2,4)
ability.icon =BUI.UI.Statusbar("BUI_BuffsS"..i.."_Icon", ability.bg, {size-border,size-border}, {CENTER,CENTER,0,0}, {1,1,1,1},'', false)
ability.icon:SetDrawLayer(0)
-- ability.label =BUI.UI.Label( "BUI_BuffsS"..i.."_Label", ability, {size,size}, {TOPLEFT,TOPLEFT,0,0}, BUI.UI.Font(BUI.Vars.FrameFont1,fs-2,true), nil, {1,2}, '', false)
-- ability.label:SetDrawLayer(1)
ability.timer =BUI.UI.Label( "BUI_BuffsS"..i.."_Timer", ability, {fs*4,fs}, {BOTTOM,BOTTOM,0,-5}, BUI.UI.Font(BUI.Vars.FrameFont1,fs,true,true), nil, {1,2}, '', false)
ability.timer:SetDrawLayer(1)
anchor=side and {LEFT,RIGHT,space,0} or {RIGHT,LEFT,-space,0}
ability.progress =BUI.UI.Backdrop("BUI_BuffsS"..i.."_Progress", ability, {w,8}, anchor, {0,0,0,0}, {1,1,1,1}, nil, not BUI.Vars.SynergyCdProgress)
ability.progress:SetEdgeTexture(bar_texture,32,4,4) ability.progress:SetEdgeColor(unpack(theme_color))
ability.progress:SetAlpha(.8)
ability.name =BUI.UI.Label( "BUI_BuffsS"..i.."_Name", ability.progress, {w,fs-2}, {BOTTOMLEFT,TOPLEFT,0,-space}, BUI.UI.Font("standard",fs-2,true), nil, {side and 0 or 2,2}, '', false)
anchor=side and {LEFT,LEFT,2,0} or {RIGHT,RIGHT,-2,0}
ability.bar =BUI.UI.Statusbar("BUI_BuffsS"..i.."_Bar", ability.progress, {w-2,8-4}, anchor, prog_color, BUI.Textures[BUI.Vars.FramesTexture], false)
--Extra settings
ability.index=i
ability.custom=true
ability:SetMouseEnabled(true)
ability:SetHandler("OnMouseEnter", BUI.Buffs.ShowTooltip)
ability:SetHandler("OnMouseExit", function()ClearTooltip(InformationTooltip)end)
anchor=BUI.Vars.SynergyCdDirection=="horisontal" and {LEFT,RIGHT,space,0,ability} or {BOTTOM,TOP,0,-space,ability}
end
end
function BUI.Frames.Widgets_Init(widget,dup)
local cm =BUI.Vars.FrameMagickaColor
local fs =BUI.Vars.WidgetsSize/2.5 --16
local border =4
local space =3
local w =BUI.Vars.WidgetsPWidth
local size =BUI.Vars.WidgetsSize
local ph =size<=36 and 8 or math.floor(size/4)
local anchor ={CENTER,CENTER,400,350}
local widgets
if widget then
widgets={[string.gsub(widget,"BUI_Widget_","")]=true}
else
widgets=BUI.Vars.Widgets
widgets["Potion"]=BUI.Vars.WidgetPotion
end
for _id,enable in pairs(widgets) do
if enable then
local icon,name,side
local id=string.gsub(_id," ","_")
local data=BUI.Vars["BUI_Widget_"..id]
if data then anchor=data or anchor side=anchor[6] else data={} end
if data[11]~=true then
anchor=dup and {TOP,BOTTOM,0,space+(size+space)*(dup-1),_G["BUI_Widget_"..id]} or anchor
local bar_texture=side and "/BanditsUserInterface/textures/theme/progressbar_left_2.dds" or "/BanditsUserInterface/textures/theme/progressbar_right_2.dds"
local fname ="BUI_Widget_"..id..(dup and "_"..dup or "")
local ability =BUI.UI.Control( fname, BanditsUI, {size,size}, anchor, not widget and not data[12])
local id_check=tonumber(id)
if id_check then
icon=GetAbilityIcon(id_check)
name=GetAbilityName(id_check)
ability.duration=BUI.GetAbilityDuration(id_check)
else
icon=_id=="Potion" and PotionIcon[BUI.MainPower] or "/esoui/art/icons/icon_missing.dds"
name=_id
end
ability.init=false
ability.bg =BUI.UI.Backdrop( fname.."_BG", ability, {size,size}, {CENTER,CENTER,0,0}, theme_color, theme_color, BUI.abilityframe, false)
ability.bg:SetDrawLayer(0) ability.bg:SetEdgeTexture("",8,4,4)
ability.icon =BUI.UI.Statusbar(fname.."_Icon", ability.bg, {size-border,size-border}, {CENTER,CENTER,0,0}, {1,1,1,1}, icon, false)
ability.icon:SetDrawLayer(0)
--[[
if BUI.Vars.DeveloperMode then
ability.label =BUI.UI.Label( fname.."_Label", ability, {size,size}, {TOPLEFT,TOPLEFT,0,0}, BUI.UI.Font(BUI.Vars.FrameFont1,fs-2,true), nil, {1,0}, id_check or '', false)
ability.label:SetDrawLayer(1)
end
--]]
ability.timer =BUI.UI.Label( fname.."_Timer", ability, {fs*4,fs}, {BOTTOM,BOTTOM,0,-5}, BUI.UI.Font(BUI.Vars.FrameFont1,fs,true,true), nil, {1,2}, '', false)
ability.timer:SetDrawLayer(1)
ability.count =BUI.UI.Label( fname.."_Count", ability, {size,size}, {TOP,TOP,0,0}, BUI.UI.Font(BUI.Vars.FrameFont1,size/2,true,true), nil, {2,0}, '', false)
ability.count:SetDrawLayer(2)
anchor=side and {RIGHT,LEFT,-space,0} or {LEFT,RIGHT,space,0}
ability.progress =BUI.UI.Backdrop(fname.."_Progress", ability, {w,ph}, anchor, {0,0,0,0}, {1,1,1,1}, nil, true) --not data[8])
ability.progress:SetEdgeTexture(bar_texture,32,4,4) ability.progress:SetEdgeColor(unpack(theme_color))
if ph>8 then
ability.pbg =BUI.UI.Backdrop(fname.."_pBg", ability.progress, {w-4,ph-4}, {TOPLEFT,TOPLEFT,2,2}, {0,0,0,1}, {0,0,0,0}, nil, false)
else
local frame=_G[fname.."_pBg"] if frame then frame:SetHidden(true) end
end
-- ability.progress:SetAlpha(.8)
anchor=side and {BOTTOMRIGHT,TOPRIGHT,0,-space} or {BOTTOMLEFT,TOPLEFT,0,-space}
ability.name =BUI.UI.Label( fname.."_Name", ability.progress, {w,fs-2}, anchor, BUI.UI.Font("standard",fs-2,true), nil, {(side and 2 or 0),0}, name, false)
anchor=side and {TOPRIGHT,BOTTOMRIGHT,0,-space} or {TOPLEFT,BOTTOMLEFT,0,-space}
-- ability.tName =BUI.UI.Label( fname.."_Target", ability.progress, {w,fs-2}, anchor, BUI.UI.Font("standard",fs-2,true), nil, {(side and 2 or 0),0}, "", false)
anchor=side and {RIGHT,RIGHT,-2,0} or {LEFT,LEFT,2,0}
ability.bar =BUI.UI.Statusbar(fname.."_Bar", ability.progress, {w-4,ph-4}, anchor, prog_color, BUI.Textures[BUI.Vars.FramesTexture], false)
ability.bar1 =BUI.UI.Statusbar(fname.."_Bar1", ability.progress, {w-4,ph-4}, anchor, cm, BUI.Textures[BUI.Vars.FramesTexture], true)
ability.bar1:SetAlpha(.75)
--Extra settings
ability.index=_id
ability.widget=true
if dup then return ability end
ability:SetMouseEnabled(true)
ability:SetHandler("OnMouseDown", function(self,button) BUI.Buffs.ButtonHandler(self,button) end)
ability:SetHandler("OnMoveStop", function(self) BUI.Menu:SaveAnchor(self,nil,nil,nil,side,data[7],data[8],data[9],data[10],data[11],data[12],data[13]) end)
ability:SetHandler("OnMouseEnter", BUI.Buffs.ShowTooltip)
ability:SetHandler("OnMouseExit", function()ClearTooltip(InformationTooltip)end)
-- ability:SetDrawTier(DT_HIGH)
anchor={BOTTOM,TOP,0,-space,ability}
end
end
end
end
function BUI.Frames.PassiveBuffs_Init()
local number =16
for i=1, number do control=_G["BUI_BuffsPas"..i] if control~=nil then control:SetHidden(true) end end
if not BUI.Vars.PlayerBuffs or BUI.Vars.BuffsPassives~="On additional panel" then return end
local fs =BUI.Vars.PassiveBuffSize/2.5 --16
local border =4
local space =3
local w =BUI.Vars.PassivePWidth
local size =BUI.Vars.PassiveBuffSize
local side =BUI.Vars.PassivePSide=="right"
--Create the Self Buffs frame container
local ui =BUI.UI.Control( "BUI_BuffsPas", BanditsUI, {size,(size+space)*number-space}, BUI.Vars.BUI_BuffsPas, false)
ui.backdrop =BUI.UI.Backdrop( "BUI_BuffsPas_BG", ui, "inherit", {BOTTOM,BOTTOM,0,0}, {0,0,0,0.4}, {0,0,0,1}, nil, true) --ui.backdrop:SetEdgeTexture("",16,4,4)
ui.label =BUI.UI.Label( "BUI_BuffsPas_Label", ui.backdrop, "inherit", {CENTER,CENTER,0,0}, BUI.UI.Font("standard",20,true), nil, {1,1}, BUI.Loc("PasBuffsLabel"))
ui:SetAlpha(BUI.Vars.FrameOpacityOut/100)
ui:SetDrawLayer(DT_HIGH)
ui:SetMovable(true)
ui:SetHandler("OnMouseUp", function(self) BUI.Menu:SaveAnchor(self) end)
ui.base =BUI.UI.Control("BUI_BuffsPas_Base", ui, "inherit", {BOTTOMLEFT,BOTTOMLEFT,0,0})
--Iterate over Buffs
local anchor ={BOTTOM,BOTTOM,0,0,ui.base}
local bar_texture =side and "/BanditsUserInterface/textures/theme/progressbar_right_2.dds" or "/BanditsUserInterface/textures/theme/progressbar_left_2.dds"
for i=1, number do
local color={.4,.4,.4,.6}
local ability =BUI.UI.Backdrop( "BUI_BuffsPas"..i, ui.base, {size,size}, anchor, theme_color, color, BUI.abilityframe, true)
ability:SetDrawLayer(0) ability:SetEdgeTexture("",8,4,4)
ability.icon =BUI.UI.Statusbar("BUI_BuffsPas"..i.."_Icon", ability, {size-border,size-border}, {CENTER,CENTER,0,0}, {1,1,1,1},'', false)
ability.icon:SetDrawLayer(0)
ability.label =BUI.UI.Label( "BUI_BuffsPas"..i.."_Label", ability, {size,size}, {TOPLEFT,TOPLEFT,0,0}, BUI.UI.Font(BUI.Vars.FrameFont1,fs-2,true), nil, {1,2}, '', false)
ability.label:SetDrawLayer(1)
ability.timer =BUI.UI.Label( "BUI_BuffsPas"..i.."_Timer", ability, {fs*4,fs}, {BOTTOM,BOTTOM,0,-5}, BUI.UI.Font(BUI.Vars.FrameFont1,fs,true,true), nil, {1,2}, '', false)
ability.timer:SetDrawLayer(1)
ability.count =BUI.UI.Label( "BUI_BuffsPas"..i.."_Count", ability, {fs*2,fs}, {TOPRIGHT,TOPRIGHT,0,0}, BUI.UI.Font(BUI.Vars.FrameFont1,fs,true,true), nil, {2,2}, '', false)
ability.count:SetDrawLayer(2)
anchor=side and {LEFT,RIGHT,space,0} or {RIGHT,LEFT,-space,0}
ability.progress =BUI.UI.Backdrop( "BUI_BuffsPas"..i.."_Progress", ability, {w,8}, anchor, {0,0,0,0}, {1,1,1,1}, nil, not BUI.Vars.PassiveProgress)
ability.progress:SetEdgeTexture(bar_texture,32,4,4) ability.progress:SetEdgeColor(unpack(theme_color))
ability.name =BUI.UI.Label( "BUI_BuffsPas"..i.."_Name", ability.progress, {w,fs-2}, {BOTTOMRIGHT,TOPRIGHT,0,-space}, BUI.UI.Font("standard",fs-2,true), nil, {side and 0 or 2,2}, '', false)
anchor=side and {LEFT,LEFT,2,0} or {RIGHT,RIGHT,-2,0}
ability.bar =BUI.UI.Statusbar("BUI_BuffsPas"..i.."_Bar", ability.progress, {w-4,8-4}, anchor, prog_color, BUI.Textures[BUI.Vars.FramesTexture], false)
--Extra settings
ability.index=i
ability.passives=true
ability:SetMouseEnabled(true)
ability:SetHandler("OnMouseDown", function(self,button) BUI.Buffs.ButtonHandler(self,button) end)
ability:SetHandler("OnMouseEnter", BUI.Buffs.ShowTooltip)
ability:SetHandler("OnMouseExit", function()ClearTooltip(InformationTooltip)end)
anchor={BOTTOM,TOP,0,-space,ability}
end
end
function BUI.Frames.TargetBuffs_Init()
if BUI_BuffsT_Panel then BUI_BuffsT_Panel:SetHidden(true) end
if not BUI.Vars.TargetBuffs then return end
local fs =BUI.Vars.TargetBuffSize/2.5 --16
local k =1.16
local space =3
local size =BUI.Vars.TargetBuffSize
local number =15
--Create the target buffs frame container
local ui =BUI.UI.Control( "BUI_BuffsT", BanditsUI, {(size+space)*number-space,size}, BUI.Vars.BUI_BuffsT, false)
ui.backdrop =BUI.UI.Backdrop( "BUI_BuffsT_BG", ui, "inherit", {CENTER,CENTER,0,0}, {0,0,0,0.4}, {0,0,0,1}, nil, true) --ui.backdrop:SetEdgeTexture("",16,4,4)
ui.label =BUI.UI.Label( "BUI_BuffsT_Label", ui.backdrop, "inherit", {CENTER,CENTER,0,0}, BUI.UI.Font("standard",20,true), nil, {1,1}, BUI.Loc("TBuffsLabel"))
ui:SetAlpha(BUI.Vars.FrameOpacityOut/100)
ui:SetDrawLayer(DT_HIGH)
ui:SetMovable(true)
ui:SetHandler("OnMouseUp", function(self) BUI.Menu:SaveAnchor(self) end)
ui.base =BUI.UI.Control( "BUI_BuffsT_Panel", ui, {size,size}, {BUI.Vars.TargetBuffsAlign,BUI.Vars.TargetBuffsAlign,0,0})
local anchor ={LEFT,LEFT,0,0,ui.base}
--Iterate over Buffs
for i=1, number do
local ability =BUI.UI.Backdrop( "BUI_BuffsT"..i, ui.base, {size,size}, anchor, theme_color, theme_color, BUI.abilityframe, true)
-- ability.debuff =BUI.UI.Statusbar("BUI_BuffsT"..i.."_Debuff", ability, {size,size/2}, {BOTTOM,TOP,0,0}, {1,1,1,1},'/BanditsUserInterface/textures/debuff.dds', true)
ability:SetDrawLayer(0) ability:SetEdgeTexture("",8,2,4)
ability.icon =BUI.UI.Statusbar("BUI_BuffsT"..i.."_Icon", ability, {size/k,size/k}, {CENTER,CENTER,0,0}, {1,1,1,1},'', false)
ability.icon:SetDrawLayer(1)
ability.label =BUI.UI.Label( "BUI_BuffsT"..i.."_Label", ability, {size,size}, {TOP,TOP,0,0}, BUI.UI.Font(BUI.Vars.FrameFont1,fs-2,true), nil, {1,2}, '', false)
ability.label:SetDrawLayer(2)
ability.timer =BUI.UI.Label( "BUI_BuffsT"..i.."_Timer", ability, {fs*4,fs}, {BOTTOM,BOTTOM,0,-5}, BUI.UI.Font(BUI.Vars.FrameFont1,fs,true,true), nil, {1,2}, '', false)
ability.timer:SetDrawLayer(2)
ability.count =BUI.UI.Label( "BUI_BuffsT"..i.."_Count", ability, {fs*2,fs}, {TOPRIGHT,TOPRIGHT,0,0}, BUI.UI.Font(BUI.Vars.FrameFont1,fs,true,true), nil, {2,2}, '', false)
ability.count:SetDrawLayer(2)
--Extra settings
anchor={LEFT,RIGHT,space,0,ability}
end
end
local function PlayerBuffs_Update()
local border =6
local space =5
local size =BUI.Vars.PlayerBuffSize
local number=(not BUI.PlayerBuffs) and 0 or #BUI.PlayerBuffs
BUI_BuffsP_Panel:SetWidth((size+space)*math.min(number,16)-space)
--Main Buffs
for i=1, math.min(number,16) do
local ability=_G["BUI_BuffsP"..i]
if BUI.PlayerBuffs[i].Blank then
ability:SetHidden(true)
else
local color=(not BUI.PlayerBuffs[i].Positive) and source_color[1] or ((BUI.PlayerBuffs[i].Player and BUI.Vars.CastbyPlayer) and theme_color or source_color[3])
local scale=BUI.PlayerBuffs[i].Scale
ability:SetHidden(false)
ability:SetEdgeColor(unpack(color))
-- ability.icon:SetColor(unpack(BUI.PlayerBuffs[i].Color))
ability.icon:SetTexture(BUI.PlayerBuffs[i].Texture)
if BUI.Vars.DeveloperMode then ability.label:SetText(BUI.PlayerBuffs[i].Plate) end
ability.timer:SetText(BUI.FormatTime(BUI.PlayerBuffs[i].Timer/1000))
ability.count:SetText((BUI.PlayerBuffs[i].Count>0) and BUI.PlayerBuffs[i].Count or "")
ability:SetDimensions(size*scale,size*scale)
ability.icon:SetDimensions(size*scale-border,size*scale-border)
end
end
for i=math.min(number+1,16), 16 do _G["BUI_BuffsP"..i]:SetHidden(true) end
--Passives
if BUI.Vars.BuffsPassives=="On additional panel" then
number=#BUI.PassiveBuffs
for i=1, math.min(number,16) do
local ability=_G["BUI_BuffsPas"..i]
if ability then
local color=(not BUI.PassiveBuffs[i].Positive) and source_color[1] or ((BUI.PassiveBuffs[i].Player and BUI.Vars.CastbyPlayer) and theme_color or source_color[3])
ability:SetHidden(false)
ability:SetEdgeColor(unpack(color))
-- ability.icon:SetColor(unpack(BUI.PassiveBuffs[i].Color))
ability.icon:SetTexture(BUI.PassiveBuffs[i].Texture)
if BUI.Vars.DeveloperMode then ability.label:SetText(BUI.PassiveBuffs[i].Plate) end
ability.timer:SetText(BUI.FormatTime(BUI.PassiveBuffs[i].Timer/1000))
ability.count:SetText((BUI.PassiveBuffs[i].Count>0) and BUI.PassiveBuffs[i].Count or "")
if BUI.Vars.PassiveProgress then
ability.name:SetText(BUI.PassiveBuffs[i].Name)
local pct=BUI.PassiveBuffs[i].Timer/BUI.PassiveBuffs[i].Duration
ability.bar:SetWidth(pct*(ability.progress:GetWidth()-4))
end
end
end
for i=math.min(number+1,16), 16 do _G["BUI_BuffsPas"..i]:SetHidden(true) end
BUI_BuffsPas_Base:SetHeight((BUI.Vars.PassiveBuffSize+space)*number-space)
end
end
local function Widgets_Update()
local now=GetGameTimeMilliseconds()
--Potion
if BUI.Vars.WidgetPotion and now>=BUI.PotionEndTime-5000 and BUI.Player[BUI.MainPower].max-BUI.Player[BUI.MainPower].current>=6000 then
BUI.Widgets["Potion"]={
id =0,
Name ="Potion",
Count =0,
Texture =PotionIcon[BUI.MainPower],
Duration =math.max(BUI.PotionEndTime-now,0),
Started =now,
Confirm =true,
Expires =BUI.Widgets.Potion and BUI.Widgets.Potion.Expires,
}
end
for _id in pairs(BUI.Widgets) do
local id=string.gsub(_id," ","_")
local ability=_G["BUI_Widget_"..id]
if ability then
local widget=BUI.Vars["BUI_Widget_"..id] or {}
local function Update(data,targetName)
if not data.Confirm and not data.Hold then
if widget[12] then --Always show
ability.progress:SetHidden(true)
ability.timer:SetText("")
ability.count:SetText("")
else
ability:SetHidden(true)
end
ability.Target=nil
return true
end
if not ability.init then
ability.icon:SetTexture(data.Texture)
ability.init=true
end
--Activation
if not data.Expires then
if (widget[13]==1 or widget[13]==3) then PlaySound(BUI.Vars.WidgetSound1) end
data.Expires=1
end
--Update
data.Confirm=nil
local color=(not data.Positive) and source_color[1] or ((data.Player and BUI.Vars.CastbyPlayer) and theme_color or source_color[3])
ability.bg:SetEdgeColor(unpack(color))
local duration=widget[7] or data.Duration
local timer=(data.Started or 0)+duration-now
if duration>data.Duration then data.Hold=true end
ability:SetHidden(false)
ability.timer:SetText(timer>0 and BUI.FormatTime(timer/1000) or "")
ability.count:SetText(data.Count and data.Count>0 and data.Count or "")
if widget[8] then
ability.progress:SetHidden(false)
ability.name:SetText(targetName or data.Name)
local pct=duration>0 and timer/duration or 1
ability.bar:SetWidth(pct*(BUI.Vars.WidgetsPWidth-4))
if data.Combine and BUI.Widgets[data.Combine] then
local comb=BUI.Widgets[data.Combine]
local pct=comb.Duration>0 and ((comb.Started or 0)+comb.Duration-now)/comb.Duration or 1
ability.bar1:SetWidth(pct*(BUI.Vars.WidgetsPWidth-4))
ability.bar1:SetHidden(false)
BUI.Widgets[data.Combine]=nil
else
ability.bar1:SetHidden(true)
end
end
if timer<=0 then
data.Hold=nil
elseif timer<1000 and timer>0 and data.Expires~=2 then
--Deactivation
if (widget[13]==2 or widget[13]==3) then PlaySound(BUI.Vars.WidgetSound2) end
BUI.UI.Expires(ability.bg)
data.Expires=2
end
end
--Multytarget
if BUI.Widgets[_id].Target then
local dup=0
for targetName,data in pairs(BUI.Widgets[_id]) do
if targetName~="Target" then
if dup>0 and dup<10 then
ability=_G["BUI_Widget_"..id.."_"..dup] or BUI.Frames.Widgets_Init(id,dup)
end
if Update(data,targetName) then BUI.Widgets[_id][targetName]=nil end
-- ability.tName:SetText(targetName)
dup=dup+1
end
end
if dup==0 then
BUI.Widgets[_id]=nil
else
for i=dup,9 do frame=_G["BUI_Widget_"..id.."_"..i] if frame then frame:SetHidden(true) end end
end
else
if Update(BUI.Widgets[_id]) then BUI.Widgets[_id]=nil end
end
end
end
end
local function CustomBuffs_Update()
--Custom Buffs
number=#BUI.CustomBuffs
for i=1, math.min(number,12) do
local ability=_G["BUI_BuffsC"..i]
if ability then
local color=(not BUI.CustomBuffs[i].Positive) and source_color[1] or ((BUI.CustomBuffs[i].Player and BUI.Vars.CastbyPlayer) and theme_color or source_color[3])
ability:SetHidden(false)
ability.bg:SetEdgeColor(unpack(color))
-- ability.icon:SetColor(unpack(BUI.CustomBuffs[i].Color))
ability.icon:SetTexture(BUI.CustomBuffs[i].Texture)
if BUI.Vars.DeveloperMode then ability.label:SetText(BUI.CustomBuffs[i].Plate) end
ability.timer:SetText(BUI.FormatTime(BUI.CustomBuffs[i].Timer/1000))
ability.count:SetText((BUI.CustomBuffs[i].Count>0) and BUI.CustomBuffs[i].Count or "")
if BUI.CustomBuffs[i].Timer<1000 and BUI.CustomBuffs[i].Timer>0 then BUI.UI.Expires(ability.bg) end
if BUI.Vars.CustomBuffsProgress then
ability.name:SetText(BUI.CustomBuffs[i].Name)
local pct=BUI.CustomBuffs[i].Timer/BUI.CustomBuffs[i].Duration
ability.bar:SetWidth(pct*(ability.progress:GetWidth()-4))
end
end
end
for i=math.min(number+1,12), 12 do _G["BUI_BuffsC"..i]:SetHidden(true) end
end
local function SynergyCd_Update()
--Custom Buffs
local now=GetGameTimeMilliseconds()
for i=1,4 do
local ability=_G["BUI_BuffsS"..i]
if ability then
if BUI.SynergyCd[i] then
local timer=BUI.SynergyCd[i].StartTime+20000-now
ability:SetHidden(false)
ability.icon:SetTexture(BUI.SynergyCd[i].Texture)
ability.timer:SetText(BUI.FormatTime(timer/1000))
-- ability.label:SetText(BUI.SynergyCd[i].id)
if timer<1000 and timer>0 then BUI.UI.Expires(ability.bg) end
if BUI.Vars.SynergyCdProgress then
ability.name:SetText(BUI.SynergyCd[i].Name)
local pct=timer/20000
ability.bar:SetWidth(pct*(ability.progress:GetWidth()-4))
end
if timer<=BUI.Buffs.UpdateTime then BUI.SynergyCd[i]=nil end
else
ability:SetHidden(true)
end
end
end
end
local function TargetBuffs_Update()
local k =1.16
local space =5
local size =BUI.Vars.TargetBuffSize
local number=(BUI.TargetBuffs==nil) and 0 or #BUI.TargetBuffs
BUI_BuffsT_Panel:SetWidth((size+space)*number-space)
--Iterate over Buffs
for i=1, math.min(number,15) do
local ability=_G[ "BUI_BuffsT"..i]
if BUI.TargetBuffs[i].Blank then
ability:SetHidden(true)
else
local color=(BUI.TargetBuffs[i].Player and BUI.Vars.CastbyPlayer) and theme_color or source_color[3]
local set=BUI.TargetBuffs[i].Set
ability:SetHidden(false)
ability:SetEdgeColor(unpack(color))
-- ability.debuff:SetHidden(BUI.TargetBuffs[i].Positive)
-- ability.icon:SetColor(unpack(BUI.TargetBuffs[i].Color))
ability.icon:SetTexture(BUI.TargetBuffs[i].Texture)
if BUI.Vars.DeveloperMode then ability.label:SetText(BUI.TargetBuffs[i].Plate) end
ability.timer:SetText(BUI.FormatTime(BUI.TargetBuffs[i].Timer/1000))
ability.count:SetText((BUI.TargetBuffs[i].Count>0) and BUI.TargetBuffs[i].Count or "")
ability:SetDimensions(size*set,size*set)
-- ability.debuff:SetDimensions(size*set,size*set/2)
ability.icon:SetDimensions(size*set/k,size*set/k)
end
end
for i=math.min(number+1,15), 15 do control=_G["BUI_BuffsT"..i] if control~=nil then control:SetHidden(true) end end
end
local function BuffsPlayer() --PlayerBuffs
local now=GetGameTimeMilliseconds()
local numBuffs=GetNumBuffs("player")
local index=(BUI.Vars.BuffsPassives=="On one panel") and 2 or 1
local index,p_index,c_index,num_buffs,num_debuff,num_passive=0,0,0,0,0,0
local Purge=false
local have_food=false
BUI.Buffs.HornActive=nil
local buffName,timeStarted,timeEnding,buffSlot,stackCount,iconFilename,buffType,effectType,abilityType,statusEffectType,abilityId,canClickOff,castByPlayer
BUI.PlayerBuffs={}
BUI.PassiveBuffs={}
BUI.CustomBuffs={}
-- BUI.Widgets={}
TMP_PENETR=0
BUI.Expedition=0
BUI.Gallop=0
BUI_ReticleBoost:SetHidden(true)
for i=-8, numBuffs do
buffName=nil
local effect=BUI.Buffs.Effects[i]
if effect and effect.timeEnding>now/1000 then
buffName =ProcEffects[effect.id].name
timeStarted =effect.timeStarted
timeEnding =effect.timeEnding
effectType =ProcEffects[effect.id].negative and -1 or 1
abilityId =effect.id
iconFilename =ProcEffects[effect.id].icon
castByPlayer =not ProcEffects[effect.id].negative
stackCount =0
elseif i>0 then
buffName,timeStarted,timeEnding,buffSlot,stackCount,iconFilename,buffType,effectType,abilityType,statusEffectType,abilityId,canClickOff,castByPlayer=GetUnitBuffInfo("player",i)
buffName=string.gsub(buffName,"%^%w+","")
end