This repository was archived by the owner on Apr 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBadRNG.lua
More file actions
59 lines (52 loc) · 1.19 KB
/
BadRNG.lua
File metadata and controls
59 lines (52 loc) · 1.19 KB
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
local parser = ParserLib:GetInstance("1.1")
local skills = {
-- "Rake", -- For testing
"Heroic Strike",
"Shield Slam",
"Sunder Armor",
"Revenge"
}
local tanks = {
-- ParserLib_SELF, -- For testing
"Ahtia",
"Sulg",
"Henkebenke",
"Nyo",
"Percaso"
}
local bosses = {
-- "Galak", -- For testing
"Vaelastrasz",
"Broodlord Lashlayer",
"Chromagus"
}
function contains(list, item)
for _, i in ipairs(list) do
if item == i then
return true
end
end
return false
end
function BadRNG_OnLoad()
-- parser:RegisterEvent("BadRNG", "CHAT_MSG_SPELL_SELF_DAMAGE", ParserLib_OnEvent) -- For testing
parser:RegisterEvent("BadRNG", "CHAT_MSG_SPELL_PARTY_DAMAGE", ParserLib_OnEvent)
end
function ParserLib_OnEvent(event, info)
if info.type == "miss" then
if contains(tanks, info.source) then
if contains(skills, info.skill) then
local boss_match = false
for _, boss in ipairs(bosses) do
if string.find(info.victim, boss) then
boss_match = true
end
end
if boss_match then
-- Everything matches. Do what you want here.
SendChatMessage(arg1,"PARTY");
end
end
end
end
end