Get an Epic Experience with Premium

LibPlayerSpells-1.0

Libraries Login to Add Favorites
  • 0 Likes
  • World of Warcraft
  • 686 Monthly Downloads
  • Supports: 6.0.3
  • 2,382 Total Downloads
  • Updated 12/19/2014
  • Created 01/10/2014
  • 0 Favorites
  • Project Site
  • Release Type: Release
  • License: GNU General Public License version 3 (GPLv3)
  • Newest File: 0.2
or

About LibPlayerSpells-1.0

LibPlayerSpells-1.0

LibPlayerSpells-1.0 is a library providing data about the spells of the eleven 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 ?
  • Is this spell a raid wide buff ?
  • 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, survival cooldowns and raid buffs 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 an 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.

  • RAIDBUFF: this is a raid buff; additional data is a bitfield indicating the provided buffs (spell haste, critical strike, ...).
  • CROWD_CTL: this is a crowd-control spell; no additional data yet.
  • INTERRUPT: this spell can interrupt spell casts; no additional data yet.
  • DISPEL: this spell can dispel either allies’ debuffs or enemies’ buffs; no additional data yet.
Raid buff flags

These flags are used in the additional data for raids buffs.

  • STATS: Strength, Agility and Intellect
  • STAMINA: Stamina
  • ATK_POWER: Attack Power
  • MULTISTRIKE: Multistrike
  • SPL_POWER: Spell Power
  • HASTE: Haste
  • CRITICAL: Critical Strike
  • MASTERY: Mastery Bonus
  • BURST_HASTE: Burst Haste (e.g. Bloodlust/Heroism)
  • VERSATILITY: Versatility

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).
  • MANA_REGEN: This spell allows the target to recharge their mana; e.g. Innervate.
  • 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 0.2
8c98903b310ec7d18e60e12e12739b4a4bc47659
Adirelle <adirelle@gmail.com>
2014-12-19 17:57:50 +0100

Update wowace release.

--------------------

Guillaume Perréal:
    - Added gitter badge.
    - Added gitter.im webhook.
Adirelle:
    - Monk: fixed Enveloping Mist id.
    - Monk: fixed Renewing Mist and Enveloping Mist.
    - Warrior: flag "Shield Wall" as survival.
arcadepro:
    - War: Fixed Glyph of Heroic Leap
Adirelle:
    - Hunter: added Sniper Training, and also consider Steady Focus as important.
    - Hunter: added the missing buffs of Lone Wolf.
    - Druid: added Lunar Inspiration.
    Fixes https://github.com/Adirelle/AdiButtonAuras/issues/134.
    - Priest: fixed the buff id of Devouring Plague.
    Fixes https://github.com/Adirelle/AdiButtonAuras/issues/130.
    - Druid: consider Pulverize as important.
    - Druid: hopefully fixed Sunfire.
    Should fix https://github.com/Adirelle/AdiButtonAuras/issues/131.
    - Monk: added Renewing Mist.
Rainrider:
    - priest: fix Dispel Magic
    the dispel tabel was closed one line too early
Adirelle:
    - Priest: fixed whitespaces.
    - Priest: display Shadow Word: Insanity on Insanity.
    Should fix https://github.com/Adirelle/AdiButtonAuras/pull/122.
    - Paladin: added Beacon of Faith.
Rainrider:
    - rogue: sort by spell id
    follow the guidelines
    - rogue: fix Smoke Bomb and add Burst of Speed
    fixes gh-63
    - rogue: fixes Hemorrhage and Crimson Tempest
    Fixes gh-64 and gh-65
Adirelle:
    - Revert "Merge remote-tracking branch 'dafzor/patch-1'"
    This reverts commit 69fd0539d9bcc698845c43b589fff92591a7b522, reversing
    changes made to 864a04b4921843ff0248c71822b5aeb38cb9f58a.
daf:
    - Fixed Rend and Deep Wounds
    Made it so Rend and deep wounds are marked as personal debuffs so they only show the one the player applied.
Adirelle:
    - Added a .gitattributes file.
kesava-wow:
    - Priest.lua - add Void Entropy
Adirelle:
    - Druid: added Moonkin Form.
    - Priest: added Dispel Magic.
    - Druid: added Solar/Lunar Empowerment and fixed Sunfire.
    - Monk: fixed Dizzying Haze.
    - Fixed the database tests.
    - Monk: added Vital Mists and Dizzying Haze.
    - Monk ((Brewmaster)): display Shuffle on Chi Explosion.
arcadepro:
    - War: Fixed Glad Shield Charge.
Adirelle:
    - Cleaning up Shaman.lua
    - Druid: added Rejuvenation (Germination).
    - Druid: added Cenarion Ward and Pulverize.
    - Hunter: fixed Beast Lore, Aspect of the Beast and Misdirection.
    - Druid: display Tooth and Claw on Maul.
Rainrider:
    - druid: fix Savage Defense
    Fixes Adirelle/AdiButtonAuras#102
Adirelle:
    - Monk: fixed Zen Sphere & Momentum.
    See https://github.com/Adirelle/AdiButtonAuras/issues/100#issuecomment-61908453.
    - Monk: added several auras.
    Closes https://github.com/Adirelle/AdiButtonAuras/issues/100.
    - Rogue: listed the provider of the Hemorrhage debuff.
arcadepro:
    - Warrior: Added Fury Spells, HS Glyph
    - Typo
    - Druid: Fixes  https://github.com/Adirelle/AdiButtonAuras/issues/87
    Fixes Faerie Fire, Mighty Bash, Skull Bash, Berserk (alternating forms),
    Hurricane, Prowl, Forms, Ursols Vortex, Tree Form Buff, Stampeding Roar,
    Infected Wounds
    - DK: Necrotic Plague, Breath of Sindragosa
Adirelle:
    - Reorganized and uncommented the spells with just a cooldown and no aura.
    - Some additional restoration spells, hacked fixed the lack of maelstrom and echo of element auras.
    - Completed shaman for enhancement and elemental, minus totem effects.
arcadepro:
    - Bump
    - Druid: Fixes Glyph of Savage Roar
    Fixes https://github.com/Adirelle/AdiButtonAuras/issues/85
Adirelle:
    - Mage: revision bump.
    - Mage: listed all polymorph variants.
    - Mage: tidied file (comments, whitespaces, order).
    - Mage: fixed Alter Time.
    - Mage: show Heating Up on Pyroblast.
    Should fix https://github.com/Adirelle/AdiButtonAuras/issues/82.
arcadepro:
    - DK: Fixes Howling Blast
    Fixes https://github.com/Adirelle/AdiButtonAuras/issues/78
    - Warrior: Fixed Intervene, Safeguard, Sudden Death
    Intervene, Safeguard, Sudden Death, Level 100 Talents, Re-ordered lists,
    Added more descriptions.
