Editing
OnSpellCast - ObjectReference
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[Category:Scripting]] [[Category:Papyrus]] [[Category:Events]] '''Member of:''' [[ObjectReference Script]] Event called when a spell is cast by this object reference. == Syntax == <syntaxhighlight lang="papyrus"> Event OnSpellCast(Form akSpell) </syntaxhighlight> == Parameters == *akSpell: Spell that was cast. Can be [[Spell Script | Spell]], [[Enchantment Script | Enchantment]], [[Potion Script | Potion]], or [[Ingredient Script | Ingredient]]. == Examples == <syntaxhighlight lang="papyrus"> Spell Property FireballSpell Auto ; Our fireball spell object that we can compare our argument to Event OnSpellCast(Form akSpell) Spell spellCast = akSpell as Spell if 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 </syntaxhighlight> == 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, but unlike spells, akSpell must be assigned to a shout. == See Also == *[[ObjectReference Script]]
Summary:
Please note that all contributions to the CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
CreationKit:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Landing page
Tutorials
Game Systems
Editor Reference
Scripting Reference
Recent changes
Help
Tools
What links here
Related changes
Special pages
Page information
Page values