Difference between revisions of "OnSpellCast - ObjectReference"
Jump to navigation
Jump to search
imported>Rasikko m (→Notes: works for shouts) |
TwilightSky (talk | contribs) m (→Notes: Updated my note.) |
||
Line 29: | Line 29: | ||
*For concentration spells, this event only fires once, at the moment the reference begins casting. | *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 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 | * This event can also be used to detect shouts cast by the player, however, for shouts that contains three associated spells it will only catch the last spell consistently. | ||
== See Also == | == See Also == | ||
*[[ObjectReference Script]] | *[[ObjectReference Script]] |
Revision as of 04:47, 13 July 2023
Member of: ObjectReference Script
Event called when a spell is cast by this object reference.
Syntax
Event OnSpellCast(Form akSpell)
Parameters
- akSpell: Spell that was cast. Can be Spell, Enchantment, Potion, or Ingredient.
Examples
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
Notes
- 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, however, for shouts that contains three associated spells it will only catch the last spell consistently.