57 lines
1.7 KiB
Plaintext
57 lines
1.7 KiB
Plaintext
|
Scriptname _00E_FS_A3_Mage_ThaumaturgicShieldSC extends activemagiceffect
|
||
|
|
||
|
;=====================================================================================
|
||
|
; EVENTS
|
||
|
;=====================================================================================
|
||
|
|
||
|
Event OnEffectStart(Actor akTarget, Actor akCaster)
|
||
|
|
||
|
Debug.MessageBox("_00E_FS_A3_Mage_ThaumaturgicShieldSC Cool.")
|
||
|
|
||
|
EndEvent
|
||
|
|
||
|
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
|
||
|
|
||
|
|
||
|
If (akAggressor as actor) && (Utility.RandomInt(1, 100) <= fThrowBackChance)
|
||
|
|
||
|
Debug.MessageBox("_00E_FS_A3_Mage_ThaumaturgicShieldSC Cool 2.")
|
||
|
|
||
|
akAttacker = akAggressor as Actor
|
||
|
|
||
|
If (akSource as Spell)
|
||
|
|
||
|
ReflectSpell(akSource as Spell)
|
||
|
|
||
|
Elseif (akSource.HasKeyword(WeapTypeBow))
|
||
|
|
||
|
ReflectArrow(akSource as Weapon)
|
||
|
|
||
|
EndIf
|
||
|
|
||
|
Endif
|
||
|
|
||
|
|
||
|
EndEvent
|
||
|
;=====================================================================================
|
||
|
; FUNCTIONS
|
||
|
;=====================================================================================
|
||
|
|
||
|
Function ReflectSpell(Spell spSpellToReflect)
|
||
|
|
||
|
EndFunction
|
||
|
|
||
|
Function ReflectArrow(Weapon wpBow)
|
||
|
|
||
|
EndFunction
|
||
|
|
||
|
;=====================================================================================
|
||
|
; PROPERTIES
|
||
|
;=====================================================================================
|
||
|
|
||
|
Actor akAttacker
|
||
|
|
||
|
float fThrowBackChance = 100
|
||
|
; The likelihood that a spell will be reflected onto the caster
|
||
|
|
||
|
Spell Property _00E_FS_A3_Mage_ThaumaturgicShieldArrowSP Auto
|