-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMain.lua
47 lines (38 loc) · 1.17 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
local addonName, addonTable = ...
_G[addonName] = addonTable
--- @type MaxDps
if not MaxDps then return end
local MaxDps = MaxDps
local GetSpellInfo = C_Spell and C_Spell.GetSpellInfo or _G.GetSpellInfo
local GetTotemInfo = GetTotemInfo
local GetTime = GetTime
local Shaman = MaxDps:NewModule('Shaman')
addonTable.Shaman = Shaman
Shaman.spellMeta = {
__index = function(t, k)
print('Spell Key ' .. k .. ' not found!')
end
}
function Shaman:Enable()
if MaxDps.Spec == 1 then
MaxDps.NextSpell = Shaman.Elemental
MaxDps:Print(MaxDps.Colors.Info .. 'Shaman Elemental', "info")
elseif MaxDps.Spec == 2 then
MaxDps.NextSpell = Shaman.Enhancement
MaxDps:Print(MaxDps.Colors.Info .. 'Shaman Enhancement', "info")
elseif MaxDps.Spec == 3 then
MaxDps.NextSpell = Shaman.Restoration
MaxDps:Print(MaxDps.Colors.Info .. 'Shaman Restoration', "info")
end
return true
end
function Shaman:TotemMastery(totem)
local tmName = C_Spell and GetSpellInfo(totem).name or GetSpellInfo(totem)
for i = 1, 4 do
local haveTotem, totemName, startTime, duration = GetTotemInfo(i)
if haveTotem and totemName == tmName then
return startTime + duration - GetTime()
end
end
return 0
end