Eddoursul
b1e0dac27a
a) the perk specifically targets bow attacks, b) this bonus is not used anywhere else, c) to make it consistent, it is better to use an engine level solution, see the Magic Sneak Attacks mod by po3.
57 lines
1.7 KiB
Plaintext
57 lines
1.7 KiB
Plaintext
Scriptname _00E_FS_DreameaterSC extends activemagiceffect
|
|
{Dreameater bonus damage}
|
|
|
|
;=====================================================================================
|
|
; EVENTS
|
|
;=====================================================================================
|
|
|
|
event OnEffectStart(Actor akTarget, Actor akCaster)
|
|
if SKSE.GetVersion()
|
|
fMagnitude = GetMagnitude()
|
|
endif
|
|
endevent
|
|
|
|
Event OnEffectFinish(Actor akTarget, Actor akCaster)
|
|
if ! fMagnitude
|
|
fMagnitude = akTarget.GetActorValue(sActorValue)
|
|
endif
|
|
|
|
if akTarget.IsDead()
|
|
return
|
|
endif
|
|
|
|
akTarget.RestoreActorValue(sActorValue, fMagnitude)
|
|
|
|
Float fBonusDamage = fMagnitude * akCaster.GetActorValue("Illusion") / 3.0
|
|
If fBonusDamage < fMagnitude
|
|
fBonusDamage = fMagnitude
|
|
EndIf
|
|
|
|
; Target's magic resistance
|
|
Float fMagicResist = akTarget.GetActorValue("MagicResist")
|
|
If fMagicResist > 0
|
|
fBonusDamage = fBonusDamage * (100.0 - fMagicResist) / 100.0
|
|
EndIf
|
|
|
|
akTarget.DamageActorValue("Health", fBonusDamage)
|
|
|
|
If akTarget.HasMagicEffect(_00E_FS_PsychosisWeaknessVisualME)
|
|
akTarget.DispelSpell(_00E_FS_PsychosisWeaknessSP)
|
|
akTarget.DispelSpell(_00E_FS_PsychosisWeaknessSP_NoSlow)
|
|
EndIf
|
|
EndEvent
|
|
|
|
;=====================================================================================
|
|
; PROPERTIES
|
|
;=====================================================================================
|
|
|
|
float fMagnitude
|
|
String Property sActorValue = "FavorActive" Auto
|
|
|
|
Actor Property PlayerREF Auto
|
|
|
|
MagicEffect Property _00E_FS_PsychosisWeaknessVisualME Auto
|
|
|
|
Spell Property _00E_FS_PsychosisWeaknessSP Auto
|
|
Spell Property _00E_FS_PsychosisWeaknessSP_NoSlow Auto
|