Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname SwordDrain extends ObjectReference
- float playerMagicka
- SPELL Property DrainMagickaEffect Auto
- WEAPON Property PhantomSword Auto
- ; This function is called when the player equips the PhantomWeapon
- Event OnEquipped(Actor akActor)
- If akActor == Game.GetPlayer()
- ; Get the player's current and base magicka values
- playerMagicka = Game.GetPlayer().GetActorValue("Magicka")
- ; Check if the player has enough magicka to equip the weapon
- If (playerMagicka < 15)
- ; If not, show a notification and prevent the weapon from being equipped
- Debug.Notification("You don't have enough magicka to conjure the PhantomWeapon!")
- Game.GetPlayer().UnequipItem(PhantomSword)
- Else
- DrainMagickaEffect.Cast(akActor, akActor)
- EndIf
- EndIf
- EndEvent
- ; When the player unequips the PhantomWeapon
- Event OnUnequipped(Actor akActor)
- If akActor == Game.GetPlayer()
- ; Remove the magicka drain effect
- akActor.DispelSpell(DrainMagickaEffect)
- EndIf
- EndEvent
Add Comment
Please, Sign In to add comment