Scripts

TR_m4_HH_Ulvo_ToolReceiptSc

TR_Mainland.esm
Variables 3
Local Variables
OnPCEquip
PCSkipEquip
doonce
Source
1Begin TR_m4_HH_Ulvo_ToolReceiptSc 2 3short OnPCEquip 4short PCSkipEquip 5short doonce 6 7set PCSkipEquip to 0 8; any actions that might end the script must be placed lower than this line 9 10if ( GetJournalIndex "TR_m4_HH_Ulvo3" == 0 ) 11 if ( GetDisabled == 0 ) 12 disable 13 return 14 endif 15elseif ( GetDisabled ) 16 enable 17endif 18 19; Activating from the inventory 20 21if ( MenuMode ) 22 23 ; the vanilla engine fails to set PCSkipEquip under certain 24 ; conditions, so we must do it ourselves for 25 ; OnPCEquip to work properly 26 27 set PCSkipEquip to 1 28 if ( OnPCEquip ) 29 30 ; place actions for when the player opened the book from the inventory here 31 if ( GetJournalIndex "TR_m4_HH_Ulvo3" > 0 ) 32 if ( GetJournalIndex "TR_m4_HH_Ulvo3" < 100 ) 33 if ( doonce == 0 ) 34 set doonce to 1 35 MessageBox "These crates have been forcibly broken into." 36 endif 37 Journal "TR_m4_HH_Ulvo3" 20 38 endif 39 endif 40 41 set OnPCEquip to 0 42 set PCSkipEquip to 0 ; OpenMW fails to open the book without this line 43 Activate 44 endif 45 46 ; this return is important 47 ; we must make sure OnActivate secton is only accessed outside of MenuMode 48 ; or the vanilla engine fails to take the book if opened from the world 49 return 50endif 51 52; Activating in the world 53if ( OnActivate ) 54 55 ; place actions for when the player opened the book from the world here 56 if ( GetJournalIndex "TR_m4_HH_Ulvo3" > 0 ) 57 if ( GetJournalIndex "TR_m4_HH_Ulvo3" < 100 ) 58 if ( doonce == 0 ) 59 set doonce to 1 60 MessageBox "These crates have been forcibly broken into." 61 endif 62 Journal "TR_m4_HH_Ulvo3" 20 63 endif 64 endif 65 66 Activate 67endif 68 69end