Fixed Wolf Blood duration not applying without SKSE, added basic re-equipping
This commit is contained in:
parent
629a8e3b1e
commit
00459d5b16
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -457,7 +457,7 @@ EndEvent
|
|||||||
Event OnPlayerLoadGame()
|
Event OnPlayerLoadGame()
|
||||||
_InitAchemyControl()
|
_InitAchemyControl()
|
||||||
|
|
||||||
if aCreatedPotions.length == 0
|
if ! SKSE.GetVersion() || aCreatedPotions.length == 0
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ int function _GetScriptVersion() Global
|
|||||||
return 1
|
return 1
|
||||||
endFunction
|
endFunction
|
||||||
|
|
||||||
Function Transform(int duration)
|
Function Transform(int duration = 0)
|
||||||
|
|
||||||
bool bWasParalyzed
|
bool bWasParalyzed
|
||||||
Actor player = self.getActorReference()
|
Actor player = self.getActorReference()
|
||||||
@ -103,9 +103,21 @@ Function Transform(int duration)
|
|||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
fPlayerScale = player.GetScale()
|
fPlayerScale = player.GetScale()
|
||||||
EquipementStorage.saveEquippedItems()
|
|
||||||
|
if SKSE.GetVersion()
|
||||||
|
EquipementStorage.saveEquippedItems()
|
||||||
|
else
|
||||||
|
EquipementStorage.saveEquippedItemsVanilla()
|
||||||
|
endif
|
||||||
|
|
||||||
float preTransformDmgResist = player.GetActorValue("damageResist")
|
float preTransformDmgResist = player.GetActorValue("damageResist")
|
||||||
_00E_Theriantrophist_WolfFormSP.setNthEffectDuration(0, duration)
|
|
||||||
|
if duration > 0
|
||||||
|
; Wolf Blood should dispel the wolf form on finish (as of 2.1)
|
||||||
|
; With SKSE, we equalize their duration. The 5 seconds offset serves as a failsafe in case the main effect ends without changing the race.
|
||||||
|
_00E_Theriantrophist_WolfFormSP.setNthEffectDuration(0, duration + 5)
|
||||||
|
endif
|
||||||
|
|
||||||
_00E_Theriantrophist_WolfFormSP.Cast(player)
|
_00E_Theriantrophist_WolfFormSP.Cast(player)
|
||||||
WolfAttributes.SetInWolfForm(true)
|
WolfAttributes.SetInWolfForm(true)
|
||||||
player.additem(_00E_Theriantrophist_Claws, abSilent = true)
|
player.additem(_00E_Theriantrophist_Claws, abSilent = true)
|
||||||
@ -131,7 +143,7 @@ Function TransformBack()
|
|||||||
_00E_FS_Affinity_ScourgeOfTheWilds_TitanSP = Game.GetFormFromFile(0x0102F19E, "Enderal - Forgotten Stories.esm") as Spell
|
_00E_FS_Affinity_ScourgeOfTheWilds_TitanSP = Game.GetFormFromFile(0x0102F19E, "Enderal - Forgotten Stories.esm") as Spell
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
MagicEffect _00E_FS_Affinity_ScourgeOfTheWilds_TitanME = Game.GetFormFromFile(0x0102F19F, "Enderal - Forgotten Stories.esm") as MagicEffect
|
;MagicEffect _00E_FS_Affinity_ScourgeOfTheWilds_TitanME = Game.GetFormFromFile(0x0102F19F, "Enderal - Forgotten Stories.esm") as MagicEffect
|
||||||
|
|
||||||
Actor PlayerREF = self.getActorReference()
|
Actor PlayerREF = self.getActorReference()
|
||||||
|
|
||||||
@ -268,7 +280,15 @@ Function _InitStats(float preTransformDmgResist)
|
|||||||
WolfAttributes.ModWolfHealth(fHealthMod)
|
WolfAttributes.ModWolfHealth(fHealthMod)
|
||||||
WolfAttributes.ModWolfStamina(fStaminaMod)
|
WolfAttributes.ModWolfStamina(fStaminaMod)
|
||||||
|
|
||||||
float fClawDamage = boostFactor * _CalcWeaponSpellStrength(player) * (1 - BalancingDamageMalusPercent / 100.0)
|
float weaponStrength
|
||||||
|
if SKSE.GetVersion()
|
||||||
|
weaponStrength = _CalcWeaponSpellStrength(player)
|
||||||
|
else
|
||||||
|
weaponStrength = player.GetActorValue("OneHanded") / 2
|
||||||
|
endif
|
||||||
|
|
||||||
|
float fClawDamage = boostFactor * weaponStrength * (1 - BalancingDamageMalusPercent / 100.0)
|
||||||
|
|
||||||
float ClawDamageBonus = player.GetActorValue("LastBribedIntimidated")
|
float ClawDamageBonus = player.GetActorValue("LastBribedIntimidated")
|
||||||
WolfAttributes.ForceWolfUnarmedDmg(fClawDamage + ClawDamageBonus)
|
WolfAttributes.ForceWolfUnarmedDmg(fClawDamage + ClawDamageBonus)
|
||||||
|
|
||||||
|
@ -16,46 +16,55 @@ Topic Property CaliaDialogue_ForgottenStories_Theriantrophist_CommentsTopic Auto
|
|||||||
|
|
||||||
Event OnEffectStart(Actor akTarget, Actor akCaster)
|
Event OnEffectStart(Actor akTarget, Actor akCaster)
|
||||||
|
|
||||||
if akTarget == Game.GetPlayer()
|
if akTarget != Game.GetForm(0x14)
|
||||||
|
Dispel()
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
if !akTarget.HasPerk(_00E_Class_Theriantrophist_P01_StrongBlood)
|
if !akTarget.HasPerk(_00E_Class_Theriantrophist_P01_StrongBlood)
|
||||||
_00E_Theriantrophist_CannotDrinkPotion.Show()
|
_00E_Theriantrophist_CannotDrinkPotion.Show()
|
||||||
_00E_Theriantrophist_PoisonOnWerewolfPotion.Cast(akTarget)
|
_00E_Theriantrophist_PoisonOnWerewolfPotion.Cast(akTarget)
|
||||||
self.dispel()
|
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
|
return
|
||||||
Endif
|
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
|
|
||||||
self.dispel()
|
|
||||||
return
|
|
||||||
Endif
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
if (!playerWhileTransformedAlias.IsTransformed())
|
|
||||||
_AddArcaneFever()
|
|
||||||
playerWhileTransformedAlias.ForceRefTo(akTarget)
|
|
||||||
playerWhileTransformedAlias.Transform(self.getDuration() as int)
|
|
||||||
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
|
|
||||||
|
|
||||||
self.dispel()
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if (!playerWhileTransformedAlias.IsTransformed())
|
||||||
|
_AddArcaneFever()
|
||||||
|
playerWhileTransformedAlias.ForceRefTo(akTarget)
|
||||||
|
|
||||||
|
int duration = 0
|
||||||
|
if SKSE.GetVersion()
|
||||||
|
duration = GetDuration() as int
|
||||||
|
endif
|
||||||
|
|
||||||
|
playerWhileTransformedAlias.Transform(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
|
Endevent
|
||||||
|
|
||||||
|
Event OnEffectFinish(Actor akTarget, Actor akCaster)
|
||||||
|
controlQuest.playerWhileTransformed.TransformBack()
|
||||||
|
endevent
|
||||||
|
@ -76,9 +76,64 @@ int Function GetWeaponDamage(Weapon weapID)
|
|||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
|
function saveEquippedItemsVanilla()
|
||||||
|
|
||||||
|
Actor PlayerRef = Game.GetForm(0x14) as Actor
|
||||||
|
|
||||||
|
EquippedItemLeft = PlayerRef.GetEquippedWeapon(true) as Form
|
||||||
|
if ! EquippedItemLeft
|
||||||
|
EquippedItemLeft = PlayerRef.GetEquippedSpell(0) as Form
|
||||||
|
endif
|
||||||
|
|
||||||
|
EquippedItemRight = PlayerRef.GetEquippedWeapon(false) as Form
|
||||||
|
if ! EquippedItemRight
|
||||||
|
EquippedItemRight = PlayerRef.GetEquippedSpell(1) as Form
|
||||||
|
endif
|
||||||
|
|
||||||
|
If !EquippedItemRight
|
||||||
|
whatKindRight = 0
|
||||||
|
ElseIf (EquippedItemRight as Weapon)
|
||||||
|
;weaponDamageSpeed += GetWeaponDamage(EquippedItemRight as Weapon)
|
||||||
|
whatKindRight = 1
|
||||||
|
ElseIf (EquippedItemRight as Spell)
|
||||||
|
whatKindRight = 2
|
||||||
|
Else
|
||||||
|
whatKindRight = 1
|
||||||
|
EndIf
|
||||||
|
|
||||||
|
If !EquippedItemLeft
|
||||||
|
whatKindLeft = 0
|
||||||
|
ElseIf (EquippedItemLeft as Weapon)
|
||||||
|
;GetWeaponDamage(EquippedItemLeft as Weapon)
|
||||||
|
whatKindLeft = 1
|
||||||
|
ElseIf (EquippedItemLeft as Spell)
|
||||||
|
whatKindLeft = 2
|
||||||
|
Else
|
||||||
|
whatKindLeft = 1
|
||||||
|
EndIf
|
||||||
|
|
||||||
|
wornArmor = new Armor[15]
|
||||||
|
wornArmor[0] = PlayerRef.GetEquippedArmorInSlot(30) as Armor
|
||||||
|
wornArmor[1] = PlayerRef.GetEquippedArmorInSlot(31) as Armor
|
||||||
|
wornArmor[2] = PlayerRef.GetEquippedArmorInSlot(32) as Armor
|
||||||
|
wornArmor[3] = PlayerRef.GetEquippedArmorInSlot(33) as Armor
|
||||||
|
wornArmor[4] = PlayerRef.GetEquippedArmorInSlot(34) as Armor
|
||||||
|
wornArmor[5] = PlayerRef.GetEquippedArmorInSlot(35) as Armor
|
||||||
|
wornArmor[6] = PlayerRef.GetEquippedArmorInSlot(36) as Armor
|
||||||
|
wornArmor[7] = PlayerRef.GetEquippedArmorInSlot(37) as Armor
|
||||||
|
wornArmor[8] = PlayerRef.GetEquippedArmorInSlot(38) as Armor
|
||||||
|
wornArmor[9] = PlayerRef.GetEquippedArmorInSlot(39) as Armor
|
||||||
|
wornArmor[10] = PlayerRef.GetEquippedArmorInSlot(40) as Armor
|
||||||
|
wornArmor[11] = PlayerRef.GetEquippedArmorInSlot(41) as Armor
|
||||||
|
wornArmor[12] = PlayerRef.GetEquippedArmorInSlot(42) as Armor
|
||||||
|
wornArmor[13] = PlayerRef.GetEquippedArmorInSlot(43) as Armor
|
||||||
|
wornArmor[13] = PlayerRef.GetEquippedArmorInSlot(47) as Armor ; backpack
|
||||||
|
|
||||||
|
endfunction
|
||||||
|
|
||||||
Function saveEquippedItems()
|
Function saveEquippedItems()
|
||||||
|
|
||||||
Actor PlayerRef = Game.GetPlayer()
|
Actor PlayerRef = Game.GetForm(0x14) as Actor
|
||||||
|
|
||||||
EquippedItemLeft = PlayerRef.GetEquippedObject(0)
|
EquippedItemLeft = PlayerRef.GetEquippedObject(0)
|
||||||
EquippedItemRight = PlayerRef.GetEquippedObject(1)
|
EquippedItemRight = PlayerRef.GetEquippedObject(1)
|
||||||
@ -164,7 +219,7 @@ Function equipeItems()
|
|||||||
|
|
||||||
if whatKindRight == 2
|
if whatKindRight == 2
|
||||||
PlayerRef.EquipSpell(EquippedItemRight as Spell, 1)
|
PlayerRef.EquipSpell(EquippedItemRight as Spell, 1)
|
||||||
elseif PlayerRef.GetItemCount(EquippedItemRight) > 0
|
elseif EquippedItemRight && PlayerRef.GetItemCount(EquippedItemRight) > 0
|
||||||
if SKSE.GetVersion()
|
if SKSE.GetVersion()
|
||||||
PlayerRef.EquipItemEx(EquippedItemRight, 1)
|
PlayerRef.EquipItemEx(EquippedItemRight, 1)
|
||||||
else
|
else
|
||||||
@ -174,7 +229,7 @@ Function equipeItems()
|
|||||||
|
|
||||||
if whatKindLeft == 2
|
if whatKindLeft == 2
|
||||||
PlayerRef.EquipSpell(EquippedItemLeft as Spell, 0)
|
PlayerRef.EquipSpell(EquippedItemLeft as Spell, 0)
|
||||||
elseif PlayerRef.GetItemCount(EquippedItemLeft) > 0
|
elseif EquippedItemLeft && PlayerRef.GetItemCount(EquippedItemLeft) > 0
|
||||||
if SKSE.GetVersion()
|
if SKSE.GetVersion()
|
||||||
PlayerRef.EquipItemEx(EquippedItemLeft, 2)
|
PlayerRef.EquipItemEx(EquippedItemLeft, 2)
|
||||||
else
|
else
|
||||||
|
@ -92,7 +92,7 @@ Function Transform()
|
|||||||
Game.DisablePlayerControls(true, true, true, false, true, true, true)
|
Game.DisablePlayerControls(true, true, true, false, true, true, true)
|
||||||
|
|
||||||
If PlayerREF == None
|
If PlayerREF == None
|
||||||
PlayerREF = Game.GetPlayer()
|
PlayerREF = Game.GetForm(0x14) as Actor
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
_00E_FS_Theriantrophist_PotionM.Play(PlayerREF)
|
_00E_FS_Theriantrophist_PotionM.Play(PlayerREF)
|
||||||
@ -111,28 +111,35 @@ Function Transform()
|
|||||||
explosionMarker.SetPosition(PlayerREF.GetPositionX(), PlayerREF.GetPositionY(), (PlayerREF.GetPositionZ() + 100.0))
|
explosionMarker.SetPosition(PlayerREF.GetPositionX(), PlayerREF.GetPositionY(), (PlayerREF.GetPositionZ() + 100.0))
|
||||||
explosionMarker.PlaceAtMe(_00E_FS_Theriantrophist_TransEXP)
|
explosionMarker.PlaceAtMe(_00E_FS_Theriantrophist_TransEXP)
|
||||||
_00E_FS_Theriantrophist_TransformIMOD.Apply()
|
_00E_FS_Theriantrophist_TransformIMOD.Apply()
|
||||||
PlayerREF.UnequipAll()
|
|
||||||
|
if SKSE.GetVersion()
|
||||||
|
; Re-equipping is fully working with SKSE
|
||||||
|
PlayerREF.UnequipAll()
|
||||||
|
endif
|
||||||
|
|
||||||
PlayerREF.SetRace(_00E_Theriantrophist_PlayerWerewolfRace)
|
PlayerREF.SetRace(_00E_Theriantrophist_PlayerWerewolfRace)
|
||||||
|
|
||||||
if PlayerREF.HasSpell(_00E_FS_Affinity_AbBrute)
|
if SKSE.GetVersion()
|
||||||
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Brute)
|
if PlayerREF.HasSpell(_00E_FS_Affinity_AbBrute)
|
||||||
elseif PlayerREF.HasSpell(_00E_FS_Affinity_AbDrifter)
|
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Brute)
|
||||||
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Drifter)
|
elseif PlayerREF.HasSpell(_00E_FS_Affinity_AbDrifter)
|
||||||
elseif PlayerREF.HasSpell(_00E_FS_Affinity_AbDruid)
|
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Drifter)
|
||||||
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Druid)
|
elseif PlayerREF.HasSpell(_00E_FS_Affinity_AbDruid)
|
||||||
elseif PlayerREF.HasSpell(_00E_FS_Affinity_AbNightwolf)
|
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Druid)
|
||||||
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Nightwolf)
|
elseif PlayerREF.HasSpell(_00E_FS_Affinity_AbNightwolf)
|
||||||
elseif PlayerREF.HasSpell(_00E_FS_Affinity_AbRavager)
|
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Nightwolf)
|
||||||
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Ravager)
|
elseif PlayerREF.HasSpell(_00E_FS_Affinity_AbRavager)
|
||||||
elseif PlayerREF.HasSpell(_00E_FS_Affinity_AbScourge)
|
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Ravager)
|
||||||
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Scourge)
|
elseif PlayerREF.HasSpell(_00E_FS_Affinity_AbScourge)
|
||||||
elseif PlayerREF.HasSpell(_00E_FS_Affinity_AbSoulcaller)
|
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Scourge)
|
||||||
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Soulcaller)
|
elseif PlayerREF.HasSpell(_00E_FS_Affinity_AbSoulcaller)
|
||||||
else
|
Player.SetSkin(_00E_FS_Theriantrophist_Skin_Soulcaller)
|
||||||
Player.SetSkin(Player.GetRace().GetSkin())
|
else
|
||||||
|
Player.SetSkin(Player.GetRace().GetSkin())
|
||||||
|
endif
|
||||||
|
PlayerREF.QueueNiNodeUpdate()
|
||||||
endif
|
endif
|
||||||
PlayerREF.QueueNiNodeUpdate()
|
|
||||||
|
|
||||||
_00E_Theriantrophist_TransformShader.Stop(PlayerREF)
|
_00E_Theriantrophist_TransformShader.Stop(PlayerREF)
|
||||||
explosionMarker.Delete()
|
explosionMarker.Delete()
|
||||||
Game.EnablePlayerControls(true, true, false, true, true, true, true, true)
|
Game.EnablePlayerControls(true, true, false, true, true, true, true, true)
|
||||||
@ -163,7 +170,7 @@ EndFunction
|
|||||||
Function GoBackToNormal()
|
Function GoBackToNormal()
|
||||||
{Transforms the player back to human, but does not calculate stats, unlock perks, ... and does not check if a transformation is legal}
|
{Transforms the player back to human, but does not calculate stats, unlock perks, ... and does not check if a transformation is legal}
|
||||||
If PlayerREF == None
|
If PlayerREF == None
|
||||||
PlayerREF = Game.GetPlayer()
|
PlayerREF = Game.GetForm(0x14) as Actor
|
||||||
EndIf
|
EndIf
|
||||||
;PlayerREF.GetActorBase().SetSkin(SkinNakedWerewolfBeast)
|
;PlayerREF.GetActorBase().SetSkin(SkinNakedWerewolfBeast)
|
||||||
|
|
||||||
@ -185,8 +192,10 @@ Function GoBackToNormal()
|
|||||||
PlayerREF.SetRace(originalRace)
|
PlayerREF.SetRace(originalRace)
|
||||||
PlayerREF.PlayIdle(_00E_IdleStomp)
|
PlayerREF.PlayIdle(_00E_IdleStomp)
|
||||||
|
|
||||||
Player.SetSkin(Player.GetRace().GetSkin())
|
if SKSE.GetVersion()
|
||||||
PlayerREF.QueueNiNodeUpdate()
|
Player.SetSkin(Player.GetRace().GetSkin())
|
||||||
|
PlayerREF.QueueNiNodeUpdate()
|
||||||
|
endif
|
||||||
|
|
||||||
Game.EnablePlayerControls()
|
Game.EnablePlayerControls()
|
||||||
|
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user