Adirelle:
    - Warlock: updated Immolate, Incinerate, Conflagrate and Backdraft (including (Fire and Brimstone versions).
    Fixes https://github.com/Adirelle/AdiButtonAuras/issues/75.
    - Tidied hunter spells (order and comments).
    - hunter: display Beast Cleave on Multishot.
    Fixes https://github.com/Adirelle/AdiButtonAuras/issues/76.
    - Monk data tidying.
    - Monk: display Crane's Zeal on Blackout Kick (Stance of the Spirited Crane).
    - Added a link to the contribution guidelines.
    - Druid and warlock revision bump.
Tim Bellefleur:
    - Fix extraneous comma
    - Warlock: Hand of Guldan & Meta: Chaos Wave debuffs
arcadepro:
    - Corruption, Drain Life, and Drain Soul
    Fixes #72
    
    (cherry picked from commit f767a3c445d7c8d68b0ef65190aaf40865458b13)
    - Fixes https://github.com/Adirelle/AdiButtonAuras/issues/70#
    - Corruption, Drain Life, and Drain Soul
    Fixes #72
    - Fixed some Blood specific problems.
    Rune Tap, Blood Shield, Icy Touch, Plague Strike.
    - More small changes
    - English and Typo Fixes
Adirelle:
    - Druid: updated Moonfire and Sunfire ids.
    Fixes GH-37.
    - Removed the tradeskills since they do not give any bonus anymore.
    - README updated to reflect WoD changes.
arcadepro:
    - Update version
    Merged Steady focus change.
    - Some fixes.
    Aspect of the Beast, Black Ice, Deterrence Id, Binding Shot afflicted.
Adirelle:
    - Hunter: removed Fervor and added Steady Focus.
    - Warrior revision bump.
arcadepro:
    - Fixed Spaces
    Save us from the space police.
Michael Murray:
    - Add Amplify Magic as a Helpful Survival CD
arcadepro:
    - 6.0 additions
    Tidyup and a couple of additions from Daf.
    - 6.0 changes.
    Some minor fixes and additions.
Michael Murray:
    - Some Mage Clean-ups
Adirelle:
    - Fixed database conflict testing.
    - Druid: Symbiosis is gone too.
    - Removed all ids that do not exist anymore.
    I'm pretty sure half of these spells have new ids.
    - Spit only one big error per category, instead of one for each spell.
arcadepro:
    - Added standard Hawk Aspect
    Oops. :)
    - Added some missing spells
    Aspects, Black Ice, Posthaste
Adirelle:
    - Bump data revisions.
    - Fixed indentation.
daf:
    - fixed void tendrils added power word barrier
    - Several paladin spells added
    - Added Rogue's Mark for Death
    - Added rogue Combat Readiness duration
    - Cleanup of presences... again.
    - Added Death Strike Aura for blood shield Added Army of the Dead Aura for damage reduction while channeling
    - Added Burning Rush (talent) and Rain of Fire Aura
    - Added Death Knight Presences since there's no default highlight on which is active
arcadepro:
    - Fixed Orc Blood Fury Spell ID (AP)
    - Warrior Changes
Adirelle:
    - tests: check conflicts between databases.
    - Paladin: Fixed id of "Lay on Hands".
    - Added more tests.
    - Added lint and checkstyle scripts.
    - Update README.textile
    - Update README.textile
    - Fixed some bugs revealed by the tests.
    - Added some unit testing.
    - Bumped some revisions.
arcadepro:
    - Some Minor Typos and Formatting.
Adirelle:
    - Core: track spell sources.
    This allows to easily get version information about a spell.
    - Copyright update.
arcadepro:
    - Added Shadow Form
    - Fixed Levitate
    - Added Angelic Feather
    - Added Spectral Guise
    - Added Mind Flay & Insanity
    - Fixed HotW again.
Adirelle:
    - DK: added Presences.
    Fixes Adirelle/AdiButtonAuras#32.
    - Warlock: added Rain of fire (closes GH-27) and Burning Rush (closes GH-26).
    - Fixed indent in Warrior.lua
    - Warrior: added Glyph of Incite.
    Fixed GH-24.
    - Core: track spell sources.
    This allows to easily get version information about a spell.
    - Druid: also map the Heart of the Wild buffs to the talent.
    - Copyright update.
    - Druid: revision bump.
arcadepro:
    - Fixes Druid HotW aura. Issue #25
    HotW Buff Aura matches spellbook id. It is, however, different for each
    spec.
Adirelle:
    - Hunter: added Lone Wolf buffs and reordered other raid buffs.
    - Added contributors to README.textile
Michael Murray:
    - One more time for Thrill of the Hunt
    - Updates to Lock and Load
ckaotik:
    - Mage: Added polymorphs, modified spells and a few cooldowns/auras.
    - Paladin: Fixed incorrect nesting of HELPFUL/PERSONAL
    - Paladin: Added several spells, providers and modifiers.
arcadepro:
    - Stupid web interface.
    - Delete Warrior.lua
    - Reverted to personal setup.
    - RAIDBUFF category re-enabled for pull.
    - Protection & Arms 100% functional.
    - Update Warrior.lua
    - Update Warrior.lua
    - Update Warrior.lua
    - Update Warrior.lua
Rainrider:
    - monk: add brewmaster and windwalker spells
    - hunter: bump spells version
    Build 18716 should be fully covered now
    - hunter: add Netherwinds
    Flourish is now Savage Vigor
    - hunter: Improved Camouflage removed
Adirelle:
    - Hunter: enabled hunter (de)buffs again.
    - Core: emits warnings on invalid spells, instead of causing an error.
arcadepro:
    - Added Ultimatum. 'RAIDBUFF' just doesn't work.
    - Removed Shouts, Added Sudden Execute.
    - Update Warrior.lua
    - Update Warrior.lua
    Make Prot and Arms usable for Adibuttonauras. Tested in game. Will tidy up categories later.
Michael Murray:
    - Comments and one cleanup
    - Update to put translations in the proper tables
    - Updates from testing and more Mage spells
    - Add some Fire auras
    Removed Invoker's Energy since it didn't seem to be working.
    - Additional Mage cooldowns
    - Add Mage bombs and some Frost/Arcane procs
Rainrider:
    - hunter: fix non SV camouflage
    - hunter: add WoD talents
    - hunter: add WoD marksman spells
    - hunter: add WoD beast master spells
    - hunter: add WoD survival spells
    - data: direct combat benefits from professions removed
    - data: revisit racials
    - data: clean up; add WoD raid buffs
    - core: add support for WoD raid buff categories
    - bump TOC to 6.0
    - add some survival raid cooldowns
ckaotik:
    - Paladin: Track Inquisition Buff
    - Deathknight: Frost Fever is also applied by Howling Blast
Rainrider:
    - Warlock: bump data version
    - Warlock: add Hellfire
    - Warlock: fix Chaos Wave (Metamorphosis)
    - Warlock: add Life Tap
    - Warlock: fix Corruption
    fixes https://github.com/Adirelle/AdiButtonAuras/issues/25
    - Hunter: bump data version
    - Hunter: fix The Beast Within
    - Hunter: fix Frenzy
    - Hunter: fix Focus Fire
    - Hunter: fix Freezing Trap
    - Hunter: fix Master's Call
    - Hunter: fix Camouflage
    - Monk: Add Zen Sphere
Adirelle:
    - Druid: Thrash spellbook id is different from ids in action bars.
    See https://github.com/Adirelle/AdiButtonAuras/issues/23.
    - Warlock: fix the spell id of glyphed Health Funnel.
    Closes https://github.com/Adirelle/AdiButtonAuras/issues/18.
    - Warlock: fixed Shadowburn ids.
    - Monk: added Storm, Earth, and Fire.
Rainrider:
    - Warlock: fix Enslave Demon
    AURA and INVERT_AURA are not mutually exclusive but complementary
    - Deathknight: fix Control Undead
    AURA and INVERT_AURA are not mutually exclusive but complementary
Adirelle:
    - Added an Acknowledgment section in the README.
Rainrider:
    - Deathknight: include most spells
Adirelle:
    - Shaman: added Maelstrom Weapon.
    - Monk: fixed Rising Sun Kick mapping.
Rainrider:
    - Rogue: removed some entries as they are handled through DRData
    - Rogue: added most spells
Adirelle:
    - Priest: fixed Evangelism provider id.
ckaotik:
    - Changed Priest rules: Added healer's Void Shift, added Mind Bender cd, changed evangelism spellID (works for discipline), added Archangel spellID
    - Fixed Druid's Savage Defense
Adirelle:
    - Monk: fixed Healing Sphere buff id.

Login to Curse

Don't have an account? Create One.

Get an epic experience with Curse Premium
  • Faster addon downloads
  • Premium-Only Beta Giveaways
  • Ad-Free Curse experience
  • Premium Curse Client
  • and many More Features
  • Learn More »

Plantronics GameCom Commander Headset Giveaway!