|
| 1 | +# Criminal Investigation |
| 2 | + |
| 3 | +## Begin |
| 4 | +When a criminal investigation task is executed for the first time, the status is `crime_investigation_status_pending`. |
| 5 | +The task handler sends a *Charge* or *Indictment* letter to the offending merchant, sets the status to `crime_investigation_status_investigating`, and reschedules the task according to the result of the following computation: |
| 6 | +```c |
| 7 | +(now + (((now & 7) + 8) << 8)) | 0x80 |
| 8 | +``` |
| 9 | + |
| 10 | +The lower 3 bits of the current time are used as a synchronized pseudorandom number ranging from `0` to `7`. |
| 11 | +To that number `8` is added, and the result is shifted by `8` to get a timespan between 8 to 15 days. |
| 12 | +That timespan is added to the current time, and the 8th bit is set to constrain the time of day between 12:00 and 24:00. |
| 13 | + |
| 14 | +Both random fields are filled with the result of `rand()` with a `RAND_MAX` of `32767`. |
| 15 | + |
| 16 | +## Verdict |
| 17 | +TODO |
| 18 | + |
| 19 | +## Scheduled Task Data |
| 20 | +The following task fields have been identified: |
| 21 | +```c |
| 22 | +struct scheduled_task_criminal_investigation |
| 23 | +{ |
| 24 | + unsigned __int8 field_0_merchant_index __tabform(NODUPS); |
| 25 | + unsigned __int8 field_1_town_index; |
| 26 | + char field_2; |
| 27 | + unsigned __int8 field_3_hometown_index; |
| 28 | + int field_4_timestamp; |
| 29 | + crime_type field_8_crime_type; |
| 30 | + crime_investigation_status field_9_status; |
| 31 | + unsigned __int16 field_A_random1; |
| 32 | + unsigned __int16 field_C_random2; |
| 33 | + signed __int16 field_E; |
| 34 | +}; |
| 35 | +``` |
| 36 | + |
| 37 | +where `crime_type` was found to be: |
| 38 | +```c |
| 39 | +enum crime_type : unsigned __int8 |
| 40 | +{ |
| 41 | + crime_type_criminal_plans = 0x0, |
| 42 | + crime_type_boycott_broken = 0x1, |
| 43 | + crime_type_pirate_attack = 0x2, |
| 44 | + crime_type_burglary = 0x3, |
| 45 | + crime_type_pirate_sponsor = 0x4, |
| 46 | + crime_type_indecent_behaviour = 0x5, |
| 47 | + crime_type_heresy = 0x6, |
| 48 | + crime_type_round_world = 0x7, |
| 49 | + crime_type_undermining_league = 0x8, |
| 50 | + crime_type_pirate_firing_on_ships = 0x9, |
| 51 | + crime_type_pirate_plundering_ships = 0xA, |
| 52 | + crime_type_pirate_sinking_ships = 0xB, |
| 53 | + crime_type_pirate_capturing_ships = 0xC, |
| 54 | + crime_type_pirate_attacking_town = 0xD, |
| 55 | + crime_type_pirate_firing_on_town = 0xE, |
| 56 | + crime_type_pirate_plundering_town = 0xF, |
| 57 | +}; |
| 58 | +``` |
| 59 | + |
| 60 | +and `crime_investigation_status` was found to be: |
| 61 | +```c |
| 62 | +enum crime_investigation_status : unsigned __int8 |
| 63 | +{ |
| 64 | + crime_investigation_status_pending = 0x0, |
| 65 | + crime_investigation_status_investigating = 0x1, |
| 66 | + crime_investigation_status_confiscation_successful = 0x2, |
| 67 | + crime_investigation_status_unknown = 0x3, |
| 68 | +}; |
| 69 | +``` |
0 commit comments