enderalse/source/scripts/_00E_UnlockSpellAlias.psc

72 lines
2.5 KiB
Plaintext

Scriptname _00E_UnlockSpellAlias extends ReferenceAlias
Int Property LOCK_LEVEL_NOVICE = 1 AutoReadOnly
Int Property LOCK_LEVEL_APPRENTICE = 25 AutoReadOnly
Int Property LOCK_LEVEL_ADEPT = 50 AutoReadOnly
Int Property LOCK_LEVEL_EXPERT = 75 AutoReadOnly
Int Property LOCK_LEVEL_MASTER = 254 AutoReadOnly
event OnInit()
OnPlayerLoadGame()
endevent
event OnPlayerLoadGame()
if SKSE.GetVersion() > 0
RegisterForModEvent("Enderal_UnlockSpellHit", "OnUnlockSpell")
endif
endevent
Event OnUnlockSpell(string eventName, string strArg, float fSpellFormID, Form containerForm)
ObjectReference rContainer = containerForm as ObjectReference
Form rSpell = Game.GetForm(fSpellFormID as int)
Int projectileLevel = 0
If rSpell == _00E_UnlockProjectile_Novice
projectileLevel = LOCK_LEVEL_NOVICE
ElseIf rSpell == _00E_UnlockProjectile_Apprentice || rSpell == _25E_UnlockLockExplosion_Apprentice
projectileLevel = LOCK_LEVEL_APPRENTICE
ElseIf rSpell == _00E_UnlockProjectile_Adept || rSpell == _50E_UnlockLockExplosion_Adept
projectileLevel = LOCK_LEVEL_ADEPT
ElseIf rSpell == _00E_UnlockProjectile_Expert || rSpell == _75E_UnlockLockExplosion_Expert
projectileLevel = LOCK_LEVEL_EXPERT
ElseIf rSpell == _00E_UnlockProjectile_Master || rSpell == _100E_UnlockLockExplosion_Master
projectileLevel = LOCK_LEVEL_MASTER
else
return
endif
Int lockLevel = rContainer.GetLockLevel()
If lockLevel > LOCK_LEVEL_MASTER
_00E_sDoorLocked.Show()
WPNTG06ControlStaffShootFailM.Play(rContainer)
ElseIf projectileLevel >= lockLevel
; Unlock
rContainer.Lock(False)
_00E_UILockpickingUnlockM.Play(rContainer)
_00E_Ability_Antimagic_FXSShader.Play(rContainer)
rContainer.PlaceAtMe(_00E_UnlockLockExplosion, 1)
EndIf
endevent
Projectile Property _00E_UnlockProjectile_Novice Auto
Projectile Property _00E_UnlockProjectile_Apprentice Auto
Projectile Property _00E_UnlockProjectile_Adept Auto
Projectile Property _00E_UnlockProjectile_Expert Auto
Projectile Property _00E_UnlockProjectile_Master Auto
Explosion Property _00E_UnlockLockExplosion Auto
Explosion Property _100E_UnlockLockExplosion_Master Auto
Explosion Property _25E_UnlockLockExplosion_Apprentice Auto
Explosion Property _50E_UnlockLockExplosion_Adept Auto
Explosion Property _75E_UnlockLockExplosion_Expert Auto
Message Property _00E_sDoorLocked Auto
Sound Property WPNTG06ControlStaffShootFailM Auto
Sound Property _00E_UILockpickingUnlockM Auto
EffectShader Property _00E_Ability_Antimagic_FXSShader Auto