# script_set_town_walker_destination
# Input: arg1 = agent_no
# Output: none
("set_town_walker_destination",
[(store_script_param_1, ":agent_no"),
(store_random_in_range, ":rand_dest", 1 ,12),
(assign, reg0, 9),
(assign, reg1, 10),
(assign, reg2, 12),
(assign, reg3, 32),
(assign, reg4, 33),
(assign, reg5, 34),
(assign, reg6, 35),
(assign, reg7, 36),
(assign, reg8, 37),
(assign, reg9, 38),
(assign, reg10, 39),
(try_for_agents, ":cur_agent"),
(agent_get_troop_id, ":cur_troop", ":cur_agent"),
(is_between, ":cur_troop", walkers_begin, walkers_end),
(agent_get_slot, ":target_entry_point", ":cur_agent", 0),
(try_begin),
(eq, ":rand_dest", 1),
(assign, ":target_entry_point", 9),
(else_try),
(eq, ":rand_dest", 2),
(assign, ":target_entry_point", 10),
(else_try),
(eq, ":rand_dest", 3),
(assign, ":target_entry_point", 12),
(else_try),
(eq, ":rand_dest", 4),
(assign, ":target_entry_point", 32),
(else_try),
(eq, ":rand_dest", 2),
(assign, ":target_entry_point", 33),
(else_try),
(eq, ":rand_dest", 5),
(assign, ":target_entry_point", 34),
(else_try),
(eq, ":rand_dest", 6),
(assign, ":target_entry_point", 35),
(else_try),
(eq, ":rand_dest", 7),
(assign, ":target_entry_point", 36),
(else_try),
(eq, ":rand_dest", 8),
(assign, ":target_entry_point", 37),
(else_try),
(eq, ":rand_dest", 9),
(assign, ":target_entry_point", 38),
(else_try),
(eq, ":rand_dest", 10),
(assign, ":target_entry_point", 39),
(else_try),
(assign, ":target_entry_point", 10),
(try_end),
(try_begin),
(agent_set_slot, ":agent_no", 0, ":target_entry_point"),
(entry_point_get_position, pos1, ":target_entry_point"),
(try_begin),
(init_position, pos2),
(position_set_y, pos2, 250),
(position_transform_position_to_parent, pos1, pos1, pos2),
(try_end),
(agent_set_scripted_destination, ":agent_no", pos1, 0),
(agent_set_speed_limit, ":agent_no", 5),
(try_end),
]),