Lore archive · Warcraft Wiki, 2023 dump
API IsSpellInRange
Last wiki revision 2023-08-14
Returns 1 if the player is in range to use the specified spell on the target unit, 0 otherwise. inRange = IsSpellInRange(spellName, unit) = IsSpellInRange(index, bookType, unit)
- spellName: - The localized spell name. The player must know the spell.
- unit: : UnitId - The unit to use as a target for the spell.
- inRange: - if the target is in range of the spell, if the target is not in range of the spell, if the provided arguments were invalid or inapplicable.
- This takes into account talents, and can be used to determine the approximate distance to your raid members.
- The function returns if:
- The spell cannot be cast on the unit. i.e. Frostbolt on a friendly unit, or Heal on an hostile unit (such as a mind-controlled raid member)
- If the unit is not 'visible' (per ) or does not exist (per )
- The current player does not know this spell (so you cannot use 'Heal' to test 40 yard range for anyone other than a priest)
- The spell can only be cast on the player (i.e. a self-buff such as Mage Armor or Barkskin)
Source
https://warcraft.wiki.gg/wiki/API_IsSpellInRange · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.