Thread Tools Display Modes
06/08/20, 03:28 AM   #1
remosito
AddOn Author - Click to view addons
Join Date: Dec 2019
Posts: 30
Any way to find out who/what dropped a loot item?

Howdie all :-)

is there a way to find out what/who dropped an item?

I found the Event one can hook into. But the return values only give back who received an item.

Lua Code:
  1. EVENT_LOOT_RECEIVED (*string* _receivedBy_, *string* _itemName_, *integer* _quantity_, *[ItemUISoundCategory|#ItemUISoundCategory]* _soundCategory_, *[LootItemType|#LootItemType]* _lootType_, *bool* _self_, *bool* _isPickpocketLoot_, *string* _questItemIcon_, *integer* _itemId_, *bool* _isStolen_)

Is there a way to get the mob/chest/node that dropped it?

(Wanted to start to log what/who drops what Leads)

thanks a lot in advance
  Reply With Quote
06/08/20, 06:37 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,913
Often answered: no
We got no api to return the drop name or unit tag or whatever.
You could try workarounds like capture last hovered mouse/crosshair/reticle name and if after that loot was started within a few seconds this one might have been the loot giver... But this is just as far as you can get here I guess.
  Reply With Quote
06/08/20, 07:23 AM   #3
Micke2nd
AddOn Author - Click to view addons
Join Date: Mar 2017
Posts: 43
...or the enemy from last fight, or last quest giver
If mouseover delivers to many options

Last edited by Micke2nd : 06/09/20 at 02:53 AM.
  Reply With Quote
06/08/20, 10:30 AM   #4
remosito
AddOn Author - Click to view addons
Join Date: Dec 2019
Posts: 30
thank you both for the answers.

It is as I feared then :-)

Was thinking about the route of last kill too. Came as far as

EVENT_COMBAT_EVENT of ActionType ACTION_RESULT_DIED or ACTION_RESULT_DIED_XP (to avoid critters???)

thought before I go any further and try to track down similar hooks for chests, treasure map chests, saveboxes, containers, resource nodes. And whereever else Leads come from. I ask to make sure I dont jump through 1 million hoops just for missing/notfinding an easier solution... :-)

First though, I guess I'll give a good hard think towards if I really want to do it ;-)

thanks again for the quick replies
  Reply With Quote
06/08/20, 01:26 PM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,913
Event_inventory_single_slot_update fires for new items. You can filter it to only fire as your player gets new items and check with this what item came in new. You only need to track the sources you have mentioned already (chests, bags, containers, enemies bodies, etc.) , and maybe with event_loot* to compare the itemName as well, to be sure it really was looted (and not obtained from a mail attachment etc. But the mapping of sources to items should be hard to make "safe". If you e. G. Loot bags and overland sacks or whatever wuicly after another you cannot be sure what item came from what container...
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Any way to find out who/what dropped a loot item?

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