Scripts

TR_m4_VM_Skull_RilasRomavelSc

TR_Mainland.esm
Variables 12
Local Variables
button
messageOn
frameBuffer
talking
beenpickedup
adventure
quip
youthere
spearmsg
drummsg
verygood
dontleave
Source
1begin TR_m4_VM_Skull_RilasRomavelSc 2 3short button 4short messageOn 5short frameBuffer 6short talking 7short beenpickedup 8short adventure 9short quip 10 11short youthere 12short spearmsg 13short drummsg 14short verygood 15short dontleave 16 17; bug out if in menumode 18if ( MenuMode ) 19 if ( OnActivate ) 20 set frameBuffer to 1 21 endif 22 return 23endif 24 25; if the player left-clicks the skull in the world from inventory, "OnActivate" is still true for one more frame after inventory is exited 26; we (I) want to suppress that because it feels weird 27if ( frameBuffer ) 28 set frameBuffer to 0 29 return 30endif 31 32; in-world quips 33if ( youthere == 0 ) 34 if ( GetDistance "player" <= 600 ) 35 PlaySound3D "skeleton moan" 36 MessageBox "You there! ^PCRace! This isn't my body. Come closer, I have something to say!" 37 set youthere to 1 38 elseif ( "TR_m4_VM_RilasRoma_Body"->GetDistance "player" <= 400 ) 39 PlaySound3D "skeleton moan" 40 MessageBox "You there! ^PCRace! That's my body! Look behind you, I have something to say!" 41 set youthere to 1 42 endif 43endif 44 45if ( spearmsg == 0 ) 46 if ( "Player"->GetItemCount "TR_m4_VM_MightierThanSword" >= 1 ) 47 if ( CellChanged ) 48 set spearmsg to 1 ; janky way to deal with edge case where player moves skull outside current cell, steals spear, then moves to skull cell 49 elseif ( GetJournalIndex "TR_m4_VM_Headless" < 50 ) 50 PlaySound3D "skeleton moan" 51 set spearmsg to 1 52 if ( adventure ) 53 MessageBox "You know, I'll be needing that later." 54 else 55 MessageBox "Yes, by all means, go ahead! Steal my spear! S'wit." 56 endif 57 endif 58 endif 59endif 60 61if ( drummsg == 0 ) 62 if ( "Player"->GetItemCount "TR_m4_q_Headless_Drum_UNI" >= 1 ) 63 if ( CellChanged ) 64 set drummsg to 1 ; janky way to deal with edge case where player moves skull outside current cell, steals spear, then moves to skull cell 65 elseif ( GetJournalIndex "TR_m4_VM_Headless" < 50 ) 66 PlaySound3D "skeleton moan" 67 set drummsg to 1 68 if ( adventure ) 69 MessageBox "We're going to need that for the ritual." 70 else 71 MessageBox "Really? You're stealing the drum? It's not even worth half as much as it weighs." 72 endif 73 endif 74 endif 75endif 76 77if ( beenpickedup ) 78 if ( dontleave != 1 ) 79 if ( "Player"->GetItemCount "TR_m4_VM_Skull_RilasRomavel" < 1 ) 80 if ( "Player"->GetDistance "TR_m4_VM_Skull_RilasRomavel" >= 1024 ) 81 PlaySound3D "skeleton moan" 82 MessageBox "Wait! Don't just leave me here!" 83 set dontleave to 1 84 endif 85 endif 86 endif 87endif 88 89if ( adventure ) 90 if ( "TR_m4_VM_RilasRoma_Body"->OnActivate ) 91 PlaySound3D "skeleton moan" 92 MessageBox "That's my body. You know, for some time, it could move by itself. Took care of the Nord, then it walked away and tripped. Onto the spear." 93 elseif ( "TR_m4_Borgas Too-Sure"->OnActivate ) 94 PlaySound3D "skeleton moan" 95 MessageBox "That's the idiot responsible for this mess. Really, who tries to decapitate a skeleton?" 96 endif 97endif 98 99if ( verygood == 0 ) 100 if ( GetPCCell "Romavel Ancestral Tomb" ) 101 if ( GetJournalIndex "TR_m4_VM_Headless" >= 50 ) 102 PlaySound3D "skeleton moan" 103 MessageBox "Very good, we are all here! ^PCName, come to the ashpit." 104 set verygood to 1 105 set spearmsg to 1 106 endif 107 endif 108endif 109 110if ( OnActivate ) 111 if ( GetJournalIndex "TR_m4_VM_Headless" < 200 ) 112 Set messageOn to 1 113 endif 114endif 115 116if ( messageOn == 0 ) 117 return 118endif 119 120if ( messageOn == 1 ) 121 MessageBox "Do you wish to speak with the skull or pick it up?" "Speak" "Pick it up" 122 set messageOn to 2 123endif 124 125if ( messageOn == 2 ) 126 set button to GetButtonPressed 127 if ( button == 0 ) 128 ; talk with it 129 Set talking to 1 130 Set messageOn to 0 131 elseif ( button == 1 ) 132 ; pick it up 133 Activate 134 Set messageOn to 0 135 Set beenpickedup to 1 136 Set dontleave to 0 137 ; quip 138 PlaySound3D "skeleton moan" 139 if ( GetJournalIndex "TR_m4_VM_Headless" == 0 ) 140 MessageBox "Wait! Put me down! I have something to say first!" 141 elseif ( GetJournalIndex "TR_m4_VM_Headless" >= 10 ) 142 "Player"->StartScript "TR_m4_VM_Headless_HotCold_scp" 143 if ( adventure == 0 ) 144 MessageBox "Splendid! It's been so long since my last adventure. I won't let you down, ^PCName!" 145 set adventure to 1 146 else 147 if ( quip == 0 ) 148 MessageBox "Onward we go!" 149 elseif ( quip == 1 ) 150 MessageBox "Let's go!" 151 elseif ( quip == 2 ) 152 MessageBox "Our journey continues." 153 elseif ( quip == 3 ) 154 MessageBox "Isn't it a marvelous day for adventure, ^PCName?" 155 endif 156 set quip to quip + 1 157 if ( quip > 3 ) 158 set quip to 0 159 endif 160 endif 161 endif 162 return 163 endif 164endif 165 166; speak with the skull 167if ( talking ) 168 ; summon the dummy NPC! 169 PlaceAtPC "TR_m4_VM_RilasRoma_Dial" 1 1 1 170 set talking to 0 171endif 172 173end