Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ScriptName ApplySpellOnHit Extends ActiveMagicEffect
- Spell Property SpellToApply Auto
- Actor Caster
- Actor Target
- Event OnEffectStart(Actor akTarget, Actor akCaster)
- Caster = akCaster
- Target = akTarget
- EndEvent
- Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
- If (akSource as Weapon) && !(akSource as Enchantment) && (akAggressor == Caster as ObjectReference); && (!akProjectile)
- if (akSource as Weapon) == Caster.GetEquippedWeapon(0) || (akSource as Weapon) == Caster.GetEquippedWeapon(1)
- SpellToApply.Cast(Caster, Target)
- endif
- EndIf
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement