LibPlayerSpells-1.0

Libraries Login to Add Favorites
  • 0 Likes
  • World of Warcraft
  • 324 Monthly Downloads
  • Supports: 7.1.5
  • 13,499 Total Downloads
  • Updated Feb 20, 2017
  • Created Jan 10, 2014
  • 4 Favorites
  • Project Site
  • Release Type: Release
  • License: GNU General Public License version 3 (GPLv3)
  • Newest File: 0.5
or

About LibPlayerSpells-1.0

LibPlayerSpells-1.0

Build Status Gitter chat

LibPlayerSpells-1.0 is a library providing data about the spells of the twelve character classes in World of Warcraft. It also includes additional spells derived from racial traits and other sources. The word "spells" is used here in the general sense; it includes active skills as well as passive spells that are found in the players' spellbook. Buffs and debuffs that are applied by the player from other sources are also covered.

This library is born from the need to centralize similar data used in several addons to reduce the maintenance cost and to have a better consistency across those addons.

It provides answers to questions like:
  • Does this spell have a cooldown?
  • Does this spell apply one or several buff(s) or debuff(s)?
  • Is this spell a survival cooldown, or used for DPS?
  • Does this spell regenerate mana or some other resource?
  • What are the survival buffs of all the classes?
  • Which spell interrupt abilities are available?

Each class has his own data file that can be updated separately from the main code.

Supported classes & specs

Not all classes and specializations are 100% supported yet. However, most interrupts, dispels, and survival cooldowns are complete.

If LibPlayerSpells is missing something specific from your class please file a detailed bug on Github or contribute to the project yourself if you are feeling brave! In the second case, be sure to read the contribution guidelines.

Usage

Copy the library files in your addon and list the lib.xml file in the TOC file.

LibPlayerSpells-1.0 uses LibStub: local LibPlayerSpells = LibStub('LibPlayerSpells-1.0')

Querying information from a spell

You can then obtain information about a given spell with GetSpellInfo: local flags, providers, modifiedSpells[, moreFlags] = LibPlayerSpells:GetSpellinfo(spellId) Where:

  • spellId is the numerical spell identifier.
  • flags is a bitfield containing data about the spells (see below).
  • providers is the identifier (or a table of) identifier(s) of the spell(s) to; said otherwise, if the provider is not found in the player's spellbook, the given spell is unavailable. For example, the provider spell can be a passive spell given by a talent.
  • modifiedSpells is the (or a table of) identifier(s) of the spell(s) affected by the given spells.
  • If the given spell is a special case (see below), moreFlags contains another bitfield.

Querying the spell database

You can iterate the database, looking for certain spells, using IterateSpells: for spellId, flags, providers, modifiedSpells, moreFlags in LibPlayerSpells:IterateSpells(oneOfFlags, requiredFlags, rejectedFlags) do -- Do something with the loot end flags, providers, modifiedSpells, moreFlags have the same meaning as the values returned by GetSpellinfo. spellId is obviously the numerical identifier of the current spell.

The three method arguments are used to build a filter. They are bitmask specifications. They can be passed as an numerical bitmask computed using bit.bor and library constants, or a string containing the flags separated by white spaces or commas. For example, bit.bor(LibPlayerSpells.constants.HUNTER, LibPlayerSpells.constants.BURST) is the same bitmask as "HUNTER BURST".

IterateSpells lists all spells that:

  • has at least one of the flags listed by oneOfFlags
  • and has all flags listed by requiredFlags,
  • and has none of the flags in rejectedFlags.

If a bitmask is empty or not provided, the corresponding condition is ignored. With no arguments, all spells are listed.

Example: -- Iterate through spells that have a cooldown, are/apply an aura and are either survival or mana-regenerating skills. for spellId, flags, providers, modifiedSpells, moreFlags in LibPlayerSpells:IterateSpells("SURVIVAL REGEN_MANA", "AURA COOLDOWN") do -- Do something with it ! end

Flags

Most spell information is stored in a bitfield to compact storage and easily test or filter spells. The bit value constants are available in the LibPlayerSpells.constants table.

The presence of a specific flag can be tested this way: if bit.band(flags, LibPlayerSpells.constants.AURA) ~= 0 then -- This spell is an aura, do something meaningful with it. end

However, the library provides a way to easily build flag tests.

Special spell types

These flags indicate special spells, that (will) have additional data.

  • CROWD_CTRL: this is a crowd-control spell; additional data is a bitfield indicating the diminishing returns category (disorient, taunt, etc.).
  • DISPEL: this spell can dispel either allies' debuffs or enemies' buffs; no additional data yet.
Crowd control flags

These flags are used in the additional data for crowd control spells and indicate the diminishing returns category a spell belongs to. While INTERRUPT and KNOCKBACK are technically DR categories themselves, they do not always have an associated aura and are not traceable through the UNIT_AURA event. Thus they are just ordinary flags in the spell bitmask.

  • DISORIENT
  • INCAPACITATE
  • ROOT
  • STUN
  • TAUNT

Spell sources

These flags indicate the source of the spell. The constants are self-explanatory: DEATHKNIGHT, DRUID, HUNTER, MAGE, MONK, PALADIN, PRIEST, ROGUE, SHAMAN, WARLOCK, WARRIOR, RACIAL.

Targeting

These flags hints about the targeting mechanism of the spell. They are exclusive most of the time.

  • HELPFUL: The spell can be cast on any ally, including the player and his pet.
  • HARMFUL: The spell can be cast on any enemy.
  • PERSONAL: The spell automatically targets the player.
  • PET: The spell automatically targets the player's pet.

Miscellaneous

  • AURA: The spell applies (or is) a buff on allies, or a debuff on enemies.
  • UNIQUE_AURA: A given character can have only one instance of this (de)buff at a time, even if several players cast the same spell on it, e.g. Hunter's Mark.
  • COOLDOWN: This spell has a meaningful cooldown.
  • SURVIVAL: This spell is considered a survival skill.
  • BURST: This spell is considered a burst skill (either damaging or healing).
  • POWER_REGEN: This spell allows the target to recharge some kind of alternative resource e.g. Energizing Brew
  • IMPORTANT: An important spell the player should react to.
  • INVERT_AURA: The aura logic of this spell is inverted. It applies a debuff on allies or a buff on enemies (this case has yet to be found), e.g. the Weakened Soul applied by Power Word: Shield.

Acknowledgements

Thanks to ckaotik, Rainrider, mjmurray88, arcadepro for their testing and contributions to the class spells.

License

LibPlayerSpells-1.0 is licensed using GPL v3. This means that any addon using it must have a compatible license (see there).

tag f76233d4093883012a4856888d5c00d39372588f 0.5
Author:    Rainrider <rainrider.wow@gmail.com>
Date:    Sat Jan 14 00:28:52 2017 +0100

Tagging for release

commit 1173463d4b8da1e20ef25cb21fd820f9f4d4869a
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Sat Jan 14 00:24:43 2017 +0100

    racials: data versioning for patch 7.1.5

    No actual changes

commit f3bd464f32749a1863cd2809d084c8aec61f8f62
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Sat Jan 14 00:23:44 2017 +0100

    priest: proper data versioning for patch 7.1.5

commit 453d8a754355331f25372fa64ec8c6a64675b8e2
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Sat Jan 14 00:21:43 2017 +0100

    shaman: update for patch 7.1.5

    No actual changes

commit 21c05756c9d5f761387cc6d3183522801b39267d
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Sat Jan 14 00:09:59 2017 +0100

    rogue: update for patch 7.1.5

    No actual changes

commit b9ba1993aa3b47e5faaea82161456e1ccb7480e0
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Fri Jan 13 21:42:13 2017 +0100

    paladin: update for patch 7.1.5

