2021-10-05 22:15:58 +00:00
|
|
|
Scriptname _00E_FS_PsychosisSC extends activemagiceffect
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; EVENTS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Event OnEffectStart(Actor akTarget, Actor akCaster)
|
|
|
|
|
|
|
|
caster = akCaster
|
|
|
|
akVictim = akTarget
|
|
|
|
CheckForPsychosis()
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Event OnEffectFinish(Actor akCaster, Actor akTarget)
|
|
|
|
|
|
|
|
akVictim.RemoveSpell(_00E_FS_PsychosisCounter_01_SP)
|
|
|
|
akVictim.RemoveSpell(_00E_FS_PsychosisCounter_02_SP)
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; FUNCTIONS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Function CheckForPsychosis()
|
2021-10-12 02:10:35 +00:00
|
|
|
If akVictim.HasMagicEffect(_00E_FS_PsychosisWeaknessVisualME) == False
|
|
|
|
If akVictim.HasSpell(_00E_FS_PsychosisCounter_01_SP) == False
|
2021-10-05 22:15:58 +00:00
|
|
|
akVictim.AddSpell(_00E_FS_PsychosisCounter_01_SP, False)
|
2021-10-12 02:10:35 +00:00
|
|
|
ElseIf akVictim.HasSpell(_00E_FS_PsychosisCounter_02_SP) == False
|
|
|
|
akVictim.AddSpell(_00E_FS_PsychosisCounter_02_SP, False)
|
2021-10-05 22:15:58 +00:00
|
|
|
Else
|
|
|
|
AddDebuff()
|
|
|
|
EndIf
|
|
|
|
EndIf
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function AddDebuff()
|
2021-10-12 02:10:35 +00:00
|
|
|
Spell weaknessSpell = _00E_FS_PsychosisWeaknessSP_NoSlow
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
If caster == PlayerREF
|
2021-10-12 02:10:35 +00:00
|
|
|
If PlayerREF.HasPerk(_00E_Class_Sinistrope_P08_C_Illusionist)
|
|
|
|
weaknessSpell = _00E_FS_PsychosisWeaknessSP
|
|
|
|
EndIf
|
2021-10-05 22:15:58 +00:00
|
|
|
_00E_FS_Psychosis_Weakened.Show()
|
|
|
|
EndIf
|
|
|
|
|
2021-10-12 02:10:35 +00:00
|
|
|
Float fResist = caster.GetActorValue("Illusion") * 0.5
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2021-10-12 02:10:35 +00:00
|
|
|
weaknessSpell.SetNthEffectMagnitude(0, fResist)
|
|
|
|
weaknessSpell.SetNthEffectMagnitude(1, fResist)
|
|
|
|
weaknessSpell.SetNthEffectMagnitude(2, fResist)
|
|
|
|
weaknessSpell.SetNthEffectMagnitude(3, fResist)
|
|
|
|
weaknessSpell.SetNthEffectMagnitude(4, fResist)
|
|
|
|
weaknessSpell.SetNthEffectMagnitude(5, fResist)
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2021-10-12 02:10:35 +00:00
|
|
|
weaknessSpell.Cast(akVictim, akVictim)
|
2021-10-05 22:15:58 +00:00
|
|
|
akVictim.RemoveSpell(_00E_FS_PsychosisCounter_01_SP)
|
|
|
|
akVictim.RemoveSpell(_00E_FS_PsychosisCounter_02_SP)
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; PROPERTIES
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Actor akVictim
|
|
|
|
Actor caster
|
|
|
|
|
|
|
|
Actor Property PlayerREF Auto
|
|
|
|
|
2021-10-12 02:10:35 +00:00
|
|
|
Perk Property _00E_Class_Sinistrope_P08_C_Illusionist Auto
|
2021-10-05 22:15:58 +00:00
|
|
|
Spell Property _00E_FS_PsychosisWeaknessSP Auto
|
2021-10-12 02:10:35 +00:00
|
|
|
Spell Property _00E_FS_PsychosisWeaknessSP_NoSlow Auto
|
|
|
|
MagicEffect Property _00E_FS_PsychosisWeaknessVisualME Auto
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
Spell Property _00E_FS_PsychosisCounter_01_SP Auto
|
|
|
|
Spell Property _00E_FS_PsychosisCounter_02_SP Auto
|
|
|
|
|
|
|
|
Message Property _00E_FS_Psychosis_Weakened Auto
|
|
|
|
|