Advertisement
Guest User

Diff between Warband MS 1.134 and 1.142

a guest
Jul 8th, 2011
613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 213.78 KB | None | 0 0
  1. diff -rupBN Module_system 1.134//header_mission_templates.py Module_system 1.142//header_mission_templates.py
  2. --- Module_system 1.134//header_mission_templates.py    2010-05-26 12:57:06.000000000 -0700
  3. +++ Module_system 1.142//header_mission_templates.py    2011-06-10 12:37:00.000000000 -0700
  4. @@ -129,6 +129,7 @@ mtf_team_fight          = 0x00000001 #id
  5.  mtf_battle_mode         = 0x00000002 #No inventory access
  6.  
  7.  mtf_commit_casualties   = 0x00000010
  8.  
  9.  mtf_no_blood            = 0x00000100
  10.  
  11. +mtf_synch_inventory     = 0x00010000 #Make a backup of player inventory and restore it at mission end.
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19. diff -rupBN Module_system 1.134//header_operations.py Module_system 1.142//header_operations.py
  20. --- Module_system 1.134//header_operations.py   2010-12-02 17:45:30.000000000 -0800
  21. +++ Module_system 1.142//header_operations.py   2011-05-17 11:14:44.000000000 -0700
  22. @@ -87,6 +87,17 @@ check_quest_concluded           = 204 #
  23.  
  24.  
  25.  is_trial_version                = 250 # (is_trial_version),
  26.  
  27.  
  28.  
  29. +options_get_damage_to_player    = 260 # (options_get_damage_to_player, <destination>), #0 = 1/4, 1 = 1/2, 2 = 1/1
  30.  
  31. +options_set_damage_to_player    = 261 # (options_set_damage_to_player, <value>), #0 = 1/4, 1 = 1/2, 2 = 1/1
  32.  
  33. +options_get_damage_to_friends   = 262 # (options_get_damage_to_friends, <destination>), #0 = 1/2, 1 = 3/4, 2 = 1/1
  34.  
  35. +options_set_damage_to_friends   = 263 # (options_set_damage_to_friends, <value>), #0 = 1/2, 1 = 3/4, 2 = 1/1
  36.  
  37. +options_get_combat_ai           = 264 # (options_get_combat_ai, <destination>), #0 = good, 1 = average, 2 = poor
  38.  
  39. +options_set_combat_ai           = 265 # (options_set_combat_ai, <value>), #0 = good, 1 = average, 2 = poor
  40.  
  41. +options_get_campaign_ai         = 266 # (options_get_campaign_ai, <destination>), #0 = good, 1 = average, 2 = poor
  42.  
  43. +options_set_campaign_ai         = 267 # (options_set_campaign_ai, <value>), #0 = good, 1 = average, 2 = poor
  44.  
  45. +options_get_combat_speed        = 268 # (options_get_combat_speed, <destination>), #0 = slowest, 1 = slower, 2 = normal, 3 = faster, 4 = fastest
  46.  
  47. +options_set_combat_speed        = 269 # (options_set_combat_speed, <value>), #0 = slowest, 1 = slower, 2 = normal, 3 = faster, 4 = fastest
  48.  
  49. +
  50.  
  51.  profile_get_banner_id                = 350 # (profile_get_banner_id, <destination>),
  52.  
  53.  profile_set_banner_id                = 351 # (profile_set_banner_id, <value>),
  54.  
  55.  
  56.  
  57. @@ -118,7 +129,7 @@ player_set_troop_id                  = 4
  58.  player_get_agent_id                  = 406 # (player_get_agent_id, <destination>, <player_id>),
  59.  
  60.  player_get_gold                      = 407 # (player_get_gold, <destination>, <player_id>),
  61.  
  62.  player_set_gold                      = 408 # (player_set_gold, <player_id>, <value>, <max_value>), #set max_value to 0 if no limit is wanted
  63.  
  64. -player_spawn_new_agent               = 409 # (player_spawn_new_agent, <player_id>),
  65.  
  66. +player_spawn_new_agent               = 409 # (player_spawn_new_agent, <player_id>, <entry_point>),
  67.  
  68.  player_add_spawn_item                = 410 # (player_add_spawn_item, <player_id>, <item_slot_no>, <item_id>),
  69.  
  70.  multiplayer_get_my_team              = 411 # (multiplayer_get_my_team, <destination>),
  71.  
  72.  multiplayer_get_my_troop             = 412 # (multiplayer_get_my_troop, <destination>),
  73.  
  74. @@ -133,7 +144,7 @@ multiplayer_make_everyone_enemy      = 4
  75.  player_control_agent                 = 421 # (player_control_agent, <player_id>, <agent_id>),
  76.  
  77.  player_get_item_id                   = 422 # (player_get_item_id, <destination>, <player_id>, <item_slot_no>) #only for server
  78.  
  79.  player_get_banner_id                 = 423 # (player_get_banner_id, <destination>, <player_id>),
  80.  
  81. -game_get_reduce_campaign_ai          = 424 # (game_get_reduce_campaign_ai, <destination>),
  82.  
  83. +game_get_reduce_campaign_ai          = 424 # (game_get_reduce_campaign_ai, <destination>), #depreciated, use options_get_campaign_ai instead
  84.  
  85.  multiplayer_find_spawn_point         = 425 # (multiplayer_find_spawn_point, <destination>, <team_no>, <examine_all_spawn_points>, <is_horseman>),
  86.  
  87.  set_spawn_effector_scene_prop_kind   = 426 # (set_spawn_effector_scene_prop_kind <team_no> <scene_prop_kind_no>)
  88.  
  89.  set_spawn_effector_scene_prop_id     = 427 # (set_spawn_effector_scene_prop_id <scene_prop_id>)
  90.  
  91. @@ -288,7 +299,7 @@ position_move_z                 = 722 #
  92.  
  93.  
  94.  position_rotate_x               = 723 # (position_rotate_x,<position_no>,<angle>),
  95.  
  96.  position_rotate_y               = 724 # (position_rotate_y,<position_no>,<angle>),
  97.  
  98. -position_rotate_z               = 725 # (position_rotate_z,<position_no>,<angle>),
  99.  
  100. +position_rotate_z               = 725 # (position_rotate_z,<position_no>,<angle>,[use_global_z_axis]), # set use_global_z_axis as 1 if needed, otherwise you don't have to give that.
  101.  
  102.  
  103.  
  104.  position_get_x                  = 726 # (position_get_x,<destination_fixed_point>,<position_no>), #x position in meters * fixed point multiplier is returned
  105.  
  106.  position_get_y                  = 727 # (position_get_y,<destination_fixed_point>,<position_no>), #y position in meters * fixed point multiplier is returned
  107.  
  108. @@ -371,11 +382,13 @@ create_combo_label_overlay
  109.  overlay_obtain_focus                      = 949 # (overlay_obtain_focus, <overlay_id>), #works for textboxes only
  110.  
  111.  
  112.  
  113.  overlay_set_tooltip                       = 950 # (overlay_set_tooltip, <overlay_id>, <string_id>),
  114.  
  115. +overlay_set_container_overlay              = 951 # (overlay_set_container_overlay, <overlay_id>, <container_overlay_id>) # -1 to reset
  116.  
  117.  
  118.  
  119.  show_object_details_overlay               = 960 # (show_object_details_overlay, <value>), #0 = hide, 1 = show
  120.  
  121.  
  122.  
  123. -show_item_details      = 970 # (show_item_details, <item_id>, <position_no>, <show_default_text_or_not>) #show_default_text_or_not should be 1 for showing "default" for default item costs
  124.  
  125. -close_item_details     = 971 # (close_item_details)
  126.  
  127. +show_item_details                         = 970 # (show_item_details, <item_id>, <position_no>, <show_default_text_or_not>) #show_default_text_or_not should be 1 for showing "default" for default item costs
  128.  
  129. +close_item_details                        = 971 # (close_item_details)
  130.  
  131. +show_item_details_with_modifier           = 972 # (show_item_details_with_modifier, <item_id>, <item_modifier>, <position_no>, <show_default_text_or_not>) #show_default_text_or_not should be 1 for showing "default" for default item costs
  132.  
  133.  
  134.  
  135.  context_menu_add_item       = 980 # (right_mouse_menu_add_item, <string_id>, <value>), #must be called only inside script_game_right_mouse_menu_get_buttons
  136.  
  137.  
  138.  
  139. @@ -459,7 +472,7 @@ add_info_page_note_from_sreg    = 1092 #
  140.  tutorial_box                    = 1120 # (tutorial_box,<string_id>,<string_id>), #deprecated use dialog_box instead.
  141.  
  142.  dialog_box                      = 1120 # (tutorial_box,<text_string_id>,<title_string_id>),
  143.  
  144.  question_box                    = 1121 # (question_box,<string_id>, [<yes_string_id>], [<no_string_id>]),
  145.  
  146. -tutorial_message                = 1122 # (tutorial_message,<string_id>, <color>), #set string_id = -1 for hiding the message
  147.  
  148. +tutorial_message                = 1122 # (tutorial_message,<string_id>, <color>, , <auto_close_time>), #set string_id = -1 for hiding the message
  149.  
  150.  tutorial_message_set_position   = 1123 # (tutorial_message_set_position, <position_x>, <position_y>),
  151.  
  152.  tutorial_message_set_size       = 1124 # (tutorial_message_set_size, <size_x>, <size_y>),
  153.  
  154.  tutorial_message_set_center_justify = 1125 # (tutorial_message_set_center_justify, <val>), #set not 0 for center justify, 0 for not center justify
  155.  
  156. @@ -689,6 +702,7 @@ party_clear_particle_systems           =
  157.  
  158.  
  159.  party_get_battle_opponent              = 1680   # (party_get_battle_opponent, <destination>, <party_id>)
  160.  
  161.  party_get_icon                         = 1681   # (party_get_icon, <destination>, <party_id>),
  162.  
  163. +party_set_extra_icon                   = 1682   # (party_set_extra_icon, <party_id>, <map_icon_id>, <up_down_distance_fixed_point>, <up_down_frequency_fixed_point>, <rotate_frequency_fixed_point>, <fade_in_out_frequency_fixed_point>), #frequencies are in number of revolutions per second
  164.  
  165.  
  166.  
  167.  party_get_skill_level                  = 1685   # (party_get_skill_level, <destination>, <party_id>, <skill_no>),
  168.  
  169.  agent_get_speed                        = 1689   # (agent_get_speed, <position_no>, <agent_id>), #will return speed in x and y
  170.  
  171. @@ -744,6 +758,7 @@ agent_get_player_id                    =
  172.  agent_set_invulnerable_shield          = 1725 # (agent_set_invulnerable_shield, <agent_id>),
  173.  
  174.  agent_get_wielded_item                 = 1726  # (agent_get_wielded_item,<destination>,<agent_id>,<hand_no>),
  175.  
  176.  agent_get_ammo                         = 1727  # (agent_get_ammo,<destination>,<agent_id>, <value>), #value = 1 gets ammo for wielded item, value = 0 gets ammo for all items
  177.  
  178. +#agent_get_ammo_for_slot                = 1825 # (agent_get_ammo_for_slot, <destination>, <agent_id>, <slot_no>), #slot no can be between 0-3
  179.  
  180.  agent_refill_ammo                      = 1728  # (agent_refill_ammo,<agent_id>),
  181.  
  182.  #agent_refill_wielded_shield_hit_points = 1692   # (agent_refill_wielded_shield_hit_points, <agent_id>),
  183.  
  184.  agent_has_item_equipped                = 1729  # (agent_has_item_equipped,<agent_id>,<item_id>),
  185.  
  186. @@ -803,7 +818,7 @@ agent_set_team                         =
  187.  
  188.  
  189.  agent_get_class                        = 1772   # (agent_get_class ,<destination>, <agent_id>),
  190.  
  191.  agent_get_division                     = 1773   # (agent_get_division ,<destination>, <agent_id>),
  192.  
  193. -agent_unequip_item                     = 1774    # (agent_unequip_item,<agent_id>,<item_id>),
  194.  
  195. +agent_unequip_item                     = 1774    # (agent_unequip_item, <agent_id>, <item_id>, [weapon_slot_no]), #weapon_slot_no is optional, and can be between 1-4 (used only for weapons, not armor). in either case, item_id has to be set correctly.
  196.  
  197.  
  198.  
  199.  class_is_listening_order               = 1775   # (class_is_listening_order, <team_no>, <sub_class>),
  200.  
  201.  agent_set_ammo                         = 1776   # (agent_set_ammo,<agent_id>,<item_id>,<value>), #value = a number between 0 and maximum ammo
  202.  
  203. @@ -811,7 +826,7 @@ agent_set_ammo                         =
  204.  agent_add_offer_with_timeout           = 1777   # (agent_add_offer_with_timeout, <agent_id>, <agent_id>, <duration-in-1/1000-seconds>), #second agent_id is offerer, 0 value for duration is an infinite offer
  205.  
  206.  agent_check_offer_from_agent           = 1778   # (agent_check_offer_from_agent, <agent_id>, <agent_id>), #second agent_id is offerer
  207.  
  208.  
  209.  
  210. -agent_equip_item                       = 1779    # (agent_equip_item,<agent_id>,<item_id>), #for weapons, agent needs to have an empty weapon slot
  211.  
  212. +agent_equip_item                       = 1779    # (agent_equip_item, <agent_id>, <item_id>, [weapon_slot_no]), #for weapons, agent needs to have an empty weapon slot. weapon_slot_no is optional, and can be between 1-4 (used only for weapons, not armor).
  213.  
  214.  
  215.  
  216.  entry_point_get_position               = 1780   # (entry_point_get_position, <position_no>, <entry_no>),
  217.  
  218.  entry_point_set_position               = 1781   # (entry_point_set_position, <entry_no>, <position_no>),
  219.  
  220. @@ -859,6 +874,9 @@ scene_prop_get_hit_points              =
  221.  scene_prop_get_max_hit_points          = 1816   # (scene_prop_get_max_hit_points, <destination>, <scene_prop_id>),
  222.  
  223.  scene_prop_get_team                    = 1817   # (scene_prop_get_team, <value>, <scene_prop_id>),
  224.  
  225.  scene_prop_set_team                    = 1818   # (scene_prop_set_team, <scene_prop_id>, <value>),
  226.  
  227. +scene_prop_set_prune_time              = 1819   # (scene_prop_set_prune_time, <scene_prop_id>, <value>), # prune time can only be set to objects that are already on the prune queue. static objects are not affected by this operation.
  228.  
  229. +
  230.  
  231. +agent_get_ammo_for_slot                = 1825  # (agent_get_ammo_for_slot, <destination>, <agent_id>, <slot_no>), #slot no can be between 0-3
  232.  
  233.  
  234.  
  235.  scene_item_get_num_instances           = 1830  # (scene_item_get_num_instances, <destination>, <item_id>),
  236.  
  237.  scene_item_get_instance                = 1831  # (scene_item_get_instance, <destination>, <item_id>, <instance_no>),
  238.  
  239. @@ -908,7 +926,7 @@ replace_scene_items_with_scene_props   =
  240.  #---------------------------
  241.  
  242.  
  243.  
  244.  set_mission_result                     = 1906  # (set_mission_result,<value>),
  245.  
  246. -finish_mission                         = 1907  # (finish_mission),
  247.  
  248. +finish_mission                         = 1907  # (finish_mission, <delay_in_seconds>),
  249.  
  250.  jump_to_scene                          = 1910  # (jump_to_scene,<scene_id>,<entry_no>),
  251.  
  252.  set_jump_mission                       = 1911  # (set_jump_mission,<mission_template_id>),
  253.  
  254.  set_jump_entry                         = 1912  # (set_jump_entry,<entry_no>),
  255.  
  256. @@ -998,14 +1016,14 @@ set_game_menu_tableau_mesh             =
  257.  #change_window types.
  258.  
  259.  change_screen_return                   = 2040  # (change_screen_return),
  260.  
  261.  change_screen_loot                     = 2041  # (change_screen_loot, <troop_id>),
  262.  
  263. -change_screen_trade                    = 2042  # (change_screen_trade),
  264.  
  265. +change_screen_trade                    = 2042  # (change_screen_trade, <troop_id>),
  266.  
  267.  change_screen_exchange_members         = 2043 # (change_screen_exchange_members, [0,1 = exchange_leader], [party_id]), #if party id is not given, current party will be used
  268.  
  269.  change_screen_trade_prisoners          = 2044  # (change_screen_trade_prisoners),
  270.  
  271.  change_screen_buy_mercenaries          = 2045  # (change_screen_buy_mercenaries),
  272.  
  273.  change_screen_view_character           = 2046  # (change_screen_view_character),
  274.  
  275.  change_screen_training                 = 2047  # (change_screen_training),
  276.  
  277.  change_screen_mission                  = 2048  # (change_screen_mission),
  278.  
  279. -change_screen_map_conversation         = 2049   # (change_screen_map_conversation),
  280.  
  281. +change_screen_map_conversation         = 2049   # (change_screen_map_conversation, <troop_id>),
  282.  
  283.  change_screen_exchange_with_party      = 2050   # (change_screen_exchange_with_party, <party_id>),
  284.  
  285.  change_screen_equip_other              = 2051  # (change_screen_equip_other, <troop_id>),
  286.  
  287.  change_screen_map                      = 2052
  288.  
  289. @@ -1024,6 +1042,9 @@ store_trigger_param_2  = 2072  # (store_
  290.  store_trigger_param_3  = 2073  # (store_trigger_param_3,<destination>),
  291.  
  292.  set_trigger_result     = 2075  # (set_trigger_result, <value>),
  293.  
  294.  
  295.  
  296. +val_lshift             = 2100 # (val_lshift, <destination>, <value>), # shifts the bits of destination to left by value amount.
  297.  
  298. +val_rshift             = 2101 # (val_rshift, <destination>, <value>), # shifts the bits of destination to right by value amount.
  299.  
  300. +
  301.  
  302.  val_add                = 2105  #dest, operand ::       dest = dest + operand
  303.  
  304.                 # (val_add,<destination>,<value>),
  305.  
  306.  val_sub                = 2106  #dest, operand ::       dest = dest + operand
  307.  
  308. @@ -1125,7 +1146,7 @@ store_conversation_troop        = 2200 #
  309.  store_partner_faction           = 2201 # (store_partner_faction,<destination>),
  310.  
  311.  store_encountered_party         = 2202 # (store_encountered_party,<destination>),
  312.  
  313.  store_encountered_party2        = 2203 # (store_encountered_party2,<destination>),
  314.  
  315. -store_faction_of_party          = 2204 # (store_faction_of_party,<destination>),
  316.  
  317. +store_faction_of_party          = 2204 # (store_faction_of_party, <destination>, <party_id>),
  318.  
  319.  set_encountered_party           = 2205 # (set_encountered_party,<destination>),
  320.  
  321.  
  322.  
  323.  
  324.  
  325. @@ -1241,6 +1262,11 @@ lhs_operations = [try_for_range,
  326.                    store_repeat_object,
  327.  
  328.                    get_global_cloud_amount,
  329.  
  330.                    get_global_haze_amount,
  331.  
  332. +                  options_get_damage_to_player,
  333.  
  334. +                  options_get_damage_to_friends,
  335.  
  336. +                  options_get_combat_ai,
  337.  
  338. +                  options_get_campaign_ai,
  339.  
  340. +                  options_get_combat_speed,
  341.  
  342.                    profile_get_banner_id,
  343.  
  344.                    get_achievement_stat,
  345.  
  346.                    get_max_players,
  347.  
  348. @@ -1408,6 +1434,7 @@ lhs_operations = [try_for_range,
  349.                    scene_prop_get_hit_points,
  350.  
  351.                    scene_prop_get_max_hit_points,
  352.  
  353.                    scene_prop_get_team,
  354.  
  355. +                  agent_get_ammo_for_slot,
  356.  
  357.                    scene_item_get_num_instances,
  358.  
  359.                    scene_item_get_instance,
  360.  
  361.                    scene_spawned_item_get_num_instances,
  362.  
  363. @@ -1507,7 +1534,9 @@ lhs_operations = [try_for_range,
  364.                    store_attacker_count,
  365.  
  366.                    store_normalized_team_count,
  367.  
  368.                    ]
  369.  
  370. -global_lhs_operations = [val_add,
  371.  
  372. +global_lhs_operations = [val_lshift,
  373.  
  374. +                         val_rshift,
  375.  
  376. +                         val_add,
  377.  
  378.                           val_sub,
  379.  
  380.                           val_mul,
  381.  
  382.                           val_div,
  383.  
  384. diff -rupBN Module_system 1.134//header_triggers.py Module_system 1.142//header_triggers.py
  385. --- Module_system 1.134//header_triggers.py 2010-11-30 16:33:08.000000000 -0800
  386. +++ Module_system 1.142//header_triggers.py 2011-03-30 18:00:04.000000000 -0700
  387. @@ -21,8 +21,7 @@ ti_tab_pressed           = -21.0 #can on
  388.  ti_inventory_key_pressed = -22.0 #can only be used in module_mission_templates triggers
  389.  
  390.  ti_escape_pressed        = -23.0 #can only be used in module_mission_templates triggers
  391.  
  392.  ti_battle_window_opened  = -24.0 #can only be used in module_mission_templates triggers
  393.  
  394. -#ti_on_mission_start      = -20.0
  395.  
  396. -ti_on_agent_spawn  = -25.0 #can only be used in module_mission_templates triggers
  397.  
  398. +ti_on_agent_spawn        = -25.0 #can only be used in module_mission_templates triggers
  399.  
  400.  ti_on_agent_killed_or_wounded = -26.0 #can only be used in module_mission_templates triggers
  401.  
  402.  ti_on_agent_knocked_down = -27.0 #can only be used in module_mission_templates triggers
  403.  
  404.  ti_on_agent_hit          = -28.0 #can only be used in module_mission_templates triggers
  405.  
  406. @@ -32,6 +31,10 @@ ti_on_agent_hit          = -28.0 #can on
  407.  # Register 0: damage dealer item_id
  408.  
  409.  # Position Register 0: position of the blow
  410.  
  411.  #                      rotation gives the direction of the blow
  412.  
  413. +# Trigger result: if returned result is greater than or equal to zero, inflicted damage is set to the value specified by the module.
  414.  
  415. +
  416.  
  417. +ti_on_player_exit        = -29.0 #can only be used in module_mission_templates triggers
  418.  
  419. +# Trigger Param 1: player_id
  420.  
  421.  
  422.  
  423.  ti_on_leave_area         = -30.0 #can only be used in module_mission_templates triggers
  424.  
  425.  ti_on_scene_prop_init    = -40.0 #can only be used in module_scene_props triggers
  426.  
  427. diff -rupBN Module_system 1.134//ID_scripts.py Module_system 1.142//ID_scripts.py
  428. --- Module_system 1.134//ID_scripts.py  2010-12-07 11:31:40.000000000 -0800
  429. +++ Module_system 1.142//ID_scripts.py  2011-07-08 15:59:32.000000000 -0700
  430. @@ -138,8 +138,8 @@ script_setup_talk_info = 136
  431.  script_setup_talk_info_companions = 137
  432.  
  433.  script_update_party_creation_random_limits = 138
  434.  
  435.  script_set_trade_route_between_centers = 139
  436.  
  437. -script_center_change_trade_good_production = 140
  438.  
  439. -script_average_trade_good_prices = 141
  440.  
  441. +script_average_trade_good_prices = 140
  442.  
  443. +script_average_trade_good_prices_2 = 141
  444.  
  445.  script_average_trade_good_productions = 142
  446.  
  447.  script_normalize_trade_good_productions = 143
  448.  
  449.  script_update_trade_good_prices = 144
  450.  
  451. @@ -563,5 +563,9 @@ script_change_player_right_to_rule = 561
  452.  script_indict_lord_for_treason = 562
  453.  
  454.  script_give_center_to_faction_while_maintaining_lord = 563
  455.  
  456.  script_check_concilio_calradi_achievement = 564
  457.  
  458. +script_refresh_center_inventories = 565
  459.  
  460. +script_refresh_center_armories = 566
  461.  
  462. +script_refresh_center_weaponsmiths = 567
  463.  
  464. +script_refresh_center_stables = 568
  465.  
  466.  
  467.  
  468.  
  469.  
  470. diff -rupBN Module_system 1.134//module_animations.py Module_system 1.142//module_animations.py
  471. --- Module_system 1.134//module_animations.py   2010-12-06 12:01:28.000000000 -0800
  472. +++ Module_system 1.142//module_animations.py   2011-04-05 18:14:02.000000000 -0700
  473. @@ -657,10 +657,12 @@ animations = [
  474.     [0.3, "equip_arms", 354, 350, arf_blend_in_0],
  475.  
  476.   ],
  477.  
  478.   ["equip_pistol_front_left", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
  479.  
  480. -   [0.6, "anim_human", combat+30, combat+45, arf_blend_in_0],
  481.  
  482. +##   [0.6, "anim_human", combat+30, combat+45, arf_blend_in_0],
  483.  
  484. +   [0.8, "equip_arms", 253, 276, arf_blend_in_0],
  485.  
  486.   ],
  487.  
  488.   ["unequip_pistol_front_left", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
  489.  
  490. -   [0.3, "anim_human", combat+10, combat+0, arf_blend_in_0],
  491.  
  492. +##   [0.3, "anim_human", combat+10, combat+0, arf_blend_in_0],
  493.  
  494. +   [0.2, "equip_arms", 254, 250, arf_blend_in_0],
  495.  
  496.   ],
  497.  
  498.   ["equip_katana", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
  499.  
  500.     [0.8, "anim_human", combat+30, combat+45, arf_blend_in_0],
  501.  
  502. diff -rupBN Module_system 1.134//module_constants.py Module_system 1.142//module_constants.py
  503. --- Module_system 1.134//module_constants.py    2010-08-07 22:41:50.000000000 -0700
  504. +++ Module_system 1.142//module_constants.py    2011-06-29 17:36:34.000000000 -0700
  505. @@ -1580,7 +1580,7 @@ ranged_weapons_end = "itm_torch"
  506.  armors_begin = "itm_leather_gloves"
  507.  
  508.  armors_end = "itm_wooden_stick"
  509.  
  510.  shields_begin = "itm_wooden_shield"
  511.  
  512. -shields_end = "itm_jarid"
  513.  
  514. +shields_end = ranged_weapons_begin
  515.  
  516.  
  517.  
  518.  # Banner constants
  519.  
  520.  
  521.  
  522. @@ -1793,3 +1793,10 @@ ACHIEVEMENT_KASSAI_MASTER = 71,
  523.  ACHIEVEMENT_IRON_BEAR = 72,
  524.  
  525.  ACHIEVEMENT_LEGENDARY_RASTAM = 73,
  526.  
  527.  ACHIEVEMENT_SVAROG_THE_MIGHTY = 74,
  528.  
  529. +
  530.  
  531. +ACHIEVEMENT_MEN_HANDLER = 75,
  532.  
  533. +ACHIEVEMENT_GIRL_POWER = 76,
  534.  
  535. +ACHIEVEMENT_QUEEN = 77,
  536.  
  537. +ACHIEVEMENT_EMPRESS = 78,
  538.  
  539. +ACHIEVEMENT_TALK_OF_THE_TOWN = 79,
  540.  
  541. +ACHIEVEMENT_LADY_OF_THE_LAKE = 80,
  542.  
  543. diff -rupBN Module_system 1.134//module_dialogs.py Module_system 1.142//module_dialogs.py
  544. --- Module_system 1.134//module_dialogs.py  2010-11-25 19:35:38.000000000 -0800
  545. +++ Module_system 1.142//module_dialogs.py  2011-07-08 15:59:16.000000000 -0700
  546. @@ -800,13 +800,13 @@ dialogs = [
  547.       ]],
  548.  
  549.      
  550.  
  551.  
  552.  
  553. -  [anyone|plyr, "fighter_chamber_warn",
  554.  
  555. +  [anyone|plyr, "fighter_chamber_warn", # unused
  556.  
  557.     [],
  558.  
  559.     "{!}TODO: Sorry, let's try once again.", "fighter_talk_train_chamber", []],
  560.  
  561.  
  562.  
  563. -  [anyone|plyr, "fighter_chamber_warn",
  564.  
  565. +  [anyone|plyr, "fighter_chamber_warn", # unused
  566.  
  567.     [],
  568.  
  569. -   "{!}TODO: Sorry. I want to leave the exercise.", "fighter_talk_leave_chamber", []],
  570.  
  571. +   "{!}TODO: Sorry. I want to leave the exercise.", "close_window", []],
  572.  
  573.  
  574.  
  575.    [trp_tutorial_archer_1|auto_proceed, "start",
  576.  
  577.     [],
  578.  
  579. @@ -1576,8 +1576,8 @@ dialogs = [
  580.    [anyone,"start", [(troop_slot_eq,"$g_talk_troop", slot_troop_occupation, slto_player_companion),
  581.  
  582.                      (neg|main_party_has_troop,"$g_talk_troop"),
  583.  
  584.                      (eq, "$talk_context", tc_party_encounter)],
  585.  
  586. -   "Do you want me to rejoin you?", "member_wilderness_talk",[]],
  587.  
  588. -  [anyone,"start", [(neg|main_party_has_troop,"$g_talk_troop"),(eq, "$g_encountered_party", "p_four_ways_inn")], "Do you want me to rejoin you?", "member_inn_talk",[]],
  589.  
  590. +   "{!}Do you want me to rejoin you?", "close_window",[]], # unused
  591.  
  592. +  [anyone,"start", [(neg|main_party_has_troop,"$g_talk_troop"),(eq, "$g_encountered_party", "p_four_ways_inn")], "{!}Do you want me to rejoin you?", "close_window",[]], # unused
  593.  
  594.  #  [anyone,"member_separate_inn", [], "I don't know what you will do without me, but you are the boss. I'll wait for you at the Four Ways inn.", "close_window",
  595.  
  596.  #  [anyone,"member_separate_inn", [], "All right then. I'll meet you at the four ways inn. Good luck.", "close_window",
  597.  
  598.  #   [(remove_member_from_party,"$g_talk_troop", "p_main_party"),(add_troop_to_site, "$g_talk_troop", "scn_four_ways_inn", borcha_inn_entry)]],
  599.  
  600. @@ -2677,7 +2677,7 @@ dialogs = [
  601.    [
  602.  
  603.      (is_between, "$g_talk_troop", "trp_relative_of_merchant", "trp_relative_of_merchant"),
  604.  
  605.    ],
  606.  
  607. -  "Oh -- thank the heavens... Thank the heavens... Am I safe?", "close_screen",
  608.  
  609. +  "Oh -- thank the heavens... Thank the heavens... Am I safe?", "close_window",
  610.  
  611.    []],
  612.  
  613.  
  614.  
  615.  
  616.  
  617. @@ -4525,11 +4525,20 @@ dialogs = [
  618.   And of course, you will always remain as my foremost vassal."),
  619.  
  620.      ],
  621.  
  622.     "{s6}", "rebel_thanks_answer",
  623.  
  624. -   [
  625.  
  626. -  
  627.  
  628. +   [  
  629.  
  630.       (unlock_achievement, ACHIEVEMENT_KINGMAKER),
  631.  
  632.       (call_script, "script_end_quest", "qst_rebel_against_kingdom"),
  633.  
  634. -       ]],
  635.  
  636. +
  637.  
  638. +     (try_begin),
  639.  
  640. +       (troop_get_type, ":is_female", "trp_player"),
  641.  
  642. +       (eq, ":is_female", 1),
  643.  
  644. +
  645.  
  646. +       (troop_get_type, ":is_female", "$g_talk_troop"),
  647.  
  648. +       (eq, ":is_female", 1),     
  649.  
  650. +
  651.  
  652. +       (unlock_achievement, ACHIEVEMENT_GIRL_POWER),
  653.  
  654. +     (try_end),
  655.  
  656. +    ]],
  657.  
  658.  
  659.  
  660.    [anyone|plyr,"rebel_thanks_answer", [], "It was an honour to fight for your cause, {reg65?madame:my lord}.", "rebel_thanks_answer_2", []],
  661.  
  662.    [anyone|plyr,"rebel_thanks_answer", [], "You will always have my loyal support, {reg65?my lady:sir}.", "rebel_thanks_answer_2", []],
  663.  
  664. @@ -5835,7 +5844,7 @@ dialogs = [
  665.                      (troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
  666.  
  667.                       (le,"$talk_context",tc_siege_commander),
  668.  
  669.                       ],
  670.  
  671. -   "It is good to see you, old friend", "lord_start",
  672.  
  673. +   "It is good to see you, old friend.", "lord_start",
  674.  
  675.     []],
  676.  
  677.  
  678.  
  679.    
  680.  
  681. @@ -7581,7 +7590,12 @@ dialogs = [
  682.     (str_store_string, s9, "$g_rejoinder_to_last_comment"),
  683.  
  684.     ],
  685.  
  686.     "{s9}", "lord_respond_to_insult",[
  687.  
  688. -   (unlock_achievement, ACHIEVEMENT_SASSY),
  689.  
  690. +
  691.  
  692. +        (try_begin),
  693.  
  694. +            (troop_get_type, ":is_female", "trp_player"),
  695.  
  696. +            (eq, ":is_female", 1),
  697.  
  698. +            (unlock_achievement, ACHIEVEMENT_SASSY),
  699.  
  700. +        (try_end),
  701.  
  702.     ]],
  703.  
  704.  
  705.  
  706.  
  707.  
  708. @@ -12827,7 +12841,7 @@ dialogs = [
  709.  
  710.  
  711.    [anyone,"lord_join_rebellion_suggest_cheat",
  712.  
  713.     [], "Cheat:Allright.",
  714.  
  715. -   "lord_join_rebellion_ask_for_order",
  716.  
  717. +   "close_window", # unused
  718.  
  719.     [
  720.  
  721.       (troop_set_slot, "$g_talk_troop", slot_troop_discussed_rebellion, 1),
  722.  
  723.       (call_script, "script_change_troop_faction", "$g_talk_troop", "$players_kingdom"),
  724.  
  725. @@ -12903,9 +12917,6 @@ dialogs = [
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732. -
  733.  
  734. -
  735.  
  736. -  #sdsd
  737.  
  738.    [anyone,"lord_tell_objective", [
  739.  
  740.    (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_holding_center),
  741.  
  742.    (party_get_attached_to, ":cur_center_no", "$g_talk_troop_party"),
  743.  
  744. @@ -14576,13 +14587,13 @@ Hand over my {reg19} denars, if you plea
  745.    
  746.  
  747.    [anyone|plyr,"lord_mission_rescue_prisoner_method", [
  748.  
  749.    (eq, 1, 0),
  750.  
  751. -  ],
  752.  
  753. -  "I am thinking of paying the ransom.", "lord_mission_rescue_prisoner_method_ransom",[]],
  754.  
  755. +  ], # unused
  756.  
  757. +  "{!}I am thinking of paying the ransom.", "lord_mission_rescue_prisoner_method_ransom",[]],
  758.  
  759.  
  760.  
  761.    [anyone|plyr,"lord_mission_rescue_prisoner_method", [
  762.  
  763.    (eq, 1, 0),
  764.  
  765. -  ],
  766.  
  767. -  "I am thinking of using my connections in {s24}.", "lord_mission_rescue_prisoner_method_connections",[]],
  768.  
  769. +  ], # unused
  770.  
  771. +  "{!}I am thinking of using my connections in {s24}.", "close_window",[]],
  772.  
  773.    
  774.  
  775.    [anyone|plyr,"lord_mission_rescue_prisoner_method", [],
  776.  
  777.    "I am thinking of breaking into the prison in {s24}, finding {s13}, and fighting my way out.", "lord_mission_rescue_prisoner_method_prisonbreak",[]],
  778.  
  779. @@ -15512,15 +15523,8 @@ I suppose there are plenty of bounty hun
  780.         (quest_get_slot, ":quest_target_amount", "qst_capture_prisoners", slot_quest_target_amount),
  781.  
  782.         (assign,reg1,":quest_target_amount"),
  783.  
  784.         (str_store_troop_name_link,s9,"$g_talk_troop"),
  785.  
  786. -##       (str_store_party_name,2,"$g_encountered_party"),
  787.  
  788. -       (str_store_troop_name_by_count,3,":quest_target_troop",":quest_target_amount"),
  789.  
  790. +       (str_store_troop_name_by_count,s3,":quest_target_troop",":quest_target_amount"),
  791.  
  792.         (setup_quest_text,"$random_quest_no"),
  793.  
  794. -##       (try_begin),
  795.  
  796. -##         (is_between, "$g_encountered_party", centers_begin, centers_end),
  797.  
  798. -##         (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
  799.  
  800. -##       (else_try),
  801.  
  802. -##         (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
  803.  
  804. -##       (try_end),
  805.  
  806.         (str_store_string, s2, "@{s9} has requested you to bring him {reg1} {s3} as prisoners."),
  807.  
  808.      ]],
  809.  
  810.    
  811.  
  812. @@ -19857,11 +19861,11 @@ I suppose there are plenty of bounty hun
  813.             (val_add, ":total_value", ":item_value"),
  814.  
  815.           (try_end),
  816.  
  817.      (try_end),
  818.  
  819. -    (store_div, "$deserter_tribute", ":total_value", 10), #10000 gold = excellent_target
  820.  
  821. -    (val_max, "$deserter_tribute", 10),
  822.  
  823. -    (assign,reg(5),"$deserter_tribute")]],
  824.  
  825. -  [anyone|plyr,"deserter_barter_2", [(store_troop_gold,reg(2)),(ge,reg(2),"$deserter_tribute"),(assign,reg(5),"$deserter_tribute")],
  826.  
  827. -   "All right here's your {reg5} denars.", "deserter_barter_3a",[(troop_remove_gold, "trp_player","$deserter_tribute")]],
  828.  
  829. +    (store_div, "$g_tribute_amount", ":total_value", 10), #10000 gold = excellent_target
  830.  
  831. +    (val_max, "$g_tribute_amount", 10),
  832.  
  833. +    (assign,reg(5),"$g_tribute_amount")]],
  834.  
  835. +  [anyone|plyr,"deserter_barter_2", [(store_troop_gold,reg(2)),(ge,reg(2),"$g_tribute_amount"),(assign,reg(5),"$g_tribute_amount")],
  836.  
  837. +   "All right here's your {reg5} denars.", "deserter_barter_3a",[(troop_remove_gold, "trp_player","$g_tribute_amount")]],
  838.  
  839.    [anyone|plyr,"deserter_barter_2", [],
  840.  
  841.     "I don't have that much money with me", "deserter_barter_3b",[]],
  842.  
  843.    [anyone,"deserter_barter_3b", [],
  844.  
  845. @@ -22677,7 +22681,13 @@ I suppose there are plenty of bounty hun
  846.     (faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
  847.  
  848.     (str_store_troop_name, s10, ":faction_leader"),  
  849.  
  850.     (ge, "$g_mayor_given_political_dialog", 1),
  851.  
  852. -  
  853.  
  854. +   (assign, ":continue", 0),
  855.  
  856. +   (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end),
  857.  
  858. +     (faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active),
  859.  
  860. +     (neq, ":cur_faction", "$g_encountered_party_faction"),
  861.  
  862. +     (assign, ":continue", 1), #at least 1 faction is active
  863.  
  864. +   (try_end),
  865.  
  866. +   (eq, ":continue", 1),
  867.  
  868.    ], "What is {s10}'s policy in regards to the other realms of Calradia?", "mayor_politics_assess",[
  869.  
  870.    ]],
  871.  
  872.  
  873.  
  874. @@ -24119,7 +24129,7 @@ I suppose there are plenty of bounty hun
  875.                                             (store_troop_gold, ":gold", "trp_player"),
  876.  
  877.                                             (store_div, ":gold_capacity", ":gold", 10),#10 denars per man
  878.  
  879.                                             (val_min, ":num_volunteers", ":gold_capacity"),
  880.  
  881. -                                           (eq, ":num_volunteers", 0),
  882.  
  883. +                                           (le, ":num_volunteers", 0),
  884.  
  885.                                             ],
  886.  
  887.     "I don't think anyone would be interested, {sir/madam}. Is there anything else I can do for you?", "village_elder_talk",[]],
  888.  
  889.    
  890.  
  891. @@ -25264,7 +25274,7 @@ I suppose there are plenty of bounty hun
  892.    [anyone,"sell_prisoner_outlaws", [[store_troop_kind_count,0,"trp_brigand"],[ge,reg(0),1],[assign,reg(1),reg(0)],[val_mul,reg(1),30],[assign,reg(2),reg(0)],[val_mul,reg(2),30]],
  893.  
  894.     "Well well, you've captured {reg0} brigands. Each one is worth 30 denars, so I'll give you {reg1} for them in total.", "sell_prisoner_outlaws",
  895.  
  896.     [[call_script, "script_troop_add_gold", "trp_player", reg(1)],[add_xp_to_troop,reg(2)],[remove_member_from_party,"trp_brigand"]]],
  897.  
  898. -  [anyone,"sell_prisoner_outlaws", [], "I suppose that'll be all, then.", "sell_prisoner_outlaws_finished",[]],
  899.  
  900. +  [anyone,"sell_prisoner_outlaws", [], "I suppose that'll be all, then.", "close_window",[]],
  901.  
  902.  # Ryan END
  903.  
  904.  
  905.  
  906.    [anyone|plyr,"prisoner_chat", [], "Do not try running away or trying something stupid. I will be watching you.", "prisoner_chat_2",[]],
  907.  
  908. @@ -25437,10 +25447,14 @@ I suppose there are plenty of bounty hun
  909.                                      (str_clear, s5),
  910.  
  911.                                      (assign, ":number_of_goods", 0),
  912.  
  913.                                      (try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
  914.  
  915. -                                      (store_sub, ":cur_good_slot", ":cur_good", trade_goods_begin),
  916.  
  917. -                                      (val_add, ":cur_good_slot", slot_town_trade_good_productions_begin),
  918.  
  919. -                                      (party_get_slot, ":production", "$g_encountered_party", ":cur_good_slot"),
  920.  
  921. -                                      (ge, ":production", 5),
  922.  
  923. +                                      #(store_sub, ":cur_good_slot", ":cur_good", trade_goods_begin),
  924.  
  925. +                                      #(val_add, ":cur_good_slot", slot_town_trade_good_productions_begin),
  926.  
  927. +                                      #(party_get_slot, ":production", "$g_encountered_party", ":cur_good_slot"),
  928.  
  929. +
  930.  
  931. +                                      (call_script, "script_center_get_production", "$g_encountered_party", ":cur_good"),
  932.  
  933. +                                      (assign, ":production", reg0),
  934.  
  935. +                                      (ge, ":production", 20),
  936.  
  937. +
  938.  
  939.                                        (str_store_item_name, s3, ":cur_good"),
  940.  
  941.                                        (try_begin),
  942.  
  943.                                          (eq, ":number_of_goods", 0),
  944.  
  945. diff -rupBN Module_system 1.134//module_game_menus.py Module_system 1.142//module_game_menus.py
  946. --- Module_system 1.134//module_game_menus.py   2010-11-25 19:35:38.000000000 -0800
  947. +++ Module_system 1.142//module_game_menus.py   2011-07-01 10:46:30.000000000 -0700
  948. @@ -4143,52 +4143,49 @@ game_menus = [
  949.        (try_end),
  950.  
  951.        
  952.  
  953.        (try_begin),
  954.  
  955. -        (le, ":minimum_power", 5),
  956.  
  957. +        (le, ":minimum_power", 25),
  958.  
  959.          (assign, ":division_constant", 1),
  960.  
  961.        (else_try),
  962.  
  963. -        (le, ":minimum_power", 10),
  964.  
  965. +        (le, ":minimum_power", 50),
  966.  
  967.          (assign, ":division_constant", 2),
  968.  
  969.        (else_try),
  970.  
  971. -        (le, ":minimum_power", 25),
  972.  
  973. +        (le, ":minimum_power", 75),
  974.  
  975.          (assign, ":division_constant", 3),
  976.  
  977.        (else_try),
  978.  
  979. -        (le, ":minimum_power", 50),
  980.  
  981. +        (le, ":minimum_power", 125),
  982.  
  983.          (assign, ":division_constant", 4),
  984.  
  985.        (else_try),
  986.  
  987. -        (le, ":minimum_power", 100),
  988.  
  989. -        (assign, ":division_constant", 5),
  990.  
  991. -      (else_try),
  992.  
  993.          (le, ":minimum_power", 200),
  994.  
  995. -        (assign, ":division_constant", 6),
  996.  
  997. +        (assign, ":division_constant", 5),
  998.  
  999.        (else_try),
  1000.  
  1001.          (le, ":minimum_power", 400),
  1002.  
  1003. -        (assign, ":division_constant", 7),
  1004.  
  1005. +        (assign, ":division_constant", 6),
  1006.  
  1007.        (else_try),
  1008.  
  1009.          (le, ":minimum_power", 800),
  1010.  
  1011. -        (assign, ":division_constant", 8),
  1012.  
  1013. +        (assign, ":division_constant", 7),
  1014.  
  1015.        (else_try),
  1016.  
  1017.          (le, ":minimum_power", 1600),
  1018.  
  1019. -        (assign, ":division_constant", 9),
  1020.  
  1021. +        (assign, ":division_constant", 8),
  1022.  
  1023.        (else_try),
  1024.  
  1025.          (le, ":minimum_power", 3200),
  1026.  
  1027. -        (assign, ":division_constant", 10),
  1028.  
  1029. +        (assign, ":division_constant", 9),
  1030.  
  1031.        (else_try),
  1032.  
  1033.          (le, ":minimum_power", 6400),
  1034.  
  1035. -        (assign, ":division_constant", 11),
  1036.  
  1037. +        (assign, ":division_constant", 10),
  1038.  
  1039.        (else_try),
  1040.  
  1041.          (le, ":minimum_power", 12800),
  1042.  
  1043. -        (assign, ":division_constant", 12),
  1044.  
  1045. +        (assign, ":division_constant", 11),
  1046.  
  1047.        (else_try),
  1048.  
  1049.          (le, ":minimum_power", 25600),
  1050.  
  1051. -        (assign, ":division_constant", 13),
  1052.  
  1053. +        (assign, ":division_constant", 12),
  1054.  
  1055.        (else_try),
  1056.  
  1057.          (le, ":minimum_power", 51200),
  1058.  
  1059. -        (assign, ":division_constant", 14),
  1060.  
  1061. +        (assign, ":division_constant", 13),
  1062.  
  1063.        (else_try),
  1064.  
  1065.          (le, ":minimum_power", 102400),
  1066.  
  1067. -        (assign, ":division_constant", 15),
  1068.  
  1069. +        (assign, ":division_constant", 14),
  1070.  
  1071.        (else_try),  
  1072.  
  1073. -        (assign, ":division_constant", 16),
  1074.  
  1075. +        (assign, ":division_constant", 15),
  1076.  
  1077.        (try_end),  
  1078.  
  1079.                                                                                
  1080.  
  1081.        (val_div, ":player_party_strength", ":division_constant"), #1.126, ":division_constant" was 5 before
  1082.  
  1083. @@ -5403,13 +5400,13 @@ game_menus = [
  1084.            (call_script, "script_party_count_members_with_full_health", "p_collective_friends"),          
  1085.  
  1086.            (assign, ":ally_num_soldiers", reg0),
  1087.  
  1088.            (eq, "$g_battle_result", -1),
  1089.  
  1090. -          (eq, ":ally_num_soldiers", 0), #battle lost (sdsd = TODO : also compare this with routed allies too like in other parts)
  1091.  
  1092. +          (eq, ":ally_num_soldiers", 0), #battle lost (TODO : also compare this with routed allies too like in other parts)
  1093.  
  1094.            (leave_encounter),
  1095.  
  1096.            (change_screen_return),
  1097.  
  1098.          (try_end),
  1099.  
  1100.          ],
  1101.  
  1102.      [
  1103.  
  1104. -      ("talk_to_siege_commander",[]," Request a meeting with the commander.",[
  1105.  
  1106. +      ("talk_to_siege_commander",[],"Request a meeting with the commander.",[
  1107.  
  1108.                                  (call_script, "script_get_meeting_scene"), (assign, ":meeting_scene", reg0),
  1109.  
  1110.                                  (modify_visitors_at_site,":meeting_scene"),(reset_visitors),
  1111.  
  1112.                                  (set_visitor,0,"trp_player"),
  1113.  
  1114. @@ -6067,7 +6064,7 @@ game_menus = [
  1115.            (call_script, "script_party_count_members_with_full_health", "p_main_party"),
  1116.  
  1117.            (assign, ":main_party_fit_regulars", reg0),
  1118.  
  1119.            (eq, "$g_battle_result", -1),
  1120.  
  1121. -          (eq, ":main_party_fit_regulars", 0), #all lost (sdsd = TODO : )
  1122.  
  1123. +          (eq, ":main_party_fit_regulars", 0), #all lost (TODO : )
  1124.  
  1125.            (assign, "$g_next_menu", "mnu_captivity_start_castle_defeat"),
  1126.  
  1127.            (jump_to_menu, "mnu_total_defeat"),
  1128.  
  1129.          (try_end),
  1130.  
  1131. @@ -6414,12 +6411,12 @@ game_menus = [
  1132.          (assign, "$no_soldiers_left", 0),
  1133.  
  1134.          (try_begin),
  1135.  
  1136.            (call_script, "script_party_count_members_with_full_health","p_main_party"),
  1137.  
  1138. -          (le, reg0, 0), #(sdsd = TODO : compare with num_routed_us)
  1139.  
  1140. +          (le, reg0, 0), #(TODO : compare with num_routed_us)
  1141.  
  1142.            (assign, "$no_soldiers_left", 1),
  1143.  
  1144.            (str_store_string, s4, "str_attack_walls_failure"),
  1145.  
  1146.          (else_try),
  1147.  
  1148.            (call_script, "script_party_count_members_with_full_health","$g_encountered_party"),
  1149.  
  1150. -          (le, reg0, 0), #(sdsd = TODO : compare with num_routed_enemies)
  1151.  
  1152. +          (le, reg0, 0), #(TODO : compare with num_routed_enemies)
  1153.  
  1154.            (assign, "$no_soldiers_left", 1),
  1155.  
  1156.            (assign, "$g_battle_result", 1),
  1157.  
  1158.            (str_store_string, s4, "str_attack_walls_success"),
  1159.  
  1160. @@ -6503,12 +6500,12 @@ game_menus = [
  1161.          (assign, "$no_soldiers_left", 0),
  1162.  
  1163.          (try_begin),
  1164.  
  1165.            (call_script, "script_party_count_members_with_full_health", "p_main_party"),
  1166.  
  1167. -          (le, reg0, 0), #(sdsd = TODO : compare with num_routed_us)
  1168.  
  1169. +          (le, reg0, 0), #(TODO : compare with num_routed_us)
  1170.  
  1171.            (assign, "$no_soldiers_left", 1),
  1172.  
  1173.            (str_store_string, s4, "str_attack_walls_failure"),
  1174.  
  1175.          (else_try),
  1176.  
  1177.            (call_script, "script_party_count_members_with_full_health", "p_collective_enemy"),
  1178.  
  1179. -          (le, reg0, 0), #(sdsd = TODO : compare with num_routed_enemies)
  1180.  
  1181. +          (le, reg0, 0), #(TODO : compare with num_routed_enemies)
  1182.  
  1183.            (assign, "$no_soldiers_left", 1),
  1184.  
  1185.            (assign, "$g_battle_result", 1),
  1186.  
  1187.            (str_store_string, s4, "str_attack_walls_success"),
  1188.  
  1189. @@ -7120,7 +7117,7 @@ game_menus = [
  1190.              (assign, ":enemy_finished", 0),
  1191.  
  1192.              (try_begin),
  1193.  
  1194.                (eq, "$g_battle_result", 1),
  1195.  
  1196. -              (eq, ":num_enemy_regulars_remaining", 0), #battle won (sdsd = TODO : compare with num_routed_us)
  1197.  
  1198. +              (eq, ":num_enemy_regulars_remaining", 0), #battle won (TODO : compare with num_routed_us)
  1199.  
  1200.                (assign, ":enemy_finished",1),
  1201.  
  1202.              (else_try),
  1203.  
  1204.                (eq, "$g_engaged_enemy", 1),
  1205.  
  1206. @@ -7137,7 +7134,7 @@ game_menus = [
  1207.              (try_begin),
  1208.  
  1209.                (this_or_next|eq, "$g_battle_result", -1),
  1210.  
  1211.                (troop_is_wounded,  "trp_player"),
  1212.  
  1213. -              (eq, ":num_ally_regulars_remaining", 0), #(sdsd = TODO : compare with num_routed_allies)
  1214.  
  1215. +              (eq, ":num_ally_regulars_remaining", 0), #(TODO : compare with num_routed_allies)
  1216.  
  1217.                (assign, ":battle_lost",1),
  1218.  
  1219.              (try_end),
  1220.  
  1221.              (this_or_next|eq, ":battle_lost",1),
  1222.  
  1223. @@ -7573,6 +7570,20 @@ game_menus = [
  1224.             (call_script, "script_cf_enter_center_location_bandit_check"),
  1225.  
  1226.           (else_try),
  1227.  
  1228.             (party_get_slot, ":merchant_troop", "$current_town", slot_town_elder),
  1229.  
  1230. +
  1231.  
  1232. +      #(try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
  1233.  
  1234. +        #(store_sub, ":cur_good_price_slot", ":cur_goods", trade_goods_begin),
  1235.  
  1236. +        #(val_add, ":cur_good_price_slot", slot_town_trade_good_prices_begin),
  1237.  
  1238. +       #(party_get_slot, ":cur_price", "$current_town", ":cur_good_price_slot"),
  1239.  
  1240. +       #(call_script, "script_center_get_production", "$current_town", ":cur_goods"),
  1241.  
  1242. +        #(assign, reg13, reg0),
  1243.  
  1244. +       #(call_script, "script_center_get_consumption", "$current_town", ":cur_goods"),
  1245.  
  1246. +        #(str_store_party_name, s1, "$current_town"),
  1247.  
  1248. +        #(str_store_item_name, s2, ":cur_goods"),
  1249.  
  1250. +       #(assign, reg16, ":cur_price"),
  1251.  
  1252. +        #(display_log_message, "@DEBUG:{s1}-{s2}, prd: {reg13}, con: {reg0}, raw: {reg1}, cns: {reg2}, fee: {reg16}"),
  1253.  
  1254. +     #(try_end),
  1255.  
  1256. +
  1257.  
  1258.             (change_screen_trade, ":merchant_troop"),
  1259.  
  1260.           (try_end),
  1261.  
  1262.           ]),
  1263.  
  1264. @@ -8411,8 +8422,52 @@ game_menus = [
  1265.              (party_set_slot, "$current_town", slot_village_number_of_cattle, ":num_cattle"),
  1266.  
  1267.            (try_end),
  1268.  
  1269.            (troop_clear_inventory, "trp_temp_troop"),
  1270.  
  1271. +
  1272.  
  1273. +         #below line changed with below lines to make plunder result more realistic. Now only items produced in bound town can be stolen after raid.
  1274.  
  1275. +          #(reset_item_probabilities,100),
  1276.  
  1277. +
  1278.  
  1279. +         #begin of changes
  1280.  
  1281. +         (party_get_slot, ":bound_town", slot_village_bound_center, "$current_town"),
  1282.  
  1283. +          (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
  1284.  
  1285.            (reset_item_probabilities,100),
  1286.  
  1287. -          (troop_add_merchandise,"trp_temp_troop",itp_type_goods,45),
  1288.  
  1289. +          (assign, ":total_probability", 0),
  1290.  
  1291. +          (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
  1292.  
  1293. +            (store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"),
  1294.  
  1295. +            (party_get_slot, ":cur_price", ":bound_town", ":cur_price_slot"),
  1296.  
  1297. +            (call_script, "script_center_get_production", ":bound_town", ":cur_goods"),
  1298.  
  1299. +            (assign, ":cur_probability", reg0),
  1300.  
  1301. +            (call_script, "script_center_get_consumption", ":bound_town", ":cur_goods"),
  1302.  
  1303. +            (val_div, reg0, 3),
  1304.  
  1305. +            (val_add, ":cur_probability", reg0),
  1306.  
  1307. +            (val_mul, ":cur_probability", 4),
  1308.  
  1309. +            (val_mul, ":cur_probability", average_price_factor),
  1310.  
  1311. +            (val_div, ":cur_probability", ":cur_price"),
  1312.  
  1313. +           #first only simulation
  1314.  
  1315. +            #(set_item_probability_in_merchandise,":cur_goods",":cur_probability"),                         
  1316.  
  1317. +           (val_add, ":total_probability", ":cur_probability"),
  1318.  
  1319. +          (try_end),
  1320.  
  1321. +
  1322.  
  1323. +          (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
  1324.  
  1325. +            (store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"),
  1326.  
  1327. +            (party_get_slot, ":cur_price", ":bound_town", ":cur_price_slot"),
  1328.  
  1329. +            (call_script, "script_center_get_production", ":bound_town", ":cur_goods"),
  1330.  
  1331. +            (assign, ":cur_probability", reg0),
  1332.  
  1333. +            (call_script, "script_center_get_consumption", ":bound_town", ":cur_goods"),
  1334.  
  1335. +            (val_div, reg0, 3),
  1336.  
  1337. +            (val_add, ":cur_probability", reg0),
  1338.  
  1339. +            (val_mul, ":cur_probability", 4),
  1340.  
  1341. +            (val_mul, ":cur_probability", average_price_factor),
  1342.  
  1343. +            (val_div, ":cur_probability", ":cur_price"),
  1344.  
  1345. +
  1346.  
  1347. +           (val_mul, ":cur_probability", num_merchandise_goods),
  1348.  
  1349. +           (val_mul, ":cur_probability", 100),
  1350.  
  1351. +           (val_div, ":cur_probability", ":total_probability"),
  1352.  
  1353. +
  1354.  
  1355. +            (set_item_probability_in_merchandise,":cur_goods",":cur_probability"),                      
  1356.  
  1357. +          (try_end),
  1358.  
  1359. +         #end of changes
  1360.  
  1361. +
  1362.  
  1363. +          (troop_add_merchandise,"trp_temp_troop",itp_type_goods,30),
  1364.  
  1365.            (troop_sort_inventory, "trp_temp_troop"),
  1366.  
  1367.            (change_screen_loot, "trp_temp_troop"),
  1368.  
  1369.          ]),
  1370.  
  1371. @@ -8489,7 +8544,7 @@ game_menus = [
  1372.            (is_between, "$g_encountered_party", towns_begin, towns_end),
  1373.  
  1374.            (store_sub, ":encountered_town_no", "$g_encountered_party", towns_begin),
  1375.  
  1376.            (set_achievement_stat, ACHIEVEMENT_MIGRATING_COCONUTS, ":encountered_town_no", 1),
  1377.  
  1378. -          
  1379.  
  1380. +
  1381.  
  1382.            (assign, ":there_are_villages_not_visited", 0),
  1383.  
  1384.            (try_for_range, ":cur_town", towns_begin, towns_end),
  1385.  
  1386.              (store_sub, ":encountered_town_no", ":cur_town", towns_begin),
  1387.  
  1388. @@ -10908,13 +10963,11 @@ game_menus = [
  1389.         (store_sub, ":cur_good_price_slot", ":cur_good", trade_goods_begin),
  1390.  
  1391.         (val_add, ":cur_good_price_slot", slot_town_trade_good_prices_begin),
  1392.  
  1393.         (party_get_slot, ":price", "$g_encountered_party", ":cur_good_price_slot"),
  1394.  
  1395. -      
  1396.  
  1397. -      
  1398.  
  1399. +          
  1400.  
  1401.        (assign, ":total_centers", 0),
  1402.  
  1403.        (assign, ":calradian_average_price", 0),
  1404.  
  1405.        (assign, ":calradian_average_production", 0),
  1406.  
  1407.        (assign, ":calradian_average_consumption", 0),
  1408.  
  1409. -
  1410.  
  1411.        
  1412.  
  1413.        (try_for_range, ":center", centers_begin, centers_end),
  1414.  
  1415.         (neg|is_between, ":center", castles_begin, castles_end),
  1416.  
  1417. @@ -10963,10 +11016,7 @@ game_menus = [
  1418.        (item_get_slot, ":production_string", ":cur_good", slot_item_production_string),
  1419.  
  1420.        (str_store_string, s4, ":production_string"),
  1421.  
  1422.        
  1423.  
  1424. -       (str_store_string, s1, "str___s3_price_=_reg4_calradian_average_reg6_capital_reg11_s4_base_reg1modified_by_raw_material_reg2modified_by_prosperity_reg3_calradian_average_production_base_reg5_total_reg12_consumed_reg7used_as_raw_material_reg8modified_total_reg9_calradian_consumption_base_reg10_total_reg13s1_"),
  1425.  
  1426. -
  1427.  
  1428. -      
  1429.  
  1430. -      
  1431.  
  1432. +       (str_store_string, s1, "str___s3_price_=_reg4_calradian_average_reg6_capital_reg11_s4_base_reg1modified_by_raw_material_reg2modified_by_prosperity_reg3_calradian_average_production_base_reg5_total_reg12_consumed_reg7used_as_raw_material_reg8modified_total_reg9_calradian_consumption_base_reg10_total_reg13s1_"),        
  1433.  
  1434.       (try_end),
  1435.  
  1436.      
  1437.  
  1438.      
  1439.  
  1440. @@ -11084,13 +11134,27 @@ game_menus = [
  1441.       (store_sub, ":num_goods", trade_goods_end, trade_goods_begin),
  1442.  
  1443.       (store_mul, ":max_iteration", ":num_towns", ":num_goods"),
  1444.  
  1445.       (val_mul, ":max_iteration", ":max_skill"),
  1446.  
  1447. -     (val_div, ":max_iteration", 20),
  1448.  
  1449. +     (val_div, ":max_iteration", 15),
  1450.  
  1451.  
  1452.  
  1453.       (assign, ":org_encountered_party", "$g_encountered_party"),
  1454.  
  1455.  
  1456.  
  1457.       (try_for_range, ":unused", 0, ":max_iteration"),
  1458.  
  1459.         (store_random_in_range, ":random_trade_good", trade_goods_begin, trade_goods_end),
  1460.  
  1461.         (store_random_in_range, ":random_town", towns_begin, towns_end),
  1462.  
  1463. +      
  1464.  
  1465. +      (party_get_slot, ":cur_merchant", ":org_encountered_party", slot_town_merchant),    
  1466.  
  1467. +      (assign, ":item_found", 0),
  1468.  
  1469. +       #(troop_get_inventory_capacity, ":inv_size", ":cur_merchant"),
  1470.  
  1471. +       (try_for_range, ":i_slot", num_equipment_kinds, max_inventory_items + num_equipment_kinds),
  1472.  
  1473. +         (troop_get_inventory_slot, ":slot_item", ":cur_merchant", ":i_slot"),
  1474.  
  1475. +        (try_begin),
  1476.  
  1477. +          (eq, ":slot_item", ":random_trade_good"),
  1478.  
  1479. +          (assign, ":item_found", 1),
  1480.  
  1481. +        (try_end),
  1482.  
  1483. +      (try_end),
  1484.  
  1485. +          
  1486.  
  1487. +      (eq, ":item_found", 1),
  1488.  
  1489. +
  1490.  
  1491.         (assign, ":already_best", 0),
  1492.  
  1493.         (try_begin),
  1494.  
  1495.           (eq, ":random_trade_good", ":best_result_1_item"),
  1496.  
  1497. @@ -11107,7 +11171,7 @@ game_menus = [
  1498.         (try_end),
  1499.  
  1500.         (eq, ":already_best", 0),
  1501.  
  1502.         (store_item_value, ":random_trade_good_price", ":random_trade_good"),
  1503.  
  1504. -       (assign, "$g_encountered_party", ":org_encountered_party"),
  1505.  
  1506. +       (assign, "$g_encountered_party", ":org_encountered_party"),    
  1507.  
  1508.         (call_script, "script_game_get_item_buy_price_factor", ":random_trade_good"),
  1509.  
  1510.         (store_mul, ":random_trade_good_buy_price", ":random_trade_good_price", reg0),
  1511.  
  1512.         (val_div, ":random_trade_good_buy_price", 100),
  1513.  
  1514. @@ -11359,6 +11423,19 @@ game_menus = [
  1515.          (party_remove_prisoners, "$g_ransom_offer_party", "$g_ransom_offer_troop", 1),
  1516.  
  1517.          #(troop_set_slot, "$g_ransom_offer_troop", slot_troop_is_prisoner, 0),
  1518.  
  1519.          (call_script, "script_remove_troop_from_prison", "$g_ransom_offer_troop"),
  1520.  
  1521. +
  1522.  
  1523. +        (try_begin),
  1524.  
  1525. +            (troop_get_type, ":is_female", "trp_player"),
  1526.  
  1527. +            (eq, ":is_female", 1),
  1528.  
  1529. +
  1530.  
  1531. +            (get_achievement_stat, ":number_of_lords_sold", ACHIEVEMENT_MEN_HANDLER, 1),
  1532.  
  1533. +            (val_add, ":number_of_lords_sold", 1),
  1534.  
  1535. +            (set_achievement_stat, ACHIEVEMENT_MEN_HANDLER, 1, ":number_of_lords_sold"),
  1536.  
  1537. +
  1538.  
  1539. +            (eq, ":number_of_lords_sold", 3),
  1540.  
  1541. +            (unlock_achievement, ACHIEVEMENT_MEN_HANDLER),
  1542.  
  1543. +        (try_end),
  1544.  
  1545. +
  1546.  
  1547.          (change_screen_return),
  1548.  
  1549.          ]),
  1550.  
  1551.        ("ransom_reject",[],"Reject the offer.",
  1552.  
  1553. @@ -13100,7 +13177,12 @@ game_menus = [
  1554.       (else_try),
  1555.  
  1556.         (unlock_achievement, ACHIEVEMENT_MANIFEST_DESTINY),
  1557.  
  1558.       (try_end),
  1559.  
  1560. -    
  1561.  
  1562. +
  1563.  
  1564. +        (try_begin),
  1565.  
  1566. +            (troop_get_type, ":is_female", "trp_player"),
  1567.  
  1568. +            (eq, ":is_female", 1),
  1569.  
  1570. +            (unlock_achievement, ACHIEVEMENT_EMPRESS),
  1571.  
  1572. +        (try_end),  
  1573.  
  1574.        ],
  1575.  
  1576.      [
  1577.  
  1578.        ("continue",[],"Continue...",
  1579.  
  1580. diff -rupBN Module_system 1.134//module_items.py Module_system 1.142//module_items.py
  1581. --- Module_system 1.134//module_items.py    2010-12-02 16:05:06.000000000 -0800
  1582. +++ Module_system 1.142//module_items.py    2011-05-09 15:12:24.000000000 -0700
  1583. @@ -299,11 +299,11 @@ items = [
  1584.  ["leather_boots", "Leather Boots", [("leather_boots_a",0)], itp_merchandise| itp_type_foot_armor  |itp_civilian | itp_attach_armature,0,
  1585.  
  1586.   174 , weight(1.25)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(16)|difficulty(0) ,imodbits_cloth ],
  1587.  
  1588.  ["splinted_leather_greaves", "Splinted Leather Greaves", [("leather_greaves_a",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature,0,
  1589.  
  1590. - 310 , weight(3)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(21)|difficulty(0) ,imodbits_armor ],
  1591.  
  1592. + 310 , weight(2)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(21)|difficulty(0) ,imodbits_armor ],
  1593.  
  1594.  ["mail_chausses", "Mail Chausses", [("mail_chausses_a",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature  ,0,
  1595.  
  1596.   530 , weight(3)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(24)|difficulty(0) ,imodbits_armor ],
  1597.  
  1598.  ["splinted_greaves", "Splinted Greaves", [("splinted_greaves_a",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature,0,
  1599.  
  1600. - 853 , weight(3.5)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(28)|difficulty(7) ,imodbits_armor ],
  1601.  
  1602. + 853 , weight(2.75)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(28)|difficulty(7) ,imodbits_armor ],
  1603.  
  1604.  ["mail_boots", "Mail Boots", [("mail_boots_a",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature  ,0,
  1605.  
  1606.   1250 , weight(3)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(31)|difficulty(8) ,imodbits_armor ],
  1607.  
  1608.  ["iron_greaves", "Iron Greaves", [("iron_greaves_a",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature,0,
  1609.  
  1610. @@ -315,11 +315,11 @@ items = [
  1611.  ["sarranid_boots_a", "Sarranid Shoes", [("sarranid_shoes",0)], itp_type_foot_armor |itp_civilian | itp_attach_armature ,0,
  1612.  
  1613.   30 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(8)|difficulty(0) ,imodbits_cloth ],
  1614.  
  1615.  ["sarranid_boots_b", "Sarranid Leather Boots", [("sarranid_boots",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature ,0,
  1616.  
  1617. - 120 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(16)|difficulty(0) ,imodbits_cloth ],
  1618.  
  1619. + 120 , weight(2)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(16)|difficulty(0) ,imodbits_cloth ],
  1620.  
  1621.  ["sarranid_boots_c", "Plated Boots", [("sarranid_camel_boots",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature ,0,
  1622.  
  1623. - 280 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(20)|difficulty(0) ,imodbits_plate ],
  1624.  
  1625. + 280 , weight(3)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(20)|difficulty(0) ,imodbits_plate ],
  1626.  
  1627.  ["sarranid_boots_d", "Sarranid Mail Boots", [("sarranid_mail_chausses",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature ,0,
  1628.  
  1629. - 920 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(30)|difficulty(0) ,imodbits_armor ],
  1630.  
  1631. + 920 , weight(3)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(30)|difficulty(0) ,imodbits_armor ],
  1632.  
  1633.  
  1634.  
  1635.  ["sarranid_head_cloth", "Lady Head Cloth", [("tulbent",0)],  itp_type_head_armor | itp_doesnt_cover_hair |itp_civilian |itp_attach_armature,0, 1 , weight(0.5)|abundance(100)|head_armor(4)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
  1636.  
  1637.  ["sarranid_head_cloth_b", "Lady Head Cloth", [("tulbent_b",0)],  itp_type_head_armor | itp_doesnt_cover_hair |itp_civilian |itp_attach_armature,0, 1 , weight(0.5)|abundance(100)|head_armor(4)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
  1638.  
  1639. @@ -572,7 +572,7 @@ items = [
  1640.  ["woolen_cap", "Woolen Cap", [("woolen_cap_new",0)], itp_merchandise| itp_type_head_armor  |itp_civilian ,0, 2 , weight(1)|abundance(100)|head_armor(6)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
  1641.  
  1642.  ["felt_hat", "Felt Hat", [("felt_hat_a_new",0)], itp_merchandise| itp_type_head_armor |itp_civilian,0, 4 , weight(1)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
  1643.  
  1644.  ["felt_hat_b", "Felt Hat", [("felt_hat_b_new",0)], itp_merchandise| itp_type_head_armor |itp_civilian,0, 4 , weight(1)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
  1645.  
  1646. -["leather_cap", "Leather Cap", [("leather_cap_a_new",0)], itp_merchandise| itp_type_head_armor|itp_civilian ,0, 6 , weight(1)|abundance(100)|head_armor(10)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
  1647.  
  1648. +["leather_cap", "Leather Cap", [("leather_cap_a_new",0)], itp_merchandise| itp_type_head_armor|itp_civilian ,0, 8, weight(1)|abundance(100)|head_armor(18)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
  1649.  
  1650.  ["female_hood", "Lady's Hood", [("ladys_hood_new",0)], itp_merchandise| itp_type_head_armor |itp_civilian  ,0, 9 , weight(1)|abundance(100)|head_armor(10)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
  1651.  
  1652.  ["leather_steppe_cap_a", "Steppe Cap", [("leather_steppe_cap_a_new",0)], itp_merchandise|itp_type_head_armor   ,0,
  1653.  
  1654.  24 , weight(1)|abundance(100)|head_armor(12)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
  1655.  
  1656. @@ -598,13 +598,13 @@ items = [
  1657.  ["khergit_lady_hat", "Khergit Lady Hat", [("khergit_lady_hat",0)],  itp_type_head_armor   |itp_civilian |itp_doesnt_cover_hair | itp_fit_to_head,0, 1 , weight(0.5)|abundance(100)|head_armor(4)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
  1658.  
  1659.  ["khergit_lady_hat_b", "Khergit Lady Leather Hat", [("khergit_lady_hat_b",0)], itp_type_head_armor  | itp_doesnt_cover_hair | itp_fit_to_head  |itp_civilian ,0, 1 , weight(0.5)|abundance(100)|head_armor(4)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
  1660.  
  1661.  ["sarranid_felt_hat", "Sarranid Felt Hat", [("sar_helmet3",0)], itp_merchandise| itp_type_head_armor   ,0, 16 , weight(2)|abundance(100)|head_armor(5)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_cloth ],
  1662.  
  1663. -["turban", "Turban", [("tuareg_open",0)], itp_merchandise| itp_type_head_armor   ,0, 28 , weight(2)|abundance(100)|head_armor(11)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_cloth ],
  1664.  
  1665. -["desert_turban", "Desert Turban", [("tuareg",0)], itp_merchandise| itp_type_head_armor | itp_covers_beard ,0, 38 , weight(2)|abundance(100)|head_armor(14)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_cloth ],
  1666.  
  1667. +["turban", "Turban", [("tuareg_open",0)], itp_merchandise| itp_type_head_armor   ,0, 28 , weight(1)|abundance(100)|head_armor(11)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_cloth ],
  1668.  
  1669. +["desert_turban", "Desert Turban", [("tuareg",0)], itp_merchandise| itp_type_head_armor | itp_covers_beard ,0, 38 , weight(1.50)|abundance(100)|head_armor(14)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_cloth ],
  1670.  
  1671.  ["sarranid_warrior_cap", "Sarranid Warrior Cap", [("tuareg_helmet",0)], itp_merchandise| itp_type_head_armor | itp_covers_beard  ,0, 90 , weight(2)|abundance(100)|head_armor(19)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1672.  
  1673. -["sarranid_horseman_helmet", "Horseman Helmet", [("sar_helmet2",0)], itp_merchandise| itp_type_head_armor   ,0, 180 , weight(2)|abundance(100)|head_armor(25)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1674.  
  1675. -["sarranid_helmet1", "Sarranid Keffiyeh Helmet", [("sar_helmet1",0)], itp_merchandise| itp_type_head_armor   ,0, 290 , weight(2)|abundance(100)|head_armor(35)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1676.  
  1677. -["sarranid_mail_coif", "Sarranid Mail Coif", [("tuareg_helmet2",0)], itp_merchandise| itp_type_head_armor ,0, 430 , weight(2)|abundance(100)|head_armor(41)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1678.  
  1679. -["sarranid_veiled_helmet", "Sarranid Veiled Helmet", [("sar_helmet4",0)], itp_merchandise| itp_type_head_armor | itp_covers_beard  ,0, 810 , weight(2)|abundance(100)|head_armor(47)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1680.  
  1681. +["sarranid_horseman_helmet", "Horseman Helmet", [("sar_helmet2",0)], itp_merchandise| itp_type_head_armor   ,0, 180 , weight(2.75)|abundance(100)|head_armor(25)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1682.  
  1683. +["sarranid_helmet1", "Sarranid Keffiyeh Helmet", [("sar_helmet1",0)], itp_merchandise| itp_type_head_armor   ,0, 290 , weight(2.50)|abundance(100)|head_armor(35)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1684.  
  1685. +["sarranid_mail_coif", "Sarranid Mail Coif", [("tuareg_helmet2",0)], itp_merchandise| itp_type_head_armor ,0, 430 , weight(3)|abundance(100)|head_armor(41)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1686.  
  1687. +["sarranid_veiled_helmet", "Sarranid Veiled Helmet", [("sar_helmet4",0)], itp_merchandise| itp_type_head_armor | itp_covers_beard  ,0, 810 , weight(3.50)|abundance(100)|head_armor(47)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1688.  
  1689.  ["nordic_archer_helmet", "Nordic Leather Helmet", [("Helmet_A_vs2",0)], itp_merchandise| itp_type_head_armor    ,0, 40 , weight(1.25)|abundance(100)|head_armor(14)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1690.  
  1691.  ["nordic_veteran_archer_helmet", "Nordic Leather Helmet", [("Helmet_A",0)], itp_merchandise| itp_type_head_armor,0, 70 , weight(1.5)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1692.  
  1693.  ["nordic_footman_helmet", "Nordic Footman Helmet", [("Helmet_B_vs2",0)], itp_merchandise| itp_type_head_armor |itp_fit_to_head ,0, 150 , weight(1.75)|abundance(100)|head_armor(30)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1694.  
  1695. @@ -612,13 +612,13 @@ items = [
  1696.  ["nordic_huscarl_helmet", "Nordic Huscarl's Helmet", [("Helmet_C_vs2",0)], itp_merchandise| itp_type_head_armor   ,0, 390 , weight(2)|abundance(100)|head_armor(40)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1697.  
  1698.  ["nordic_warlord_helmet", "Nordic Warlord Helmet", [("Helmet_C",0)], itp_merchandise| itp_type_head_armor ,0, 880 , weight(2.25)|abundance(100)|head_armor(48)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1699.  
  1700.  
  1701.  
  1702. -["vaegir_fur_cap", "Cap with Fur", [("vaeg_helmet3",0)], itp_merchandise| itp_type_head_armor   ,0, 50 , weight(2)|abundance(100)|head_armor(15)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1703.  
  1704. +["vaegir_fur_cap", "Cap with Fur", [("vaeg_helmet3",0)], itp_merchandise| itp_type_head_armor   ,0, 50 , weight(1)|abundance(100)|head_armor(15)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1705.  
  1706.  ["vaegir_fur_helmet", "Vaegir Helmet", [("vaeg_helmet2",0)], itp_merchandise| itp_type_head_armor   ,0, 110 , weight(2)|abundance(100)|head_armor(21)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1707.  
  1708. -["vaegir_spiked_helmet", "Spiked Cap", [("vaeg_helmet1",0)], itp_merchandise| itp_type_head_armor   ,0, 230 , weight(2)|abundance(100)|head_armor(32)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1709.  
  1710. -["vaegir_lamellar_helmet", "Helmet with Lamellar Guard", [("vaeg_helmet4",0)], itp_merchandise| itp_type_head_armor   ,0, 360 , weight(2)|abundance(100)|head_armor(38)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1711.  
  1712. -["vaegir_noble_helmet", "Vaegir Nobleman Helmet", [("vaeg_helmet7",0)], itp_merchandise| itp_type_head_armor   ,0, 710, weight(2)|abundance(100)|head_armor(45)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1713.  
  1714. -["vaegir_war_helmet", "Vaegir War Helmet", [("vaeg_helmet6",0)], itp_merchandise| itp_type_head_armor   ,0, 820 , weight(2)|abundance(100)|head_armor(47)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1715.  
  1716. -["vaegir_mask", "Vaegir War Mask", [("vaeg_helmet9",0)], itp_merchandise| itp_type_head_armor |itp_covers_beard ,0, 950 , weight(2)|abundance(100)|head_armor(52)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1717.  
  1718. +["vaegir_spiked_helmet", "Spiked Cap", [("vaeg_helmet1",0)], itp_merchandise| itp_type_head_armor   ,0, 230 , weight(2.50)|abundance(100)|head_armor(32)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1719.  
  1720. +["vaegir_lamellar_helmet", "Helmet with Lamellar Guard", [("vaeg_helmet4",0)], itp_merchandise| itp_type_head_armor   ,0, 360 , weight(2.75)|abundance(100)|head_armor(38)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1721.  
  1722. +["vaegir_noble_helmet", "Vaegir Nobleman Helmet", [("vaeg_helmet7",0)], itp_merchandise| itp_type_head_armor   ,0, 710, weight(2.75)|abundance(100)|head_armor(45)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1723.  
  1724. +["vaegir_war_helmet", "Vaegir War Helmet", [("vaeg_helmet6",0)], itp_merchandise| itp_type_head_armor   ,0, 820 , weight(3)|abundance(100)|head_armor(47)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1725.  
  1726. +["vaegir_mask", "Vaegir War Mask", [("vaeg_helmet9",0)], itp_merchandise| itp_type_head_armor |itp_covers_beard ,0, 950 , weight(3.50)|abundance(100)|head_armor(52)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ],
  1727.  
  1728.  
  1729.  
  1730.  #TODO:
  1731.  
  1732.  #["skullcap_b", "Skullcap_b", [("skull_cap_new_b",0)], itp_merchandise| itp_type_head_armor   ,0, 71 , weight(1.5)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_plate ],
  1733.  
  1734. @@ -646,7 +646,7 @@ items = [
  1735.  122 , weight(3.5)|difficulty(0)|spd_rtng(103) | weapon_length(70)|swing_damage(24 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1736.  
  1737.  ["spiked_mace",         "Spiked Mace", [("spiked_mace_new",0)], itp_type_one_handed_wpn|itp_can_knock_down|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
  1738.  
  1739.  180 , weight(3.5)|difficulty(0)|spd_rtng(98) | weapon_length(70)|swing_damage(28 , blunt) | thrust_damage(0 ,  pierce),imodbits_pick ],
  1740.  
  1741. -["military_hammer", "Military Hammer", [("military_hammer",0)], itp_type_one_handed_wpn|itp_can_knock_down|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip,
  1742.  
  1743. +["military_hammer", "Military Hammer", [("military_hammer",0)], itp_type_one_handed_wpn|itp_can_knock_down|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
  1744.  
  1745.  317 , weight(2)|difficulty(0)|spd_rtng(95) | weapon_length(70)|swing_damage(31 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1746.  
  1747.  ["maul",         "Maul", [("maul_b",0)], itp_crush_through|itp_type_two_handed_wpn|itp_merchandise|itp_can_knock_down |itp_primary|itp_two_handed|itp_wooden_parry|itp_wooden_attack|itp_unbalanced, itc_nodachi|itcf_carry_spear,
  1748.  
  1749.  97 , weight(6)|difficulty(11)|spd_rtng(83) | weapon_length(79)|swing_damage(36 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1750.  
  1751. @@ -654,15 +654,15 @@ items = [
  1752.  101 , weight(7)|difficulty(12)|spd_rtng(81) | weapon_length(82)|swing_damage(39, blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1753.  
  1754.  ["warhammer",         "Great Hammer", [("maul_d",0)], itp_crush_through|itp_type_two_handed_wpn|itp_merchandise|itp_can_knock_down|itp_primary|itp_two_handed|itp_wooden_parry|itp_wooden_attack|itp_unbalanced, itc_nodachi|itcf_carry_spear,
  1755.  
  1756.  290 , weight(9)|difficulty(14)|spd_rtng(79) | weapon_length(75)|swing_damage(45 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1757.  
  1758. -["pickaxe",         "Pickaxe", [("fighting_pick_new",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip,
  1759.  
  1760. +["pickaxe",         "Pickaxe", [("fighting_pick_new",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
  1761.  
  1762.  27 , weight(3)|difficulty(0)|spd_rtng(99) | weapon_length(70)|swing_damage(19 , pierce) | thrust_damage(0 ,  pierce),imodbits_pick ],
  1763.  
  1764.  ["spiked_club",         "Spiked Club", [("spiked_club",0)], itp_type_one_handed_wpn|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
  1765.  
  1766.  83 , weight(3)|difficulty(0)|spd_rtng(97) | weapon_length(70)|swing_damage(21 , pierce) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1767.  
  1768. -["fighting_pick", "Fighting Pick", [("fighting_pick_new",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip,
  1769.  
  1770. +["fighting_pick", "Fighting Pick", [("fighting_pick_new",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
  1771.  
  1772.  108 , weight(1.0)|difficulty(0)|spd_rtng(98) | weapon_length(70)|swing_damage(22 , pierce) | thrust_damage(0 ,  pierce),imodbits_pick ],
  1773.  
  1774. -["military_pick", "Military Pick", [("steel_pick_new",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip,
  1775.  
  1776. +["military_pick", "Military Pick", [("steel_pick_new",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
  1777.  
  1778.  280 , weight(1.5)|difficulty(0)|spd_rtng(97) | weapon_length(70)|swing_damage(31 , pierce) | thrust_damage(0 ,  pierce),imodbits_pick ],
  1779.  
  1780. -["morningstar",         "Morningstar", [("mace_morningstar_new",0)], itp_crush_through|itp_type_two_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry|itp_unbalanced, itc_morningstar|itcf_carry_axe_left_hip,
  1781.  
  1782. +["morningstar",         "Morningstar", [("mace_morningstar_new",0)], itp_crush_through|itp_type_two_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry|itp_unbalanced, itc_morningstar|itcf_carry_mace_left_hip,
  1783.  
  1784.  305 , weight(4.5)|difficulty(13)|spd_rtng(95) | weapon_length(85)|swing_damage(38 , pierce) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790. @@ -693,11 +693,11 @@ items = [
  1791.  ["arabian_sword_a",         "Sarranid Sword", [("arabian_sword_a",0),("scab_arabian_sword_a", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
  1792.  
  1793.  108 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(97)|swing_damage(26 , cut) | thrust_damage(19 ,  pierce),imodbits_sword_high ],
  1794.  
  1795.  ["arabian_sword_b",         "Sarranid Arming Sword", [("arabian_sword_b",0),("scab_arabian_sword_b", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
  1796.  
  1797. -218 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(97)|swing_damage(28 , cut) | thrust_damage(19 ,  pierce),imodbits_sword_high ],
  1798.  
  1799. +218 , weight(1.7)|difficulty(0)|spd_rtng(99) | weapon_length(97)|swing_damage(28 , cut) | thrust_damage(19 ,  pierce),imodbits_sword_high ],
  1800.  
  1801.  ["sarranid_cavalry_sword",         "Sarranid Cavalry Sword", [("arabian_sword_c",0),("scab_arabian_sword_c", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
  1802.  
  1803.  310 , weight(1.5)|difficulty(0)|spd_rtng(98) | weapon_length(105)|swing_damage(28 , cut) | thrust_damage(19 ,  pierce),imodbits_sword_high ],
  1804.  
  1805.  ["arabian_sword_d",         "Sarranid Guard Sword", [("arabian_sword_d",0),("scab_arabian_sword_d", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
  1806.  
  1807. -420 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(97)|swing_damage(30 , cut) | thrust_damage(20 ,  pierce),imodbits_sword_high ],
  1808.  
  1809. +420 , weight(1.7)|difficulty(0)|spd_rtng(99) | weapon_length(97)|swing_damage(30 , cut) | thrust_damage(20 ,  pierce),imodbits_sword_high ],
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  #["nomad_sabre",         "Nomad Sabre", [("shashqa",0),("scab_shashqa", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 115 , weight(1.75)|difficulty(0)|spd_rtng(101) | weapon_length(100)|swing_damage(27 , cut) | thrust_damage(0 ,  pierce),imodbits_sword ],
  1816.  
  1817. @@ -770,23 +770,23 @@ items = [
  1818.   228 , weight(4.5)|difficulty(10)|spd_rtng(92) | weapon_length(100)|swing_damage(45 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  1819.  
  1820.  ["great_axe",         "Great Axe", [("two_handed_battle_axe_e",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry|itp_unbalanced, itc_nodachi|itcf_carry_axe_back,
  1821.  
  1822.   316 , weight(4.5)|difficulty(10)|spd_rtng(94) | weapon_length(96)|swing_damage(47 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  1823.  
  1824. -["long_axe",         "Long Axe", [("long_axe_a",0)], itp_type_polearm|itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry|itp_next_item_as_melee|itp_merchandise,itc_staff|itcf_carry_axe_back,
  1825.  
  1826. - 390 , weight(4.5)|difficulty(10)|spd_rtng(93) | weapon_length(120)|swing_damage(46 , cut) | thrust_damage(19 ,  blunt),imodbits_axe ],
  1827.  
  1828. +["long_axe",         "Long Axe", [("long_axe_a",0)], itp_type_polearm|itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry|itp_next_item_as_melee|itp_unbalanced|itp_merchandise,itc_staff|itcf_carry_axe_back,
  1829.  
  1830. + 390 , weight(4.75)|difficulty(10)|spd_rtng(93) | weapon_length(120)|swing_damage(46 , cut) | thrust_damage(19 ,  blunt),imodbits_axe ],
  1831.  
  1832.  ["long_axe_alt",         "Long Axe", [("long_axe_a",0)],itp_type_two_handed_wpn|itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry|itp_unbalanced, itc_nodachi|itcf_carry_axe_back,
  1833.  
  1834. - 390 , weight(4.5)|difficulty(10)|spd_rtng(88) | weapon_length(120)|swing_damage(46 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  1835.  
  1836. - ["long_axe_b",         "Long War Axe", [("long_axe_b",0)], itp_type_polearm| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry|itp_next_item_as_melee|itp_merchandise, itc_staff|itcf_carry_axe_back,
  1837.  
  1838. - 510 , weight(4.5)|difficulty(10)|spd_rtng(92) | weapon_length(125)|swing_damage(50 , cut) | thrust_damage(18 ,  blunt),imodbits_axe ],
  1839.  
  1840. + 390 , weight(4.75)|difficulty(10)|spd_rtng(88) | weapon_length(120)|swing_damage(46 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  1841.  
  1842. + ["long_axe_b",         "Long War Axe", [("long_axe_b",0)], itp_type_polearm| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry|itp_next_item_as_melee|itp_unbalanced|itp_merchandise, itc_staff|itcf_carry_axe_back,
  1843.  
  1844. + 510 , weight(5.0)|difficulty(10)|spd_rtng(92) | weapon_length(125)|swing_damage(50 , cut) | thrust_damage(18 ,  blunt),imodbits_axe ],
  1845.  
  1846.  ["long_axe_b_alt",         "Long War Axe", [("long_axe_b",0)], itp_type_two_handed_wpn| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry|itp_unbalanced, itc_nodachi|itcf_carry_axe_back,
  1847.  
  1848. - 510 , weight(4.5)|difficulty(10)|spd_rtng(87) | weapon_length(125)|swing_damage(50 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  1849.  
  1850. - ["long_axe_c",         "Great Long Axe", [("long_axe_c",0)], itp_type_polearm| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry|itp_next_item_as_melee|itp_merchandise, itc_staff|itcf_carry_axe_back,
  1851.  
  1852. - 660 , weight(4.5)|difficulty(10)|spd_rtng(91) | weapon_length(127)|swing_damage(54 , cut) | thrust_damage(19 ,  blunt),imodbits_axe ],
  1853.  
  1854. + 510 , weight(5.0)|difficulty(10)|spd_rtng(87) | weapon_length(125)|swing_damage(50 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  1855.  
  1856. + ["long_axe_c",         "Great Long Axe", [("long_axe_c",0)], itp_type_polearm| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry|itp_next_item_as_melee|itp_unbalanced|itp_merchandise, itc_staff|itcf_carry_axe_back,
  1857.  
  1858. + 660 , weight(5.5)|difficulty(10)|spd_rtng(91) | weapon_length(127)|swing_damage(54 , cut) | thrust_damage(19 ,  blunt),imodbits_axe ],
  1859.  
  1860.  ["long_axe_c_alt",      "Great Long Axe", [("long_axe_c",0)], itp_type_two_handed_wpn| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry|itp_unbalanced, itc_nodachi|itcf_carry_axe_back,
  1861.  
  1862. - 660 , weight(4.5)|difficulty(10)|spd_rtng(85) | weapon_length(127)|swing_damage(54 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  1863.  
  1864. + 660 , weight(5.5)|difficulty(10)|spd_rtng(85) | weapon_length(127)|swing_damage(54 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  1865.  
  1866.  
  1867.  
  1868.   ["bardiche",         "Bardiche", [("two_handed_battle_axe_d",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry|itp_unbalanced, itc_nodachi|itcf_carry_axe_back,
  1869.  
  1870. - 291 , weight(4.5)|difficulty(10)|spd_rtng(91) | weapon_length(102)|swing_damage(47 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  1871.  
  1872. + 291 , weight(4.75)|difficulty(10)|spd_rtng(91) | weapon_length(102)|swing_damage(47 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  1873.  
  1874.  ["great_bardiche",         "Great Bardiche", [("two_handed_battle_axe_f",0)], itp_type_two_handed_wpn|itp_merchandise|itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry|itp_unbalanced, itc_nodachi|itcf_carry_axe_back,
  1875.  
  1876. - 617 , weight(4.5)|difficulty(10)|spd_rtng(89) | weapon_length(116)|swing_damage(50 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  1877.  
  1878. + 617 , weight(5.0)|difficulty(10)|spd_rtng(89) | weapon_length(116)|swing_damage(50 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886. @@ -794,7 +794,7 @@ items = [
  1887.  ["voulge",         "Voulge", [("two_handed_battle_long_axe_a",0)], itp_type_polearm|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_staff,
  1888.  
  1889.   120 , weight(3.0)|difficulty(10)|spd_rtng(88) | weapon_length(175)|swing_damage(40 , cut) | thrust_damage(18 ,  pierce),imodbits_axe ],
  1890.  
  1891.  ["long_bardiche",         "Long Bardiche", [("two_handed_battle_long_axe_b",0)], itp_type_polearm|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_staff,
  1892.  
  1893. -390 , weight(4.5)|difficulty(11)|spd_rtng(89) | weapon_length(140)|swing_damage(48 , cut) | thrust_damage(17 ,  pierce),imodbits_axe ],
  1894.  
  1895. +390 , weight(4.75)|difficulty(11)|spd_rtng(89) | weapon_length(140)|swing_damage(48 , cut) | thrust_damage(17 ,  pierce),imodbits_axe ],
  1896.  
  1897.  ["great_long_bardiche",         "Great Long Bardiche", [("two_handed_battle_long_axe_c",0)], itp_type_polearm|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_staff,
  1898.  
  1899.   660 , weight(5.0)|difficulty(12)|spd_rtng(88) | weapon_length(155)|swing_damage(50 , cut) | thrust_damage(17 ,  pierce),imodbits_axe ],
  1900.  
  1901.  
  1902.  
  1903. @@ -812,15 +812,15 @@ items = [
  1904.  ["sword_medieval_b", "Sword", [("sword_medieval_b",0),("sword_medieval_b_scabbard", ixmesh_carry),("sword_rusty_a",imodbit_rusty),("sword_rusty_a_scabbard", ixmesh_carry|imodbit_rusty)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
  1905.  
  1906.   243 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(28 , cut) | thrust_damage(23 ,  pierce),imodbits_sword_high ],
  1907.  
  1908.  ["sword_medieval_b_small", "Short Sword", [("sword_medieval_b_small",0),("sword_medieval_b_small_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
  1909.  
  1910. - 152 , weight(1.5)|difficulty(0)|spd_rtng(102) | weapon_length(85)|swing_damage(26, cut) | thrust_damage(24, pierce),imodbits_sword_high ],
  1911.  
  1912. + 152 , weight(1)|difficulty(0)|spd_rtng(102) | weapon_length(85)|swing_damage(26, cut) | thrust_damage(24, pierce),imodbits_sword_high ],
  1913.  
  1914.  ["sword_medieval_c", "Arming Sword", [("sword_medieval_c",0),("sword_medieval_c_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
  1915.  
  1916.   410 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(29 , cut) | thrust_damage(24 ,  pierce),imodbits_sword_high ],
  1917.  
  1918.  ["sword_medieval_c_small", "Short Arming Sword", [("sword_medieval_c_small",0),("sword_medieval_c_small_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
  1919.  
  1920. - 243 , weight(1.5)|difficulty(0)|spd_rtng(103) | weapon_length(86)|swing_damage(26, cut) | thrust_damage(24 ,  pierce),imodbits_sword_high ],
  1921.  
  1922. + 243 , weight(1)|difficulty(0)|spd_rtng(103) | weapon_length(86)|swing_damage(26, cut) | thrust_damage(24 ,  pierce),imodbits_sword_high ],
  1923.  
  1924.  ["sword_medieval_c_long", "Arming Sword", [("sword_medieval_c_long",0),("sword_medieval_c_long_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
  1925.  
  1926. - 480 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(100)|swing_damage(29 , cut) | thrust_damage(28 ,  pierce),imodbits_sword_high ],
  1927.  
  1928. + 480 , weight(1.7)|difficulty(0)|spd_rtng(99) | weapon_length(100)|swing_damage(29 , cut) | thrust_damage(28 ,  pierce),imodbits_sword_high ],
  1929.  
  1930.  ["sword_medieval_d_long", "Long Arming Sword", [("sword_medieval_d_long",0),("sword_medieval_d_long_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
  1931.  
  1932. - 550 , weight(1.5)|difficulty(0)|spd_rtng(96) | weapon_length(105)|swing_damage(33 , cut) | thrust_damage(28 ,  pierce),imodbits_sword ],
  1933.  
  1934. + 550 , weight(1.8)|difficulty(0)|spd_rtng(96) | weapon_length(105)|swing_damage(33 , cut) | thrust_damage(28 ,  pierce),imodbits_sword ],
  1935.  
  1936.  
  1937.  
  1938.  #["sword_medieval_d", "sword_medieval_d", [("sword_medieval_d",0),("sword_medieval_d_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
  1939.  
  1940.  # 131 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(24 , cut) | thrust_damage(21 ,  pierce),imodbits_sword ],
  1941.  
  1942. @@ -858,19 +858,19 @@ items = [
  1943.  ["mace_2",         "Knobbed_Mace", [("mace_a",0)], itp_type_one_handed_wpn|itp_can_knock_down|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
  1944.  
  1945.   98 , weight(2.5)|difficulty(0)|spd_rtng(98) | weapon_length(70)|swing_damage(21 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1946.  
  1947.  ["mace_3",         "Spiked Mace", [("mace_c",0)], itp_type_one_handed_wpn|itp_can_knock_down|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
  1948.  
  1949. - 152 , weight(2.5)|difficulty(0)|spd_rtng(98) | weapon_length(70)|swing_damage(23 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1950.  
  1951. + 152 , weight(2.75)|difficulty(0)|spd_rtng(98) | weapon_length(70)|swing_damage(23 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1952.  
  1953.  ["mace_4",         "Winged_Mace", [("mace_b",0)], itp_type_one_handed_wpn|itp_can_knock_down|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
  1954.  
  1955. - 212 , weight(2.5)|difficulty(0)|spd_rtng(98) | weapon_length(70)|swing_damage(24 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1956.  
  1957. + 212 , weight(2.75)|difficulty(0)|spd_rtng(98) | weapon_length(70)|swing_damage(24 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1958.  
  1959.  # Goedendag
  1960.  
  1961.   ["club_with_spike_head",  "Spiked Staff", [("mace_e",0)],  itp_type_two_handed_wpn|itp_merchandise|itp_can_knock_down|itp_primary|itp_wooden_parry, itc_bastardsword|itcf_carry_axe_back,
  1962.  
  1963. - 200 , weight(2.5)|difficulty(9)|spd_rtng(95) | weapon_length(117)|swing_damage(24 , blunt) | thrust_damage(20 ,  pierce),imodbits_mace ],
  1964.  
  1965. + 200 , weight(2.80)|difficulty(9)|spd_rtng(95) | weapon_length(117)|swing_damage(24 , blunt) | thrust_damage(20 ,  pierce),imodbits_mace ],
  1966.  
  1967.  
  1968.  
  1969.  ["long_spiked_club",         "Long Spiked Club", [("mace_long_c",0)], itp_type_polearm|itp_can_knock_down|itp_merchandise| itp_primary|itp_wooden_parry, itc_staff|itcf_carry_axe_back,
  1970.  
  1971. - 264 , weight(2.5)|difficulty(0)|spd_rtng(96) | weapon_length(126)|swing_damage(23 , pierce) | thrust_damage(20 ,  blunt),imodbits_mace ],
  1972.  
  1973. + 264 , weight(3)|difficulty(0)|spd_rtng(96) | weapon_length(126)|swing_damage(23 , pierce) | thrust_damage(20 ,  blunt),imodbits_mace ],
  1974.  
  1975.  ["long_hafted_knobbed_mace",         "Long Hafted Knobbed Mace", [("mace_long_a",0)], itp_type_polearm| itp_can_knock_down|itp_primary|itp_wooden_parry, itc_staff|itcf_carry_axe_back,
  1976.  
  1977. - 324 , weight(2.5)|difficulty(0)|spd_rtng(95) | weapon_length(133)|swing_damage(26 , blunt) | thrust_damage(23 ,  blunt),imodbits_mace ],
  1978.  
  1979. + 324 , weight(3)|difficulty(0)|spd_rtng(95) | weapon_length(133)|swing_damage(26 , blunt) | thrust_damage(23 ,  blunt),imodbits_mace ],
  1980.  
  1981.  ["long_hafted_spiked_mace",         "Long Hafted Spiked Mace", [("mace_long_b",0)], itp_type_polearm|itp_can_knock_down|itp_merchandise| itp_primary|itp_wooden_parry, itc_staff|itcf_carry_axe_back,
  1982.  
  1983. - 310 , weight(2.5)|difficulty(0)|spd_rtng(94) | weapon_length(140)|swing_damage(28 , blunt) | thrust_damage(26 ,  blunt),imodbits_mace ],
  1984.  
  1985. + 310 , weight(3)|difficulty(0)|spd_rtng(94) | weapon_length(140)|swing_damage(28 , blunt) | thrust_damage(26 ,  blunt),imodbits_mace ],
  1986.  
  1987.  
  1988.  
  1989.  ["sarranid_two_handed_mace_1",         "Iron Mace", [("mace_long_d",0)], itp_type_two_handed_wpn|itp_can_knock_down|itp_two_handed|itp_merchandise| itp_primary|itp_crush_through|itp_unbalanced, itc_greatsword|itcf_carry_axe_back,
  1990.  
  1991.  470 , weight(4.5)|difficulty(0)|spd_rtng(90) | weapon_length(95)|swing_damage(35 , blunt) | thrust_damage(22 ,  blunt),imodbits_mace ],
  1992.  
  1993. @@ -879,23 +879,23 @@ items = [
  1994.  ["sarranid_mace_1",         "Iron Mace", [("mace_small_d",0)], itp_type_one_handed_wpn|itp_merchandise|itp_can_knock_down |itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,
  1995.  
  1996.   45 , weight(2.0)|difficulty(0)|spd_rtng(99) | weapon_length(73)|swing_damage(22 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
  1997.  
  1998.  ["sarranid_axe_a", "Iron Battle Axe", [("one_handed_battle_axe_g",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip,
  1999.  
  2000. - 250 , weight(1.75)|difficulty(9)|spd_rtng(97) | weapon_length(71)|swing_damage(35 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  2001.  
  2002. + 250 , weight(1.65)|difficulty(9)|spd_rtng(97) | weapon_length(71)|swing_damage(35 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  2003.  
  2004.  ["sarranid_axe_b", "Iron War Axe", [("one_handed_battle_axe_h",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip,
  2005.  
  2006.   360 , weight(1.75)|difficulty(9)|spd_rtng(97) | weapon_length(71)|swing_damage(38 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  2007.  
  2008.  
  2009.  
  2010.  ["sarranid_two_handed_axe_a",         "Sarranid Battle Axe", [("two_handed_battle_axe_g",0)], itp_type_two_handed_wpn|itp_two_handed|itp_primary|itp_bonus_against_shield|itp_unbalanced, itc_nodachi|itcf_carry_axe_back,
  2011.  
  2012.   350 , weight(3.0)|difficulty(10)|spd_rtng(89) | weapon_length(95)|swing_damage(49 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  2013.  
  2014.  ["sarranid_two_handed_axe_b",         "Sarranid War Axe", [("two_handed_battle_axe_h",0)], itp_type_two_handed_wpn|itp_two_handed|itp_primary|itp_bonus_against_shield|itp_unbalanced, itc_nodachi|itcf_carry_axe_back,
  2015.  
  2016. - 280 , weight(3.0)|difficulty(10)|spd_rtng(90) | weapon_length(90)|swing_damage(46 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  2017.  
  2018. + 280 , weight(2.50)|difficulty(10)|spd_rtng(90) | weapon_length(90)|swing_damage(46 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  ["scythe",         "Scythe", [("scythe",0)], itp_type_polearm|itp_offset_lance|itp_merchandise| itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear, 43 , weight(2)|difficulty(0)|spd_rtng(97) | weapon_length(182)|swing_damage(30 , cut) | thrust_damage(14 ,  pierce),imodbits_polearm ],
  2029.  
  2030. -["pitch_fork",         "Pitch Fork", [("pitch_fork",0)], itp_type_polearm|itp_offset_lance|itp_merchandise| itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear, 19 , weight(1.5)|difficulty(0)|spd_rtng(87) | weapon_length(154)|swing_damage(16 , blunt) | thrust_damage(22 ,  pierce),imodbits_polearm ],
  2031.  
  2032. -["military_fork", "Military Fork", [("military_fork",0)], itp_type_polearm|itp_offset_lance|itp_merchandise| itp_primary|itp_wooden_parry, itc_spear, 153 , weight(2)|difficulty(0)|spd_rtng(95) | weapon_length(135)|swing_damage(15 , blunt) | thrust_damage(30 ,  pierce),imodbits_polearm ],
  2033.  
  2034. -["battle_fork",         "Battle Fork", [("battle_fork",0)], itp_type_polearm|itp_offset_lance|itp_merchandise| itp_primary|itp_wooden_parry, itc_spear, 282 , weight(2.2)|difficulty(0)|spd_rtng(90) | weapon_length(144)|swing_damage(15, blunt) | thrust_damage(35 ,  pierce),imodbits_polearm ],
  2035.  
  2036. -["boar_spear",         "Boar Spear", [("spear",0)], itp_type_polearm|itp_merchandise| itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear|itcf_carry_spear,
  2037.  
  2038. +["pitch_fork",         "Pitch Fork", [("pitch_fork",0)], itp_type_polearm|itp_offset_lance|itp_merchandise| itp_primary|itp_penalty_with_shield|itp_wooden_parry,itc_staff, 19 , weight(1.5)|difficulty(0)|spd_rtng(87) | weapon_length(154)|swing_damage(16 , blunt) | thrust_damage(22 ,  pierce),imodbits_polearm ],
  2039.  
  2040. +["military_fork", "Military Fork", [("military_fork",0)], itp_type_polearm|itp_offset_lance|itp_merchandise| itp_primary|itp_wooden_parry,itc_staff, 153 , weight(2)|difficulty(0)|spd_rtng(95) | weapon_length(135)|swing_damage(15 , blunt) | thrust_damage(30 ,  pierce),imodbits_polearm ],
  2041.  
  2042. +["battle_fork",         "Battle Fork", [("battle_fork",0)], itp_type_polearm|itp_offset_lance|itp_merchandise| itp_primary|itp_wooden_parry,itc_staff, 282 , weight(2.2)|difficulty(0)|spd_rtng(90) | weapon_length(144)|swing_damage(15, blunt) | thrust_damage(35 ,  pierce),imodbits_polearm ],
  2043.  
  2044. +["boar_spear",         "Boar Spear", [("spear",0)], itp_type_polearm|itp_merchandise| itp_primary|itp_penalty_with_shield|itp_wooden_parry,itc_staff|itcf_carry_spear,
  2045.  
  2046.  76 , weight(1.5)|difficulty(0)|spd_rtng(90) | weapon_length(157)|swing_damage(26 , cut) | thrust_damage(23 ,  pierce),imodbits_polearm ],
  2047.  
  2048.  #["spear",         "Spear", [("spear",0)], itp_type_polearm|itp_merchandise| itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear|itcf_carry_spear, 173 , weight(4.5)|difficulty(0)|spd_rtng(80) | weapon_length(158)|swing_damage(17 , blunt) | thrust_damage(23 ,  pierce),imodbits_polearm ],
  2049.  
  2050.  
  2051.  
  2052. @@ -1091,22 +1091,22 @@ items = [
  2053.  
  2054.  
  2055.  #TODO:
  2056.  
  2057.  ["darts",         "Darts", [("dart_b",0),("dart_b_bag", ixmesh_carry)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_javelin|itcf_carry_quiver_right_vertical|itcf_show_holster_when_drawn,
  2058.  
  2059. -155 , weight(5)|difficulty(1)|spd_rtng(95) | shoot_speed(28) | thrust_damage(22 ,  pierce)|max_ammo(7)|weapon_length(32),imodbits_thrown ],
  2060.  
  2061. +155 , weight(4)|difficulty(1)|spd_rtng(95) | shoot_speed(28) | thrust_damage(22 ,  pierce)|max_ammo(7)|weapon_length(32),imodbits_thrown ],
  2062.  
  2063.  ["war_darts",         "War Darts", [("dart_a",0),("dart_a_bag", ixmesh_carry)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn,
  2064.  
  2065.  285 , weight(5)|difficulty(1)|spd_rtng(93) | shoot_speed(27) | thrust_damage(25 ,  pierce)|max_ammo(7)|weapon_length(45),imodbits_thrown ],
  2066.  
  2067.  
  2068.  
  2069.  ["javelin",         "Javelins", [("javelin",0),("javelins_quiver_new", ixmesh_carry)], itp_type_thrown |itp_merchandise|itp_primary|itp_next_item_as_melee ,itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn,
  2070.  
  2071. -300, weight(5)|difficulty(1)|spd_rtng(91) | shoot_speed(25) | thrust_damage(34 ,  pierce)|max_ammo(5)|weapon_length(75),imodbits_thrown ],
  2072.  
  2073. +300, weight(4)|difficulty(1)|spd_rtng(91) | shoot_speed(25) | thrust_damage(34 ,  pierce)|max_ammo(5)|weapon_length(75),imodbits_thrown ],
  2074.  
  2075.  ["javelin_melee",         "Javelin", [("javelin",0)], itp_type_polearm|itp_primary|itp_wooden_parry , itc_staff,
  2076.  
  2077.  300, weight(1)|difficulty(0)|spd_rtng(95) |swing_damage(12, cut)| thrust_damage(14,  pierce)|weapon_length(75),imodbits_polearm ],
  2078.  
  2079.  
  2080.  
  2081.  ["throwing_spears",         "Throwing Spears", [("jarid_new_b",0),("jarid_new_b_bag", ixmesh_carry)], itp_type_thrown |itp_merchandise|itp_primary|itp_next_item_as_melee ,itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn,
  2082.  
  2083. -525 , weight(4)|difficulty(2)|spd_rtng(87) | shoot_speed(22) | thrust_damage(44 ,  pierce)|max_ammo(4)|weapon_length(65),imodbits_thrown ],
  2084.  
  2085. +525 , weight(3)|difficulty(2)|spd_rtng(87) | shoot_speed(22) | thrust_damage(44 ,  pierce)|max_ammo(4)|weapon_length(65),imodbits_thrown ],
  2086.  
  2087.  ["throwing_spear_melee",         "Throwing Spear", [("jarid_new_b",0),("javelins_quiver", ixmesh_carry)],itp_type_polearm|itp_primary|itp_wooden_parry , itc_staff,
  2088.  
  2089.  525 , weight(1)|difficulty(1)|spd_rtng(91) | swing_damage(18, cut) | thrust_damage(23 ,  pierce)|weapon_length(75),imodbits_thrown ],
  2090.  
  2091.  
  2092.  
  2093.  ["jarid",         "Jarids", [("jarid_new",0),("jarid_quiver", ixmesh_carry)], itp_type_thrown |itp_merchandise|itp_primary|itp_next_item_as_melee ,itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn,
  2094.  
  2095. -560 , weight(4)|difficulty(2)|spd_rtng(89) | shoot_speed(24) | thrust_damage(45 ,  pierce)|max_ammo(4)|weapon_length(65),imodbits_thrown ],
  2096.  
  2097. +560 , weight(2.75)|difficulty(2)|spd_rtng(89) | shoot_speed(24) | thrust_damage(45 ,  pierce)|max_ammo(4)|weapon_length(65),imodbits_thrown ],
  2098.  
  2099.  ["jarid_melee",         "Jarid", [("jarid_new",0),("jarid_quiver", ixmesh_carry)], itp_type_polearm|itp_primary|itp_wooden_parry , itc_staff,
  2100.  
  2101.  560 , weight(1)|difficulty(2)|spd_rtng(93) | swing_damage(16, cut) | thrust_damage(20 ,  pierce)|weapon_length(65),imodbits_thrown ],
  2102.  
  2103.  
  2104.  
  2105. @@ -1115,8 +1115,8 @@ items = [
  2106.  #TODO: Heavy throwing Spear
  2107.  
  2108.  ["stones",         "Stones", [("throwing_stone",0)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_stone, 1 , weight(4)|difficulty(0)|spd_rtng(97) | shoot_speed(30) | thrust_damage(11 ,  blunt)|max_ammo(18)|weapon_length(8),imodbit_large_bag ],
  2109.  
  2110.  
  2111.  
  2112. -["throwing_knives", "Throwing Knives", [("throwing_knife",0)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_knife, 76 , weight(3.5)|difficulty(0)|spd_rtng(121) | shoot_speed(25) | thrust_damage(19 ,  cut)|max_ammo(14)|weapon_length(0),imodbits_thrown ],
  2113.  
  2114. -["throwing_daggers", "Throwing Daggers", [("throwing_dagger",0)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_knife, 193 , weight(3.5)|difficulty(0)|spd_rtng(110) | shoot_speed(24) | thrust_damage(25 ,  cut)|max_ammo(13)|weapon_length(0),imodbits_thrown ],
  2115.  
  2116. +["throwing_knives", "Throwing Knives", [("throwing_knife",0)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_knife, 76 , weight(2.5)|difficulty(0)|spd_rtng(121) | shoot_speed(25) | thrust_damage(19 ,  cut)|max_ammo(14)|weapon_length(0),imodbits_thrown ],
  2117.  
  2118. +["throwing_daggers", "Throwing Daggers", [("throwing_dagger",0)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_knife, 193 , weight(2.5)|difficulty(0)|spd_rtng(110) | shoot_speed(24) | thrust_damage(25 ,  cut)|max_ammo(13)|weapon_length(0),imodbits_thrown ],
  2119.  
  2120.  #TODO: Light Trowing axe, Heavy Throwing Axe
  2121.  
  2122.  ["light_throwing_axes", "Light Throwing Axes", [("francisca",0)], itp_type_thrown |itp_merchandise|itp_primary|itp_next_item_as_melee,itcf_throw_axe,
  2123.  
  2124.  360, weight(5)|difficulty(2)|spd_rtng(99) | shoot_speed(18) | thrust_damage(35,cut)|max_ammo(4)|weapon_length(53),imodbits_thrown_minus_heavy ],
  2125.  
  2126. diff -rupBN Module_system 1.134//module_mission_templates.py Module_system 1.142//module_mission_templates.py
  2127. --- Module_system 1.134//module_mission_templates.py    2010-12-03 10:37:42.000000000 -0800
  2128. +++ Module_system 1.142//module_mission_templates.py    2011-06-10 12:37:00.000000000 -0700
  2129. @@ -2205,7 +2205,7 @@ mission_templates = [
  2130.    ),
  2131.  
  2132.  
  2133.  
  2134.    (
  2135.  
  2136. -    "lead_charge",mtf_battle_mode,charge,
  2137.  
  2138. +    "lead_charge",mtf_battle_mode|mtf_synch_inventory,charge,
  2139.  
  2140.      "You lead your men to battle.",
  2141.  
  2142.      [
  2143.  
  2144.       (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
  2145.  
  2146. @@ -2412,7 +2412,7 @@ mission_templates = [
  2147.    ),
  2148.  
  2149.  
  2150.  
  2151.    (
  2152.  
  2153. -    "village_attack_bandits",mtf_battle_mode,charge,
  2154.  
  2155. +    "village_attack_bandits",mtf_battle_mode|mtf_synch_inventory,charge,
  2156.  
  2157.      "You lead your men to battle.",
  2158.  
  2159.      [
  2160.  
  2161.       (3,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
  2162.  
  2163. @@ -2470,7 +2470,7 @@ mission_templates = [
  2164.  
  2165.  
  2166.  
  2167.  
  2168.    (
  2169.  
  2170. -    "village_raid",mtf_battle_mode,charge,
  2171.  
  2172. +    "village_raid",mtf_battle_mode|mtf_synch_inventory,charge,
  2173.  
  2174.      "You lead your men to battle.",
  2175.  
  2176.      [
  2177.  
  2178.       (3,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,12,[]),
  2179.  
  2180. @@ -2851,7 +2851,7 @@ mission_templates = [
  2181.    ),
  2182.  
  2183.  
  2184.  
  2185.    (
  2186.  
  2187. -    "castle_attack_walls_defenders_sally",mtf_battle_mode,-1,
  2188.  
  2189. +    "castle_attack_walls_defenders_sally",mtf_battle_mode|mtf_synch_inventory,-1,
  2190.  
  2191.      "You attack the walls of the castle...",
  2192.  
  2193.      [
  2194.  
  2195.       (0,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,12,[]),
  2196.  
  2197. @@ -2951,7 +2951,7 @@ mission_templates = [
  2198.  
  2199.  
  2200.  
  2201.  
  2202.    (
  2203.  
  2204. -    "castle_attack_walls_belfry",mtf_battle_mode,-1,
  2205.  
  2206. +    "castle_attack_walls_belfry",mtf_battle_mode|mtf_synch_inventory,-1,
  2207.  
  2208.      "You attack the walls of the castle...",
  2209.  
  2210.      [
  2211.  
  2212.       (0,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,12,[]),
  2213.  
  2214. @@ -3032,7 +3032,7 @@ mission_templates = [
  2215.    ),
  2216.  
  2217.  
  2218.  
  2219.    (
  2220.  
  2221. -    "castle_attack_walls_ladder",mtf_battle_mode,-1,
  2222.  
  2223. +    "castle_attack_walls_ladder",mtf_battle_mode|mtf_synch_inventory,-1,
  2224.  
  2225.      "You attack the walls of the castle...",
  2226.  
  2227.      [
  2228.  
  2229.       (0,mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,12,[]),
  2230.  
  2231. @@ -13318,7 +13318,7 @@ mission_templates = [
  2232.    ),
  2233.  
  2234.    
  2235.  
  2236.    (
  2237.  
  2238. -   "bandit_lair",mtf_battle_mode,charge,
  2239.  
  2240. +   "bandit_lair",mtf_battle_mode|mtf_synch_inventory,charge,
  2241.  
  2242.      "Ambushing a bandit lair",
  2243.  
  2244.      [
  2245.  
  2246.        (0,mtef_team_0|mtef_use_exact_number,af_override_horse, aif_start_alarmed, 7,[]),
  2247.  
  2248. diff -rupBN Module_system 1.134//module_scripts.py Module_system 1.142//module_scripts.py
  2249. --- Module_system 1.134//module_scripts.py  2011-06-06 13:36:04.826756143 -0700
  2250. +++ Module_system 1.142//module_scripts.py  2011-07-01 13:58:04.000000000 -0700
  2251. @@ -10,6 +10,7 @@ from header_items import *
  2252.  from header_triggers import *
  2253.  
  2254.  from header_terrain_types import *
  2255.  
  2256.  from header_music import *
  2257.  
  2258. +from header_map_icons import *
  2259.  
  2260.  from ID_animations import *
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266. @@ -224,9 +225,6 @@ scripts = [
  2267.          (try_for_range, ":center_no", centers_begin, centers_end),
  2268.  
  2269.            (party_set_slot, ":center_no", ":offset", average_price_factor), #1000
  2270.  
  2271.          (try_end),
  2272.  
  2273. -##        (party_set_slot, "p_zendar", ":offset", average_price_factor),
  2274.  
  2275. -##        (party_set_slot, "p_salt_mine", ":offset", average_price_factor),
  2276.  
  2277. -##        (party_set_slot, "p_four_ways_inn", ":offset", average_price_factor),
  2278.  
  2279.        (try_end),
  2280.  
  2281.  
  2282.  
  2283.       (call_script, "script_initialize_trade_routes"),
  2284.  
  2285. @@ -644,8 +642,7 @@ scripts = [
  2286.       #This needs to be after market towns
  2287.  
  2288.       (call_script, "script_initialize_economic_information"),
  2289.  
  2290.  
  2291.  
  2292. -     (try_for_range, ":village_no", villages_begin, villages_end),
  2293.  
  2294. -        (call_script, "script_refresh_village_merchant_inventory", ":village_no"),
  2295.  
  2296. +     (try_for_range, ":village_no", villages_begin, villages_end),        
  2297.  
  2298.          (call_script, "script_refresh_village_merchant_inventory", ":village_no"),
  2299.  
  2300.        (try_end),    
  2301.  
  2302.                  
  2303.  
  2304. @@ -716,6 +713,7 @@ scripts = [
  2305.          (party_get_slot, ":center_lord", ":center_no", slot_town_lord),
  2306.  
  2307.          (ge, ":center_lord", 1),
  2308.  
  2309.          (troop_slot_eq, ":center_lord", slot_troop_leaded_party, 0),
  2310.  
  2311. +       (assign, "$g_there_is_no_avaliable_centers", 0),
  2312.  
  2313.          (call_script, "script_create_kingdom_hero_party", ":center_lord", ":center_no"),
  2314.  
  2315.          (assign, ":lords_party", "$pout_party"),
  2316.  
  2317.          (party_attach_to_party, ":lords_party", ":center_no"),
  2318.  
  2319. @@ -2953,8 +2951,8 @@ scripts = [
  2320.          (party_is_active, ":root_attacker_party"),
  2321.  
  2322.          (store_faction_of_party, ":defender_faction", ":root_defender_party"),
  2323.  
  2324.          (store_faction_of_party, ":attacker_faction", ":root_attacker_party"),
  2325.  
  2326. -        (neq, ":defender_faction", "fac_player_faction"),
  2327.  
  2328. -        (neq, ":attacker_faction", "fac_player_faction"),
  2329.  
  2330. +        #(neq, ":defender_faction", "fac_player_faction"),
  2331.  
  2332. +        #(neq, ":attacker_faction", "fac_player_faction"),    
  2333.  
  2334.          (store_relation, ":reln", ":defender_faction", ":attacker_faction"),
  2335.  
  2336.          (lt, ":reln", 0),
  2337.  
  2338.          (assign, ":trigger_result", 0),
  2339.  
  2340. @@ -2963,7 +2961,7 @@ scripts = [
  2341.            (this_or_next|eq, "$g_battle_simulation_cancel_for_party", ":root_defender_party"),
  2342.  
  2343.            (eq, "$g_battle_simulation_cancel_for_party", ":root_attacker_party"),
  2344.  
  2345.            (assign, "$g_battle_simulation_cancel_for_party", -1),
  2346.  
  2347. -          (assign, "$auto_enter_town", "$g_battle_simulation_auto_enter_town_after_battle"),
  2348.  
  2349. +          (assign, "$auto_enter_town", "$g_battle_simulation_auto_enter_town_after_battle"),        
  2350.  
  2351.            (assign, ":trigger_result", 1),
  2352.  
  2353.          (else_try),
  2354.  
  2355.            (try_begin),
  2356.  
  2357. @@ -2971,7 +2969,7 @@ scripts = [
  2358.              (party_slot_eq, ":root_attacker_party", slot_party_retreat_flag, 1),
  2359.  
  2360.              (assign, ":trigger_result", 1), #End battle!
  2361.  
  2362.            (try_end),
  2363.  
  2364. -          (party_set_slot, ":root_attacker_party", slot_party_retreat_flag, 0),
  2365.  
  2366. +          (party_set_slot, ":root_attacker_party", slot_party_retreat_flag, 0),         
  2367.  
  2368.  
  2369.  
  2370.            #(assign, ":cancel_attack", 0),
  2371.  
  2372.  
  2373.  
  2374. @@ -3000,7 +2998,7 @@ scripts = [
  2375.        
  2376.  
  2377.              (val_mul, ":attacker_strength", 100), #it was 0.5 in old version, now it is only 1 / 1.23
  2378.  
  2379.              (val_div, ":attacker_strength", 123),
  2380.  
  2381. -          (try_end),
  2382.  
  2383. +          (try_end),        
  2384.  
  2385.  
  2386.  
  2387.            (call_script, "script_party_count_fit_for_battle", "p_collective_ally", 0),
  2388.  
  2389.            (assign, ":old_defender_strength", reg0),
  2390.  
  2391. @@ -3020,12 +3018,12 @@ scripts = [
  2392.              (party_collect_attachments_to_party, ":root_defender_party", "p_collective_ally"),
  2393.  
  2394.            (try_end),
  2395.  
  2396.            (call_script, "script_party_count_fit_for_battle", "p_collective_ally", 0),
  2397.  
  2398. -          (assign, ":new_defender_strength", reg0),
  2399.  
  2400. +          (assign, ":new_defender_strength", reg0),         
  2401.  
  2402.  
  2403.  
  2404.            (try_begin),
  2405.  
  2406.              (this_or_next|eq, ":new_attacker_strength", 0),
  2407.  
  2408.              (eq, ":new_defender_strength", 0),
  2409.  
  2410. -            # Battle concluded! determine winner
  2411.  
  2412. +            # Battle concluded! determine winner          
  2413.  
  2414.              
  2415.  
  2416.              (assign, ":do_not_end_battle", 0),
  2417.  
  2418.              (try_begin),
  2419.  
  2420. @@ -3596,17 +3594,17 @@ scripts = [
  2421.          (val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
  2422.  
  2423.          (party_get_slot, ":price_factor", "$g_encountered_party", ":item_slot_no"),
  2424.  
  2425.        
  2426.  
  2427. -       (try_begin),
  2428.  
  2429. -           (is_between, "$g_encountered_party", villages_begin, villages_end),
  2430.  
  2431. -           (party_get_slot, ":market_town", "$g_encountered_party", slot_village_market_town),
  2432.  
  2433. -           (party_get_slot, ":price_in_market_town", ":market_town", ":item_slot_no"),
  2434.  
  2435. -           (val_max, ":price_factor", ":price_in_market_town"),
  2436.  
  2437. -       (try_end),
  2438.  
  2439. +       #new
  2440.  
  2441. +       #(try_begin),
  2442.  
  2443. +       #   (is_between, "$g_encountered_party", villages_begin, villages_end),
  2444.  
  2445. +       #   (party_get_slot, ":market_town", "$g_encountered_party", slot_village_market_town),
  2446.  
  2447. +       #   (party_get_slot, ":price_in_market_town", ":market_town", ":item_slot_no"),
  2448.  
  2449. +       #   (val_max, ":price_factor", ":price_in_market_town"),
  2450.  
  2451. +       #(try_end),
  2452.  
  2453.        
  2454.  
  2455.         #For villages, the good will be sold no cheaper than in the market town
  2456.  
  2457.         #This represents the absence of a permanent market -- ie, the peasants retain goods to sell on their journeys to town, and are not about to do giveaway deals with passing adventurers
  2458.  
  2459. -      
  2460.  
  2461. -      
  2462.  
  2463. +              
  2464.  
  2465.          (val_mul, ":price_factor", 100), #normalize price factor to range 0..100
  2466.  
  2467.          (val_div, ":price_factor", average_price_factor),
  2468.  
  2469.        (try_end),
  2470.  
  2471. @@ -3646,8 +3644,7 @@ scripts = [
  2472.          #increase trade penalty while selling weapons, armor, and horses
  2473.  
  2474.          (val_mul, ":trade_penalty", 4),
  2475.  
  2476.        (try_end),
  2477.  
  2478. -      
  2479.  
  2480. -      
  2481.  
  2482. +            
  2483.  
  2484.        (store_add, ":penalty_divisor", 100, ":trade_penalty"),
  2485.  
  2486.        
  2487.  
  2488.        (val_mul, ":price_factor", 100),
  2489.  
  2490. @@ -3671,9 +3668,10 @@ scripts = [
  2491.        (party_get_skill_level, ":trade_skill", "p_main_party", skl_trade),
  2492.  
  2493.        (try_begin),
  2494.  
  2495.          (is_between, ":item_kind_id", trade_goods_begin, trade_goods_end),
  2496.  
  2497. -        (assign, ":penalty",15), #reduced slightly
  2498.  
  2499. +        (assign, ":penalty", 12), #reduced slightly 20-15-12
  2500.  
  2501.          (store_mul, ":skill_bonus", ":trade_skill", 1),
  2502.  
  2503.          (val_sub, ":penalty", ":skill_bonus"),
  2504.  
  2505. +       (val_max, ":penalty", 3),      
  2506.  
  2507.        (else_try),
  2508.  
  2509.          (assign, ":penalty",100),
  2510.  
  2511.          (store_mul, ":skill_bonus", ":trade_skill", 5),
  2512.  
  2513. @@ -3718,19 +3716,20 @@ scripts = [
  2514.      
  2515.  
  2516.       (try_begin),
  2517.  
  2518.         (is_between, "$g_encountered_party", villages_begin, villages_end),
  2519.  
  2520. -       (val_mul, ":penalty", 2),
  2521.  
  2522. +       (val_mul, ":penalty", 5), #1.25x trade penalty in villages.
  2523.  
  2524. +       (val_div, ":penalty", 4),
  2525.  
  2526.       (try_end),
  2527.  
  2528.      
  2529.  
  2530. -     (try_begin),
  2531.  
  2532. -            (is_between, "$g_encountered_party", centers_begin, centers_end),
  2533.  
  2534. -       #Double trade penalty if no local production or consumption
  2535.  
  2536. -       (is_between, ":item_kind_id", trade_goods_begin, trade_goods_end),
  2537.  
  2538. -       (call_script, "script_center_get_production", "$g_encountered_party", ":item_kind_id"),
  2539.  
  2540. -       (eq, reg0, 0),
  2541.  
  2542. -       (call_script, "script_center_get_consumption", "$g_encountered_party", ":item_kind_id"),
  2543.  
  2544. -       (eq, reg0, 0),
  2545.  
  2546. -       (val_mul, ":penalty", 2),
  2547.  
  2548. -     (try_end),
  2549.  
  2550. +     #(try_begin),
  2551.  
  2552. +            #(is_between, "$g_encountered_party", centers_begin, centers_end),
  2553.  
  2554. +       ##Double trade penalty if no local production or consumption
  2555.  
  2556. +       #(is_between, ":item_kind_id", trade_goods_begin, trade_goods_end),
  2557.  
  2558. +       #(call_script, "script_center_get_production", "$g_encountered_party", ":item_kind_id"),
  2559.  
  2560. +       #(eq, reg0, 0),
  2561.  
  2562. +       #(call_script, "script_center_get_consumption", "$g_encountered_party", ":item_kind_id"),
  2563.  
  2564. +       #(eq, reg0, 0),
  2565.  
  2566. +       #(val_mul, ":penalty", 2),
  2567.  
  2568. +     #(try_end),
  2569.  
  2570.      
  2571.  
  2572.        (val_mul, ":penalty",  ":penalty_multiplier"),
  2573.  
  2574.        (val_div, ":penalty", 1000),
  2575.  
  2576. @@ -3753,12 +3752,22 @@ scripts = [
  2577.          (party_get_slot, ":multiplier", "$g_encountered_party", ":item_slot_no"),
  2578.  
  2579.          (try_begin),
  2580.  
  2581.            (eq, ":reclaim_mode", 0),
  2582.  
  2583. -          (val_add, ":multiplier", 10),
  2584.  
  2585. +          (val_add, ":multiplier", 20),
  2586.  
  2587.          (else_try),
  2588.  
  2589. -          (val_add, ":multiplier", 15),
  2590.  
  2591. +          (val_add, ":multiplier", 30),
  2592.  
  2593.          (try_end),
  2594.  
  2595. +
  2596.  
  2597. +       (store_item_value, ":item_value", ":item_kind_id"),
  2598.  
  2599. +       (try_begin),
  2600.  
  2601. +         (ge, ":item_value", 100),
  2602.  
  2603. +         (store_sub, ":item_value_sub_100", ":item_value", 100),
  2604.  
  2605. +         (store_div, ":item_value_sub_100_div_8", ":item_value_sub_100", 8),
  2606.  
  2607. +         (val_add, ":multiplier", ":item_value_sub_100_div_8"),
  2608.  
  2609. +       (try_end),
  2610.  
  2611. +
  2612.  
  2613.          (val_min, ":multiplier", maximum_price_factor),
  2614.  
  2615. -        (party_set_slot, "$g_encountered_party", ":item_slot_no", ":multiplier"),
  2616.  
  2617. +        
  2618.  
  2619. +       (party_set_slot, "$g_encountered_party", ":item_slot_no", ":multiplier"),
  2620.  
  2621.        (try_end),
  2622.  
  2623.    ]),
  2624.  
  2625.    
  2626.  
  2627. @@ -3777,12 +3786,22 @@ scripts = [
  2628.          (party_get_slot, ":multiplier", "$g_encountered_party", ":item_slot_no"),
  2629.  
  2630.          (try_begin),
  2631.  
  2632.            (eq, ":return_mode", 0),
  2633.  
  2634. -          (val_sub, ":multiplier", 15),
  2635.  
  2636. +          (val_sub, ":multiplier", 30),
  2637.  
  2638.          (else_try),
  2639.  
  2640. -          (val_sub, ":multiplier", 10),
  2641.  
  2642. +          (val_sub, ":multiplier", 20),
  2643.  
  2644.          (try_end),
  2645.  
  2646. +
  2647.  
  2648. +       (store_item_value, ":item_value", ":item_kind_id"),
  2649.  
  2650. +       (try_begin),
  2651.  
  2652. +         (ge, ":item_value", 100),
  2653.  
  2654. +         (store_sub, ":item_value_sub_100", ":item_value", 100),
  2655.  
  2656. +         (store_div, ":item_value_sub_100_div_8", ":item_value_sub_100", 8),
  2657.  
  2658. +         (val_sub, ":multiplier", ":item_value_sub_100_div_8"),
  2659.  
  2660. +       (try_end),
  2661.  
  2662. +
  2663.  
  2664.          (val_max, ":multiplier", minimum_price_factor),
  2665.  
  2666. -        (party_set_slot, "$g_encountered_party", ":item_slot_no", ":multiplier"),
  2667.  
  2668. +        
  2669.  
  2670. +       (party_set_slot, "$g_encountered_party", ":item_slot_no", ":multiplier"),
  2671.  
  2672.        (try_end),
  2673.  
  2674.    ]),
  2675.  
  2676.    
  2677.  
  2678. @@ -6557,33 +6576,51 @@ scripts = [
  2679.        
  2680.  
  2681.      ("initialize_economic_information",
  2682.  
  2683.      [          
  2684.  
  2685. -       #All towns produce tools, pottery, and wool cloth for sale in countryside
  2686.  
  2687. +   #All towns produce tools, pottery, and wool cloth for sale in countryside
  2688.  
  2689.     (try_for_range, ":town_no", towns_begin, towns_end),   
  2690.  
  2691. -       (party_set_slot, ":town_no", slot_center_wool_looms, 20),
  2692.  
  2693. -       (party_set_slot, ":town_no", slot_center_breweries, 2),
  2694.  
  2695. -       (party_set_slot, ":town_no", slot_center_pottery_kilns, 10),
  2696.  
  2697. -       (party_set_slot, ":town_no", slot_center_smithies, 15),
  2698.  
  2699. -       (party_set_slot, ":town_no", slot_center_mills, 5),
  2700.  
  2701. -       (party_set_slot, ":town_no", slot_center_tanneries, 2),
  2702.  
  2703. -       (party_set_slot, ":town_no", slot_center_wine_presses, 1),
  2704.  
  2705. -       (party_set_slot, ":town_no", slot_center_olive_presses, 2),
  2706.  
  2707. -      
  2708.  
  2709. -       (party_set_slot, ":town_no", slot_center_acres_grain, 1000), #Surrounding fields
  2710.  
  2711. -       (party_set_slot, ":town_no", slot_center_acres_vineyard, 1000), #Surrounding fields
  2712.  
  2713. +       (store_random_in_range, ":random_average_20_variation_10", 10, 31), #10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 or 30
  2714.  
  2715. +       (party_set_slot, ":town_no", slot_center_wool_looms, ":random_average_20_variation_10"),
  2716.  
  2717. +
  2718.  
  2719. +       (store_random_in_range, ":random_average_2_variation_1", 1, 4), #1,2 or 3
  2720.  
  2721. +       (party_set_slot, ":town_no", slot_center_breweries, ":random_average_2_variation_1"),
  2722.  
  2723. +
  2724.  
  2725. +       (store_random_in_range, ":random_average_10_variation_7", 3, 18), #3,4,5,6,7,8,9,10,11,12,13,14,15,16 or 17
  2726.  
  2727. +       (party_set_slot, ":town_no", slot_center_pottery_kilns, ":random_average_10_variation_7"),
  2728.  
  2729. +
  2730.  
  2731. +       (store_random_in_range, ":random_average_15_variation_9", 6, 25), #6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 or 24
  2732.  
  2733. +       (party_set_slot, ":town_no", slot_center_smithies, ":random_average_15_variation_9"),
  2734.  
  2735. +
  2736.  
  2737. +       (store_random_in_range, ":random_average_5_variation_3", 3, 9), #2,3,4,5,6,7 or 8
  2738.  
  2739. +       (party_set_slot, ":town_no", slot_center_mills, ":random_average_5_variation_3"),
  2740.  
  2741. +
  2742.  
  2743. +       (store_random_in_range, ":random_average_2_variation_1", 1, 4), #1,2 or 3
  2744.  
  2745. +       (party_set_slot, ":town_no", slot_center_tanneries, ":random_average_2_variation_1"),
  2746.  
  2747. +
  2748.  
  2749. +       (store_random_in_range, ":random_average_1_variation_1", 0, 3), #0,1 or 2
  2750.  
  2751. +       (party_set_slot, ":town_no", slot_center_wine_presses, ":random_average_1_variation_1"),
  2752.  
  2753. +
  2754.  
  2755. +       (store_random_in_range, ":random_average_2_variation_1", 1, 4), #1,2 or 3
  2756.  
  2757. +       (party_set_slot, ":town_no", slot_center_olive_presses, ":random_average_2_variation_1"),
  2758.  
  2759.        
  2760.  
  2761. +       (store_random_in_range, ":random_average_1000_variation_500", 500, 1501), #1,2 or 3
  2762.  
  2763. +       (party_set_slot, ":town_no", slot_center_acres_grain, ":random_average_1000_variation_500"), #500..1500
  2764.  
  2765. +
  2766.  
  2767. +       (store_random_in_range, ":random_average_1000_variation_500", 500, 1501), #1,2 or 3
  2768.  
  2769. +       (party_set_slot, ":town_no", slot_center_acres_vineyard, ":random_average_1000_variation_500"), #500..1500
  2770.  
  2771.      (try_end),
  2772.  
  2773.      
  2774.  
  2775.     (party_set_slot, "p_town_1", slot_center_linen_looms, 15),      #Sargoth
  2776.  
  2777. +   (party_set_slot, "p_town_1", slot_center_wine_presses, 4),      #Shariz
  2778.  
  2779.    
  2780.  
  2781.     (party_set_slot, "p_town_2", slot_center_salt_pans, 5),         #Tihr
  2782.  
  2783.     (party_set_slot, "p_town_2", slot_center_fishing_fleet, 25),    #Tihr
  2784.  
  2785.    
  2786.  
  2787. -   (party_set_slot, "p_town_3", slot_center_wine_presses, 10),     #Veluca
  2788.  
  2789. +   (party_set_slot, "p_town_3", slot_center_wine_presses, 10),     #Veluca
  2790.  
  2791.    
  2792.  
  2793.     (party_set_slot, "p_town_4", slot_center_olive_presses, 15),    #Suno
  2794.  
  2795.    
  2796.  
  2797.     (party_set_slot, "p_town_5", slot_center_silk_looms, 20),       #Jelkaka
  2798.  
  2799. -   (party_set_slot, "p_town_5", slot_center_fishing_fleet, 30),    #Jelkala
  2800.  
  2801. +   (party_set_slot, "p_town_5", slot_center_fishing_fleet, 30),    #Jelkala   
  2802.  
  2803.  
  2804.  
  2805.     (party_set_slot, "p_town_6", slot_center_breweries, 10),        #Praven
  2806.  
  2807.     (party_set_slot, "p_town_6", slot_center_tanneries, 4),         #Praven
  2808.  
  2809. @@ -6595,6 +6632,7 @@ scripts = [
  2810.     (party_set_slot, "p_town_8", slot_center_smithies, 25),         #Reyvadin
  2811.  
  2812.     (party_set_slot, "p_town_8", slot_center_wool_looms, 35),       #Reyvadin
  2813.  
  2814.     (party_set_slot, "p_town_8", slot_center_tanneries, 4),         #Reyvadin
  2815.  
  2816. +   (party_set_slot, "p_town_8", slot_center_wine_presses, 4),      #Reyvadin
  2817.  
  2818.  
  2819.  
  2820.     (party_set_slot, "p_town_9", slot_center_smithies, 18),         #Khudan
  2821.  
  2822.     (party_set_slot, "p_town_9", slot_center_tanneries, 3),         #Khudan
  2823.  
  2824. @@ -6616,7 +6654,7 @@ scripts = [
  2825.     (party_set_slot, "p_town_14", slot_center_tanneries, 3),        #Halmar
  2826.  
  2827.    
  2828.  
  2829.     (party_set_slot, "p_town_15", slot_center_smithies, 20),        #Yalen
  2830.  
  2831. -   (party_set_slot, "p_town_15", slot_center_wine_presses, 5),     #Yalen
  2832.  
  2833. +   (party_set_slot, "p_town_15", slot_center_wine_presses, 6),     #Yalen
  2834.  
  2835.     (party_set_slot, "p_town_15", slot_center_olive_presses, 5),    #Yalen
  2836.  
  2837.     (party_set_slot, "p_town_15", slot_center_fishing_fleet, 25),   #Yalen
  2838.  
  2839.    
  2840.  
  2841. @@ -6629,28 +6667,29 @@ scripts = [
  2842.     (party_set_slot, "p_town_18", slot_center_wine_presses, 4),     #narra
  2843.  
  2844.      
  2845.  
  2846.     (party_set_slot, "p_town_19", slot_center_tanneries, 5),        #Shariz
  2847.  
  2848. -   (party_set_slot, "p_town_19", slot_center_breweries, 0),        #Shariz
  2849.  
  2850. -   (party_set_slot, "p_town_19", slot_center_wine_presses, 3),     #Shariz
  2851.  
  2852. +   (party_set_slot, "p_town_19", slot_center_breweries, 0),        #Shariz #no alcohol in arabic region
  2853.  
  2854. +   (party_set_slot, "p_town_19", slot_center_wine_presses, 0),     #Shariz #no alcohol in arabic region
  2855.  
  2856.     (party_set_slot, "p_town_19", slot_center_fishing_fleet, 5),    #Shariz
  2857.  
  2858.  
  2859.  
  2860.     (party_set_slot, "p_town_20", slot_center_tanneries, 5),        #Darquba
  2861.  
  2862. -   (party_set_slot, "p_town_20", slot_center_breweries, 0),        #Darquba
  2863.  
  2864. -   (party_set_slot, "p_town_20", slot_center_wine_presses, 2),     #Darquba
  2865.  
  2866. +   (party_set_slot, "p_town_20", slot_center_breweries, 0),        #Darquba #no alcohol in arabic region
  2867.  
  2868. +   (party_set_slot, "p_town_20", slot_center_wine_presses, 0),     #Darquba #no alcohol in arabic region
  2869.  
  2870.  
  2871.  
  2872.     (party_set_slot, "p_town_21", slot_center_tanneries, 5),        #Ahmerrad
  2873.  
  2874. -   (party_set_slot, "p_town_21", slot_center_breweries, 0),        #Ahmerrad
  2875.  
  2876. -   (party_set_slot, "p_town_21", slot_center_wine_presses, 2),     #Ahmerrad
  2877.  
  2878. +   (party_set_slot, "p_town_21", slot_center_breweries, 0),        #Ahmerrad #no alcohol in arabic region
  2879.  
  2880. +   (party_set_slot, "p_town_21", slot_center_wine_presses, 0),     #Ahmerrad #no alcohol in arabic region
  2881.  
  2882.      
  2883.  
  2884.     (party_set_slot, "p_town_22", slot_center_tanneries, 5),        #Bariyye
  2885.  
  2886. -   (party_set_slot, "p_town_22", slot_center_breweries, 0),        #Bariyye
  2887.  
  2888. +   (party_set_slot, "p_town_22", slot_center_breweries, 0),        #Bariyye #no alcohol in arabic region
  2889.  
  2890. +   (party_set_slot, "p_town_22", slot_center_wine_presses, 0),     #Bariyye #no alcohol in arabic region
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.    
  2897.  
  2898.      (try_for_range, ":village_no", villages_begin, villages_end),
  2899.  
  2900. -        (store_random_in_range, ":random_cattle", 35, 65),
  2901.  
  2902. +        (store_random_in_range, ":random_cattle", 30, 75),
  2903.  
  2904.          (party_set_slot, ":village_no", slot_center_head_cattle, ":random_cattle"),
  2905.  
  2906.  
  2907.  
  2908. -        (store_random_in_range, ":random_sheep", 90, 120),
  2909.  
  2910. +        (store_random_in_range, ":random_sheep", 60, 150),
  2911.  
  2912.          (party_set_slot, ":village_no", slot_center_head_sheep, ":random_sheep"),
  2913.  
  2914.  
  2915.  
  2916.         (party_set_slot, ":village_no", slot_center_acres_grain, 10000), #10 acres for each of 1000 households
  2917.  
  2918. @@ -6853,14 +6892,12 @@ scripts = [
  2919.     (try_end),
  2920.  
  2921.      
  2922.  
  2923.     #Initialize prices based on production, etc
  2924.  
  2925. -    (try_for_range, ":unused", 0, 15), #15 cycles = 45 days. For a village with -20 production, this should lead to approximate +1000, modified
  2926.  
  2927. +    (try_for_range, ":unused", 0, 3), #15 cycles = 45 days. For a village with -20 production, this should lead to approximate +1000, modified    
  2928.  
  2929.          (call_script, "script_update_trade_good_prices"), #changes prices based on production
  2930.  
  2931. -        (call_script, "script_update_trade_good_prices"),
  2932.  
  2933. -        (call_script, "script_update_trade_good_prices"),
  2934.  
  2935. -      
  2936.  
  2937. -       (call_script, "script_average_trade_good_prices"), #Conduct virtual trade  twice    
  2938.  
  2939. -       (call_script, "script_average_trade_good_prices"),
  2940.  
  2941. +        #(call_script, "script_update_trade_good_prices"),
  2942.  
  2943. +        #(call_script, "script_update_trade_good_prices"),
  2944.  
  2945.        
  2946.  
  2947. +       #(call_script, "script_average_trade_good_prices"), #Conduct virtual trade         
  2948.  
  2949.      (try_end),
  2950.  
  2951.      
  2952.  
  2953.     #Initialize prosperity based on final prices
  2954.  
  2955. @@ -9509,7 +9546,7 @@ scripts = [
  2956.            #validity check
  2957.  
  2958.            (player_is_admin, ":player_no"),
  2959.  
  2960.            (is_between, ":value", 0, 51),
  2961.  
  2962. -          (is_between, ":value", "$g_multiplayer_max_num_bots"),
  2963.  
  2964. +          (is_between, ":value", 0, "$g_multiplayer_max_num_bots"),
  2965.  
  2966.            #condition checks are done
  2967.  
  2968.            (assign, "$g_multiplayer_num_bots_voteable", ":value"),
  2969.  
  2970.            (get_max_players, ":num_players"),
  2971.  
  2972. @@ -13122,39 +13159,78 @@ scripts = [
  2973.    # param2: item_id
  2974.  
  2975.    # param3: production_rate (should be between -100 (for net consumption) and 100 (for net production)
  2976.  
  2977.    # param4: randomness (between 0-100)
  2978.  
  2979. -  ("center_change_trade_good_production",
  2980.  
  2981. -    [
  2982.  
  2983. -      (store_script_param, ":center_no", 1),
  2984.  
  2985. -      (store_script_param, ":item_no", 2),
  2986.  
  2987. -      (store_script_param, ":production_rate", 3),
  2988.  
  2989. -#      (val_mul, ":production_rate", 5),
  2990.  
  2991. -      (store_script_param, ":randomness", 4),
  2992.  
  2993. -      (store_random_in_range, ":random_num", 0, ":randomness"),
  2994.  
  2995. -      (store_random_in_range, ":random_sign", 0, 2),
  2996.  
  2997. -      (try_begin),
  2998.  
  2999. -        (eq, ":random_sign", 0),
  3000.  
  3001. -        (val_add, ":production_rate", ":random_num"),
  3002.  
  3003. -      (else_try),
  3004.  
  3005. -        (val_sub, ":production_rate", ":random_num"),
  3006.  
  3007. -      (try_end),
  3008.  
  3009. -      (val_sub, ":item_no", trade_goods_begin),
  3010.  
  3011. -      (val_add, ":item_no", slot_town_trade_good_productions_begin),
  3012.  
  3013. -
  3014.  
  3015. -      (party_get_slot, ":old_production_rate", ":center_no", ":item_no"),
  3016.  
  3017. -      (val_add, ":production_rate", ":old_production_rate"),
  3018.  
  3019. -      (party_set_slot, ":center_no", ":item_no", ":production_rate"),
  3020.  
  3021. -  ]),
  3022.  
  3023. +  #("center_change_trade_good_production",
  3024.  
  3025. +  #  [
  3026.  
  3027. +#    (display_message, "@CHANGING"),
  3028.  
  3029. +#      (store_script_param, ":center_no", 1),
  3030.  
  3031. +#      (store_script_param, ":item_no", 2),
  3032.  
  3033. +#      (store_script_param, ":production_rate", 3),
  3034.  
  3035. +#      (store_script_param, ":randomness", 4),
  3036.  
  3037. +#      (store_random_in_range, ":random_num", 0, ":randomness"),
  3038.  
  3039. +#      (store_random_in_range, ":random_sign", 0, 2),
  3040.  
  3041. +#      (try_begin),
  3042.  
  3043. +#        (eq, ":random_sign", 0),
  3044.  
  3045. +#        (val_add, ":production_rate", ":random_num"),
  3046.  
  3047. +#      (else_try),
  3048.  
  3049. +#        (val_sub, ":production_rate", ":random_num"),
  3050.  
  3051. +#      (try_end),
  3052.  
  3053. +#      (val_sub, ":item_no", trade_goods_begin),
  3054.  
  3055. +#      (val_add, ":item_no", slot_town_trade_good_productions_begin),
  3056.  
  3057. +#
  3058.  
  3059. +#      (party_get_slot, ":old_production_rate", ":center_no", ":item_no"),
  3060.  
  3061. +#      (val_add, ":production_rate", ":old_production_rate"),
  3062.  
  3063. +#      (party_set_slot, ":center_no", ":item_no", ":production_rate"),
  3064.  
  3065. +#  ]),
  3066.  
  3067. +
  3068.  
  3069. +
  3070.  
  3071. +
  3072.  
  3073.  
  3074.  
  3075.    ("average_trade_good_prices", #Called from start
  3076.  
  3077. -    [
  3078.  
  3079. -  
  3080.  
  3081. +    [ 
  3082.  
  3083.     #This should be done by route rather than distance
  3084.  
  3085.        (store_sub, ":item_to_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
  3086.  
  3087.  
  3088.  
  3089.        (try_for_range, ":center_no", towns_begin, towns_end),
  3090.  
  3091. -        
  3092.  
  3093. +        (this_or_next|is_between, ":center_no", towns_begin, towns_end),
  3094.  
  3095. +       (is_between, ":center_no", villages_begin, villages_end),
  3096.  
  3097.        
  3098.  
  3099.          (try_for_range, ":other_center", centers_begin, centers_end),
  3100.  
  3101. +          (this_or_next|is_between, ":center_no", towns_begin, towns_end),
  3102.  
  3103. +         (is_between, ":center_no", villages_begin, villages_end),
  3104.  
  3105. +          
  3106.  
  3107. +          (neq, ":other_center", ":center_no"),
  3108.  
  3109. +          (store_distance_to_party_from_party, ":cur_distance", ":center_no", ":other_center"),
  3110.  
  3111. +          (lt, ":cur_distance", 50), #Reduced from 110
  3112.  
  3113. +          (store_sub, ":dist_factor", 50, ":cur_distance"),
  3114.  
  3115. +        
  3116.  
  3117. +          (try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
  3118.  
  3119. +            (store_add, ":cur_good_slot", ":cur_good", ":item_to_slot"),
  3120.  
  3121. +            (party_get_slot, ":center_price", ":center_no", ":cur_good_slot"),
  3122.  
  3123. +            (party_get_slot, ":other_center_price", ":other_center", ":cur_good_slot"),
  3124.  
  3125. +            (store_sub, ":price_dif", ":center_price", ":other_center_price"),
  3126.  
  3127. +          
  3128.  
  3129. +            (assign, ":price_dif_change", ":price_dif"),
  3130.  
  3131. +
  3132.  
  3133. +            (val_mul ,":price_dif_change", ":dist_factor"),
  3134.  
  3135. +            (val_div ,":price_dif_change", 1000), #Maximum of 1/20 per center
  3136.  
  3137. +            (val_add, ":other_center_price", ":price_dif_change"),
  3138.  
  3139. +            (party_set_slot, ":other_center", ":cur_good_slot", ":other_center_price"),
  3140.  
  3141. +          
  3142.  
  3143. +            (val_sub, ":center_price", ":price_dif_change"),
  3144.  
  3145. +            (party_set_slot, ":center_no", ":cur_good_slot", ":center_price"),        
  3146.  
  3147. +          (try_end),
  3148.  
  3149. +        (try_end),
  3150.  
  3151. +      (try_end),
  3152.  
  3153. +  ]),
  3154.  
  3155. +
  3156.  
  3157. +  ("average_trade_good_prices_2", #Called from start
  3158.  
  3159. +    [
  3160.  
  3161. +  
  3162.  
  3163. +   #This should be done by route rather than distance
  3164.  
  3165. +      (store_sub, ":item_to_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
  3166.  
  3167. +
  3168.  
  3169. +      (try_for_range, ":center_no", towns_begin, towns_end),              
  3170.  
  3171. +        (try_for_range, ":other_center", centers_begin, centers_end),
  3172.  
  3173.            (this_or_next|is_between, ":other_center", towns_begin, towns_end),
  3174.  
  3175.             (is_between, ":other_center", villages_begin, villages_end),
  3176.  
  3177.  
  3178.  
  3179. @@ -13208,9 +13284,8 @@ scripts = [
  3180.    # INPUT: none (called only from game start?)
  3181.  
  3182.    #This is currently deprecated, as I was going to try to fine-tune production
  3183.  
  3184.    ("average_trade_good_productions",
  3185.  
  3186. -    [
  3187.  
  3188. +    [   
  3189.  
  3190.        (store_sub, ":item_to_slot", slot_town_trade_good_productions_begin, trade_goods_begin),
  3191.  
  3192. -#      (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
  3193.  
  3194.        (try_for_range, ":center_no", towns_begin, towns_end),
  3195.  
  3196.          (this_or_next|is_between, ":center_no", towns_begin, towns_end),
  3197.  
  3198.          (is_between, ":center_no", villages_begin, villages_end),
  3199.  
  3200. @@ -13247,7 +13322,7 @@ scripts = [
  3201.    # INPUT: none
  3202.  
  3203.    # This currently deprecated, as I was going to try to fine-tune productions
  3204.  
  3205.    ("normalize_trade_good_productions",
  3206.  
  3207. -    [
  3208.  
  3209. +    [   
  3210.  
  3211.        (store_sub, ":item_to_slot", slot_town_trade_good_productions_begin, trade_goods_begin),
  3212.  
  3213.        (try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
  3214.  
  3215.          (assign, ":total_production", 0),
  3216.  
  3217. @@ -13283,9 +13358,48 @@ scripts = [
  3218.          (is_between, ":center_no", villages_begin, villages_end),
  3219.  
  3220.          (call_script, "script_update_trade_good_price_for_party", ":center_no"),
  3221.  
  3222.        (try_end),
  3223.  
  3224. -#      (call_script, "script_update_trade_good_price_for_party", "p_zendar"),
  3225.  
  3226. -#      (call_script, "script_update_trade_good_price_for_party", "p_salt_mine"),
  3227.  
  3228. -#      (call_script, "script_update_trade_good_price_for_party", "p_four_ways_inn"),
  3229.  
  3230. +
  3231.  
  3232. +      (try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
  3233.  
  3234. +       (assign, ":total_price", 0),
  3235.  
  3236. +       (assign, ":total_constants", 0),
  3237.  
  3238. +
  3239.  
  3240. +       (try_for_range, ":center_no", centers_begin, centers_end),
  3241.  
  3242. +          (this_or_next|is_between, ":center_no", towns_begin, towns_end),
  3243.  
  3244. +          (is_between, ":center_no", villages_begin, villages_end),
  3245.  
  3246. +
  3247.  
  3248. +          (store_sub, ":cur_good_price_slot", ":cur_good", trade_goods_begin),
  3249.  
  3250. +          (val_add, ":cur_good_price_slot", slot_town_trade_good_prices_begin),
  3251.  
  3252. +          (party_get_slot, ":cur_price", ":center_no", ":cur_good_price_slot"),
  3253.  
  3254. +
  3255.  
  3256. +         (try_begin),
  3257.  
  3258. +           (is_between, ":center_no", towns_begin, towns_end),
  3259.  
  3260. +           (assign, ":constant", 5),
  3261.  
  3262. +          (else_try),
  3263.  
  3264. +           (assign, ":constant", 1),
  3265.  
  3266. +         (try_end),
  3267.  
  3268. +
  3269.  
  3270. +         (val_mul, ":cur_price", ":constant"),
  3271.  
  3272. +
  3273.  
  3274. +         (val_add, ":total_price", ":cur_price"),
  3275.  
  3276. +         (val_add, ":total_constants", ":constant"),
  3277.  
  3278. +       (try_end),
  3279.  
  3280. +
  3281.  
  3282. +       (try_for_range, ":center_no", centers_begin, centers_end),
  3283.  
  3284. +          (this_or_next|is_between, ":center_no", towns_begin, towns_end),
  3285.  
  3286. +          (is_between, ":center_no", villages_begin, villages_end),
  3287.  
  3288. +
  3289.  
  3290. +          (store_sub, ":cur_good_price_slot", ":cur_good", trade_goods_begin),
  3291.  
  3292. +          (val_add, ":cur_good_price_slot", slot_town_trade_good_prices_begin),
  3293.  
  3294. +          (party_get_slot, ":cur_price", ":center_no", ":cur_good_price_slot"),
  3295.  
  3296. +
  3297.  
  3298. +         (val_mul, ":cur_price", 1000),
  3299.  
  3300. +         (val_mul, ":cur_price", ":total_constants"),
  3301.  
  3302. +         (val_div, ":cur_price", ":total_price"),       
  3303.  
  3304. +
  3305.  
  3306. +         (val_clamp, ":cur_price", minimum_price_factor, maximum_price_factor),
  3307.  
  3308. +         (party_set_slot, ":center_no", ":cur_good_price_slot", ":cur_price"),
  3309.  
  3310. +       (try_end),
  3311.  
  3312. +      (try_end),
  3313.  
  3314.    ]),
  3315.  
  3316.  
  3317.  
  3318.    #script_update_trade_good_price_for_party
  3319.  
  3320. @@ -13306,35 +13420,52 @@ scripts = [
  3321.         (assign, ":consumption", reg0),
  3322.  
  3323.         (val_sub, ":production", ":consumption"),
  3324.  
  3325.        
  3326.  
  3327. -       #Change averages production x 4 for excess demand
  3328.  
  3329. +       #Change averages production x 2(1+random(2)) (was 4, random(8)) for excess demand
  3330.  
  3331.          (try_begin),
  3332.  
  3333.           #supply is greater than demand
  3334.  
  3335.            (gt, ":production", 0),
  3336.  
  3337. -         (store_mul, ":change_factor", ":production", 8), #price will be decreased by his factor
  3338.  
  3339. +         (store_mul, ":change_factor", ":production", 1), #price will be decreased by his factor
  3340.  
  3341.           (store_random_in_range, ":random_change", 0, ":change_factor"),
  3342.  
  3343. +         (val_add, ":random_change", ":change_factor"),
  3344.  
  3345. +         (val_add, ":random_change", ":change_factor"),         
  3346.  
  3347. +
  3348.  
  3349. +         #simulation starts
  3350.  
  3351. +          (store_sub, ":final_price", ":cur_price", ":random_change"),
  3352.  
  3353. +         (val_clamp, ":final_price", minimum_price_factor, maximum_price_factor),                       
  3354.  
  3355.           (try_begin), #Excess of supply decelerates over time, as low price reduces output
  3356.  
  3357. -           (lt, ":cur_price", 900),
  3358.  
  3359. -           (val_mul, ":random_change", ":cur_price"),
  3360.  
  3361. -           (val_div, ":random_change", 900),
  3362.  
  3363. -         (try_end),
  3364.  
  3365. +           #if expected final price is 100 then it will multiply random_change by 0.308x ((100+300)/(1300) = 400/1300).
  3366.  
  3367. +           (lt, ":final_price", 1000),
  3368.  
  3369. +           (store_add, ":final_price_plus_300", ":final_price", 300),
  3370.  
  3371. +           (val_mul, ":random_change", ":final_price_plus_300"),
  3372.  
  3373. +           (val_div, ":random_change", 1300),
  3374.  
  3375. +          (try_end),
  3376.  
  3377.            (val_sub, ":cur_price", ":random_change"),
  3378.  
  3379.          (else_try),
  3380.  
  3381.            (lt, ":production", 0),
  3382.  
  3383.           (store_sub, ":change_factor", 0, ":production"), #price will be increased by his factor
  3384.  
  3385. -         (val_mul, ":change_factor", 8),
  3386.  
  3387. +         (val_mul, ":change_factor", 1),
  3388.  
  3389.           (store_random_in_range, ":random_change", 0, ":change_factor"),
  3390.  
  3391. +         (val_add, ":random_change", ":change_factor"),
  3392.  
  3393. +         (val_add, ":random_change", ":change_factor"),
  3394.  
  3395.            (val_add, ":cur_price", ":random_change"),
  3396.  
  3397.          (try_end),
  3398.  
  3399. -  
  3400.  
  3401. -      
  3402.  
  3403. +          
  3404.  
  3405.          #Move price towards average by 3%...
  3406.  
  3407.         #Equilibrium is 33 cycles, or 100 days
  3408.  
  3409.         #Change per cycle is Production x 4
  3410.  
  3411.         #Thus, max differential = -5 x 4 x 33 = -660 for -5
  3412.  
  3413. -        (store_sub, ":price_difference", ":cur_price", average_price_factor),
  3414.  
  3415. -        (val_mul, ":price_difference", 97),
  3416.  
  3417. -        (val_div, ":price_difference", 100),
  3418.  
  3419. -        (store_add, ":new_price", average_price_factor, ":price_difference"),
  3420.  
  3421. +       (try_begin),
  3422.  
  3423. +         (is_between, ":center_no", villages_begin, villages_end),
  3424.  
  3425. +          (store_sub, ":price_difference", ":cur_price", average_price_factor),
  3426.  
  3427. +          (val_mul, ":price_difference", 97),
  3428.  
  3429. +          (val_div, ":price_difference", 100),
  3430.  
  3431. +          (store_add, ":new_price", average_price_factor, ":price_difference"),
  3432.  
  3433. +        (else_try),
  3434.  
  3435. +          (store_sub, ":price_difference", ":cur_price", average_price_factor),
  3436.  
  3437. +          (val_mul, ":price_difference", 97),
  3438.  
  3439. +          (val_div, ":price_difference", 100),
  3440.  
  3441. +          (store_add, ":new_price", average_price_factor, ":price_difference"),
  3442.  
  3443. +        (try_end),
  3444.  
  3445.        
  3446.  
  3447.         #Price of manufactured goods drift towards primary raw material
  3448.  
  3449.         (try_begin),
  3450.  
  3451. @@ -13342,10 +13473,23 @@ scripts = [
  3452.              (neq, ":raw_material", 0),
  3453.  
  3454.             (store_sub, ":raw_material_price_slot", ":raw_material", trade_goods_begin),
  3455.  
  3456.             (val_add, ":raw_material_price_slot", slot_town_trade_good_prices_begin),
  3457.  
  3458. -           (party_get_slot, ":raw_material_price", ":center_no", ":raw_material_price_slot"),
  3459.  
  3460. -           (gt, ":raw_material_price", ":new_price"),
  3461.  
  3462. -           (store_sub, ":raw_material_boost", ":raw_material_price", ":new_price"),
  3463.  
  3464. -           (val_div, ":raw_material_boost", 10),
  3465.  
  3466. +
  3467.  
  3468. +           (party_get_slot, ":total_raw_material_price", ":center_no", ":raw_material_price_slot"),
  3469.  
  3470. +           (val_mul, ":total_raw_material_price", 3),
  3471.  
  3472. +            (assign, ":number_of_centers", 3),
  3473.  
  3474. +
  3475.  
  3476. +           (try_for_range, ":village_no", villages_begin, villages_end),
  3477.  
  3478. +             (party_slot_eq, ":village_no", slot_village_bound_center, ":center_no"),
  3479.  
  3480. +             (party_get_slot, ":raw_material_price", ":village_no", ":raw_material_price_slot"),
  3481.  
  3482. +             (val_add, ":total_raw_material_price", ":raw_material_price"),
  3483.  
  3484. +             (val_add, ":number_of_centers", 1),
  3485.  
  3486. +            (try_end),
  3487.  
  3488. +
  3489.  
  3490. +           (store_div, ":average_raw_material_price", ":total_raw_material_price", ":number_of_centers"),                 
  3491.  
  3492. +
  3493.  
  3494. +           (gt, ":average_raw_material_price", ":new_price"),
  3495.  
  3496. +           (store_sub, ":raw_material_boost", ":average_raw_material_price", ":new_price"),
  3497.  
  3498. +           (val_div, ":raw_material_boost", 10),
  3499.  
  3500.             (val_add, ":new_price", ":raw_material_boost"),
  3501.  
  3502.         (try_end),
  3503.  
  3504.        
  3505.  
  3506. @@ -13419,7 +13563,6 @@ scripts = [
  3507.             (party_get_slot, ":base_production", ":center_no", slot_center_tanneries),
  3508.  
  3509.             (val_mul, ":base_production", 20),
  3510.  
  3511.            
  3512.  
  3513. -
  3514.  
  3515.         (else_try),
  3516.  
  3517.             (eq, ":cur_good", "itm_honey"),      #Demand = 5
  3518.  
  3519.             (party_get_slot, ":base_production", ":center_no", slot_center_apiaries),
  3520.  
  3521. @@ -13469,9 +13612,7 @@ scripts = [
  3522.         (else_try),
  3523.  
  3524.             (eq, ":cur_good", "itm_wine"),  
  3525.  
  3526.             (party_get_slot, ":base_production", ":center_no", slot_center_wine_presses),
  3527.  
  3528. -           (val_mul, ":base_production", 30),
  3529.  
  3530. -          
  3531.  
  3532. -          
  3533.  
  3534. +           (val_mul, ":base_production", 30),                     
  3535.  
  3536.         (else_try),
  3537.  
  3538.             (eq, ":cur_good", "itm_raw_olives"),    
  3539.  
  3540.             (party_get_slot, ":base_production", ":center_no", slot_center_acres_olives),
  3541.  
  3542. @@ -13489,9 +13630,7 @@ scripts = [
  3543.         (else_try),
  3544.  
  3545.             (eq, ":cur_good", "itm_raw_flax"),  
  3546.  
  3547.             (party_get_slot, ":base_production", ":center_no", slot_center_acres_flax),
  3548.  
  3549. -           (val_div, ":base_production", 65),
  3550.  
  3551. -          
  3552.  
  3553. -
  3554.  
  3555. +           (val_div, ":base_production", 65),         
  3556.  
  3557.         (else_try),
  3558.  
  3559.             (eq, ":cur_good", "itm_velvet"),    
  3560.  
  3561.             (party_get_slot, ":base_production", ":center_no", slot_center_silk_looms),
  3562.  
  3563. @@ -13504,9 +13643,7 @@ scripts = [
  3564.             (eq, ":cur_good", "itm_raw_dyes"),  
  3565.  
  3566.             (this_or_next|eq, ":center_no", "p_town_5"),
  3567.  
  3568.                 (eq, ":center_no", "p_town_22"),
  3569.  
  3570. -           (assign, ":base_production", 50),
  3571.  
  3572. -
  3573.  
  3574. -          
  3575.  
  3576. +           (assign, ":base_production", 50),          
  3577.  
  3578.         (else_try),
  3579.  
  3580.             (eq, ":cur_good", "itm_raw_date_fruit"),    
  3581.  
  3582.             (party_get_slot, ":base_production", ":center_no", slot_center_acres_dates),
  3583.  
  3584. @@ -13531,11 +13668,7 @@ scripts = [
  3585.                 (assign, ":base_production", 30),
  3586.  
  3587.             (try_end)
  3588.  
  3589.         (try_end),
  3590.  
  3591. -      
  3592.  
  3593. -      
  3594.  
  3595. -      
  3596.  
  3597. -      
  3598.  
  3599. -      
  3600.  
  3601. +                          
  3602.  
  3603.         #Modify production by other goods
  3604.  
  3605.         (assign, ":modified_production", ":base_production"),
  3606.  
  3607.         (try_begin),
  3608.  
  3609. @@ -13573,8 +13706,7 @@ scripts = [
  3610.         (else_try),
  3611.  
  3612.             (eq, ":cur_good", "itm_velvet"),
  3613.  
  3614.             (call_script, "script_good_price_affects_good_production", ":center_no", "itm_raw_silk", ":base_production", 1),
  3615.  
  3616. -           (assign, ":initially_modified_production", reg0),
  3617.  
  3618. -          
  3619.  
  3620. +           (assign, ":initially_modified_production", reg0),          
  3621.  
  3622.             (call_script, "script_good_price_affects_good_production", ":center_no", "itm_raw_dyes", ":initially_modified_production", 2),
  3623.  
  3624.             (assign, ":modified_production", reg0),
  3625.  
  3626.         (else_try),
  3627.  
  3628. @@ -13587,7 +13719,6 @@ scripts = [
  3629.             (assign, ":modified_production", reg0),
  3630.  
  3631.         (try_end),
  3632.  
  3633.        
  3634.  
  3635. -
  3636.  
  3637.         (assign, ":base_production_modded_by_raw_materials", ":modified_production"), #this is just logged for the report screen
  3638.  
  3639.  
  3640.  
  3641.         #Increase both positive and negative production by the center's prosperity
  3642.  
  3643. @@ -13776,7 +13907,7 @@ scripts = [
  3644.      
  3645.  
  3646.       (call_script, "script_add_log_entry", logent_party_traded, ":party_no", ":origin", ":center_no", -1),
  3647.  
  3648.  
  3649.  
  3650. -      (call_script, "script_do_party_center_trade", ":party_no", ":center_no", price_adjustment), #change prices by 20%, also, sets party_last_traded to new
  3651.  
  3652. +      (call_script, "script_do_party_center_trade", ":party_no", ":center_no", 4), #it was first 10 then increased 20 then increased 30, now I decrease it to back 6. Because otherwise prices do not differiate much. Trade become useless in game.
  3653.  
  3654.        
  3655.  
  3656.        (assign, ":total_change", reg0),
  3657.  
  3658.        #Adding the earnings to the wealth (maximum changed price is the earning)
  3659.  
  3660. @@ -13835,7 +13966,7 @@ scripts = [
  3661.      [
  3662.  
  3663.        (store_script_param_1, ":party"), #Party_id
  3664.  
  3665.        
  3666.  
  3667. -      (assign, reg(0),0),
  3668.  
  3669. +      (assign, reg0,0),
  3670.  
  3671.        (party_get_num_companion_stacks, ":num_stacks",":party"),
  3672.  
  3673.        (try_for_range, ":i_stack", 0, ":num_stacks"),
  3674.  
  3675.          (party_stack_get_troop_id, ":stack_troop", ":party", ":i_stack"),
  3676.  
  3677. @@ -13848,7 +13979,7 @@ scripts = [
  3678.          (party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"),
  3679.  
  3680.          (val_sub, ":stack_size", ":num_wounded"),
  3681.  
  3682.          (val_mul, ":stack_strength", ":stack_size"),
  3683.  
  3684. -        (val_add,reg(0), ":stack_strength"),
  3685.  
  3686. +        (val_add,reg0, ":stack_strength"),
  3687.  
  3688.        (try_end),
  3689.  
  3690.    ]),
  3691.  
  3692.    
  3693.  
  3694. @@ -13954,21 +14085,14 @@ scripts = [
  3695.    #script_party_calculate_loot:
  3696.  
  3697.    # INPUT:
  3698.  
  3699.    # param1: Party-id
  3700.  
  3701. -  # Returns num looted items in reg(0)  
  3702.  
  3703. +  # Returns num looted items in reg0
  3704.  
  3705.    ("party_calculate_loot",
  3706.  
  3707.      [
  3708.  
  3709.        (store_script_param_1, ":enemy_party"), #Enemy Party_id
  3710.  
  3711.              
  3712.  
  3713.        (call_script, "script_calculate_main_party_shares"),
  3714.  
  3715.        (assign, ":num_player_party_shares", reg0),
  3716.  
  3717. -      #(assign, ":num_ally_shares", reg1),
  3718.  
  3719. -      #(store_add, ":num_shares",  ":num_player_party_shares", ":num_ally_shares"),
  3720.  
  3721. -      
  3722.  
  3723. -      #Calculate player loot probability
  3724.  
  3725. -      #(assign, ":loot_probability", 100),
  3726.  
  3727. -      #(val_mul, ":loot_probability", 10),
  3728.  
  3729. -      #(val_div, ":loot_probability", ":num_shares"),
  3730.  
  3731. -      
  3732.  
  3733. +            
  3734.  
  3735.        (try_for_range, ":i_loot", 0, num_party_loot_slots),
  3736.  
  3737.          (store_add, ":cur_loot_slot", ":i_loot", slot_party_looted_item_1),
  3738.  
  3739.          (party_get_slot, ":item_no", "$g_enemy_party", ":cur_loot_slot"),
  3740.  
  3741. @@ -14022,10 +14146,6 @@ scripts = [
  3742.            (assign, ":cur_probability", 100),
  3743.  
  3744.            (val_mul, ":cur_probability", average_price_factor),
  3745.  
  3746.            (val_div, ":cur_probability", ":cur_price"),
  3747.  
  3748. -          (val_mul, ":cur_probability", average_price_factor),
  3749.  
  3750. -          (val_div, ":cur_probability", ":cur_price"),
  3751.  
  3752. -          (val_mul, ":cur_probability", average_price_factor),
  3753.  
  3754. -          (val_div, ":cur_probability", ":cur_price"),
  3755.  
  3756.            (assign, reg0, ":cur_probability"),
  3757.  
  3758.            (set_item_probability_in_merchandise, ":cur_goods", ":cur_probability"),
  3759.  
  3760.          (try_end),
  3761.  
  3762. @@ -14529,7 +14649,6 @@ scripts = [
  3763.            (party_prisoner_stack_get_troop_id, ":stack_troop", ":party_no", ":stack_no"),
  3764.  
  3765.            (troop_is_hero, ":stack_troop"),
  3766.  
  3767.            (party_add_members, ":collection_party", ":stack_troop", 1),
  3768.  
  3769. -
  3770.  
  3771.          (try_end),
  3772.  
  3773.        (try_end),
  3774.  
  3775.        (party_get_num_attached_parties, ":num_attached_parties", ":party_no"),
  3776.  
  3777. @@ -15749,10 +15868,10 @@ scripts = [
  3778.        (assign, reg0, 0),
  3779.  
  3780.        (try_for_range, ":i_stack", 0, ":num_stacks"),
  3781.  
  3782.          (party_stack_get_troop_id, ":stack_troop",":party",":i_stack"),
  3783.  
  3784. +        (neq, ":stack_troop", "trp_player"),
  3785.  
  3786.          (assign, ":num_fit",0),
  3787.  
  3788.          (try_begin),
  3789.  
  3790.            (troop_is_hero, ":stack_troop"),
  3791.  
  3792. -          (neq, ":stack_troop", "trp_player"),
  3793.  
  3794.            (store_troop_health, ":troop_hp", ":stack_troop"),
  3795.  
  3796.            (try_begin),
  3797.  
  3798.              (ge, ":troop_hp", 80),
  3799.  
  3800. @@ -16154,21 +16273,37 @@ scripts = [
  3801.          (val_add, ":no_centers", 1),
  3802.  
  3803.          
  3804.  
  3805.          #(party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"),
  3806.  
  3807. -        (eq, ":home_center", ":cur_center"), #I changed it with above line, now if slot_town_lord is a village its home center is bordered walled center. Better this way. ozan-18.01.09
  3808.  
  3809. +        (eq, ":home_center", ":cur_center"), #I changed it with above line, now if lord is owner of any village its bound walled center is counted as 1000. Better this way. ozan-18.01.09
  3810.  
  3811.          
  3812.  
  3813.          (val_add, ":no_centers", 1000),
  3814.  
  3815.        (try_end),
  3816.  
  3817. -      (gt, ":no_centers", 0), #Fail if there are no centers
  3818.  
  3819. +
  3820.  
  3821. +     #if no center is available count all centers not besieged do not care its faction.
  3822.  
  3823. +     (try_begin),
  3824.  
  3825. +        (le, ":no_centers", 0),
  3826.  
  3827. +
  3828.  
  3829. +       (assign, "$g_there_is_no_avaliable_centers", 1),
  3830.  
  3831. +
  3832.  
  3833. +        (try_for_range,":cur_center", walled_centers_begin, walled_centers_end),
  3834.  
  3835. +         (party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1),
  3836.  
  3837. +          (val_add, ":no_centers", 1),                                  
  3838.  
  3839. +        (try_end),
  3840.  
  3841. +     (else_try),
  3842.  
  3843. +       (assign, "$g_there_is_no_avaliable_centers", 0),
  3844.  
  3845. +     (try_end),
  3846.  
  3847. +
  3848.  
  3849.        (store_random_in_range, ":random_center", 0, ":no_centers"),
  3850.  
  3851.        (try_for_range,":cur_center", walled_centers_begin, walled_centers_end),
  3852.  
  3853.          (eq, ":result", -1),
  3854.  
  3855.          (store_faction_of_party, ":cur_faction", ":cur_center"),
  3856.  
  3857. +       (this_or_next|eq, "$g_there_is_no_avaliable_centers", 1),
  3858.  
  3859.          (eq, ":cur_faction", ":faction_no"),
  3860.  
  3861.          (party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1),
  3862.  
  3863.          (val_sub, ":random_center", 1),
  3864.  
  3865.          (try_begin),
  3866.  
  3867.            #(party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"),
  3868.  
  3869. -          (eq, ":home_center", ":cur_center"), #I changed it with above line, now if slot_town_lord is a village its home center is bordered walled center. Better this way. ozan-18.01.09
  3870.  
  3871. +          (eq, ":home_center", ":cur_center"), #I changed it with above line, now if lord is owner of any village its bound walled center is counted as 1000. Better this way. ozan-18.01.09
  3872.  
  3873. +         (eq, "$g_there_is_no_avaliable_centers", 0),
  3874.  
  3875.  
  3876.  
  3877.            (val_sub, ":random_center", 1000),
  3878.  
  3879.          (try_end),
  3880.  
  3881. @@ -16694,9 +16829,6 @@ scripts = [
  3882.                (store_random_in_range, ":quest_no", ":quests_begin_2", ":quests_end_2"),
  3883.  
  3884.              (try_end),
  3885.  
  3886.            
  3887.  
  3888. -#TODO: Remove this when test is done
  3889.  
  3890. -#       (assign, ":quest_no", "qst_meet_spy_in_enemy_town"),
  3891.  
  3892. -#TODO: Remove this when test is done end
  3893.  
  3894.             (neg|check_quest_active,":quest_no"),
  3895.  
  3896.             (neg|quest_slot_ge, ":quest_no", slot_quest_dont_give_again_remaining_days, 1),
  3897.  
  3898.             (try_begin),
  3899.  
  3900. @@ -17928,11 +18060,10 @@ scripts = [
  3901.         (try_end),
  3902.  
  3903.         (eq, ":giver_troop", ":junior_debauched_lord_in_faction"),
  3904.  
  3905.        
  3906.  
  3907. -       (assign, ":faction_to_attack", 0),
  3908.  
  3909. -       (assign, ":faction_to_attack_score", 0),
  3910.  
  3911. +       (assign, ":faction_to_attack", -1),
  3912.  
  3913. +       (assign, ":faction_to_attack_score", -1),
  3914.  
  3915.        
  3916.  
  3917.         (try_for_range, ":faction_candidate", kingdoms_begin, kingdoms_end),
  3918.  
  3919. -           (neq, ":faction_to_attack", -1),
  3920.  
  3921.             (neq, ":faction_candidate", ":giver_troop_faction"),
  3922.  
  3923.             (faction_slot_eq, ":faction_candidate", slot_faction_state, sfs_active),
  3924.  
  3925.             (neq, ":faction_candidate", "$players_kingdom"),
  3926.  
  3927. @@ -17940,20 +18071,14 @@ scripts = [
  3928.             (store_relation, ":relation", ":faction_candidate", ":giver_troop_faction"),
  3929.  
  3930.            
  3931.  
  3932.             (store_add, ":provocation_slot", ":giver_troop_faction", slot_faction_provocation_days_with_factions_begin),
  3933.  
  3934. -           (val_sub, ":provocation_slot", kingdoms_begin),            
  3935.  
  3936. +           (val_sub, ":provocation_slot", kingdoms_begin),
  3937.  
  3938.             (faction_get_slot, ":provocation_days", ":faction_candidate", ":provocation_slot"),
  3939.  
  3940.            
  3941.  
  3942. -           (try_begin),
  3943.  
  3944. -               (lt, ":relation", 0),
  3945.  
  3946. -               (assign, ":faction_to_attack", -1), #disqualifies if thefaction is already at war
  3947.  
  3948. -           (else_try),
  3949.  
  3950. -               (ge, ":provocation_days", 1),
  3951.  
  3952. -               (assign, ":faction_to_attack", -1), #disqualifies if the faction has already provoked someone
  3953.  
  3954. -           (else_try),
  3955.  
  3956. -               (ge, ":relation", 0),
  3957.  
  3958. -               (assign, ":faction_to_attack_temp_score", 2),
  3959.  
  3960. -               #add in scores - no truce?
  3961.  
  3962. -              
  3963.  
  3964. +           (ge, ":relation", 0), #disqualifies if the faction is already at war
  3965.  
  3966. +           (le, ":provocation_days", 0), #disqualifies if the faction has already provoked someone
  3967.  
  3968. +          
  3969.  
  3970. +           (store_random_in_range, ":faction_candidate_score", 0, 100),
  3971.  
  3972. +           #add in scores - no truce?
  3973.  
  3974.  #              (store_add, ":truce_slot", ":giver_troop_faction", slot_faction_truce_days_with_factions_begin),
  3975.  
  3976.  #              (store_add, ":provocation_slot", ":giver_troop_faction", slot_faction_provocation_days_with_factions_begin),
  3977.  
  3978.  #              (val_sub, ":truce_slot", kingdoms_begin),
  3979.  
  3980. @@ -17964,11 +18089,9 @@ scripts = [
  3981.  #                  (val_sub, ":faction_to_attack_temp_score", 1),
  3982.  
  3983.  #              (try_end),
  3984.  
  3985.                
  3986.  
  3987. -               (gt, ":faction_to_attack_temp_score", ":faction_to_attack_score"),
  3988.  
  3989. -              
  3990.  
  3991. -               (assign, ":faction_to_attack", ":faction_candidate"),
  3992.  
  3993. -               (assign, ":faction_to_attack_temp_score", ":faction_to_attack_score"),
  3994.  
  3995. -           (try_end)
  3996.  
  3997. +           (gt, ":faction_candidate_score", ":faction_to_attack_score"),
  3998.  
  3999. +           (assign, ":faction_to_attack", ":faction_candidate"),
  4000.  
  4001. +           (assign, ":faction_to_attack_score", ":faction_candidate_score"),
  4002.  
  4003.         (try_end),
  4004.  
  4005.        
  4006.  
  4007.         (is_between, ":faction_to_attack", kingdoms_begin, kingdoms_end),
  4008.  
  4009. @@ -19675,6 +19798,16 @@ scripts = [
  4010.         (store_troop_faction, ":lord_troop_faction", ":lord_troop_id"),
  4011.  
  4012.       (try_end),   
  4013.  
  4014.       (faction_get_slot, ":faction_leader", ":lord_troop_faction", slot_faction_leader),
  4015.  
  4016. +
  4017.  
  4018. +     (try_begin),
  4019.  
  4020. +       (eq, ":faction_leader", "trp_player"),
  4021.  
  4022. +
  4023.  
  4024. +        (try_begin),
  4025.  
  4026. +            (troop_get_type, ":is_female", "trp_player"),
  4027.  
  4028. +            (eq, ":is_female", 1),
  4029.  
  4030. +            (unlock_achievement, ACHIEVEMENT_QUEEN),
  4031.  
  4032. +        (try_end),
  4033.  
  4034. +     (try_end),
  4035.  
  4036.      
  4037.  
  4038.       (try_begin),
  4039.  
  4040.         (eq, ":faction_leader", ":old_lord_troop_id"),
  4041.  
  4042. @@ -20589,7 +20722,12 @@ scripts = [
  4043.        (store_troop_faction, ":troop_faction_no", ":troop_no"),
  4044.  
  4045.        
  4046.  
  4047.        (assign, "$pout_party", -1),
  4048.  
  4049. -      (set_spawn_radius, 0),
  4050.  
  4051. +      (try_begin),
  4052.  
  4053. +        (eq, "$g_there_is_no_avaliable_centers", 0),
  4054.  
  4055. +        (set_spawn_radius, 0),
  4056.  
  4057. +     (else_try),
  4058.  
  4059. +        (set_spawn_radius, 15),
  4060.  
  4061. +      (try_end),
  4062.  
  4063.        (spawn_around_party, ":center_no", "pt_kingdom_hero_party"),
  4064.  
  4065.        
  4066.  
  4067.        (assign, "$pout_party", reg0),
  4068.  
  4069. @@ -20912,12 +21050,17 @@ scripts = [
  4070.        (store_script_param_1, ":village_no"),
  4071.  
  4072.        (party_get_slot, ":merchant_troop", ":village_no", slot_town_elder),
  4073.  
  4074.        (reset_item_probabilities,0),
  4075.  
  4076. -      (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
  4077.  
  4078. +
  4079.  
  4080. +     (assign, ":total_probability", 0),
  4081.  
  4082.        (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
  4083.  
  4084. +      
  4085.  
  4086.         (call_script, "script_center_get_production", ":village_no", ":cur_goods"),
  4087.  
  4088.         (assign, ":cur_probability", reg0),
  4089.  
  4090.         (call_script, "script_center_get_consumption", ":village_no", ":cur_goods"),
  4091.  
  4092. +       (val_div, reg0, 3),
  4093.  
  4094.         (val_add, ":cur_probability", reg0),
  4095.  
  4096. +
  4097.  
  4098. +       (val_max, ":cur_probability", 1),
  4099.  
  4100.      
  4101.  
  4102.         (try_begin),
  4103.  
  4104.             (this_or_next|eq, ":cur_goods", "itm_chicken"),
  4105.  
  4106. @@ -20925,30 +21068,33 @@ scripts = [
  4107.             (assign, ":cur_probability", 5),
  4108.  
  4109.         (try_end),
  4110.  
  4111.      
  4112.  
  4113. -       (val_mul, ":cur_probability", 3),
  4114.  
  4115. -    
  4116.  
  4117. -        (store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"),
  4118.  
  4119. -        (party_get_slot, ":cur_price", ":village_no", ":cur_price_slot"),
  4120.  
  4121. -        (val_mul, ":cur_probability", average_price_factor),
  4122.  
  4123. -        (val_div, ":cur_probability", ":cur_price"),
  4124.  
  4125. -        (val_mul, ":cur_probability", average_price_factor),
  4126.  
  4127. -        (val_div, ":cur_probability", ":cur_price"),
  4128.  
  4129. -        (val_mul, ":cur_probability", average_price_factor),
  4130.  
  4131. -        (val_div, ":cur_probability", ":cur_price"),
  4132.  
  4133. -#        (val_mul, ":cur_probability", average_price_factor),
  4134.  
  4135. -#        (val_div, ":cur_probability", ":cur_price"),
  4136.  
  4137. -        (set_item_probability_in_merchandise, ":cur_goods", ":cur_probability"),
  4138.  
  4139. +       (val_add, ":total_probability", ":cur_probability"),
  4140.  
  4141.        (try_end),
  4142.  
  4143. -#      (set_item_probability_in_merchandise, "itm_spice", 0),
  4144.  
  4145. -#      (set_item_probability_in_merchandise, "itm_velvet", 0),
  4146.  
  4147. -
  4148.  
  4149. +    
  4150.  
  4151.       (try_begin),
  4152.  
  4153.         (party_get_slot, ":prosperity", ":village_no", slot_town_prosperity),
  4154.  
  4155. -       (val_div, ":prosperity", 17), #up to 5
  4156.  
  4157. -       (store_add, ":number_of_goods", ":prosperity", 1),
  4158.  
  4159. +       (val_div, ":prosperity", 15), #up to 6
  4160.  
  4161. +       (store_add, ":number_of_items_in_village", ":prosperity", 1),
  4162.  
  4163.       (try_end),
  4164.  
  4165.  
  4166.  
  4167. -      (troop_add_merchandise, ":merchant_troop", itp_type_goods, ":number_of_goods"),
  4168.  
  4169. +      (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
  4170.  
  4171. +       (call_script, "script_center_get_production", ":village_no", ":cur_goods"),
  4172.  
  4173. +       (assign, ":cur_probability", reg0),
  4174.  
  4175. +       (call_script, "script_center_get_consumption", ":village_no", ":cur_goods"),
  4176.  
  4177. +       (val_div, reg0, 3),
  4178.  
  4179. +       (val_add, ":cur_probability", reg0),
  4180.  
  4181. +
  4182.  
  4183. +       (val_max, ":cur_probability", 1),
  4184.  
  4185. +
  4186.  
  4187. +        (val_mul, ":cur_probability", ":number_of_items_in_village"),
  4188.  
  4189. +       (val_mul, ":cur_probability", 100),
  4190.  
  4191. +       (val_div, ":cur_probability", ":total_probability"),
  4192.  
  4193. +
  4194.  
  4195. +        (set_item_probability_in_merchandise, ":cur_goods", ":cur_probability"),
  4196.  
  4197. +      (try_end),
  4198.  
  4199. +
  4200.  
  4201. +      (troop_clear_inventory, ":merchant_troop"),
  4202.  
  4203. +      (troop_add_merchandise, ":merchant_troop", itp_type_goods, ":number_of_items_in_village"),
  4204.  
  4205.        (troop_ensure_inventory_space, ":merchant_troop", 80),
  4206.  
  4207.  
  4208.  
  4209.        #Adding 1 prosperity to the village while reducing each 3000 gold from the elder
  4210.  
  4211. @@ -21045,6 +21191,26 @@ scripts = [
  4212.    ("process_village_raids",
  4213.  
  4214.      [
  4215.  
  4216.         (try_for_range, ":village_no", villages_begin, villages_end),
  4217.  
  4218. +        ##CABA Fix
  4219.  
  4220. +        (try_begin),
  4221.  
  4222. +          (this_or_next|is_between, ":village_no", "p_village_16", "p_village_23"), #Shapeshte through Shulus (up to Ilvia)
  4223.  
  4224. +          (this_or_next|is_between, ":village_no", "p_village_49", "p_village_51"), #Tismirr and Karindi
  4225.  
  4226. +          (this_or_next|eq, ":village_no", "p_village_75"), #Bhulaban
  4227.  
  4228. +          (is_between, ":village_no", "p_village_85", "p_village_87"), #Ismirala and Slezkh
  4229.  
  4230. +          (assign, ":normal_village_icon", "icon_village_snow_a"),  
  4231.  
  4232. +          (assign, ":burnt_village_icon", "icon_village_snow_burnt_a"),
  4233.  
  4234. +          (assign, ":deserted_village_icon", "icon_village_snow_deserted_a"),
  4235.  
  4236. +        (else_try),
  4237.  
  4238. +          (is_between, ":village_no", "p_village_91", "p_salt_mine"), #Ayn Assuadi through Rushdigh
  4239.  
  4240. +          (assign, ":normal_village_icon", "icon_village_c"),  
  4241.  
  4242. +          (assign, ":burnt_village_icon", "icon_village_burnt_c"),
  4243.  
  4244. +          (assign, ":deserted_village_icon", "icon_village_deserted_c"),
  4245.  
  4246. +        (else_try),
  4247.  
  4248. +          (assign, ":normal_village_icon", "icon_village_a"),
  4249.  
  4250. +          (assign, ":burnt_village_icon", "icon_village_burnt_a"),
  4251.  
  4252. +          (assign, ":deserted_village_icon", "icon_village_deserted_a"),
  4253.  
  4254. +        (try_end),
  4255.  
  4256. +        ##CABA Fix        
  4257.  
  4258.           (party_get_slot, ":village_raid_progress", ":village_no", slot_village_raid_progress),
  4259.  
  4260.           (try_begin),                
  4261.  
  4262.             (party_slot_eq, ":village_no", slot_village_state, 0), #village is normal
  4263.  
  4264. @@ -21056,8 +21222,8 @@ scripts = [
  4265.              
  4266.  
  4267.               (try_begin),
  4268.  
  4269.                 (party_get_icon, ":village_icon", ":village_no"),
  4270.  
  4271. -               (neq, ":village_icon", "icon_village_a"),
  4272.  
  4273. -               (party_set_icon, ":village_no", "icon_village_a"),
  4274.  
  4275. +              (neq, ":village_icon", ":normal_village_icon"), ##CABA FIX
  4276.  
  4277. +              (party_set_icon, ":village_no", ":normal_village_icon"), ##CABA FIX
  4278.  
  4279.               (try_end),
  4280.  
  4281.              
  4282.  
  4283.               (party_slot_ge, ":village_no", slot_village_smoke_added, 1),
  4284.  
  4285. @@ -21104,7 +21270,7 @@ scripts = [
  4286.                 (party_slot_eq, ":village_no", slot_village_smoke_added, 0),
  4287.  
  4288.                 (party_add_particle_system, ":village_no", "psys_map_village_fire"),
  4289.  
  4290.                 (party_add_particle_system, ":village_no", "psys_map_village_fire_smoke"),
  4291.  
  4292. -               (party_set_icon, ":village_no", "icon_village_burnt_a"),
  4293.  
  4294. +              (party_set_icon, ":village_no", ":burnt_village_icon"), ##CABA FIX
  4295.  
  4296.                 (party_set_slot, ":village_no", slot_village_smoke_added, 1),
  4297.  
  4298.               (try_end),
  4299.  
  4300.               (try_begin),
  4301.  
  4302. @@ -21172,7 +21338,7 @@ scripts = [
  4303.               (party_slot_eq, ":village_no", slot_village_smoke_added, 2),
  4304.  
  4305.               (party_clear_particle_systems, ":village_no"),
  4306.  
  4307.               (party_set_slot, ":village_no", slot_village_smoke_added, 3),
  4308.  
  4309. -             (party_set_icon, ":village_no", "icon_village_deserted_a"),
  4310.  
  4311. +            (party_set_icon, ":village_no", ":deserted_village_icon"), ##CABA FIX
  4312.  
  4313.             (try_end),
  4314.  
  4315.             (try_begin),
  4316.  
  4317.               (gt, ":recover_progress", 100),
  4318.  
  4319. @@ -21180,7 +21346,7 @@ scripts = [
  4320.               (party_set_slot, ":village_no", slot_village_recover_progress, 0),
  4321.  
  4322.               (party_clear_particle_systems, ":village_no"),
  4323.  
  4324.               (party_set_slot, ":village_no", slot_village_smoke_added, 0),
  4325.  
  4326. -             (party_set_icon, ":village_no", "icon_village_a"),
  4327.  
  4328. +            (party_set_icon, ":village_no", ":normal_village_icon"), ##CABA FIX
  4329.  
  4330.             (try_end),
  4331.  
  4332.           (try_end),
  4333.  
  4334.         (try_end),
  4335.  
  4336. @@ -22634,7 +22800,7 @@ scripts = [
  4337.         (eq, ":faction_marshal", "trp_player"),
  4338.  
  4339.         (neq, "$players_kingdom", ":faction_no"),
  4340.  
  4341.  
  4342.  
  4343. -       (faction_set_slot, ":faction_no", slot_faction_political_issue, 1), #Appointment of marshal
  4344.  
  4345. +                (faction_set_slot, ":faction_no", slot_faction_political_issue, 1), #Appointment of marshal
  4346.  
  4347.         (store_current_hours, ":hours"),
  4348.  
  4349.         (val_max, ":hours", 0),
  4350.  
  4351.         (faction_set_slot, ":faction_no", slot_faction_political_issue_time, ":hours"), #Appointment of marshal
  4352.  
  4353. @@ -22769,7 +22935,7 @@ scripts = [
  4354.         #Resolve faction political issue
  4355.  
  4356.         (assign, ":winning_candidate", -1),
  4357.  
  4358.         (try_begin),
  4359.  
  4360. -           (call_script, "script_troop_get_relation_with_troop", ":faction_leader", ":popular_favorite"),
  4361.  
  4362. +                        (call_script, "script_troop_get_relation_with_troop", ":faction_leader", ":popular_favorite"),
  4363.  
  4364.            
  4365.  
  4366.             (this_or_next|ge, reg0, 10),
  4367.  
  4368.             (this_or_next|troop_slot_eq, ":faction_leader", slot_troop_stance_on_faction_issue, ":popular_favorite"),
  4369.  
  4370. @@ -22830,7 +22996,7 @@ scripts = [
  4371.                 (troop_set_slot, ":active_npc", slot_troop_stance_on_faction_issue, -1),
  4372.  
  4373.             (try_end),     
  4374.  
  4375.             (try_begin),
  4376.  
  4377. -               (eq, "$players_kingdom", ":faction_no"),
  4378.  
  4379. +                                (eq, "$players_kingdom", ":faction_no"),
  4380.  
  4381.                 (troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
  4382.  
  4383.             (try_end),
  4384.  
  4385.            
  4386.  
  4387. @@ -22893,8 +23059,8 @@ scripts = [
  4388.     (try_begin),
  4389.  
  4390.         (faction_get_slot, ":faction_issue", ":faction_no", slot_faction_political_issue),
  4391.  
  4392.         (le, ":faction_issue", 0),
  4393.  
  4394. -      
  4395.  
  4396. -       (assign, ":landless_lords", 0),
  4397.  
  4398. +
  4399.  
  4400. +                (assign, ":landless_lords", 0),
  4401.  
  4402.         (assign, ":unassigned_centers", 0),
  4403.  
  4404.         (assign, ":first_unassigned_center_found", 0),
  4405.  
  4406.        
  4407.  
  4408. @@ -22957,7 +23123,7 @@ scripts = [
  4409.      (try_end),  
  4410.  
  4411.          
  4412.  
  4413.     #DO FACTION AI HERE
  4414.  
  4415. -   (try_begin),
  4416.  
  4417. +        (try_begin),
  4418.  
  4419.         (eq, ":faction_no", "$players_kingdom"),
  4420.  
  4421.         (eq, ":faction_marshal", "trp_player"),
  4422.  
  4423.         (assign, ":faction_ai_decider", "trp_player"),
  4424.  
  4425. @@ -22977,6 +23143,7 @@ scripts = [
  4426.         (neq, ":new_strategy", ":old_faction_ai_state"),
  4427.  
  4428.         (eq, ":new_strategy", sfai_gathering_army),
  4429.  
  4430.         (faction_get_slot, ":faction_marshal", ":faction_no", slot_faction_marshall),
  4431.  
  4432. +       (ge, ":faction_marshal", 0),
  4433.  
  4434.         (troop_get_slot, ":marshal_party", ":faction_marshal", slot_troop_leaded_party),
  4435.  
  4436.         (party_set_slot, ":marshal_party", slot_party_ai_object, -1),
  4437.  
  4438.         (assign, "$g_gathering_new_started", 1),
  4439.  
  4440. @@ -22992,11 +23159,17 @@ scripts = [
  4441.         (eq, ":new_strategy", ":old_faction_ai_state"),
  4442.  
  4443.         (eq, ":new_strategy", sfai_gathering_army),
  4444.  
  4445.         (faction_get_slot, ":faction_marshal", ":faction_no", slot_faction_marshall),
  4446.  
  4447. +       (ge, ":faction_marshal", 0),
  4448.  
  4449.         (troop_get_slot, ":marshal_party", ":faction_marshal", slot_troop_leaded_party),
  4450.  
  4451.         (party_get_slot, ":party_ai_object", ":marshal_party", slot_party_ai_object),
  4452.  
  4453. +
  4454.  
  4455.         (ge, ":party_ai_object", 0),
  4456.  
  4457. +       (ge, ":marshal_party", 0),
  4458.  
  4459. +       (party_is_active, ":marshal_party"),
  4460.  
  4461. +       (party_is_active, ":party_ai_object"),    
  4462.  
  4463.         (store_distance_to_party_from_party, ":dist", ":marshal_party", ":party_ai_object"),
  4464.  
  4465.         (le, ":dist", 5),
  4466.  
  4467. +
  4468.  
  4469.         (party_set_slot, ":marshal_party", slot_party_ai_object, -1),
  4470.  
  4471.      (try_end),
  4472.  
  4473.       #end ozan
  4474.  
  4475. @@ -23281,6 +23454,7 @@ scripts = [
  4476.         (val_max, ":renown_change", 0),
  4477.  
  4478.        
  4479.  
  4480.         (eq, ":troop_no", "trp_player"),
  4481.  
  4482. +
  4483.  
  4484.         (assign, reg5, ":renown_change"),
  4485.  
  4486.        
  4487.  
  4488.         (eq, "$cheat_mode", 1),
  4489.  
  4490. @@ -23293,6 +23467,17 @@ scripts = [
  4491.      
  4492.  
  4493.        (try_begin),
  4494.  
  4495.          (eq, ":troop_no", "trp_player"),
  4496.  
  4497. +
  4498.  
  4499. +       (try_begin),
  4500.  
  4501. +         (ge, ":new_renown", 50),
  4502.  
  4503. +
  4504.  
  4505. +          (try_begin),
  4506.  
  4507. +            (troop_get_type, ":is_female", "trp_player"),
  4508.  
  4509. +            (eq, ":is_female", 1),
  4510.  
  4511. +            (unlock_achievement, ACHIEVEMENT_TALK_OF_THE_TOWN),
  4512.  
  4513. +          (try_end),
  4514.  
  4515. +       (try_end),
  4516.  
  4517. +
  4518.  
  4519.          (str_store_troop_name, s1, ":troop_no"),
  4520.  
  4521.          (assign, reg12, ":renown_change"),
  4522.  
  4523.          (val_abs, reg12),
  4524.  
  4525. @@ -24634,7 +24819,7 @@ scripts = [
  4526.          (val_mul, ":quest_importance", ":importance_multiplier"),
  4527.  
  4528.          (val_div, ":quest_importance", 100),
  4529.  
  4530.        (else_try),
  4531.  
  4532. -        (val_div, ":quest_importance", 4),
  4533.  
  4534. +        (val_mul, ":quest_importance", 4), #was div 4. Relation was increasing very less. I changed it to mul 4.
  4535.  
  4536.          (val_add, ":quest_importance", 1),
  4537.  
  4538.          (call_script, "script_change_player_relation_with_troop", ":quest_giver", ":quest_importance"),
  4539.  
  4540.        (try_end),
  4541.  
  4542. @@ -25413,11 +25598,11 @@ scripts = [
  4543.                (else_try),
  4544.  
  4545.                  (ge, ":agent_hit_points", 25),
  4546.  
  4547.                  (assign, ":agent_delta_courage_score", 1),
  4548.  
  4549. -              (end_try),
  4550.  
  4551. +              (try_end),
  4552.  
  4553.                (try_begin), # to make our warrior run away easier we decrease one, because they have player_agent (+6) advantage.
  4554.  
  4555.                  (agent_is_ally, ":agent_no"),
  4556.  
  4557.                  (val_sub, ":agent_delta_courage_score", 1),
  4558.  
  4559. -              (end_try),
  4560.  
  4561. +              (try_end),
  4562.  
  4563.              (else_try),
  4564.  
  4565.                (assign, ":agent_delta_courage_score", 2),
  4566.  
  4567.              (end_try),
  4568.  
  4569. @@ -25454,13 +25639,13 @@ scripts = [
  4570.                (val_mul, ":agent_delta_courage_score", 50),
  4571.  
  4572.                (val_add, ":agent_courage_score", ":agent_delta_courage_score"),
  4573.  
  4574.                (agent_set_slot, ":centered_agent_no", slot_agent_courage_score, ":agent_courage_score"),          
  4575.  
  4576. -            (try_begin),
  4577.  
  4578. +            (else_try),
  4579.  
  4580.                (lt, ":dist", 4000), #21-40 meter
  4581.  
  4582.                (agent_get_slot, ":agent_courage_score", ":centered_agent_no", slot_agent_courage_score),
  4583.  
  4584.                (val_mul, ":agent_delta_courage_score", 40),
  4585.  
  4586.                (val_add, ":agent_courage_score", ":agent_delta_courage_score"),
  4587.  
  4588.                (agent_set_slot, ":centered_agent_no", slot_agent_courage_score, ":agent_courage_score"),          
  4589.  
  4590. -            (try_begin),
  4591.  
  4592. +            (else_try),
  4593.  
  4594.                (lt, ":dist", 7000), #41-70 meter
  4595.  
  4596.                (agent_get_slot, ":agent_courage_score", ":centered_agent_no", slot_agent_courage_score),
  4597.  
  4598.                (val_mul, ":agent_delta_courage_score", 30),
  4599.  
  4600. @@ -25641,7 +25826,6 @@ scripts = [
  4601.              (agent_get_slot, ":agent_courage_score", ":agent_no", slot_agent_courage_score),
  4602.  
  4603.              (val_mul, ":agent_delta_courage_score", 90),
  4604.  
  4605.              (val_add, ":agent_courage_score", ":agent_delta_courage_score"),
  4606.  
  4607. -
  4608.  
  4609.              (agent_set_slot, ":agent_no", slot_agent_courage_score, ":agent_courage_score"),          
  4610.  
  4611.            (else_try),
  4612.  
  4613.              (lt, ":dist", 600), #5-6 meters
  4614.  
  4615. @@ -29568,7 +29752,6 @@ scripts = [
  4616.            (else_try),
  4617.  
  4618.              (eq, ":agent_division", 7),
  4619.  
  4620.              (val_add, ":num_us_ready_group7", 1),
  4621.  
  4622. -
  4623.  
  4624.              (eq, "$group7_has_troops", 1), #added to solve problem.
  4625.  
  4626.            (else_try),
  4627.  
  4628.              (eq, ":agent_division", 8),
  4629.  
  4630. @@ -30106,11 +30289,17 @@ scripts = [
  4631.    # INPUT: arg1 = party_no, arg2 = center_no, arg3 = percentage_change_in_center
  4632.  
  4633.    # OUTPUT: reg0 = total_change
  4634.  
  4635.    ("do_party_center_trade",
  4636.  
  4637. -    [
  4638.  
  4639. +    [   
  4640.  
  4641.        (store_script_param, ":party_no", 1),
  4642.  
  4643.        (store_script_param, ":center_no", 2),
  4644.  
  4645. -      (store_script_param, ":percentage_change", 3), #this should probably always be a constant. Currently it is 25
  4646.  
  4647. -     (assign, ":percentage_change", 30),
  4648.  
  4649. +
  4650.  
  4651. +      (try_begin),
  4652.  
  4653. +       (eq, "$cheat_mode", 3),
  4654.  
  4655. +       (str_store_party_name, s1, ":center_no"),
  4656.  
  4657. +       (display_message, "@{!}DEBUG : {s1} is trading with villagers"),
  4658.  
  4659. +      (try_end),
  4660.  
  4661. +
  4662.  
  4663. +      (store_script_param, ":percentage_change", 3), #this should probably always be a constant. Currently it is 25     
  4664.  
  4665.  
  4666.  
  4667.       (party_get_slot, ":origin", ":party_no", slot_party_last_traded_center),
  4668.  
  4669.       (party_set_slot, ":party_no", slot_party_last_traded_center, ":center_no"),
  4670.  
  4671. @@ -30134,20 +30323,22 @@ scripts = [
  4672.            (val_mul, ":cur_change", -1),
  4673.  
  4674.          (try_end),
  4675.  
  4676.  
  4677.  
  4678. -       #The new price for the caravan or peasant is set before the change, so the prices in the trading town have full effect on the next center
  4679.  
  4680. -        (party_set_slot, ":party_no", ":cur_good_price_slot", ":cur_center_price"),
  4681.  
  4682. +       (assign, ":initial_price", ":cur_center_price"),
  4683.  
  4684. +
  4685.  
  4686. +       #The new price for the caravan or peasant is set before the change, so the prices in the trading town have full effect on the next center        
  4687.  
  4688. +       (party_set_slot, ":party_no", ":cur_good_price_slot", ":cur_center_price"),
  4689.  
  4690.        
  4691.  
  4692. -        (val_add, ":cur_center_price", ":cur_change"),
  4693.  
  4694. -        (party_set_slot, ":center_no", ":cur_good_price_slot", ":cur_center_price"),
  4695.  
  4696. +        (val_add, ":cur_center_price", ":cur_change"),      
  4697.  
  4698. +       (party_set_slot, ":center_no", ":cur_good_price_slot", ":cur_center_price"),
  4699.  
  4700.                
  4701.  
  4702.         (try_begin),
  4703.  
  4704.             (eq, "$cheat_mode", 3),
  4705.  
  4706.             (str_store_party_name, s3, ":origin"),
  4707.  
  4708.             (str_store_party_name, s4, ":center_no"),
  4709.  
  4710.             (str_store_item_name, s5, ":cur_good"),
  4711.  
  4712. -           (assign, reg4, ":cur_change"),
  4713.  
  4714. +           (assign, reg4, ":initial_price"),
  4715.  
  4716.             (assign, reg5, ":cur_center_price"),
  4717.  
  4718. -           (display_message, "@{!}DEBUG -- Trade of {s5} from {s3} to {s4} brings price from {reg4} to  {reg5}"),
  4719.  
  4720. +           (display_log_message, "@{!}DEBUG -- Trade of {s5} from {s3} to {s4} brings price from {reg4} to {reg5}"),
  4721.  
  4722.         (try_end),
  4723.  
  4724.        
  4725.  
  4726.        (try_end),
  4727.  
  4728. @@ -30779,12 +30970,12 @@ scripts = [
  4729.           (assign, ":volunteer_troop", ":upgrade_troop_no"),
  4730.  
  4731.         (try_end),
  4732.  
  4733.        
  4734.  
  4735. -       (assign, ":upper_limit", 7),
  4736.  
  4737. +       (assign, ":upper_limit", 8),
  4738.  
  4739.         (try_begin),
  4740.  
  4741. -         (ge, ":player_relation", 5),
  4742.  
  4743. +         (ge, ":player_relation", 4),
  4744.  
  4745.           (assign, ":upper_limit", ":player_relation"),
  4746.  
  4747.           (val_div, ":upper_limit", 2),
  4748.  
  4749. -         (val_add, ":upper_limit", 10),
  4750.  
  4751. +         (val_add, ":upper_limit", 6),
  4752.  
  4753.         (else_try),
  4754.  
  4755.           (lt, ":player_relation", 0),
  4756.  
  4757.           (assign, ":upper_limit", 0),
  4758.  
  4759. @@ -30937,6 +31128,17 @@ scripts = [
  4760.         (else_try),
  4761.  
  4762.           (party_set_slot, ":village_no", slot_village_infested_by_bandits, 0),
  4763.  
  4764.           (store_random_in_range, ":random_no", 0, 100),
  4765.  
  4766. +         (assign, ":continue", 1),
  4767.  
  4768. +         (try_begin),
  4769.  
  4770. +           (check_quest_active, "qst_collect_taxes"),
  4771.  
  4772. +           (quest_slot_eq, "qst_collect_taxes", slot_quest_target_center, ":village_no"),
  4773.  
  4774. +           (assign, ":continue", 0),
  4775.  
  4776. +         (else_try),
  4777.  
  4778. +           (check_quest_active, "qst_train_peasants_against_bandits"),
  4779.  
  4780. +           (quest_slot_eq, "qst_train_peasants_against_bandits", slot_quest_target_center, ":village_no"),
  4781.  
  4782. +           (assign, ":continue", 0),
  4783.  
  4784. +         (try_end),
  4785.  
  4786. +         (eq, ":continue", 1),
  4787.  
  4788.           (lt, ":random_no", 3),
  4789.  
  4790.           (store_random_in_range, ":random_no", 0, 3),
  4791.  
  4792.           (try_begin),
  4793.  
  4794. @@ -32959,8 +33161,6 @@ scripts = [
  4795.     (store_script_param, ":impact_divisor", 4),  
  4796.  
  4797.  
  4798.  
  4799.     (assign, reg4, ":production"),
  4800.  
  4801. -
  4802.  
  4803. -  
  4804.  
  4805.    
  4806.  
  4807.     (try_begin),
  4808.  
  4809.         (gt, ":production", 0), #let's take -20 as the zero production rate, although in actuality production can go lower, representing increased demand
  4810.  
  4811. @@ -32968,9 +33168,22 @@ scripts = [
  4812.         (store_sub, ":input_good_price_slot", ":input_item_no", trade_goods_begin),
  4813.  
  4814.         (val_add, ":input_good_price_slot", slot_town_trade_good_prices_begin),
  4815.  
  4816.         (party_get_slot, ":input_price", ":center", ":input_good_price_slot"),
  4817.  
  4818. -  
  4819.  
  4820. -      
  4821.  
  4822.  
  4823.  
  4824. +       (try_begin),
  4825.  
  4826. +         (is_between, ":center", towns_begin, towns_end),
  4827.  
  4828. +
  4829.  
  4830. +         (val_mul, ":input_price", 4),
  4831.  
  4832. +         (assign, ":number_of_villages", 4),
  4833.  
  4834. +         (try_for_range, ":village_no", villages_begin, villages_end),
  4835.  
  4836. +           (party_slot_eq, ":village_no", slot_village_bound_center, ":center"),
  4837.  
  4838. +           (party_get_slot, ":input_price_at_village", ":village_no", ":input_good_price_slot"),
  4839.  
  4840. +           (val_add, ":input_price", ":input_price_at_village"),
  4841.  
  4842. +           (val_add, ":number_of_villages", 1),
  4843.  
  4844. +         (try_end),         
  4845.  
  4846. +
  4847.  
  4848. +         (val_div, ":input_price", ":number_of_villages"),
  4849.  
  4850. +       (try_end),
  4851.  
  4852. +      
  4853.  
  4854.         (try_begin), #1/2 impact for low prices
  4855.  
  4856.             (lt, ":input_price", 1000),
  4857.  
  4858.             (val_mul, ":impact_divisor", 2),
  4859.  
  4860. @@ -32983,19 +33196,16 @@ scripts = [
  4861.             (val_add, ":input_price", 1000),
  4862.  
  4863.         (try_end),
  4864.  
  4865.        
  4866.  
  4867. -
  4868.  
  4869.         (val_mul, ":production", 1000),
  4870.  
  4871.         (val_div, ":production", ":input_price"),
  4872.  
  4873.    
  4874.  
  4875. -#      (assign, reg5, ":production"),
  4876.  
  4877. -#      (str_store_item_name, s4, ":input_item_no"),
  4878.  
  4879. -#      (display_message, "@{s4} price of {reg3} reduces production from {reg4} to {reg5}"),
  4880.  
  4881. -      
  4882.  
  4883. +       #(assign, reg5, ":production"),
  4884.  
  4885. +       #(assign, reg3, ":input_price"),
  4886.  
  4887. +       #(str_store_item_name, s4, ":input_item_no"),
  4888.  
  4889. +       #(display_message, "@{s4} price of {reg3} reduces production from {reg4} to {reg5}"),      
  4890.  
  4891.     (try_end),
  4892.  
  4893. -  
  4894.  
  4895. -      
  4896.  
  4897. -   (assign, reg0, ":production"),
  4898.  
  4899. -  
  4900.  
  4901. +              
  4902.  
  4903. +   (assign, reg0, ":production")
  4904.  
  4905.     ]),
  4906.  
  4907.    
  4908.  
  4909.  
  4910.  
  4911. @@ -33403,7 +33613,6 @@ scripts = [
  4912.                      (this_or_next|troop_slot_eq, ":npc", slot_troop_2ary_morality_state, tms_dismissed),
  4913.  
  4914.                          (eq, "$disable_npc_complaints", 1),
  4915.  
  4916.  # npc is quietly disappointed
  4917.  
  4918. -
  4919.  
  4920.                      (troop_get_slot, ":grievance", ":npc", slot_troop_morality_penalties),
  4921.  
  4922.                      (val_add, ":grievance", ":value"),
  4923.  
  4924.                      (troop_set_slot, ":npc", slot_troop_morality_penalties, ":grievance"),
  4925.  
  4926. @@ -33587,7 +33796,6 @@ scripts = [
  4927.          (else_try),
  4928.  
  4929.              (lt, ":morality_grievances", 15),
  4930.  
  4931.              (str_store_string, 7, "str_content"),
  4932.  
  4933. -
  4934.  
  4935.          (else_try),
  4936.  
  4937.              (lt, ":morality_grievances", 30),
  4938.  
  4939.              (str_store_string, 7, "str_concerned"),
  4940.  
  4941. @@ -42613,9 +42821,10 @@ scripts = [
  4942.            (try_end),
  4943.  
  4944.                        
  4945.  
  4946.            (try_begin),  
  4947.  
  4948. -            #if currently our target is attacking to an enemy center and that center is besieged/raided by one of our parties then
  4949.  
  4950. -            #divide marshal_distance for other center's to "2" instead of "3" and add some small more distance to avoid easily
  4951.  
  4952. -            #changing mind during siege because of small score differences.
  4953.  
  4954. +            #if currently main aim of our faction is attacking to an enemy center and that center is already besieged/raided by one of
  4955.  
  4956. +            #our parties then divide marshal_dist_to_potential_target_div_x score for current center to "3/2" instead of "3" and this
  4957.  
  4958. +            #result in decrease at distance_score, and also decrease some scores from power_ratio_score in order to avoid frequently
  4959.  
  4960. +            #changes at main aimed target city of our faction during sieges.
  4961.  
  4962.                
  4963.  
  4964.              (faction_get_slot, ":current_ai_state", ":faction_no", slot_faction_ai_state),
  4965.  
  4966.              (eq, ":current_ai_state", sfai_attacking_center),
  4967.  
  4968. @@ -42646,8 +42855,8 @@ scripts = [
  4969.  
  4970.  
  4971.              (eq, ":all_vassals_included", 0),
  4972.  
  4973.  
  4974.  
  4975. -            (store_div, ":marshal_dist_to_potential_target_div_x", ":marshal_dist_to_potential_target", 2),
  4976.  
  4977. -            (assign, ":marshal_dist_to_potential_target_div_x", ":marshal_dist_to_potential_target"),
  4978.  
  4979. +            (store_mul, ":marshal_dist_to_potential_target_div_x", ":marshal_dist_to_potential_target", 2),
  4980.  
  4981. +            (val_div, ":marshal_dist_to_potential_target_div_x", 3),
  4982.  
  4983.            (else_try),
  4984.  
  4985.              (store_div, ":marshal_dist_to_potential_target_div_x", ":marshal_dist_to_potential_target", 3),
  4986.  
  4987.            (try_end),
  4988.  
  4989. @@ -44262,7 +44471,7 @@ scripts = [
  4990.                 (val_sub, ":num_of_servings_to_serve", 1),
  4991.  
  4992.                 (item_set_slot, ":item", slot_item_is_checked, 1),
  4993.  
  4994.             (try_end),
  4995.  
  4996. -       (try_begin),
  4997.  
  4998. +       (try_end),
  4999.  
  5000.     (try_end),
  5001.  
  5002.     ]),
  5003.  
  5004.  
  5005.  
  5006. @@ -44611,8 +44820,7 @@ scripts = [
  5007.     (str_store_party_name, s4, ":center_no"),
  5008.  
  5009.    
  5010.  
  5011.     (assign, ":hardship_index", 0),
  5012.  
  5013. -   (try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
  5014.  
  5015. -      
  5016.  
  5017. +   (try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),      
  5018.  
  5019.         #Must have consumption of at least 4 to be relevant
  5020.  
  5021.         #This prevents perishables and raw materials from having a major impact
  5022.  
  5023.         (try_begin),
  5024.  
  5025. @@ -44622,8 +44830,7 @@ scripts = [
  5026.             (item_get_slot, ":consumer_consumption", ":cur_good", slot_item_urban_demand),
  5027.  
  5028.         (try_end),
  5029.  
  5030.         (gt, ":consumer_consumption", 2),
  5031.  
  5032. -      
  5033.  
  5034. -      
  5035.  
  5036. +              
  5037.  
  5038.         (store_div, ":max_impact", ":consumer_consumption", 3), #was 4
  5039.  
  5040.        
  5041.  
  5042.         #High-demand items like grain tend to have much more dramatic price differentiation, so they yield substantially higher results than low-demand items
  5043.  
  5044. @@ -44643,10 +44850,10 @@ scripts = [
  5045.    
  5046.  
  5047.     (assign, reg0, ":hardship_index"),
  5048.  
  5049.  
  5050.  
  5051. -   #(try_begin),
  5052.  
  5053. -       #(eq, "$cheat_mode", 1),
  5054.  
  5055. -       #(display_message, "@{!}DEBUG -- hardship index for {s4} = {reg0}"),
  5056.  
  5057. -   #(try_end),
  5058.  
  5059. +   (try_begin),
  5060.  
  5061. +       (eq, "$cheat_mode", 1),
  5062.  
  5063. +       (display_message, "@{!}DEBUG -- hardship index for {s4} = {reg0}"),
  5064.  
  5065. +   (try_end)
  5066.  
  5067.     ]),
  5068.  
  5069.    
  5070.  
  5071.     ("lord_find_alternative_faction", #Also, make it so that lords will try to keep at least one center unassigned
  5072.  
  5073. @@ -44656,40 +44863,81 @@ scripts = [
  5074.      
  5075.  
  5076.       (assign, ":new_faction", -1),
  5077.  
  5078.       (assign, ":score_to_beat", -5),
  5079.  
  5080. -    
  5081.  
  5082. -     #Factions with an available center
  5083.  
  5084. -     (try_for_range, ":center_no", centers_begin, centers_end),
  5085.  
  5086. -       (this_or_next|party_slot_eq, ":center_no", slot_town_lord, stl_unassigned),
  5087.  
  5088. -       (party_slot_eq, ":center_no", slot_town_lord, stl_rejected_by_player),
  5089.  
  5090. -       (store_faction_of_party, ":center_faction", ":center_no"),
  5091.  
  5092. -       (neq, ":center_faction", ":orig_faction"),
  5093.  
  5094. -       (faction_get_slot, ":liege", ":center_faction", slot_faction_leader),
  5095.  
  5096. -       (this_or_next|neq, ":liege", "trp_player"),
  5097.  
  5098. -       (ge, "$player_right_to_rule", 25),     
  5099.  
  5100. -       (call_script, "script_troop_get_relation_with_troop", ":troop_no", ":liege"),
  5101.  
  5102. -       (assign, ":liege_relation", reg0),
  5103.  
  5104. -       (gt, ":liege_relation", ":score_to_beat"),
  5105.  
  5106. -       (assign, ":new_faction", ":center_faction"),
  5107.  
  5108. -       (assign, ":score_to_beat", ":liege_relation"),
  5109.  
  5110. -     (try_end),
  5111.  
  5112. -    
  5113.  
  5114. -     #Factions without an available center
  5115.  
  5116. +
  5117.  
  5118.       (try_begin),
  5119.  
  5120. -       (eq, ":new_faction", -1),
  5121.  
  5122. -       (assign, ":score_to_beat", 0),
  5123.  
  5124. -      
  5125.  
  5126. -       (try_for_range, ":kingdom", kingdoms_begin, kingdoms_end),
  5127.  
  5128. -         (faction_slot_eq, ":kingdom", slot_faction_state, sfs_active),
  5129.  
  5130. -         (faction_get_slot, ":liege", ":kingdom", slot_faction_leader),
  5131.  
  5132. -         (call_script, "script_troop_get_relation_with_troop", ":troop_no", ":liege"),
  5133.  
  5134. -         (assign, ":liege_relation", reg0),       
  5135.  
  5136. -         (gt, ":liege_relation", ":score_to_beat"),
  5137.  
  5138. -        
  5139.  
  5140. -         (assign, ":new_faction", ":kingdom"),
  5141.  
  5142. -         (assign, ":score_to_beat", ":liege_relation"),       
  5143.  
  5144. -       (try_end),
  5145.  
  5146. +       (store_random_in_range, ":advantegous_faction_change_time", 0, 10000),
  5147.  
  5148. +
  5149.  
  5150. +       (this_or_next|le, "$g_advantegous_faction", 0),
  5151.  
  5152. +       (eq, ":advantegous_faction_change_time", 0),
  5153.  
  5154. +       (store_random_in_range, "$g_advantegous_faction", kingdoms_begin, kingdoms_end),
  5155.  
  5156. +
  5157.  
  5158. +       #(str_store_faction_name, s7, "$g_advantegous_faction"),
  5159.  
  5160. +       #(display_message, "@OZANDEBUG : new advantegous faction is {s7}"),
  5161.  
  5162.       (try_end),
  5163.  
  5164. -    
  5165.  
  5166. +
  5167.  
  5168. +     (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),  
  5169.  
  5170. +       (this_or_next|eq, "$g_give_advantage_to_original_faction", 1),
  5171.  
  5172. +       (neq, ":faction_no", ":orig_faction"),
  5173.  
  5174. +      
  5175.  
  5176. +       (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
  5177.  
  5178. +       (assign, ":number_of_walled_centers", 0),
  5179.  
  5180. +       (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
  5181.  
  5182. +         (store_faction_of_party, ":center_faction", ":center_no"),
  5183.  
  5184. +         (eq, ":center_faction", ":faction_no"),
  5185.  
  5186. +
  5187.  
  5188. +         (try_begin),
  5189.  
  5190. +           (party_slot_eq, ":center_no", slot_party_type, spt_town),
  5191.  
  5192. +           (val_add, ":number_of_walled_centers", 2),
  5193.  
  5194. +         (else_try),
  5195.  
  5196. +           (val_add, ":number_of_walled_centers", 1),
  5197.  
  5198. +         (try_end),
  5199.  
  5200. +       (try_end),
  5201.  
  5202. +
  5203.  
  5204. +       (assign, ":number_of_lords", 0),
  5205.  
  5206. +        (try_for_range, ":troop_id", original_kingdom_heroes_begin, active_npcs_end),
  5207.  
  5208. +          (store_troop_faction, ":faction_of_troop", ":troop_id"),
  5209.  
  5210. +          (eq, ":faction_of_troop", ":faction_no"),
  5211.  
  5212. +         (val_add, ":number_of_lords", 1),
  5213.  
  5214. +        (try_end),
  5215.  
  5216. +
  5217.  
  5218. +        (faction_get_slot, ":liege", ":faction_no", slot_faction_leader),
  5219.  
  5220. +       (call_script, "script_troop_get_relation_with_troop", ":troop_no", ":liege"),
  5221.  
  5222. +       (assign, ":relation_with_leader", reg0),
  5223.  
  5224. +
  5225.  
  5226. +       (store_mul, ":faction_score", ":number_of_walled_centers", 100),
  5227.  
  5228. +       (val_div, ":faction_score", ":number_of_lords"),
  5229.  
  5230. +       (val_add, ":faction_score", ":relation_with_leader"),
  5231.  
  5232. +
  5233.  
  5234. +       (try_begin),
  5235.  
  5236. +         (eq, ":faction_no", ":orig_faction"),
  5237.  
  5238. +         (eq, "$g_give_advantage_to_original_faction", 1),
  5239.  
  5240. +         (val_add, ":faction_score", 100),
  5241.  
  5242. +       (try_end),
  5243.  
  5244. +
  5245.  
  5246. +       (try_begin),
  5247.  
  5248. +         (eq, "$g_advantegous_faction", ":faction_no"),
  5249.  
  5250. +         (val_add, ":faction_score", 50),
  5251.  
  5252. +       (try_end),
  5253.  
  5254. +
  5255.  
  5256. +       (try_begin),
  5257.  
  5258. +         (eq, ":faction_no", "$players_kingdom"),
  5259.  
  5260. +         (val_sub, ":faction_score", 100),
  5261.  
  5262. +         (val_add, "$player_right_to_rule"),
  5263.  
  5264. +       (try_end),
  5265.  
  5266. +
  5267.  
  5268. +       #(str_store_faction_name, s1, ":faction_no"),
  5269.  
  5270. +       #(assign, reg1, ":number_of_walled_centers"),
  5271.  
  5272. +       #(assign, reg2, ":number_of_lords"),
  5273.  
  5274. +       #(assign, reg3, ":relation_with_leader"),
  5275.  
  5276. +       #(assign, reg4, ":faction_score"),
  5277.  
  5278. +       #(display_message, "@OZANDEBUG : {s1}, centers:{reg1}, lords:{reg2}, rel:{reg3}, score:{reg4}"),
  5279.  
  5280. +
  5281.  
  5282. +       (gt, ":faction_score", ":score_to_beat"),
  5283.  
  5284. +
  5285.  
  5286. +       (assign, ":score_to_beat", ":faction_score"),
  5287.  
  5288. +        (assign, ":new_faction", ":faction_no"),
  5289.  
  5290. +     (try_end),
  5291.  
  5292. +        
  5293.  
  5294.       (assign, reg0, ":new_faction"),  
  5295.  
  5296.     ]),
  5297.  
  5298.        
  5299.  
  5300. @@ -46860,8 +47108,7 @@ scripts = [
  5301.     #Indictments, cont: Finalize where the lord goes
  5302.  
  5303.     (try_begin),
  5304.  
  5305.         (is_between, ":new_faction", kingdoms_begin, kingdoms_end),
  5306.  
  5307. -      
  5308.  
  5309. -      
  5310.  
  5311. +              
  5312.  
  5313.         (try_begin),
  5314.  
  5315.             (ge, "$cheat_mode", 1),
  5316.  
  5317.             (str_store_troop_name, s4, ":troop_no"),
  5318.  
  5319. @@ -46964,5 +47211,137 @@ scripts = [
  5320.     (try_end),  
  5321.  
  5322.    ]),
  5323.  
  5324.    
  5325.  
  5326. -  
  5327.  
  5328. +  # script_refresh_center_inventories
  5329.  
  5330. +  ("refresh_center_inventories",
  5331.  
  5332. +  [
  5333.  
  5334. +    (reset_item_probabilities, 100),
  5335.  
  5336. +    (set_merchandise_modifier_quality, 150),
  5337.  
  5338. +
  5339.  
  5340. +    (reset_item_probabilities, 100),
  5341.  
  5342. +   (set_item_probability_in_merchandise, "itm_salt", 700),
  5343.  
  5344. +
  5345.  
  5346. +    (troop_add_merchandise, "trp_salt_mine_merchant", itp_type_goods,30),
  5347.  
  5348. +
  5349.  
  5350. +    # Add trade goods to merchant inventories
  5351.  
  5352. +    (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
  5353.  
  5354. +
  5355.  
  5356. +    (try_for_range, ":cur_center", towns_begin, towns_end),
  5357.  
  5358. +      (party_get_slot, ":cur_merchant", ":cur_center", slot_town_merchant),
  5359.  
  5360. +      (reset_item_probabilities,100),
  5361.  
  5362. +      (assign, ":total_probability", 0),
  5363.  
  5364. +      (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
  5365.  
  5366. +        (store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"),
  5367.  
  5368. +        (party_get_slot, ":cur_price", ":cur_center", ":cur_price_slot"),
  5369.  
  5370. +        (call_script, "script_center_get_production", ":cur_center", ":cur_goods"),
  5371.  
  5372. +        (assign, ":cur_probability", reg0),
  5373.  
  5374. +        (call_script, "script_center_get_consumption", ":cur_center", ":cur_goods"),
  5375.  
  5376. +        (val_div, reg0, 3),
  5377.  
  5378. +        (val_add, ":cur_probability", reg0),
  5379.  
  5380. +        (val_mul, ":cur_probability", 4),
  5381.  
  5382. +        (val_mul, ":cur_probability", average_price_factor),
  5383.  
  5384. +        (val_div, ":cur_probability", ":cur_price"),
  5385.  
  5386. +       (val_add, ":total_probability", ":cur_probability"),
  5387.  
  5388. +      (try_end),
  5389.  
  5390. +
  5391.  
  5392. +     (party_get_slot, ":town_prosperity", ":cur_center", slot_town_prosperity),
  5393.  
  5394. +     (store_div, ":number_of_items_in_town", ":town_prosperity", 2),
  5395.  
  5396. +     (val_clamp, ":number_of_items_in_town", 10, 40)
  5397.  
  5398. +
  5399.  
  5400. +      (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
  5401.  
  5402. +        (store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"),
  5403.  
  5404. +        (party_get_slot, ":cur_price", ":cur_center", ":cur_price_slot"),
  5405.  
  5406. +        (call_script, "script_center_get_production", ":cur_center", ":cur_goods"),
  5407.  
  5408. +        (assign, ":cur_probability", reg0),
  5409.  
  5410. +        (call_script, "script_center_get_consumption", ":cur_center", ":cur_goods"),
  5411.  
  5412. +        (val_div, reg0, 3),
  5413.  
  5414. +        (val_add, ":cur_probability", reg0),
  5415.  
  5416. +        (val_mul, ":cur_probability", 4),
  5417.  
  5418. +        (val_mul, ":cur_probability", average_price_factor),
  5419.  
  5420. +        (val_div, ":cur_probability", ":cur_price"),
  5421.  
  5422. +        (val_mul, ":cur_probability", ":number_of_items_in_town"),
  5423.  
  5424. +       (val_mul, ":cur_probability", 100),
  5425.  
  5426. +       (val_div, ":cur_probability", ":total_probability"),
  5427.  
  5428. +        (set_item_probability_in_merchandise, ":cur_goods", ":cur_probability"),                        
  5429.  
  5430. +      (try_end),
  5431.  
  5432. +
  5433.  
  5434. +      (troop_clear_inventory, ":cur_merchant"),
  5435.  
  5436. +
  5437.  
  5438. +      (troop_add_merchandise, ":cur_merchant", itp_type_goods, ":number_of_items_in_town"),     
  5439.  
  5440. +      (troop_ensure_inventory_space, ":cur_merchant", 30),
  5441.  
  5442. +      (troop_sort_inventory, ":cur_merchant"),
  5443.  
  5444. +      (store_troop_gold, ":cur_gold", ":cur_merchant"),
  5445.  
  5446. +      (lt, ":cur_gold", 1500),
  5447.  
  5448. +      (store_random_in_range, ":new_gold", 500, 1000),
  5449.  
  5450. +      (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
  5451.  
  5452. +    (try_end),    
  5453.  
  5454. +  ]),
  5455.  
  5456. +
  5457.  
  5458. +  # script_refresh_center_armories
  5459.  
  5460. +  ("refresh_center_armories",
  5461.  
  5462. +  [
  5463.  
  5464. +    (reset_item_probabilities, 100),
  5465.  
  5466. +   (set_merchandise_modifier_quality, 150),
  5467.  
  5468. +   (try_for_range, reg2, armor_merchants_begin, armor_merchants_end),
  5469.  
  5470. +     (store_sub, ":cur_town", reg2, armor_merchants_begin),
  5471.  
  5472. +     (val_add, ":cur_town", towns_begin),
  5473.  
  5474. +     (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
  5475.  
  5476. +     (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_body_armor, 16),
  5477.  
  5478. +     (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_head_armor, 16),
  5479.  
  5480. +     (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_foot_armor, 8),
  5481.  
  5482. +     (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_hand_armor, 4),
  5483.  
  5484. +     (troop_ensure_inventory_space, reg2, merchant_inventory_space),
  5485.  
  5486. +     (troop_sort_inventory, reg2),
  5487.  
  5488. +     (store_troop_gold, reg6, reg2),
  5489.  
  5490. +     (lt, reg6, 900),
  5491.  
  5492. +     (store_random_in_range, ":new_gold", 200, 400),
  5493.  
  5494. +     (call_script, "script_troop_add_gold", reg2, ":new_gold"),
  5495.  
  5496. +    (end_try),
  5497.  
  5498. +  ]),
  5499.  
  5500. +
  5501.  
  5502. +  # script_refresh_center_weaponsmiths
  5503.  
  5504. +  ("refresh_center_weaponsmiths",
  5505.  
  5506. +  [
  5507.  
  5508. +    (reset_item_probabilities, 100),
  5509.  
  5510. +    (set_merchandise_modifier_quality, 150),
  5511.  
  5512. +    (try_for_range, reg2, weapon_merchants_begin, weapon_merchants_end),
  5513.  
  5514. +     (store_sub, ":cur_town", reg2, weapon_merchants_begin),
  5515.  
  5516. +      (val_add, ":cur_town", towns_begin),
  5517.  
  5518. +      (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
  5519.  
  5520. +      (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_one_handed_wpn, 5),
  5521.  
  5522. +      (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_two_handed_wpn, 5),
  5523.  
  5524. +      (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_polearm, 5),
  5525.  
  5526. +      (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_shield, 6),
  5527.  
  5528. +      (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_bow, 4),
  5529.  
  5530. +      (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_crossbow, 3),
  5531.  
  5532. +      (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_thrown, 5),
  5533.  
  5534. +      (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_arrows, 2),
  5535.  
  5536. +      (troop_add_merchandise_with_faction, reg2, ":cur_faction", itp_type_bolts, 2),
  5537.  
  5538. +      (troop_ensure_inventory_space, reg2, merchant_inventory_space),
  5539.  
  5540. +      (troop_sort_inventory, reg2),
  5541.  
  5542. +      (store_troop_gold, reg6, reg2),
  5543.  
  5544. +      (lt, reg6, 900),
  5545.  
  5546. +      (store_random_in_range, ":new_gold", 200, 400),
  5547.  
  5548. +      (call_script, "script_troop_add_gold", reg2, ":new_gold"),
  5549.  
  5550. +    (try_end),
  5551.  
  5552. +  ]),
  5553.  
  5554. +
  5555.  
  5556. +  # script_refresh_center_stables
  5557.  
  5558. +  ("refresh_center_stables",
  5559.  
  5560. +  [
  5561.  
  5562. +    (reset_item_probabilities, 100),
  5563.  
  5564. +    (set_merchandise_modifier_quality, 150),
  5565.  
  5566. +    (try_for_range, ":cur_merchant", horse_merchants_begin, horse_merchants_end),
  5567.  
  5568. +      (store_sub, ":cur_town", ":cur_merchant", horse_merchants_begin),
  5569.  
  5570. +      (val_add, ":cur_town", towns_begin),
  5571.  
  5572. +      (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
  5573.  
  5574. +      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_horse, 5),
  5575.  
  5576. +      (troop_ensure_inventory_space, ":cur_merchant", 65),
  5577.  
  5578. +      (troop_sort_inventory, ":cur_merchant"),
  5579.  
  5580. +      (store_troop_gold, ":cur_gold", ":cur_merchant"),
  5581.  
  5582. +      (lt, ":cur_gold", 600),
  5583.  
  5584. +      (store_random_in_range, ":new_gold", 200, 400),
  5585.  
  5586. +      (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
  5587.  
  5588. +    (try_end),
  5589.  
  5590. +  ]),
  5591.  
  5592. +
  5593.  
  5594.  ]
  5595.  
  5596. diff -rupBN Module_system 1.134//module_simple_triggers.py Module_system 1.142//module_simple_triggers.py
  5597. --- Module_system 1.134//module_simple_triggers.py  2010-12-06 11:55:58.000000000 -0800
  5598. +++ Module_system 1.142//module_simple_triggers.py  2011-07-01 13:58:04.000000000 -0700
  5599. @@ -951,17 +951,17 @@ simple_triggers = [
  5600.          (try_begin),
  5601.  
  5602.            (neg|is_between, "$g_lord_long_term_count", "trp_kingdom_heroes_including_player_begin", active_npcs_end),
  5603.  
  5604.            (assign, "$g_lord_long_term_count", "trp_kingdom_heroes_including_player_begin"),
  5605.  
  5606. -       (try_end),
  5607.  
  5608. +        (try_end),
  5609.  
  5610.  
  5611.  
  5612.          (assign, ":troop_no", "$g_lord_long_term_count"),
  5613.  
  5614.    
  5615.  
  5616.          (try_begin),
  5617.  
  5618.            (eq, ":troop_no", "trp_kingdom_heroes_including_player_begin")
  5619.  
  5620.            (assign, ":troop_no", "trp_player"),
  5621.  
  5622. -       (try_end),
  5623.  
  5624. -      
  5625.  
  5626. -       (try_begin),
  5627.  
  5628. -         (eq, "$cheat_mode", 1),
  5629.  
  5630. +        (try_end),
  5631.  
  5632. +
  5633.  
  5634. +        (try_begin),
  5635.  
  5636. +          (eq, "$cheat_mode", 1),
  5637.  
  5638.            (str_store_troop_name, s9, ":troop_no"),
  5639.  
  5640.            (display_message, "@{!}DEBUG -- Doing political calculations for {s9}"),
  5641.  
  5642.          (try_end),
  5643.  
  5644. @@ -984,7 +984,7 @@ simple_triggers = [
  5645.              (faction_get_slot, ":faction_leader", ":original_faction", slot_faction_leader),
  5646.  
  5647.              (troop_get_slot, ":troop_reputation", ":troop_no", slot_lord_reputation_type),
  5648.  
  5649.            
  5650.  
  5651. -           (try_begin),
  5652.  
  5653. +            (try_begin),
  5654.  
  5655.                (neq, ":faction_leader", ":troop_no"),
  5656.  
  5657.                (try_begin),
  5658.  
  5659.                  (this_or_next|eq, ":troop_reputation", lrep_quarrelsome),
  5660.  
  5661. @@ -992,11 +992,11 @@ simple_triggers = [
  5662.                  (this_or_next|eq, ":troop_reputation", lrep_cunning),
  5663.  
  5664.                  (eq, ":troop_reputation", lrep_debauched),
  5665.  
  5666.                  (call_script, "script_troop_change_relation_with_troop", ":troop_no", ":faction_leader", -4),
  5667.  
  5668. -               (val_add, "$total_no_fief_changes", -4),
  5669.  
  5670. +                (val_add, "$total_no_fief_changes", -4),
  5671.  
  5672.                (else_try),
  5673.  
  5674.                  (eq, ":troop_reputation", lrep_martial),
  5675.  
  5676.                  (call_script, "script_troop_change_relation_with_troop", ":troop_no", ":faction_leader", -2),
  5677.  
  5678. -               (val_add, "$total_no_fief_changes", -2),
  5679.  
  5680. +                (val_add, "$total_no_fief_changes", -2),
  5681.  
  5682.                (try_end),
  5683.  
  5684.              (try_end),
  5685.  
  5686.            (try_end),
  5687.  
  5688. @@ -1004,96 +1004,90 @@ simple_triggers = [
  5689.        
  5690.  
  5691.          #Auto-indictment or defection
  5692.  
  5693.          (try_begin),
  5694.  
  5695. -           (this_or_next|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
  5696.  
  5697. -               (eq, ":troop_no", "trp_player"),       
  5698.  
  5699. -      
  5700.  
  5701. -           (try_begin),
  5702.  
  5703. -               (eq, ":troop_no", "trp_player"),
  5704.  
  5705. -               (assign, ":faction", "$players_kingdom"),
  5706.  
  5707. -           (else_try),
  5708.  
  5709. -               (store_faction_of_troop, ":faction", ":troop_no"),
  5710.  
  5711. -           (try_end),
  5712.  
  5713. -      
  5714.  
  5715. -           (faction_get_slot, ":faction_leader", ":faction", slot_faction_leader),
  5716.  
  5717. -           (neq, ":troop_no", ":faction_leader"),
  5718.  
  5719. -          
  5720.  
  5721. -           #I don't know why these are necessary, but they appear to be
  5722.  
  5723. -           (neg|is_between, ":troop_no", "trp_kingdom_1_lord", "trp_knight_1_1"),
  5724.  
  5725. -           (neg|is_between, ":troop_no", pretenders_begin, pretenders_end),
  5726.  
  5727. -          
  5728.  
  5729. -           (call_script, "script_troop_get_relation_with_troop", ":troop_no", ":faction_leader"),
  5730.  
  5731. -           (le, reg0, -75),
  5732.  
  5733. +          (this_or_next|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
  5734.  
  5735. +          (eq, ":troop_no", "trp_player"),    
  5736.  
  5737. +          (try_begin),
  5738.  
  5739. +            (eq, ":troop_no", "trp_player"),
  5740.  
  5741. +            (assign, ":faction", "$players_kingdom"),
  5742.  
  5743. +          (else_try),
  5744.  
  5745. +            (store_faction_of_troop, ":faction", ":troop_no"),
  5746.  
  5747. +          (try_end),
  5748.  
  5749.  
  5750.  
  5751. +          (faction_get_slot, ":faction_leader", ":faction", slot_faction_leader),
  5752.  
  5753. +          (neq, ":troop_no", ":faction_leader"),
  5754.  
  5755.            
  5756.  
  5757. +          #I don't know why these are necessary, but they appear to be
  5758.  
  5759. +          (neg|is_between, ":troop_no", "trp_kingdom_1_lord", "trp_knight_1_1"),
  5760.  
  5761. +          (neg|is_between, ":troop_no", pretenders_begin, pretenders_end),
  5762.  
  5763.            
  5764.  
  5765. -           (call_script, "script_cf_troop_can_intrigue", ":troop_no", 0), #Should include battle, prisoner, in a castle with others
  5766.  
  5767. -      
  5768.  
  5769. -           (store_random_in_range, ":who_moves_first", 0, 2),
  5770.  
  5771. -          
  5772.  
  5773. -           (try_begin),
  5774.  
  5775. -               (neq, ":who_moves_first", 0),
  5776.  
  5777. -               (neq, ":troop_no", "trp_player"),
  5778.  
  5779. -              
  5780.  
  5781. -               #do a defection
  5782.  
  5783. -               (call_script, "script_lord_find_alternative_faction", ":troop_no"),
  5784.  
  5785. -               (assign, ":new_faction", reg0),
  5786.  
  5787. -          
  5788.  
  5789. -               (is_between, ":new_faction", kingdoms_begin, kingdoms_end),
  5790.  
  5791. -
  5792.  
  5793. -               (str_store_troop_name_link, s1, ":troop_no"),
  5794.  
  5795. -               (str_store_faction_name_link, s2, ":new_faction")
  5796.  
  5797. -               (str_store_faction_name_link, s3, ":faction"),
  5798.  
  5799. -              
  5800.  
  5801. -               (call_script, "script_change_troop_faction", ":troop_no", ":new_faction"),
  5802.  
  5803. -              
  5804.  
  5805. -               (try_begin),
  5806.  
  5807. -                   (ge, "$cheat_mode", 1),
  5808.  
  5809. -                   (str_store_troop_name, s4, ":troop_no"),
  5810.  
  5811. -                   (display_message, "@{!}DEBUG - {s4} faction changed in defection"),
  5812.  
  5813. -               (try_end)
  5814.  
  5815. -              
  5816.  
  5817. -               (troop_get_type, reg4, ":troop_no"),
  5818.  
  5819. -               (str_store_string, s4, "str_lord_defects_ordinary"),
  5820.  
  5821. -               (display_log_message, "@{!}{s4}"),
  5822.  
  5823. -              
  5824.  
  5825. -               (try_begin),
  5826.  
  5827. -                   (eq, "$cheat_mode", 1),
  5828.  
  5829. -                   (this_or_next|eq, ":new_faction", "$players_kingdom"),
  5830.  
  5831. -                       (eq, ":faction", "$players_kingdom"),
  5832.  
  5833. -                   (call_script, "script_add_notification_menu", "mnu_notification_lord_defects", ":troop_no", ":faction"),
  5834.  
  5835. -               (try_end),             
  5836.  
  5837. -           (else_try),
  5838.  
  5839. -               (neq, ":faction_leader", "trp_player"),
  5840.  
  5841. -               (call_script, "script_indict_lord_for_treason", ":troop_no", ":faction"),
  5842.  
  5843. -           (try_end),       
  5844.  
  5845. -       (else_try),  #Take a stand on an issue
  5846.  
  5847. -           (neq, ":troop_no", "trp_player"),
  5848.  
  5849. -           (store_faction_of_troop, ":faction", ":troop_no"),
  5850.  
  5851. -          
  5852.  
  5853. -           (faction_slot_ge, ":faction", slot_faction_political_issue, 1),
  5854.  
  5855. +          (call_script, "script_troop_get_relation_with_troop", ":troop_no", ":faction_leader"),
  5856.  
  5857. +          (le, reg0, -50), #was -75
  5858.  
  5859.  
  5860.  
  5861. -           #This bit of complication is needed for savegame compatibility -- if zero is in the slot, they'll choose anyway        
  5862.  
  5863. -           (neg|troop_slot_ge, ":troop_no", slot_troop_stance_on_faction_issue, 1),
  5864.  
  5865. +          (call_script, "script_cf_troop_can_intrigue", ":troop_no", 0), #Should include battle, prisoner, in a castle with others
  5866.  
  5867. +          (store_random_in_range, ":who_moves_first", 0, 2),
  5868.  
  5869.            
  5870.  
  5871. -           (this_or_next|troop_slot_eq, ":troop_no", slot_troop_stance_on_faction_issue, -1),
  5872.  
  5873. -               (neq, "$players_kingdom", ":faction"),
  5874.  
  5875. +          (try_begin),
  5876.  
  5877. +            (neq, ":who_moves_first", 0),
  5878.  
  5879. +            (neq, ":troop_no", "trp_player"),
  5880.  
  5881.                
  5882.  
  5883. -           (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
  5884.  
  5885. -          
  5886.  
  5887. -           (call_script, "script_npc_decision_checklist_take_stand_on_issue", ":troop_no"),
  5888.  
  5889. -           (troop_set_slot, ":troop_no", slot_troop_stance_on_faction_issue, reg0),
  5890.  
  5891. +            #do a defection
  5892.  
  5893. +           (assign, "$g_give_advantage_to_original_faction", 1),            
  5894.  
  5895. +           (store_faction_of_troop, ":orig_faction", ":troop_no"),
  5896.  
  5897. +           (call_script, "script_lord_find_alternative_faction", ":troop_no"),
  5898.  
  5899. +           (assign, ":new_faction", reg0),        
  5900.  
  5901. +           (assign, "$g_give_advantage_to_original_faction", 0),
  5902.  
  5903. +           (try_begin),
  5904.  
  5905. +             (neq, ":new_faction", ":orig_faction"),            
  5906.  
  5907. +            
  5908.  
  5909. +              (is_between, ":new_faction", kingdoms_begin, kingdoms_end),
  5910.  
  5911. +              (str_store_troop_name_link, s1, ":troop_no"),
  5912.  
  5913. +              (str_store_faction_name_link, s2, ":new_faction"),  
  5914.  
  5915. +              (str_store_faction_name_link, s3, ":faction"),
  5916.  
  5917. +              (call_script, "script_change_troop_faction", ":troop_no", ":new_faction"),
  5918.  
  5919. +              (try_begin),
  5920.  
  5921. +                (ge, "$cheat_mode", 1),
  5922.  
  5923. +                (str_store_troop_name, s4, ":troop_no"),
  5924.  
  5925. +                (display_message, "@{!}DEBUG - {s4} faction changed in defection"),
  5926.  
  5927. +              (try_end),  
  5928.  
  5929. +              (troop_get_type, reg4, ":troop_no"),
  5930.  
  5931. +              (str_store_string, s4, "str_lord_defects_ordinary"),
  5932.  
  5933. +              (display_log_message, "@{!}{s4}"),
  5934.  
  5935. +              (try_begin),
  5936.  
  5937. +                (eq, "$cheat_mode", 1),
  5938.  
  5939. +                (this_or_next|eq, ":new_faction", "$players_kingdom"),
  5940.  
  5941. +                (eq, ":faction", "$players_kingdom"),
  5942.  
  5943. +                (call_script, "script_add_notification_menu", "mnu_notification_lord_defects", ":troop_no", ":faction"),
  5944.  
  5945. +              (try_end),              
  5946.  
  5947. +           (try_end),
  5948.  
  5949. +          (else_try)
  5950.  
  5951. +            (neq, ":faction_leader", "trp_player"),
  5952.  
  5953. +           (call_script, "script_troop_get_relation_with_troop", ":troop_no", ":faction_leader"),
  5954.  
  5955. +           (le, reg0, -75),
  5956.  
  5957. +            (call_script, "script_indict_lord_for_treason", ":troop_no", ":faction"),
  5958.  
  5959. +          (try_end),        
  5960.  
  5961. +        (else_try),  #Take a stand on an issue
  5962.  
  5963. +          (neq, ":troop_no", "trp_player"),
  5964.  
  5965. +          (store_faction_of_troop, ":faction", ":troop_no"),
  5966.  
  5967. +          (faction_slot_ge, ":faction", slot_faction_political_issue, 1),
  5968.  
  5969. +          #This bit of complication is needed for savegame compatibility -- if zero is in the slot, they'll choose anyway         
  5970.  
  5971. +          (neg|troop_slot_ge, ":troop_no", slot_troop_stance_on_faction_issue, 1),
  5972.  
  5973. +          (this_or_next|troop_slot_eq, ":troop_no", slot_troop_stance_on_faction_issue, -1),
  5974.  
  5975. +          (neq, "$players_kingdom", ":faction"),
  5976.  
  5977. +          (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
  5978.  
  5979. +          (call_script, "script_npc_decision_checklist_take_stand_on_issue", ":troop_no"),
  5980.  
  5981. +          (troop_set_slot, ":troop_no", slot_troop_stance_on_faction_issue, reg0),
  5982.  
  5983.          (try_end),
  5984.  
  5985.  
  5986.  
  5987. -       (try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
  5988.  
  5989. -           (call_script, "script_troop_get_relation_with_troop", ":troop_no", ":active_npc"),
  5990.  
  5991. -           (lt, reg0, 0),
  5992.  
  5993. -           (assign, ":relation", reg0),
  5994.  
  5995. -           (store_sub, ":chance_of_convergence", 0, ":relation"),
  5996.  
  5997. -           (store_random_in_range, ":random", 0, 300),
  5998.  
  5999. -           (lt, ":random", ":chance_of_convergence"),
  6000.  
  6001. -           (call_script, "script_troop_change_relation_with_troop", ":troop_no", ":active_npc", 1),
  6002.  
  6003. -           (val_add, "$total_relation_changes_through_convergence", 1),
  6004.  
  6005. -       (try_end),             
  6006.  
  6007. +        (try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
  6008.  
  6009. +          (call_script, "script_troop_get_relation_with_troop", ":troop_no", ":active_npc"),
  6010.  
  6011. +          (lt, reg0, 0),
  6012.  
  6013. +          (assign, ":relation", reg0),
  6014.  
  6015. +          (store_sub, ":chance_of_convergence", 0, ":relation"),
  6016.  
  6017. +          (store_random_in_range, ":random", 0, 300),
  6018.  
  6019. +          (lt, ":random", ":chance_of_convergence"),
  6020.  
  6021. +          (call_script, "script_troop_change_relation_with_troop", ":troop_no", ":active_npc", 1),
  6022.  
  6023. +          (val_add, "$total_relation_changes_through_convergence", 1),
  6024.  
  6025. +        (try_end),            
  6026.  
  6027.          ]),
  6028.  
  6029.    
  6030.  
  6031.  #TEMPORARILY DISABLED, AS READINESS IS NOW A PRODUCT OF NPC_DECISION_CHECKLIST
  6032.  
  6033. @@ -1308,12 +1302,10 @@ simple_triggers = [
  6034.      (try_begin),
  6035.  
  6036.         (ge, "$cheat_mode", 1),
  6037.  
  6038.    
  6039.  
  6040. -       (try_for_range, ":king", "trp_kingdom_1_lord", "trp_knight_1_1"),
  6041.  
  6042. -      
  6043.  
  6044. +       (try_for_range, ":king", "trp_kingdom_1_lord", "trp_knight_1_1"),      
  6045.  
  6046.             (store_add, ":proper_faction", ":king", "fac_kingdom_1"),
  6047.  
  6048.             (val_sub, ":proper_faction", "trp_kingdom_1_lord"),
  6049.  
  6050.             (store_faction_of_troop, ":actual_faction", ":king"),
  6051.  
  6052. -
  6053.  
  6054.            
  6055.  
  6056.             (neq, ":proper_faction", ":actual_faction"),
  6057.  
  6058.             (neq, ":actual_faction", "fac_commoners"),
  6059.  
  6060. @@ -1327,7 +1319,7 @@ simple_triggers = [
  6061.  #          (display_message, "@{s65}"),
  6062.  
  6063.             (rest_for_hours, 0, 0, 0),
  6064.  
  6065.            
  6066.  
  6067. -           (assign, "$cheat_mode", 1),
  6068.  
  6069. +           #(assign, "$cheat_mode", 1),
  6070.  
  6071.             (jump_to_menu, "mnu_debug_alert_from_s65"),
  6072.  
  6073.         (try_end),
  6074.  
  6075.    
  6076.  
  6077. @@ -1379,7 +1371,7 @@ simple_triggers = [
  6078.      ]),
  6079.  
  6080.  
  6081.  
  6082.    # Refresh merchant inventories
  6083.  
  6084. -   (24,
  6085.  
  6086. +   (72,
  6087.  
  6088.     [
  6089.  
  6090.        (try_for_range, ":village_no", villages_begin, villages_end),
  6091.  
  6092.          (call_script, "script_refresh_village_merchant_inventory", ":village_no"),
  6093.  
  6094. @@ -1835,6 +1827,9 @@ simple_triggers = [
  6095.     [
  6096.  
  6097.         (try_for_range, ":troop_no", active_npcs_begin, active_npcs_end),
  6098.  
  6099.           (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
  6100.  
  6101. +
  6102.  
  6103. +         (str_store_troop_name, s1, ":troop_no"),
  6104.  
  6105. +      
  6106.  
  6107.           (neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
  6108.  
  6109.           (neg|troop_slot_ge, ":troop_no", slot_troop_leaded_party, 1),
  6110.  
  6111.  
  6112.  
  6113. @@ -1852,14 +1847,18 @@ simple_triggers = [
  6114.             (assign, ":center_no", reg0),
  6115.  
  6116.  
  6117.  
  6118.             (try_begin),
  6119.  
  6120. -             (eq, "$cheat_mode", 2),
  6121.  
  6122. -             (assign, reg7, ":center_no"),
  6123.  
  6124. +             (eq, "$cheat_mode", 2),            
  6125.  
  6126.               (str_store_party_name, s7, ":center_no"),
  6127.  
  6128. +            (str_store_troop_name, s0, ":troop_no"),
  6129.  
  6130.               (display_message, "str_debug__s0_is_spawning_around_party__s7"),
  6131.  
  6132.             (try_end),
  6133.  
  6134.        
  6135.  
  6136.             (call_script, "script_create_kingdom_hero_party", ":troop_no", ":center_no"),
  6137.  
  6138. -           (party_attach_to_party, "$pout_party", ":center_no"),
  6139.  
  6140. +
  6141.  
  6142. +          (try_begin),
  6143.  
  6144. +            (eq, "$g_there_is_no_avaliable_centers", 0),
  6145.  
  6146. +             (party_attach_to_party, "$pout_party", ":center_no"),
  6147.  
  6148. +           (try_end),
  6149.  
  6150.            
  6151.  
  6152.             #new
  6153.  
  6154.             #(troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
  6155.  
  6156. @@ -2040,7 +2039,7 @@ simple_triggers = [
  6157.             (eq, ":cur_center", ":home_center"),
  6158.  
  6159.            
  6160.  
  6161.            #Peasants trade in their home center
  6162.  
  6163. -          (call_script, "script_do_party_center_trade", ":party_no", ":home_center", price_adjustment), #this needs to be the same as the center          
  6164.  
  6165. +          (call_script, "script_do_party_center_trade", ":party_no", ":home_center", 4), #this needs to be the same as the center         
  6166.  
  6167.            (store_faction_of_party, ":center_faction", ":cur_center"),
  6168.  
  6169.             (party_set_faction, ":party_no", ":center_faction"),                   
  6170.  
  6171.             (party_get_slot, ":market_town", ":home_center", slot_village_market_town),
  6172.  
  6173. @@ -2053,7 +2052,7 @@ simple_triggers = [
  6174.               (party_get_slot, ":cur_ai_object", ":party_no", slot_party_ai_object),
  6175.  
  6176.               (eq, ":cur_center", ":cur_ai_object"),
  6177.  
  6178.  
  6179.  
  6180. -             (call_script, "script_do_party_center_trade", ":party_no", ":cur_ai_object", price_adjustment), #raised from 10
  6181.  
  6182. +             (call_script, "script_do_party_center_trade", ":party_no", ":cur_ai_object", 4), #raised from 10
  6183.  
  6184.               (assign, ":total_change", reg0),
  6185.  
  6186.              #This is roughly 50% of what a caravan would pay
  6187.  
  6188.              
  6189.  
  6190. @@ -2088,7 +2087,7 @@ simple_triggers = [
  6191.               #Adding 1 to village prosperity
  6192.  
  6193.               (try_begin),
  6194.  
  6195.                 (store_random_in_range, ":rand", 0, 100),
  6196.  
  6197. -               (lt, ":rand", 35),
  6198.  
  6199. +               (lt, ":rand", 5), #was 35
  6200.  
  6201.                 (call_script, "script_change_center_prosperity", ":home_center", 1),
  6202.  
  6203.                (val_add, "$newglob_total_prosperity_from_village_trade", 1),
  6204.  
  6205.               (try_end),
  6206.  
  6207. diff -rupBN Module_system 1.134//module_triggers.py Module_system 1.142//module_triggers.py
  6208. --- Module_system 1.134//module_triggers.py 2010-09-28 18:42:26.000000000 -0700
  6209. +++ Module_system 1.142//module_triggers.py 2011-07-01 13:58:04.000000000 -0700
  6210. @@ -32,138 +32,29 @@ triggers = [
  6211.  # Tutorial:
  6212.  
  6213.    (0.1, 0, ti_once, [(map_free,0)], [(dialog_box,"str_tutorial_map1")]),
  6214.  
  6215.  
  6216.  
  6217. -#  (1.0, 0, ti_once, [(map_free,0)], [(start_map_conversation, "trp_guide", -1)]),
  6218.  
  6219. -
  6220.  
  6221.  # Refresh Merchants
  6222.  
  6223. -  (0.0, 0, 24.0, [], [
  6224.  
  6225. -                      (reset_item_probabilities,100),
  6226.  
  6227. -                      (set_merchandise_modifier_quality,150),
  6228.  
  6229. -
  6230.  
  6231. -
  6232.  
  6233. -                      (reset_item_probabilities,100),(set_item_probability_in_merchandise,"itm_salt",700),
  6234.  
  6235. -                      (troop_add_merchandise,"trp_salt_mine_merchant",itp_type_goods,num_merchandise_goods),
  6236.  
  6237. -
  6238.  
  6239. -                      # Add trade goods to merchant inventories
  6240.  
  6241. -#                      (store_sub, ":item_to_production_slot", slot_town_trade_good_productions_begin, trade_goods_begin),
  6242.  
  6243. -                      (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
  6244.  
  6245. -
  6246.  
  6247. -                      (try_for_range,":cur_center",towns_begin,towns_end),
  6248.  
  6249. -                        (party_get_slot,":cur_merchant",":cur_center",slot_town_merchant),
  6250.  
  6251. -                        (reset_item_probabilities,100),
  6252.  
  6253. -                        (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
  6254.  
  6255. -#                          (store_add, ":cur_production_slot", ":cur_goods", ":item_to_production_slot"),
  6256.  
  6257. -                          (store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"),
  6258.  
  6259. -#                          (party_get_slot, ":cur_production", ":cur_center", ":cur_production_slot"),
  6260.  
  6261. -                          (party_get_slot, ":cur_price", ":cur_center", ":cur_price_slot"),
  6262.  
  6263. -                      
  6264.  
  6265. -#                          (assign, ":cur_probability", 100),
  6266.  
  6267. -#                          (store_add, ":cur_production", 100, ":cur_production"),
  6268.  
  6269. -#                          (val_mul, ":cur_probability", ":cur_production"),
  6270.  
  6271. -#                          (val_div, ":cur_probability", 100),
  6272.  
  6273. -#                          (try_begin),
  6274.  
  6275. -#                            (gt, ":cur_probability", 100),
  6276.  
  6277. -#                            (store_sub, ":temp_dif", ":cur_probability", 100),
  6278.  
  6279. -#                            (val_mul, ":temp_dif", 4),
  6280.  
  6281. -#                            (val_add, ":cur_probability", ":temp_dif"),
  6282.  
  6283. -#                          (try_end),
  6284.  
  6285. -#                          (store_sub, ":temp_dif", average_price_factor, ":cur_price"),
  6286.  
  6287. -#                          (val_div, ":temp_dif", 2),
  6288.  
  6289. -#                          (val_add, ":cur_price", ":temp_dif"),
  6290.  
  6291. -
  6292.  
  6293. -                         (call_script, "script_center_get_production", ":cur_center", ":cur_goods"),
  6294.  
  6295. -                         (assign, ":cur_probability", reg0),
  6296.  
  6297. -                         (call_script, "script_center_get_consumption", ":cur_center", ":cur_goods"),
  6298.  
  6299. -                         (val_add, ":cur_probability", reg0),
  6300.  
  6301. -                        
  6302.  
  6303. -                         (val_mul, ":cur_probability", 4),
  6304.  
  6305. -
  6306.  
  6307. -
  6308.  
  6309. -                          (val_mul, ":cur_probability", average_price_factor),
  6310.  
  6311. -                          (val_div, ":cur_probability", ":cur_price"),
  6312.  
  6313. -                          (val_mul, ":cur_probability", average_price_factor),
  6314.  
  6315. -                          (val_div, ":cur_probability", ":cur_price"),
  6316.  
  6317. -                          (val_mul, ":cur_probability", average_price_factor),
  6318.  
  6319. -                          (val_div, ":cur_probability", ":cur_price"),
  6320.  
  6321. -#                          (val_mul, ":cur_probability", average_price_factor),
  6322.  
  6323. -#                          (val_div, ":cur_probability", ":cur_price"),
  6324.  
  6325. -                          (set_item_probability_in_merchandise,":cur_goods",":cur_probability"),
  6326.  
  6327. -                        (try_end),
  6328.  
  6329. -                        (troop_add_merchandise,":cur_merchant",itp_type_goods,num_merchandise_goods),
  6330.  
  6331. -
  6332.  
  6333. -                        (troop_ensure_inventory_space,":cur_merchant",merchant_inventory_space),
  6334.  
  6335. -                        (troop_sort_inventory, ":cur_merchant"),
  6336.  
  6337. -                        (store_troop_gold, ":cur_gold",":cur_merchant"),
  6338.  
  6339. -                        (lt,":cur_gold",1500),
  6340.  
  6341. -                        (store_random_in_range,":new_gold",500,1000),
  6342.  
  6343. -                        (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
  6344.  
  6345. -                      (try_end),
  6346.  
  6347. -                     ]),
  6348.  
  6349. +  (0.0, 0, 72.0, [],
  6350.  
  6351. +  [    
  6352.  
  6353. +    (call_script, "script_refresh_center_inventories"),
  6354.  
  6355. +  ]),
  6356.  
  6357.  
  6358.  
  6359.  # Refresh Armor sellers
  6360.  
  6361. -  (0.0, 0, 24.0, [], [
  6362.  
  6363. -                      (reset_item_probabilities,100),
  6364.  
  6365. -                      (set_merchandise_modifier_quality,150),
  6366.  
  6367. -                      (try_for_range,reg(2),armor_merchants_begin,armor_merchants_end),
  6368.  
  6369. -                        (store_sub, ":cur_town", reg2, armor_merchants_begin),
  6370.  
  6371. -                        (val_add, ":cur_town", towns_begin),
  6372.  
  6373. -                        (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
  6374.  
  6375. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_body_armor,16),
  6376.  
  6377. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_head_armor,16),
  6378.  
  6379. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_foot_armor,8),
  6380.  
  6381. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_hand_armor,4),
  6382.  
  6383. -                        (troop_ensure_inventory_space,reg(2),merchant_inventory_space),
  6384.  
  6385. -                        (troop_sort_inventory, reg(2)),
  6386.  
  6387. -                        (store_troop_gold, reg(6),reg(2)),
  6388.  
  6389. -                        (lt,reg(6),900),
  6390.  
  6391. -                        (store_random_in_range,":new_gold",200,400),
  6392.  
  6393. -                        (call_script, "script_troop_add_gold", reg(2), ":new_gold"),
  6394.  
  6395. -                      (end_try,0),
  6396.  
  6397. -                     ]),
  6398.  
  6399. -
  6400.  
  6401. +  (0.0, 0, 72.0, [],
  6402.  
  6403. +  [    
  6404.  
  6405. +    (call_script, "script_refresh_center_armories"),
  6406.  
  6407. +  ]),
  6408.  
  6409.  
  6410.  
  6411.  # Refresh Weapon sellers
  6412.  
  6413. -  (0.0, 0, 24.0, [], [
  6414.  
  6415. -                      (reset_item_probabilities,100),
  6416.  
  6417. -                      (set_merchandise_modifier_quality,150),
  6418.  
  6419. -                      (try_for_range,reg(2),weapon_merchants_begin,weapon_merchants_end),
  6420.  
  6421. -                        (store_sub, ":cur_town", reg2, weapon_merchants_begin),
  6422.  
  6423. -                        (val_add, ":cur_town", towns_begin),
  6424.  
  6425. -                        (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
  6426.  
  6427. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_one_handed_wpn,5),
  6428.  
  6429. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_two_handed_wpn,5),
  6430.  
  6431. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_polearm,5),
  6432.  
  6433. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_shield,6),
  6434.  
  6435. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_bow,4),
  6436.  
  6437. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_crossbow,3),
  6438.  
  6439. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_thrown,5),
  6440.  
  6441. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_arrows,2),
  6442.  
  6443. -                        (troop_add_merchandise_with_faction,reg(2), ":cur_faction",itp_type_bolts,2),
  6444.  
  6445. -                        (troop_ensure_inventory_space,reg(2),merchant_inventory_space),
  6446.  
  6447. -                        (troop_sort_inventory, reg(2)),
  6448.  
  6449. -                        (store_troop_gold, reg(6),reg(2)),
  6450.  
  6451. -                        (lt,reg(6),900),
  6452.  
  6453. -                        (store_random_in_range,":new_gold",200,400),
  6454.  
  6455. -                      (call_script, "script_troop_add_gold", reg(2), ":new_gold"),
  6456.  
  6457. -                      (end_try,0),
  6458.  
  6459. -                     ]),
  6460.  
  6461. +  (0.0, 0, 72.0, [],
  6462.  
  6463. +  [
  6464.  
  6465. +    (call_script, "script_refresh_center_weaponsmiths"),
  6466.  
  6467. +  ]),
  6468.  
  6469.  
  6470.  
  6471.  # Refresh Horse sellers
  6472.  
  6473. -  (0.0, 0, 24.0, [], [
  6474.  
  6475. -                      (reset_item_probabilities,100),
  6476.  
  6477. -                      (set_merchandise_modifier_quality,150),
  6478.  
  6479. -                      (try_for_range,":cur_merchant",horse_merchants_begin,horse_merchants_end),
  6480.  
  6481. -                        (store_sub, ":cur_town", ":cur_merchant", horse_merchants_begin),
  6482.  
  6483. -                        (val_add, ":cur_town", towns_begin),
  6484.  
  6485. -                        (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
  6486.  
  6487. -                        (troop_add_merchandise_with_faction,":cur_merchant", ":cur_faction",itp_type_horse,5),
  6488.  
  6489. -                        (troop_ensure_inventory_space,":cur_merchant",65),
  6490.  
  6491. -                        (troop_sort_inventory, ":cur_merchant"),
  6492.  
  6493. -                        (store_troop_gold, ":cur_gold",":cur_merchant"),
  6494.  
  6495. -                        (lt,":cur_gold",600),
  6496.  
  6497. -                        (store_random_in_range,":new_gold",200,400),
  6498.  
  6499. -                        (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
  6500.  
  6501. -                      (try_end),
  6502.  
  6503. -                     ]),
  6504.  
  6505. +  (0.0, 0, 72.0, [],
  6506.  
  6507. +  [
  6508.  
  6509. +    (call_script, "script_refresh_center_stables"),
  6510.  
  6511. +  ]),
  6512.  
  6513.    
  6514.  
  6515.  
  6516.  
  6517.  #############
  6518.  
  6519. @@ -1338,7 +1229,7 @@ triggers = [
  6520.                     (eq, ":cur_eliminated_by_player", "$qst_troublesome_bandits_eliminated_by_player"),
  6521.  
  6522.                     ],
  6523.  
  6524.                    [(display_message, "str_bandits_eliminated_by_another"),
  6525.  
  6526. -                   (call_script, "script_abort_quest", "qst_troublesome_bandits", 2),
  6527.  
  6528. +                   (call_script, "script_abort_quest", "qst_troublesome_bandits", 0),
  6529.  
  6530.                     ]),
  6531.  
  6532.  
  6533.  
  6534.    (0.3, 0.0, 1.1, [(check_quest_active, "qst_troublesome_bandits"),
  6535.  
  6536. @@ -1603,10 +1494,27 @@ triggers = [
  6537.      ]),
  6538.  
  6539.  
  6540.  
  6541.  
  6542.  
  6543. -
  6544.  
  6545. -
  6546.  
  6547.  #NPC system changes end
  6548.  
  6549.  
  6550.  
  6551. +# Lady of the lake achievement
  6552.  
  6553. +   (1, 0, 0,
  6554.  
  6555. +   [
  6556.  
  6557. +     (troop_get_type, ":is_female", "trp_player"),
  6558.  
  6559. +     (eq, ":is_female", 1),      
  6560.  
  6561. +     (try_for_range, ":companion", companions_begin, companions_end),
  6562.  
  6563. +       (troop_slot_eq, ":companion", slot_troop_occupation, slto_player_companion),
  6564.  
  6565. +       (troop_inventory_slot_get_item_amount, ":num_great_sword", ":companion", "itm_great_sword"),
  6566.  
  6567. +       (troop_inventory_slot_get_item_amount, ":num_sword_two_handed_a", ":companion", "itm_sword_two_handed_a"),
  6568.  
  6569. +       (troop_inventory_slot_get_item_amount, ":num_strange_great_sword", ":companion", "itm_strange_great_sword"),
  6570.  
  6571. +       (this_or_next|ge, ":num_great_sword", 1),
  6572.  
  6573. +       (this_or_next|ge, ":num_sword_two_handed_a", 1),
  6574.  
  6575. +       (ge, ":num_strange_great_sword", 1),
  6576.  
  6577. +       (unlock_achievement, ACHIEVEMENT_LADY_OF_THE_LAKE),
  6578.  
  6579. +     (try_end),
  6580.  
  6581. +    ],
  6582.  
  6583. +   []
  6584.  
  6585. +   ),
  6586.  
  6587. +
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.  
  6594.  
  6595. diff -rupBN Module_system 1.134//module_troops.py Module_system 1.142//module_troops.py
  6596. --- Module_system 1.134//module_troops.py   2010-12-07 15:53:24.000000000 -0800
  6597. +++ Module_system 1.142//module_troops.py   2011-05-23 13:37:40.000000000 -0700
  6598. @@ -547,19 +547,19 @@ troops = [
  6599.      itm_shirt,itm_coarse_tunic,itm_wrapping_boots,itm_nomad_boots,itm_head_wrappings,itm_straw_hat],
  6600.  
  6601.     def_attrib|level(4),wp(55),knows_common|knows_power_draw_2|knows_ironflesh_1,rhodok_face_younger_1, rhodok_face_old_2],
  6602.  
  6603.    ["rhodok_spearman","Rhodok Spearman","Rhodok Spearmen",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_kingdom_5,
  6604.  
  6605. -   [itm_spear,itm_spear,itm_tab_shield_pavise_a,itm_falchion,
  6606.  
  6607. +   [itm_spear,itm_pike,itm_spear,itm_tab_shield_pavise_a,itm_falchion,
  6608.  
  6609.      itm_felt_hat_b,itm_common_hood,itm_leather_armor,itm_arena_tunic_green,itm_wrapping_boots,itm_nomad_boots],
  6610.  
  6611.     def_attrib|level(9),wp(80),knows_common|knows_ironflesh_2|knows_shield_1|knows_power_strike_2|knows_athletics_1,rhodok_face_young_1, rhodok_face_old_2],
  6612.  
  6613.    ["rhodok_trained_spearman","Rhodok Trained Spearman","Rhodok Trained Spearmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_kingdom_5,
  6614.  
  6615. -   [itm_pike,itm_military_fork,itm_war_spear,itm_tab_shield_pavise_b,
  6616.  
  6617. +   [itm_pike,itm_war_spear,itm_tab_shield_pavise_b,
  6618.  
  6619.      itm_footman_helmet,itm_padded_coif,itm_aketon_green,itm_aketon_green,itm_ragged_outfit,itm_nomad_boots,itm_leather_boots],
  6620.  
  6621.     def_attrib|level(14),wp_one_handed (105) | wp_two_handed (105) | wp_polearm (115) | wp_archery (105) | wp_crossbow (105) | wp_throwing (105),knows_common|knows_ironflesh_3|knows_shield_2|knows_power_strike_2|knows_athletics_2,rhodok_face_young_1, rhodok_face_older_2],
  6622.  
  6623.    ["rhodok_veteran_spearman","Rhodok Veteran Spearman","Rhodok Veteran Spearmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_shield,0,0,fac_kingdom_5,
  6624.  
  6625. -   [itm_ashwood_pike,itm_battle_fork,itm_military_scythe,itm_tab_shield_pavise_c,
  6626.  
  6627. +   [itm_ashwood_pike,itm_glaive,itm_tab_shield_pavise_c,
  6628.  
  6629.      itm_kettle_hat,itm_mail_coif,itm_mail_with_tunic_green,itm_leather_boots,itm_splinted_leather_greaves,itm_leather_gloves],
  6630.  
  6631.     def_attrib|level(19),wp_one_handed (115) | wp_two_handed (115) | wp_polearm (130) | wp_archery (115) | wp_crossbow (115) | wp_throwing (115),knows_common|knows_ironflesh_5|knows_shield_3|knows_power_strike_4|knows_athletics_3,rhodok_face_young_1, rhodok_face_older_2],
  6632.  
  6633.    ["rhodok_sergeant","Rhodok Sergeant","Rhodok Sergeants",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_shield|tf_guarantee_gloves,0,0,fac_kingdom_5,
  6634.  
  6635. -   [itm_glaive,itm_military_hammer,itm_bec_de_corbin_a,itm_bec_de_corbin_a,itm_military_cleaver_c,itm_tab_shield_pavise_d,
  6636.  
  6637. +   [itm_glaive,itm_military_hammer,itm_military_cleaver_c,itm_tab_shield_pavise_d,
  6638.  
  6639.      itm_full_helm, itm_bascinet_3,itm_bascinet_2,itm_surcoat_over_mail,itm_surcoat_over_mail,itm_heraldic_mail_with_surcoat,itm_mail_chausses,itm_leather_gloves,itm_mail_mittens],
  6640.  
  6641.     def_attrib|level(25),wp_one_handed (130) | wp_two_handed (115) | wp_polearm (155) | wp_archery (115) | wp_crossbow (115) | wp_throwing (115),knows_common|knows_ironflesh_6|knows_shield_5|knows_power_strike_5|knows_athletics_5,rhodok_face_middle_1, rhodok_face_older_2],
  6642.  
  6643.    ["rhodok_crossbowman","Rhodok Crossbowman","Rhodok Crossbowmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_ranged,0,0,fac_kingdom_5,
  6644.  
  6645. @@ -602,11 +602,11 @@ troops = [
  6646.      itm_skirmisher_armor,itm_turban,itm_sarranid_boots_a,itm_sarranid_boots_b],
  6647.  
  6648.     def_attrib|level(9),wp(75),knows_common|knows_athletics_2,swadian_face_young_1, swadian_face_old_2],
  6649.  
  6650.   ["sarranid_veteran_footman","Sarranid Veteran Footman","Sarranid Veteran Footmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_kingdom_6,
  6651.  
  6652. -   [itm_bamboo_spear,itm_sarranid_mail_coif,itm_arabian_sword_a,itm_arabian_sword_b,itm_tab_shield_kite_b,
  6653.  
  6654. -    itm_sarranid_boots_b,itm_sarranid_leather_armor,itm_jarid,itm_arabian_sword_a,itm_mace_3],
  6655.  
  6656. +   [itm_bamboo_spear,itm_arabian_sword_a,itm_arabian_sword_b,itm_tab_shield_kite_b,
  6657.  
  6658. +    itm_sarranid_boots_b,itm_sarranid_warrior_cap,itm_sarranid_leather_armor,itm_jarid,itm_arabian_sword_a,itm_mace_3],
  6659.  
  6660.     def_attrib|level(14),wp_one_handed (85) | wp_two_handed (85) | wp_polearm (85) | wp_archery (75) | wp_crossbow (75) | wp_throwing (100),knows_common|knows_athletics_2|knows_power_throw_2|knows_ironflesh_1|knows_shield_2,swadian_face_young_1, swadian_face_old_2],
  6661.  
  6662.   ["sarranid_infantry","Sarranid Infantry","Sarranid Infantries",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_kingdom_6,
  6663.  
  6664. -   [itm_sarranid_mail_shirt,itm_sarranid_warrior_cap,itm_jarid,itm_sarranid_boots_c,itm_sarranid_boots_b,itm_sarranid_axe_a,itm_arabian_sword_b,itm_mace_3,itm_spear,itm_tab_shield_kite_c],
  6665.  
  6666. +   [itm_sarranid_mail_shirt,itm_sarranid_mail_coif,itm_jarid,itm_sarranid_boots_c,itm_sarranid_boots_b,itm_sarranid_axe_a,itm_arabian_sword_b,itm_mace_3,itm_spear,itm_tab_shield_kite_c],
  6667.  
  6668.     def_attrib|level(20),wp_one_handed (105) | wp_two_handed (105) | wp_polearm (105) | wp_archery (75) | wp_crossbow (75) | wp_throwing (110),knows_common|knows_riding_3|knows_ironflesh_2|knows_shield_3 | knows_power_throw_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
  6669.  
  6670.   ["sarranid_guard","Sarranid Guard","Sarranid Guards",tf_mounted|tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_kingdom_6,
  6671.  
  6672.     [itm_military_pick,itm_sarranid_two_handed_axe_a,itm_jarid,itm_scimitar_b,itm_war_spear,itm_mace_4,itm_sarranid_boots_d, itm_sarranid_boots_c,itm_arabian_armor_b,itm_sarranid_mail_coif,itm_sarranid_veiled_helmet,itm_mail_mittens,itm_leather_gloves,itm_tab_shield_kite_d],
  6673.  
  6674. @@ -615,11 +615,11 @@ troops = [
  6675.     [itm_turban,itm_desert_turban,itm_skirmisher_armor,itm_jarid,itm_jarid,itm_arabian_sword_a,itm_spiked_club,itm_tab_shield_small_round_a,itm_sarranid_warrior_cap,itm_sarranid_boots_a],
  6676.  
  6677.     def_attrib|level(14),wp(80),knows_common|knows_riding_2|knows_power_throw_2|knows_ironflesh_1|knows_athletics_3,swadian_face_young_1, swadian_face_middle_2],
  6678.  
  6679.   ["sarranid_archer","Sarranid Archer","Sarranid Archers",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_kingdom_6,
  6680.  
  6681. -   [itm_arrows,itm_nomad_bow,itm_nomad_bow,itm_nomad_bow,itm_arabian_sword_a,itm_archers_vest,itm_jarid ,itm_sarranid_boots_b,itm_sarranid_helmet1,itm_turban,itm_desert_turban],
  6682.  
  6683. +   [itm_arrows,itm_arrows,itm_nomad_bow,itm_arabian_sword_a,itm_archers_vest,itm_sarranid_boots_b,itm_sarranid_helmet1,itm_sarranid_warrior_cap,itm_turban,itm_desert_turban],
  6684.  
  6685.     def_attrib|level(19),wp_one_handed (90) | wp_two_handed (90) | wp_polearm (90) | wp_archery (100) | wp_crossbow (90) | wp_throwing (100),knows_common|knows_power_draw_3|knows_ironflesh_2|knows_power_throw_3|knows_athletics_4,swadian_face_young_1, swadian_face_old_2],
  6686.  
  6687.   ["sarranid_master_archer","Sarranid Master Archer","Sarranid Master Archers",tf_guarantee_ranged|tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_kingdom_6,
  6688.  
  6689. -   [itm_barbed_arrows,itm_arabian_sword_b,itm_mace_3,itm_strong_bow,itm_nomad_bow,itm_strong_bow,itm_nomad_bow,itm_jarid,
  6690.  
  6691. -    itm_arabian_armor_b,itm_barbed_arrows,itm_sarranid_boots_c,itm_sarranid_boots_b,itm_sarranid_mail_coif],
  6692.  
  6693. +   [itm_barbed_arrows,itm_barbed_arrows,itm_arabian_sword_b,itm_mace_3,itm_strong_bow,itm_nomad_bow,
  6694.  
  6695. +    itm_arabian_armor_b,itm_sarranid_boots_c,itm_sarranid_boots_b,itm_sarranid_mail_coif],
  6696.  
  6697.     str_14 | agi_5 | int_4 | cha_4|level(24),wp_one_handed (100) | wp_two_handed (100) | wp_polearm (100) | wp_archery (130) | wp_crossbow (100) | wp_throwing (130),knows_common|knows_power_draw_4|knows_power_throw_4|knows_ironflesh_3|knows_athletics_5,swadian_face_middle_1, swadian_face_older_2],
  6698.  
  6699.   ["sarranid_horseman","Sarranid Horseman","Sarranid Horsemen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_kingdom_6,
  6700.  
  6701.     [itm_lance,itm_arabian_sword_b,itm_scimitar_b,itm_mace_4,itm_tab_shield_small_round_b,
  6702.  
  6703. @@ -1925,8 +1925,8 @@ troops = [
  6704.     def_attrib|level(19),wp(115),knows_common|knows_ironflesh_5|knows_shield_3|knows_power_strike_4|knows_athletics_3,rhodok_face_young_1, rhodok_face_older_2],
  6705.  
  6706.    ["rhodok_scout_multiplayer_ai","Rhodok Scout","Rhodok Scouts",tf_mounted|tf_guarantee_all,0,0,fac_kingdom_5,
  6707.  
  6708.     #TODO: Change weapons, copied from Nord Scout
  6709.  
  6710. -   [itm_javelin,itm_sword_viking_1,itm_two_handed_axe,itm_spear,itm_tab_shield_round_a,
  6711.  
  6712. -    itm_skullcap,itm_leather_jerkin,itm_leather_boots,itm_saddle_horse],
  6713.  
  6714. +   [itm_sword_medieval_a,itm_tab_shield_heater_cav_a,itm_light_lance,itm_skullcap,itm_aketon_green,
  6715.  
  6716. +    itm_ragged_outfit,itm_nomad_boots,itm_ankle_boots,itm_saddle_horse],
  6717.  
  6718.     def_attrib|level(19),wp(100),knows_riding_5|knows_ironflesh_2|knows_power_strike_2|knows_shield_1|knows_horse_archery_2|knows_power_throw_3,rhodok_face_young_1, rhodok_face_older_2],
  6719.  
  6720.    ["sarranid_infantry_multiplayer_ai","Sarranid Infantry","Sarranid Infantries",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_kingdom_6,
  6721.  
  6722.     [itm_sarranid_mail_shirt,itm_sarranid_horseman_helmet,itm_sarranid_boots_b,itm_sarranid_boots_c,itm_splinted_leather_greaves,itm_arabian_sword_b,itm_mace_3,itm_spear,itm_tab_shield_kite_c],
  6723.  
  6724. diff -rupBN Module_system 1.134//process_dialogs.py Module_system 1.142//process_dialogs.py
  6725. --- Module_system 1.134//process_dialogs.py 2009-12-21 14:51:56.000000000 -0800
  6726. +++ Module_system 1.142//process_dialogs.py 2011-06-01 17:29:44.000000000 -0700
  6727. @@ -66,6 +66,7 @@ def compile_sentence_tokens(sentences):
  6728.    input_tokens = []
  6729.  
  6730.    output_tokens = []
  6731.  
  6732.    dialog_states = ["start","party_encounter","prisoner_liberated","enemy_defeated","party_relieved","event_triggered","close_window","trade","exchange_members", "trade_prisoners","buy_mercenaries","view_char","training","member_chat","prisoner_chat"]
  6733.  
  6734. +  dialog_state_usages = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
  6735.  
  6736.    for sentence in sentences:
  6737.  
  6738.      output_token_id = -1
  6739.  
  6740.      output_token = sentence[opt_token_pos]
  6741.  
  6742. @@ -77,6 +78,7 @@ def compile_sentence_tokens(sentences):
  6743.          break
  6744.  
  6745.      if not found:
  6746.  
  6747.        dialog_states.append(output_token)
  6748.  
  6749. +      dialog_state_usages.append(0)
  6750.  
  6751.        output_token_id = len(dialog_states) - 1
  6752.  
  6753.      output_tokens.append(output_token_id)
  6754.  
  6755.    for sentence in sentences:
  6756.  
  6757. @@ -86,6 +88,7 @@ def compile_sentence_tokens(sentences):
  6758.      for i_t in xrange(len(dialog_states)):
  6759.  
  6760.        if input_token == dialog_states[i_t]:
  6761.  
  6762.          input_token_id = i_t
  6763.  
  6764. +        dialog_state_usages[i_t] = dialog_state_usages[i_t] + 1
  6765.  
  6766.          found = 1
  6767.  
  6768.          break
  6769.  
  6770.      if not found:
  6771.  
  6772. @@ -98,6 +101,9 @@ def compile_sentence_tokens(sentences):
  6773.        print "**********************************************************************************"
  6774.  
  6775.      input_tokens.append(input_token_id)
  6776.  
  6777.    save_dialog_states(dialog_states)
  6778.  
  6779. +  for i_t in xrange(len(dialog_states)):
  6780.  
  6781. +    if dialog_state_usages[i_t] == 0:
  6782.  
  6783. +      print "ERROR: Output token not found: " + dialog_states[i_t]
  6784.  
  6785.    return (input_tokens, output_tokens)
  6786.  
  6787.  
  6788.  
  6789.  def create_auto_id(sentence,auto_ids):
  6790.  
  6791. diff -rupBN Module_system 1.134//variables.txt Module_system 1.142//variables.txt
  6792. --- Module_system 1.134//variables.txt  2010-12-06 12:01:52.000000000 -0800
  6793. +++ Module_system 1.142//variables.txt  2011-06-30 18:28:52.000000000 -0700
  6794. @@ -1202,3 +1202,8 @@ g_multiplayer_duel_start_time
  6795.  love_interest_in_town_7
  6796.  
  6797.  love_interest_in_town_8
  6798.  
  6799.  number_of_controversial_policy_decisions
  6800.  
  6801. +g_production_day_count_for_town
  6802.  
  6803. +g_tribute_amount
  6804.  
  6805. +g_there_is_no_avaliable_centers
  6806.  
  6807. +g_advantegous_faction
  6808.  
  6809. +g_give_advantage_to_original_faction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement