enderalse/source/scripts/_00e_overstrainsc.psc

89 lines
2.5 KiB
Plaintext
Raw Normal View History

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))
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)
float fStrength = (Self.GetMagnitude()*akCasterREF.GetActorValue("Illusion")/5)
_00E_FS_OverstrainDMGSP.SetNthEffectMagnitude(0, fStrength)
iStunStage = 2
_00E_FS_OverstrainDMGSP.Cast(akTargetREF, akTargetREF)
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
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
Faction Property EPFaction Auto