LibPlayerSpells-1.0

52.9k Downloads

LibDispellable:CanDispel function?

alexandersoto opened this issue ยท 3 comments

commented

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 AdiAddons/LibDispellable-1.0#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.

commented

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

commented

I'm looking for a function like LibDispellable:CanDispel(unit, isBuff, dispelType, spellID). In AdiAddons/LibDispellable-1.0#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?

commented

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)