74 lines
2.3 KiB
Plaintext
74 lines
2.3 KiB
Plaintext
Scriptname _00E_FS_DreameaterSC extends activemagiceffect
|
|
|
|
;=====================================================================================
|
|
; EVENTS
|
|
;=====================================================================================
|
|
|
|
Event OnEffectStart(Actor akTarget, Actor akCaster)
|
|
Float fMagnitude = Self.GetMagnitude()
|
|
Float fBonusDamage = fMagnitude * akCaster.GetActorValue("Illusion") / 3.0
|
|
If fBonusDamage < fMagnitude
|
|
fBonusDamage = fMagnitude
|
|
EndIf
|
|
|
|
; Sneak bonus
|
|
If IsExtraDamageApplicable(akTarget, akCaster)
|
|
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
|
|
_00E_FS_FakeStealthMsg.Show(fStealthModifier)
|
|
UISneakAttackM.Play(akCaster)
|
|
EndIf
|
|
fBonusDamage = fBonusDamage * fStealthModifier
|
|
EndIf
|
|
|
|
; Target's magic resistance
|
|
Float fMagicResist = akTarget.GetAV("MagicResist")
|
|
If fMagicResist > 0
|
|
fBonusDamage = fBonusDamage * (100.0 - fMagicResist) / 100.0
|
|
EndIf
|
|
|
|
|
|
akTarget.DamageAV("Health", fBonusDamage)
|
|
|
|
If akTarget.HasMagicEffect(_00E_FS_PsychosisWeaknessVisualME)
|
|
akTarget.DispelSpell(_00E_FS_PsychosisWeaknessSP)
|
|
akTarget.DispelSpell(_00E_FS_PsychosisWeaknessSP_NoSlow)
|
|
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()
|
|
If akTarget.GetCombatState() != 1
|
|
Return True
|
|
EndIf
|
|
EndIf
|
|
|
|
Return False
|
|
EndFunction
|
|
|
|
|
|
;=====================================================================================
|
|
; PROPERTIES
|
|
;=====================================================================================
|
|
|
|
Actor Property PlayerREF Auto
|
|
|
|
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
|
|
|
|
Spell Property _00E_FS_PsychosisWeaknessSP Auto
|
|
Spell Property _00E_FS_PsychosisWeaknessSP_NoSlow Auto
|