merchants sell different items for each town

正在查看此主题的用户

Tooff

Squire
I want to merchants sell different items for each towns,with different cultures.
how can i get it? do i need put something in module_constants.py?
 
Tooff 说:
I want to merchants sell different items for each towns,with different cultures.
how can i get it? do i need put something in module_constants.py?

It's a bit tiresome, but you'd have to specify what you don't want them to sell using the probability-in-merchandise number, ie.g. suppose you want the merchant of Tihr to be the only one selling smoked fish.  Then for every other merchant, you'd have to insert:

(set_item_probability_in_merchandise, "itm_smoked_fish", 0),

The ideal is to write a long, generic script that sets down all your specifications as exceptions, e.g. something like the following:

插入代码块:
("restrict_native_goods",
    [
     (store_script_param_1, ":this_merchant"),   
     (troop_get_slot, ":cur_town", "this_merchant" slot_troop_town),
      (try_begin),
           (neg|eq, ":cur_town", "p_tihr"),
           (set_item_probability_in_merchandise, "itm_smoked_fish", 0), # sets fish probability = 0 everywhere but Tihr
      (else_try),
           (neg|eq, ":cur_town", "p_sargoth"),
           (set_item_probability_in_merchandise, "itm_dried_meat", 0), # sets meat probability = 0 everywhere but Sargoth
     (else_try), 
           (neg|eq, ":cur_town", "p_jelkala"),
           (set_item_probability_in_merchandise, "itm_velvet", 0), # sets velvet probability = 0 everywhere but Jelkala
     (else_try), 
             etc.
              :
(end_try),

]),

Specify fully for the goods, then dump it in the scripts folder.

Then look for anywhere in the scripts file for any time the phrase: "troop_add_merchandise" is used in conjunction with itp_type_goods.  And just before that call the restriction script, e.g.

插入代码块:
                            (call_script,"script_restrict_native_goods", ":cur_merchant"),
                            (troop_add_merchandise,":cur_merchant",itp_type_goods,num_merchandise_goods),

Besides the towns, you will also want to call this script when refreshing village merchandise and looting scripts just to make sure you can't get those goods that way either.

This also applies to armor, weapons, etc.  Anything you want to restrict.  Just remember that different agents refresh different type goods, so you'd want a construct a separate "restrict_native_armor" script and apply that at the different "troop_add_merchandise" points where it refers to itp_type_body_armor, itp_type head, etc.  Similarly for separate weapons & horse scripts.

 
后退
顶部 底部