Jump to content

Could a spell effect trigger from health percentage loss or something similar?


Recommended Posts

I'm thinking it'd be awesome to create a rare spell effect for a mysterious stranger summon in Skyrim. I wasn't sure how this would be done since there's obviously no VATS or other opportunities for a very brief summon. Anyone have any ideas on how to go about this?

Link to comment
Share on other sites


1) Create your actor

2) On the created actor attach this script:



float property fKillSelf = 60.0 auto

Auto State WaitingLoad
Event OnLoad()
RegisterForSingleUpdate(fKillSelf)
GoToState("WaitingDeath")
EndEvent
EndState

State WaitingDeath
EVENT onDYING(ACTOR killer)
Self.SetCriticalStage(3)
EndEvent

Event OnDeath(Actor killer)
Self.SetCriticalStage(4)
EndEvent
EndState

Event OnUpdate()
Self.Kill(Self)
EndEvent


3) Create a 'Magical Effect' with archetype "Script" and add this script:



ActorBase Property MyActor Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
akCaster.PlaceActorAtMe(MyActor)
EndEvent


4) Create an 'Ability Spell' and add to it the 'Magical Effect' with archetype "Script"

5) Add to the "Ability Spell" the condition "GetValuePercentage" and choose "Health" < 0.5

(GetValuePercentage or GetValue or GetActorValue or GetPercentage, i don't remember right now the exact name of the condition)

* Appling this condition is just an example and it will trigger once the player has less than 50% of his health, there are other conditions you can use to trigger the summon, but this is up to what you have in mind in doing.

You can also add multiple conditions to the 'Ability Spell', that will trigger the summon only when all of those conditions are meet.

6) Now you only need to add the "Ability Spell" to the player, the how to do it depends on what you want to do.


* This is a basic draft script to be used as an example, but even if you use it like this it's still working.

* There are multiple ways that you could do this.

* Your idea is something i do a lot in my last mod, and i advise you to test a lot or ask for all the flaws that this idea has, and what 'Fail Safes' needs to be applied.

But i suggest that you experiment with it first, that's the only way to learn in the deep CK's waters.


EDIT: A bunch of typos... i wrote it without first drinking coffee...


Have a happy modding.

Edited by maxarturo
Link to comment
Share on other sites

  • Recently Browsing   0 members

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