enderalse/scripts/source/_00e_fs_dreameatersc.psc

72 lines
2.2 KiB
Plaintext
Raw Normal View History

Scriptname _00E_FS_DreameaterSC extends activemagiceffect
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnEffectStart(Actor akTarget, Actor akCaster)
2021-10-05 22:59:59 +00:00
Float fMagnitude = Self.GetMagnitude()
Float fBonusDamage = fMagnitude * akCaster.GetActorValue("Illusion") / 3.0
If fBonusDamage < fMagnitude
fBonusDamage = fMagnitude
2021-10-05 22:59:59 +00:00
EndIf
2021-10-05 22:59:59 +00:00
; Sneak bonus
If IsExtraDamageApplicable(akTarget, akCaster)
2021-10-05 22:59:59 +00:00
Float fStealthModifier = Game.GetGameSettingFloat("fCombatSneakBowMult")
If akCaster.HasPerk(_00E_Class_Infiltrator_P03_B_HeartShot)
fStealthModifier = fStealthModifier * _00E_Class_Infiltrator_P03_B_HeartShot.GetNthEntryValue(0, 0)
EndIf
If akCaster == PlayerREF
2021-10-05 22:59:59 +00:00
_00E_FS_FakeStealthMsg.Show(fStealthModifier)
UISneakAttackM.Play(akCaster)
EndIf
2021-10-05 22:59:59 +00:00
fBonusDamage = fBonusDamage * fStealthModifier
EndIf
; Target's magic resistance
Float fMagicResist = akTarget.GetAV("MagicResist")
If fMagicResist > 0
fBonusDamage = fBonusDamage * (100.0 - fMagicResist) / 100.0
EndIf
2021-10-05 22:59:59 +00:00
akTarget.DamageAV("Health", fBonusDamage)
If akTarget.HasMagicEffect(_00E_FS_PsychosisWeaknessVisualME)
akTarget.DispelSpell(_00E_FS_PsychosisWeaknessSP)
2021-10-05 22:59:59 +00:00
EndIf
EndEvent
Bool Function IsExtraDamageApplicable(Actor akTarget, Actor akCaster)
If akTarget.HasMagicEffect(_00E_FS_PsychosisWeaknessVisualME)
Return True
EndIf
If akCaster.IsDetectedBy(akTarget) == False
akTarget.GetCombatState()
2021-10-05 22:59:59 +00:00
If akTarget.GetCombatState() != 1
Return True
EndIf
EndIf
Return False
EndFunction
2021-10-05 22:59:59 +00:00
;=====================================================================================
; PROPERTIES
;=====================================================================================
Actor Property PlayerREF Auto
2021-10-05 22:59:59 +00:00
Perk Property _00E_Class_Infiltrator_P03_B_HeartShot Auto ; 2.5
MagicEffect Property _00E_FS_PsychosisWeaknessVisualME Auto
Message Property _00E_FS_FakeStealthMsg Auto
Sound Property UISneakAttackM Auto
2021-10-05 22:59:59 +00:00
Spell Property _00E_FS_PsychosisWeaknessSP Auto