Jump to content

Werewolf Regen Health Script


Durai

Recommended Posts

So I'm working on a mod that'll give players an amulet that'll boost their stats when becoming a Werewolf (seriously underpowered at higher levels). I have two scripts: one on the actaul amulet, and one on the player. It works well except for one thing; modding the healrate actor value does nothing while being a Werewolf. I've used the ingame commands to view my healrate and it shows it being at 1.5. However, after taking some damage, my health never regenerates. If anyone can tell me what I'm doing wrong, please let me know.

 

Here's the script for the amulet:

 

Scriptname WerewolfAmulet002 extends ObjectReference

Race Property WerewolfBeastRace Auto
GlobalVariable Property WasWerewolf Auto

Event OnEquipped(Actor akActor)
If akActor == Game.Getplayer()
If WasWerewolf.Value == 0
WasWerewolf.SetValue(1)
Debug.Notification("Blessing recieved.")
endif
endif
EndEvent

Event OnUnequipped(Actor akActor)
If akActor == Game.GetPlayer()
If akActor.GetRace()==WerewolfBeastRace
akActor.ModActorValue("Health", 100.0)
akActor.ModActorValue("DamageResist", 200.0)
akActor.ModActorValue("UnarmedDamage", 25.0)
akActor.ModActorValue("MagicResist", 35.0)
Else
WasWerewolf.SetValue(0)
Debug.Notification("Blessing removed.")
endif
EndIf
EndEvent

 

 

And here's the one on the player:

 

Scriptname WerewolfEquipItem001 extends ReferenceAlias

Race Property WerewolfBeastRace auto
GlobalVariable Property WasWerewolf Auto

Event OnRaceSwitchComplete()
If Game.Getplayer().GetRace() == WerewolfBeastRace
If WasWerewolf.Value == 1
Debug.Notification("Your strength has been enhanced.")
WasWerewolf.SetValue(2)
endif
Else
If WasWerewolf.Value == 2
Debug.Notification("Strength enhancements removed.")
Game.Getplayer().ModActorValue("Health", -100.0)
Game.Getplayer().ModActorValue("DamageResist", -200.0)
Game.Getplayer().ModActorValue("UnarmedDamage", -25.0)
Game.Getplayer().ModActorValue("MagicResist", -35.0)
WasWerewolf.SetValue(0)
endif
endif
EndEvent

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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