Scriptname TMSpawnManageScript extends ObjectReference quest property myquest Auto int property mystage Auto objectReference[] property fights Auto MusicType Property music Auto ObjectReference Property Entrance Auto ObjectReference Property Exit Auto float property sneakScale Autobool active float maxDfloat dNormalfloat dSmallfloat dLargefloat dVLargeEvent OnActivate(ObjectReference akActionRef) if(!active) active = true start() int i = 0 while(i < fights.length) fights[i].activate(self) i += 1 endWhile self.registerforsingleupdate(0.5) endIfendEventevent onUpdate() bool notDone int i = 0 while(i < fights.length) if(!fights[i].isdisabled()) notDone = true endIf i += 1 endWhile if(!notDone) end() else self.registerforsingleupdate(0.5) endIfendEventfunction start() ;close the entrance if(entrance != none) entrance.activate(self) endIf ;start the music if(music != none) music.add() endIf changeToCombatSettings()endFunctionfunction end() active = false changeToNormalSettings() ;stop the music if(music != none) music.remove() endIf ;Update any associated quest if(myQuest != none) myQuest.setstage(myStage) endIf ;open the entrance if(entrance != none) entrance.activate(self) endIf ;open the exit if(exit != none) exit.activate(self) endIf ;disable this object self.disablenowait(false) endFunctionfunction onLoad() if(active) changetoCombatSettings() endIfendFunctionfunction changeToCombatSettings() DSmall = Game.getGameSettingFloat("fSneakDetectionSizeSmall") DLarge = Game.getGameSettingFloat("fSneakDetectionSizeLarge") DVLarge = Game.getGameSettingFloat("fSneakDetectionSizeVeryLarge") DNormal = Game.GetGameSettingFloat("fSneakDetectionSizeNormal") MaxD = Game.getGameSettingFloat("fSneakMaxdistance") Game.setGameSettingFloat("fSneakDetectionSizeNormal" , 1 + sneakScale) Game.setGameSettingFloat("fSneakDetectionSizeSmall" , 0.5 + sneakScale) Game.setGameSettingFloat("fSneakDetectionSizeLarge" , 1.5 + sneakScale) Game.setGameSettingFloat("fSneakDetectionSizeVeryLarge" , 2 + sneakScale) Game.setGameSettingFloat("fSneakMaxdistance" , 40000.0)endFunctionfunction changeToNormalSettings() if(DNormal != 1 + sneakScale) Game.setGameSettingFloat("fSneakDetectionSizeNormal" , DNormal) else Game.setGameSettingFloat("fSneakDetectionSizeNormal" , 1) endIf if(DSmall != 0.5 + sneakScale) Game.setGameSettingFloat("fSneakDetectionSizeSmall" , DSmall) else Game.setGameSettingFloat("fSneakDetectionSizeSmall" , 0.5) endIf if(DLarge != 1.5 + sneakScale) Game.setGameSettingFloat("fSneakDetectionSizeLarge" , DLarge) else Game.setGameSettingFloat("fSneakDetectionSizeLarge" , 1.5) endIf if(DVLarge != 2 + sneakScale) Game.setGameSettingFloat("fSneakDetectionSizeVeryLarge" , DVLarge) else Game.setGameSettingFloat("fSneakDetectionSizeVeryLarge" , 2) endIf if(MaxD != 40000) Game.setGameSettingFloat("fSneakMaxdistance" , MaxD) else Game.setGameSettingFloat("fSneakMaxdistance" , 2500) endIfendFunction