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

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

Complete Spellbook Example

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.