Spoiler
Scriptname HealthTrigger extends Quest{for each 10% change in life, increases/decreases attack speed}import Mathfloat Property IAS = 1.0 Autofloat Property PercentHealth = 100.0 Auto int counter = 0int counterTwo = 0float x = 0.0 ; percent change in attack speedEvent OnInIt()registerForUpdate(1)Debug.Notification("IAS script active")Game.GetPlayer().forceAV("WeaponSpeedMult", 1.0) ; 0.0 by defaultGame.GetPlayer().forceAV("LeftWeaponSpeedMult", 1.0)endEventEvent OnUpdate()PercentHealth = Game.GetPlayer().GetAVPercentage("Health")counterTwo = 10 - Ceiling(PercentHealth * 10)x = ((counterTwo - counter) / 10.0 )If counter != counterTwoGame.GetPlayer().alterAV("WeaponSpeedMult", x )Game.GetPlayer().alterAV("LeftWeaponSpeedMult", x )Debug.Notification("Threshold passed. IAS: " + IAS)counter = counterTwoendIfendEventFunction alterAV(string asValueName, float afAmount)If afAmount > 0Game.GetPlayer().restoreAV(asValueName, afAmount)ElseGame.GetPlayer().damageAV(asValueName, afAmount)endIfendFunctionFirst issue: I originally didn't have the function alterAV() and it worked fine, but looked a little clumsy. I wanted to clean it up a bit, but now it doesn't compile. I'm getting a "function does not exist error" on alterAV() referencing the line where I try to call it.
UPDATE: This issue has been resolved. Here is the updated script:
Spoiler
Scriptname HealthTrigger extends Quest{for each 10% change in life, increases/decreases attack speed}import Mathfloat Property IAS = 1.0 Autofloat Property PercentHealth = 100.0 Auto int counter = 0int counterTwo = 0float x = 0.0 ; percent change in attack speedEvent OnInIt()registerForUpdate(1)Debug.Notification("IAS script active")Game.GetPlayer().forceAV("WeaponSpeedMult", 1.0) ; 0.0 by defaultGame.GetPlayer().forceAV("LeftWeaponSpeedMult", 1.0)endEventEvent OnUpdate()PercentHealth = Game.GetPlayer().GetAVPercentage("Health")counterTwo = 10 - Ceiling(PercentHealth * 10)x = ((counterTwo - counter) / 10.0 )If counter != counterTwoalterAV(Game.GetPlayer(), "WeaponSpeedMult", x )alterAV(Game.GetPlayer(), "LeftWeaponSpeedMult", x )IAS = Game.GetPlayer().GetAV("WeaponSpeedMult")Debug.Notification("Threshold passed. IAS: " + IAS)counter = counterTwoendIfendEventFunction alterAV(actor playerHere, string asValueName, float afAmount) globalIf afAmount > 0playerHere.modAV(asValueName, afAmount)ElseplayerHere.damageAV(asValueName, afAmount)endIfendFunctionI also changed restoreAV() -> modAV() as restore wasn't working.
Second issue: The actor value WeaponSpeedMult starts at 0.0. In my script i forced it to 1.0 because otherwise as soon as the player loses 10% hp WeaponSpeedMult goes to 0.1. The player is now attacking at 0.1 instead of 1.1 speed. However, this seems to conflict with the Dual Flurry perk. I changed the magnitude of the perk effect from 1.2 -> 0.2 and 1.35 -> 0.35, but I'm still seeing it jump an extra 100% (so at 85% health with 2 1h equipped and DualFlurry30, I'm getting 2.3 attack speed instead of 1.3).
Anyone care to lend a hand?

