promotional bannermobile promotional banner

LibSpellRange-1.0

Provides enhanced spell range checking functionality

Background

Blizzard's IsSpellInRange API has always been very limited - you either must have the name of the spell, or its spell book ID.
Checking directly by spellID is simply not possible. Now, in Mists of Pandaria, Blizzard changed the way that many talents and specialization spells work - instead of giving you a new spell when leaned, they replace existing spells. These replacement spells do not work with Blizzard's IsSpellInRange function whatsoever; this limitation is what prompted the creation of this lib.

Usage

LibSpellRange-1.0 exposes an enhanced version of IsSpellInRange that:

  • Allows ranged checking based on both spell name and spellID.
  • Works correctly with replacement spells that will not work using Blizzard's IsSpellInRange method alone.


SpellRange.IsSpellInRange(spell, unit)

Improved spell range checking function.

Parameters

spell
Name or spellID of a spell that you wish to check the range of. The spell must be a spell that you have in your spellbook or your pet's spellbook.
unit
UnitID of the spell that you wish to check the range on.

Return value

Exact same returns as http://wowprogramming.com/docs/api/IsSpellInRange

Usage

-- Check spell range by spell name on unit "target"
local SpellRange = LibStub("SpellRange-1.0")
local inRange = SpellRange.IsSpellInRange("Stormstrike", "target")

-- Check spell range by spellID on unit "mouseover"
local SpellRange = LibStub("SpellRange-1.0")
local inRange = SpellRange.IsSpellInRange(17364, "mouseover")


SpellRange.SpellHasRange(spell)

Improved SpellHasRange.

Parameters

spell
Name or spellID of a spell that you wish to check for a range. The spell must be a spell that you have in your spellbook or your pet's spellbook.

Return value

Exact same returns as http://wowprogramming.com/docs/api/SpellHasRange

Usage

-- Check if a spell has a range by spell name
local SpellRange = LibStub("SpellRange-1.0")
local hasRange = SpellRange.SpellHasRange("Stormstrike")

-- Check if a spell has a range by spellID
local SpellRange = LibStub("SpellRange-1.0")
local hasRange = SpellRange.SpellHasRange(17364)


The LibSpellRange-1.0 Team

profile avatar
  • 14
    Followers
  • 20
    Projects
  • 28.2M
    Downloads

More from CybelorasView all

  • TellMeWhen project image

    TellMeWhen

    • 27.0M
    • Addons

    Provides visual, auditory, and textual notifications about cooldowns, buffs, and pretty much every other element of combat.

    • 27.0M
    • April 30, 2026
    • Addons
    • +3
  • LibDogTag-3.0 project image

    LibDogTag-3.0

    • 177.8K
    • Addons

    A library to provide a markup syntax

    • 177.8K
    • April 22, 2026
    • Addons
  • LibDogTag-Unit-3.0 project image

    LibDogTag-Unit-3.0

    • 179.0K
    • Addons

    A library to provide unit-oriented tags to LibDogTag-3.0

    • 179.0K
    • April 22, 2026
    • Addons
  • Improved Loot Frame project image

    Improved Loot Frame

    • 202.3K
    • Addons

    Condenses all loot onto one page instead of having three items per page with scroll buttons.

    • 202.3K
    • February 22, 2026
    • Addons
  • TellMeWhen project image

    TellMeWhen

    • 27.0M
    • Addons

    Provides visual, auditory, and textual notifications about cooldowns, buffs, and pretty much every other element of combat.

    • 27.0M
    • April 30, 2026
    • Addons
    • +3
  • LibDogTag-3.0 project image

    LibDogTag-3.0

    • 177.8K
    • Addons

    A library to provide a markup syntax

    • 177.8K
    • April 22, 2026
    • Addons
  • LibDogTag-Unit-3.0 project image

    LibDogTag-Unit-3.0

    • 179.0K
    • Addons

    A library to provide unit-oriented tags to LibDogTag-3.0

    • 179.0K
    • April 22, 2026
    • Addons
  • Improved Loot Frame project image

    Improved Loot Frame

    • 202.3K
    • Addons

    Condenses all loot onto one page instead of having three items per page with scroll buttons.

    • 202.3K
    • February 22, 2026
    • Addons