Casts a spell specified by id (optionally on a specified unit). Only protected (i.e. usable only by the Blizzard UI) if the given spell is castable (not passive) and is not a trade skill; can be used by addons to cast the "spells" that open trade skill windows.


See also Spell functions.

Signature:

CastSpellByID(spellID [, "target"])

Arguments:

  • spellID - ID of the spell to cast (number, spellID)
  • target - A unit to target with the spell (string, unitID)
This function is protected and can only be called by the Blizzard user interface