COMBAT_EVENT kill detection for mobs
Hey everyone, I'm currently trying to work out how to detect if the player has killed a mob, and I believe this is done using EVENT_COMBAT_EVENT. I'm trying to use the 'result' parameter, pairing it with ACTION_RESULT_DIED, ACTION_RESULT_KILLING_BLOW, and ACTION_RESULT_TARGET_DEAD, like so:
Lua Code:
But for some reason, I cannot get "killed" to be printed. I understand that the event only fires on player or pet actions, but I believed at least Killing Blow should be detected from the player's final, killing attack. Any suggestions for what I'm doing wrong? Also, I tried commenting out the filters, but to no avail. Thank you! EDIT 1: Okay so I realized that something is indeed wrong with the filters, because after reloadui it actually worked when commenting them out. However, I'm now still trying to figure out what to do with the filters EDIT 2: After commenting out two of the three events, the "killed" is finally fired. So to me it's appearing like adding the filters together won't allow it to fire for these events. I thought that the filter would make it so that only those results would trigger the event, but now I'm not so sure how it works. EDIT 3: Okay so I found out that, contrary to the ESOUI page, you do NOT need to pass the namespace in. |
You cannot use the same filter type more than once for an event handler. In order to get it to work properly, you will need to register 3 separate handlers (different namespace) for EVENT_COMBAT_EVENT.
|
Quote:
Any ideas? |
My guess is that it didn't filter anything and you just received all events unfiltered.
|
Okay thanks a bunch, I'll go ahead and do some more testing and see if a d() call before the result check prints anything.
|
So you were totally correct, the event was just firing for everything! Nice intuition.
|
Glad to hear it worked! :)
|
All times are GMT -6. The time now is 11:41 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI