DRList-1.0 (Diminishing Returns Data)

DRList-1.0 (Diminishing Returns Data)

89.9k Downloads

Re-write

ManneN1 opened this issue · 1 comments

commented

Hello wardz,

First of, thanks for your great work with this library.

I am however starting to wonder whether it would be better to just calculate all of the DRs internally and just provide a callback/api, instead of every single addon doing the calculations by themselves. This would also lend itself better to integration with other AddOns such as WeakAuras.

Something like:

Callbacks:
timestamp, guid, category, level, length-modifier, spellID, isFirst = DR_APPLIED (sent on a new DR is applied e.g., stun being applied - this could be sent multiple times in a row before DR_START_FADE is sent, due to overlapping CCs being applied, isFirst indicates if this is the only aura causing this DR currently applied to the unit)
timestamp, guid, category, level, length-modifier, spellID, isLast = DR_AURA_FADED (sent when an aura which is in any category is removed, isLast indicates if the aura that faded was the last aura of that category present on the unit)
timestamp, guid, category = DR_EXPIRED (or DR_RESET)

API:
GetCurrentDRByCategory(guid, category) -- returns a tbl with the DRs level, timestamp, count of current applied auras, and length connected to the (e.g., { timestamp = xyz, num_applied_auras = kyz, level = 2, length = 0.5 })
GetCurrentDRsByGUID(guid) -- returns a tbl with timestamp (from the last DR_START_FADE or DR_APPLIED of that category - whichever was last, or nil if it already reset), level and length-modifier for each category
GetDRCategoryInfo(category) -- returns the number of DR steps, their respective length-modifier and also the reset timeout (e.g., for most categories { info = { [1] = 1.0, [2] = 0.5, [3] = 0.25, [4] = 0, }, resetTime = 20 })
GetDRCategoryBySpellID(spellID) -- returns the category names related to that spellID in a table {e.g., [1] = "stun", [2] = "incapacitate", ... }
GetDRCategories() -- returns a tbl with all categories { [1] = "stun", [2] = "incapacitate", ... }

Could also create unitID equivalent versions of the guid related functions.

commented

Hey, glad you like it :)
Yep fully agreed, that would be a lot better and its something I've thought about doing before. It's just that I've kinda lost interest in both WoW and addon development/programming over the years (all my addons are basically in maintenance mode now, some discontinued), so rewriting this lib or maintaining 2 different versions is not really something im interested in spending time doing atm sadly.

But tbh, this should be Blizzard's job implementing an API like this. (if only they cared about feedback...) Kinda crazy how a ˜17 year old core game mechanic still doesnt have a proper API for it. Combat log DR tracking really has its flaws; like max 50 yard range in classic era / 250 yard retail unless in an instanced area, cant track all knockbacks properly, memory hog, dynamic/batched resets causing inaccurate classic DR timers (even in retail too for non-instanced zones), and so on - kinda forgot all the issues but there are more, especially against NPCs. A fully fledged DR tracking lib suitable for e.g WeakAuras thats not just arena only would require a lot of time tweaking/testing to get it right.

Anyhow, I digress. It definitely would be awesome if you or anyone else would want to create a lib like that, I could refer to it from here + Diminish. It'd be extremely helpful to the community as Blizzard doesnt seem to care about doing it themselves. Rewriting DRList-1.0 itself though would prob be a bad idea since its supposed to be a stand-in updated version of the older DRData lib by Adirelle, which some addons still rely on. Creating the new tracking lib in a fresh solo repository would be better in this case. Maybe with DRList-1.0 as a dependency/spellID db untill its no longer needed.

I'll keep this ticket open for visibility.