(
"town_tournament_won",mnf_disable_all_keys,
"You have won the tournament of {s3}! You are filled with pride as the crowd cheers your name. " +
"In addition to honour, fame and glory, you earn a prize of {reg9} peningas. {s8}",
"none",
[ (set_background_mesh, "mesh_pic_victory"), #pic book
## (try_begin),
## (set_fixed_point_multiplier, 100),
## (position_set_x, pos0, 70),
## (position_set_y, pos0, 30),
## (position_set_z, pos0, 75),
## (set_game_menu_tableau_mesh, "tableau_troop_note_mesh", "trp_player", pos0),
## (try_end),
(str_store_party_name, s3, "$current_town"),
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(try_begin),
(lt, ":player_renown", 200),
(call_script, "script_change_troop_renown", "trp_player", 10),
(else_try),
(store_mul, ":boost", 200, 10),
(val_div, ":boost", ":player_renown"),
(call_script, "script_change_troop_renown", "trp_player", ":boost"),
(try_end),
(store_random_in_range, ":rand", 0, 20),
(try_begin),
(eq, ":rand", 0),
(troop_add_item, "trp_player", "itm_common_horse", 0), #chief da objeto al ganar torneo
(display_message, "@An expensive horse is awarded to you for your victory.", 0xFF0000),
(else_try),
(eq, ":rand", 1),
(troop_add_item, "trp_player", "itm_cow1", 0), #chief da objeto al ganar torneo
(display_message, "@A fat cow is awarded to you for your victory.", 0xFF0000),
(else_try),
(eq, ":rand", 2),
(troop_add_item, "trp_player", "itm_byrnie34", 0), #chief da objeto al ganar torneo
(display_message, "@You are given a beautiful shirt of mail adorned with a pelt, as befits a mighty warlord.", 0xFF0000),
(else_try),
(eq, ":rand", 3),
(troop_add_item, "trp_player", "itm_noble_sword", 0), #chief da objeto al ganar torneo
(display_message, "@They give you a fine sword, worthy of a noble.", 0xFF0000),
(else_try),
(display_message, "@They appreciate your participation in the competition and place a wreath of laurel on your head.", 0xFF0000),
(try_end),
(try_begin),
(party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
(lt, ":center_relation", 30),
(call_script, "script_change_player_relation_with_center", "$current_town", 6),
(try_end),
(assign, reg9, 200),
(add_xp_to_troop, 250, "trp_player"),
(troop_add_gold, "trp_player", reg9),
(str_clear, s8),
(store_add, ":total_win", "$g_tournament_bet_placed", "$g_tournament_bet_win_amount"),
(try_begin),
(gt, "$g_tournament_bet_win_amount", 0),
(assign, reg8, ":total_win"),
(str_store_string, s8, "@Moreover, you earn {reg8} peningas from the clever bets you placed on yourself..."),
(try_end),
(try_begin),
(this_or_next|neq, "$players_kingdom", "$g_encountered_party_faction"),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 70),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 145),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_object, "$g_encountered_party"),
(str_store_string, s8, "str_s8_you_are_also_invited_to_attend_the_ongoing_feast_in_the_castle"),
(try_end),
(troop_add_gold, "trp_player", ":total_win"),
(assign, ":player_odds_sub", 0),
(store_div, ":player_odds_sub", "$g_tournament_bet_win_amount", 5),
(party_get_slot, ":player_odds", "$current_town", slot_town_player_odds),
(val_sub, ":player_odds", ":player_odds_sub"),
(val_max, ":player_odds", 250),
(party_set_slot, "$current_town", slot_town_player_odds, ":player_odds"),
(call_script, "script_play_victorious_sound"),
(unlock_achievement, ACHIEVEMENT_MEDIEVAL_TIMES),
],
[
("continue", [], "Continue...",
[(jump_to_menu, "mnu_town"),
]),
]
),