enderalse/source/scripts/_00e_fs_nq10_staticscript.psc

59 lines
1.5 KiB
Plaintext
Raw Normal View History

Scriptname _00E_FS_NQ10_StaticScript extends ObjectReference
Event OnActivate(ObjectReference akActionRef)
If akActionRef == PlayerREF && !Self.IsActivationBlocked()
Self.BlockActivation(true)
2024-01-10 14:08:24 +00:00
int iCurrentStage = FS_NQ10.GetCurrentStageID()
If iCurrentStage == 0
2024-01-10 14:08:24 +00:00
FS_NQ10.SetCurrentStageID(10)
FS_NQ10.SetObjectiveDisplayed(5)
FS_NQ10.SetObjectiveDisplayed(10)
ElseIf iCurrentStage == 5
2024-01-10 14:08:24 +00:00
FS_NQ10.SetCurrentStageID(15)
FS_NQ10.SetObjectiveDisplayed(10)
EndIf
TryToEnableStatics()
If _00E_FS_NQ10_StaticCountGlobal.GetValue() == 9
2024-01-10 14:08:24 +00:00
FS_NQ10.SetCurrentStageID(30)
EndIf
Self.BlockActivation(False)
EndIf
EndEvent
Function TryToEnableStatics()
Int iStaticsEnabled = 0
Int iIndex = 9
While iIndex > 0
iIndex -= 1
MiscObject oMiscPiece = _00E_FS_NQ10_MiscList.GetAt(iIndex) as MiscObject
If PlayerREF.GetItemCount(oMiscPiece) == 1
PlayerREF.RemoveItem(oMiscPiece, 1)
ObjectReference oStaticPiece = _00E_FS_NQ10_StaticList.GetAt(iIndex) as ObjectReference
oStaticPiece.Enable()
iStaticsEnabled += 1
EndIf
EndWhile
If iStaticsEnabled > 0
FS_NQ10.ModObjectiveGlobal(iStaticsEnabled, _00E_FS_NQ10_StaticCountGlobal, 10, 9, true)
_00E_FS_NQ10_PlacePartM.Play(PlayerREF)
EndIf
EndFunction
bool DoOnce = false
Formlist Property _00E_FS_NQ10_MiscList Auto
Formlist Property _00E_FS_NQ10_StaticList Auto
Actor Property PlayerREF Auto
Quest Property FS_NQ10 Auto
GlobalVariable Property _00E_FS_NQ10_StaticCountGlobal Auto
Sound Property _00E_FS_NQ10_PlacePartM Auto