-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
145 lines (111 loc) · 3.84 KB
/
main.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
if not MaxDps then
return;
end
local Paladin = MaxDps:NewModule('Paladin');
-- Spells
local _TemplarsVerdict = 85256;
local _Judgment = 20271;
local _CrusaderStrike = 35395;
local _BladeofJustice = 184575;
local _Crusade = 231895;
local _ShieldofVengeance = 184662;
local _Zeal = 217020;
local _Consecration = 205228;
local _HammerofWrath = 24275;
local _Inquisition = 84963;
local _ExecutionSentence = 267798;
local _WakeofAshes = 255937;
local _JudgementHoly = 275773;
local _HolyShock = 20473;
local _HolyConsecration = 26573;
local _HolyConsecrationAura = 204242;
local _ProtJudgement = 275779;
local _AvengersShield = 31935;
local _HammerRight = 53595;
local _BlessedHammer = 204019;
local _ShieldRightous = 53600;
local _ConsecrationProtAura = 188370;
-- General
function Paladin:Enable()
MaxDps:Print(MaxDps.Colors.Info .. 'Paladin [Holy, Protection, Retribution]');
if MaxDps.Spec == 1 then
MaxDps.NextSpell = Paladin.Holy;
elseif MaxDps.Spec == 2 then
MaxDps.NextSpell = Paladin.Protection;
elseif MaxDps.Spec == 3 then
MaxDps.NextSpell = Paladin.Retribution;
end;
return true;
end
function Paladin:Holy(timeShift, currentSpell, gcd, talents)
if MaxDps:SpellAvailable(_JudgementHoly, timeShift) then
return _JudgementHoly;
end
if MaxDps:SpellAvailable(_CrusaderStrike, timeShift) then
return _CrusaderStrike;
end
if MaxDps:SpellAvailable(_HolyShock, timeShift) then
return _HolyShock;
end
if MaxDps:SpellAvailable(_HolyConsecration, timeShift) and not MaxDps:TargetAura(_HolyConsecrationAura, timeShift) then
return _HolyConsecration;
end
end
function Paladin:Protection(timeShift, currentSpell, gcd, talents)
if MaxDps:SpellAvailable(_ShieldRightous, timeShift) then
return _ShieldRightous;
end
if MaxDps:SpellAvailable(_HolyConsecration, timeShift) and not MaxDps:TargetAura(_HolyConsecrationAura, timeShift) and not MaxDps:Aura(_ConsecrationProtAura) then
return _HolyConsecration;
end
if MaxDps:SpellAvailable(_ProtJudgement, timeShift) then
return _ProtJudgement;
end
if MaxDps:SpellAvailable(_AvengersShield, timeShift) then
return _AvengersShield;
end
if not talents[_BlessedHammer] and MaxDps:SpellAvailable(_HammerRight, timeShift) then
return _HammerRight;
end
if talents[_BlessedHammer] and MaxDps:SpellAvailable(_BlessedHammer, timeShift) then
return _BlessedHammer;
end
end
function Paladin:Retribution(timeShift, currentSpell, gcd, talents)
local crusStrike = _CrusaderStrike;
if talents[_Zeal] then
crusStrike = _Zeal;
end
local holyPower = UnitPower('player', Enum.PowerType.HolyPower);
MaxDps:GlowCooldown(_ShieldofVengeance, MaxDps:SpellAvailable(_ShieldofVengeance, timeShift));
if talents[_Crusade] then
MaxDps:GlowCooldown(_Crusade, MaxDps:SpellAvailable(_Crusade, timeShift));
end
if talents[_WakeofAshes] and holyPower<=1 and MaxDps:SpellAvailable(_WakeofAshes, timeShift) then
return _WakeofAshes;
end
if talents[_Inquisition] and holyPower>1 and not MaxDps:Aura(_Inquisition, timeShift) then
return _Inquisition;
end
if talents[_ExecutionSentence] and MaxDps:SpellAvailable(_ExecutionSentence, timeShift) and holyPower >= 3 then
return _ExecutionSentence;
end
if holyPower >= 5 then
return _TemplarsVerdict;
end
if MaxDps:SpellAvailable(_HammerofWrath, timeShift) and holyPower <=4 and MaxDps:TargetPercentHealth() < 0.2 and MaxDps:TargetPercentHealth() > 0 then
return _HammerofWrath;
end
if MaxDps:SpellAvailable(_BladeofJustice, timeShift) and holyPower <= 3 then
return _BladeofJustice;
end
if MaxDps:SpellAvailable(_Judgment, timeShift) and holyPower <= 4 then
return _Judgment;
end
if talents[_Consecration] and MaxDps:SpellAvailable(_Consecration, timeShift) and holyPower <=4 then
return _Consecration;
end
if MaxDps:SpellAvailable(crusStrike, timeShift) and holyPower <= 4 then
return crusStrike;
end
end