ItemRack icon indicating copy to clipboard operation
ItemRack copied to clipboard

Added an event to process swaps on Feign Death

Open caccavale opened this issue 4 years ago • 1 comments

Moving into phase 5 of classic, hunters are beginning to swap trinkets 2-3 times per fight. Trinket swapping using FD has felt slower in Itemrack than using a spammable macro. After some testing using a Weakaura which attempts to swap trinkets every frame after FD has been cast, it seems like this is because trinkets can be swapped earlier than the events which Itemrack uses to trigger processing the swap queue.

Using the same Weakaura I figured out that trinkets can be swapped as soon as the UNIT_AURA update corresponding to Feign Death's buff has been fired (assuming FD isn't resisted). This is my attempt at having itemrack register for and respond to that event for responsive FD trinket swapping.

I'm really not a LUA dev and I'm by no means certain that ItemRack.ProcessCombatQueue() was the correct thing to do here, but it seems to be working much more consistently now and swapping around .6-1s after FD is cast.

Please let me know if you would suggest any changes!

caccavale avatar Aug 25 '20 03:08 caccavale

Hi

I'm afraid you can't implement it like this, e.g. you don't take into concern that players can disable events in the config menu and we also ony register events in ItemRack:RegisterEvents at load time.

  • Please register the event in RegisterEvent and also unregister it properly.
  • You can add a event handler for UNIT_AURA in OnPlayerLogin
  • Calling ProcessCombatQueue() should be fine
  • Exit the loop where you filter for the buff, when you found it

Rottenbeer avatar Sep 04 '20 16:09 Rottenbeer

Not relevant anymore I guess.

Rottenbeer avatar Sep 26 '24 16:09 Rottenbeer