OnSpellCast - ObjectReference

Revision as of 12:33, 13 July 2023 by TwilightSky (talk | contribs) (Undo revision 23219 by TwilightSky (talk))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Member of: ObjectReference Script

Event called when a spell is cast by this object reference.

SyntaxEdit

Event OnSpellCast(Form akSpell)

ParametersEdit

ExamplesEdit

Event OnSpellCast(Form akSpell)
  Spell spellCast = akSpell as Spell
  if spellCast && spellCast == FireballSpell
    Debug.Trace("We just cast a fireball!")
  else
    Debug.Trace("We cast something, but we don't know what it is")
  endIf
endEvent

NotesEdit

  • For concentration spells, this event only fires once, at the moment the reference begins casting.
  • This function does not appear to detect spells cast via Papyrus (e.g. TempleBlessingScript casts its spell on the player from the player, but the event is not caught).
  • This Event can also be used to detect shouts cast by the player, but unlike spells, akSpell must be assigned to a shout.

See AlsoEdit