Users who are viewing this thread

I have created several new places in module_parties to trade only food, (the trigger I have used is from the Salt mine merchant) but this trigger says that only items type goods can be traded. This covers all items of type good (itp_type_goods)
What can I do so that the merchant can only sell food? (fish, bread, honey, etc.) and not other things (Leathers, Skins, Tools, etc.)
This is the triggers
Code:
(0.0, 0, 24.0, [], [# Refresh Molinos
                    (try_for_range, ":molinero", mercader_molino_inicio, mercader_molino_fin),
                      (troop_clear_inventory, ":molinero"),
                      (reset_item_probabilities,100),
                      (set_merchandise_modifier_quality,100),#150
                      (reset_item_probabilities,100),(set_item_probability_in_merchandise,"itm_bread",800),#700
                    #(try_for_range, ":alimentos", comercio_molino_inicio, comercio_molino_fin),
                      (troop_add_merchandise,":molinero",itp_type_goods,num_merchandise_goods),
                    (try_end),
                      (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, comercio_molino_inicio),

                    (try_for_range,":cur_center",towns_begin,towns_end),
                      (party_get_slot,":cur_merchant",":cur_center",slot_town_merchant),
                      (reset_item_probabilities,50),#100
                    (try_for_range, ":cur_goods", comercio_molino_inicio, comercio_molino_fin),
                      (store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"),
                      (party_get_slot, ":cur_price", ":cur_center", ":cur_price_slot"),

                          (call_script, "script_center_get_production", ":cur_center", ":cur_goods"),
                          (assign, ":cur_probability", reg0),
                          (call_script, "script_center_get_consumption", ":cur_center", ":cur_goods"),
                          (val_add, ":cur_probability", reg0),

                          (val_mul, ":cur_probability", 2),#4

                          (val_mul, ":cur_probability", average_price_factor),
                          (val_div, ":cur_probability", ":cur_price"),
                          (val_mul, ":cur_probability", average_price_factor),
                          (val_div, ":cur_probability", ":cur_price"),
                          (val_mul, ":cur_probability", average_price_factor),
                          (val_div, ":cur_probability", ":cur_price"),

                        (set_item_probability_in_merchandise,":cur_goods",":cur_probability"),
                     (try_end),
                        (troop_add_merchandise,":cur_merchant",itp_type_goods,num_merchandise_goods),

                        (troop_ensure_inventory_space,":cur_merchant",merchant_inventory_space),
                        (troop_sort_inventory, ":cur_merchant"),
                        (store_troop_gold, ":cur_gold",":cur_merchant"),
                        (lt,":cur_gold",1500),
                        (store_random_in_range,":new_gold",500,1000),
                        (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
                     (try_end),
                     ]),
 
Solution
Use the refresh_center_inventories script . Because everything is already there.

(try_begin),
(eq, ":cur_merchant", "trp_tavern_itemseller_1"), #change this
(troop_clear_inventory, ":cur_merchant"),
(try_for_range, ":item", food_begin, food_end),
(store_random_in_range, ":rand", 50, 51), #how many items
(troop_add_item, ":cur_merchant",":item",":rand"),
(try_end),
(try_end),
before
(troop_ensure_inventory_space, ":cur_merchant", merchant_inventory_space),
Im on phone but you could search my old mod ms after itemseller_1....
Or you could do it like I made the salt mine.
Use the refresh_center_inventories script . Because everything is already there.

(try_begin),
(eq, ":cur_merchant", "trp_tavern_itemseller_1"), #change this
(troop_clear_inventory, ":cur_merchant"),
(try_for_range, ":item", food_begin, food_end),
(store_random_in_range, ":rand", 50, 51), #how many items
(troop_add_item, ":cur_merchant",":item",":rand"),
(try_end),
(try_end),
before
(troop_ensure_inventory_space, ":cur_merchant", merchant_inventory_space),
Im on phone but you could search my old mod ms after itemseller_1....
Or you could do it like I made the salt mine.
 
Last edited:
Upvote 0
Solution
Use the refresh_center_inventories script . Because everything is already there.

(try_begin),
(eq, ":cur_merchant", "trp_tavern_itemseller_1"), #change this
(troop_clear_inventory, ":cur_merchant"),
(try_for_range, ":item", food_begin, food_end),
(store_random_in_range, ":rand", 50, 51), #how many items
(troop_add_item, ":cur_merchant",":item",":rand"),
(try_end),
(try_end),
before
(troop_ensure_inventory_space, ":cur_merchant", merchant_inventory_space),
Im on phone but you could search my old mod ms after itemseller_1....
Or you could do it like I made the salt mine.
ok thanks I'll see you when I can
 
Upvote 0
at the end I put this in module_dialog and delete the trigger that I had created
Code:
############ Molinero inicio ##################################
[anyone,"start", [(is_between,"$g_talk_troop",mercader_molino_inicio,mercader_molino_fin)],
"Good day {sir/madam}. What can I do for you?", "comprador",[]],

[anyone|plyr,"comprador", [],
 "I want to buy some food. Show me your wares.", "molinero_resp1",[]],
[anyone|plyr,"comprador", [],
 "I am looking for used boots. Show me what you have.", "molinero_resp2",[]],
[anyone|plyr,"comprador", [],
 "I'm thinking of buying ammo. Do you have any?", "molinero_resp3",[]],

[anyone,"molinero_resp1", [], "Of course, {sir/madam}. I have a variety of foods that you can buy.", "molinero",[
(troop_clear_inventory,"$g_talk_troop"),
(try_for_range, ":alimentos", comercio_molino_inicio, comercio_molino_fin),
(store_random_in_range, ":rango", 2,5),
(troop_add_items,"$g_talk_troop",":alimentos",":rango"),
(try_end),
[change_screen_trade]]],
[anyone,"molinero_resp2", [], "Yes {sir / madam}. I have many boots, some better than others, but all in good condition.", "molinero",[
(troop_clear_inventory,"$g_talk_troop"),
(troop_add_merchandise,"$g_talk_troop",itp_type_foot_armor,18),
[change_screen_trade]]],
[anyone,"molinero_resp3", [], "Ah yes {sir / madam}. I have bullets and cartridges of all kinds.", "molinero",[
(troop_clear_inventory,"$g_talk_troop"),
(troop_add_merchandise,"$g_talk_troop",itp_type_bullets,12),
[change_screen_trade]]],

[anyone,"molinero", [], "Anything else?", "comprador",[]],
[anyone|plyr,"comprador", [], "Thank you, good bye.", "close_window",[]],
qhcf2iqsd4l0bi56g.jpg
oxmfllxpr0xdn596g.jpg
6360hc9vmgjxh826g.jpg
q4tuzf6ewvh10fp6g.jpg
 
Upvote 0
At the end of script_get_trade_penalty

Code:
      (val_max, ":penalty", 1),
      ## TOCAN+ ## - Salt mine reduces the cost of salt.
        (try_begin),
            (eq, "$g_encountered_party", "p_salt_mine"),
            (assign, ":penalty", -50), # Adjust the penalty as desired.  More negative = lower price.  -100 = 1 denar. #TOCAN
        (try_end),   
      ## TOCAN- ##             
      (assign, reg0, ":penalty"),
 
Upvote 0
Back
Top Bottom