Scripts

TR_m7_HH_Dren_q_Vedam1SC

TR_Mainland.esm
Variables 5
Local Variables
PCSkipEquip
OnPCEquip
button
doOnce
letterState
Source
1begin TR_m7_HH_Dren_q_Vedam1SC 2 3short PCSkipEquip 4short OnPCEquip 5short button 6short doOnce 7short letterState 8;global TR_m7_HH_Dren_q_Vedam1_Seal 9 10if ( GetDisabled ) 11 Return 12endif 13 14if ( doOnce == 0 ) ; init pcskipequip, necessary if added directly to players inventory 15 if ( TR_m7_HH_Dren_q_Vedam1_Seal == 0 ) 16 ; if seal is unbroken, avoid equipping 17 set PCSkipEquip to 1 18 else 19 set letterState to 2 20 set PCSkipEquip to 0 21 endif 22 set doOnce to 1 23endif 24 25if ( OnActivate ) 26 Player->AddItem "TR_m7_HH_Dren_q_Vedam1" 1 27 Disable 28 MessageBox "You pick up the letter." 29endif 30 31if ( letterState == 2 ) ; letter unsealed 32 Set PCSkipEquip to 0 33endif 34 35if ( OnPCEquip == 0 ) 36 Set button to -1 37 Return 38endif 39 40if ( letterState == 0 ) ; sealed letter 41 if ( TR_m7_HH_Dren_q_Vedam1_Seal == 0 ) 42 MessageBox "Do you want to break the seal on the letter? It cannot be repaired." "Yes" "No" 43 Set letterState to 1 44 else 45 Set PCSkipEquip to 0 46 Set OnPCEquip to 0 47 endif 48endif 49 50if ( letterState == 1 ) 51 set button to GetButtonPressed 52 if ( button == 0 ) 53 ;unseal it and set global 54 Set letterState to 2 55 Set TR_m7_HH_Dren_q_Vedam1_Seal to 1 56 Set OnPCEquip to 0 57 Set PCSkipEquip to 0 58 MessageBox "You have broken the seal." "Okay" 59 60 elseif ( button == 1 ) 61 Set letterState to 0 62 Set PCSkipEquip to 1 63 Set OnPCEquip to 0 64 ;leave it sealed and reset PCSkipEquip 65 endif 66 Return 67endif 68 69End