enderalse/source/scripts/_00e_fs_dreameatersc.psc

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
akTarget.RestoreActorValue(sActorValue, fMagnitude)
if akTarget.IsDead()
return
endif
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