Core Concepts

Spell Objects

Learn how to create spell objects with traits and organize them in your rotation

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.

Creating Spell Objects

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.

Spell Traits

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 immunities
  • effect = "physical" or "magic" - Avoids effect immunities
  • targeted = true - Requires a target
  • ranged = true - Ranged spell
  • heal = true - Healing spell
  • ignoreMoving = true - Can cast while moving
  • ignoreControl = true - Can cast while crowd controlled
  • ignoreChanneling = true - Cancels current channel to cast
  • ignoreFacing = true - Doesn't require facing target
  • stun = true - Stun effect
  • bleed = true - Bleed effect
  • slow = true - Slow effect

Spell Cost

Access the resource cost of a spell. Use spell.cost to check a specific power type, or spell.costs to auto-detect the power type and amount.

spell.cost.{powerType} - Cost for a specific power type

spell.cost.focus   : number | 0
spell.cost.energy  : number | 0
spell.cost.mana    : number | 0
spell.cost.rage    : number | 0

spell.costs - Auto-detects the power type and how much the spell costs

spell.costs : number | 0
-- Check specific power type cost
if player.focus >= killCommand.cost.focus then
    killCommand()
end

-- Auto-detect cost (will return the cost regardless of power type)
if player.power >= cobraShot.costs then
    cobraShot()
end

Examples

cobraShot = 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})

Populating the Actor

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().

Full Example

For a complete spellbook example with traits, callbacks, and rotation logic, see the Getting Started tutorial.


Next: Learn how to work with Item Objects for consumables, trinkets, and equipment.