Jump to content

A trigger that adds poison effects


Zorkaz

Recommended Posts

Made my own script. For reference:


Scriptname SBOutofBreathScript extends ObjectReference
SPELL Property PoisonEffect Auto
{The poison spell}
Actor Property PlayerRef Auto
{The player}
Message Property TheMessagetoshow Auto
{Show a message while being poisoned}
Sound Property Coughingmale Auto
Sound Property Coughingfemale Auto
{Play a sound while being poisoned}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Int InTrigger = 0
 
Event OnTriggerEnter(ObjectReference akTriggerRef)
    if (InTrigger == 0)
        if akTriggerRef == Game.GetPlayer()
            InTrigger += 1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;While being in the trigger;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
while (InTrigger == 1)

            PoisonEffect.Cast(PlayerRef)
            TheMessagetoshow.Show()


ActorBase PlayerBase = Game.GetPlayer().GetActorBase()
Int Rand = Utility.RandomInt(0,100)
;This is so there's only one or two breath sounds not a thousand at once
If Rand == 0
            if (PlayerBase.GetSex() == 0)
            coughingmale.play(self)
            elseif (PlayerBase.GetSex() == 1)
            coughingfemale.play(self)
            Endif
EndIf
endwhile
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


        endif
    endif
EndEvent
 



Event OnTriggerLeave(ObjectReference akTriggerRef)
    if (InTrigger > 0)
        if akTriggerRef == Game.GetPlayer()
            InTrigger -= 1
        endif
    endif
EndEvent



Notes: As poison spell you might make your own spell with a custom damagehealth effect, that is flagged as "painless"

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...