-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScornStone.lua
42 lines (36 loc) · 1.05 KB
/
ScornStone.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
local watchedGUID
local soulStone = 20707
local darkIntent = 109773 -- For debugging
local funItem = "Seafarer's Slidewhistle"
-- Not using "self" or "event" right now, but if I need them in the future reindexing all of the select calls would be a pain.
function ScornStone(self, event, ...)
local eventType = select(2, ...)
local targetGUID, targetName = select(8, ...)
-- First, check to see if we need to watch someone new.
if (
eventType == "SPELL_CAST_SUCCESS"
) then
local spellid = select(11, ...);
if (
and spellid == soulStone
) then
watchedGUID = targetGUID
SendChatMessage(targetName .. ", I believe in you.");
-- Still need to figure out how to do this.
-- UseItemByName(funItem)
end
end
-- Failing that, see if our current target kicked the bucket.
elseif (
eventType == "UNIT_DIED"
) then
if (
watchedGUID
and targetGUID == watchedGUID
) then
SendChatMessage(targetName .. ", I'm not angry, just disappointed.");
-- Probably better to unregister the event. Maybe someday!
watchedGUID = nil
end
end
end