Download the
Module System and set up module_info.py to point to your Warband installation (see other threads on downloading Python, etc). However, the flintlock pistol is an already enabled entry in the MS, it simply won't show up as merchandise since the game doesn't know how to go about adding their type to merchants. Open up module_triggers.py and scroll down to the following:
# Refresh Weapon sellers
(0.0, 0, 24.0, [], [
(reset_item_probabilities,100),
(set_merchandise_modifier_quality,150),
(try_for_range,reg(2),weapon_merchants_begin,weapon_merchants_end),
(store_sub, ":cur_town", reg2, weapon_merchants_begin),
(val_add, ":cur_town", towns_begin),
(party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_one_handed_wpn,5),
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_two_handed_wpn,5),
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_polearm,5),
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_shield,6),
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_bow,4),
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_crossbow,3),
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_thrown,5),
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_arrows,2),
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_bolts,2),
(troop_ensure_inventory_space,reg(2),merchant_inventory_space),
(troop_sort_inventory, reg(2)),
(store_troop_gold, reg(6),reg(2)),
(lt,reg(6),900),
(store_random_in_range,":new_gold",200,400),
(call_script, "script_troop_add_gold", reg(2), ":new_gold"),
(end_try,0),
]),
Basically, this says that every 24 hours, merchandise of various types is added to the weaponsmith of each town, their inventory space is sorted (leaving enough spaces for you to sell), and gold is added if they're below a margin of 900. This is repeated for every weaponsmith in every city.
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_thrown,5),This line adds 5 thrown items to that merchant. Don't worry about the :cur_faction - items are not restricted by faction by default. Open up header_items.py - a list of all types of items are shown under #item flags. To make sure your pistol (and the corresponding ammunition) shows up as merchandise, ensure they are flagged with itp_merchandise (this is already the case), and add its type to the list of merchandise to add. So you would have the following code:
(troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_bolts,2),
(troop_add_merchandise,":cur_merchant",itp_type_musket,1),
(troop_add_merchandise,":cur_merchant", itp_type_pistol,1),
(troop_add_merchandise,":cur_merchant", itp_type_bullets,1),
(troop_ensure_inventory_space,reg(2),merchant_inventory_space),As a side note, if you wanted a revolver, modify the max_ammo(1) flag for the flintlock pistol entry in module_items.py to whatever value you want.