The Elder Scrolls

Editing “Avoid Death” script/effect.

Content of the article: "Editing “Avoid Death” script/effect."

So, I was wondering about the possibility of making the Avoid Death perk/effect/script in the Restoration tree a “True Avoid Death” feature instead. Having the effect only kick in specifically between >0 and <10 makes it, honestly, kinda useless.

For the record, here’s the vanilla script itself that’s attached to the magic effect:

Scriptname PerkAvoidDeathScript extends ActiveMagicEffect

; ready to heal you
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked )
; ; debug.trace(self + ” Enter Bleedout”);
If PerkAvoidDeathTimer.GetValue() < GameDaysPassed.GetValue()
; cast heal spell
PercentHealth = GetTargetActor().GetAVPercentage(“Health”)
If PercentHealth < 0.1
PerkAvoidDeathTimer.SetValue(GameDaysPassed.GetValue() + 1.0)
; ; debug.trace(self + ” Heal “+ PerkAvoidDeathTimer.GetValue() + ” ” + GameDaysPassed.GetValue())
; ; debug.trace(self + ” Timer not reset ” + PerkAvoidDeathTimer.GetValue() + ” ” + GameDaysPassed.GetValue())

Spell Property HealSpell Auto

GlobalVariable Property PerkAvoidDeathTimer Auto

GlobalVariable Property GameDaysPassed Auto

float Property PercentHealth = 100.0 Auto

I want the heal to actually fire on what would otherwise have been a killing blow, like the name of the perk suggests.

Just changing the script to detect “health=0 or less” is useless, since upon any hit taking health to zero or less the player just dies and the heal gets canceled.

My initial idea would be to somehow set the player as essential, then on entering bleed-out, cast the healing spell, then remove essential flag on player until the timer resets. Sounds simple, but I’m not sure how you’d track the essential flag on the player – I know a lot of “Death Alternative” mods use a similar set up, but they use quests to track this. Ideally I’d like to achieve this by editing just this one script.

But first, is there a simpler solution here I’m missing? Has this functionality been implemented in some other mod already?


Read:  50 people 1 harrowstorm

Similar Guides

© Post "Editing “Avoid Death” script/effect." for game The Elder Scrolls.

Top 7 NEW Games of June 2020

Quite a few exciting games are releasing for PC, PS4, Xbox One, and Nintendo in June. Here's what to keep an eye on.

Top 10 NEW Open World Games of 2020

Video games with open worlds continue to roll out in 2020 on PC, PS4, Xbox One, Nintendo Switch, and beyond. Here are some to look forward to!

Top 10 Best New Upcoming Games 2020-2021

The best selection of games which will be released in 2020 and 2021 for PS4, PS5, Xbox One, Xbox Series X, Google Stadia and PC - and you can watch in amazing UHD 4K and 60FPS with latest updates about all of the games in this list!

You Might Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *