TobiaszPL Posted May 14, 2019 Share Posted May 14, 2019 Heyyy... how i can detect if NPC is Paralized / Frozen etc. Im trying to make animals for my mod Braverock 3and i have idea to make Animals able to produce items for exampleCow produce MilkChicken produce Eggsetc. and im doing it by Spell and Event OnHit but because its spell you can use this spell any time you wanti 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 :Palso 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 More sharing options...
ReDragon2013 Posted May 18, 2019 Share Posted May 18, 2019 (edited) 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 May 18, 2019 by ReDragon2013 Link to comment Share on other sites More sharing options...
Recommended Posts