GetSpellCastItem()

Determines the object that caused the spell script to be called.

object GetSpellCastItem();

Description

Returns the object that cast the spell that the spell script is being executed for.

This object will be valid until and upto the end of the script, where the game engine removes it, or at least one casting from the item's charges.

Therefore, object type, charges, cost, plot, anything about it can be retrieved. Most useful for Bioware's use magic device (checks if the object is a scroll)



Remarks

Strickly used in scripts that resolve a spells or spell abilities effects, this function should not be used unless you are modifying how existing spells or spell abilities (scripted by BioWare and the scripts are found in scripts.bif) are implemented.

On a side note to change the scripting of a spell one could modify the BioWare scripts for a spell or spell ability (eg. NW_S0_FLMSTRIKE for Flame Strike) and save that script within the module (or Hakpak).

This should only be used inside spell scripts. If you want to learn how to use the new spellhooking system, check the advanced scripting tutorials in the Lexicon's Lyceum.


Version

1.61

See Also

categories: Spells Functions


 author: Tom Cassiotis, editor: Jasperre