add encounter_random_reason function