Scripts

TR_m7_Ns_IC8_rock_sc

TR_Mainland.esm
Variables 16
Local Variables
reset
initialized
control
control2
starttimer
timer
timer2
swingTime
startAngle
startHeight
currangle
yvalue
zvalue
zoffset
tmpoffset
weightoffset
Source
1Begin TR_m7_Ns_IC8_rock_sc 2 3;Controls effects for miracle "cutscene" 4 5float starttimer 6float timer 7float timer2 8float swingTime 9float startAngle 10float startHeight 11float currangle 12float yvalue 13float zvalue 14float zoffset 15float tmpoffset 16float weightoffset 17 18short reset 19short initialized 20short control 21short control2 22 23if ( GetJournalIndex TR_m7_Ns_IC8 >= 30 ) 24 Return 25endif 26 27if ( GetDisabled == 1 ) 28 if ( GetJournalIndex TR_m7_Ns_IC8 >= 10 ) 29 Enable 30 else 31 Return 32 endif 33endif 34 35if ( GetJournalIndex TR_m7_Ns_IC8 < 10 ) 36 Disable 37endif 38 39;Prevent player from picking up rock again once placed on altar 40if ( control >= 1 ) 41 if ( OnActivate ) 42 Return 43 endif 44endif 45 46;Skip to end of cutscene if player leaves and re-enters cell 47if ( CellChanged == 1 ) 48 if ( control >= 1 ) 49 TR_m7_q_Ns_IC8_gem1->SetPos Z 12466.608 50 TR_m7_q_Ns_IC8_gem2->SetPos Z 12466.689 51 TR_m7_q_Ns_IC8_gem3->SetPos Z 12466.689 52 TR_m7_q_Ns_IC8_gem4->SetPos Z 12466.690 53 TR_m7_q_Ns_IC8_gem5->SetPos Z 12466.692 54 TR_m7_q_Ns_IC8_gem6->SetPos Z 12466.732 55 TR_m7_q_Ns_IC8_gem7->SetPos Z 12467.566 56 TR_m7_q_Ns_IC8_gem8->SetPos Z 12466.692 57 TR_m7_q_Ns_IC8_gem9->SetPos Z 12465.641 58 Journal TR_m7_Ns_IC8 30 59 set control to 3 60 Disable 61 endif 62endif 63 64;Slight delay between rock being placed and start of floating 65if ( control == 1 ) 66 if ( starttimer < 2 ) 67 if ( MenuMode == 0 ) 68 set starttimer to ( starttimer + GetSecondsPassed ) 69 endif 70 Return 71 endif 72endif 73 74;Moves to next stage of cutscene when rock floats high enough 75if ( control == 1 ) 76 if ( GetPos Z > 12515 ) 77 set control to 2 78 endif 79endif 80 81;Mostly copied from typical floating object script 82if ( control >= 1 ) 83 if ( initialized == 0 ) 84 set startAngle to GetAngle, Y 85 set startHeight to GetPos, Z 86 set swingTime to 1 87 set initialized to 1 88 set tmpoffset to startHeight 89 endif 90 91 if ( MenuMode == 0 ) 92 93 if ( timer == 0 ) 94 if ( reset == 0 ) 95 set timer to Random 100 96 set timer to timer / 4 97 endif 98 endif 99 100 set timer to ( timer + GetSecondsPassed ) 101 set currangle to GetAngle Y 102 set yvalue to 20 * GetSecondsPassed 103 104 ;rotate up 105 if ( timer < swingTime ) 106 set currangle to currangle + yvalue 107 SetAngle Y currangle 108 ;rotate down 109 elseif ( timer < (swingTime * 3) ) 110 set currangle to currangle - yvalue 111 SetAngle Y currangle 112 ;up again 113 elseif ( timer < (swingTime * 4 ) ) 114 set currangle to currangle + yvalue 115 SetAngle Y currangle 116 ;reset timer to zero 117 else 118 set timer to 0 119 set reset to 1 120 SetAngle, Y, startangle 121 endif 122 123 set tmpoffset to tmpoffset + GetSecondsPassed * 7 124 SetPos Z tmpoffset 125 endif 126endif 127 128;Gemstones are hidden inside altar mesh 129;Will move to top of altar, one at a time 130;GhostDeathFX for shiny lights, starts slightly early to match timing of spell effects 131;Could potentially disable gems before this quest stage, but there shouldn't be any way for player to see them 132if ( MenuMode == 0 ) 133 if ( control == 2 ) 134 if ( timer2 > 1 ) 135 if ( control2 == 0 ) 136 PlaceItemCell T_Glb_Var_GhostDeathFX2 "Narsis, Chapel of Zenithar" 9671.120 6255.221 12455.0 0 137 set control2 to 1 138 endif 139 endif 140 141 if ( timer2 > 1.5 ) 142 if ( control2 == 1 ) 143 TR_m7_q_Ns_IC8_gem1->ExplodeSpell TR_m7_q_Ns_IC8_FinaleSFX 144 TR_m7_q_Ns_IC8_gem1->SetPos Z 12466.608 145 set control2 to 2 146 endif 147 endif 148 149 if ( timer2 > 3 ) 150 if ( control2 == 2 ) 151 PlaceItemCell T_Glb_Var_GhostDeathFX2 "Narsis, Chapel of Zenithar" 9708.690 6190.418 12455.0 0 152 set control2 to 3 153 endif 154 endif 155 156 if ( timer2 > 3.5 ) 157 if ( control2 == 3 ) 158 TR_m7_q_Ns_IC8_gem2->ExplodeSpell TR_m7_q_Ns_IC8_FinaleSFX 159 TR_m7_q_Ns_IC8_gem2->SetPos Z 12466.689 160 set control2 to 4 161 endif 162 endif 163 164 if ( timer2 > 5 ) 165 if ( control2 == 4 ) 166 PlaceItemCell T_Glb_Var_GhostDeathFX2 "Narsis, Chapel of Zenithar" 9693.892 6118.798 12455.0 0 167 set control2 to 5 168 endif 169 endif 170 171 if ( timer2 > 5.5 ) 172 if ( control2 == 5 ) 173 TR_m7_q_Ns_IC8_gem3->ExplodeSpell TR_m7_q_Ns_IC8_FinaleSFX 174 TR_m7_q_Ns_IC8_gem3->SetPos Z 12466.689 175 set control2 to 6 176 endif 177 endif 178 179 if ( timer2 > 7 ) 180 if ( control2 == 6 ) 181 PlaceItemCell T_Glb_Var_GhostDeathFX2 "Narsis, Chapel of Zenithar" 9638.975 6073.954 12455.0 0 182 set control2 to 7 183 endif 184 endif 185 186 if ( timer2 > 7.5 ) 187 if ( control2 == 7 ) 188 TR_m7_q_Ns_IC8_gem4->ExplodeSpell TR_m7_q_Ns_IC8_FinaleSFX 189 TR_m7_q_Ns_IC8_gem4->SetPos Z 12466.690 190 set control2 to 8 191 endif 192 endif 193 194 if ( timer2 > 9 ) 195 if ( control2 == 8 ) 196 PlaceItemCell T_Glb_Var_GhostDeathFX2 "Narsis, Chapel of Zenithar" 9565.795 6071.186 12455.0 0 197 set control2 to 9 198 endif 199 endif 200 201 if ( timer2 > 9.5 ) 202 if ( control2 == 9 ) 203 TR_m7_q_Ns_IC8_gem5->ExplodeSpell TR_m7_q_Ns_IC8_FinaleSFX 204 TR_m7_q_Ns_IC8_gem5->SetPos Z 12466.692 205 set control2 to 10 206 endif 207 endif 208 209 if ( timer2 > 11 ) 210 if ( control2 == 10 ) 211 PlaceItemCell T_Glb_Var_GhostDeathFX2 "Narsis, Chapel of Zenithar" 9507.844 6118.732 12455.0 0 212 set control2 to 11 213 endif 214 endif 215 216 if ( timer2 > 11.5 ) 217 if ( control2 == 11 ) 218 TR_m7_q_Ns_IC8_gem6->ExplodeSpell TR_m7_q_Ns_IC8_FinaleSFX 219 TR_m7_q_Ns_IC8_gem6->SetPos Z 12466.732 220 set control2 to 12 221 endif 222 endif 223 224 if ( timer2 > 13 ) 225 if ( control2 == 12 ) 226 PlaceItemCell T_Glb_Var_GhostDeathFX2 "Narsis, Chapel of Zenithar" 9495.115 6188.234 12455.0 0 227 set control2 to 13 228 endif 229 endif 230 231 if ( timer2 > 13.5 ) 232 if ( control2 == 13 ) 233 TR_m7_q_Ns_IC8_gem7->ExplodeSpell TR_m7_q_Ns_IC8_FinaleSFX 234 TR_m7_q_Ns_IC8_gem7->SetPos Z 12467.566 235 set control2 to 14 236 endif 237 endif 238 239 if ( timer2 > 15 ) 240 if ( control2 == 14 ) 241 PlaceItemCell T_Glb_Var_GhostDeathFX2 "Narsis, Chapel of Zenithar" 9529.350 6251.792 12455.0 0 242 set control2 to 15 243 endif 244 endif 245 246 if ( timer2 > 15.5 ) 247 if ( control2 == 15 ) 248 TR_m7_q_Ns_IC8_gem8->ExplodeSpell TR_m7_q_Ns_IC8_FinaleSFX 249 TR_m7_q_Ns_IC8_gem8->SetPos Z 12466.692 250 set control2 to 16 251 endif 252 endif 253 254 if ( timer2 > 17 ) 255 if ( control2 == 16 ) 256 PlaceItemCell T_Glb_Var_GhostDeathFX2 "Narsis, Chapel of Zenithar" 9602.630 6274.086 12455.0 0 257 set control2 to 17 258 endif 259 endif 260 261 if ( timer2 > 17.5 ) 262 if ( control2 == 17 ) 263 TR_m7_q_Ns_IC8_gem9->ExplodeSpell TR_m7_q_Ns_IC8_FinaleSFX 264 TR_m7_q_Ns_IC8_gem9->SetPos Z 12465.641 265 set control2 to 18 266 endif 267 endif 268 269 if ( timer2 > 19 ) 270 ExplodeSpell TR_m7_q_Ns_IC8_FinaleSFX 271 set control to 3 272 Journal TR_m7_Ns_IC8 30 273 Disable 274 endif 275 276 set timer2 to ( timer2 + GetSecondsPassed ) 277 endif 278endif 279 280if ( control >= 1 ) 281 return 282endif 283 284;Cutscene will begin only if player puts rock on altar 285if ( GetJournalIndex TR_m7_Ns_IC8 == 20 ) 286 if ( GetPCCell "Narsis, Chapel of Zenithar" == 1 ) 287 if ( player->GetItemCount TR_m7_q_Ns_IC8_strangeRock == 0 ) 288 if ( GetPos Z > 12445 ) 289 if ( GetPos X > 9480 ) 290 if ( GetPos X < 9720 ) 291 if ( GetPos Y > 5995 ) 292 if ( GetPos Y < 6230 ) 293 set control to 1 294 endif 295 endif 296 endif 297 endif 298 endif 299 endif 300 endif 301endif 302 303End