Quantcast How does WoW register that YOU killed a unit? - WoWInterface
Thread Tools Display Modes
12-04-17, 10:28 PM   #1
Pewkins
A Defias Bandit
Join Date: Dec 2017
Posts: 2
How does WoW register that YOU killed a unit?

I set up an event listener for COMBAT_LOG_EVENT_UNFILTERED, and then put in a listener for the unit_died event, as seen below, but what I noticed is when a guard was killing an enemy next to me, it would print that event as well.

If curious function for simple printing event below

Code:
function MyMod.UNIT_DIED(...)
    print(string.join(",", tostringall(...)))
end
I guess I was wondering how WoW recognizes that YOU killed a unit, vs a unit dying near you(that you just so happened to kill in some cases)

I was thinking about nesting this inside another listener for when combat starts to start the second listener, but if I was fighting two enemies at once, we would run into a problem, as well as that not really being KISS.

I suppose there is PARTY_KILL, but you need to start a party to get that call, which isnt really useful at that point.

Pardon me if I am just not seeing something right in front of me, as this is my first time working inside the WoW API.

Any help is greatly appreciated!
  Reply With Quote
12-04-17, 11:15 PM   #2
Kanegasi
A Cobalt Mageweaver
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 225
PARTY_KILL is a misnomer. That combat event fires even if you're alone.
  Reply With Quote
12-05-17, 03:58 PM   #3
Pewkins
A Defias Bandit
Join Date: Dec 2017
Posts: 2
Aw dang, you're right!

I didnt notice it was so early in the /eventtrace log. I would have thought it was near UINIT_DIED, but nope, its one of the first events to fire off on death, and UNIT_DIED seems to be one of the last triggers to fire off.

Well, i guess they say there are no stupid questions when you are a newbie

Thanks a ton dude!
  Reply With Quote
12-06-17, 05:19 AM   #4
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,273
PARTY_KILL does not trigger for pet/vehicle/bodyguard kills tho.
  Reply With Quote
12-07-17, 01:10 PM   #5
myrroddin
A Molten Giant
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 883
Nor does PARTY_KILL trigger for raid kills unless the person doing the killing is in your party within the raid.
  Reply With Quote
12-08-17, 12:08 PM   #6
vis781
A Fallenroot Satyr
Join Date: Dec 2017
Posts: 27
Hi, I'm guessing here but my thoughts are that the combat log registers hits sequentially. If you and someone else are aoeing a target even if the events occur at the same time it will still be logged in a sequential fashion. Every hit will be tagged with a unit Id. The hit that brought the health of the target to zero or below is the one that killed it.

Can't think of another way it could be done right now.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » How does WoW register that YOU killed a unit?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off