Difference between revisions of "Spell Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>CraftySentinel
(→‎SKSE Member Functions: Added SetNth Functions)
imported>CraftySentinel
m (Reverted to List)
 
Line 1: Line 1:
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
[[Category:SKSE]]
[[Category:SKSE Script Objects]]
'''Extends:''' [[Form Script]]
'''Extends:''' [[Form Script]]


Line 22: Line 16:
== Member Functions ==
== Member Functions ==


{|class="wikitable" width =100%
:'''[[Cast - Spell|Cast]](ObjectReference ''akSource'', ObjectReference ''akTarget'')'''
!style="text-align:left;"|Function
:*Casts this spell from the source object reference, optionally toward a target object reference.
!style="text-align:left;"|Description
 
|-
:'''[[IsHostile - Spell|Bool IsHostile]]()'''
|[[Cast - Spell|'''Cast'''(ObjectReference ''akSource'', ObjectReference ''akTarget'')]]
:*Returns whether this spell is considered hostile or not.
|Casts this spell from the source object reference, optionally toward a target object reference.
|-


|[[IsHostile - Spell|Bool '''IsHostile'''()]]
:'''[[RemoteCast - Spell|RemoteCast]](ObjectReference ''akSource'', Actor ''akBlameActor'', ObjectReference ''akTarget'')'''
|Returns whether this spell is considered hostile or not.
:*Casts this spell from the source object reference, with akBlameActor getting blame for any crime
|-


|[[RemoteCast - Spell|'''RemoteCast'''(ObjectReference ''akSource'', Actor ''akBlameActor'', ObjectReference ''akTarget'')]]
|Casts this spell from the source object reference, with akBlameActor getting blame for any crime
|-


|}


== SKSE Member Functions ==
== SKSE Member Functions ==


{|class="wikitable" width =100%
:'''Float [[GetCastTime - Spell|GetCastTime]]()'''
!style="text-align:left;"|Function
:*Returns the time to cast the spell.
!style="text-align:left;"|Description
 
|-
:'''Int [[GetNumEffects - Spell|GetNumEffects]]()'''
|[[GetCastTime - Spell|Float '''GetCastTime'''()]]
:*Returns the number of effects on this spell.
|Returns the time to cast the spell.
 
|-
:'''Float [[GetNthEffectMagnitude - Spell|GetNthEffectMagnitude]](Int ''index'')'''
:*Returns the magnitude of the specified effect of this spell.


|[[GetNumEffects - Spell|Int '''GetNumEffects'''()]]
:'''Int [[GetNthEffectArea - Spell|GetNthEffectArea]](Int ''index'')'''
|Returns the number of effects on this spell.
:*Returns the area of the specified effect of this spell.
|-


|[[GetNthEffectMagnitude - Spell|Float '''GetNthEffectMagnitude'''(Int ''index'')]]
:'''Int [[GetNthEffectDuration - Spell|GetNthEffectDuration]](Int ''index'')'''
|Returns the magnitude of the specified effect of this spell.
:*Returns the duration of the specified effect of this spell.
|-


|[[GetNthEffectArea - Spell|Int '''GetNthEffectArea'''(Int ''index'')]]
:'''MagicEffect [[GetNthEffectMagicEffect - Spell|GetNthEffectMagicEffect]](Int ''index'')'''
|Returns the area of the specified effect of this spell.
:*Returns the MagicEffect of the specified effect of this spell.
|-


|[[GetNthEffectDuration - Spell|Int '''GetNthEffectDuration'''(Int ''index'')]]
:'''Int [[GetCostliestEffectIndex - Spell|GetCostliestEffectIndex]]()'''
|Returns the duration of the specified effect of this spell.
:*Returns which effect of the spell has the highest cost.
|-


|[[GetNthEffectMagicEffect - Spell|MagicEffect '''GetNthEffectMagicEffect'''(Int ''index'')]]
:'''Int [[GetMagickaCost - Spell|GetMagickaCost]]()'''
|Returns the MagicEffect of the specified effect of this spell.
:*Returns the base magicka cost of the spell
|-


|[[GetCostliestEffectIndex - Spell|Int '''GetCostliestEffectIndex'''()]]
:'''Int [[GetEffectiveMagickaCost - Spell|GetEffectiveMagickaCost]](Actor ''caster'')'''
|Returns which effect of the spell has the highest cost.
:*Returns the effective cost of the spell.
|-


|[[GetMagickaCost - Spell|Int '''GetMagickaCost'''()]]
:'''Perk [[GetPerk - Spell|GetPerk]]()'''
|Returns the base magicka cost of the spell
:*Returns the perk associated with the spell.
|-


|[[GetEffectiveMagickaCost - Spell|Int '''GetEffectiveMagickaCost'''(Actor ''caster'')]]
:'''[[SetNthEffectMagnitude - Spell|SetNthEffectMagnitude]](Int ''index'', Float ''value'')'''
|Returns the effective cost of the spell.
:*Sets the magnitude of the specified effect.
|-


|[[GetPerk - Spell|Perk '''GetPerk'''()]]
:'''[[SetNthEffectArea - Spell|SetNthEffectArea]](Int ''index'', Int ''value'')'''
|Returns the perk associated with the spell.
:*Sets the area of the specified effect.
|-


|[[SetNthEffectMagnitude - Spell|'''SetNthEffectMagnitude'''(Int ''index'', Float ''value'')]]
:'''[[SetNthEffectDuration - Spell|SetNthEffectDuration]](Int ''index'', Int ''value'')'''
|Sets the magnitude of the specified effect.
:*Sets the duration of the specified effect.
|-


|[[SetNthEffectArea - Spell|'''SetNthEffectArea'''(Int ''index'', Int ''value'')]]
:'''EquipSlot [[GetEquipType - Spell|GetEquipType]]()'''
|Sets the area of the specified effect.
:*Returns the EquipSlot Type that this spell uses.
|-


|[[SetNthEffectDuration - Spell|'''SetNthEffectDuration'''(Int ''index'', Int ''value'')]]
:'''[[SetEquipSlotType - Spell|SetEquipSlotType]](EquipSlot ''type'')'''
|Sets the duration of the specified effect.
:*Sets the EquipSlot type to the specified equip slot.
|-


|}


