Scripts

TR_m4_TT_Ravur_Othravel_sc

TR_Mainland.esm
Variables 23
Local Variables
TR_Map
control
controlQ
NoLore
T_Local_NPC
T_Local_NoLore
hiddenWeapon
trackPlayerMorals
trackUlmon
trackOrc
trackOrcBooks
trackAshlands
trackGreedTholas
trackGreedMels
trackGreedZalan
trackGreedMilns
trackDay
noAttack
trackProof
ThankIbelard
timer
playerX
playerY
Source
1Begin TR_m4_TT_Ravur_Othravel_sc 2 3; Script on NPC TR_m4_TT_Ravur_Othravel for Bal Foyen Temple questline. 4 5short TR_Map 6short control 7short controlQ 8short NoLore 9short T_Local_NPC 10short T_Local_NoLore 11float timer 12short hiddenWeapon 13short trackPlayerMorals 14short trackUlmon 15short trackOrc 16short trackOrcBooks 17short trackAshlands 18short trackGreedTholas 19short trackGreedMels 20short trackGreedZalan 21short trackGreedMilns 22short trackDay 23float playerX 24float playerY 25short noAttack 26short trackProof 27short ThankIbelard ; for "Remnants of Resdayn" 28 29if ( controlQ == 0 ) 30 if ( GetDistance player < 300 ) 31 set controlQ to 1 32 if ( PCRace == 1 ) 33 Say "vo\d\f\Hlo_DF202.mp3" "Three blessings to you, Argonian." 34 elseif ( PCRace == 2 ) 35 Say "vo\d\f\Hlo_DF203.mp3" "Three blessings to you, Breton." 36 elseif ( PCRace == 4 ) 37 Say "vo\d\f\Hlo_DF201.mp3" "Three blessings to you, Altmer." 38 elseif ( PCRace == 5 ) 39 Say "vo\d\f\Hlo_DF200.mp3" "Three blessings to you, Cyrodil." 40 elseif ( PCRace == 6 ) 41 Say "vo\d\f\Hlo_DF199.mp3" "Three blessings to you, Khajiit." 42 elseif ( PCRace == 7 ) 43 Say "vo\d\f\Hlo_DF198.mp3" "Three blessings to you, Nord." 44 elseif ( PCRace == 8 ) 45 Say "vo\d\f\Hlo_DF197.mp3" "Three blessings to you, Orc." 46 elseif ( PCRace == 9 ) 47 Say "vo\d\f\Hlo_DF196.mp3" "Three blessings to you, Redguard." 48 elseif ( PCRace == 10 ) 49 Say "vo\d\f\Hlo_DF204.mp3" "Three blessings to you, Bosmer." 50 else 51 Say "vo\d\f\Hlo_DF205.mp3" "A warm welcome to you, sera." 52 endif 53 set playerX to ( player->GetPos X ) 54 set playerY to ( player->GetPos Y ) 55 Face playerX playerY 56 endif 57elseif ( controlQ == 2 ) 58 ; Ravur teleports back to the Temple. This is called several times in the 59 ; questline (first after the Kitchen Supplies quest). 60 if ( MenuMode == 0 ) 61 set timer to ( timer + GetSecondsPassed ) 62 if ( timer > 1.2 ) 63 set controlQ to 3 64 PlaceAtMe T_Glb_Var_SummonFX 1 0 0 65 Return 66 endif 67 endif 68elseif ( controlQ == 3 ) 69 if ( MenuMode == 0 ) 70 set timer to ( timer + GetSecondsPassed ) 71 if ( timer > 2 ) 72; if ( GetJournalIndex TR_m4_TT_LastWillAndTestament > 0 ) 73; set controlQ to 25 74; PositionCell 2322 -132134 453 8520 "Bal Foyen" 75; AIWander 0, 0, 5, 30, 0, 10, 0, 0, 0, 25, 0, 35 76; set timer to 0 77; Return 78 79 if ( GetJournalIndex TR_m4_TT_AndothrenCharity > 0 ) 80 set controlQ to 18 81 else 82 set controlQ to 4 83 endif 84 PositionCell 3940 4349 14753 15000 "Bal Foyen, Temple" 85 AIWander 0, 0, 5, 0, 40, 0, 10, 0, 5, 5, 25, 5 86 set timer to 0 87 Return 88 endif 89 endif 90;elseif ( controlQ == 5 ) 91; set controlQ to 6 92;elseif ( controlQ == 6 ) 93; set controlQ to 7 ; back and forth because somehow her Hello / PC head tracking was broken before. 94; Enable 95elseif ( controlQ == 12 ) 96 ; Player has been sent out to harrass nobles with potions. 97 if ( GetJournalIndex TR_m4_TT_TroublesomeOrc != 100 ) 98 if ( player->GetPos Z < 14800 ) 99 set controlQ to 13 100 endif 101 else 102 set controlQ to 14 103 endif 104elseif ( controlQ == 13 ) 105 if ( GetDistance player < 600 ) 106 set controlQ to 15 107 AIFollow player 0 0 0 0 108 endif 109elseif ( controlQ == 14 ) 110; if ( GetDistance player < 1000 ) 111; set controlQ to 15 112; ForceRun 113; AITravel 2763 -132844 465 0 114; endif 115 if ( GetDistance player < 1000 ) 116 set controlQ to 16 117 ForceGreeting 118 endif 119elseif ( controlQ == 15 ) 120 if ( GetDistance player < 300 ) 121 set controlQ to 16 122 ForceGreeting 123 endif 124elseif ( controlQ == 18 ) 125 ; Ravur follows the player to the nobles. 126 ; primary following stage, make sure she stays in Bal Foyen and doesn't drown. 127 if ( control >= 1 ) ; if following 128 if ( GetPCCell "Bal Foyen" != 1 ) 129 set controlQ to 19 130 endif 131 if ( GetInterior == 0 ) 132 if ( GetPCCell "Bal Foyen, Temple" == 0 ) 133 if ( GetDistance player > 2000 ) 134 set controlQ to 19 135 elseif ( GetPos Z < 0 ) 136 set controlQ to 19 137 endif 138 endif 139 endif 140 if ( control == 1 ) 141 if ( GetDistance player > 1000 ) 142 Say "Vo\d\F\Flw_DF004.mp3" "Hey! Wait for me!" 143 set timer to 0 144 set control to 2 145 endif 146 elseif ( control == 2 ) 147 if ( GetDistance Player < 500 ) 148 set timer to ( timer + GetSecondsPassed ) 149 if ( timer > 3 ) 150 set control to 1 151 endif 152 endif 153 endif 154 if ( GetPCCell "Bal Foyen, Andas Estate" == 1 ) 155 set control to 0 156 set timer to 0 157 PositionCell 3940 4349 14753 15000 "Bal Foyen, Temple" 158 AIWander 0, 0, 5, 0, 40, 0, 10, 0, 5, 5, 25, 5 159 endif 160 if ( GetPCCell "Bal Foyen, The Dancing Cup" == 1 ) ; don't yell at the commoner if player decides to beat him up and don't gang up on him 161 if ( noAttack != 0 ) 162 set noAttack to 0 163 SetFight 0 164 SetFlee 1000 165 endif 166 elseif ( noAttack == 0 ) 167 set noAttack to -1 168 SetFight 30 169 SetFlee 0 170 endif 171 else 172 if ( control == -1 ) 173 ; mels mathyn conversation 174 if ( CellChanged ) 175 set TR_m4_Mels_Mathyn.controlQ to 1 176 set trackGreedMels to 1 177 PositionCell 4282 4333 13640 10800 "Bal Foyen, Mathyn Manor" 178 set control to 0 179 endif 180 endif 181 endif 182elseif ( controlQ == 19 ) 183 if ( MenuMode == 0 ) 184 ; back to the Temple I go 185 ExplodeSpell "almsivi intervention" 186 set controlQ to 2 187 set control to 0 188 set timer to 0 189 endif 190elseif ( controlQ == 21 ) 191 ; Ralvs has escorted the player to the tomb (start of quest TR_m4_TT_LastWillAndTestament). 192 set controlQ to 22 193 AITravel 4218 5092 13970 194elseif ( controlQ == 22 ) 195 if ( GetAIPackageDone ) 196 set controlQ to 23 197 AITravel 4218 5030 13970 198 endif 199 if ( GetJournalIndex TR_m4_TT_LastWillAndTestament == 20 ) 200 if ( GetDistance player < 150 ) 201 set controlQ to 24 202 ForceGreeting 203 endif 204 endif 205elseif ( controlQ == 23 ) 206 if ( GetJournalIndex TR_m4_TT_LastWillAndTestament == 20 ) 207 if ( GetDistance player < 150 ) 208 set controlQ to 24 209 ForceGreeting 210 endif 211 endif 212elseif ( controlQ == 25 ) 213 ; Ravur has dropped the player a message and is running up the stairway. 214 if ( GetAIPackageDone ) 215 ClearForceRun 216 set controlQ to 26 217 SetHello 30 218 endif 219elseif ( controlQ == 26 ) 220 ; Ravur has arrived in the dorm. 221 if ( GetJournalIndex TR_m4_TT_LastWillAndTestament == 30 ) 222 set controlQ to 27 223 set timer to 0 224 endif 225elseif ( controlQ == 27 ) 226 ; 2-minute timer for the player to find proof in Nalvs's office. 227 if ( MenuMode == 0 ) 228 set timer to ( timer + GetSecondsPassed ) 229 endif 230 if ( timer > 120 ) 231 set controlQ to 28 232 endif 233elseif ( controlQ == 29 ) 234 ; Enough of the sleuthing... 235 if ( GetAIPackageDone ) 236 SetHello 30 237 set controlQ to 30 238 endif 239elseif ( controlQ == 31 ) 240 ; Nalvs has fled Bal Foyen. 241 if ( player->GetPos X > 3800 ) 242 set controlQ to 32 243 ForceGreeting 244 endif 245elseif ( controlQ == 34 ) 246 ; Ravur goes to Omaynis. 247 if ( MenuMode ) 248 Return 249 endif 250 set controlQ to 35 251 RemoveItem common_robe_05_a 1 252 AddItem expensive_robe_02 1 253 Equip expensive_robe_02 254 AddItem "indoril boots" 1 255 Equip "indoril boots" 256 AddItem "indoril left gauntlet" 1 257 Equip "indoril left gauntlet" 258 AddItem "indoril right gauntlet" 1 259 Equip "indoril right gauntlet" 260 AddItem "indoril pauldron left" 1 261 Equip "indoril pauldron left" 262 AddItem "indoril pauldron right" 1 263 Equip "indoril pauldron right" 264 set hiddenWeapon to 1 265 AddItem TR_m4_TT_RavurDagger 1 266 equip TR_m4_TT_RavurDagger 267 AITravel 4737 3807 15491 0 268elseif ( controlQ == 35 ) 269 if ( GetDistance player < 100 ) 270 set controlQ to 36 271 AIWander 0, 0, 5, 0, 40, 0, 10, 0, 5, 5, 25, 5 272 elseif ( GetAIPackageDone ) 273 set controlQ to 36 274 AIWander 0, 0, 5, 0, 40, 0, 10, 0, 5, 5, 25, 5 275 endif 276elseif ( controlQ == 37 ) 277 if ( OnDeath ) 278 if ( GetDeadCount TR_m4_TT_Nalvs_Andolin > 0 ) 279 Journal TR_m4_TT_LastWillAndTestament 200 280 else 281 Journal TR_m4_TT_LastWillAndTestament_c 75 282 endif 283 endif 284endif 285 286; auto-update Orc tracker if player didn't talk to her, and Orc visits Bal Foyen 287if ( trackOrc < 10 ) 288 if ( GetJournalIndex TR_m4_TT_TroublesomeOrc == 100 ) 289 if ( GetJournalIndex TR_m4_TT_Forgiveness >= 10 ) 290 ModDisposition 5 291 set trackPlayerMorals to ( trackPlayerMorals + trackOrc ) 292 set trackOrc to 10 ; teaching the Orc 293 endif 294 endif 295endif 296 297; The trackPlayerMorals variable tracks how well the player conducted himself during 298; some ethical decisions (from Ravur's viewpoint). 299; It is fed by auxiliary variables like trackAshlands and trackGreedTholas, which 300; evaluate the player's actions in specific situations. 301; Each of these auxiliary variables has the following semantics: 302; 0: Player has behaved neutrally or not made the decision yet. 303; [1, 9]: Player has done well (the better, the larger the value). 304; [10, infinity): Player has done well, and the variable has already been fed into 305; trackPlayerMorals. 306; [-9, -1]: Player has done badly (the worse, the larger the absolute value). 307; (-infinity, -10]: Player has done badly, and the variable has already been fed into 308; trackPlayerMorals. 309 310; How well did the player do during the Ashlands quest? 311if ( trackAshlands == -3 ) 312 set trackAshlands to -10 313 set trackPlayerMorals to ( trackPlayerMorals - 3 ) 314elseif ( trackAshlands > 0 ) 315 if ( trackAshlands <= 9 ) 316 set trackPlayerMorals to ( trackPlayerMorals + trackAshlands ) 317 set trackAshlands to 10 318 endif 319elseif ( trackAshlands < 0 ) 320 if ( trackAshlands >= -9 ) 321 set trackPlayerMorals to ( trackPlayerMorals + trackAshlands ) 322 set trackAshlands to 0 323 endif 324endif 325 326; How well did the player act around the nobles? 327; if trackGreedTholas is set to a low value, escalate it to trackPlayerMorals and fix it at a higher magnitude 328if ( trackGreedTholas >= 10 ) 329elseif ( trackGreedTholas <= -10 ) 330elseif ( trackGreedTholas ) 331 set trackPlayerMorals to ( trackPlayerMorals + trackGreedTholas ) 332 set trackGreedTholas to ( trackGreedTholas * 10 ) 333endif 334if ( trackGreedMels >= 10 ) 335elseif ( trackGreedMels <= -10 ) 336elseif ( trackGreedMels ) 337 set trackPlayerMorals to ( trackPlayerMorals + trackGreedMels ) 338 set trackGreedMels to ( trackGreedMels * 10 ) 339endif 340if ( trackGreedZalan >= 10 ) 341elseif ( trackGreedZalan <= -10 ) 342elseif ( trackGreedZalan ) 343 set trackPlayerMorals to ( trackPlayerMorals + trackGreedZalan ) 344 set trackGreedZalan to ( trackGreedZalan * 10 ) 345endif 346if ( trackGreedMilns >= 10 ) 347elseif ( trackGreedMilns <= -10 ) 348elseif ( trackGreedMilns ) 349 set trackPlayerMorals to ( trackPlayerMorals + trackGreedMilns ) 350 set trackGreedMilns to ( trackGreedMilns * 10 ) 351endif 352 353; temporarily disable to prevent player from encountering her outside prior to Kitchen Supplies start 354if ( GetJournalIndex TR_m4_TT_KitchenSupplies < 10 ) 355 if ( GetJournalIndex TR_m4_TT_WellnessCheck >= 30 ) 356 if ( GetInterior == 0 ) 357 if ( GetDisabled == 0 ) 358 Disable 359 endif 360 endif 361 endif 362elseif ( GetJournalIndex TR_m4_TT_KitchenSupplies < 30 ) 363 if ( GetDisabled == 1 ) 364 Enable 365 endif 366endif 367 368; hidden weapon for players using weapon sheathing mods 369if ( hiddenWeapon == 0 ) 370 if ( GetHealth < 121 ) 371 set hiddenWeapon to 1 372 AddItem TR_m4_TT_RavurDagger 1 373 equip TR_m4_TT_RavurDagger 374 if ( control == 1 ) 375 if ( GetFight == 0 ) 376 SetFight 30 377 SetFlee 0 378 endif 379 endif 380 endif 381endif 382 383if ( OnDeath ) 384 if ( GetJournalIndex TR_m4_TT_BooksBarbarians > 0 ) 385 if ( GetJournalIndex TR_m4_TT_BooksBarbarians < 100 ) 386 Journal TR_m4_TT_BooksBarbarians 120 387 endif 388 endif 389endif 390 391; block activation during teleportation 392if ( OnActivate ) 393 if ( controlQ == 2 ) 394 Return 395 elseif ( controlQ == 3 ) 396 Return 397 else 398 Activate 399 endif 400endif 401 402if ( TR_Map != 4 ) 403 set TR_Map to 4 404 set noAttack to -1 405endif 406 407End