Thread Tools Display Modes
05/05/22, 09:17 AM   #1
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
EVENT_LOOT_RECEIVED isStolen always false

As the title indicates, this field is returning false even for loot that is stolen from containers marked stealing or from bodies of dead innocent NPC's.

The isPickpocketLoot field appears to return correct values for pickpocketed loot.

Last edited by Phinix : 05/05/22 at 11:18 AM.
  Reply With Quote
05/05/22, 11:22 AM   #2
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
I have another loosely related question.

Assuming shared loot conditions (new loot item added to player bags) will EVENT_INVENTORY_SINGLE_SLOT_UPDATE always register before EVENT_LOOT_RECEIVED?

Last edited by Phinix : 05/05/22 at 12:49 PM.
  Reply With Quote
05/05/22, 02:49 PM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Isnt it the other way around?
Loot received, shown in the loot box, you take items, event inv Single slot update
  Reply With Quote
05/05/22, 03:00 PM   #4
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
Intuitively that is what I would have thought as well. However I noticed LootDrop was passing bagId and slotId from EVENT_INVENTORY_SINGLE_SLOT_UPDATE to EVENT_LOOT_RECEIVED by setting a "last item" variable and so decided to check.

So far it does indeed appear that EVENT_INVENTORY_SINGLE_SLOT_UPDATE always occurs first. In fact, it seems to occur TWICE for each loot item (probably with different 'updateReason') after which EVENT_LOOT_RECEIVED registers.

You can test it by registering for both events then creating a simple print of the event name and loot name. I haven't encountered any situation where EVENT_LOOT_RECEIVED happens before or without EVENT_INVENTORY_SINGLE_SLOT_UPDATE occurring, but I just wanted to ask in case maybe someone knows for sure how these are coded internally.
  Reply With Quote
05/05/22, 07:40 PM   #5
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
So the 2nd firing of EVENT_INVENTORY_SINGLE_SLOT_UPDATE appears to be when loot is shifted from your inventory to your craft bag. For loot where this happens automatically, it fires once when it hits your inventory bag, then again when it is moved to your craft bag.

It definitely seems both of these hits will always occur before EVENT_LOOT_RECEIVED.
  Reply With Quote
05/06/22, 01:39 AM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Checking the WishList code it seems that event_single_slot_update fires first with INVENTORY_UPDATE_REASON_DEFAULT, right.
I have added an event filter on that.
After that event_loot_received.

At least I had added some DolgubonsLazyWritCreator checks in event_single_slot_update to detect "boxes" first, and then checked the variable at event_loot_received later.
  Reply With Quote
05/07/22, 10:04 PM   #7
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 408
This was brought up before in the gitter chat:


ZOSDanBatson @ZOSDanBatson Aug 02 2021 08:33
Quick look at the client and server code says that flag should be good, so I'll have to debug it and see if I can repro it

ZOSDanBatson @ZOSDanBatson Aug 02 2021 08:38
Ah nm I see the hole. The flags never comes from the server. I'll have to talk with a server engineer to determine if there's a reason for that.
I don't think there was anything after that though
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » EVENT_LOOT_RECEIVED isStolen always false

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