Rarity

Rarity

17M Downloads

Pick Pocket may trigger duplicate attempts

rdw-software opened this issue ยท 3 comments

commented

Source: Discord

hi, any idea why one pick pocketing counts as 2 attempts, sometimes even as 3?

image

image


Possibly related to #706?

I didn't experience any such issue while testing the above changes, so this needs some investigation.

commented

It looks like this doesn't happen all the time, but I was able to reproduce a triple attempt (one Pick Pocket cast):

[2024-06-08 20:28:40] (Debug) LOOT_READY with target: Creature-0-3111-571-30-29330-0000E36836
[2024-06-08 20:28:40] (Debug) Locking session for 1 second(s) to prevent duplicate attempts from being counted
[2024-06-08 20:28:40] (Debug) 3 slot(s) to loot
[2024-06-08 20:28:40] (Debug) Checking NPC guid (1): Creature-0-3111-571-30-29330-0000E36836
[2024-06-08 20:28:40] (Debug) NPC ID is one we need: 29330
[2024-06-08 20:28:40] (Debug) New attempt found for Decahedral Dwarven Dice
[2024-06-08 20:28:40] (Debug) Setting tracked item to 8494 (Parrot Cage (Hyacinth Macaw))
[2024-06-08 20:28:40] (Debug) Ending session for [Parrot Cage (Hyacinth Macaw)] (0:00)
[2024-06-08 20:28:40] (Debug) Starting a session
[2024-06-08 20:28:40] (Debug) Checking NPC guid (2): Creature-0-3111-571-30-29330-0000E36836
[2024-06-08 20:28:40] (Debug) NPC ID is one we need: 29330
[2024-06-08 20:28:40] (Debug) New attempt found for Decahedral Dwarven Dice
[2024-06-08 20:28:40] (Debug) Setting tracked item to 8494 (Parrot Cage (Hyacinth Macaw))
[2024-06-08 20:28:40] (Debug) Ending session for [Parrot Cage (Hyacinth Macaw)] (0:00)
[2024-06-08 20:28:40] (Debug) Starting a session
[2024-06-08 20:28:40] (Debug) Checking NPC guid (3): Creature-0-3111-571-30-29330-0000E36836
[2024-06-08 20:28:40] (Debug) NPC ID is one we need: 29330
[2024-06-08 20:28:40] (Debug) New attempt found for Decahedral Dwarven Dice
[2024-06-08 20:28:40] (Debug) Setting tracked item to 8494 (Parrot Cage (Hyacinth Macaw))
[2024-06-08 20:28:40] (Debug) Ending session for [Parrot Cage (Hyacinth Macaw)] (0:00)
[2024-06-08 20:28:40] (Debug) Starting a session
[2024-06-08 20:28:41] (Debug) LOOT_READY with target: Creature-0-3111-571-30-29330-0000E36836
[2024-06-08 20:28:41] (Debug) Session is locked; ignoring this LOOT_READY event
[2024-06-08 20:28:41] (Debug) Unlocking session to continue scanning for new LOOT_READY events

And a double attempt:

[2024-06-08 20:30:39] (Debug) LOOT_READY with target: Creature-0-3111-571-30-29330-00006368B3
[2024-06-08 20:30:39] (Debug) Locking session for 1 second(s) to prevent duplicate attempts from being counted
[2024-06-08 20:30:39] (Debug) 2 slot(s) to loot
[2024-06-08 20:30:39] (Debug) Checking NPC guid (1): Creature-0-3111-571-30-29330-00006368B3
[2024-06-08 20:30:39] (Debug) NPC ID is one we need: 29330
[2024-06-08 20:30:39] (Debug) New attempt found for Decahedral Dwarven Dice
[2024-06-08 20:30:39] (Debug) Setting tracked item to 8494 (Parrot Cage (Hyacinth Macaw))
[2024-06-08 20:30:39] (Debug) Ending session for [Parrot Cage (Hyacinth Macaw)] (0:00)
[2024-06-08 20:30:39] (Debug) Starting a session
[2024-06-08 20:30:39] (Debug) Checking NPC guid (2): Creature-0-3111-571-30-29330-00006368B3
[2024-06-08 20:30:39] (Debug) NPC ID is one we need: 29330
[2024-06-08 20:30:39] (Debug) New attempt found for Decahedral Dwarven Dice
[2024-06-08 20:30:39] (Debug) Setting tracked item to 8494 (Parrot Cage (Hyacinth Macaw))
[2024-06-08 20:30:39] (Debug) Ending session for [Parrot Cage (Hyacinth Macaw)] (0:00)
[2024-06-08 20:30:39] (Debug) Starting a session
[2024-06-08 20:30:39] (Debug) LOOT_READY with target: Creature-0-3111-571-30-29330-00006368B3
[2024-06-08 20:30:39] (Debug) Session is locked; ignoring this LOOT_READY event
[2024-06-08 20:30:40] (Debug) Unlocking session to continue scanning for new LOOT_READY events

There are duplicate loot events (which Rarity should ignore, although it may fail due to timing issues):

image

It's somewhat odd that the loot window was "closed" twice according to these events.

commented

Okay, never mind: The duplicate attempts happen when the loot window contains multiple items (slots). Each adds one attempt:

image

3 items (vendor trash, potion, money) = 3 attempts

commented

The reason for this is indeed the above change: https://github.com/WowRarity/Rarity/pull/711/files

By not marking the NPC GUID as processed, Pick Pocket and regular loot events can coexist, but multiple item slots count as well.

The simplest fix I can think of is undoing the above change, so NPC GUIDs are always "checked off" immediately (as they were originally). Then, if the target is alive - i.e., the player used Pick Pocket - the GUID can be removed again at the end. This still allows multiple Pick Pocket attempts to count after the NPC's pockets have "respawned" and shouldn't change regular looting.

Now, while looting multiple items during a single Pick Pocket cast, the second, third, ... items no longer count:

image