Difference between revisions of "AddSpell - Actor"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Rhavlovick
m (1 revision: Clobber re-import by Henning)
 
imported>Chesko
Line 32: Line 32:
endIf
endIf
</source>
</source>
== Notes ==
* Adding a spell marked as an Ability to the Player without at least one [[Effect Item]] set in the Effects List will result in a crash to desktop when the Player attempts to view their Active Effects.


== See Also ==
== See Also ==
*[[Actor Script]]
*[[Actor Script]]
*[[RemoveSpell - Actor]]
*[[RemoveSpell - Actor]]

Revision as of 10:32, 20 February 2012

Member of: Actor Script

Adds the specified spell to this actor.

Syntax

bool Function AddSpell(Spell akSpell, bool abVerbose = true) native

Parameters

  • akSpell: The spell to add to this actor.
  • abVerbose: Pass false to suppress UI messages for spells added to the player. Spells added to NPCs never result in a UI message.
    • Default: True

Return Value

True on success.

Examples

; Adds the sheep spell to the player
if (Game.GetPlayer().AddSpell(SheepSpellProperty))
  Debug.Trace("Sheep spell added to the player")
endIf


; Adds the sheep spell to the player, silently
if (Game.GetPlayer().AddSpell(SheepSpellProperty, false))
  Debug.Trace("Sheep spell added to the player (like a ninja!)")
endIf

Notes

  • Adding a spell marked as an Ability to the Player without at least one Effect Item set in the Effects List will result in a crash to desktop when the Player attempts to view their Active Effects.

See Also