Scriptname _00E_Theriantrophist_TransformSC extends _00E_Theriantrophist_WerewolfPotion _FS_TheriantrophistControlQuest Property controlQuest Auto Message Property _00E_Theriantrophist_CannotDrinkPotion Auto Message Property _00E_Theriantrophist_ForceTransformBackMessage Auto Perk Property _00E_Class_Theriantrophist_P01_StrongBlood Auto Spell Property _00E_Theriantrophist_PoisonOnWerewolfPotion Auto GlobalVariable Property _00E_FS_Theriantrophist_AllowTemporaryTransform Auto Actor Property _00E_MC_JesparREF Auto Actor Property _00E_MC_CaliaREF Auto Topic Property JesparDialogue_ForgottenStories_Theriantrophist_CommentsTopic Auto Topic Property CaliaDialogue_ForgottenStories_Theriantrophist_CommentsTopic Auto Event OnEffectStart(Actor akTarget, Actor akCaster) if akTarget != Game.GetForm(0x14) Dispel() return endif if !akTarget.HasPerk(_00E_Class_Theriantrophist_P01_StrongBlood) _00E_Theriantrophist_CannotDrinkPotion.Show() _00E_Theriantrophist_PoisonOnWerewolfPotion.Cast(akTarget) Dispel() return Endif _00E_Theriantrophist_PlayerAsWerewolf playerWhileTransformedAlias = controlQuest.playerWhileTransformed if _00E_FS_Theriantrophist_AllowTemporaryTransform.GetValueInt() == 0 if !playerWhileTransformedAlias.CanBeTransformed(akTarget.getCurrentLocation()) if EnderalFunctions.IsDLLLoaded() Debug.Notification(_00E_Theriantrophist_ForceTransformBackMessage.getName()) _RestorePotion() else ; TODO: Replace the string with a localizable message. Debug.Notification("You cannot transform here.") endif Dispel() return Endif endif if (!playerWhileTransformedAlias.IsTransformed()) _AddArcaneFever() playerWhileTransformedAlias.ForceRefTo(akTarget) int duration = 0 if SKSE.GetVersion() duration = GetDuration() as int endif playerWhileTransformedAlias.Transform(self, duration) Endif If _00E_MC_CaliaREF.GetDistance(Game.GetPlayer()) <= 700 _00E_MC_CaliaREF.Say(CaliaDialogue_ForgottenStories_Theriantrophist_CommentsTopic) ElseIf _00E_MC_JesparREF.GetDistance(Game.GetPlayer()) <= 700 _00E_MC_JesparREF.Say(JesparDialogue_ForgottenStories_Theriantrophist_CommentsTopic) endif Endevent auto state NormalFinish Event OnEffectFinish(Actor akTarget, Actor akCaster) controlQuest.playerWhileTransformed.TransformBackByTimer() endevent endstate state ForcedFinish ; do nothing endstate