53 lines
1.4 KiB
Plaintext
53 lines
1.4 KiB
Plaintext
Scriptname _00E_TEST_Script01 extends ObjectReference
|
|
|
|
|
|
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
|
|
|
|
|
|
If (akAggressor as actor) && (Utility.RandomInt(1, 100) <= iThrowBackChance)
|
|
|
|
Debug.MessageBox("_00E_FS_A3_Mage_ThaumaturgicShieldSC Cool 2.")
|
|
|
|
akAttacker = akAggressor as Actor
|
|
akProjectile.Delete()
|
|
|
|
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
|
|
|
|
int iThrowBackChance = 100
|
|
; The likelihood that a spell will be reflected onto the caster
|
|
|
|
Spell Property _00E_FS_A3_Mage_ThaumaturgicShieldArrowSP Auto
|
|
|
|
Keyword Property WeapTypeBow Auto |