commit 4f4605e2fa2b1f86f67366ca3226189380ba9cef
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Fri Jan 13 21:25:34 2017 +0100

    death knight: update for patch 7.1.5

    No actual changes

commit 8e4b9289fbbc1d480b78ac95b92f0a3bdcaaed29
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Fri Jan 13 21:07:29 2017 +0100

    mage: update frost for patch 7.1.5

commit 354d9d12ecad37a43fdd9302abdcb4b2dcf37da1
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Fri Jan 13 20:51:38 2017 +0100

    mage: update fire for patch 7.1.5

commit 420cabd5f54d80f94f5050e079ccff30ed5e4d01
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Fri Jan 13 20:33:40 2017 +0100

    mage: add Chrono Shift properly

commit 9dd849215fa861440c10645a7b133148ef49e721
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Fri Jan 13 20:10:06 2017 +0100

    warlock: remove Mana Tap

    Move Empowered Life Tap to Burst

commit 631aafd9e46d1ccba3d6255bcf212b8cddbd5838
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Fri Jan 13 08:16:23 2017 +0100

    warrior: update for patch 7.1.5

    Thank you arcadepro

commit 17aef640a52d4ec63b103b165f5d0775c1e90ccc
Author: daf <daf.public@madalien.com>
Date:   Thu Jan 12 21:18:52 2017 +0000

    mage: fix for arcane talent changes in 7.1.5 (#115)

    Removed Quickening
    Added Prismatic Barrier
    Added Chrono Shift (buff only)

commit ff60a4da27a68558501487b23dee629715b6ea9e
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Thu Jan 12 22:12:27 2017 +0100

    warlock: fix Unstable Affliction

    Thank you Deilv
    Closes https://github.com/AdiAddons/LibPlayerSpells-1.0/pull/114
    Closes https://github.com/AdiAddons/LibPlayerSpells-1.0/issues/113

commit 211d31aba4fb75a65edccb79e5c86abaa4bd63cb
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Thu Jan 12 22:04:51 2017 +0100

    warlock: update for patch 7.1.5

commit e59a2061c67d4bc8589abd396ab06fdf383ee59c
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Wed Jan 11 15:58:44 2017 +0100

    priest: update for patch 7.1.5

commit dc0b38f18ac5fd103cef2cc858f21bc9a1738a3a
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Wed Jan 11 14:41:57 2017 +0100

    druid: update for patch 7.1.5

commit 7c61d574cda8d08cdad1b9ea9a9ef9774074bb5e
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Wed Jan 11 14:08:55 2017 +0100

    monk: update for patch 7.1.5

commit 3cb7e2e035600d9f3ea23eb631bcb25c57c59afc
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Wed Jan 11 13:05:51 2017 +0100

    hunter: update for patch 7.1.5

commit e419eec8e8bbbefd682ba97d9b8f475f9d3d86e7
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Wed Jan 11 11:24:20 2017 +0100

    demonhunter: update for patch 7.1.5

commit 7330c9e08dbe28a028f98eaf039e969d18323fb0
Author: Rainrider <rainrider.wow@gmail.com>
Date:   Tue Jan 10 23:49:51 2017 +0100

    One last try

commit b2ad049d739301cfabb8faa6f0e0291a75b1c3e3
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Tue Jan 10 23:39:17 2017 +0100

    Sorry for playing around

commit 76f22d1b7b4e99451689b1eeefd3c5f29ccddac0
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Tue Jan 10 23:16:27 2017 +0100

    Shorten .travis.yml a bit

commit 70760f1000e51447ef82b7c99de51dfc9a299d4e
Author: Adirelle <adirelle+github@gmail.com>
Date:   Tue Jan 10 22:15:04 2017 +0100

    Revert "Failure test: wrong webhook URL."

    This reverts commit 5ecfe15dc93a5350cdbf1222abbd7fe06e116ec1.

commit 5ecfe15dc93a5350cdbf1222abbd7fe06e116ec1
Author: Adirelle <adirelle+github@gmail.com>
Date:   Tue Jan 10 22:13:07 2017 +0100

    Failure test: wrong webhook URL.

commit 0aee1c23ee8edcb91a32b9e1ff9c46464c1e37cd
Author: Adirelle <adirelle+github@gmail.com>
Date:   Tue Jan 10 21:52:48 2017 +0100

    Use curl directly from .travis.yml to deploy.

commit e56d79b8f5e259afa71668abc887d2c118279969
Author: Adirelle <adirelle+github@gmail.com>
Date:   Tue Jan 10 21:50:17 2017 +0100

    Failure test.

commit ac8c2d4a4ec5733c6a0ea28f4a91174e83f4dcc2
Author: Adirelle <adirelle+github@gmail.com>
Date:   Tue Jan 10 20:48:32 2017 +0100

    Restrict deploys to master and tags again.

commit ac8c2d4a4ec5733c6a0ea28f4a91174e83f4dcc2
Author: Adirelle <adirelle+github@gmail.com>
Date:   Tue Jan 10 20:48:32 2017 +0100

    Restrict deploys to master and tags again.

commit 73fc9b7b4b94db85f031456cb9bdec82bdce9e53
Author: Adirelle <adirelle+github@gmail.com>
Date:   Tue Jan 10 20:47:20 2017 +0100

    travis: no need for SSH known_hosts anymore.

commit 0ef872d29da18dac9bcfff69b4d11d5e3752665e
Author: Adirelle <adirelle+github@gmail.com>
Date:   Tue Jan 10 20:45:17 2017 +0100

    Fixed the webhook request.

commit 46b90c0110f3cf21eee2d104e6afb19d78c725d6
Author: Adirelle <adirelle+github@gmail.com>
Date:   Tue Jan 10 20:30:46 2017 +0100

    Use the new wowace packager.

commit 1cfb11b640e928b14f82865ff847d2959947243c
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Wed Oct 26 22:30:08 2016 +0200

    tests: better fix for changed __RegisterSpells behavior

commit 8a68378825ac5cc377405da9b50af695bbc8e89b
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Wed Oct 26 21:26:54 2016 +0200

    tests: fix for AdiDebug inclusion

commit 833237421c4b5cd74bffb7490412e601e438d847
Author: Benjamin Staneck <staneck@gmail.com>
Date:   Wed Oct 26 20:13:27 2016 +0200

    spelling and misc fact fixes

commit 3f11f5d3af3a7c2ff1d1a29e2df2b420d5d14ccf
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Wed Oct 26 13:41:58 2016 +0200

    Bump ToC

commit 7d234019a444d03da6dbee44e5bc9b27e7ab4b06
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Wed Oct 26 13:40:52 2016 +0200

    core: move error messages to debug

    Fixes https://github.com/AdiAddons/LibPlayerSpells-1.0/issues/110

commit 74b0c0a932cfa8d8f277f6783f28f9edf843bc1d
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Wed Oct 26 13:21:18 2016 +0200

    paladin: fix for 7.1

    Blade of Wrath redesigned
    Divine Steed consolidated

commit c6229eaa8bede645fdb2be0cfff4a593ae5a9078
Author: Adirelle <adirelle+github@gmail.com>
Date:   Wed Oct 26 08:18:32 2016 +0200

    hunter: Animal Instincts redesigned in 7.1: it does not provide any buff anymore.

commit 9e622ccf79027742efb73d36de38436a2103f54f
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Sat Oct 15 01:53:35 2016 +0200

    priest: add Sins of the Many (Discipline artifact)

commit 70a813a905df86c4b6d7fed80ad579be78502109
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Sat Oct 1 14:12:26 2016 +0200

    monk: add Fists of Fury stun effect

    Closes https://github.com/AdiAddons/LibPlayerSpells-1.0/issues/107

commit 198619357d1652ee7444f12f37f18ebf0a43790f
Author: Adirelle <adirelle+github@gmail.com>
Date:   Sat Oct 1 12:57:27 2016 +0200

    hunter: display the stack and duration of Mongoose Fury on Fury of the Eagle (BM artifact).

commit e76134ff92ab6b5b3e024fbeb5d8add4a6ea725a
Author: Adirelle <adirelle+github@gmail.com>
Date:   Mon Sep 12 18:38:19 2016 +0200

    core: do not complain if there is no old version.

commit e76134ff92ab6b5b3e024fbeb5d8add4a6ea725a
Author: Adirelle <adirelle+github@gmail.com>
Date:   Mon Sep 12 18:38:19 2016 +0200

    core: do not complain if there is no old version.

commit 65243b8e3f3c1d6172944743c4f5292d1dc817c4
Author: Adirelle <adirelle+github@gmail.com>
Date:   Mon Sep 12 18:27:06 2016 +0200

    core: GetSpellInfo and IterateSpells now return the dispel categories.

    See #102.

commit a2c474a1fc750514170145e9328c240180062d4c
Author: Adirelle <adirelle+github@gmail.com>
Date:   Mon Sep 12 18:23:07 2016 +0200

    core: wipe internal data coming from versions anterior to 8.

    See #100.

commit 5620c219e34c96be00cad947cde8da887b6637de
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Sun Sep 11 21:37:21 2016 +0200

    hunter: fix some of the stuns

commit e14e0dcf68fed04dd56afd7bc34dd53c245421b3
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Sun Sep 11 21:11:34 2016 +0200

    Fix .pkgmeta

    Closes https://github.com/AdiAddons/LibPlayerSpells-1.0/issues/103
    Thank you @nebularg

commit 5a6014e9c6af7bbfa3b1a043ae4e67627aa523dc
Author: Adirelle <adirelle+github@gmail.com>
Date:   Sun Sep 11 01:34:16 2016 +0200

    hunter: Spirit Mend is not reserved for the pet only.

commit 175310a492eeb266539e01ae6599d0203d2e79ef
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Sun Sep 11 01:21:22 2016 +0200

    druid: fix Stellar Flare typo

    Fixes https://github.com/AdiAddons/AdiButtonAuras/issues/235

commit 72835bc0aeeb1cff5ebf60fc9ed8266ce9922bba
Author: Adirelle <adirelle+github@gmail.com>
Date:   Sat Sep 10 22:56:36 2016 +0200

    hunter: bump revision.

commit 9c212791df2b09f93df0ee88fc76a2bd3ff31f2a
Author: Adirelle <adirelle+github@gmail.com>
Date:   Sat Sep 10 22:54:50 2016 +0200

    hunter: tag several pet survival skills.

commit 93cb3f215631f1f51940ef734719a6af51012e76
Author: Adirelle <adirelle+github@gmail.com>
Date:   Sat Sep 10 22:54:50 2016 +0200

    hunter: add Stone Armor (Quilen passive).

commit c10b413038149ae2acb9d1dc24fcf09e68359f5a
Author: Adirelle <adirelle+github@gmail.com>
Date:   Sat Sep 10 22:54:28 2016 +0200

    hunter: Play Dead is a pet survival skill.

commit 4be4cf493eeb146d5d623ea5e28ddde645cab385
Author: Adirelle <adirelle+github@gmail.com>
Date:   Sat Sep 10 22:53:32 2016 +0200

    hunter: tag Feign Death as survival.

commit 3ebd68a28272d5f3c53d270cf58afddca8a0bad6
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Thu Sep 8 16:37:51 2016 +0200

    hunter: add Aspect of the Chameleon

commit e666d52409423818e11c275df0f52866c058d556
Author: Rainrider <Rainrider@users.noreply.github.com>
Date:   Thu Sep 8 00:24:00 2016 +0200

    priest: add discipline artifact hidden ability

    Closes https://github.com/AdiAddons/AdiButtonAuras/issues/233