Scripts

TR_m3_OE_MissaWeapon_Script

TR_Mainland.esm
Variables 5
Local Variables
GameHourLocal
GameHourRounded
speechTrigger
speakChance
messageIndex
Source
1begin TR_m3_OE_MissaWeapon_Script 2 3; Script for weapons enchanted using Missa Rhyle's soul, 4; for quest tr_m3_mg_oe_q8. 5 6short GameHourLocal 7short GameHourRounded 8short speechTrigger 9short speakChance 10short messageIndex 11 12if ( MenuMode ) 13 Return 14endif 15 16; Something wrong 17; I hold my head 18; Missa gone 19; A breton dead 20if ( messageIndex == 5 ) 21 Return 22endif 23 24; Every hour, there's a small chance that Missa will speak 25set GameHourRounded to GameHour 26if ( GameHourLocal != GameHourRounded ) 27 28 set GameHourLocal to GameHourRounded 29 30 ; Check if Missa weapon is in the PC's inventory 31 set speechTrigger to 0 32 if ( Player->GetItemCount "TR_m3_OE_Missa_Staff" > 0 ) 33 set speechTrigger to 1 34 endif 35 36 ; Only show message when equipped 37 if ( speechTrigger == 1 ) 38 set speakChance to Random 100 39 ; 8% chance. Should trigger roughly once every 12 hours 40 if ( speakChance < 7 ) 41 PlaySound "T_SndObj_Hauntedfade" 42 if ( messageIndex == 0 ) 43 MessageBox "Huh? Where... where am I now?" 44 elseif ( messageIndex == 1 ) 45 MessageBox "Can anybody hear me?" 46 elseif ( messageIndex == 2 ) 47 MessageBox "How? How could this have happened?" 48 elseif ( messageIndex == 3 ) 49 MessageBox "^PCName, are you out there? Please..." 50 elseif ( messageIndex == 4 ) 51 MessageBox "You hear sobbing" 52 endif 53 set messageIndex to ( messageIndex + 1 ) 54 endif 55 endif 56endif 57 58end