Difference between revisions of "Bethesda Tutorial Papyrus Events and Properties"

imported>Frenchfrog
imported>Frenchfrog
Line 190: Line 190:


<source lang="papyrus">
<source lang="papyrus">
scriptName LokirsDraugrResurrection extends Actor
scriptName LokirsDraugrResurrection extends Actor
{This Script lives on the dead minion draugr in Lokir's Tomb. It handles their resurrection}
{This Script lives on the dead minion draugr in Lokir's Tomb. It handles their resurrection}
   
   
Spell property reanimateSpell Auto          ; this is the special self-resurrection spell to use
Spell property reanimateSpell Auto          ; this is the special self-resurrection spell to use
objectReference property myTrigger auto    ; This is the reference we are waiting on to send an activate
objectReference property myTrigger auto    ; This is the reference we are waiting on to send an activate
   
   
Event OnActivate(ObjectReference akActionRef)
Event OnActivate(ObjectReference akActionRef)
   ; I've been activated - see if was my trigger
   ; I've been activated - see if was my trigger
   if (akActionRef == myTrigger)
   if (akActionRef == myTrigger)
      ; Cast a Reanimate spell on the Draugr
      ; Cast a Reanimate spell on the Draugr
      reanimateSpell.Cast(Self, Self)
      reanimateSpell.Cast(Self, Self)
   EndIf
   EndIf
EndEvent
EndEvent
</source>
</source>


Anonymous user