Added fallbacks for GetType() and GetBaseDamage()

This commit is contained in:
Eddoursul 2024-02-13 10:53:17 +01:00
parent 1b91e81321
commit dae5c10a96
6 changed files with 20 additions and 8 deletions

View File

@ -128,6 +128,10 @@ EndFunction
float Function GetDealtDamage(Form akDamageSource) float Function GetDealtDamage(Form akDamageSource)
if ! SKSE.GetVersion()
return 55.0
endif
bool bIsSpell bool bIsSpell
bool bIsArrow bool bIsArrow

View File

@ -37,7 +37,7 @@ Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile,
_00E_NQG07_s_PetrifiedCombatAttackHasNoEffect.Show() _00E_NQG07_s_PetrifiedCombatAttackHasNoEffect.Show()
MAGFail.Play(akSelf) MAGFail.Play(akSelf)
Else Else
DamageShield(akSource, akSource.GetType()) DamageShield(akSource)
MAGShockImpact.Play(akSelf) MAGShockImpact.Play(akSelf)
If !bIsFlickering If !bIsFlickering
Flicker() Flicker()
@ -129,9 +129,9 @@ Function Flicker()
EndFunction EndFunction
Function DamageShield(Form akDamageSource, int iDamageSourceType) Function DamageShield(Form akDamageSource)
__Config_fShieldStrength = __Config_fShieldStrength - GetDealtDamage(akDamageSource, iDamageSourceType) __Config_fShieldStrength = __Config_fShieldStrength - GetDealtDamage(akDamageSource)
If (__Config_fShieldStrength > 0) && ((fOriginalStrength - fCurrentSubtrahend) >= __Config_fShieldStrength) If (__Config_fShieldStrength > 0) && ((fOriginalStrength - fCurrentSubtrahend) >= __Config_fShieldStrength)
float fCurrentPercentage = ((__Config_fShieldStrength)/(fOriginalStrength/100)) float fCurrentPercentage = ((__Config_fShieldStrength)/(fOriginalStrength/100))
@ -145,12 +145,20 @@ Function DamageShield(Form akDamageSource, int iDamageSourceType)
EndFunction EndFunction
float Function GetDealtDamage(Form akDamageSource, int iDamageSourceType) float Function GetDealtDamage(Form akDamageSource)
if iDamageSourceType == 41 Weapon wpSourceWeapon = akDamageSource as Weapon
Weapon wpSourceWeapon = akDamageSource as Weapon
if wpSourceWeapon
if ! SKSE.GetVersion()
if PlayerREF.GetEquippedItemType(1) == 5 || PlayerREF.GetEquippedItemType(1) == 6
return 50.0
endif
return 40
endif
Return wpSourceWeapon.GetBaseDamage() as Float Return wpSourceWeapon.GetBaseDamage() as Float
Elseif iDamageSourceType == 22 || iDamageSourceType == 21 Else
Return 25.0 Return 25.0
EndIf EndIf

View File

@ -471,7 +471,7 @@ State Transfomed
EndEvent EndEvent
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
if (akBaseObject != _00E_Theriantrophist_Claws) || akBaseObject.GetType() == 119 if akBaseObject != _00E_Theriantrophist_Claws
self.getActorReference().UnequipItem(akBaseObject) self.getActorReference().UnequipItem(akBaseObject)
self.getActorReference().equipItem(_00E_Theriantrophist_Claws, abSilent = true) self.getActorReference().equipItem(_00E_Theriantrophist_Claws, abSilent = true)
Endif Endif