-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathutilities.lua
More file actions
40 lines (32 loc) · 767 Bytes
/
utilities.lua
File metadata and controls
40 lines (32 loc) · 767 Bytes
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
local addonName, addon = ...
function addon:GetTalentRank(tabIndex, talentIndex)
local _, _, _, _, rank = GetTalentInfo(tabIndex, talentIndex)
return rank
end
function addon:HasTalentRank(tabIndex, talentIndex, rankRequired)
return self:GetTalentRank(tabIndex, talentIndex) >= (rankRequired or 1)
end
function addon:HasGlyph(id)
for i = 1, GetNumGlyphSockets() do
local _, _, _, spellId = GetGlyphSocketInfo(i)
if spellId == id then
return true
end
end
return false
end
function addon:GetItemSetCount(set)
local count = 0
local link
for i = 1, 10 do
link = GetInventoryItemLink("player", i)
if link then
for _, itemId in pairs(set) do
if link:find(itemId) then
count = count + 1
end
end
end
end
return count
end