== Events ==
== Events ==
None
None
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
[[Category:SKSE]]
[[Category:SKSE Script Objects]]

Latest revision as of 03:41, 3 February 2014

Extends: Form Script

Script for the manipulation of spells.

Definition[edit | edit source]

ScriptName Spell extends Form

Properties[edit | edit source]

None

Global Functions[edit | edit source]

None

Member Functions[edit | edit source]

Cast(ObjectReference akSource, ObjectReference akTarget)
  • Casts this spell from the source object reference, optionally toward a target object reference.
Bool IsHostile()
  • Returns whether this spell is considered hostile or not.
RemoteCast(ObjectReference akSource, Actor akBlameActor, ObjectReference akTarget)
  • Casts this spell from the source object reference, with akBlameActor getting blame for any crime


SKSE Member Functions[edit | edit source]

Float GetCastTime()
  • Returns the time to cast the spell.
Int GetNumEffects()
  • Returns the number of effects on this spell.
Float GetNthEffectMagnitude(Int index)
  • Returns the magnitude of the specified effect of this spell.
Int GetNthEffectArea(Int index)
  • Returns the area of the specified effect of this spell.
Int GetNthEffectDuration(Int index)
  • Returns the duration of the specified effect of this spell.
MagicEffect GetNthEffectMagicEffect(Int index)
  • Returns the MagicEffect of the specified effect of this spell.
Int GetCostliestEffectIndex()
  • Returns which effect of the spell has the highest cost.
Int GetMagickaCost()
  • Returns the base magicka cost of the spell
Int GetEffectiveMagickaCost(Actor caster)
  • Returns the effective cost of the spell.
Perk GetPerk()
  • Returns the perk associated with the spell.
SetNthEffectMagnitude(Int index, Float value)
  • Sets the magnitude of the specified effect.
SetNthEffectArea(Int index, Int value)
  • Sets the area of the specified effect.
SetNthEffectDuration(Int index, Int value)
  • Sets the duration of the specified effect.
EquipSlot GetEquipType()
  • Returns the EquipSlot Type that this spell uses.
SetEquipSlotType(EquipSlot type)
  • Sets the EquipSlot type to the specified equip slot.


Events[edit | edit source]

None