Advertisement
Guest User

Untitled

a guest
Jun 7th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. ScriptName ApplySpellOnHit Extends ActiveMagicEffect
  2.  
  3. Spell Property SpellToApply Auto
  4.  
  5. Actor Caster
  6. Actor Target
  7.  
  8. Event OnEffectStart(Actor akTarget, Actor akCaster)
  9. Caster = akCaster
  10. Target = akTarget
  11. EndEvent
  12.  
  13. Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
  14.  
  15. If (akSource as Weapon) && !(akSource as Enchantment) && (akAggressor == Caster as ObjectReference); && (!akProjectile)
  16. if (akSource as Weapon) == Caster.GetEquippedWeapon(0) || (akSource as Weapon) == Caster.GetEquippedWeapon(1)
  17. SpellToApply.Cast(Caster, Target)
  18. endif
  19. EndIf
  20.  
  21. EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement