Ashmond
Sergeant at Arms
Greets!
Here is a bit of tavern keep dialog that allows the player to purchase ten, fifty, one hundred or three hundred troops of any kind. This is an extension of sombody's code that was posted in this thread. Hijacking that topic wasn't intended.
Each option will only present itself if the player meets the minimum requirements. This is a time saver for the player yet requires the exchange of denars. The charge for each troop is the same as regular recruitment. For personal preferences, tweaking the amount of troops to purchase or which factions are available is fairly straight forward.
Enjoy! If you choose to use this in a publicly released mod, credit Somebody & Ashmond (because everyone I've seen use this credit us both anyway).
Placement below the following works well:
Here is a bit of tavern keep dialog that allows the player to purchase ten, fifty, one hundred or three hundred troops of any kind. This is an extension of sombody's code that was posted in this thread. Hijacking that topic wasn't intended.
Each option will only present itself if the player meets the minimum requirements. This is a time saver for the player yet requires the exchange of denars. The charge for each troop is the same as regular recruitment. For personal preferences, tweaking the amount of troops to purchase or which factions are available is fairly straight forward.
Enjoy! If you choose to use this in a publicly released mod, credit Somebody & Ashmond (because everyone I've seen use this credit us both anyway).
Code:
#giz me troobz
[anyone|plyr,"tavernkeeper_talk",
[
(party_get_free_companions_capacity,":room","p_main_party"),
(ge,":room",10),
(store_troop_gold,":gold","trp_player"),
(ge,":gold",1000),
], "So I herd u liek troobz.", "ramun_buy",[]],
[anyone,"ramun_buy", [], "Of course. What kind would you like?", "ramun_faction",[]],
[anyone|repeat_for_factions|plyr,"ramun_faction",
[ (store_repeat_object, ":faction_no"),
(this_or_next|is_between, ":faction_no", npc_kingdoms_begin, kingdoms_end),
(this_or_next|is_between, ":faction_no", "fac_commoners", "fac_neutral"),
(is_between, ":faction_no", "fac_manhunters", "fac_mountain_bandits"),
(try_begin),
(is_between, ":faction_no", npc_kingdoms_begin, kingdoms_end),
(faction_get_slot, ":str", ":faction_no", slot_faction_adjective),
(str_store_string, s2, ":str"),
(else_try),
(str_store_faction_name, s2, ":faction_no"),
(try_end),
], "Some {s2} please.", "ramun_select",
[(store_repeat_object, reg2),(str_store_faction_name, s2, reg2),]
],
[anyone|plyr,"ramun_faction",[], "Nevermind.", "tavernkeeper_pretalk", []],
[anyone,"ramun_select", [], "So you want some troops from the {s2}?", "ramun_troops",[]],
[anyone|repeat_for_troops|plyr,"ramun_troops",
[
(store_repeat_object, ":troop"),
(is_between, ":troop", regular_troops_begin, "trp_kidnapped_girl"),#eliminates a load
(store_faction_of_troop, ":faction", ":troop"),#eliminates the rest
(eq, ":faction", reg2),#by faction obviously
(neg|troop_is_hero, ":troop"),#patrol leaders
(str_store_troop_name, s3, ":troop"),
(assign,"$stroop",0),
],
"{s3}", "ramun_count", [(store_repeat_object,reg3),(str_store_faction_name, s3, reg2),(str_store_troop_name_plural,s4,reg3),(assign,"$stroop",reg3),]],
[anyone|plyr,"ramun_troops",[],"No, none of these. Let me see that faction list again.","ramun_buy",[]],
[anyone,"ramun_count",[],"How many {s4}?","ramun_crespond",[]],
[anyone|plyr,"ramun_crespond",[],"I shall return when I'm better prepared.","tavernkeeper_pretalk",[]],
[anyone|plyr,"ramun_crespond",
[
(party_get_free_companions_capacity,":room","p_main_party"),
(ge,":room",10),
(store_troop_gold,":gold","trp_player"),
(call_script,"script_game_get_join_cost",reg3),
(store_mul,":cost",reg0,10),
(ge,":gold",":cost"),
],"I'd like ten.","ramun_buy_some",[(assign, "$tcost", 10),]],
[anyone|plyr,"ramun_crespond",
[
(party_get_free_companions_capacity,":room","p_main_party"),
(ge,":room",50),
(store_troop_gold,":gold","trp_player"),
(call_script,"script_game_get_join_cost",reg3),
(store_mul,":cost",reg0,50),
(ge,":gold",":cost"),
],"I'd like fifty.","ramun_buy_some",[(assign, "$tcost", 50),]],
[anyone|plyr,"ramun_crespond",
[
(party_get_free_companions_capacity,":room","p_main_party"),
(ge,":room",100),
(store_troop_gold,":gold","trp_player"),
(call_script,"script_game_get_join_cost",reg3),
(store_mul,":cost",reg0,100),
(ge,":gold",":cost"),
],"I'd like one hundred.","ramun_buy_some",[(assign, "$tcost", 100),]],
[anyone|plyr,"ramun_crespond",
[
(party_get_free_companions_capacity,":room","p_main_party"),
(ge,":room",300),
(store_troop_gold,":gold","trp_player"),
(call_script,"script_game_get_join_cost",reg3),
(store_mul,":cost",reg0,300),
(ge,":gold",":cost"),
],"I have no time for this tomfoolery! I need an army! I'll take three hundred!","ramun_buy_300",[(assign, "$tcost", 300),]],
[anyone,"ramun_buy_some",[], "Certainly.", "ramun_anythingelse",
[
(party_add_members, "p_main_party","$stroop","$tcost"),
(call_script,"script_game_get_join_cost",reg3),
(val_mul, "$tcost", reg0),
(troop_remove_gold, "trp_player", "$tcost"),
(assign, "$tcost", 0),
]
],
[anyone,"ramun_buy_300",[], "What a greedy {fulcher/queine} ye be! I do this only for thee.", "ramun_anythingelse",
[
(party_add_members, "p_main_party","$stroop","$tcost"),
(call_script,"script_game_get_join_cost",reg3),
(val_mul, "$tcost",reg0),
(troop_remove_gold, "trp_player", "$tcost"),
(assign, "$tcost", 0),
]
],
[anyone,"ramun_anythingelse",[],"What else?","ramun_demands",[]],
[anyone|plyr,"ramun_demands",[],"No, I'm done as thou hadst served well","tavernkeeper_pretalk",[]],
[anyone|plyr,"ramun_demands",[],"Yes, more of the same.","ramun_count",[]],
[anyone|plyr,"ramun_demands",[],"I would have another look at the list anew.","ramun_buy",[]],
#giz me troobz end
Placement below the following works well:
Code:
[anyone ,"start", [(store_conversation_troop,reg(1)),(ge,reg(1),tavernkeepers_begin),(lt,reg(1),tavernkeepers_end)],
"Good day dear {sir/madam}. How can I help you?", "tavernkeeper_talk",
[
# (store_encountered_party,reg(2)),
# (party_get_slot,"$tavernkeeper_party",reg(2),slot_town_mercs),
]],