forked from E1ila/RaidLogger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Buffs.lua
executable file
·278 lines (276 loc) · 6.94 KB
/
Buffs.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
local BUFFS = {
["22888"] = {
name = "Rallying Cry of the Dragonslayer",
desc = "Dragonslayer",
type = "World"
},
["15366"] = {
name = "Songflower Serenade",
desc = "Songflower",
type = "World",
},
["16609"] = {
name = "Warchief's Blessing",
desc = "WCB",
type = "World",
},
["23766"] = {
name = "Sayge's Dark Fortune of Intelligence",
desc = "DMF",
type = "world"
},
["23738"] = {
name = "Sayge's Dark Fortune of Spirit",
desc = "DMF",
type = "world"
},
["23768"] = {
name = "Sayge's Dark Fortune of Damage",
desc = "DMF",
type = "world"
},
["24425"] = {
name = "Spirit of Zandalar",
desc = "ZG",
type = "world"
},
["22817"] = {
name = "Fengus' Ferocity",
desc = "DMT AP",
type = "World",
},
["22820"] = {
name = "Slip'kik's Savvy",
desc = "DMT Crit",
type = "World",
},
["22818"] = {
name = "Mol'dar's Moxie",
desc = "DMT Stamina",
type = "World",
},
["11364"] = {
name = "Resistance",
desc = "Magic Resistance Potion",
type = "Consumable",
},
["3593"] = {
name = "Health II",
desc = "Elixir of Fortitude",
type = "Consumable",
},
["3222"] = {
name = "Regeneration (6 hp5)",
desc = "Strong Troll's Blood Potion",
type = "Consumable",
},
["3223"] = {
name = "Regeneration (12 hp5)",
desc = "Mighty Troll's Blood Potion",
type = "Consumable",
},
["24361"] = {
name = "Regeneration (20 hp5)",
desc = "Major Troll's Blood Potion",
type = "Consumable",
},
["24363"] = {
name = "Mana Regeneration (12 mp5)",
desc = "Mageblood Potion",
type = "Consumable",
},
["17549"] = {
name = "Greater Arcane Protection",
desc = "Greater Arcane Protection Potion",
type = "Consumable"
},
["17543"] = {
name = "Greater Fire Protection",
desc = "Greater Fire Protection Potion",
type = "Consumable"
},
["7233"] = {
name = "Fire Protection",
type = "Consumable"
},
["17548"] = {
name = "Greater Shadow Protection",
desc = "Greater Shadow Protection Potion",
type = "Consumable"
},
["7242"] = {
name = "Shadow Protection",
desc = "Shadow Protection Potion",
type = "Consumable"
},
["17546"] = {
name = "Greater Nature Protection",
desc = "Greater Nature Protection Potion",
type = "Consumable"
},
["7254"] = {
name = "Nature Protection",
desc = "Nature Protection Potion",
type = "Consumable"
},
["17544"] = {
name = "Greater Frost Protection",
desc = "Greater Frost Protection Potion",
type = "Consumable"
},
["7239"] = {
name = "Frost Protection",
desc = "Frost Protection Potion",
type = "Consumable"
},
["17539"] = {
name = "Greater Arcane Elixir",
type = "Consumable",
},
["11474"] = {
name = "Elixir of Shadow Power",
type = "Consumable",
},
["17538"] = {
name = "Elixir of the Mongoose",
type = "Consumable",
},
["11405"] = {
name = "Elixir of the Giants",
type = "Consumable",
},
["16326"] = {
name = "Juju Ember",
desc = "Fire Res Juju",
type = "Consumable",
},
["16329"] = {
name = "Juju Might",
desc = "Attack Power Juju",
type = "Consumable",
},
["16323"] = {
name = "Juju Power",
desc = "Strength Juju",
type = "Consumable",
},
["16322"] = {
name = "Juju Flurry",
desc = "Attack Speed Juju",
type = "Consumable",
},
["16325"] = {
name = "Juju Chill",
desc = "Frost Res Juju",
type = "Consumable",
},
["16321"] = {
name = "Juju Escape",
desc = "Dodge Juju",
type = "Consumable",
},
["17628"] = {
name = "Supreme Power",
type = "Flask",
},
["17626"] = {
name = "Flask of the Titans",
type = "Flask",
},
["17627"] = {
name = "Distilled Wisdom",
type = "Flask",
},
["24870"] = {
name = "Well Fed (?? sta, ?? spi)",
type = "Food",
},
["19705"] = {
name = "Well Fed (1 sta, 1 spi)",
type = "Food",
},
["19706"] = {
name = "Well Fed (3 sta, 3 spi)",
type = "Food",
},
["19709"] = {
name = "Well Fed (7 sta, 7 spi)",
type = "Food",
},
["19710"] = {
name = "Well Fed (11 sta, 11 spi)",
type = "Food",
},
["19711"] = {
name = "Well Fed (13 sta, 13 spi)",
type = "Food",
},
["25694"] = {
name = "Well Fed (2 mp5)",
type = "Food",
},
["25941"] = {
name = "Well Fed (5 mp5)",
type = "Food",
},
["18194"] = {
name = "Mana Regeneration (7 mp5)",
desc = "Nightfin Soup",
type = "Food",
},
["22730"] = {
name = "Increased Intellect (9 int)",
desc = "Runn Tum Tuber Surprise",
type = "Food",
},
["18192"] = {
name = "Increased Agility (9 agi)",
desc = "Grilled Squid",
type = "Food",
},
["24799"] = {
name = "Well Fed (19 str)",
desc = "Smoked Desert Dumpling",
type = "Food",
},
["22789"] = {
name = "Gordok Green Grog (10 sta)",
desc = "DMT beer",
type = "Alcohol",
},
["22790"] = {
name = "Kreeg's Stout Beatdown (25 spi, -5 int)",
desc = "DMT beer",
type = "Alcohol",
},
["25804"] = {
name = "Rumsey Rum Black Label (15 sta)",
desc = "Fishing",
type = "Alcohol",
},
}
function RaidLogger_CheckBuffs(players)
for i = 1, 40 do
name, _, group = GetRaidRosterInfo(i)
if name then
if not players[name] then players[name] = {} end
RaidLogger_CheckUnitBuffs(players[name], "raid" .. i)
players[name]["present"] = (players[name]["present"] or 0) + 1
end
end
return players
end
function RaidLogger_CheckUnitBuffs(player, unit)
for i = 1, 40 do
local buffName, _, _, _, _, _, _, _, _, spellId = UnitBuff(unit, i)
if spellId then
-- using string because our lua parser having hard time dealing with number keys
spellId = tostring(spellId)
local trackedBuff = BUFFS[spellId]
-- print(" |cff0088ff<|cff00bbffRaidLogger|cff0088ff>|r player "..i.." has "..buffName.." "..tostring(trackedBuff))
if trackedBuff then
player[spellId] = (player[spellId] or 0) + 1
end
end
end
end