parent
3c1725cbcb
commit
a43aa14bef
11 changed files with 110 additions and 177 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,77 +0,0 @@ |
||||
Scriptname _00E_ClosedChestAlias 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 OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) |
||||
|
||||
ObjectReference hitRef = GetReference() |
||||
|
||||
If akAggressor != PlayerREF || hitRef.IsLocked() == False |
||||
Return |
||||
EndIf |
||||
|
||||
Int projectileLevel = 0 |
||||
|
||||
If akProjectile == _00E_UnlockProjectile_Novice |
||||
projectileLevel = LOCK_LEVEL_NOVICE |
||||
ElseIf akProjectile == _00E_UnlockProjectile_Apprentice |
||||
projectileLevel = LOCK_LEVEL_APPRENTICE |
||||
ElseIf akProjectile == _00E_UnlockProjectile_Adept |
||||
projectileLevel = LOCK_LEVEL_ADEPT |
||||
ElseIf akProjectile == _00E_UnlockProjectile_Expert |
||||
projectileLevel = LOCK_LEVEL_EXPERT |
||||
ElseIf akProjectile == _00E_UnlockProjectile_Master |
||||
projectileLevel = LOCK_LEVEL_MASTER |
||||
ElseIf akSource |
||||
Formlist unlockSpells = _00E_ChestAndDoorUnlockScript_UnlockSpells |
||||
If unlockSpells.HasForm(akSource) |
||||
If akSource == unlockSpells.GetAt(0) as Explosion |
||||
projectileLevel = LOCK_LEVEL_APPRENTICE |
||||
ElseIf akSource == unlockSpells.GetAt(1) as Explosion |
||||
projectileLevel = LOCK_LEVEL_ADEPT |
||||
ElseIf akSource == unlockSpells.GetAt(2) as Explosion |
||||
projectileLevel = LOCK_LEVEL_EXPERT |
||||
ElseIf akSource == unlockSpells.GetAt(3) as Explosion |
||||
projectileLevel = LOCK_LEVEL_MASTER |
||||
EndIf |
||||
EndIf |
||||
EndIf |
||||
|
||||
If projectileLevel > 0 |
||||
Int lockLevel = hitRef.GetLockLevel() |
||||
If lockLevel > LOCK_LEVEL_MASTER |
||||
_00E_sDoorLocked.Show() |
||||
WPNTG06ControlStaffShootFailM.Play(hitRef) |
||||
ElseIf projectileLevel >= lockLevel |
||||
; Unlock |
||||
hitRef.Lock(False) |
||||
_00E_UILockpickingUnlockM.Play(hitRef) |
||||
_00E_Ability_Antimagic_FXSShader.Play(hitRef) |
||||
hitRef.PlaceAtMe(_00E_UnlockLockExplosion, 1) |
||||
EndIf |
||||
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 |
||||
|
||||
Message Property _00E_sDoorLocked Auto |
||||
|
||||
Sound Property _00E_UILockpickingUnlockM Auto |
||||
Sound Property WPNTG06ControlStaffShootFailM Auto |
||||
|
||||
EffectShader Property _00E_Ability_Antimagic_FXSShader Auto |
||||
Explosion Property _00E_UnlockLockExplosion Auto |
||||
|
||||
FormList Property _00E_UnlockScrolls Auto |
||||
FormList Property _00E_ChestAndDoorUnlockScript_UnlockSpells Auto |
||||
|
||||
Actor Property PlayerREF Auto |
@ -1,97 +0,0 @@ |
||||
Scriptname _00E_ScrollUnlockAlias extends ReferenceAlias Hidden |
||||
|
||||
event OnPlayerLoadGame() |
||||
if UnlockScrollEquipped() |
||||
GotoState("Equipped") |
||||
endif |
||||
endevent |
||||
|
||||
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) |
||||
if akBaseObject as Scroll && _00E_UnlockScrolls.HasForm(akBaseObject) |
||||
GotoState("Equipped") |
||||
endif |
||||
endEvent |
||||
|
||||
bool function UnlockScrollEquipped() |
||||
Actor PlayerREF = GetReference() as Actor |
||||
if PlayerREF.IsEquipped(_00E_UnlockScrolls) |
||||
return true |
||||
endif |
||||
Form leftHand = PlayerREF.GetEquippedObject(0) |
||||
return leftHand && _00E_UnlockScrolls.HasForm(leftHand) |
||||
endfunction |
||||
|
||||
Event OnUpdate() |
||||
if UnlockScrollAliases.IsStopped() |
||||
if ! UnlockScrollAliases.Start() |
||||
RegisterForSingleUpdate(0.1) |
||||
endif |
||||
elseif UnlockScrollAliases.IsStopping() |
||||
RegisterForSingleUpdate(0.01) |
||||
elseif UnlockScrollAliases.IsStarting() |
||||
RegisterForSingleUpdate(0.01) |
||||
endif |
||||
EndEvent |
||||
|
||||
state Equipped |
||||
event OnPlayerLoadGame() |
||||
if ! UnlockScrollEquipped() |
||||
GotoState("") |
||||
endif |
||||
endevent |
||||
|
||||
event OnBeginState() |
||||
ObjectReference actorRef = GetReference() |
||||
RegisterForAnimationEvent(actorRef, "BeginCastRight") |
||||
RegisterForAnimationEvent(actorRef, "BeginCastLeft") |
||||
endevent |
||||
|
||||
event OnEndState() |
||||
ObjectReference actorRef = GetReference() |
||||
UnregisterForAnimationEvent(actorRef, "BeginCastRight") |
||||
UnregisterForAnimationEvent(actorRef, "BeginCastLeft") |
||||
endevent |
||||
|
||||
Event OnUpdate() |
||||
if UnlockScrollAliases.IsStopped() |
||||
if ! UnlockScrollAliases.Start() |
||||
RegisterForSingleUpdate(0.1) |
||||
endif |
||||
elseif UnlockScrollAliases.IsStopping() |
||||
RegisterForSingleUpdate(0.01) |
||||
elseif UnlockScrollAliases.IsStarting() |
||||
RegisterForSingleUpdate(0.01) |
||||
endif |
||||
EndEvent |
||||
|
||||
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) |
||||
; do nothing |
||||
endEvent |
||||
|
||||
Event OnObjectUnequipped(Form akBaseObject, ObjectReference akReference) |
||||
if ! UnlockScrollEquipped() |
||||
GotoState("") |
||||
endif |
||||
endEvent |
||||
|
||||
Event OnAnimationEvent(ObjectReference akSource, string asEventName) |
||||
ObjectReference crosshairRef = Game.GetCurrentCrosshairRef() |
||||
|
||||
if crosshairRef |
||||
Form baseObject = crosshairRef.GetBaseObject() |
||||
if baseObject as Container || baseObject as Door |
||||
ScrollTarget.ForceRefTo(crosshairRef) |
||||
UnlockScrollAliases.Stop() |
||||
return |
||||
endif |
||||
endif |
||||
|
||||
UnlockScrollAliases.Stop() |
||||
RegisterForSingleUpdate(0.01) |
||||
ScrollTarget.Clear() |
||||
endEvent |
||||
endstate |
||||
|
||||
Quest Property UnlockScrollAliases Auto |
||||
FormList Property _00E_UnlockScrolls Auto |
||||
ReferenceAlias Property ScrollTarget Auto |
@ -0,0 +1,69 @@ |
||||
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() |
||||
RegisterForModEvent("Enderal_UnlockSpellHit", "OnUnlockSpell") |
||||
endevent |
||||
|
||||
event OnPlayerLoadGame() |
||||
RegisterForModEvent("Enderal_UnlockSpellHit", "OnUnlockSpell") |
||||
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 |
Loading…
Reference in new issue