Coder Social home page Coder Social logo

drlist-1.0's Introduction

DRList-1.0 (Diminishing Returns Database)

World of Warcraft library for providing player diminishing returns categorization.

Contents

About

Library that contains (hopefully) the most up to date diminishing returns categorization. This is purely the diminishing return data itself with API's to determine if a spellID has a diminishing return, if it diminishes in PvE and the category it diminishes in. You will have to keep track of actual DR timers yourself.

This addon is a rewrite of DRData-1.0 by Adirelle which is no longer maintained. DRList is updated to seamlessly support all World of Warcraft clients. (Classic, TBC, Wotlk, Cataclysm, Retail)


Manual Install

Requires LibStub.

  1. Unzip file into WoW/Interface/AddOns/YourAddon/Libs/.
  2. Add an entry for Libs/DRList-1.0/DRList-1.0.xml into your addon's TOC file.

Usage with BigWigsMods Packager

Requires LibStub.

  1. Add an entry for Libs/DRList-1.0/DRList-1.0.xml into your addon's TOC file.
  2. Add this repository to the packager's externals list:

.pkgmeta file:

externals:
  Libs/DRList-1.0: https://github.com/wardz/DRList-1.0

Upgrading from DRData to DRList

  • Any references to DRData must be changed to DRList. Easiest is to just change the LibStub call so your local DRData variable points to DRList.
  • For accessing raw data tables you will now need to add the current expansion as an extra table property. E.g DRData.categoryNames to DRList.categoryNames.retail or DRList.categoryNames[DRList.gameExpansion]. The only exception for this is the spell list table.
  • Calls to Lib:IterateProviders() must be replaced with Lib:IterateSpellsByCategory() as providers are now obsolete.
  • Lib:GetSpellCategory() now has an optional second return value for spells with shared DRs.
    • Lib.spellList[spellID] now returns a table for spells with shared DRs instead of a string.

Contributing

License

Copyright (C) 2024 Wardz | MIT License.

drlist-1.0's People

Contributors

ascott18 avatar jquick avatar mannen1 avatar wardz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

drlist-1.0's Issues

Add cataclysm classic spell support

The list of spells with diminishing returns needs to be updated for cata.
Sorry I can't give more info, but the work needs to be done (and I expect it will be some fair amount of work)

Update for The War Within

Just a headsup; im on vacation for the next ~2 weeks, so I probably wont be able to add the new spells for The War Within expansion until after release.

[BUG]: DR Timers are not displaying the max value, players are getting tricked

What happened?

On Classic/TBC/WotLK:

  1. Use any spell which induces DR
  2. Wait for the DR tracked by this library to end.
  3. Use any spell which induces the same DR category as (1)
  4. DR will sometimes not have reset

Is there any errors?

No

Game Version

The Burning Crusade Classic, Wrath of the Lich King, Classic Era

Game Language

English

Any additional info?

The problem is that the DR has been set to 19 seconds (https://github.com/wardz/DRList-1.0/blob/master/DRList-1.0/DRList-1.0.lua#L154), instead of the actual max of 20 seconds.

This is causing players to get tricked, causing myths that DR is actually wrong in Classic WotLK, and isn't actually 15-20 but more like 15-21 due to errors on Blizzards part - when in fact it's at least partly due to a config choice in DRList (not saying the myth isn't true, but many "claims" are just a DR timer configured below the max threshold).

My suggestion is to set the default DR duration value in the DRList library to the actual max of 20 seconds, thereby players would never get tricked into believing the DR is over when it is in fact not, and they would instead only be able to knowingly gamble on using CC early.

This change would, for the average player who is unaware of details related to AddOns and how DR works, remove completely unexplainable randomness.

Note: Yes, I am aware that individual AddOns can go in and hi-jack the DRList lib, changing the DR duration value by themselves. However, I don't think this is an optimal solution as it will cause different combinations of loaded AddOns to show different DR timers (and they could also interfere with eachother, each trying to set the duration to something different).

[BUG]: WOW_PROJECT_ID is now WOW_PROJECT_WRATH_CLASSIC for Wrath

What happened?

Blizzard just released a patch that changed WOW_PROJECT_ID for Wrath Classic from WOW_PROJECT_BURNING_CRUSADE_CLASSIC to WOW_PROJECT_WRATH_CLASSIC.

Is there any errors?

1x DRList-1.0-25\Spells-Spells.lua:477: DRList-1.0: Unsupported game expansion loaded.
<string>:"=[C]"]: in function "error"
[string "@11DRList-1.0-25\Spells-Spells.lua":477: in main chunk

Locals:
Lib = <table> {
 IsPVE = <func> @..\DRList-1.0.lua:315
 GetCategoryName = <func> @..\DRList-1.0.lua:305
 GetSpellCategory = <func> @..\DRList-1.0.lua:291
 IterateSpellsByCategory = <func> @..\DRList-1.0.lua:354
 GetNextDR = <func> @..\DRList-1.0.lua:324
 gameExpansion = "unknown"
 categoriesPvE = <table> {}
 L = <table> {}
 GetCategories = <func> @..\DRList-1.0.lua:265
 GetCategoryLocalization = <func> @..\DRList-1.0.lua:305
 GetSpells = <func> @..\DRList-1.0.lua:258
 diminishedDurations = <table> {}
 GetResetTime = <func> @..\DRList-1.0.lua:280
 GetCategoryBySpellID = <func> @..\DRList-1.0.lua:291
 IterateSpells = <func> @..\DRList-1.0.lua:354
 NextDR = <func> @..\DRList-1.0.lua:324
 resetTimes = <table> {}
 IsPvECategory = <func> @..\DRList-1.0.lua:315
 categoryNames = <table> {}
 GetPvECategories = <func> @..\DRList-1.0.lua:273
}
version = 25

Game Version

Wrath of the Lich King

Game Language

English

Any additional info?

Gethe/wow-ui-source@3eaa29b#diff-239a2f4f8604d0b3956f4ee003b618690f95fbfb2c116e0d5fdc4e5cff41cb27R1105-R1106

[BUG]: Mind Control shows up in PVE.

What happened?

Mind Control for a priest in TBC shows up in PVE when it doesn't have a DR at all.

Is there any errors?

NO

Game Version

The Burning Crusade Classic

Game Language

English

Any additional info?

No response

Re-write

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.

[Feature] Cata shared dr-categories (deep freeze + ring of frost)

As you mentioned in https://github.com/wardz/DRList-1.0/blob/master/DRList-1.0/Spells.lua#L828 already, a spell having two categories is something DRList cannot handle right now.

My suggesetion is sth like this:

function Lib:GetCategoryBySpellID(spellID)
    if Lib.gameExpansion == "classic" then
        -- OBSOLETE: second return value is no longer needed after Classic Era patch 1.15.0.
        local category = Lib.spellList[spellID]
        if not category then return end
        return category, spellID
    end

    local category = Lib.spellList[spellID]
    if type(category) == "table" then
        return unpack(category)
    else
        return category
    end
end

This would initially not break addons using DRList, considering they don't use DRList.spellList.

Curseforge Packager embed usage is unconventional

Typically, the main embeds xml file is contained in the root of the repo, so that when an external is declared in the .pkgmeta, the usage in the .toc file ends up like Lib\DRList-1.0\DRList-1.0.xml

However, DRList nests its main folder one level down, causing that conventional format to not work, instead requiring Lib\DRList-1.0\DRList-1.0\DRList-1.0.xml.

Since restructuring the folders at this point would break anything that is already using this, my suggestion would be to instead just to add a second DRList-1.0.xml at the root of the repo that then references the nested one.

Unmaintained for TBC? Confirming claim

In this GladdyTBC comment, the author of Gladdy-TBC claimed that DRList has incorrect categories, and therefore they will maintain their own fork of DRData for TBC Classic. This is a concerning direction, because now 2 different DRData forks are seemingly being maintained, which will cause fragmentation and duplicated development toward the same goal.

Is their claim true, or is DRList known to currently have completely correct DR categories for TBC Classic?

Heads up regarding GetSpellInfo that is deprecated in The War Within

GetSpellInfo was replaced with C_Spell.GetSpellInfo

It returns information differently - here is an example for Divine Shield.

/dump GellSpellInfo(642)
Dump: value=GetSpellInfo(642)
[1]="Divine Shield",
[3]=524354,
[4]=0,
[5]=0,
[6]=0,
[7]=642,
[8]=524354

/dump C_Spell.GetSpellInfo(642)
Dump: value=C_Spell.GetSpellInfo(642)
[1]={
castTime=0,
name="Divine Shield",
minRange=0,
originalIconID=524354,
icondID=524354,
maxRange=0,
spellID=642
}

[BUG]: A little more info with the libs

What happened?

Nothing is broken. Just wondering if you could make the template show more than it does right now. Like when the timer is up it prints out Spell has come off dr's or something?

Is there any errors?

No response

Game Version

Retail, The Burning Crusade Classic, Wrath of the Lich King, Classic Era

Game Language

English

Any additional info?

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.