2021-10-05 22:15:58 +00:00
|
|
|
Scriptname _00E_OverstrainSC extends activemagiceffect
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; EVENTS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Event OnEffectStart(Actor akTarget, Actor akCaster)
|
|
|
|
|
|
|
|
If akTarget.HasMagicEffect(_00E_FS_Overstrain_TimerME)
|
|
|
|
|
|
|
|
_00E_FS_OverstrainImmunity.Show()
|
|
|
|
|
|
|
|
Else
|
|
|
|
|
|
|
|
akTargetREF = akTarget
|
|
|
|
akCasterREF = akCaster
|
|
|
|
|
|
|
|
bAwardXP = (akCasterREF == None || (akCasterREF.GetFactionRank(EPFaction) >= 0) || akCasterREF.HasEffectKeyword(BlameSpellKeyword))
|
|
|
|
|
2024-02-12 17:21:08 +00:00
|
|
|
if SKSE.GetVersion()
|
|
|
|
fMagnitude = GetMagnitude()
|
|
|
|
endif
|
|
|
|
|
|
|
|
fDamageMagnitude = fMagnitude * akCasterREF.GetActorValue("Illusion") / 5
|
|
|
|
|
2021-10-05 22:15:58 +00:00
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Event OnSpellCast(Form akSpell)
|
|
|
|
|
|
|
|
CastStun()
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Event OnDying(Actor akKiller)
|
|
|
|
_00E_EPOnDeath akVictim = ((akTargetREF as ObjectReference) as _00E_EPOnDeath)
|
|
|
|
If iStunStage >= 2 && bAwardXP && akVictim
|
|
|
|
akVictim.HasBlameSpell = true
|
|
|
|
EndIf
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; FUNCTIONS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Function CastStun()
|
|
|
|
|
|
|
|
If iStunStage > 0 || akTargetREF == None
|
|
|
|
Return
|
|
|
|
EndIf
|
|
|
|
iStunStage = 1
|
|
|
|
|
|
|
|
akTargetREF.PlaceAtMe(_00E_FS_OverstrainEXP)
|
|
|
|
_00E_Ability_StaggerSelfSpell.RemoteCast(akTargetREF, akCasterREF, akTargetREF)
|
|
|
|
|
|
|
|
iStunStage = 2
|
2024-02-12 17:21:08 +00:00
|
|
|
|
|
|
|
if SKSE.GetVersion()
|
|
|
|
_00E_FS_OverstrainDMGSP.SetNthEffectMagnitude(0, fDamageMagnitude)
|
|
|
|
_00E_FS_OverstrainDMGSP.Cast(akTargetREF, akTargetREF)
|
|
|
|
else
|
|
|
|
; taper magnitude = effect magnitude * Taper Weight * Taper Duration / (Taper Curve + 1)
|
|
|
|
; does not match SKSE damage, needs improvement
|
|
|
|
akTargetREF.DamageActorValue("Health", fDamageMagnitude + fDamageMagnitude * 0.3 * 1.0 / (2.0 + 1))
|
|
|
|
endif
|
|
|
|
|
2021-10-05 22:15:58 +00:00
|
|
|
IllusionNegativeFXS.Play(akTargetREF)
|
|
|
|
MAGIllusionReleaseAimedSDM.Play(akTargetREF)
|
|
|
|
IllusionDark01Imod.Apply()
|
|
|
|
_00E_FS_OverstrainImmunitySP.Cast(akTargetREF, akTargetREF)
|
|
|
|
Self.Dispel()
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; PROPERTIES
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Actor akTargetREF
|
|
|
|
Actor akCasterREF
|
|
|
|
Bool bAwardXP
|
|
|
|
Int iStunStage
|
2024-02-12 17:21:08 +00:00
|
|
|
float fDamageMagnitude
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
Spell Property _00E_Ability_StaggerSelfSpell Auto
|
|
|
|
Spell Property _00E_FS_OverstrainDMGSP Auto
|
|
|
|
Spell Property _00E_FS_OverstrainImmunitySP Auto
|
|
|
|
Sound Property MAGIllusionReleaseAimedSDM Auto
|
|
|
|
EffectShader Property IllusionNegativeFXS Auto
|
|
|
|
|
|
|
|
MagicEffect Property _00E_FS_Overstrain_TimerME Auto
|
|
|
|
|
|
|
|
Message Property _00E_FS_OverstrainImmunity Auto
|
|
|
|
|
|
|
|
Explosion Property _00E_FS_OverstrainEXP Auto
|
|
|
|
|
|
|
|
ImageSpaceModifier Property IllusionDark01Imod Auto
|
|
|
|
|
|
|
|
Keyword Property BlameSpellKeyword Auto
|
|
|
|
|
2024-02-12 17:21:08 +00:00
|
|
|
Faction Property EPFaction Auto
|
|
|
|
|
|
|
|
Float Property fMagnitude = 7.0 Auto
|