Feels good to be modding again
This script is supposed to give the player (I do not want the ring to fire when equipped on NPC's) that is equipping the ring (which this script is attached to) a massive boost to their stamina regen WHEN they are attacked with less than 10% of their max stamina. The effect is supposed to cancel when the player is attacked with more than 10% stamina. Currently, the script does not work. I'm not sure if I've messed up with the actual script, or if attaching it to the item (ring) is the wrong thing to do. Any help would be fantastic.
Scriptname aaaHarmonyEnchant
{Enchantment for the Amulet of Harmony}
float fCurrentStamina = Game.GetPlayer().GetAVPercentage("Stamina")
float fStaminaRate = Game.GetPlayer().GetAV("StaminaRate")
float fStaminaRateO = 0
int bEquipped = 0
Event OnEquipped(Actor akActor)
if akActor == Game.GetPlayer()
bEquipped = 1
fStaminaRateO = Game.GetPlayer().GetAV("StaminaRate")
EndIf
EndEvent
Event OnUnequipped(Actor akActor)
if akActor == Game.GetPlayer()
bEquipped = 0
game.GetPlayer().SetAV("StaminaRate", fStaminaRateO)
Endif
EndEvent
event OnHit()
if bEquipped == 1
if fCurrentStamina <= .1
game.GetPlayer().SetAV("StaminaRate", (fStaminaRate + 1000))
else
game.GetPlayer().SetAV("StaminaRate", fStaminaRateO)
endif
endif
EndEvent