forked from kaminaris/MaxDps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tier.lua
150 lines (144 loc) · 5.23 KB
/
Tier.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
--- @type MaxDps MaxDps
local _, MaxDps = ...;
local GetInventorySlotInfo = GetInventorySlotInfo
local GetInventoryItemLink = GetInventoryItemLink
local GetItemInfo = GetItemInfo
local slots = {"HEADSLOT","SHOULDERSLOT", "CHESTSLOT", "LEGSSLOT", "HANDSSLOT"}
local tiernumbers = {30, 31}
function MaxDps:CountTier()
if not self.tier then
self.tier = {}
end
local _, _, classIndex = UnitClass("player")
local count = 0
local tier
for _,tier in pairs(tiernumbers) do
if not self.tier[tier] then
self.tier[tier] = {}
end
for _,slotName in pairs(slots) do
local match = nil
local slotID = GetInventorySlotInfo(slotName)
local itemLink = GetInventoryItemLink("player", slotID)
local itemName
if itemLink then
itemName = GetItemInfo(itemLink)
--print(itemLink)
else
break
end
if itemName == nil then return end
if tier == 30 then
-- DK
if classIndex == 6 then
match = string.match(itemName,"Lingering Phantom's")
end
-- DH
if classIndex == 12 then
match = string.match(itemName,"Kinslayer's")
end
-- Druid
if classIndex == 11 then
match = string.match(itemName,"the Autumn Blaze")
end
-- Evoker
if classIndex == 13 then
match = string.match(itemName,"Obsidian Secrets")
end
-- Hunter
if classIndex == 3 then
match = string.match(itemName,"Ashen Predator's")
end
-- Mage
if classIndex == 8 then
match = string.match(itemName,"Underlight Conjurer's")
end
-- Monk
if classIndex == 10 then
match = string.match(itemName,"the Vermillion Forge")
end
-- Paladin
if classIndex == 2 then
match = string.match(itemName,"Heartfire Sentinel's")
end
-- Priest
if classIndex == 5 then
match = string.match(itemName,"The Furnace Seraph")
end
-- Rogue
if classIndex == 4 then
match = string.match(itemName,"Lurking Specter's")
end
-- Shaman
if classIndex == 7 then
match = string.match(itemName,"of the Cinderwolf")
end
-- Warlock
if classIndex == 9 then
match = string.match(itemName,"Grim Inquisitor's")
end
-- Warrior
if classIndex == 1 then
match = string.match(itemName,"of the Onyx Crucible")
end
end
if tier == 31 then
-- DK
if classIndex == 6 then
match = string.match(itemName,"of the Risen Nightmare")
end
-- DH
if classIndex == 12 then
match = string.match(itemName,"Screaming Torchfiend's")
end
-- Druid
if classIndex == 11 then
match = string.match(itemName,"Benevolent Embersage's")
end
-- Evoker
if classIndex == 13 then
match = string.match(itemName,"Werynkeeper's Timeless")
end
-- Hunter
if classIndex == 3 then
match = string.match(itemName,"Blazing Dreamstalker's")
end
-- Mage
if classIndex == 8 then
match = string.match(itemName,"Wayward Chronomancer's")
end
-- Monk
if classIndex == 10 then
match = string.match(itemName,"Mystic Heron's")
end
-- Paladin
if classIndex == 2 then
match = string.match(itemName,"Zealous Pyreknight's")
end
-- Priest
if classIndex == 5 then
match = string.match(itemName,"of Lunar Communion")
end
-- Rogue
if classIndex == 4 then
match = string.match(itemName,"Lucid Shadewalker's")
end
-- Shaman
if classIndex == 7 then
match = string.match(itemName,"Greatwolf Outcast's")
end
-- Warlock
if classIndex == 9 then
match = string.match(itemName,"Devout Ashdevil's")
end
-- Warrior
if classIndex == 1 then
match = string.match(itemName,"Molten Vanguard's")
end
end
if match then count = count + 1 end
end
self.tier[tier].count = count
end
return count
end