begin dbattackScript ; AzuMite's dbattackScript ; AzuMite 2009-12-09 ;global DBAttack ;global GameHour short state short gamehour_now short gamehour_previous short first_attack if ( state == 0 ) ; main loop if ( GetPCSleep == 1 ) set state to 10 endif elseif ( state == 10 ) ; sleeping if ( GetJournalIndex TR_DBHunt >= 100 ) StopScript dbattackScript elseif ( GetPCSleep != 1 ) set state to 0 else set gamehour_now to GameHour if ( gamehour_now != gamehour_previous ) set gamehour_previous to gamehour_now if ( player->GetLevel > 30 ) if ( gamehour_now < 5 ) if ( Random 1000 < 10 ) set state to 20 endif endif endif endif endif elseif ( state == 20 ) ; db attack if ( first_attack == 0 ) set first_attack to 1 set DBAttack to 1 endif if ( Random 1000 < 200 ) PlaceAtPC db_assassin4 1 64 0 PlaceAtPC db_assassin4 1 64 1 else PlaceAtPC db_assassin4 1 64 1 endif WakeUpPC MessageBox "You are awakened by a cold feeling." set state to 0 endif end