Scripts

TR_m7_HH_LlananuReport

TR_Mainland.esm
Variables 7
Local Variables
sealFailed
PCSkipEquip
OnPCEquip
scrollState
securityCheck
button
wasActivated
Source
1begin TR_m7_HH_LlananuReport 2 3;allows player to open and read "sealed" orders... 4;and gives the player the chance to "re-seal" them 5;the global TR_m7_HH_UnsealedLlananu is used for dialogue... 6;to tell if the scroll is CURRENTLY sealed or not 7;for quest TR_m7_HH_Raran1 8 9short sealFailed 10short PCSkipEquip 11short OnPCEquip 12short scrollState 13short securityCheck 14short button 15short wasActivated 16 17;scrollState... 18;0 never been loaded, sets PCSkipEquip once 19;1 scoll is sealed, ask if you want to unseal 20;2 player has been asked to unseal, wait for response 21;3 it is unsealed and can be read 22;4 it has been read once, ask if you want to re-seal 23;5 player has been asked to re-seal, wait for response 24 25if ( GetDisabled == 1 ) 26 Return 27endif 28 29if ( scrollState == 0 ) 30 ;set up PCSkipEquip for first use 31 Set PCSkipEquip to 1 32 Set scrollState to 1 33endif 34 35if ( OnActivate == 1 ) 36 Set wasActivated to 1 37 ;handle activate method of reading books 38endif 39 40if ( wasActivated == 1 ) 41 42 if ( scrollState == 1 ) 43 MessageBox "This scroll has been sealed. If you want to break the seal, drop the scroll on your character." "Okay." "Pick up Scroll." 44 set scrollState to 10 45 Return 46 endif 47 48 if ( scrollState == 10 ) 49 set button to GetButtonPressed 50 if ( button == 0 ) 51 Set scrollState to 0 52 Set wasActivated to 0 53 elseif ( button == 1 ) 54 ;can't get around activate... so we add on copy to the player and disable this reference 55 Player->AddItem "TR_m7_q_HH_LlananuSealed" 1 56 Set scrollState to 0 57 Set wasActivated to 0 58 Disable 59 endif 60 Return 61 endif 62 63 ;if ( scrollState == SOMETHING ELSE ) 64 Activate 65 66endif 67 68 69if ( OnPCEquip == 0 ) 70 Set button to -1 71 Return 72endif 73 74if ( scrollState == 1 ) 75 MessageBox "Do you want to break the seal and read the scroll?" "Yes" "No" 76 Set scrollState to 2 77endif 78 79if ( scrollState == 2 ) 80 set button to GetButtonPressed 81 if ( button == 0 ) 82 Set scrollState to 3 83 Set TR_m7_HH_UnsealedLlananu to 1 84 Set OnPCEquip to 0 85 Set PCSkipEquip to 0 86 MessageBox "You have broken the seal." "Okay" 87 ;unseal it and set global 88 elseif ( button == 1 ) 89 Set scrollState to 1 90 Set PCSkipEquip to 1 91 Set OnPCEquip to 0 92 ;leave it sealed and reset PCSkipEquip 93 endif 94 Return 95endif 96 97if ( scrollState == 3 ) 98 Set scrollState to 4 99 Set PCSkipEquip to 1 100 Return 101endif 102 103if ( scrollState == 4 ) 104 MessageBox "Do you want to read the scroll again, or try to re-seal the scroll?" "Read again" "Re-seal it" 105 Set scrollState to 5 106 Return 107endif 108 109if ( scrollState == 5 ) 110 set button to GetButtonPressed 111 if ( button == 0 ) 112 Set scrollState to 3 113 Set OnPCEquip to 0 114 Set PCSkipEquip to 0 115 elseif ( button == 1 ) 116 if ( sealFailed == 0 ) 117 Set securityCheck to Random 100 118 if ( Player->GetSecurity > securityCheck ) 119 Set scrollState to 1 120 Set PCSkipEquip to 1 121 Set TR_m7_HH_UnsealedLlananu to 0 122 MessageBox "You have resealed the scroll." "Okay" 123 ;reset state and conditions here 124 else 125 set sealFailed to 1 126 MessageBox "You have damaged the seal." "Okay" 127 endif 128 else 129 MessageBox "The seal has been damaged." "Okay" 130 endif 131 Set OnPCEquip to 0 132 endif 133endif 134 135End