(
"recruit_volunteers_town",0,
"{!}{s18}",
"none",
[
# JuJu70 - make it more realistic
(troop_get_slot, ":religion","trp_player", slot_troop_religion),
(party_get_slot, ":center_culture", "$current_town", slot_center_culture),
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown), #renown
(party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
(party_get_slot, ":faith", "$current_town", slot_center_faithratio),
###
(try_begin),
(this_or_next|party_slot_eq, "$current_town", slot_town_lord, "trp_player"), #chief add for recruit need to permission
(party_slot_eq, "$current_town", recruit_permission_need, 0), #chief add for recruit need to permission
(party_set_slot, "$current_town", recruit_permission_need, 3), #no recruit possibility x time
(assign, "$g_block_recruiting", 0),
(store_random_in_range, ":random_no", 0, 9),
(assign, ":extra_vol", 1),
##renown adjustment
(assign, ":upper_limit", 6),
(try_begin),
(ge, ":player_renown", 100),
(store_sub, ":renown_bonus", ":player_renown", 100),
(val_div, ":renown_bonus", 100),
(val_add, ":upper_limit", ":renown_bonus"),
(try_end),
(try_begin),
(party_slot_eq, "$current_town", slot_town_lord, "trp_player"), #player is lord
(val_add, ":upper_limit", 2),
(try_end),
## religious adjustment
(try_begin),
(eq, ":religion", 1),
(val_mul, ":upper_limit", ":faith"),
(val_div, ":upper_limit", 100),
(val_add, ":upper_limit", 1),
(else_try),
(eq, ":religion", 2),
(store_sub, ":p_faith", 100, ":faith"),
(val_mul, ":upper_limit", ":p_faith"),
(val_div, ":upper_limit", 100),
(val_add, ":upper_limit", 1),
(try_end),
## charisma adjustment
(store_attribute_level, ":charisma", "trp_player", ca_charisma),
(val_div, ":charisma", 10),
(val_add, ":upper_limit", ":charisma"),
(store_skill_level, ":leadership", "skl_leadership", "trp_player"),
(val_div, ":leadership", 5),
(val_add, ":upper_limit", ":leadership"),
## relation adjustment
(try_begin),
(ge, ":center_relation", 20), #chief change to 20
(store_div, ":rec_bonus", ":center_relation", 20),
(val_add, ":upper_limit", ":rec_bonus"),
(else_try),
(lt, ":center_relation", 0),
(assign, ":upper_limit", 0),
(try_end),
# (try_begin),
# (gt, ":center_relation", 60),
# (val_add, ":extra_vol", 4),
# (else_try),
# (gt, ":center_relation", 30),
# (val_add, ":extra_vol", 2),
# (else_try),
## (gt, ":center_relation", 30),
# (val_add, ":extra_vol", 0),
# (try_end),
(try_begin),
(this_or_next|lt, ":center_relation", 0),
(le, ":random_no", 1), #40% possibilites nobody want to join
(assign, ":volunteer_amount", ":extra_vol"), #chief chage from 0 to 1 for frank request
(else_try),
(store_random_in_range, ":random_no2", 1, ":upper_limit"), #max 14 men, they are warband (old english werod) with a leader + standarbearer or horned + warriors
(try_begin),
(party_slot_eq,"$current_town",slot_party_type, spt_town),
(party_get_slot, ":prosperity", "$current_town", slot_town_prosperity),
(val_div, ":prosperity", 25),
(val_add, ":random_no2", ":prosperity"),
(try_end),
(val_add, ":random_no2", ":extra_vol"),
(assign, ":volunteer_amount", ":random_no2"),
(try_end),
(store_random_in_range, ":ram_troop", 0, 7),
(try_begin),
(gt, ":center_relation", 30),
(eq, ":ram_troop", 1),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_3_troop),
(else_try),
(gt, ":center_relation", 30),
(eq, ":ram_troop", 2),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_2_troop),
(troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", 1),
(try_begin),
(le, ":upgrade_troop_no", 0),
(troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", 0),
(try_end),
(gt, ":upgrade_troop_no", 0),
(assign, ":volunteer_troop", ":upgrade_troop_no"),
(else_try),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_2_troop),
(try_end),
(try_end),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(store_troop_gold, ":gold", "trp_player"),
(store_character_level, ":troop_level", ":volunteer_troop"), #cost = level * 4 . Common: troop level 23 = 92 peningas, but player save time to upgrade and upgrade cost
(val_mul, ":troop_level", 4),
(assign, ":wage", ":troop_level"),
# (call_script, "script_cost_per_village_recruit"), #MOTO variable cost
# (store_div, ":gold_capacity", ":gold", reg0),#10 peningas per man MOTO variable cost
(store_div, ":gold_capacity", ":gold", ":wage"),
(assign, ":party_capacity", ":free_capacity"),
(val_min, ":party_capacity", ":gold_capacity"),
(try_begin),
(gt, ":party_capacity", 0),
(val_min, ":volunteer_amount", ":party_capacity"),
(try_end),
(assign, reg5, ":volunteer_amount"),
(assign, reg7, 0),
(try_begin),
(gt, ":volunteer_amount", ":gold_capacity"),
(assign, reg7, 1), #not enough money
(try_end),
(try_begin),
(eq, ":volunteer_amount", 0),
(str_store_string, s18, "@No one here wants to join your party."),
#(str_store_string, s19, "@But"),
(else_try),
(store_mul, reg6, ":volunteer_amount", ":wage"),
(assign, "$temp", ":volunteer_amount"), #troop chief
(assign, "$temp2", ":volunteer_troop"), #troop chief
(str_store_troop_name_by_count, s3, ":volunteer_troop", ":volunteer_amount"),
(try_begin),
(eq, reg5, 1),
(str_store_string, s18, "@One {s3} is willing to follow you."),
(else_try),
(str_store_string, s18, "@{reg5} {s3} are willing to follow you."),
(try_end),
#(str_store_string, s19, "@Also"),
#(set_background_mesh, "mesh_pic_recruits"),
# mnu_recruit_volunteers ends
(else_try),
(str_store_string, s18, "@You need to get the permission of the lord of this place to recruit here."),
#(str_store_string, s19, "@But"),
(party_get_slot, ":center_culture", "$current_town", slot_center_culture),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_2_troop),
(assign, ":volunteer_amount", 0),
(assign, reg7, 0),#
(assign, reg5, 1),#
(assign, "$g_block_recruiting", 1),
(end_try),
],
[
("continue_not_enough_gold",
[
(eq, reg7, 1),
],
"I don't have enough money.",
[
(jump_to_menu,"mnu_town"),
]),
("continue",
[
(eq, reg7, 0),
(eq, reg5, 0),
], #noone willing to join
"Continue...",
[
(jump_to_menu,"mnu_town"),
]),
("recruit_them",
[
(eq, reg7, 0),
(gt, reg5, 0),
(eq, "$g_block_recruiting", 0), #vc_submenu_recruits
],
"Recruit them ({reg6} peningas).",
[
(assign, ":volunteer_troop", "$temp2"), #troop chief
(assign, ":volunteer_amount", "$temp"), #troop chief
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(val_min, ":volunteer_amount", ":free_capacity"),
(store_troop_gold, ":gold", "trp_player"),
(store_character_level, ":troop_level", ":volunteer_troop"), #cost = level * 4 . Common: troop level 23 = 92 peningas, but player save time to upgrade and upgrade cost
(val_mul, ":troop_level", 4),
(assign, ":recruit_cost", ":troop_level"),
(store_div, ":gold_capacity", ":gold", ":recruit_cost"),#
(val_min, ":volunteer_amount", ":gold_capacity"),
(party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
(store_mul, ":cost", ":volunteer_amount", ":recruit_cost"),
(troop_remove_gold, "trp_player", ":cost"),
(jump_to_menu,"mnu_town"),
]),
("forget_it",
[
(eq, reg7, 0),
(gt, reg5, 0),
],
"Forget it.",
[
(jump_to_menu,"mnu_town"),
]),
],
),