Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pickpocketing may cause subsequent loot events to be ignored even if there are items of interest #706

Closed
Duckwhale opened this issue Mar 17, 2024 · 3 comments · Fixed by #711

Comments

@Duckwhale
Copy link
Member

Duckwhale commented Mar 17, 2024

Source: WowAce

I've noticed when playing on my rogue that any mob that I kill is only tracked as an attempt if I have NOT attempted to pick their pockets beforehand. if I just straight up kill them, all is well and once looted the attempts are counted. anything pickpocketed may as well not exist as far as the addon is concerned

If I understand correctly, the issue may be that Rarity ignores the NPC after it's been "looted" twice (pickpocketing + on kill).

@Duckwhale
Copy link
Member Author

Looking at the code, I suspect the NPC is simply "checked off" after the pickpocket completes and the loot window is opened.

Source:

Rarity/Core.lua

Line 756 in 62e7b13

if Rarity.guids[guid] ~= nil then

If this is the issue, then the list of "seen" NPCs could be split into two lists, one for loot and another for pickpocketing events.

@Duckwhale Duckwhale self-assigned this Mar 17, 2024
@Duckwhale
Copy link
Member Author

The problem can be observed in the table inspector:

  1. Type /tinspect Rarity.guids
  2. Use Pick Pocket on the target
  3. The GUID is checked off and subsequent loot events will be ignored

The next question then is where exactly the pick pocket event leads to the GUID being checked off. I believe there is no special handling since Blizzard's UI only sends generic UNIT_SPELLCAST_SUCCEEDED and then LOOT_READY / LOOT_OPENED events when pick-pocketing an enemy. Rarity therefore can't differentiate between a regular loot attempt and Pick Pocket.

In other words, it's all the same CheckNpcInterest handling, which would be called twice in this scenario.

@Duckwhale Duckwhale moved this from The time is nigh (Planning) to It's finally happening! (WIP) in Timeline Apr 11, 2024
@Duckwhale Duckwhale changed the title Pickpocketing may cause subsequent loot events to be ignored even if there are items of interest (?) Pickpocketing may cause subsequent loot events to be ignored even if there are items of interest Apr 11, 2024
@Duckwhale
Copy link
Member Author

Turns out the solution is quite simple: Just don't set the guids entry if the requiresPickpocket flag is enabled.
There can't be issues with duplicate attempts since the game prevents the spell from being cast twice. And looting an enemy more than once is similarly impossible. Both attempts are differentiated by the target state - if it's not dead, Rarity assumes Pick Pocket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant