-
Notifications
You must be signed in to change notification settings - Fork 12
/
HateShrieker.lua
35 lines (26 loc) · 959 Bytes
/
HateShrieker.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
local HateShrieker = {}
function HateShrieker.OnEnterCombat(event, creature, target)
creature:RegisterEvent(HateShrieker.Screech, 7000, 0)
creature:RegisterEvent(HateShrieker.ShadowWordPain, math.random(11000,16000), 0)
end
function HateShrieker.Screech(eventId, delay, calls, creature)
creature:CastSpell(creature, 3589)
end
function HateShrieker.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function HateShrieker.OnDied(event, creature, killer)
creature:RemoveEvents()
end
function HateShrieker.ShadowWordPain(eventId, delay, calls, creature)
local targets = creature:GetAITargets(10)
if #targets == 0 then
return
end
local target = targets[math.random(#targets)]
creature:CastSpell(target, 10893)
creature:ClearThreatList()
end
RegisterCreatureEvent(8541, 1, HateShrieker.OnEnterCombat)
RegisterCreatureEvent(8541, 2, HateShrieker.OnLeaveCombat)
RegisterCreatureEvent(8541, 4, HateShrieker.OnDied)