("set_items_for_tournament",
[
(store_script_param, ":horse_chance", 1),
(store_script_param, ":lance_chance", 2),
(store_script_param, ":sword_chance", 3),
(store_script_param, ":axe_chance", 4),
(store_script_param, ":bow_chance", 5),
(store_script_param, ":javelin_chance", 6),
(store_script_param, ":mounted_bow_chance", 7),
(store_script_param, ":crossbow_sword_chance", :cool:,
(store_script_param, ":armor_item_begin", 9),
(store_script_param, ":helm_item_begin", 10),
(store_add, ":total_chance", ":sword_chance", ":axe_chance"),
(val_add, ":total_chance", ":crossbow_sword_chance"),
(try_for_range, ":i_ep", 0, 32),
(mission_tpl_entry_clear_override_items, "mt_arena_melee_fight", ":i_ep"),
(assign, ":has_horse", 0),
(store_div, ":cur_team", ":i_ep", :cool:,
(try_begin),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", ":horse_chance"),
(assign, ":has_horse", 1),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_horse"),
(try_end),
(try_begin),
(eq, ":has_horse", 1),
(store_add, ":cur_total_chance", ":total_chance", ":lance_chance"),
(val_add, ":cur_total_chance", ":javelin_chance"),
(val_add, ":cur_total_chance", ":mounted_bow_chance"),
(else_try),
(store_add, ":cur_total_chance", ":total_chance", ":bow_chance"),
(try_end),
(store_random_in_range, ":random_no", 0, ":cur_total_chance"),
(store_add, ":cur_shield_item", "itm_arena_shield_red", ":cur_team"),
(try_begin),
(val_sub, ":random_no", ":sword_chance"),
(lt, ":random_no", 0),
(try_begin),
(store_random_in_range, ":sub_random_no", 0, 100),
(lt, ":sub_random_no", 50),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_sword"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_shield_item"),
# (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_shield"),
(else_try),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_heavy_practice_sword"),
(try_end),
(else_try),
(val_sub, ":random_no", ":axe_chance"),
(lt, ":random_no", 0),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_axe"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_shield_item"),
# (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_shield"),
(else_try),
(val_sub, ":random_no", ":crossbow_sword_chance"),
(lt, ":random_no", 0),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_sword"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_crossbow"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_bolts"),
(else_try),
(eq, ":has_horse", 0),
(val_sub, ":random_no", ":bow_chance"),
(lt, ":random_no", 0),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_bow"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_arrows"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_dagger"),
(else_try),
(eq, ":has_horse", 1),
(val_sub, ":random_no", ":lance_chance"),
(lt, ":random_no", 0),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_lance"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_shield_item"),
# (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_shield"),
(else_try),
(eq, ":has_horse", 1),
(val_sub, ":random_no", ":javelin_chance"),
(lt, ":random_no", 0),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_javelin"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_shield_item"),
# (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_shield"),
(else_try),
(eq, ":has_horse", 1),
(val_sub, ":random_no", ":mounted_bow_chance"),
(lt, ":random_no", 0),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_bow"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_arrows"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_dagger"),
(try_end),
(try_begin),
(ge, ":armor_item_begin", 0),
(store_add, ":cur_armor_item", ":armor_item_begin", ":cur_team"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_armor_item"),
(try_end),
(try_begin),
(ge, ":helm_item_begin", 0),
(store_add, ":cur_helm_item", ":helm_item_begin", ":cur_team"),
(mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_helm_item"),
(try_end),
(try_end),
]),