it is already present in BRC but many people don't want to download the source while it is not finished so...
at module_dialogs
must be before this:
at module_party_templates
change all this troops if not using Floris Expanded Mod Pack
at module_troops
If not using Floris Expanded Mod Pack, delete all items and add new ones.
I'll update this code to the one I'm using once I fix my computer.
at module_dialogs
Code:
## BRC v2.0
#mercenary escort
[anyone, "start", [
(eq, "$talk_context", tc_tavern_talk),
(eq, "$talk_troop", "trp_mercenary_leader"),
(try_begin),
(party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
(eq, "$g_talk_troop", ":mercenary_troop"),
(assign, ":slot", slot_center_mercenary_troop_amount),
####If using Floris Expanded Mod Pack add these back:
# (else_try),
# (party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type_2),
# (assign, ":slot", slot_center_mercenary_troop_amount_2),
(try_end),
(neg|party_slot_eq, "$g_encountered_party", ":slot", 0),
(party_set_slot, "$g_encountered_party", ":slot", 0),
(set_spawn_radius,1),
(spawn_around_party,"$current_town","pt_escort_mercenaries_party"),
(party_set_ai_behavior,reg0,ai_bhvr_patrol_party),
(party_set_ai_object,reg0,"$current_town"),
(store_random_in_range, ":number", 0, 10000),
(party_set_helpfulness, reg0, ":number"), #tendency to help friendly parties under attack. (0-10000, 100 default.)
(assign, ":mercenary_amount", 0),
(assign, ":mercenary_cost", 0),
(try_for_range, ":troop", 0, "trp_mercenaries_end"),
(party_count_members_of_type,":mercenary_current_amount",reg0,":troop"),
(val_add, ":mercenary_amount", ":mercenary_current_amount"),
(call_script, "script_game_get_join_cost", ":troop"),
(assign, ":join_cost", reg0),
(store_mul, ":mercenary_current_cost", ":mercenary_current_amount", ":join_cost"),
(val_add, ":mercenary_cost", ":mercenary_current_cost"),
(try_end),
(gt, ":mercenary_amount", 0),
(store_sub, reg3, ":mercenary_amount", 1),
(store_sub, reg4, reg3, 1),
(assign, reg5, ":mercenary_cost"),
],
"Do you have a need for mercenaries, {sir/madam}?\
{reg3?Me and {reg4?{reg3} of my mates:one of my mates} are:I am} looking for a master.\
We'll escort you for {reg5} denars.", "mercenary_tavern_talk", []],
[anyone, "start", [
(eq, "$talk_context", tc_tavern_talk),
],
"Any orders, {sir/madam}?", "mercenary_after_recruited", []],
[anyone|plyr, "mercenary_after_recruited", [],
"Make your preparations. We'll be moving at dawn.", "mercenary_after_recruited_2", []],
[anyone|plyr, "mercenary_after_recruited", [],
"Take your time. We'll be staying in this town for a while.", "mercenary_after_recruited_2", []],
[anyone, "mercenary_after_recruited_2", [], "Yes {sir/madam}. We'll be ready when you tell us to leave.", "close_window", []],
[anyone|plyr, "mercenary_tavern_talk", [(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", reg5),],
"All right. I will hire all of you.", "mercenary_tavern_talk_hire", [(troop_remove_gold,"trp_player",reg5),
(party_set_ai_behavior,reg0,ai_bhvr_escort_party),
(party_set_ai_object,reg0,"p_main_party"),
(store_random_in_range, ":number", 200, 10000),
(party_set_helpfulness, reg0, ":number"), #tendency to help friendly parties under attack. (0-10000, 100 default.)
]],
[anyone|plyr, "mercenary_tavern_talk", [],
"All right. But I can only hire some of you.", "mercenary_tavern_talk_hire", [(change_screen_exchange_members, 1, reg0),]],
[anyone, "mercenary_tavern_talk_hire", [(store_random_in_range, ":rand", 0, 4),
(try_begin),
(eq, ":rand", 0),
(gt, "$temp", 1),
(str_store_string, s17,
"@You chose well, {sir/madam}. My lads know how to keep their word and earn their pay."),
(else_try),
(eq, ":rand", 1),
(str_store_string, s17,
"@Well done, {sir/madam}. Keep the money and wine coming our way, and there's no foe in Calradia you need fear."),
(else_try),
(eq, ":rand", 2),
(str_store_string, s17,
"@We are at your service, {sir/madam}. Point us in the direction of those who need hurting, and we'll do the rest."),
(else_try),
(str_store_string, s17,
"str_you_will_not_be_disappointed_sirmadam_you_will_not_find_better_warriors_in_all_calradia"),
(try_end),],
"{s17}", "close_window", []],
[anyone|plyr, "mercenary_tavern_talk", [(ge, ":free_capacity", 1)],
"That sounds good. But I can't afford to hire any more men right now.", "tavern_mercenary_cant_lead", []],
[anyone, "tavern_mercenary_cant_lead", [], "That's a pity. Well, {reg3?we will:I will} be lingering around here for a while,\
if you need to hire anyone.", "close_window", []],
[anyone|plyr, "mercenary_tavern_talk", [(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(eq, ":free_capacity", 0)],
"That sounds good. But I can't lead any more men right now.", "tavern_mercenary_cant_lead", []],
[anyone|plyr, "mercenary_tavern_talk", [],
"Sorry. I don't need any other men right now.", "close_window", []],
## BRC v2.0
must be before this:
Code:
[anyone, "start", [
(eq, "$talk_context", tc_tavern_talk),
(neg|troop_is_hero, "$g_talk_troop"),
(neq, "$talk_troop", "trp_mercenary_leader"),#####add this
(neg|is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
(party_get_slot, ":mercenary_amount", "$g_encountered_party", slot_center_mercenary_troop_amount),
at module_party_templates
Code:
## BRC v2.0
("escort_mercenaries_party","Escort Mercenaries",icon_vaegir_knight,0,fac_commoners,soldier_personality,[(trp_mercenary_leader,1,1),(trp_mercenary_watchman,5,20),(trp_mercenary_crossbowman,0,5),(trp_mercenary_veteran_cavalry,0,5),(trp_mercenary_swordsman,0,5),(trp_mercenary_enforcer,0,5),(trp_mercenary_infantry,0,5),(trp_mercenary_aventurier,0,5),(trp_mercenary_gendarme,0,5),(trp_mercenary_skirmisher,0,5),(trp_mercenary_mounted_archer,0,5),(trp_mercenary_axeman,0,5),(trp_mercenary_sergeant,0,5)]),
## BRC v2.0
at module_troops
Code:
["mercenary_leader", "Mercenary Leader", "Mercenary Leader", tf_guarantee_all,0,0,fac_commoners,[itm_leather_gloves,itm_leather_boots,itm_splinted_leather_greaves,itm_tab_shield_round_b,itm_hospitaller_padded_jack,itm_helmet_with_neckguardred,itm_bec_de_corbin,itm_simple_poleaxe,itm_lui_coloredhallberdb,itm_mail_mittens,itm_brass_mittens,itm_mail_gauntlets,itm_mail_chausses,itm_mail_shoes,itm_sw_teutonic_shield_01,itm_sw_teut_shield01,itm_early_transitional_heraldic,itm_crusaderhelm,itm_blackhelm,itm_sugarloaf,itm_sugarloaf_helmet_plain3,itm_reinforced_great_helm,itm_pop_flammarde], def_attrib|level(25),wp_one_handed(92)|wp_two_handed(100)|wp_polearm(187)|wp_archery(60)|wp_crossbow(90)|wp_throwing(76), knows_common|knows_riding_2|knows_ironflesh_2|knows_power_strike_3|knows_shield_2|knows_athletics_2|knows_pathfinding_7, man_face_young_1, man_face_old_4],
I'll update this code to the one I'm using once I fix my computer.