AdiAddons / LibPlayerSpells-1.0

WoW addon library - additional information about player spells.
GNU General Public License v3.0
13 stars 24 forks source link

LibDispellable:CanDispel function? #161

Open alexandersoto opened 6 days ago

alexandersoto commented 6 days ago

LibDispellable-1.0 is still being used by GladiusEx and a bug exists where curses won't show as dispellable for mages. I think that's due to remove curse missing from this check here.

However https://github.com/AdiAddons/LibDispellable-1.0/issues/6 says the library is abandoned.

Ideally LibPlayerSpells could provide an equivalent LibDispellable:CanDispel function. Would that be possible? If not do you have guidance on how to best approach? Happy to help however I can.

Rainrider commented 4 days ago

There is a dispel category in LPS. You should be able to do something like LPS:IterateSpells('DISPEL MAGE') to retrieve mage dispels.

alexandersoto commented 4 days ago

I'm looking for a function like LibDispellable:CanDispel(unit, isBuff, dispelType, spellID). In https://github.com/AdiAddons/LibDispellable-1.0/issues/6 you said:

Thus there are no alternatives to: LibDispellable:CanDispel ... If you'd prefer some higher abstraction API to somewhat mimic LibDispellable, feel free to open an issue for LibPlayerSpells-1.0.

Are you saying it's best to build that functionality outside the library using LPS:IterateSpells?

Rainrider commented 3 days ago

Yes, because tracking known player spells is out of scope for LPS. LPS can answer the question "Can a mage dispel a curse", but not "can YOUR mage dispel a curse". You could take a look at https://github.com/Rainrider/oUF_Dispellable/blob/refs%2Fheads%2Fmain/oUF_Dispellable.lua for an example implementation. There is also LibSpellbook which keeps track on spells known by the player and their pet (however this whole lib might be unneeded as the last expansion)