begin NOM_bedroll_sleep;--Bedroll on ground.; This bedroll replaces the regular (inventory) bedroll when the regular; bedroll is dropped.short state0 ;--Unusedshort stateshort buttonshort apphourshort currentHourshort delCounter;--Activate (Usage menu)if ( state == 0 ) if ( OnActivate ) set button to -1 set state to 10 messagebox "What do you want to do?" "Rest" "Take" endif return;--Handle usage menuelseif ( state == 10 ) set button to GetButtonPressed if ( button == -1 ) return elseif ( button == 0 ) ShowRestMenu set state to 30 elseif ( button == 1 ) player->AddItem "NOM_bedroll_misc" 1 Disable set state to 40 return endif;--PC Restingelseif ( state == 30 ) set apphour to GameHour if ( MenuMode == 0 ) set state to 0 set state to 0 set NOM_sleeping to 0 StartScript NOM_sleep_penalties endif if ( NOM_sleepactive == 0 ) set NOM_sleep to 0 return endif if ( GetPCSleep ) if ( NOM_sleeping == 0 ) set NOM_sleeping to 1 endif if ( currentHour != apphour ) set currentHour to apphour set NOM_sleep to ( NOM_sleep - 1 ) player->ModCurrentHealth 2 endif endif;--Will deleteelseif ( state == 40 ) set delCounter to ( delCounter + 1 ) if ( delCounter > 25 ) StopScript "NOM_bedroll_sleep" SetDelete 1 endif set state to -1endifend