Jump to content

[LE] if( Frozen || Paralized || Knocked || ... ) return; how ? :D


Recommended Posts

Heyyy... how i can detect if NPC is Paralized / Frozen etc.

 

Im trying to make animals for my mod Braverock 3

and i have idea to make Animals able to produce items

 

for example

Cow produce Milk

Chicken produce Eggs

etc.

 

and im doing it by Spell and Event OnHit

 

but because its spell you can use this spell any time you want

i know how to detect if NPC is dead and i stop script with message: "What you want to collect from dead body?"

 

#Epic_English :D

 

but is there any way to detect if NPC is stoped by any effect ?

for example is NPC is Frozen its cover by Ice and its impossible to get Milk from frozen Cow :P

also is Cow is paralized or is knocked down by FusRoDah etc.

 

 

 

is there any way to detect those things ? :D

 

and sry 4 my potato english :)

Link to comment
Share on other sites

Maybe something like this.. only inspiration

 

tobiAnimalRefAliasScript

 

Scriptname tobiAnimalRefAliasScript extends ReferenceAlias
; https://forums.nexusmods.com/index.php?/topic/7644998-if-frozen-paralized-knocked-return;-how-d/

  Bool bHostile = False                ; ***


; -- EVENTs -- 3

EVENT OnInit()
    Debug.Trace("OnInit() - has been reached.. " +self)
ENDEVENT


EVENT OnDeath(Actor akKiller)
; is triggered when this actor finishes dying (only if this alias points at an actor)
    Debug.Trace("OnDeath() - has been reached.. " +self)
ENDEVENT


EVENT OnHit(ObjectReference akAggressor, Form akSource, Projectile akProj, Bool b1, Bool b2, Bool b3, Bool b4)
IF (akSource as Spell)
    IF (akSource as Spell).IsHostile()
        Debug.Trace("OnHit() - hostile spell applied!  " +self)
        bHostile = TRUE                ; *T*
    ELSE
        ; friendly spell
    ENDIF

ELSEIF (akSource as Shout)
        Debug.Trace("OnHit() - shout applied!  " +self)
ENDIF
ENDEVENT


EVENT OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)
; received when a magic affect is being applied to this object

    string s
    int i

IF ( akEffect )
    s = akEffect.GetAssociatedSkill()           ; school of magic
    i = akEffect.GetFormID()                    ; formID for comparing
ELSE
    RETURN    ; - STOP -    no effect !?
ENDIF
;---------------------
IF (s == "Destruction")
    Debug.Notification("Destruction..")
    RETURN    ; - STOP -
ENDIF
;---------------------
IF (s == "Alteration")
    Debug.Notification("Alteration..")
    RETURN    ; - STOP -
ENDIF
;---------------------
IF (s == "Illusion")
    Debug.Notification("Illusion..")
    RETURN    ; - STOP -
ENDIF
;---------------------
    Debug.Notification("Unknown effect detected.")
ENDEVENT

 

 

Edited by ReDragon2013
Link to comment
Share on other sites

  • Recently Browsing   0 members

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