Begin dbattackScript float dbchance short journalOnce short attackOnce short playerLevel short attackmod short othermod short dbnumber short temp short sleepOnce if ( GetJournalIndex TR_dbAttack >= 50 ) return endif if ( player->GetLevel >= 30 ) set playerLevel to 5 else if ( player->GetLevel >=20 ) set playerLevel to 4 else if ( player->GetLevel >= 10 ) set playerLevel to 3 else if ( player->GetLevel >=4 ) set playerLevel to 2 else set playerLevel to 1 endif endif endif endif if ( GetPCCell "Seyda Neen, Census and Excise Office" == 1 ) return endif if ( journalOnce == 1 ) ;Journal TR_DBAttack 10 set journalOnce to -1 endif if ( GetPCSleep == 1 ) if ( sleepOnce == 1 ) return endif set sleepOnce to 1 set dbchance to Random 100 set attackmod to ( attackonce * 10 ) if ( playerlevel == 5 ) set othermod to ( 90- attackmod ) if ( dbchance <= othermod ) WakeUpPC MessageBox "You are awakened by a loud noise." set dbnumber to ( dbnumber + 1 ) if ( dbnumber > 2 ) set dbnumber to 2 endif set temp to dbnumber while ( temp != 0 ) PlaceAtPC "db_assassin4" 1 128 1 set temp to ( temp - 1 ) endwhile set attackonce to ( attackonce + 1 ) if ( journalOnce == -1 ) return endif set journalOnce to 1 set DBAttack to 1 endif else if ( playerLevel == 4 ) set othermod to ( 70 - attackmod ) if ( dbchance <= othermod ) WakeUpPC MessageBox "You are awakened by a loud noise." set dbnumber to ( dbnumber + 1 ) if ( dbnumber > 2 ) set dbnumber to 2 endif set temp to dbnumber while ( temp != 0 ) PlaceAtPC "db_assassin3" 1 128 1 set temp to ( temp - 1 ) endwhile set attackonce to ( attackonce + 1 ) if ( journalOnce == -1 ) return endif set journalOnce to 1 set DBAttack to 1 endif else if ( playerLevel == 3 ) set othermod to ( 50 - attackmod ) if ( dbchance <= othermod ) WakeUpPC MessageBox "You are awakened by a loud noise." PlaceAtPC "db_assassin2" 1 128 1 set attackonce to ( attackonce + 1 ) if ( journalOnce == -1 ) return endif set journalOnce to 1 set DBAttack to 1 endif else if ( playerLevel == 2 ) set othermod to ( 40 - attackmod ) if ( dbchance <= othermod ) WakeUpPC MessageBox "You are awakened by a loud noise." PlaceAtPC "db_assassin1" 1 128 1 set attackonce to ( attackonce + 1 ) if ( journalOnce == -1 ) return endif set journalOnce to 1 set DBAttack to 1 endif else if ( playerLevel == 1 ) set othermod to ( 20 - attackmod ) if ( dbchance <= othermod ) WakeUpPC MessageBox "You are awakened by a loud noise." PlaceAtPC "db_assassin1b" 1 128 1 set attackonce to ( attackonce + 1 ) if ( journalOnce == -1 ) return endif set journalOnce to 1 set DBAttack to 1 endif endif endif endif endif endif else set sleepOnce to 0 endif End