WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   How does WoW register that YOU killed a unit? (https://www.wowinterface.com/forums/showthread.php?t=55898)

Pewkins 12-04-17 10:28 PM

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!

Kanegasi 12-04-17 11:15 PM

PARTY_KILL is a misnomer. That combat event fires even if you're alone.

Pewkins 12-05-17 03:58 PM

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 :o

Thanks a ton dude!

Resike 12-06-17 05:19 AM

PARTY_KILL does not trigger for pet/vehicle/bodyguard kills tho.

myrroddin 12-07-17 01:10 PM

Nor does PARTY_KILL trigger for raid kills unless the person doing the killing is in your party within the raid.

vis781 12-08-17 12:08 PM

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.


All times are GMT -6. The time now is 02:12 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI