-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspud.toc
33 lines (29 loc) · 1.04 KB
/
spud.toc
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
## Interface: 100105
## Title: Spud
## Notes: A WoW AddOn for Curious Farmers by Maxwell White
## Author: Maxwell White (maxehmum on CurseForge & gitatmax on GitHub)
## Version: 1.3.1
spud.lua
## SavedVariables: SpudDB
## SavedVariablesPerCharacter: SpudCharacterDB
local function eventHandler(self, event)
if event == "COMBAT_LOG_EVENT_UNFILTERED" then
local _, subevent, _, srcGUID, _, _, _, _, _, dstFlags = CombatLogGetCurrentEventInfo()
if subevent == "PARTY_KILL" then
-- check if the killed unit is an NPC
local isNPC = bit.band(dstFlags, COMBATLOG_OBJECT_TYPE_NPC) > 0
if isNPC and srcGUID then
-- Get the player name from the GUID
local playerName = select(6, GetPlayerInfoByGUID(srcGUID))
-- increment the count for this player
if playerName then
if not playerKills[playerName] then
playerKills[playerName] = 0
end
playerKills[playerName] = playerKills[playerName] + 1
totalKills = totalKills + 1
end
end
end
end
end