enderalse/source/scripts/_60e_fs_mystical_thoughtimplosionsc.psc

68 lines
2.1 KiB
Plaintext

Scriptname _60E_FS_Mystical_ThoughtImplosionSC extends ActiveMagicEffect
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnEffectStart(Actor akTarget, Actor akCaster)
int iChance = Utility.RandomInt(1, 100)
if iChance > 0 && iChance < 33
; Do nothing
Elseif iChance >= 33 && iChance < 66
PushBack(akTarget)
Elseif iChance >= 66
Weaken(akTarget)
EndIf
EndEvent
;=====================================================================================
; FUNCTIONS
;=====================================================================================
Function PushBack(Actor Target)
MAGAlterationTelekinesisThrow.Play(Target)
float fPushStrength = (PlayerREF.GetActorValue("Illusion")/10)
if fPushStrength < 4
_00E_FS_PsionicPushStaggerSP.Cast(Target, Target)
Else
PlayerREF.PushActorAway(Target, (PlayerREF.GetActorValue("Illusion")/10))
EndIf
EndFunction
Function Weaken(Actor Target)
_00E_FS_Psychosis_Weakened.Show()
float fResist = PlayerREF.GetActorValue("Illusion")/2
_00E_FS_PsychosisWeaknessSP.SetNthEffectMagnitude(0, fResist)
_00E_FS_PsychosisWeaknessSP.SetNthEffectMagnitude(1, fResist)
_00E_FS_PsychosisWeaknessSP.SetNthEffectMagnitude(2, fResist)
_00E_FS_PsychosisWeaknessSP.SetNthEffectMagnitude(3, fResist)
_00E_FS_PsychosisWeaknessSP.SetNthEffectMagnitude(4, fResist)
_00E_FS_PsychosisWeaknessSP.SetNthEffectMagnitude(5, fResist)
_00E_FS_PsychosisWeaknessSP.Cast(Target, Target)
EndFunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
Actor Property PlayerREF Auto
Spell Property _00E_FS_PsychosisWeaknessSP Auto
Spell Property _00E_FS_PsionicPushStaggerSP Auto
Sound Property MAGAlterationTelekinesisThrow Auto
Message Property _00E_FS_Psychosis_Weakened Auto