diff --git a/scripts/_00E_SoundControl.pex b/scripts/_00E_SoundControl.pex index 5c671ab0..bbb1f335 100644 Binary files a/scripts/_00E_SoundControl.pex and b/scripts/_00E_SoundControl.pex differ diff --git a/scripts/_00E_VisionControl.pex b/scripts/_00E_VisionControl.pex index 96e9814c..5cf02796 100644 Binary files a/scripts/_00E_VisionControl.pex and b/scripts/_00E_VisionControl.pex differ diff --git a/scripts/_00e_armorsetscript.pex b/scripts/_00e_armorsetscript.pex index 978723bb..59276a77 100644 Binary files a/scripts/_00e_armorsetscript.pex and b/scripts/_00e_armorsetscript.pex differ diff --git a/scripts/_00e_func_getpointsinclass.pex b/scripts/_00e_func_getpointsinclass.pex index a970ffcd..e261b5e4 100644 Binary files a/scripts/_00e_func_getpointsinclass.pex and b/scripts/_00e_func_getpointsinclass.pex differ diff --git a/scripts/_00e_game_talentcooldownsc.pex b/scripts/_00e_game_talentcooldownsc.pex index ee1ec475..22513ce2 100644 Binary files a/scripts/_00e_game_talentcooldownsc.pex and b/scripts/_00e_game_talentcooldownsc.pex differ diff --git a/scripts/_00e_mq06_functions.pex b/scripts/_00e_mq06_functions.pex index 99b4c3a3..2f6edfa9 100644 Binary files a/scripts/_00e_mq06_functions.pex and b/scripts/_00e_mq06_functions.pex differ diff --git a/scripts/_00e_mq07a_functions.pex b/scripts/_00e_mq07a_functions.pex index 6f58d094..13fe5ea1 100644 Binary files a/scripts/_00e_mq07a_functions.pex and b/scripts/_00e_mq07a_functions.pex differ diff --git a/scripts/_00e_mq11a_functions.pex b/scripts/_00e_mq11a_functions.pex index 69d690aa..a4612119 100644 Binary files a/scripts/_00e_mq11a_functions.pex and b/scripts/_00e_mq11a_functions.pex differ diff --git a/scripts/_00e_mq11a_playeraliasscript.pex b/scripts/_00e_mq11a_playeraliasscript.pex index debd620c..ae822def 100644 Binary files a/scripts/_00e_mq11a_playeraliasscript.pex and b/scripts/_00e_mq11a_playeraliasscript.pex differ diff --git a/scripts/_00e_mq13c_functions.pex b/scripts/_00e_mq13c_functions.pex index edc2a509..3fa1668e 100644 Binary files a/scripts/_00e_mq13c_functions.pex and b/scripts/_00e_mq13c_functions.pex differ diff --git a/source/scripts/_00E_SoundControl.psc b/source/scripts/_00E_SoundControl.psc index fb9f61a4..e5d5f871 100644 --- a/source/scripts/_00E_SoundControl.psc +++ b/source/scripts/_00E_SoundControl.psc @@ -17,10 +17,10 @@ EndFunction Function RemoveCombatSoundtracks() + int nItems = _00E_MUS_AllCombatSoundtracks.GetSize() Int iIndex = 0 - Form[] tracks = _00E_MUS_AllCombatSoundtracks.ToArray() - While iIndex < tracks.Length - (tracks[iIndex] as MusicType).Remove() + While iIndex < nItems + (_00E_MUS_AllCombatSoundtracks.GetAt(iIndex) as MusicType).Remove() iIndex += 1 EndWhile diff --git a/source/scripts/_00E_VisionControl.psc b/source/scripts/_00E_VisionControl.psc index abac02f6..5ac3d2a4 100644 --- a/source/scripts/_00E_VisionControl.psc +++ b/source/scripts/_00E_VisionControl.psc @@ -119,9 +119,9 @@ Function VisionEffectNoTimestop(Formlist RefsInvolved, Formlist ActorsToFreeze = if RefsInvolved != None Int iIndex = 0 - Form[] actors = RefsInvolved.ToArray() - While iIndex < actors.Length - Actor VisionREF = actors[iIndex] as Actor + int nItems = RefsInvolved.GetSize() + While iIndex < nItems + Actor VisionREF = RefsInvolved.GetAt(iIndex) as Actor if VisionREF.IsDisabled() VisionREF.EnableNoWait() EndIf @@ -165,10 +165,10 @@ Function VisionEffectNoTimestopStop(Formlist RefsInvolved, Formlist ActorsToFree EndIf if RefsInvolved != None + int nItems = RefsInvolved.GetSize() Int iIndex = 0 - Form[] actors = RefsInvolved.ToArray() - While iIndex < actors.Length - Actor VisionREF = actors[iIndex] as Actor + While iIndex < nItems + Actor VisionREF = RefsInvolved.GetAt(iIndex) as Actor MS04MemoryFXBody01VFX.Stop(VisionREF) VisionRef.SetAlpha(1) iIndex += 1 diff --git a/source/scripts/_00e_armorsetscript.psc b/source/scripts/_00e_armorsetscript.psc index 5945b28d..c20b88e1 100644 --- a/source/scripts/_00e_armorsetscript.psc +++ b/source/scripts/_00e_armorsetscript.psc @@ -26,7 +26,7 @@ Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldCo If akNewContainer == PlayerREF ; Take All, no need to check for equipped items - If UI.IsMenuOpen("ContainerMenu") == False + If SKSE.GetVersion() > 0 && UI.IsMenuOpen("ContainerMenu") == False return EndIf @@ -43,9 +43,31 @@ EndEvent Function UpdateSpells() - Int iIndex = 0 + bool bSKSE = (SKSE.GetVersion() > 0) + + Int iIndex Int nEquippedPieces = 0 - Form[] setPieces = __Config_SetList.ToArray() + Form[] setPieces + + if bSKSE + setPieces = __Config_SetList.ToArray() + else + int nPieces = __Config_SetList.GetSize() + if nPieces == 4 + setPieces = new Form[4] + elseif nPieces == 5 + setPieces = new Form[5] + else + setPieces = new Form[6] + endif + iIndex = 0 + while iIndex < nPieces + setPieces[iIndex] = __Config_SetList.GetAt(iIndex) + iIndex += 1 + endwhile + endif + + iIndex = 0 While iIndex < setPieces.Length If PlayerREF.IsEquipped(setPieces[iIndex] as Armor) nEquippedPieces += 1 @@ -59,8 +81,26 @@ Function UpdateSpells() Int nBonusSpells = nEquippedPieces - 1 Bool bSpellRemoved = False Bool bSpellAdded = False - - Form[] bonusSpells = __Config_SetBonusesList.ToArray() + Form[] bonusSpells + + if bSKSE + bonusSpells = __Config_SetBonusesList.ToArray() + else + int nSpells = __Config_SetBonusesList.GetSize() + if nSpells == 4 + bonusSpells = new Form[4] + elseif nSpells == 5 + bonusSpells = new Form[5] + else + bonusSpells = new Form[6] + endif + iIndex = 0 + while iIndex < nSpells + bonusSpells[iIndex] = __Config_SetBonusesList.GetAt(iIndex) + iIndex += 1 + endwhile + endif + iIndex = 0 While iIndex < bonusSpells.Length Spell bonusSpell = bonusSpells[iIndex] as Spell diff --git a/source/scripts/_00e_func_getpointsinclass.psc b/source/scripts/_00e_func_getpointsinclass.psc index eeba650c..48989e36 100644 --- a/source/scripts/_00e_func_getpointsinclass.psc +++ b/source/scripts/_00e_func_getpointsinclass.psc @@ -3,12 +3,12 @@ Scriptname _00E_Func_GetPointsInClass Hidden int Function Run(Formlist akClassPerkformlist) Global Actor PlayerREF = Game.GetForm(0x14) as Actor - Form[] perkForms = akClassPerkformlist.ToArray() int PointsSpentInClass int iClassIndex = 0 - While iClassIndex < perkForms.Length - Perk iPerk = perkForms[iClassIndex] as Perk + int nItems = akClassPerkformlist.GetSize() + While iClassIndex < nItems + Perk iPerk = akClassPerkformlist.GetAt(iClassIndex) as Perk If iPerk && PlayerREF.HasPerk(iPerk) PointsSpentInClass += 1 EndIf diff --git a/source/scripts/_00e_game_talentcooldownsc.psc b/source/scripts/_00e_game_talentcooldownsc.psc index 20068f20..7f9270b5 100644 --- a/source/scripts/_00e_game_talentcooldownsc.psc +++ b/source/scripts/_00e_game_talentcooldownsc.psc @@ -20,6 +20,10 @@ Float Property IdleUpdatePeriod = 30.0 AutoReadOnly Event OnEffectStart(Actor akTarget, Actor akCaster) + if SKSE.GetVersion() == 0 + return + endif + LockEquipUpdates() CooldownShouts = New Shout[128] diff --git a/source/scripts/_00e_mq06_functions.psc b/source/scripts/_00e_mq06_functions.psc index 559e5cd9..7de0c06e 100644 --- a/source/scripts/_00e_mq06_functions.psc +++ b/source/scripts/_00e_mq06_functions.psc @@ -431,10 +431,10 @@ Function StartCer() MQ06_SC05_JorekBench.SetFactionOwner(MQ06_SC05_JorekBenchFaction) - Form[] idleMarkers = MQ06_SC05_IdleMarkerList.ToArray() + int nItems = MQ06_SC05_IdleMarkerList.GetSize() Int iIndex = 0 - While iIndex < idleMarkers.Length - (idleMarkers[iIndex] as ObjectReference).Disable() + While iIndex < nItems + (MQ06_SC05_IdleMarkerList.GetAt(iIndex) as ObjectReference).Disable() iIndex += 1 EndWhile @@ -508,11 +508,11 @@ EndFunction Function FillSpectators() - Form[] spectators = MQ06_SC05_RitualList.ToArray() + int nItems = MQ06_SC05_RitualList.GetSize() Int iIndex = 0 - While iIndex < spectators.Length - Actor akSpectator = (spectators[iIndex] as Actor) - If akSpectator.IsDead() == False + While iIndex < nItems + Actor akSpectator = (MQ06_SC05_RitualList.GetAt(iIndex) as Actor) + If ! akSpectator.IsDead() akSpectator.MoveTo(CaliaRitualMarker) SC05_SpectatorArray[iIndex].ForceRefTo(akSpectator) EndIf @@ -542,10 +542,10 @@ Function UnfillSpectators() MQ06_SC05_JorekBench.SetFactionOwner(None) - Form[] idleMarkers = MQ06_SC05_IdleMarkerList.ToArray() + int nItems = MQ06_SC05_IdleMarkerList.GetSize() iIndex = 0 - While iIndex < idleMarkers.Length - (idleMarkers[iIndex] as ObjectReference).Enable() + While iIndex < nItems + (MQ06_SC05_IdleMarkerList.GetAt(iIndex) as ObjectReference).Enable() iIndex += 1 EndWhile diff --git a/source/scripts/_00e_mq07a_functions.psc b/source/scripts/_00e_mq07a_functions.psc index 8f5cfba3..bd131292 100644 --- a/source/scripts/_00e_mq07a_functions.psc +++ b/source/scripts/_00e_mq07a_functions.psc @@ -477,14 +477,14 @@ EndFunction Function EnableEnemiesInFormlist(Formlist formlistToProcess, GlobalVariable counterGlobal) Int Index - Form[] enemies = formlistToProcess.ToArray() + int nItems = formlistToProcess.GetSize() - counterGlobal.SetValueInt(enemies.Length) + counterGlobal.SetValueInt(nItems) bDoneBattleFailsave = True Index = 0 - While Index < enemies.Length - Actor enemyRef = (enemies[Index] as Actor) + While Index < nItems + Actor enemyRef = (formlistToProcess.GetAt(Index) as Actor) enemyRef.Enable() enemyRef.SetAlpha(0.0) Index += 1 @@ -494,7 +494,7 @@ Function EnableEnemiesInFormlist(Formlist formlistToProcess, GlobalVariable coun Utility.Wait(1) - MQ07a_EnemiesLeft.SetValueInt(enemies.Length) + MQ07a_EnemiesLeft.SetValueInt(nItems) UpdateCurrentInstanceGlobal(MQ07a_EnemiesLeft) If MQ07a_CurrentWave.GetValueInt() == 1 @@ -768,11 +768,11 @@ Function EnableSigilStone() MQ07a_SC14_SigilstoneFX.EnableNoWait() MQ07a_SC14_SigilStoneLight2.EnableNoWait() - Form[] refsToDisable = MQ07a_SC14_FurnitureToDisable.ToArray() ActorBase dummyOwner = PlayerREF.GetActorBase() + int nItems = MQ07a_SC14_FurnitureToDisable.GetSize() Int Index = 0 - While Index < refsToDisable.Length - (refsToDisable[Index] as ObjectReference).SetActorOwner(dummyOwner) + While Index < nItems + (MQ07a_SC14_FurnitureToDisable.GetAt(Index) as ObjectReference).SetActorOwner(dummyOwner) Index += 1 EndWhile @@ -813,10 +813,10 @@ EndFunction Function EndSC14() - Form[] refsToDisable = MQ07a_SC14_FurnitureToDisable.ToArray() + int nItems = MQ07a_SC14_FurnitureToDisable.GetSize() Int Index = 0 - While Index < refsToDisable.Length - (refsToDisable[Index] as ObjectReference).SetActorOwner(None) + While Index < nItems + (MQ07a_SC14_FurnitureToDisable.GetAt(Index) as ObjectReference).SetActorOwner(None) Index += 1 EndWhile diff --git a/source/scripts/_00e_mq11a_functions.psc b/source/scripts/_00e_mq11a_functions.psc index 3e189ffd..9a15cb7b 100644 --- a/source/scripts/_00e_mq11a_functions.psc +++ b/source/scripts/_00e_mq11a_functions.psc @@ -191,12 +191,11 @@ EndFunction Function DisableWolfPack() ; Disable Wolf pack if still alive, to make sure they don't interrupt the scene - Form[] wolfRefs = MQ11a_SC6_WolfPackGates.ToArray() - Int iIndex = wolfRefs.Length + Int iIndex = MQ11a_SC6_WolfPackGates.GetSize() While iIndex > 0 iIndex -= 1 - Actor WolfToDisable = wolfRefs[iIndex] as Actor - If WolfToDisable.IsDead() == False + Actor WolfToDisable = MQ11a_SC6_WolfPackGates.GetAt(iIndex) as Actor + If ! WolfToDisable.IsDead() WolfToDisable.DisableNoWait() EndIf EndWhile @@ -1620,10 +1619,10 @@ Function StartTrackingFight(Int fightId, Int postFightQuestStage, FormList enemy EndFunction Function RaiseDeadServants(Formlist corpseList, ObjectReference corpseActivatorRef) - Form[] corpses = corpseList.ToArray() + int nItems = corpseList.GetSize() Int Index = 0 - While Index < corpses.Length - (corpses[Index] as ObjectReference).Activate(corpseActivatorRef) + While Index < nItems + (corpseList.GetAt(Index) as ObjectReference).Activate(corpseActivatorRef) index += 1 EndWhile EndFunction @@ -1652,18 +1651,18 @@ Function RegisterFightEnd(Int fightId, Int postFightQuestStage) EndFunction Function GiveKeyToEnemies(FormList enemyList, Key keyToGive) - Form[] enemies = enemyList.ToArray() + int nItems = enemyList.GetSize() Int Index Index = 0 - While Index < enemies.Length - (enemies[Index] as ObjectReference).AddItem(keyToGive) + While Index < nItems + (enemyList.GetAt(Index) as ObjectReference).AddItem(keyToGive) Index += 1 EndWhile Index = 0 - While Index < enemies.Length - _00E_Questshader.Play(enemies[Index] as ObjectReference) + While Index < nItems + _00E_Questshader.Play(enemyList.GetAt(Index) as ObjectReference) Index += 1 EndWhile EndFunction diff --git a/source/scripts/_00e_mq11a_playeraliasscript.psc b/source/scripts/_00e_mq11a_playeraliasscript.psc index 14a1490b..4ebf91c8 100644 --- a/source/scripts/_00e_mq11a_playeraliasscript.psc +++ b/source/scripts/_00e_mq11a_playeraliasscript.psc @@ -42,11 +42,11 @@ Function PostFightCleanup() If EnemyList ; Kill'em all as a safeguard! - Form[] enemies = EnemyList.ToArray() + int nItems = EnemyList.GetSize() Int Index = 0 - While Index < enemies.Length - Actor enemyRef = (enemies[Index] as Actor) - If enemyRef.IsDead() == False + While Index < nItems + Actor enemyRef = (EnemyList.GetAt(Index) as Actor) + If ! enemyRef.IsDead() enemyRef.Kill(enemyRef) ; "Suicide" -> no XP for the player, hehe EndIf Index += 1 @@ -57,10 +57,10 @@ Function PostFightCleanup() EndFunction Bool Function CheckEnemiesAreDead() - Form[] enemies = EnemyList.ToArray() + int nItems = EnemyList.GetSize() Int Index = 0 - While Index < enemies.Length - If (enemies[Index] as Actor).IsDead() == False + While Index < nItems + If (EnemyList.GetAt(Index) as Actor).IsDead() == False Return False EndIf Index += 1 diff --git a/source/scripts/_00e_mq13c_functions.psc b/source/scripts/_00e_mq13c_functions.psc index 8c2c6fe7..09442938 100644 --- a/source/scripts/_00e_mq13c_functions.psc +++ b/source/scripts/_00e_mq13c_functions.psc @@ -255,10 +255,10 @@ Function EnterCombat() MQ13c_SC04_SpiderParent.Enable() ; Activate all spiders to get them released into the room - Form[] enemies = MQ13c_Nexushall_Spiders.ToArray() + int nItems = MQ13c_Nexushall_Spiders.GetSize() Int index = 0 - While index < enemies.Length - Actor enemy = enemies[index] as Actor + While index < nItems + Actor enemy = MQ13c_Nexushall_Spiders.GetAt(index) as Actor if enemy != MQ13c_SC04_CenturionREF enemy.Activate(akCompanionRomance) EndIf