Difference between revisions of "AddSpell"

Jump to navigation Jump to search
308 bytes added ,  05:23, 11 May 2007
get rid of those annoying messages!
imported>Csimbi
(→‎See Also: - added link to preventing messages.)
imported>DragoonWraith
(get rid of those annoying messages!)
Line 10: Line 10:


==Notes==
==Notes==
*Addspell works only with spell types listed in the Spells section of the object window. It cannot be used to add leveled spells to an actor via script. To dynamically add a spell to the player based on their level use the following script as a guide.
*Addspell works only with spell types listed in the Spells section of the object window. It cannot be used to add leveled spells to an actor via script. To dynamically add a spell to the player based on their level use the following script as a guide.
<pre>
<pre>
Line 26: Line 27:
endif
endif
</pre>
</pre>
*Be careful when using this function on non-unique actors. Adding an ability or spell to an actor adds it to the base object, so any references that are later spawned from that base object will also have the spell.
*Be careful when using this function on non-unique actors. Adding an ability or spell to an actor adds it to the base object, so any references that are later spawned from that base object will also have the spell.
*Using AddSpell to add a spell to the player's repertoire will give a message informing the player of this. In certain situations, this can be very annoying, but using a call to a blank [[Message]] just before using AddSpell will prevent this. Like so:
<pre>Message ""
player.UnequipItem "item ID"</pre>
*Like most functions, this one is a little different when used as a console command. When used as a console command the SpellID must be specified as a [[FormID]].
*Like most functions, this one is a little different when used as a console command. When used as a console command the SpellID must be specified as a [[FormID]].
*Note that many spell effects don't work as abilities, including Feather, Burden, and Disintegrate spells, as well as any spell that causes the target to react to the caster like Turn Undead, Charm, and Demoralize.
*Note that many spell effects don't work as abilities, including Feather, Burden, and Disintegrate spells, as well as any spell that causes the target to react to the caster like Turn Undead, Charm, and Demoralize.

Navigation menu