Spell Objects are SYNQ's object-oriented system for working with abilities. Create them by providing a spell ID and optional traits that describe how the spell behaves.
synq.Spell(spellID, traits) -> Spell Object
local killCommand = synq.Spell(34026, {damage = "physical", targeted = true})
The spell object contains all attributes, methods, and functions for that spell. SYNQ automatically gathers spell information from WoW's API and uses traits to make intelligent casting decisions.
Traits tell SYNQ how each spell behaves - preventing casts into immunities, defining special casting rules, and handling edge cases automatically.
Common traits:
damage = "physical" or "magic" - Avoids damage immunitieseffect = "physical" or "magic" - Avoids effect immunitiestargeted = true - Requires a targetranged = true - Ranged spellheal = true - Healing spellignoreMoving = true - Can cast while movingignoreControl = true - Can cast while crowd controlledignoreChanneling = true - Cancels current channel to castignoreFacing = true - Doesn't require facing targetstun = true - Stun effectbleed = true - Bleed effectslow = true - Slow effectcobraShot = synq.Spell(193455, {damage = "physical", ranged = true, ignoreMoving = true})
feignDeath = synq.Spell(5384, {ignoreControl = true, ignoreChanneling = true})
exhilaration = synq.Spell(109304, {heal = true})
intimidation = synq.Spell(19577, {effect = "physical", stun = true})
Use synq.Populate to make spell objects available to your routine actor and file scope.
local Unlocker, synq, example = ...
local bm = example.hunter.bm
local Spell = synq.Spell
synq.Populate({
killCommand = Spell(34026, {damage = "physical", targeted = true}),
barbedShot = Spell(217200, {damage = "physical", ranged = true, targeted = true}),
cobraShot = Spell(193455, {damage = "physical", ranged = true, ignoreMoving = true}),
}, bm, getfenv(1))
After populating, call spells directly: killCommand() or barbedShot().
local Unlocker, synq, example = ...
local bm = example.hunter.bm
local Spell = synq.Spell
synq.Populate({
target = synq.target,
focus = synq.focus,
player = synq.player,
pet = synq.pet,
killCommand = Spell(34026, {damage = "physical", targeted = true}),
barbedShot = Spell(217200, {damage = "physical", ranged = true, targeted = true}),
cobraShot = Spell(193455, {damage = "physical", ranged = true, ignoreMoving = true}),
serpentSting = Spell(271788, {damage = "physical", ranged = true, targeted = true, bleed = true}),
bestialWrath = Spell(19574, {damage = "physical"}),
aspectOfTheWild = Spell(193530, {damage = "physical"}),
bloodshed = Spell(321530, {damage = "physical", targeted = true}),
disengage = Spell(781, {ignoreFacing = true}),
harpoon = Spell(190925, {damage = "physical", targeted = true}),
feignDeath = Spell(5384),
exhilaration = Spell(109304, {heal = true}),
intimidation = Spell(19577, {effect = "physical", stun = true}),
concussiveShot = Spell(5116, {effect = "physical", ranged = true, targeted = true, slow = true}),
}, bm, getfenv(1))
Next: Learn how to work with Item Objects for consumables, trinkets, and equipment.