Spell Overview
The Spell class provides a comprehensive interface for handling spells in World of Warcraft. It includes functionality for checking spell availability, casting spells, managing cooldowns, and handling various spell-specific behaviors.
Important Note About Checks
Several checks are automatically performed in the cast()
and smartaoe()
functions, making manual checks redundant. These include:
ready()
- No need to check if spell is ready before castingcastable(unit)
- No need to check if spell is castable before castingisusable()
- No need to check if spell is usable before castinginrange(unit)
- No need to check range before castingunit.distance
- No need to check distance before castingunit.los
- No need to check line of sight before castingunit.facing
- No need to check facing before casting
Incorrect Usage:
if spell:ready() and spell:castable("target") and target.los and target.distanceto(player) < 40 then
spell:cast("target") -- Redundant checks!
end
Correct Usage:
spell:cast("target") -- All necessary checks are performed internally
Installation
local spell = Aurora.SpellHandler.NewSpell(spellID, payload)
Parameters
Parameter | Type | Description |
---|---|---|
spellID | number | number[] | Single spell ID or array of spell IDs for different ranks |
payload | table | Optional configuration settings |