forked from SwimmingTiger/TotemTimers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Spells.lua
executable file
·66 lines (57 loc) · 2.42 KB
/
Spells.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
-- Copyright © 2008 - 2012 Xianghar <[email protected]>
-- All Rights Reserved.
-- This code is not to be modified or distributed without written permission by the author.
-- Current distribution permissions only include curse.com, wowinterface.com and their respective addon updaters
if select(2,UnitClass("player")) ~= "SHAMAN" then return end
local TotemTimers = TotemTimers
local SpellNames = TotemTimers.SpellNames
local SpellIDs = TotemTimers.SpellIDs
local function GetSpellTab(tab)
local _, _, offset, numSpells = GetSpellTabInfo(tab)
local AvailableSpells = TotemTimers.AvailableSpells
for s = offset + 1, offset + numSpells do
local spelltype, spell = GetSpellBookItemInfo(s, BOOKTYPE_SPELL)
if spelltype == "SPELL" then
AvailableSpells[spell] = true
end
end
end
local GetSpellInfo = GetSpellInfo
local IsPlayerSpell = IsPlayerSpell
function TotemTimers.GetSpells()
local AvailableSpells = TotemTimers.AvailableSpells
wipe(AvailableSpells)
for _,s in pairs(SpellIDs) do
AvailableSpells[s] = IsPlayerSpell(s)
if AvailableSpells[s] then
AvailableSpells[s] = GetSpellInfo(SpellNames[s]) == SpellNames[s]
end
end
--[[if AvailableSpells[TotemTimers.SpellIDs.PrimalStrike] and UnitLevel("player") > 10 then
AvailableSpells[TotemTimers.SpellIDs.StormStrike] = true
end]]
return true
end
--[[function TotemTimers.GetTalents()
wipe(TotemTimers.AvailableTalents)
if select(5, GetTalentInfo(2,17))>0 then TotemTimers.AvailableTalents.Maelstrom = true end
if select(5, GetTalentInfo(1,18))>0 then TotemTimers.AvailableTalents.LavaSurge = true end
if select(5, GetTalentInfo(1,13))>0 then TotemTimers.AvailableTalents.Fulmination = true end
end]]
function TotemTimers.LearnedSpell(spell,tab)
if spell then TotemTimers.AvailableSpells[spell] = true end
TotemTimers.SetCastButtonSpells()
TotemTimers.SetWeaponTrackerSpells()
TotemTimers.ProcessSetting("AnkhTracker")
TotemTimers.ProcessSetting("ShieldTracker")
-- TotemTimers.ProcessSetting("EarthShieldTracker")
-- TotemTimers.ProcessSetting("EnhanceCDs")
TotemTimers.ProcessSetting("Show")
-- TotemTimers.ProcessSetting("LongCooldowns")
TotemTimers.ProgramSetButtons()
end
function TotemTimers.ChangedTalents()
TotemTimers.GetSpells()
TotemTimers.SelectActiveProfile()
TotemTimers.ExecuteProfile()
end